container-superposition 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +72 -1370
  2. package/dist/scripts/init.js +333 -185
  3. package/dist/scripts/init.js.map +1 -1
  4. package/dist/tool/commands/adopt.d.ts +62 -0
  5. package/dist/tool/commands/adopt.d.ts.map +1 -0
  6. package/dist/tool/commands/adopt.js +767 -0
  7. package/dist/tool/commands/adopt.js.map +1 -0
  8. package/dist/tool/commands/hash.d.ts +36 -0
  9. package/dist/tool/commands/hash.d.ts.map +1 -0
  10. package/dist/tool/commands/hash.js +242 -0
  11. package/dist/tool/commands/hash.js.map +1 -0
  12. package/dist/tool/commands/plan.d.ts +2 -0
  13. package/dist/tool/commands/plan.d.ts.map +1 -1
  14. package/dist/tool/commands/plan.js +262 -42
  15. package/dist/tool/commands/plan.js.map +1 -1
  16. package/dist/tool/schema/project-config.d.ts +15 -0
  17. package/dist/tool/schema/project-config.d.ts.map +1 -0
  18. package/dist/tool/schema/project-config.js +359 -0
  19. package/dist/tool/schema/project-config.js.map +1 -0
  20. package/dist/tool/schema/types.d.ts +39 -1
  21. package/dist/tool/schema/types.d.ts.map +1 -1
  22. package/dist/tool/utils/backup.d.ts +23 -0
  23. package/dist/tool/utils/backup.d.ts.map +1 -0
  24. package/dist/tool/utils/backup.js +123 -0
  25. package/dist/tool/utils/backup.js.map +1 -0
  26. package/docs/README.md +12 -2
  27. package/docs/adopt.md +196 -0
  28. package/docs/custom-patches.md +1 -1
  29. package/docs/discovery-commands.md +55 -3
  30. package/docs/examples.md +40 -6
  31. package/docs/filesystem-contract.md +58 -0
  32. package/docs/hash.md +183 -0
  33. package/docs/minimal-and-editor.md +1 -1
  34. package/docs/overlays.md +60 -0
  35. package/docs/presets-architecture.md +1 -1
  36. package/docs/presets.md +1 -1
  37. package/docs/publishing.md +36 -23
  38. package/docs/security.md +43 -0
  39. package/docs/specs/001-verbose-plan-graph/checklists/requirements.md +36 -0
  40. package/docs/specs/001-verbose-plan-graph/contracts/plan-verbose-output.md +96 -0
  41. package/docs/specs/001-verbose-plan-graph/data-model.md +111 -0
  42. package/docs/specs/001-verbose-plan-graph/plan.md +127 -0
  43. package/docs/specs/001-verbose-plan-graph/quickstart.md +106 -0
  44. package/docs/specs/001-verbose-plan-graph/research.md +100 -0
  45. package/docs/specs/001-verbose-plan-graph/spec.md +128 -0
  46. package/docs/specs/001-verbose-plan-graph/tasks.md +223 -0
  47. package/docs/specs/002-superposition-config-file/checklists/requirements.md +36 -0
  48. package/docs/specs/002-superposition-config-file/contracts/init-project-config.md +98 -0
  49. package/docs/specs/002-superposition-config-file/data-model.md +126 -0
  50. package/docs/specs/002-superposition-config-file/plan.md +208 -0
  51. package/docs/specs/002-superposition-config-file/quickstart.md +140 -0
  52. package/docs/specs/002-superposition-config-file/research.md +144 -0
  53. package/docs/specs/002-superposition-config-file/spec.md +130 -0
  54. package/docs/specs/002-superposition-config-file/tasks.md +213 -0
  55. package/docs/team-workflow.md +27 -1
  56. package/docs/workflows.md +136 -0
  57. package/overlays/.presets/sdd.yml +84 -0
  58. package/overlays/README.md +7 -1
  59. package/overlays/amp/README.md +70 -0
  60. package/overlays/amp/devcontainer.patch.json +3 -0
  61. package/overlays/amp/overlay.yml +15 -0
  62. package/overlays/amp/setup.sh +21 -0
  63. package/overlays/amp/verify.sh +21 -0
  64. package/overlays/claude-code/README.md +83 -0
  65. package/overlays/claude-code/devcontainer.patch.json +3 -0
  66. package/overlays/claude-code/overlay.yml +15 -0
  67. package/overlays/claude-code/setup.sh +21 -0
  68. package/overlays/claude-code/verify.sh +21 -0
  69. package/overlays/gemini-cli/README.md +77 -0
  70. package/overlays/gemini-cli/devcontainer.patch.json +3 -0
  71. package/overlays/gemini-cli/overlay.yml +15 -0
  72. package/overlays/gemini-cli/setup.sh +21 -0
  73. package/overlays/gemini-cli/verify.sh +21 -0
  74. package/overlays/opencode/README.md +76 -0
  75. package/overlays/opencode/devcontainer.patch.json +3 -0
  76. package/overlays/opencode/overlay.yml +14 -0
  77. package/overlays/opencode/setup.sh +21 -0
  78. package/overlays/opencode/verify.sh +21 -0
  79. package/overlays/spec-kit/README.md +181 -0
  80. package/overlays/spec-kit/devcontainer.patch.json +6 -0
  81. package/overlays/spec-kit/overlay.yml +19 -0
  82. package/overlays/spec-kit/setup.sh +45 -0
  83. package/overlays/spec-kit/verify.sh +33 -0
  84. package/overlays/windsurf-cli/README.md +69 -0
  85. package/overlays/windsurf-cli/devcontainer.patch.json +3 -0
  86. package/overlays/windsurf-cli/overlay.yml +15 -0
  87. package/overlays/windsurf-cli/setup.sh +21 -0
  88. package/overlays/windsurf-cli/verify.sh +21 -0
  89. package/package.json +1 -1
  90. package/tool/schema/config.schema.json +138 -9
@@ -0,0 +1,106 @@
1
+ # Quickstart: Verbose Plan Graph
2
+
3
+ ## Goal
4
+
5
+ Validate that the `plan` command can explain dependency inclusion reasons for both direct overlay selection and existing manifest workflows without changing its default concise behavior.
6
+
7
+ ## Prerequisites
8
+
9
+ - Repository dependencies installed
10
+ - Working tree on branch `001-verbose-plan-graph`
11
+
12
+ ## Validation Steps
13
+
14
+ 1. Run the existing concise plan and confirm no narration appears:
15
+
16
+ ```bash
17
+ npm run init -- plan --stack compose --overlays grafana
18
+ ```
19
+
20
+ Expected result:
21
+
22
+ - Standard plan summary appears
23
+ - `Auto-Added Dependencies` includes `prometheus`
24
+ - No dependency narration section is shown
25
+
26
+ 2. Run the verbose text plan for a direct dependency:
27
+
28
+ ```bash
29
+ npm run init -- plan --stack compose --overlays grafana --verbose
30
+ ```
31
+
32
+ Expected result:
33
+
34
+ - Standard summary still appears
35
+ - A dependency narration section explains:
36
+ - `grafana` was selected directly
37
+ - `prometheus` was included because `grafana` requires it
38
+
39
+ 3. Run the verbose JSON plan and inspect explanation data:
40
+
41
+ ```bash
42
+ npm run init -- plan --stack compose --overlays grafana --json --verbose
43
+ ```
44
+
45
+ Expected result:
46
+
47
+ - JSON remains valid
48
+ - Standard plan fields are still present
49
+ - Structured explanation data identifies direct vs dependency-driven inclusions
50
+
51
+ 4. Run the verbose plan from an existing manifest:
52
+
53
+ ```bash
54
+ npm run init -- --from-manifest .devcontainer/superposition.json --no-interactive
55
+ npm run init -- plan --from-manifest .devcontainer/superposition.json --verbose
56
+ ```
57
+
58
+ Expected result:
59
+
60
+ - The plan loads overlays from the manifest without re-entering them manually
61
+ - The verbose explanation treats manifest-defined overlays as the explicit root set
62
+ - Auto-added dependencies are still explained separately from manifest-defined overlays
63
+
64
+ 5. Run the automated regression suite:
65
+
66
+ ```bash
67
+ npm test
68
+ npm run lint
69
+ ```
70
+
71
+ Expected result:
72
+
73
+ - Updated command tests pass
74
+ - TypeScript and formatting checks pass
75
+
76
+ ## Manual Edge Checks
77
+
78
+ - Multi-parent dependency case: choose overlays that share a required dependency and confirm the dependency appears once with multiple reasons.
79
+ - Stack-incompatible case: run a compose-only overlay against `--stack plain` with `--verbose` and confirm the skip reason and dependency path are shown.
80
+ - Manifest case: run a verbose plan from an existing `superposition.json` and confirm the explanation covers both manifest-defined overlays and auto-added dependencies.
81
+ - Conflict case: run a known conflicting pair with `--verbose` and confirm the failure context explains why the command cannot proceed.
82
+
83
+ ## Validation Log
84
+
85
+ Validated on 2026-03-10:
86
+
87
+ - `npm run init -- plan --stack compose --overlays grafana`
88
+ - Confirmed the concise plan output remains unchanged and still auto-adds `prometheus`
89
+ - `npm run init -- plan --stack compose --overlays grafana --verbose`
90
+ - Confirmed verbose output adds a `Dependency Resolution` section with direct-selection and required-dependency reasons
91
+ - `npm run init -- plan --stack compose --overlays grafana --json --verbose`
92
+ - Confirmed JSON output remains valid and adds a `verbose` object with inclusion reasons and summary counts
93
+ - `npm run init -- plan --from-manifest .devcontainer/superposition.json --verbose`
94
+ - Confirmed manifest-driven verbose output treats manifest overlays as the root set and still explains manifest-triggered dependencies like `codex -> nodejs`
95
+ - `npm run init -- plan --from-manifest .devcontainer/superposition.json --json --verbose`
96
+ - Confirmed JSON output records `inputMode: "manifest"` and marks manifest-defined overlays with `selectionSource: "manifest"`
97
+ - `npm run init -- plan --stack compose --overlays docker-in-docker,docker-sock --verbose`
98
+ - Confirmed verbose output adds `Resolution Notes` for the conflict boundary before the command exits with the existing conflict failure
99
+ - `npm run init -- plan --stack plain --overlays grafana --verbose`
100
+ - Confirmed verbose output reports stack-incompatible skip reasons for both `grafana` and its required dependency `prometheus`
101
+ - `npm test -- tool/__tests__/commands.test.ts`
102
+ - Passed after adding verbose coverage for direct, transitive, multi-parent, conflict, and invalid-selection behavior
103
+ - `npm test`
104
+ - Passed across the full Vitest suite after the verbose plan changes and documentation updates
105
+ - `npm run lint`
106
+ - Passed after formatting the remaining repository files that were part of the active verification surface
@@ -0,0 +1,100 @@
1
+ # Research: Verbose Plan Graph
2
+
3
+ ## Decision 1: Attach explanation data to the existing dependency resolver
4
+
5
+ **Decision**: Extend the current `plan` dependency-resolution flow so it records inclusion reasons while producing the same resolved overlay set used by normal text and JSON output.
6
+
7
+ **Rationale**: `tool/commands/plan.ts` already resolves dependencies and feeds both text and JSON views. Reusing that path avoids divergence where verbose mode could explain a different result than the standard plan.
8
+
9
+ **Alternatives considered**:
10
+
11
+ - Build a separate explanation pass after resolution: rejected because it duplicates traversal logic and risks drifting from the actual resolver.
12
+ - Infer reasons only from `autoAddedOverlays`: rejected because it cannot represent transitive chains or multi-parent dependencies clearly enough.
13
+
14
+ ## Decision 2: Model overlay inclusion as one final entry with one or more reasons
15
+
16
+ **Decision**: Represent each included overlay once, with attached reason records that indicate whether it was directly selected, required by another overlay, or reached through a transitive chain.
17
+
18
+ **Rationale**: The spec requires no duplicate final inclusion entries, even when a dependency is reached by multiple parents. A single overlay record with multiple reasons meets that requirement and keeps both text and JSON outputs easy to consume.
19
+
20
+ **Alternatives considered**:
21
+
22
+ - Emit one explanation row per path: rejected because the same overlay would appear multiple times and make the final resolved set harder to read.
23
+ - Keep only the first discovered reason: rejected because it hides valid parent relationships when multiple overlays require the same dependency.
24
+
25
+ ## Decision 3: Keep verbose output opt-in and additive
26
+
27
+ **Decision**: Show the new explanation section only when `--verbose` is present, while leaving default text output unchanged.
28
+
29
+ **Rationale**: The existing `plan` command is a concise preview tool, and the spec explicitly requires backward-compatible default behavior. Opt-in narration preserves scanability for current users.
30
+
31
+ **Alternatives considered**:
32
+
33
+ - Always show inclusion reasons: rejected because it would alter the established command output and add noise to the common case.
34
+ - Replace the existing auto-added summary with verbose narration: rejected because it would collapse the quick summary and the detailed explanation into one harder-to-scan format.
35
+
36
+ ## Decision 4: Expose explanation data in JSON only when verbose mode is requested
37
+
38
+ **Decision**: Add structured inclusion-reason data to the JSON plan payload when `--json` and `--verbose` are both present; preserve the existing JSON shape otherwise.
39
+
40
+ **Rationale**: Scripted consumers need access to the same reasoning as human readers, but existing JSON users should not be forced to adapt to new fields unless they explicitly request verbose mode.
41
+
42
+ **Alternatives considered**:
43
+
44
+ - Always add explanation fields to JSON: rejected because it changes the default contract for existing automation.
45
+ - Omit explanation data from JSON entirely: rejected because the spec requires structured verbose output for scripted consumers.
46
+
47
+ ## Decision 5: Treat conflicts and invalid input as explanation boundaries, not silent failures
48
+
49
+ **Decision**: When resolution fails due to conflicts, unsupported overlays, or invalid overlay IDs, verbose mode should explain the last valid inclusion context and then identify the reason the plan cannot proceed.
50
+
51
+ **Rationale**: The feature principle is that nothing should feel magical. Users need to know where resolution stopped and why, especially when the command refuses to proceed.
52
+
53
+ **Alternatives considered**:
54
+
55
+ - Fall back to the existing failure messages without verbose context: rejected because it leaves the explanation incomplete in the scenarios where users most need it.
56
+ - Produce partial verbose output without marking the failure boundary: rejected because it could imply that the plan completed successfully.
57
+
58
+ ## Decision 6: Verification should focus on command behavior, not only the helper function
59
+
60
+ **Decision**: Cover the new mode primarily with `planCommand` tests in `tool/__tests__/commands.test.ts`, supported by existing unit-level confidence around the command module.
61
+
62
+ **Rationale**: The user-visible risk is in the final text/JSON behavior and backward compatibility of the command surface. Command-level tests exercise option handling, output shaping, and failure behavior together.
63
+
64
+ **Alternatives considered**:
65
+
66
+ - Test only low-level resolver helpers: rejected because it would miss regressions in the rendered CLI and JSON contracts.
67
+ - Rely on manual validation alone: rejected because the change is user-visible and should be guarded by repeatable regression tests.
68
+
69
+ ## Decision 7: Manifest-driven planning should reuse the same explanation model
70
+
71
+ **Decision**: When `plan` is run from an existing `superposition.json` manifest, verbose output should use the same inclusion-reason model and rendering rules as overlay-list-driven planning.
72
+
73
+ **Rationale**: Users should not receive different explanations depending on whether overlays were provided as flags or loaded from a manifest. One model keeps the output easier to reason about and reduces the risk of semantic drift.
74
+
75
+ **Alternatives considered**:
76
+
77
+ - Create a manifest-specific explanation mode: rejected because it would duplicate logic and force users to learn two explanation formats.
78
+ - Treat manifest-defined overlays as opaque input with no per-overlay reasoning: rejected because it violates the “nothing here is magic” principle.
79
+
80
+ ## Decision 8: Manifest-defined overlays should be explained as the explicit starting set
81
+
82
+ **Decision**: In manifest-driven verbose planning, overlays loaded from the manifest should be treated as the explicit root selection set for explanation purposes, while still distinguishing auto-added dependencies from those roots.
83
+
84
+ **Rationale**: The user did not type the overlays on the current command line, but they are still part of an explicit saved configuration. Treating them as the root set preserves explainability without forcing users to re-enter them.
85
+
86
+ **Alternatives considered**:
87
+
88
+ - Label manifest overlays as dependencies: rejected because it misstates user intent and blurs the line between saved configuration and auto-resolved requirements.
89
+ - Add a third top-level selection mode with separate rendering rules: rejected because it adds conceptual weight without improving user value.
90
+
91
+ ## Decision 9: Manifest failure should stop explanation before partial output is emitted
92
+
93
+ **Decision**: Missing, invalid, or semantically broken manifests should fail before verbose explanation output is produced, with a clear message explaining why planning cannot continue.
94
+
95
+ **Rationale**: A broken manifest means the plan has no trustworthy starting configuration. Producing partial verbose output in that state would make the command feel unreliable.
96
+
97
+ **Alternatives considered**:
98
+
99
+ - Emit partial verbose output for valid fragments of the manifest: rejected because partial planning from invalid input is misleading.
100
+ - Reconstruct overlays heuristically when the manifest is malformed: rejected because it adds hidden behavior and weakens trust.
@@ -0,0 +1,128 @@
1
+ # Feature Specification: Verbose Plan Graph
2
+
3
+ **Feature Branch**: `001-verbose-plan-graph`
4
+ **Created**: 2026-03-10
5
+ **Status**: Final
6
+ **Input**: User description: "Extend the plan command with a --verbose flag that narrates the dependency resolution graph — explaining why each overlay was included, not just what was included. The principle: nothing here is magic. Scope update: it should also be possible to run plan including --verbose on an existing manifest."
7
+
8
+ ## Review & Approval _(mandatory before implementation)_
9
+
10
+ - **Spec Path**: `docs/specs/001-verbose-plan-graph/spec.md`
11
+ - **Commit Status**: Committed
12
+ - **Review Status**: APPROVED
13
+ - **Implementation Gate**: No implementation code may begin until this spec is committed and reviewed.
14
+
15
+ ## User Scenarios & Testing _(mandatory)_
16
+
17
+ ### User Story 1 - Explain auto-included overlays (Priority: P1)
18
+
19
+ A user previews a stack and wants to understand why extra overlays appear in the plan so they can trust the result before generating files.
20
+
21
+ **Why this priority**: The plan command is a decision aid. If users cannot see why dependencies were added, they cannot confidently approve the generated setup.
22
+
23
+ **Independent Test**: Can be fully tested by running `plan` with one overlay that causes at least one dependency to be included and confirming the verbose output explains each included overlay and its reason.
24
+
25
+ **Acceptance Scenarios**:
26
+
27
+ 1. **Given** a user requests a plan with an overlay that requires another overlay, **When** the user adds `--verbose`, **Then** the plan explains that the requested overlay was included by user choice and the dependency was included because it is required by that overlay.
28
+ 2. **Given** a dependency is included through more than one path, **When** the user adds `--verbose`, **Then** the plan shows all relevant parent reasons without duplicating the included overlay entry.
29
+
30
+ ---
31
+
32
+ ### User Story 2 - Explain plans loaded from a manifest (Priority: P2)
33
+
34
+ A user reviews an existing `superposition.json` manifest and wants the same verbose dependency narration without re-entering overlay selections manually.
35
+
36
+ **Why this priority**: Manifest-driven workflows are already part of the product. Verbose explanation should work there too, or users will get different levels of transparency depending on how they invoke the plan.
37
+
38
+ **Independent Test**: Can be fully tested by running `plan` from an existing manifest with `--verbose` and confirming the explanation covers the manifest-defined overlays and any resolved dependencies.
39
+
40
+ **Acceptance Scenarios**:
41
+
42
+ 1. **Given** a user runs the plan from an existing manifest, **When** the user adds `--verbose`, **Then** the plan explains why each overlay in the manifest-driven result was included using the same reasoning model as direct overlay selection.
43
+ 2. **Given** the manifest includes overlays that produce required dependencies, **When** the user adds `--verbose`, **Then** the plan explains both the manifest-defined overlays and the auto-included dependencies without requiring duplicate manual input.
44
+
45
+ ---
46
+
47
+ ### User Story 3 - Trace the full dependency path (Priority: P3)
48
+
49
+ A user wants to follow the dependency chain from requested overlays to transitive dependencies so they can review complex plans without guessing how the final set was derived.
50
+
51
+ **Why this priority**: Complex overlay combinations are harder to validate by inspection. Showing the chain reduces confusion and makes the tool easier to audit.
52
+
53
+ **Independent Test**: Can be fully tested by running `plan --verbose` with overlays that produce a multi-step dependency chain and verifying the explanation identifies each step in the chain.
54
+
55
+ **Acceptance Scenarios**:
56
+
57
+ 1. **Given** a requested overlay leads to a transitive dependency chain, **When** the user adds `--verbose`, **Then** the plan narrates the chain in request-to-dependency order.
58
+ 2. **Given** multiple requested overlays are resolved in one plan, **When** the user adds `--verbose`, **Then** the explanation groups or orders the reasoning so a user can tell which requested overlays caused each dependency.
59
+
60
+ ---
61
+
62
+ ### User Story 4 - Preserve concise output when not needed (Priority: P4)
63
+
64
+ A user who only wants a quick summary should still be able to run the plan command without additional explanation noise.
65
+
66
+ **Why this priority**: The new explainability mode should add transparency without making the default workflow slower to scan.
67
+
68
+ **Independent Test**: Can be fully tested by comparing plan output with and without `--verbose` and confirming that explanation content appears only when explicitly requested.
69
+
70
+ **Acceptance Scenarios**:
71
+
72
+ 1. **Given** a user runs the plan command without `--verbose`, **When** the plan is displayed, **Then** the command shows the existing summary output without dependency narration.
73
+ 2. **Given** a user consumes the plan in structured output mode, **When** `--verbose` is present, **Then** the inclusion reasons are available in the structured result in addition to the standard plan data.
74
+
75
+ ### Edge Cases
76
+
77
+ - A requested overlay has no dependencies and should still be explained as user-selected when `--verbose` is used.
78
+ - A dependency is required by multiple requested overlays and the explanation must show all contributing reasons without repeating the dependency as separate final selections.
79
+ - Dependency resolution stops because of a conflict or unsupported combination and the verbose output must clearly identify the last successful inclusion and the reason resolution could not continue.
80
+ - The user requests an invalid or unknown overlay and the plan must fail with a clear message instead of producing partial explanation data.
81
+ - A user attempts to plan from a missing or invalid manifest and the command must fail with a clear message instead of producing incomplete verbose explanation output.
82
+
83
+ ## Requirements _(mandatory)_
84
+
85
+ ### Functional Requirements
86
+
87
+ - **FR-001**: The plan command MUST accept a `--verbose` option that adds a narrative explanation of dependency resolution to the plan result.
88
+ - **FR-002**: When `--verbose` is present, the plan MUST explain why every included overlay appears in the final plan, including whether it was requested directly or added as a dependency.
89
+ - **FR-003**: When an included overlay was added because another overlay required it, the plan MUST identify the parent overlay or overlays that caused that inclusion.
90
+ - **FR-004**: When dependency resolution includes transitive dependencies, the plan MUST present the explanation as a traceable chain from the user-requested overlays to each transitive inclusion.
91
+ - **FR-005**: The plan MUST avoid duplicate final inclusion entries when the same dependency is reached through multiple paths while still preserving all relevant reasons for its inclusion.
92
+ - **FR-006**: When dependency resolution cannot complete because of conflicts, unsupported combinations, or invalid overlay selections, the verbose output MUST explain the point of failure and the reason the plan cannot proceed.
93
+ - **FR-007**: When the plan command is run from an existing `superposition.json` manifest, `--verbose` MUST provide the same dependency explanation coverage as overlay-list-driven planning.
94
+ - **FR-008**: When manifest-driven planning fails because the manifest is missing, invalid, or references invalid overlays, the command MUST produce a clear failure message and MUST NOT produce misleading partial verbose results.
95
+ - **FR-009**: When `--verbose` is not present, the plan command MUST preserve the existing concise behavior and must not require users to read dependency narration.
96
+ - **FR-010**: When the plan is requested in structured output mode together with `--verbose`, the inclusion reasons MUST be available in the structured result in a form that distinguishes direct selections from dependency-driven selections.
97
+ - **FR-011**: The explanation produced by `--verbose` MUST use the same resolved overlay set as the standard plan summary so users never see contradictory inclusion results between concise and verbose views.
98
+
99
+ ### Key Entities _(include if feature involves data)_
100
+
101
+ - **Plan Request**: A user's preview request, including the chosen stack, selected overlays, and optional output flags that affect how the plan is presented.
102
+ - **Manifest-Based Plan Request**: A preview request loaded from an existing `superposition.json` manifest instead of explicit overlay flags, while preserving the same user-visible planning semantics.
103
+ - **Overlay Inclusion Reason**: A user-visible explanation describing why one overlay appears in the final plan, including whether it was directly requested, required by another overlay, or reached transitively through earlier inclusions.
104
+ - **Dependency Path**: The ordered relationship from one or more user-requested overlays through intermediate requirements to a final included overlay.
105
+
106
+ ## Assumptions
107
+
108
+ - Users expect `--verbose` to add explanation only, not to change dependency resolution rules or the final set of included overlays.
109
+ - The same explainability data should be available to both human readers and scripted consumers when they explicitly request verbose output.
110
+ - Existing conflict and validation behavior remains in scope; this feature only expands how the reasoning is presented.
111
+ - Existing manifest-driven workflows should use the same explanation model as direct overlay selection rather than introducing a separate reasoning format.
112
+
113
+ ## Dependencies & Impact _(mandatory)_
114
+
115
+ - **Affected Areas**: CLI command behavior, manifest-driven planning workflows, plan output, discovery documentation, CHANGELOG.md, automated tests
116
+ - **Compatibility Impact**: Backward compatible
117
+ - **Required Documentation Updates**: README.md, discovery command documentation, CHANGELOG.md
118
+ - **Verification Plan**: Unit tests for inclusion-reason reporting, command-level tests for verbose and non-verbose output, manifest-driven planning validation, and manual validation with direct, transitive, duplicate-path, manifest, and failure scenarios
119
+
120
+ ## Success Criteria _(mandatory)_
121
+
122
+ ### Measurable Outcomes
123
+
124
+ - **SC-001**: In review testing, 100% of overlays shown in a verbose plan include an explicit human-readable reason for inclusion.
125
+ - **SC-002**: Users can run a verbose plan from an existing manifest and receive the same class of inclusion explanations as they do from direct overlay selection in 100% of acceptance scenarios.
126
+ - **SC-003**: For plans with transitive dependencies, reviewers can identify the full inclusion chain for each dependency in under 30 seconds without consulting source code or overlay manifests.
127
+ - **SC-004**: In acceptance testing across representative plan scenarios, at least 90% of users correctly distinguish direct selections from auto-included dependencies after reading a single verbose plan output.
128
+ - **SC-005**: Running the plan command without `--verbose` continues to present the concise summary with no additional explanation sections in 100% of regression test cases.
@@ -0,0 +1,223 @@
1
+ # Tasks: Verbose Plan Graph
2
+
3
+ **Input**: Design documents from `/docs/specs/001-verbose-plan-graph/`
4
+ **Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md), [data-model.md](data-model.md), [plan-verbose-output.md](contracts/plan-verbose-output.md), [quickstart.md](quickstart.md)
5
+
6
+ **Tests**: Add automated command-level coverage in `tool/__tests__/commands.test.ts`, then run manual quickstart validation plus `npm test` and `npm run lint`.
7
+
8
+ **Organization**: Tasks are grouped by user story to enable independent implementation and testing of each story.
9
+
10
+ ## Format: `[ID] [P?] [Story] Description`
11
+
12
+ - **[P]**: Can run in parallel (different files, no dependencies)
13
+ - **[Story]**: Which user story this task belongs to (e.g. `US1`, `US2`, `US3`)
14
+ - Include exact file paths in descriptions
15
+
16
+ ## Phase 1: Setup (Shared Infrastructure)
17
+
18
+ **Purpose**: Record the approved governance state and prepare the command surface for the expanded scope.
19
+
20
+ - [x] T001 Record approved spec commit status and review gate in `docs/specs/001-verbose-plan-graph/spec.md`
21
+ - [x] T002 Align implementation sequencing notes for the manifest-driven scope in `docs/specs/001-verbose-plan-graph/plan.md`
22
+ - [x] T003 Update `plan` command option and argument wiring for manifest-driven verbose planning in `scripts/init.ts`
23
+ - [x] T004 Record the revised implementation baseline and pending manifest validation in `docs/specs/001-verbose-plan-graph/quickstart.md`
24
+
25
+ ---
26
+
27
+ ## Phase 2: Foundational (Blocking Prerequisites)
28
+
29
+ **Purpose**: Build the shared request normalization and explanation model that every story depends on.
30
+
31
+ **⚠️ CRITICAL**: No user story work can begin until this phase is complete
32
+
33
+ - [x] T005 Refactor plan request normalization to support overlay-list and manifest inputs in `tool/commands/plan.ts`
34
+ - [x] T006 Define shared inclusion-reason and dependency-path helpers for all plan modes in `tool/commands/plan.ts`
35
+ - [x] T007 Define shared verbose JSON payload shaping for overlay-list and manifest inputs in `tool/commands/plan.ts`
36
+ - [x] T008 Add baseline regression coverage for request parsing and shared plan payload behavior in `tool/__tests__/commands.test.ts`
37
+ - [x] T009 Add fixture support for manifest-driven command tests in `tool/__tests__/commands.test.ts`
38
+
39
+ **Checkpoint**: Foundation ready - user story implementation can now begin following the documented story dependencies
40
+
41
+ ---
42
+
43
+ ## Phase 3: User Story 1 - Explain auto-included overlays (Priority: P1) 🎯 MVP
44
+
45
+ **Goal**: Let users see why directly selected overlays and auto-added required dependencies appear in the final plan.
46
+
47
+ **Independent Test**: Run `npm run init -- plan --stack compose --overlays grafana --verbose` and confirm the output explains `grafana` as directly selected and `prometheus` as required by `grafana`, without duplicate overlay entries.
48
+
49
+ ### Verification for User Story 1
50
+
51
+ - [x] T010 [US1] Add verbose text-output regression coverage for direct selections and required dependencies in `tool/__tests__/commands.test.ts`
52
+ - [x] T011 [US1] Add verbose JSON regression coverage for direct selections and required dependencies in `tool/__tests__/commands.test.ts`
53
+
54
+ ### Implementation for User Story 1
55
+
56
+ - [x] T012 [US1] Implement direct-selection explanation records for overlay-list planning in `tool/commands/plan.ts`
57
+ - [x] T013 [US1] Implement required-dependency explanation records for overlay-list planning in `tool/commands/plan.ts`
58
+ - [x] T014 [US1] Render the verbose dependency narration section for direct overlay selection in `tool/commands/plan.ts`
59
+ - [x] T015 [US1] Attach verbose inclusion-reason data to JSON plan output for direct overlay selection in `tool/commands/plan.ts`
60
+
61
+ **Checkpoint**: User Story 1 should now be fully functional and testable on its own
62
+
63
+ ---
64
+
65
+ ## Phase 4: User Story 2 - Explain plans loaded from a manifest (Priority: P2)
66
+
67
+ **Goal**: Let users run `plan --verbose` from an existing `superposition.json` manifest and receive the same explanation quality they get from direct overlay selection.
68
+
69
+ **Independent Test**: Run `npm run init -- plan --from-manifest superposition.json --verbose` and confirm the explanation treats manifest-defined overlays as the root set while still explaining auto-added dependencies separately.
70
+
71
+ ### Verification for User Story 2
72
+
73
+ - [x] T016 [US2] Add regression coverage for verbose text output from manifest-driven planning in `tool/__tests__/commands.test.ts`
74
+ - [x] T017 [US2] Add regression coverage for verbose JSON output from manifest-driven planning in `tool/__tests__/commands.test.ts`
75
+ - [x] T018 [US2] Add regression coverage for missing, invalid, and semantically broken manifests in `tool/__tests__/commands.test.ts`
76
+
77
+ ### Implementation for User Story 2
78
+
79
+ - [x] T019 [US2] Load manifest-defined overlay roots into the shared plan request model in `tool/commands/plan.ts`
80
+ - [x] T020 [US2] Implement manifest-root explanation records that distinguish saved configuration from dependency-driven inclusions in `tool/commands/plan.ts`
81
+ - [x] T021 [US2] Prevent partial verbose output when manifest-driven planning fails in `tool/commands/plan.ts`
82
+ - [x] T022 [US2] Render manifest-driven verbose narration using the shared explanation model in `tool/commands/plan.ts`
83
+ - [x] T023 [US2] Attach manifest input metadata to verbose JSON plan output in `tool/commands/plan.ts`
84
+
85
+ **Checkpoint**: User Stories 1 and 2 should both work independently
86
+
87
+ ---
88
+
89
+ ## Phase 5: User Story 3 - Trace the full dependency path (Priority: P3)
90
+
91
+ **Goal**: Let users follow transitive dependency chains and shared-parent paths in both direct and manifest-driven planning without guessing how the final plan was assembled.
92
+
93
+ **Independent Test**: Run `plan --verbose` for overlays that create transitive or shared-parent dependencies and confirm each included overlay appears once with traceable path information, regardless of whether the roots came from flags or a manifest.
94
+
95
+ ### Verification for User Story 3
96
+
97
+ - [x] T024 [US3] Add regression coverage for transitive dependency path narration in `tool/__tests__/commands.test.ts`
98
+ - [x] T025 [US3] Add regression coverage for shared-parent dependency explanations without duplicate overlay entries in `tool/__tests__/commands.test.ts`
99
+
100
+ ### Implementation for User Story 3
101
+
102
+ - [x] T026 [US3] Extend inclusion-reason tracking for transitive dependency paths in `tool/commands/plan.ts`
103
+ - [x] T027 [US3] Preserve multiple parent reasons while de-duplicating final overlay entries in `tool/commands/plan.ts`
104
+ - [x] T028 [US3] Render ordered dependency paths in verbose text output for overlay-list and manifest inputs in `tool/commands/plan.ts`
105
+ - [x] T029 [US3] Serialize transitive paths and multi-parent reasons in verbose JSON output in `tool/commands/plan.ts`
106
+
107
+ **Checkpoint**: User Stories 1 through 3 should all be independently functional
108
+
109
+ ---
110
+
111
+ ## Phase 6: User Story 4 - Preserve concise output when not needed (Priority: P4)
112
+
113
+ **Goal**: Keep the default plan experience concise while surfacing verbose failure context only when users explicitly request it.
114
+
115
+ **Independent Test**: Compare `plan` output with and without `--verbose`, then run conflict, invalid-overlay, and stack-incompatible cases with `--verbose` and confirm concise mode is unchanged while verbose mode adds failure context.
116
+
117
+ ### Verification for User Story 4
118
+
119
+ - [x] T030 [US4] Add regression coverage confirming non-verbose text and JSON output remain unchanged for overlay-list and manifest inputs in `tool/__tests__/commands.test.ts`
120
+ - [x] T031 [US4] Add regression coverage for verbose conflict, invalid-overlay, and stack-incompatible skip context in `tool/__tests__/commands.test.ts`
121
+
122
+ ### Implementation for User Story 4
123
+
124
+ - [x] T032 [US4] Gate verbose narration so it only renders when `--verbose` is present in `tool/commands/plan.ts`
125
+ - [x] T033 [US4] Add verbose failure-boundary explanations for conflicts, invalid overlays, stack-incompatible skips, and manifest failures in `tool/commands/plan.ts`
126
+ - [x] T034 [US4] Ensure concise summary and verbose explanation reuse the same resolved overlay set in `tool/commands/plan.ts`
127
+
128
+ **Checkpoint**: All user stories should now be independently functional
129
+
130
+ ---
131
+
132
+ ## Phase 7: Polish & Cross-Cutting Concerns
133
+
134
+ **Purpose**: Finish docs, changelog, and end-to-end verification for the expanded scope.
135
+
136
+ - [x] T035 [P] Document direct-selection and manifest-driven `--verbose` examples in `README.md`
137
+ - [x] T036 [P] Document manifest-driven verbose planning behavior and examples in `docs/discovery-commands.md`
138
+ - [x] T037 Update the user-visible change summary for manifest-driven verbose planning in `CHANGELOG.md`
139
+ - [x] T038 Update validation steps and outcomes for manifest-driven planning in `docs/specs/001-verbose-plan-graph/quickstart.md`
140
+ - [x] T039 Run automated verification with `npm test` and `npm run lint`, then record the results in `docs/specs/001-verbose-plan-graph/quickstart.md`
141
+
142
+ ---
143
+
144
+ ## Dependencies & Execution Order
145
+
146
+ ### Phase Dependencies
147
+
148
+ - **Setup (Phase 1)**: Starts immediately
149
+ - **Foundational (Phase 2)**: Depends on Setup completion and blocks all story work
150
+ - **User Story 1 (Phase 3)**: Depends on Foundational completion
151
+ - **User Story 2 (Phase 4)**: Depends on Foundational completion and should follow US1 because it extends the same command surface and explanation model to manifest inputs
152
+ - **User Story 3 (Phase 5)**: Depends on Foundational completion and should follow US1 and US2 because it builds on the shared explanation records across both input modes
153
+ - **User Story 4 (Phase 6)**: Depends on Foundational completion and should land after US1 through US3 because it validates backward compatibility and failure behavior across the full verbose path
154
+ - **Polish (Phase 7)**: Depends on the desired user stories being complete
155
+
156
+ ### User Story Dependencies
157
+
158
+ - **User Story 1 (P1)**: No dependency on other stories after Phase 2
159
+ - **User Story 2 (P2)**: Depends on the shared explanation data from Phase 2 and should follow US1 once direct-selection verbose records are stable
160
+ - **User Story 3 (P3)**: Depends on the verbose output path from US1 and the manifest-root model from US2
161
+ - **User Story 4 (P4)**: Depends on the full verbose path from US1 through US3 so concise-mode and failure-boundary regressions are measured against the completed behavior
162
+
163
+ ### Within Each User Story
164
+
165
+ - Add or update verification tasks before implementation for that story
166
+ - Extend shared data capture before rendering output
167
+ - Render text and JSON output after explanation data is available
168
+ - Complete story-specific regression coverage before moving on
169
+
170
+ ### Parallel Opportunities
171
+
172
+ - `T035` and `T036` can run in parallel once command behavior is stable
173
+ - Within each user story, the work is intentionally sequential because the changes concentrate in `tool/commands/plan.ts` and `tool/__tests__/commands.test.ts`
174
+
175
+ ---
176
+
177
+ ## Parallel Example: User Story 2
178
+
179
+ ```bash
180
+ No safe [P] tasks inside User Story 2 because manifest input handling, explanation rendering, and command regression coverage all update shared files.
181
+ ```
182
+
183
+ ## Parallel Example: Polish
184
+
185
+ ```bash
186
+ Task: "Document direct-selection and manifest-driven --verbose examples in README.md"
187
+ Task: "Document manifest-driven verbose planning behavior and examples in docs/discovery-commands.md"
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Implementation Strategy
193
+
194
+ ### MVP First (User Story 1 Only)
195
+
196
+ 1. Complete Phase 1: Setup
197
+ 2. Complete Phase 2: Foundational
198
+ 3. Complete Phase 3: User Story 1
199
+ 4. Validate `plan --verbose` for a direct dependency case
200
+ 5. Stop for review before expanding into manifest-driven planning
201
+
202
+ ### Incremental Delivery
203
+
204
+ 1. Ship the shared explanation foundation
205
+ 2. Deliver User Story 1 for direct plus required dependencies
206
+ 3. Add User Story 2 for manifest-driven verbose planning
207
+ 4. Add User Story 3 for transitive and shared-parent path tracing across both input modes
208
+ 5. Add User Story 4 to lock in concise-mode backward compatibility and verbose failure context
209
+ 6. Finish docs, changelog, and verification
210
+
211
+ ### Parallel Team Strategy
212
+
213
+ 1. One developer completes Setup and Foundational work
214
+ 2. After US1 lands, one developer can extend manifest input handling while another prepares the manifest-driven documentation examples
215
+ 3. After US2 lands, the same command owner should complete transitive-path and failure-context work because those changes remain concentrated in shared files
216
+
217
+ ---
218
+
219
+ ## Notes
220
+
221
+ - All tasks use the required checklist format with IDs, optional `[P]` markers, story labels for story phases, and exact file paths
222
+ - The approved spec gate is closed; execution readiness now depends on completing implementation, verification, and documentation tasks cleanly
223
+ - Favor command-level regression tests in `tool/__tests__/commands.test.ts` because the risk is user-visible CLI behavior
@@ -0,0 +1,36 @@
1
+ # Specification Quality Checklist: Project Configuration File
2
+
3
+ **Purpose**: Validate specification completeness and quality before proceeding to planning
4
+ **Created**: 2026-03-11
5
+ **Feature**: [spec.md](../spec.md)
6
+
7
+ ## Content Quality
8
+
9
+ - [x] No implementation details (languages, frameworks, APIs)
10
+ - [x] Focused on user value and business needs
11
+ - [x] Written for non-technical stakeholders
12
+ - [x] All mandatory sections completed
13
+
14
+ ## Requirement Completeness
15
+
16
+ - [x] No [NEEDS CLARIFICATION] markers remain
17
+ - [x] Requirements are testable and unambiguous
18
+ - [x] Success criteria are measurable
19
+ - [x] Success criteria are technology-agnostic (no implementation details)
20
+ - [x] All acceptance scenarios are defined
21
+ - [x] Edge cases are identified
22
+ - [x] Scope is clearly bounded
23
+ - [x] Dependencies and assumptions identified
24
+
25
+ ## Feature Readiness
26
+
27
+ - [x] All functional requirements have clear acceptance criteria
28
+ - [x] User scenarios cover primary flows
29
+ - [x] Feature meets measurable outcomes defined in Success Criteria
30
+ - [x] No implementation details leak into specification
31
+
32
+ ## Notes
33
+
34
+ - Validation completed on 2026-03-11 and passed on the first review iteration.
35
+ - The spec intentionally defines file names and precedence rules because they are part of the user-visible feature behavior and acceptance scope.
36
+ - Items marked incomplete require spec updates before `/speckit.clarify` or `/speckit.plan`