|
| 1 | +--- |
| 2 | +id: DE-090 |
| 3 | +slug: cli_relational_navigation_filters_show_output_and_cross_entity_queries |
| 4 | +name: 'Delta - CLI relational navigation: filters, show output, and cross-entity queries' |
| 5 | +created: '2026-03-12' |
| 6 | +updated: '2026-03-12' |
| 7 | +status: draft |
| 8 | +kind: delta |
| 9 | +aliases: [] |
| 10 | +relations: |
| 11 | +- type: relates_to |
| 12 | + target: PROD-010 |
| 13 | + description: CLI UX improvements for relational navigation |
| 14 | +context_inputs: [] |
| 15 | +applies_to: |
| 16 | + specs: |
| 17 | + - PROD-010 |
| 18 | + - SPEC-110 |
| 19 | + requirements: |
| 20 | + - PROD-010.FR-005 |
| 21 | +--- |
| 22 | + |
| 23 | +# DE-090 – CLI relational navigation: filters, show output, and cross-entity queries |
| 24 | + |
| 25 | +```yaml supekku:delta.relationships@v1 |
| 26 | +schema: supekku.delta.relationships |
| 27 | +version: 1 |
| 28 | +delta: DE-090 |
| 29 | +revision_links: |
| 30 | + introduces: [] |
| 31 | + supersedes: [] |
| 32 | +specs: |
| 33 | + primary: |
| 34 | + - PROD-010 |
| 35 | + collaborators: |
| 36 | + - SPEC-110 |
| 37 | +requirements: |
| 38 | + implements: |
| 39 | + - PROD-010.FR-005 |
| 40 | + updates: [] |
| 41 | + verifies: [] |
| 42 | +phases: [] |
| 43 | +``` |
| 44 | +
|
| 45 | +## 1. Summary & Context |
| 46 | +- **Product Spec(s)**: PROD-010 – CLI UX (reverse relationship queries, filtering) |
| 47 | +- **Technical Spec(s)**: SPEC-110 – supekku/cli Specification |
| 48 | +- **Implementation Plan**: [IP-090](./IP-090.md) |
| 49 | +- **Change Drivers**: Systematic exploration of CLI relational navigation gaps |
| 50 | +
|
| 51 | +## 2. Motivation |
| 52 | +
|
| 53 | +The CLI has good foundational relational filters (`--related-to`, `--implements` |
| 54 | +on `list deltas`; `--spec` on `list requirements/revisions/audits`; `--refs` |
| 55 | +column), but coverage is uneven across entity types. Common governance and |
| 56 | +navigation questions require manual cross-referencing or multi-command pipelines |
| 57 | +that should be single-query operations. |
| 58 | + |
| 59 | +Key pain points: |
| 60 | +- "Which deltas implement this spec?" requires `--related-to` (no `--spec` on deltas) |
| 61 | +- "Which audit covers this delta?" requires name-substring guessing |
| 62 | +- "Which issues relate to this spec?" is not possible |
| 63 | +- "Which completed deltas have no audit?" is not possible |
| 64 | +- `show spec` output is sparse — no relations, requirements, or reverse lookups |
| 65 | +- `show delta` rendered output drops relation types ("- : ISSUE-007") |
| 66 | +- `list backlog --json` strips relational fields that `show issue --json` includes |
| 67 | + |
| 68 | +## 3. Scope & Objectives |
| 69 | + |
| 70 | +### P0 — Bugs |
| 71 | +1. Fix `show delta` relation type display in rendered output |
| 72 | +2. Fix `show spec` to include relations in both rendered and JSON output |
| 73 | +3. Make `list plans` resilient to YAML parse errors (skip + warn) |
| 74 | + |
| 75 | +### P1 — Relational filters (extend existing patterns) |
| 76 | +4. `list audits --delta <ID>` — audits covering a delta |
| 77 | +5. `list revisions --delta <ID>` — revisions from a delta |
| 78 | +6. `list requirements --implemented-by <ID>` — requirements a delta implements |
| 79 | +7. `list deltas --spec <ID>` — deltas touching a spec (dedicated, consistent with revisions/audits) |
| 80 | +8. `list backlog --related-to <ID>` / `list issues --related-to <ID>` — backlog items referencing an entity |
| 81 | + |
| 82 | +### P2 — Richer `show` output |
| 83 | +9. `show spec` should summarise requirements (count + optional list) and show related deltas/revisions/audits |
| 84 | +10. `show delta` should show linked audit(s) and revision(s) via reverse lookup |
| 85 | +11. Consistent JSON schema between `list --json` and `show --json` for backlog items (include relational fields in list output) |
| 86 | + |
| 87 | +### P3 — Governance queries |
| 88 | +12. `list deltas --unaudited` — completed deltas with no associated audit |
| 89 | +13. `list requirements --unimplemented` — requirements with empty `implemented_by` |
| 90 | + |
| 91 | +### P4 — Graph/neighbourhood view |
| 92 | +14. `show <kind> <id> --related` — display all entities referencing or referenced by the target |
| 93 | + |
| 94 | +- **Operational Constraints**: Each priority tier is independently shippable |
| 95 | +- **Dependencies**: None |
| 96 | + |
| 97 | +## 4. Out of Scope |
| 98 | +- TUI relational navigation (already addressed by DE-087) |
| 99 | +- New entity types or schema changes |
| 100 | +- Backlog frontmatter schema enforcement (separate concern) |
| 101 | + |
| 102 | +## 5. Approach Overview |
| 103 | +- **System Touchpoints**: `supekku/scripts/lib/formatters/`, CLI commands in `supekku/cli/`, registries |
| 104 | +- **Key Changes**: |
| 105 | + - Formatter fixes for relation type display and spec show output |
| 106 | + - New filter flags on existing `list` commands using established patterns |
| 107 | + - Reverse-lookup helpers in registries for cross-entity queries |
| 108 | + - `--related` flag on `show` commands for neighbourhood view |
| 109 | + |
| 110 | +## 6. Verification Strategy |
| 111 | +- **Requirements Coverage**: PROD-010.FR-005 (reverse relationship queries) |
| 112 | +- **Acceptance Criteria**: |
| 113 | + - All P0 bugs fixed with regression tests |
| 114 | + - Each new filter flag has tests and works with `--json`, `--format=tsv`, table output |
| 115 | + - `show` output includes relational sections with tests |
| 116 | + - Existing tests unbroken |
| 117 | + |
| 118 | +## 7. Risks & Mitigations |
| 119 | +- **Risk**: Performance of reverse lookups on large workspaces – *Likelihood*: low – *Impact*: medium – *Mitigation*: Lazy evaluation; existing registry indices |
| 120 | +- **Risk**: Scope creep across tiers – *Likelihood*: medium – *Impact*: low – *Mitigation*: Each P-tier is a separate phase; ship incrementally |
| 121 | + |
| 122 | +## 8. Follow-ups & Tracking |
| 123 | +- **Future Phases / Deltas**: P4 (graph view) may warrant its own delta if complexity warrants |
| 124 | +- **Open Decisions / Questions**: None currently |
0 commit comments