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.
- package/README.md +72 -1370
- package/dist/scripts/init.js +333 -185
- package/dist/scripts/init.js.map +1 -1
- package/dist/tool/commands/adopt.d.ts +62 -0
- package/dist/tool/commands/adopt.d.ts.map +1 -0
- package/dist/tool/commands/adopt.js +767 -0
- package/dist/tool/commands/adopt.js.map +1 -0
- package/dist/tool/commands/hash.d.ts +36 -0
- package/dist/tool/commands/hash.d.ts.map +1 -0
- package/dist/tool/commands/hash.js +242 -0
- package/dist/tool/commands/hash.js.map +1 -0
- package/dist/tool/commands/plan.d.ts +2 -0
- package/dist/tool/commands/plan.d.ts.map +1 -1
- package/dist/tool/commands/plan.js +262 -42
- package/dist/tool/commands/plan.js.map +1 -1
- package/dist/tool/schema/project-config.d.ts +15 -0
- package/dist/tool/schema/project-config.d.ts.map +1 -0
- package/dist/tool/schema/project-config.js +359 -0
- package/dist/tool/schema/project-config.js.map +1 -0
- package/dist/tool/schema/types.d.ts +39 -1
- package/dist/tool/schema/types.d.ts.map +1 -1
- package/dist/tool/utils/backup.d.ts +23 -0
- package/dist/tool/utils/backup.d.ts.map +1 -0
- package/dist/tool/utils/backup.js +123 -0
- package/dist/tool/utils/backup.js.map +1 -0
- package/docs/README.md +12 -2
- package/docs/adopt.md +196 -0
- package/docs/custom-patches.md +1 -1
- package/docs/discovery-commands.md +55 -3
- package/docs/examples.md +40 -6
- package/docs/filesystem-contract.md +58 -0
- package/docs/hash.md +183 -0
- package/docs/minimal-and-editor.md +1 -1
- package/docs/overlays.md +60 -0
- package/docs/presets-architecture.md +1 -1
- package/docs/presets.md +1 -1
- package/docs/publishing.md +36 -23
- package/docs/security.md +43 -0
- package/docs/specs/001-verbose-plan-graph/checklists/requirements.md +36 -0
- package/docs/specs/001-verbose-plan-graph/contracts/plan-verbose-output.md +96 -0
- package/docs/specs/001-verbose-plan-graph/data-model.md +111 -0
- package/docs/specs/001-verbose-plan-graph/plan.md +127 -0
- package/docs/specs/001-verbose-plan-graph/quickstart.md +106 -0
- package/docs/specs/001-verbose-plan-graph/research.md +100 -0
- package/docs/specs/001-verbose-plan-graph/spec.md +128 -0
- package/docs/specs/001-verbose-plan-graph/tasks.md +223 -0
- package/docs/specs/002-superposition-config-file/checklists/requirements.md +36 -0
- package/docs/specs/002-superposition-config-file/contracts/init-project-config.md +98 -0
- package/docs/specs/002-superposition-config-file/data-model.md +126 -0
- package/docs/specs/002-superposition-config-file/plan.md +208 -0
- package/docs/specs/002-superposition-config-file/quickstart.md +140 -0
- package/docs/specs/002-superposition-config-file/research.md +144 -0
- package/docs/specs/002-superposition-config-file/spec.md +130 -0
- package/docs/specs/002-superposition-config-file/tasks.md +213 -0
- package/docs/team-workflow.md +27 -1
- package/docs/workflows.md +136 -0
- package/overlays/.presets/sdd.yml +84 -0
- package/overlays/README.md +7 -1
- package/overlays/amp/README.md +70 -0
- package/overlays/amp/devcontainer.patch.json +3 -0
- package/overlays/amp/overlay.yml +15 -0
- package/overlays/amp/setup.sh +21 -0
- package/overlays/amp/verify.sh +21 -0
- package/overlays/claude-code/README.md +83 -0
- package/overlays/claude-code/devcontainer.patch.json +3 -0
- package/overlays/claude-code/overlay.yml +15 -0
- package/overlays/claude-code/setup.sh +21 -0
- package/overlays/claude-code/verify.sh +21 -0
- package/overlays/gemini-cli/README.md +77 -0
- package/overlays/gemini-cli/devcontainer.patch.json +3 -0
- package/overlays/gemini-cli/overlay.yml +15 -0
- package/overlays/gemini-cli/setup.sh +21 -0
- package/overlays/gemini-cli/verify.sh +21 -0
- package/overlays/opencode/README.md +76 -0
- package/overlays/opencode/devcontainer.patch.json +3 -0
- package/overlays/opencode/overlay.yml +14 -0
- package/overlays/opencode/setup.sh +21 -0
- package/overlays/opencode/verify.sh +21 -0
- package/overlays/spec-kit/README.md +181 -0
- package/overlays/spec-kit/devcontainer.patch.json +6 -0
- package/overlays/spec-kit/overlay.yml +19 -0
- package/overlays/spec-kit/setup.sh +45 -0
- package/overlays/spec-kit/verify.sh +33 -0
- package/overlays/windsurf-cli/README.md +69 -0
- package/overlays/windsurf-cli/devcontainer.patch.json +3 -0
- package/overlays/windsurf-cli/overlay.yml +15 -0
- package/overlays/windsurf-cli/setup.sh +21 -0
- package/overlays/windsurf-cli/verify.sh +21 -0
- package/package.json +1 -1
- package/tool/schema/config.schema.json +138 -9
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Research: Project Configuration File
|
|
2
|
+
|
|
3
|
+
## Decision 1: Treat project config as a partial-answer source in the existing init flow
|
|
4
|
+
|
|
5
|
+
**Decision**: Load `.superposition.yml` or `superposition.yml` into the same
|
|
6
|
+
partial-answer merge flow already used for direct command input and manifest
|
|
7
|
+
translation.
|
|
8
|
+
|
|
9
|
+
**Rationale**: The repository already has `QuestionnaireAnswers`,
|
|
10
|
+
`buildAnswersFromCliArgs`, `buildAnswersFromManifest`, and `mergeAnswers`.
|
|
11
|
+
Reusing that path keeps generation behavior aligned across interactive, CLI,
|
|
12
|
+
manifest, and project-config inputs.
|
|
13
|
+
|
|
14
|
+
**Alternatives considered**:
|
|
15
|
+
|
|
16
|
+
- Build a separate config-only generation pipeline: rejected because it would
|
|
17
|
+
duplicate behavior and drift from the main generation path.
|
|
18
|
+
- Translate project config into a manifest before generation: rejected because
|
|
19
|
+
the project config is intended to be the human-authored source of intent, not
|
|
20
|
+
a derived artifact.
|
|
21
|
+
|
|
22
|
+
## Decision 2: Keep explicit manifest mode separate from project-config defaults
|
|
23
|
+
|
|
24
|
+
**Decision**: Project config is the default persisted input source for standard
|
|
25
|
+
initialization, but explicit manifest-based runs remain a separate mode and do
|
|
26
|
+
not merge project-config values silently.
|
|
27
|
+
|
|
28
|
+
**Rationale**: The feature spec explicitly preserves manifest-based regeneration
|
|
29
|
+
as a separate path. Mixing the two persisted inputs would make source-of-truth
|
|
30
|
+
selection ambiguous and weaken predictability.
|
|
31
|
+
|
|
32
|
+
**Alternatives considered**:
|
|
33
|
+
|
|
34
|
+
- Always merge project config into manifest-based runs: rejected because explicit
|
|
35
|
+
manifest input is a stronger per-run instruction.
|
|
36
|
+
- Replace manifest workflows entirely: rejected because it would break existing
|
|
37
|
+
regeneration behavior and expand scope.
|
|
38
|
+
|
|
39
|
+
## Decision 3: Support project-file based regeneration as a first-class persisted input mode
|
|
40
|
+
|
|
41
|
+
**Decision**: `regen` supports the repository project file as a persisted input
|
|
42
|
+
source, and it may use that source implicitly when no conflicting source or
|
|
43
|
+
clean-generation selection flags are present.
|
|
44
|
+
|
|
45
|
+
**Rationale**: The project file is now a version-controlled source of truth, so
|
|
46
|
+
regeneration should not force teams back to a generated manifest when the
|
|
47
|
+
project file already expresses the supported intent.
|
|
48
|
+
|
|
49
|
+
**Alternatives considered**:
|
|
50
|
+
|
|
51
|
+
- Keep `regen` manifest-only: rejected because it would create an arbitrary
|
|
52
|
+
split between initialization and regeneration for the same declared intent.
|
|
53
|
+
- Require `--from-project` for every project-file based regen: rejected because
|
|
54
|
+
the default regen path should be able to use the repository source of truth
|
|
55
|
+
directly when no ambiguity exists.
|
|
56
|
+
|
|
57
|
+
## Decision 4: Define parity in terms of supported clean-generation inputs
|
|
58
|
+
|
|
59
|
+
**Decision**: “Full parity” means every currently supported clean-generation
|
|
60
|
+
input that materially affects generated output can be declared in the project
|
|
61
|
+
config file, including customization surfaces such as custom images,
|
|
62
|
+
editor/minimal settings, preset glue, environment-related settings, and
|
|
63
|
+
additional generated features already represented by the generation flow.
|
|
64
|
+
|
|
65
|
+
**Rationale**: The user value is not just basic overlay selection; it is a
|
|
66
|
+
declarative source of truth for the full supported generation surface. Limiting
|
|
67
|
+
project config to a subset would force teams back to long commands for the most
|
|
68
|
+
important customizations.
|
|
69
|
+
|
|
70
|
+
**Alternatives considered**:
|
|
71
|
+
|
|
72
|
+
- Support only stack and overlays first: rejected because it would not satisfy
|
|
73
|
+
the parity requirement in the approved spec.
|
|
74
|
+
- Allow arbitrary raw devcontainer fragments in project config: rejected because
|
|
75
|
+
it would blur the boundary between supported generation inputs and unmanaged
|
|
76
|
+
custom output.
|
|
77
|
+
|
|
78
|
+
## Decision 5: Restrict discovery to the repository root and fail on dual-file ambiguity
|
|
79
|
+
|
|
80
|
+
**Decision**: Discover project config only in the current repository root and
|
|
81
|
+
fail if both supported filenames exist.
|
|
82
|
+
|
|
83
|
+
**Rationale**: The feature is explicitly project-level. Root-only discovery is
|
|
84
|
+
predictable for local workflows and CI, and dual-file failure preserves a
|
|
85
|
+
single visible source of truth.
|
|
86
|
+
|
|
87
|
+
**Alternatives considered**:
|
|
88
|
+
|
|
89
|
+
- Search parent directories: rejected because it risks binding nested work to
|
|
90
|
+
the wrong config.
|
|
91
|
+
- Prefer one filename silently: rejected because ambiguity should be surfaced,
|
|
92
|
+
not hidden.
|
|
93
|
+
|
|
94
|
+
## Decision 6: Validation must happen before generation and name the offending config entry
|
|
95
|
+
|
|
96
|
+
**Decision**: Project-config validation fails before generation begins and
|
|
97
|
+
reports syntax errors, unsupported keys, unsupported values, conflicts, missing
|
|
98
|
+
required values, and ambiguity in terms of the file content or repository state
|
|
99
|
+
the user must correct.
|
|
100
|
+
|
|
101
|
+
**Rationale**: Declarative workflows are only trustworthy if failures point back
|
|
102
|
+
to the committed source of truth rather than forcing users to infer hidden merge
|
|
103
|
+
behavior.
|
|
104
|
+
|
|
105
|
+
**Alternatives considered**:
|
|
106
|
+
|
|
107
|
+
- Let composition fail later: rejected because it hides whether the problem is
|
|
108
|
+
config input or generation logic.
|
|
109
|
+
- Ignore unknown keys: rejected because it would make committed config content
|
|
110
|
+
misleading.
|
|
111
|
+
|
|
112
|
+
## Decision 7: Persisted-input source conflicts must fail before generation
|
|
113
|
+
|
|
114
|
+
**Decision**: `--from-project` and `--from-manifest` are mutually exclusive,
|
|
115
|
+
and persisted-input source modes fail fast when combined with clean-generation
|
|
116
|
+
selection flags such as stack, overlays, or preset selection.
|
|
117
|
+
|
|
118
|
+
**Rationale**: Source selection must stay explicit and predictable. Allowing
|
|
119
|
+
multiple persisted-input sources or mixing source modes with structural
|
|
120
|
+
generation selection flags would make the effective source of truth ambiguous.
|
|
121
|
+
|
|
122
|
+
**Alternatives considered**:
|
|
123
|
+
|
|
124
|
+
- Merge persisted-input sources in precedence order: rejected because it hides
|
|
125
|
+
which source actually defines the run.
|
|
126
|
+
- Allow source modes plus structural overrides: rejected because it weakens the
|
|
127
|
+
contract of deliberate source selection.
|
|
128
|
+
|
|
129
|
+
## Decision 8: Verification must include parity cases, not only happy-path loading
|
|
130
|
+
|
|
131
|
+
**Decision**: Verification covers clean-generation parity for supported
|
|
132
|
+
customization inputs in addition to discovery, precedence, and validation
|
|
133
|
+
behavior.
|
|
134
|
+
|
|
135
|
+
**Rationale**: The highest-risk regressions are cases where project config loads
|
|
136
|
+
but silently loses part of the intended output surface, especially customization
|
|
137
|
+
settings that teams expect to be declarative.
|
|
138
|
+
|
|
139
|
+
**Alternatives considered**:
|
|
140
|
+
|
|
141
|
+
- Test only project-config discovery: rejected because discovery alone does not
|
|
142
|
+
prove parity.
|
|
143
|
+
- Rely on manual parity checks only: rejected because user-visible generation
|
|
144
|
+
behavior needs automated regression protection.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Feature Specification: Project Configuration File
|
|
2
|
+
|
|
3
|
+
**Feature Branch**: `002-superposition-config-file`
|
|
4
|
+
**Created**: 2026-03-11
|
|
5
|
+
**Status**: Final
|
|
6
|
+
**Input**: Add a repository-root project config file so teams and automation can generate the same environment from committed declarative setup instead of reconstructing long CLI commands.
|
|
7
|
+
|
|
8
|
+
> Use repo-relative Markdown links for repository files. The root `README.md`
|
|
9
|
+
> is the only exception and may use package-friendly hosted URLs.
|
|
10
|
+
|
|
11
|
+
## Review & Approval _(mandatory before implementation)_
|
|
12
|
+
|
|
13
|
+
- **Spec Path**: `docs/specs/002-superposition-config-file/spec.md`
|
|
14
|
+
- **Commit Status**: Committed
|
|
15
|
+
- **Review Status**: Approved
|
|
16
|
+
- **Implementation Gate**: No implementation code may begin until this spec is committed and reviewed.
|
|
17
|
+
|
|
18
|
+
## User Scenarios & Testing _(mandatory)_
|
|
19
|
+
|
|
20
|
+
### User Story 1 - Generate from committed project config (Priority: P1)
|
|
21
|
+
|
|
22
|
+
A project maintainer defines the desired development environment in a single repository-root config file so any teammate can generate the same stack, overlay set, output target, and supported customizations without reconstructing a long command.
|
|
23
|
+
|
|
24
|
+
**Why this priority**: This is the core user value. It turns setup intent into a durable, reviewable project artifact instead of a one-off shell command.
|
|
25
|
+
|
|
26
|
+
**Independent Test**: Place a valid `.superposition.yml` or `superposition.yml` in the repository root, run the generation flow without supplying the equivalent long-form options, and confirm the generated output matches the declared stack, overlay selection, output location, and supported customization settings.
|
|
27
|
+
|
|
28
|
+
**Acceptance Scenarios**:
|
|
29
|
+
|
|
30
|
+
1. **Given** a repository with a valid project config file in its root that defines stack, overlay selections, output location, and supported customization settings, **When** a maintainer runs the generation flow from that repository root, **Then** the tool uses those values as the starting configuration for generation.
|
|
31
|
+
2. **Given** a repository with a committed project config file, **When** a teammate clones the repository and runs the same generation flow from a fresh checkout, **Then** they receive the same effective project setup without needing the original author’s shell history or copied command examples.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
### User Story 2 - Use config-driven setup in automation (Priority: P2)
|
|
36
|
+
|
|
37
|
+
A team uses the same committed project config file in CI or scripted workflows so environment generation is repeatable, unattended, and insulated from copied command examples.
|
|
38
|
+
|
|
39
|
+
**Why this priority**: Declarative setup is most valuable when it works in unattended workflows and shared operational contexts.
|
|
40
|
+
|
|
41
|
+
**Independent Test**: Run the generation flow in a non-interactive context from a repository that contains a valid project config file and confirm it completes with no prompt for values already defined in the file, while still allowing explicit per-run overrides.
|
|
42
|
+
|
|
43
|
+
**Acceptance Scenarios**:
|
|
44
|
+
|
|
45
|
+
1. **Given** a non-interactive workflow and a valid project config file, **When** the generation flow starts, **Then** it completes using the file-defined values without requiring interactive answers for those settings.
|
|
46
|
+
2. **Given** a repository where the committed project config file is unchanged, **When** the automation workflow runs repeatedly, **Then** each run resolves the same requested configuration and any direct command overrides affect only that run.
|
|
47
|
+
3. **Given** a repository with a valid project config file and no conflicting persisted-input flag or clean-generation selection flags, **When** a user runs `init --no-interactive` or `regen` in the default project-file mode, **Then** the tool uses the project file as the persisted input source without requiring `--from-project`.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### User Story 3 - Correct invalid or ambiguous config quickly (Priority: P3)
|
|
52
|
+
|
|
53
|
+
A contributor receives clear guidance when the project config file is invalid, incomplete, or ambiguous so they can fix the committed source of truth instead of debugging generated output or hidden fallback behavior.
|
|
54
|
+
|
|
55
|
+
**Why this priority**: Declarative workflows only improve team reliability if configuration problems are surfaced clearly and early.
|
|
56
|
+
|
|
57
|
+
**Independent Test**: Introduce invalid entries, unsupported values, missing required selections for non-interactive use, or ambiguous file conditions and verify the tool stops before generation with actionable guidance tied to the file content or repository state.
|
|
58
|
+
|
|
59
|
+
**Acceptance Scenarios**:
|
|
60
|
+
|
|
61
|
+
1. **Given** a project config file with unsupported keys, unsupported values, or conflicting selections, **When** the generation flow validates the file, **Then** it stops before generating files and reports each issue in terms the contributor can correct.
|
|
62
|
+
2. **Given** both supported project config filenames are present in the same repository, **When** the generation flow starts, **Then** it stops and instructs the user to keep only one project config file so the source of truth is unambiguous.
|
|
63
|
+
|
|
64
|
+
### Edge Cases
|
|
65
|
+
|
|
66
|
+
- What happens when no project config file exists? The current interactive and flag-driven flows remain available without behavior changes.
|
|
67
|
+
- What happens when a project config file defines only part of the setup? The tool uses the provided values and continues to collect any still-required missing choices through the existing flow.
|
|
68
|
+
- How does the system handle explicit command input that conflicts with the project config file? Explicit command input takes precedence for that run, and the user can still keep the file as the shared default.
|
|
69
|
+
- How does the system handle an explicit manifest-based run? The explicit manifest remains the persisted input source for that run, and the project config file does not silently override it.
|
|
70
|
+
- How does the system handle explicit project-file or manifest-source flags that are combined with each other or with clean-generation selection flags such as stack, overlay, or preset selection? It fails before generation and tells the user to choose exactly one persisted input source for that run.
|
|
71
|
+
- How does the system handle `init --no-interactive` or `regen` when a valid project config file exists and no other persisted-input source or clean-generation selection flags are provided? It may use the project file implicitly as the persisted input source for that run.
|
|
72
|
+
- How does the system handle supported customizations such as environment settings, custom container definitions, or additional generated features? Those values are treated as first-class generation inputs and must round-trip through the project config file without being dropped.
|
|
73
|
+
- How does the system handle unsupported overlay IDs, invalid categories, or conflicting selections in the project config file? It fails validation before generation and explains the invalid entries.
|
|
74
|
+
- How does the system handle both `.superposition.yml` and `superposition.yml` in one repository? It treats this as an error to avoid ambiguity.
|
|
75
|
+
|
|
76
|
+
## Requirements _(mandatory)_
|
|
77
|
+
|
|
78
|
+
### Functional Requirements
|
|
79
|
+
|
|
80
|
+
- **FR-001**: The system MUST support exactly two project-level configuration filenames for this feature: `.superposition.yml` and `superposition.yml`.
|
|
81
|
+
- **FR-002**: The system MUST look for the project config file only in the repository root from which the generation flow is run.
|
|
82
|
+
- **FR-003**: The system MUST treat the project config file as the default persisted input source for standard initialization when an explicit manifest input is not provided.
|
|
83
|
+
- **FR-004**: The system MUST read project config values into the same setup decisions already available through interactive answers and direct command input, including stack choice, overlay selections, preset selections, output location, and other generation options that materially affect the resulting setup.
|
|
84
|
+
- **FR-005**: The system MUST allow every supported clean-generation input that materially affects generated output to be declared in `.superposition.yml` or `superposition.yml` instead of requiring a long command.
|
|
85
|
+
- **FR-006**: The system MUST support declaring customization inputs in the project config file, including custom container definitions, environment-related settings, additional generated features, and other first-class generation customizations that affect the resulting devcontainer output.
|
|
86
|
+
- **FR-007**: The system MUST preserve declared project-config customization inputs through generation so the resulting output reflects the same customization values selected for that run.
|
|
87
|
+
- **FR-008**: Users MUST be able to generate a project environment from a valid project config file without re-entering values already defined in that file.
|
|
88
|
+
- **FR-009**: The system MUST allow explicit command input supplied for a run to override conflicting values from the project config file for that run only.
|
|
89
|
+
- **FR-010**: The system MUST preserve the current interactive and flag-driven behavior for users who do not provide a project config file.
|
|
90
|
+
- **FR-011**: The system MUST validate the project config file before generating output and MUST report invalid YAML, unsupported keys, unsupported values, missing required values, or conflicting selections with actionable correction guidance.
|
|
91
|
+
- **FR-012**: The system MUST stop and report an ambiguity error when both supported project config filenames are present in the same repository.
|
|
92
|
+
- **FR-013**: The system MUST produce the same effective project setup from a project config file as it would from an equivalent set of direct user selections across the full supported declaration surface.
|
|
93
|
+
- **FR-014**: The system MUST allow a partially defined project config file to act as shared defaults while still collecting any remaining required choices through the existing user flow.
|
|
94
|
+
- **FR-015**: The system MUST keep explicit manifest-based runs as a separate persisted-input mode and MUST NOT silently merge project config values into a run that was explicitly started from a manifest.
|
|
95
|
+
- **FR-016**: The system MUST support an explicit `--from-project` source-selection mode for both initialization and regeneration flows so users can deliberately choose the repository project file as the persisted input source for a run.
|
|
96
|
+
- **FR-017**: The system MUST allow `init --no-interactive` and `regen` to use the repository project file implicitly when a valid project config file exists and no other persisted-input source flag or clean-generation selection flags are supplied.
|
|
97
|
+
- **FR-018**: The system MUST reject conflicting persisted-input source combinations before generation, including `--from-project` with `--from-manifest` and either source-selection mode combined with clean-generation selection flags such as stack, overlay, or preset selection.
|
|
98
|
+
- **FR-019**: The system MUST document how teams create, commit, validate, and use the project config file in local development, regeneration, and automation workflows, including how parity with clean generation applies to supported customization inputs and how source-selection conflicts are resolved.
|
|
99
|
+
|
|
100
|
+
### Key Entities _(include if feature involves data)_
|
|
101
|
+
|
|
102
|
+
- **Project Configuration File**: The committed repository-root definition of desired setup choices, including filename, declared setup values, supported customization inputs, and whether it is the only supported config file present.
|
|
103
|
+
- **Generation Request**: The effective set of choices used for one generation run after combining defaults, project config values, any explicit command input, and, when explicitly requested, manifest-based input, including supported customization inputs.
|
|
104
|
+
- **Customization Input**: A supported user-configurable generation setting beyond basic stack and overlay selection, such as custom container definitions, environment-related settings, or additional generated features that alter the final output.
|
|
105
|
+
- **Validation Result**: The user-facing outcome of checking the project config file, including syntax problems, unsupported entries, conflict findings, ambiguity conditions, and corrective guidance.
|
|
106
|
+
|
|
107
|
+
## Dependencies & Impact _(mandatory)_
|
|
108
|
+
|
|
109
|
+
- **Affected Areas**: Standard initialization workflow, clean-generation parity, supported customization handling, manifest-based regeneration boundaries, project-file based regeneration boundaries, CLI usage patterns, onboarding workflow, CI/CD workflow, user documentation
|
|
110
|
+
- **Compatibility Impact**: Backward compatible
|
|
111
|
+
- **Required Documentation Updates**: README.md, workflow and examples documentation, quickstart guidance, CHANGELOG.md
|
|
112
|
+
- **Verification Plan**: Unit tests for config resolution and validation, integration tests for config-driven generation, smoke tests for representative stacks, manual validation for onboarding and automation flows
|
|
113
|
+
|
|
114
|
+
## Assumptions
|
|
115
|
+
|
|
116
|
+
- The project config file becomes the team-readable source of truth for default setup intent, including supported customization inputs, but it does not remove support for current interactive, flag-driven, or explicit manifest-based flows.
|
|
117
|
+
- Explicit command input remains the highest-precedence input for a single run so users can make temporary overrides without editing the shared config file.
|
|
118
|
+
- `--from-project` and `--from-manifest` are mutually exclusive persisted-input modes rather than additive sources for one run.
|
|
119
|
+
- A single repository should contain at most one supported project config file so the source of truth stays deterministic and easy to explain.
|
|
120
|
+
|
|
121
|
+
## Success Criteria _(mandatory)_
|
|
122
|
+
|
|
123
|
+
### Measurable Outcomes
|
|
124
|
+
|
|
125
|
+
- **SC-001**: In validation testing, 95% of fresh repository checkouts that contain a valid project config file can generate the intended environment without requiring users to reconstruct setup options from prior command history.
|
|
126
|
+
- **SC-002**: In representative automation tests, 100% of successful non-interactive generation runs complete without prompting for any value already defined in the project config file and without changing the committed project config file.
|
|
127
|
+
- **SC-003**: In usability review, at least 90% of maintainers can define or update a project’s shared setup intent within 10 minutes using the documented config file workflow.
|
|
128
|
+
- **SC-004**: In invalid-configuration tests, 90% of failures identify the problematic file condition or config entry and the required correction in the first error output seen by the user.
|
|
129
|
+
- **SC-005**: In parity validation, every supported customization that can be expressed through the clean generation path can also be declared in the project config file and produces the same final generated output.
|
|
130
|
+
- **SC-006**: In CLI validation tests, 100% of runs that combine conflicting persisted-input source flags or mix a persisted-input source with clean-generation selection flags fail before generation with a source-conflict error that identifies the invalid combination.
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Tasks: Project Configuration File
|
|
2
|
+
|
|
3
|
+
**Input**: Design documents from `docs/specs/002-superposition-config-file/`
|
|
4
|
+
**Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md), [data-model.md](data-model.md), [init-project-config.md](contracts/init-project-config.md), [quickstart.md](quickstart.md)
|
|
5
|
+
|
|
6
|
+
**Tests**: Add automated coverage for config discovery, precedence, no-config fallback, explicit `--from-project`, implicit project-file regen, manifest isolation, source-conflict validation, validation failures, and customization parity in `tool/__tests__/commands.test.ts`, `tool/__tests__/composition.test.ts`, `tool/__tests__/manifest-only.test.ts`, and `tool/__tests__/minimal-and-editor.test.ts`, then run `npm test`, `npm run lint`, and `npm run test:smoke`.
|
|
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 repo-relative file paths in descriptions
|
|
15
|
+
|
|
16
|
+
## Phase 1: Setup (Shared Infrastructure)
|
|
17
|
+
|
|
18
|
+
**Purpose**: Record the approved spec gate and align the feature docs with the implementation baseline before code changes.
|
|
19
|
+
|
|
20
|
+
- [x] T001 Confirm approved spec status and implementation gate in `docs/specs/002-superposition-config-file/spec.md`
|
|
21
|
+
- [x] T002 Align implementation sequencing and verification scope in `docs/specs/002-superposition-config-file/plan.md`
|
|
22
|
+
- [x] T003 Align parity examples and validation steps in `docs/specs/002-superposition-config-file/quickstart.md`
|
|
23
|
+
- [x] T004 [P] Record supported project-config surface and customization parity expectations in `docs/specs/002-superposition-config-file/contracts/init-project-config.md`
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Phase 2: Foundational (Blocking Prerequisites)
|
|
28
|
+
|
|
29
|
+
**Purpose**: Add the shared project-config schema and merge-path support that every story depends on.
|
|
30
|
+
|
|
31
|
+
**⚠️ CRITICAL**: No user story work can begin until this phase is complete
|
|
32
|
+
|
|
33
|
+
- [x] T005 Define project-config file discovery, parsed shape, and validation helpers in `tool/schema/project-config.ts`
|
|
34
|
+
- [x] T006 Extend shared config types and `QuestionnaireAnswers` parity fields in `tool/schema/types.ts`
|
|
35
|
+
- [x] T007 Update supported config schema entries for project-config parity in `tool/schema/config.schema.json`
|
|
36
|
+
- [x] T008 Refactor answer-source merging to accept project-config defaults alongside manifest and CLI inputs in `scripts/init.ts`
|
|
37
|
+
- [x] T009 Add foundational regression coverage for project-config discovery, merge precedence, and dual-file ambiguity in `tool/__tests__/commands.test.ts`
|
|
38
|
+
- [x] T010 Add fixture coverage for supported customization parity inputs in `tool/__tests__/composition.test.ts`
|
|
39
|
+
|
|
40
|
+
**Checkpoint**: Foundation ready - user story implementation can now begin in priority order
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Phase 3: User Story 1 - Generate from committed project config (Priority: P1) 🎯 MVP
|
|
45
|
+
|
|
46
|
+
**Goal**: Let maintainers define the full supported generation intent, including supported customizations, in one repository-root config file and generate the same output as clean generation.
|
|
47
|
+
|
|
48
|
+
**Independent Test**: Put a valid `.superposition.yml` in the repository root with stack, overlays, output path, and supported customization inputs such as custom container definitions, environment-related settings, and additional generated features, run `npm run init`, and confirm the generated output matches equivalent clean-generation input without re-entering declared values.
|
|
49
|
+
|
|
50
|
+
### Verification for User Story 1
|
|
51
|
+
|
|
52
|
+
- [x] T011 [US1] Add command regression coverage for valid project-config driven generation in `tool/__tests__/commands.test.ts`
|
|
53
|
+
- [x] T012 [US1] Add composition parity coverage for project-config custom image and container definition inputs in `tool/__tests__/composition.test.ts`
|
|
54
|
+
- [x] T013 [US1] Add parity coverage for environment-related settings and additional generated features in `tool/__tests__/minimal-and-editor.test.ts`
|
|
55
|
+
|
|
56
|
+
### Implementation for User Story 1
|
|
57
|
+
|
|
58
|
+
- [x] T014 [US1] Load repository-root `.superposition.yml` and `superposition.yml` defaults into the standard init flow in `scripts/init.ts`
|
|
59
|
+
- [x] T015 [US1] Map project-config selections into the clean-generation answer model in `tool/schema/project-config.ts`
|
|
60
|
+
- [x] T016 [US1] Preserve supported customization inputs through generation and summary rendering in `scripts/init.ts`
|
|
61
|
+
- [x] T017 [US1] Ensure project-config driven answers produce the same composed output as equivalent clean-generation input in `tool/questionnaire/composer.ts`
|
|
62
|
+
- [x] T018 [US1] Keep generated run summaries accurate for project-config sourced generation in `tool/utils/summary.ts`
|
|
63
|
+
|
|
64
|
+
**Checkpoint**: User Story 1 should now be fully functional and testable on its own
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Phase 4: User Story 2 - Use config-driven setup in automation (Priority: P2)
|
|
69
|
+
|
|
70
|
+
**Goal**: Let teams run unattended generation from a committed project config while preserving per-run overrides and explicit manifest isolation.
|
|
71
|
+
|
|
72
|
+
**Independent Test**: Run `npm run init` in a non-interactive repository with a valid project config and confirm declared values are not prompted again, direct CLI flags override only that run, and `--from-manifest` remains isolated from project-config defaults.
|
|
73
|
+
|
|
74
|
+
### Verification for User Story 2
|
|
75
|
+
|
|
76
|
+
- [x] T019 [US2] Add non-interactive command regression coverage for project-config defaults and CLI override precedence in `tool/__tests__/commands.test.ts`
|
|
77
|
+
- [x] T020 [US2] Add manifest-isolation regression coverage for project-config and `--from-manifest` interactions in `tool/__tests__/manifest-only.test.ts`
|
|
78
|
+
- [x] T021 [US2] Add regression coverage for no-config fallback to current interactive and flag-driven behavior in `tool/__tests__/commands.test.ts`
|
|
79
|
+
- [x] T022 [US2] Add regression coverage for partial project-config defaults that still require remaining answers in `tool/__tests__/commands.test.ts`
|
|
80
|
+
|
|
81
|
+
### Implementation for User Story 2
|
|
82
|
+
|
|
83
|
+
- [x] T023 [US2] Apply project-config values as default persisted input for standard init without prompting for already-declared values in `scripts/init.ts`
|
|
84
|
+
- [x] T024 [US2] Preserve partial project-config values as shared defaults while collecting only unresolved required answers in `scripts/init.ts`
|
|
85
|
+
- [x] T025 [US2] Preserve run-scoped CLI override precedence over project-config defaults in `scripts/init.ts`
|
|
86
|
+
- [x] T026 [US2] Keep explicit manifest mode isolated from repository project-config defaults in `scripts/init.ts`
|
|
87
|
+
|
|
88
|
+
**Checkpoint**: User Stories 1 and 2 should both work independently
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Phase 5: User Story 3 - Correct invalid or ambiguous config quickly (Priority: P3)
|
|
93
|
+
|
|
94
|
+
**Goal**: Stop invalid, unsupported, conflicting, or ambiguous project-config input before generation and point users to the corrective action.
|
|
95
|
+
|
|
96
|
+
**Independent Test**: Introduce invalid YAML, unsupported keys, unsupported customization values, conflicting selections, missing non-interactive requirements, and both supported filenames, then confirm generation stops before output with actionable guidance tied to the repository state or config entry.
|
|
97
|
+
|
|
98
|
+
### Verification for User Story 3
|
|
99
|
+
|
|
100
|
+
- [x] T027 [US3] Add command regression coverage for invalid YAML, unsupported keys, and unsupported values in `tool/__tests__/commands.test.ts`
|
|
101
|
+
- [x] T028 [US3] Add regression coverage for conflicting selections, missing required non-interactive values, and dual-file ambiguity in `tool/__tests__/commands.test.ts`
|
|
102
|
+
- [x] T029 [US3] Add regression coverage for unsupported customization declarations outside the clean-generation surface in `tool/__tests__/commands.test.ts`
|
|
103
|
+
|
|
104
|
+
### Implementation for User Story 3
|
|
105
|
+
|
|
106
|
+
- [x] T030 [US3] Validate project-config syntax, supported keys, supported values, and conflicting selections before generation in `tool/schema/project-config.ts`
|
|
107
|
+
- [x] T031 [US3] Report repository-root ambiguity and non-interactive missing-value failures with actionable guidance in `scripts/init.ts`
|
|
108
|
+
- [x] T032 [US3] Reject unsupported customization declarations that fall outside the supported clean-generation surface in `tool/schema/project-config.ts`
|
|
109
|
+
|
|
110
|
+
**Checkpoint**: All user stories should now be independently functional
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Phase 6: Polish & Cross-Cutting Concerns
|
|
115
|
+
|
|
116
|
+
**Purpose**: Finish documentation, changelog, and end-to-end verification for the declarative workflow.
|
|
117
|
+
|
|
118
|
+
- [x] T033 [P] Document project-config usage, parity scope, and supported customization examples in `README.md`
|
|
119
|
+
- [x] T034 [P] Document local and CI workflow examples for project config in `docs/workflows.md`
|
|
120
|
+
- [x] T035 [P] Document project-config parity examples and customization cases in `docs/examples.md`
|
|
121
|
+
- [x] T036 Update the user-visible project-config change summary in `CHANGELOG.md`
|
|
122
|
+
- [x] T037 Run the maintainer workflow review for SC-003 and record the outcome in `docs/specs/002-superposition-config-file/quickstart.md`
|
|
123
|
+
- [x] T038 Record final verification steps and observed outcomes in `docs/specs/002-superposition-config-file/quickstart.md`
|
|
124
|
+
- [x] T039 Run `npm test`, `npm run lint`, and `npm run test:smoke`, then record the results in `docs/specs/002-superposition-config-file/quickstart.md`
|
|
125
|
+
- [x] T040 Add explicit `--from-project` and implicit `regen` project-file regression coverage in `tool/__tests__/commands.test.ts`
|
|
126
|
+
- [x] T041 Implement `--from-project`, implicit project-file `regen`, and source-conflict validation in `scripts/init.ts`
|
|
127
|
+
- [x] T042 Update project-file regeneration and conflict-resolution documentation in `README.md`, `docs/workflows.md`, and `docs/examples.md`
|
|
128
|
+
- [x] T043 Update the user-visible changelog entry to include `regen --from-project`, implicit project-file `regen`, and source-conflict validation in `CHANGELOG.md`
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Dependencies & Execution Order
|
|
133
|
+
|
|
134
|
+
### Phase Dependencies
|
|
135
|
+
|
|
136
|
+
- **Setup (Phase 1)**: Starts immediately
|
|
137
|
+
- **Foundational (Phase 2)**: Depends on Setup completion and blocks all user story work
|
|
138
|
+
- **User Story 1 (Phase 3)**: Depends on Foundational completion
|
|
139
|
+
- **User Story 2 (Phase 4)**: Depends on Foundational completion and should follow US1 because it extends the same answer-resolution path into unattended and manifest-sensitive flows
|
|
140
|
+
- **User Story 3 (Phase 5)**: Depends on Foundational completion and should follow US1 and US2 because validation rules depend on the final supported project-config surface and precedence behavior
|
|
141
|
+
- **Polish (Phase 6)**: Depends on the desired user stories being complete and now also covers explicit source-selection and regeneration workflow updates
|
|
142
|
+
|
|
143
|
+
### User Story Dependencies
|
|
144
|
+
|
|
145
|
+
- **User Story 1 (P1)**: No dependency on other stories after Phase 2
|
|
146
|
+
- **User Story 2 (P2)**: Depends on the project-config merge path from US1 and extends it to automation, overrides, and manifest isolation
|
|
147
|
+
- **User Story 3 (P3)**: Depends on the supported config surface from US1 and the precedence rules from US2 so failure behavior matches the completed feature
|
|
148
|
+
|
|
149
|
+
### Within Each User Story
|
|
150
|
+
|
|
151
|
+
- Add or update verification tasks before implementation for that story
|
|
152
|
+
- Land project-config loading and normalization before parity-sensitive generation changes
|
|
153
|
+
- Complete precedence and failure-handling behavior before final docs and smoke validation
|
|
154
|
+
|
|
155
|
+
### Parallel Opportunities
|
|
156
|
+
|
|
157
|
+
- `T003` and `T004` can run in parallel during Setup
|
|
158
|
+
- `T009` and `T010` can run in parallel after the foundational schema shape is settled
|
|
159
|
+
- `T012` and `T013` can run in parallel once project-config mapping is defined
|
|
160
|
+
- `T033`, `T034`, and `T035` can run in parallel after behavior is stable
|
|
161
|
+
- `T040`, `T042`, and `T043` can run in parallel after the source-selection behavior is stable
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Parallel Example: User Story 1
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
Task: "Add composition parity coverage for project-config custom image and container definition inputs in tool/__tests__/composition.test.ts"
|
|
169
|
+
Task: "Add parity coverage for environment-related settings and additional generated features in tool/__tests__/minimal-and-editor.test.ts"
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Parallel Example: Polish
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
Task: "Document project-config usage, parity scope, and supported customization examples in README.md"
|
|
176
|
+
Task: "Document local and CI workflow examples for project config in docs/workflows.md"
|
|
177
|
+
Task: "Document project-config parity examples and customization cases in docs/examples.md"
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Implementation Strategy
|
|
183
|
+
|
|
184
|
+
### MVP First (User Story 1 Only)
|
|
185
|
+
|
|
186
|
+
1. Complete Phase 1: Setup
|
|
187
|
+
2. Complete Phase 2: Foundational
|
|
188
|
+
3. Complete Phase 3: User Story 1
|
|
189
|
+
4. Validate project-config driven generation against equivalent clean-generation output
|
|
190
|
+
5. Stop for review before extending into unattended and failure-handling behavior
|
|
191
|
+
|
|
192
|
+
### Incremental Delivery
|
|
193
|
+
|
|
194
|
+
1. Land project-config discovery, typing, and merge foundations
|
|
195
|
+
2. Deliver User Story 1 for repository-root config driven generation with customization parity
|
|
196
|
+
3. Add User Story 2 for automation, CLI overrides, no-config fallback, and manifest isolation
|
|
197
|
+
4. Add User Story 3 for validation, ambiguity handling, and corrective guidance
|
|
198
|
+
5. Finish docs, changelog, and full verification
|
|
199
|
+
6. Add explicit source-selection and project-file regeneration follow-through so spec, plan, tasks, and CLI behavior stay aligned
|
|
200
|
+
|
|
201
|
+
### Parallel Team Strategy
|
|
202
|
+
|
|
203
|
+
1. One developer completes Setup and Foundational work
|
|
204
|
+
2. After the project-config schema and merge path are stable, one developer can drive US1 implementation while another prepares the parity-focused verification cases
|
|
205
|
+
3. After US1 is stable, the same command owner should complete US2 and US3 because they concentrate in `scripts/init.ts` and shared validation helpers
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Notes
|
|
210
|
+
|
|
211
|
+
- All tasks use the required checklist format with IDs, optional `[P]` markers, story labels for story phases, and exact repo-relative file paths
|
|
212
|
+
- The approved spec gate is already satisfied; execution readiness now depends on completing implementation, verification, and documentation tasks cleanly
|
|
213
|
+
- Favor command-level and composition-level regression tests because the risk is user-visible generation behavior and customization parity drift
|
package/docs/team-workflow.md
CHANGED
|
@@ -33,6 +33,31 @@ my-project/
|
|
|
33
33
|
|
|
34
34
|
## Step-by-Step Setup
|
|
35
35
|
|
|
36
|
+
### 0. Migrating an Existing Devcontainer (Optional)
|
|
37
|
+
|
|
38
|
+
If you already have a hand-crafted `.devcontainer/`, use `adopt` to create the
|
|
39
|
+
initial manifest automatically instead of writing it by hand:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# See what would be detected and generated (nothing is written)
|
|
43
|
+
npx container-superposition adopt --dry-run
|
|
44
|
+
|
|
45
|
+
# Run the adoption (writes superposition.json and custom/ patches)
|
|
46
|
+
npx container-superposition adopt
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`adopt` reads every feature URI, VS Code extension, and Docker Compose service
|
|
50
|
+
image in your existing configuration and maps them to overlays. Anything with
|
|
51
|
+
no overlay equivalent (custom features, project-specific services, custom
|
|
52
|
+
mounts, unmatched environment variables, …) is written to
|
|
53
|
+
`.devcontainer/custom/` so it survives every subsequent `regen`.
|
|
54
|
+
|
|
55
|
+
`superposition.json` is written to the **project root** (not inside
|
|
56
|
+
`.devcontainer/`), so it can be committed alongside your application code and
|
|
57
|
+
shared with the rest of the team — matching the standard team workflow.
|
|
58
|
+
|
|
59
|
+
See the [Adopt Command guide](adopt.md) for full details.
|
|
60
|
+
|
|
36
61
|
### 1. Create the Team Manifest
|
|
37
62
|
|
|
38
63
|
The team lead or maintainer creates the initial manifest:
|
|
@@ -51,7 +76,7 @@ This creates `superposition.json` in the current directory:
|
|
|
51
76
|
```json
|
|
52
77
|
{
|
|
53
78
|
"manifestVersion": "1",
|
|
54
|
-
"generatedBy": "
|
|
79
|
+
"generatedBy": "X.Y.Z",
|
|
55
80
|
"generated": "2026-02-17T14:00:00.000Z",
|
|
56
81
|
"baseTemplate": "compose",
|
|
57
82
|
"baseImage": "bookworm",
|
|
@@ -535,6 +560,7 @@ code .
|
|
|
535
560
|
|
|
536
561
|
## See Also
|
|
537
562
|
|
|
563
|
+
- [Adopt Command](adopt.md) - Migrate an existing devcontainer to the overlay-based workflow
|
|
538
564
|
- [Quick Reference](quick-reference.md) - Common commands and flags
|
|
539
565
|
- [Overlay Documentation](overlays.md) - Available overlays
|
|
540
566
|
- [Custom Patches](../tool/README.md#custom-patches) - Custom patch format
|