container-superposition 0.1.3 → 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 (141) hide show
  1. package/README.md +72 -1014
  2. package/dist/scripts/init.js +512 -238
  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/doctor.js +2 -2
  9. package/dist/tool/commands/explain.d.ts.map +1 -1
  10. package/dist/tool/commands/explain.js +88 -0
  11. package/dist/tool/commands/explain.js.map +1 -1
  12. package/dist/tool/commands/hash.d.ts +36 -0
  13. package/dist/tool/commands/hash.d.ts.map +1 -0
  14. package/dist/tool/commands/hash.js +242 -0
  15. package/dist/tool/commands/hash.js.map +1 -0
  16. package/dist/tool/commands/plan.d.ts +53 -0
  17. package/dist/tool/commands/plan.d.ts.map +1 -1
  18. package/dist/tool/commands/plan.js +784 -42
  19. package/dist/tool/commands/plan.js.map +1 -1
  20. package/dist/tool/questionnaire/composer.d.ts +12 -3
  21. package/dist/tool/questionnaire/composer.d.ts.map +1 -1
  22. package/dist/tool/questionnaire/composer.js +133 -20
  23. package/dist/tool/questionnaire/composer.js.map +1 -1
  24. package/dist/tool/schema/project-config.d.ts +15 -0
  25. package/dist/tool/schema/project-config.d.ts.map +1 -0
  26. package/dist/tool/schema/project-config.js +359 -0
  27. package/dist/tool/schema/project-config.js.map +1 -0
  28. package/dist/tool/schema/types.d.ts +57 -1
  29. package/dist/tool/schema/types.d.ts.map +1 -1
  30. package/dist/tool/utils/backup.d.ts +23 -0
  31. package/dist/tool/utils/backup.d.ts.map +1 -0
  32. package/dist/tool/utils/backup.js +123 -0
  33. package/dist/tool/utils/backup.js.map +1 -0
  34. package/dist/tool/utils/gitignore.d.ts +15 -0
  35. package/dist/tool/utils/gitignore.d.ts.map +1 -0
  36. package/dist/tool/utils/gitignore.js +41 -0
  37. package/dist/tool/utils/gitignore.js.map +1 -0
  38. package/dist/tool/utils/services-export.d.ts +14 -0
  39. package/dist/tool/utils/services-export.d.ts.map +1 -0
  40. package/dist/tool/utils/services-export.js +478 -0
  41. package/dist/tool/utils/services-export.js.map +1 -0
  42. package/dist/tool/utils/summary.d.ts +69 -0
  43. package/dist/tool/utils/summary.d.ts.map +1 -0
  44. package/dist/tool/utils/summary.js +260 -0
  45. package/dist/tool/utils/summary.js.map +1 -0
  46. package/docs/README.md +12 -2
  47. package/docs/adopt.md +196 -0
  48. package/docs/custom-patches.md +1 -1
  49. package/docs/discovery-commands.md +55 -3
  50. package/docs/examples.md +40 -6
  51. package/docs/filesystem-contract.md +58 -0
  52. package/docs/hash.md +183 -0
  53. package/docs/minimal-and-editor.md +1 -1
  54. package/docs/overlays.md +108 -5
  55. package/docs/presets-architecture.md +1 -1
  56. package/docs/presets.md +1 -1
  57. package/docs/publishing.md +36 -23
  58. package/docs/security.md +43 -0
  59. package/docs/specs/001-verbose-plan-graph/checklists/requirements.md +36 -0
  60. package/docs/specs/001-verbose-plan-graph/contracts/plan-verbose-output.md +96 -0
  61. package/docs/specs/001-verbose-plan-graph/data-model.md +111 -0
  62. package/docs/specs/001-verbose-plan-graph/plan.md +127 -0
  63. package/docs/specs/001-verbose-plan-graph/quickstart.md +106 -0
  64. package/docs/specs/001-verbose-plan-graph/research.md +100 -0
  65. package/docs/specs/001-verbose-plan-graph/spec.md +128 -0
  66. package/docs/specs/001-verbose-plan-graph/tasks.md +223 -0
  67. package/docs/specs/002-superposition-config-file/checklists/requirements.md +36 -0
  68. package/docs/specs/002-superposition-config-file/contracts/init-project-config.md +98 -0
  69. package/docs/specs/002-superposition-config-file/data-model.md +126 -0
  70. package/docs/specs/002-superposition-config-file/plan.md +208 -0
  71. package/docs/specs/002-superposition-config-file/quickstart.md +140 -0
  72. package/docs/specs/002-superposition-config-file/research.md +144 -0
  73. package/docs/specs/002-superposition-config-file/spec.md +130 -0
  74. package/docs/specs/002-superposition-config-file/tasks.md +213 -0
  75. package/docs/team-workflow.md +27 -1
  76. package/docs/workflows.md +136 -0
  77. package/overlays/.presets/microservice.yml +32 -6
  78. package/overlays/.presets/sdd.yml +84 -0
  79. package/overlays/.presets/web-api.yml +76 -56
  80. package/overlays/README.md +7 -1
  81. package/overlays/amp/README.md +70 -0
  82. package/overlays/amp/devcontainer.patch.json +3 -0
  83. package/overlays/amp/overlay.yml +15 -0
  84. package/overlays/amp/setup.sh +21 -0
  85. package/overlays/amp/verify.sh +21 -0
  86. package/overlays/claude-code/README.md +83 -0
  87. package/overlays/claude-code/devcontainer.patch.json +3 -0
  88. package/overlays/claude-code/overlay.yml +15 -0
  89. package/overlays/claude-code/setup.sh +21 -0
  90. package/overlays/claude-code/verify.sh +21 -0
  91. package/overlays/cloudflared/README.md +190 -0
  92. package/overlays/cloudflared/devcontainer.patch.json +3 -0
  93. package/overlays/cloudflared/overlay.yml +15 -0
  94. package/overlays/cloudflared/setup.sh +49 -0
  95. package/overlays/cloudflared/verify.sh +21 -0
  96. package/overlays/direnv/README.md +6 -4
  97. package/overlays/direnv/setup.sh +0 -12
  98. package/overlays/gemini-cli/README.md +77 -0
  99. package/overlays/gemini-cli/devcontainer.patch.json +3 -0
  100. package/overlays/gemini-cli/overlay.yml +15 -0
  101. package/overlays/gemini-cli/setup.sh +21 -0
  102. package/overlays/gemini-cli/verify.sh +21 -0
  103. package/overlays/grpc-tools/README.md +242 -0
  104. package/overlays/grpc-tools/devcontainer.patch.json +14 -0
  105. package/overlays/grpc-tools/overlay.yml +14 -0
  106. package/overlays/grpc-tools/setup.sh +57 -0
  107. package/overlays/grpc-tools/verify.sh +47 -0
  108. package/overlays/keycloak/.env.example +5 -0
  109. package/overlays/keycloak/README.md +238 -0
  110. package/overlays/keycloak/devcontainer.patch.json +17 -0
  111. package/overlays/keycloak/docker-compose.yml +32 -0
  112. package/overlays/keycloak/overlay.yml +23 -0
  113. package/overlays/keycloak/verify.sh +54 -0
  114. package/overlays/mailpit/.env.example +4 -0
  115. package/overlays/mailpit/README.md +191 -0
  116. package/overlays/mailpit/devcontainer.patch.json +20 -0
  117. package/overlays/mailpit/docker-compose.yml +17 -0
  118. package/overlays/mailpit/overlay.yml +26 -0
  119. package/overlays/mailpit/verify.sh +52 -0
  120. package/overlays/ngrok/overlay.yml +2 -1
  121. package/overlays/opencode/README.md +76 -0
  122. package/overlays/opencode/devcontainer.patch.json +3 -0
  123. package/overlays/opencode/overlay.yml +14 -0
  124. package/overlays/opencode/setup.sh +21 -0
  125. package/overlays/opencode/verify.sh +21 -0
  126. package/overlays/python/README.md +51 -35
  127. package/overlays/python/devcontainer.patch.json +7 -4
  128. package/overlays/python/setup.sh +50 -23
  129. package/overlays/python/verify.sh +29 -1
  130. package/overlays/spec-kit/README.md +181 -0
  131. package/overlays/spec-kit/devcontainer.patch.json +6 -0
  132. package/overlays/spec-kit/overlay.yml +19 -0
  133. package/overlays/spec-kit/setup.sh +45 -0
  134. package/overlays/spec-kit/verify.sh +33 -0
  135. package/overlays/windsurf-cli/README.md +69 -0
  136. package/overlays/windsurf-cli/devcontainer.patch.json +3 -0
  137. package/overlays/windsurf-cli/overlay.yml +15 -0
  138. package/overlays/windsurf-cli/setup.sh +21 -0
  139. package/overlays/windsurf-cli/verify.sh +21 -0
  140. package/package.json +1 -1
  141. package/tool/schema/config.schema.json +138 -9
@@ -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`
@@ -0,0 +1,98 @@
1
+ # Contract: Init Project Config
2
+
3
+ ## Purpose
4
+
5
+ Define the user-facing contract for repository-root project config input during
6
+ `init` and `regen` runs.
7
+
8
+ ## Supported Files
9
+
10
+ Exactly one of these files may be used at the repository root:
11
+
12
+ - `.superposition.yml`
13
+ - `superposition.yml`
14
+
15
+ If both exist, initialization fails before generation.
16
+
17
+ ## Supported Declaration Surface
18
+
19
+ The project config file may declare every supported clean-generation input that
20
+ materially affects generated output, including:
21
+
22
+ - stack selection
23
+ - base image and custom image selection
24
+ - container name
25
+ - preset selection and preset parameters
26
+ - overlay selections by category
27
+ - output path
28
+ - port offset
29
+ - target environment
30
+ - minimal/editor settings
31
+ - supported customization inputs such as environment-related settings, custom
32
+ container definitions, preset glue values, and additional generated features
33
+
34
+ ## Resolution Rules
35
+
36
+ ### Standard Initialization
37
+
38
+ 1. Discover a supported project config file in the repository root.
39
+ 2. Validate the file and stop on any ambiguity or invalid entries.
40
+ 3. Apply project config values as the default persisted input source.
41
+ 4. Apply any direct command input as run-specific overrides.
42
+ 5. Collect only still-missing required values through the existing flow.
43
+
44
+ ### Explicit Project-File Source Selection
45
+
46
+ 1. `--from-project` selects the repository project file as the run's persisted
47
+ input source.
48
+ 2. The command fails before generation if no supported project file exists.
49
+ 3. `--from-project` may not be combined with `--from-manifest` or
50
+ clean-generation selection flags such as stack, overlays, or preset
51
+ selection.
52
+
53
+ ### Explicit Manifest Initialization
54
+
55
+ 1. Load the explicit manifest as the run’s persisted input source.
56
+ 2. Apply any direct command input as run-specific overrides.
57
+ 3. Do not silently merge repository project config values into that run.
58
+
59
+ ### Default Regeneration Source Selection
60
+
61
+ 1. `regen` first uses the repository project file when one exists and no other
62
+ persisted-input source has been selected.
63
+ 2. If no project file exists, `regen` falls back to manifest discovery in the
64
+ established manifest locations.
65
+ 3. Persisted-input source selection must be explicit and unambiguous before
66
+ generation starts.
67
+
68
+ ## Parity Requirement
69
+
70
+ If a generation input is supported through the existing clean-generation path
71
+ and materially affects generated output, it must be expressible through the
72
+ project config file and yield the same final generated output.
73
+
74
+ ## Error Conditions
75
+
76
+ Initialization must fail before generation when any of the following occur:
77
+
78
+ - both supported project config filenames exist
79
+ - the file cannot be parsed
80
+ - unsupported keys or values are declared
81
+ - conflicting selections are declared
82
+ - `--from-project` and `--from-manifest` are used together
83
+ - a persisted-input source mode is combined with clean-generation selection
84
+ flags such as stack, overlays, or preset selection
85
+ - a required value is missing in a non-interactive context
86
+ - a declared customization input is outside the supported clean-generation
87
+ surface
88
+
89
+ ## Verification Expectations
90
+
91
+ - Valid project config yields the same output as equivalent direct user
92
+ selections.
93
+ - Supported customization inputs round-trip through project config without
94
+ losing parity.
95
+ - Missing project config preserves current interactive and flag-driven
96
+ behavior.
97
+ - `regen` supports both explicit and implicit project-file source selection.
98
+ - Explicit manifest runs remain isolated from project-config defaults.
@@ -0,0 +1,126 @@
1
+ # Data Model: Project Configuration File
2
+
3
+ ## Entity: ProjectConfigFile
4
+
5
+ **Purpose**: Represents the repository-root YAML document that declares shared
6
+ generation intent for a project.
7
+
8
+ **Fields**:
9
+
10
+ - `path`: Absolute path to the discovered file.
11
+ - `fileName`: `.superposition.yml` or `superposition.yml`.
12
+ - `declaredValues`: Parsed user-authored generation inputs.
13
+ - `status`: `missing`, `loaded`, `invalid`, or `ambiguous`.
14
+
15
+ **Validation rules**:
16
+
17
+ - At most one supported config filename may exist in the repository root.
18
+ - The file must be valid YAML.
19
+ - The file may declare only supported clean-generation inputs.
20
+
21
+ ## Entity: ProjectConfigSelection
22
+
23
+ **Purpose**: Represents the set of supported generation inputs declared in the
24
+ project config file.
25
+
26
+ **Fields**:
27
+
28
+ - `stack`
29
+ - `baseImage`
30
+ - `customImage`
31
+ - `containerName`
32
+ - `preset`
33
+ - `presetChoices`
34
+ - `language`
35
+ - `database`
36
+ - `observability`
37
+ - `cloudTools`
38
+ - `devTools`
39
+ - `playwright`
40
+ - `outputPath`
41
+ - `portOffset`
42
+ - `target`
43
+ - `minimal`
44
+ - `editor`
45
+ - `customizationInputs`
46
+ - `sourceMode`
47
+
48
+ **Validation rules**:
49
+
50
+ - Values must follow the same supported set as equivalent direct command or
51
+ interactive inputs.
52
+ - Customization-related inputs must map to supported clean-generation behavior,
53
+ not unmanaged arbitrary output fragments.
54
+ - Partial definitions are allowed, but unresolved required values must remain
55
+ completable through the existing flow.
56
+
57
+ ## Entity: CustomizationInput
58
+
59
+ **Purpose**: Represents a supported non-basic generation setting that changes
60
+ the final generated output beyond simple stack or overlay selection.
61
+
62
+ **Fields**:
63
+
64
+ - `kind`: category of customization input
65
+ - `name`: user-facing identifier for the customization
66
+ - `value`: declared value
67
+ - `source`: `project-config`, `cli`, `manifest`, or `interactive`
68
+
69
+ **Examples**:
70
+
71
+ - custom container definition
72
+ - environment-related setting
73
+ - preset glue configuration
74
+ - editor/minimal customization
75
+ - additional generated feature setting
76
+
77
+ **Validation rules**:
78
+
79
+ - The customization must already be part of the supported clean-generation
80
+ surface.
81
+ - The customization must round-trip through generation without being dropped or
82
+ silently rewritten to a different meaning.
83
+
84
+ ## Entity: EffectiveGenerationRequest
85
+
86
+ **Purpose**: Represents the final resolved inputs for one generation run.
87
+
88
+ **Fields**:
89
+
90
+ - `sourceMode`: standard init, explicit project-file init, implicit project-file
91
+ regen, explicit manifest init, or standard init with direct overrides
92
+ - `resolvedValues`: final merged `QuestionnaireAnswers`-equivalent values
93
+ - `overrideSources`: per-field record of which source won precedence
94
+
95
+ **Relationships**:
96
+
97
+ - May derive from one `ProjectConfigSelection`
98
+ - May derive from one explicit manifest input
99
+ - May include many `CustomizationInput` values
100
+
101
+ ## Entity: ValidationIssue
102
+
103
+ **Purpose**: Represents one user-facing problem found while loading the project
104
+ config file.
105
+
106
+ **Fields**:
107
+
108
+ - `scope`: `discovery`, `syntax`, `field`, `selection`, `conflict`, `ambiguity`
109
+ - `location`: file or config entry reference
110
+ - `message`: user-facing description
111
+ - `suggestedFix`: corrective action
112
+
113
+ **State transitions**:
114
+
115
+ - `detected` -> `reported`
116
+ - `reported` -> `resolved by config edit`
117
+
118
+ ## Relationship Summary
119
+
120
+ - One repository has zero or one `ProjectConfigFile`.
121
+ - One `ProjectConfigFile` may contain one `ProjectConfigSelection`.
122
+ - One `ProjectConfigSelection` may contain many `CustomizationInput` values.
123
+ - One `EffectiveGenerationRequest` merges values from supported sources and
124
+ feeds generation plus manifest output.
125
+ - One `EffectiveGenerationRequest` must resolve exactly one persisted-input
126
+ source mode before generation starts.