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,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.
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Implementation Plan: Project Configuration File
|
|
2
|
+
|
|
3
|
+
**Branch**: `002-superposition-config-file` | **Date**: 2026-03-11 | **Spec**: [spec.md](spec.md)
|
|
4
|
+
**Input**: Feature specification from `docs/specs/002-superposition-config-file/spec.md`
|
|
5
|
+
|
|
6
|
+
**Note**: This plan follows the approved spec and constitution gates for the
|
|
7
|
+
active feature branch.
|
|
8
|
+
|
|
9
|
+
## Summary
|
|
10
|
+
|
|
11
|
+
Add repository-root project config support so `init` and `regen` can load a
|
|
12
|
+
committed `.superposition.yml` or `superposition.yml` as a persisted source of
|
|
13
|
+
truth for supported generation flows, with full parity to supported generation
|
|
14
|
+
inputs, including customization surfaces such as custom container definitions,
|
|
15
|
+
environment-related settings, preset glue, and additional generated features.
|
|
16
|
+
The design extends the existing answer-merging flow instead of creating a second
|
|
17
|
+
generation pipeline, introduces an explicit `--from-project` mode, allows
|
|
18
|
+
implicit project-file use for `init --no-interactive` and default `regen` when
|
|
19
|
+
no conflicting source or selection flags are supplied, and keeps explicit
|
|
20
|
+
manifest-based regeneration as a separate persisted-input mode.
|
|
21
|
+
|
|
22
|
+
## Technical Context
|
|
23
|
+
|
|
24
|
+
**Language/Version**: TypeScript 5.3.3 on Node.js 20+
|
|
25
|
+
**Primary Dependencies**: Commander, chalk, boxen, js-yaml, ora, Inquirer
|
|
26
|
+
**Storage**: Filesystem-based project YAML config, `superposition.json`
|
|
27
|
+
manifests, overlay manifests, templates, and generated devcontainer artifacts
|
|
28
|
+
**Testing**: Vitest unit and command tests, shell-based smoke tests, TypeScript
|
|
29
|
+
compile checks
|
|
30
|
+
**Target Platform**: Node.js CLI on Linux, macOS, and Windows developer
|
|
31
|
+
environments
|
|
32
|
+
**Project Type**: CLI scaffolding tool
|
|
33
|
+
**Performance Goals**: Keep project-config discovery plus validation under 200
|
|
34
|
+
ms in representative repositories so initialization remains dominated by the
|
|
35
|
+
existing generation work rather than config loading
|
|
36
|
+
**Constraints**: Preserve backward compatibility for interactive, flag-driven,
|
|
37
|
+
explicit project-file, and explicit manifest-based flows; preserve source/dist
|
|
38
|
+
path compatibility with candidate-path resolution; maintain full parity between
|
|
39
|
+
supported clean generation inputs and project-config declarations; reject
|
|
40
|
+
conflicting persisted-input source combinations before generation; keep
|
|
41
|
+
ambiguity and validation failures user-facing and deterministic
|
|
42
|
+
**Scale/Scope**: Single feature spanning `scripts/init.ts`, shared schema/types,
|
|
43
|
+
config-loading helpers, command and composition tests, documentation, and
|
|
44
|
+
generation parity for supported customization inputs
|
|
45
|
+
|
|
46
|
+
## Constitution Check
|
|
47
|
+
|
|
48
|
+
_GATE: Must pass before Phase 0 research. Re-check after Phase 1 design and
|
|
49
|
+
before implementation._
|
|
50
|
+
|
|
51
|
+
- [x] Spec exists at `docs/specs/002-superposition-config-file/spec.md`.
|
|
52
|
+
- [x] Spec is committed and reviewed before implementation tasks or code begin.
|
|
53
|
+
- [x] Plan scope, compatibility impact, and complexity notes match the approved
|
|
54
|
+
spec.
|
|
55
|
+
- [x] Verification scope covers tests, smoke checks, and documentation updates
|
|
56
|
+
needed for the change.
|
|
57
|
+
- [x] User-visible changes include documentation updates and an `[Unreleased]`
|
|
58
|
+
`CHANGELOG.md` entry.
|
|
59
|
+
|
|
60
|
+
Gate status: Pass. Planning may proceed.
|
|
61
|
+
|
|
62
|
+
## Project Structure
|
|
63
|
+
|
|
64
|
+
### Documentation (this feature)
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
docs/specs/002-superposition-config-file/
|
|
68
|
+
├── plan.md
|
|
69
|
+
├── research.md
|
|
70
|
+
├── data-model.md
|
|
71
|
+
├── quickstart.md
|
|
72
|
+
├── contracts/
|
|
73
|
+
│ └── init-project-config.md
|
|
74
|
+
└── tasks.md
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Source Code (repository root)
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
scripts/
|
|
81
|
+
└── init.ts
|
|
82
|
+
|
|
83
|
+
tool/
|
|
84
|
+
├── __tests__/
|
|
85
|
+
│ ├── commands.test.ts
|
|
86
|
+
│ ├── composition.test.ts
|
|
87
|
+
│ ├── manifest-only.test.ts
|
|
88
|
+
│ ├── minimal-and-editor.test.ts
|
|
89
|
+
│ └── summary.test.ts
|
|
90
|
+
├── questionnaire/
|
|
91
|
+
│ └── composer.ts
|
|
92
|
+
├── schema/
|
|
93
|
+
│ ├── config.schema.json
|
|
94
|
+
│ ├── project-config.ts
|
|
95
|
+
│ └── types.ts
|
|
96
|
+
└── utils/
|
|
97
|
+
└── summary.ts
|
|
98
|
+
|
|
99
|
+
docs/
|
|
100
|
+
├── examples.md
|
|
101
|
+
├── workflows.md
|
|
102
|
+
└── specs/
|
|
103
|
+
|
|
104
|
+
README.md
|
|
105
|
+
CHANGELOG.md
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Structure Decision**: Keep the feature centered on `scripts/init.ts`, because
|
|
109
|
+
input discovery, CLI parsing, manifest handling, and answer merging already
|
|
110
|
+
converge there. Add one focused schema/helper module for project-config
|
|
111
|
+
discovery and validation, extend existing shared types for parity with clean
|
|
112
|
+
generation inputs, and keep verification concentrated in existing command and
|
|
113
|
+
composition test suites.
|
|
114
|
+
|
|
115
|
+
## Phase 0: Research
|
|
116
|
+
|
|
117
|
+
### Research Goals
|
|
118
|
+
|
|
119
|
+
- Confirm the correct precedence between project config, direct command input,
|
|
120
|
+
interactive completion, explicit `--from-project`, implicit project-file
|
|
121
|
+
source selection, and explicit manifest mode.
|
|
122
|
+
- Define what “full parity to clean generation” means for supported
|
|
123
|
+
customization inputs without introducing a second generation model.
|
|
124
|
+
- Confirm discovery, ambiguity handling, and validation boundaries for a
|
|
125
|
+
repository-root YAML config.
|
|
126
|
+
|
|
127
|
+
### Research Outputs
|
|
128
|
+
|
|
129
|
+
- [research.md](research.md)
|
|
130
|
+
|
|
131
|
+
## Phase 1: Design
|
|
132
|
+
|
|
133
|
+
### Data Model
|
|
134
|
+
|
|
135
|
+
- [data-model.md](data-model.md)
|
|
136
|
+
|
|
137
|
+
### Contracts
|
|
138
|
+
|
|
139
|
+
- [init-project-config.md](contracts/init-project-config.md)
|
|
140
|
+
|
|
141
|
+
### Quickstart
|
|
142
|
+
|
|
143
|
+
- [quickstart.md](quickstart.md)
|
|
144
|
+
|
|
145
|
+
## Implementation Approach
|
|
146
|
+
|
|
147
|
+
1. Add repository-root project-config discovery and validation to the standard
|
|
148
|
+
`init` flow and to `regen`, while keeping explicit manifest-based
|
|
149
|
+
regeneration behavior available as a separate mode.
|
|
150
|
+
2. Model project config as another partial-answer source that feeds the existing
|
|
151
|
+
`QuestionnaireAnswers` merge path.
|
|
152
|
+
3. Extend the supported config shape so it can declare every supported
|
|
153
|
+
clean-generation input, including customization surfaces already represented
|
|
154
|
+
in the current answer and generation flow.
|
|
155
|
+
4. Add explicit source-selection validation so `--from-project` and
|
|
156
|
+
`--from-manifest` remain mutually exclusive and cannot be combined with
|
|
157
|
+
clean-generation selection flags such as stack, overlays, or preset choices.
|
|
158
|
+
5. Preserve parity by ensuring project-config declarations yield the same final
|
|
159
|
+
generated output as equivalent direct user selections.
|
|
160
|
+
6. Add regression coverage for no-config fallback, override precedence,
|
|
161
|
+
project-file based regen, explicit `--from-project`, manifest isolation,
|
|
162
|
+
source-conflict validation, invalid config handling, ambiguity detection, and
|
|
163
|
+
customization parity.
|
|
164
|
+
7. Update docs and changelog entries so the declarative workflow, source
|
|
165
|
+
selection modes, and conflict rules are user-visible and auditable.
|
|
166
|
+
|
|
167
|
+
## Verification Strategy
|
|
168
|
+
|
|
169
|
+
- Add or update automated coverage for:
|
|
170
|
+
- repository-root project-config discovery
|
|
171
|
+
- no-config fallback behavior
|
|
172
|
+
- CLI-over-project-config precedence
|
|
173
|
+
- explicit `--from-project` behavior for `init` and `regen`
|
|
174
|
+
- implicit project-file selection for `init --no-interactive` and default
|
|
175
|
+
`regen`
|
|
176
|
+
- explicit manifest isolation from project-config defaults
|
|
177
|
+
- persisted-input source conflict validation (`--from-project`,
|
|
178
|
+
`--from-manifest`, and clean-generation selection flags)
|
|
179
|
+
- partial config completion through the existing questionnaire flow
|
|
180
|
+
- invalid YAML, unsupported keys or values, conflicts, and dual-file
|
|
181
|
+
ambiguity
|
|
182
|
+
- parity for supported customization inputs such as custom images, preset
|
|
183
|
+
glue, editor/minimal settings, environment-related settings, and additional
|
|
184
|
+
generated features
|
|
185
|
+
- Run `npm test`.
|
|
186
|
+
- Run `npm run lint`.
|
|
187
|
+
- Run `npm run test:smoke` when generation behavior changes across representative
|
|
188
|
+
stacks.
|
|
189
|
+
- Manually validate the scenarios in [quickstart.md](quickstart.md).
|
|
190
|
+
|
|
191
|
+
## Post-Design Constitution Check
|
|
192
|
+
|
|
193
|
+
- [x] Design preserves spec-first workflow and traces directly to the approved
|
|
194
|
+
spec.
|
|
195
|
+
- [x] Design preserves overlay contract integrity by extending the existing
|
|
196
|
+
answer and generation pipeline rather than inventing a parallel path.
|
|
197
|
+
- [x] Verification remains proportional to risk: automated tests, smoke
|
|
198
|
+
validation where applicable, and documentation updates are planned before
|
|
199
|
+
merge.
|
|
200
|
+
- [x] Documentation synchronization is explicit: `README.md`,
|
|
201
|
+
`docs/workflows.md`, `docs/examples.md`, `quickstart.md`, and `CHANGELOG.md`.
|
|
202
|
+
- [x] Simplicity and compatibility remain intact: project config is a default
|
|
203
|
+
persisted input source, explicit `--from-project` and explicit manifest
|
|
204
|
+
modes remain separate, and candidate-path compatibility stays required.
|
|
205
|
+
|
|
206
|
+
## Complexity Tracking
|
|
207
|
+
|
|
208
|
+
No constitution violations require a design exception.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Quickstart: Project Configuration File
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Use a committed repository-root config file to declare the same supported setup
|
|
6
|
+
intent that users would otherwise provide through clean generation commands.
|
|
7
|
+
|
|
8
|
+
## 1. Add one project config file at the repository root
|
|
9
|
+
|
|
10
|
+
Choose exactly one:
|
|
11
|
+
|
|
12
|
+
- `.superposition.yml`
|
|
13
|
+
- `superposition.yml`
|
|
14
|
+
|
|
15
|
+
Do not keep both in the same repository.
|
|
16
|
+
|
|
17
|
+
## 2. Declare the intended environment
|
|
18
|
+
|
|
19
|
+
Define the supported clean-generation inputs your project needs, such as:
|
|
20
|
+
|
|
21
|
+
- stack
|
|
22
|
+
- overlays
|
|
23
|
+
- presets and preset parameters
|
|
24
|
+
- output path
|
|
25
|
+
- custom image or container definition
|
|
26
|
+
- environment-related settings
|
|
27
|
+
- additional generated features and other supported customization inputs
|
|
28
|
+
|
|
29
|
+
## 3. Run standard initialization
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm run init
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Expected result:
|
|
36
|
+
|
|
37
|
+
- the project config file supplies default generation intent
|
|
38
|
+
- only still-missing required values are collected interactively
|
|
39
|
+
- the generated output matches the declared setup and supported customization
|
|
40
|
+
settings
|
|
41
|
+
|
|
42
|
+
## 4. Override a value for one run
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm run init -- --output ./tmp-devcontainer
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Expected result:
|
|
49
|
+
|
|
50
|
+
- the direct command value wins for that run only
|
|
51
|
+
- the committed project config remains the default source of truth
|
|
52
|
+
|
|
53
|
+
## 5. Use the same config in automation
|
|
54
|
+
|
|
55
|
+
Run initialization from CI or another scripted workflow in a repository that
|
|
56
|
+
contains the committed project config.
|
|
57
|
+
|
|
58
|
+
Expected result:
|
|
59
|
+
|
|
60
|
+
- non-interactive runs use declared defaults without prompting for already
|
|
61
|
+
declared values
|
|
62
|
+
- repeated runs resolve the same configuration
|
|
63
|
+
|
|
64
|
+
## 6. Regenerate from the project file
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run init -- regen
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Expected result:
|
|
71
|
+
|
|
72
|
+
- `regen` uses the repository project file when one exists
|
|
73
|
+
- the command does not require `--from-project` in that default case
|
|
74
|
+
- the generated output matches the project file's declared intent
|
|
75
|
+
|
|
76
|
+
## 7. Preserve explicit manifest regeneration
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm run init -- --from-manifest ./.devcontainer/superposition.json --no-interactive
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Expected result:
|
|
83
|
+
|
|
84
|
+
- the manifest remains the persisted input source for that run
|
|
85
|
+
- repository project config does not silently override it
|
|
86
|
+
|
|
87
|
+
## 8. Reject conflicting source modes early
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm run init -- init --from-project --stack compose
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Expected result:
|
|
94
|
+
|
|
95
|
+
- the command fails before generation
|
|
96
|
+
- the error explains that persisted-input source flags cannot be mixed with
|
|
97
|
+
clean-generation selection flags
|
|
98
|
+
|
|
99
|
+
## 9. Validate parity for supported customization inputs
|
|
100
|
+
|
|
101
|
+
For any supported customization input that can be expressed through the existing
|
|
102
|
+
clean-generation path:
|
|
103
|
+
|
|
104
|
+
- declare it in the project config file
|
|
105
|
+
- run generation
|
|
106
|
+
- confirm the final generated output matches the equivalent clean-generation
|
|
107
|
+
result
|
|
108
|
+
|
|
109
|
+
Examples of parity checks:
|
|
110
|
+
|
|
111
|
+
- custom image or container definition
|
|
112
|
+
- environment-related settings
|
|
113
|
+
- preset glue values
|
|
114
|
+
- additional generated features
|
|
115
|
+
|
|
116
|
+
## 10. Maintainer workflow review
|
|
117
|
+
|
|
118
|
+
Review result for `SC-003`:
|
|
119
|
+
|
|
120
|
+
- a maintainer can create or update `.superposition.yml`, run `npm run init -- --no-interactive`, and inspect the generated output without reconstructing a long command
|
|
121
|
+
- the documented workflow keeps the committed project config as the source of truth while still allowing one-run CLI overrides
|
|
122
|
+
|
|
123
|
+
## 11. Verification record
|
|
124
|
+
|
|
125
|
+
Validated during implementation:
|
|
126
|
+
|
|
127
|
+
- targeted regression tests for project-config discovery, precedence, manifest isolation, no-config fallback, and customization parity
|
|
128
|
+
- targeted regression tests for explicit `--from-project`, implicit project-file
|
|
129
|
+
`regen`, and source-conflict validation
|
|
130
|
+
- `npm test`
|
|
131
|
+
- `npm run lint`
|
|
132
|
+
- `npm run test:smoke`
|
|
133
|
+
|
|
134
|
+
Observed outcomes:
|
|
135
|
+
|
|
136
|
+
- valid project-config driven runs generated the expected manifest and devcontainer output
|
|
137
|
+
- `regen` used the repository project file by default when present and still
|
|
138
|
+
allowed explicit manifest-based regeneration
|
|
139
|
+
- `--no-interactive` now works with a repository-root project config and still fails without any persisted input source
|
|
140
|
+
- explicit `--from-manifest` runs ignored repository project-config defaults as required
|