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
package/docs/overlays.md
CHANGED
|
@@ -442,6 +442,36 @@ Infrastructure as Code with HCL (includes tflint)
|
|
|
442
442
|
|
|
443
443
|
## Dev Tool Overlays
|
|
444
444
|
|
|
445
|
+
### Spec Kit (SDD) (`spec-kit`)
|
|
446
|
+
|
|
447
|
+
Specify CLI for Spec-Driven Development with any AI coding agent
|
|
448
|
+
|
|
449
|
+
| Property | Value |
|
|
450
|
+
| ------------ | -------------------------------------------------------- |
|
|
451
|
+
| **Category** | dev |
|
|
452
|
+
| **Suggests** | `python`, `codex` |
|
|
453
|
+
| **Tags** | `dev`, `ai`, `sdd`, `spec-driven`, `specify`, `spec-kit` |
|
|
454
|
+
|
|
455
|
+
### Amp (`amp`)
|
|
456
|
+
|
|
457
|
+
Sourcegraph Amp CLI for AI-powered code generation and assistance
|
|
458
|
+
|
|
459
|
+
| Property | Value |
|
|
460
|
+
| ------------ | --------------------------------- |
|
|
461
|
+
| **Category** | dev |
|
|
462
|
+
| **Requires** | `nodejs` |
|
|
463
|
+
| **Tags** | `dev`, `ai`, `amp`, `sourcegraph` |
|
|
464
|
+
|
|
465
|
+
### Claude Code (`claude-code`)
|
|
466
|
+
|
|
467
|
+
Anthropic Claude Code CLI for AI-powered development assistance
|
|
468
|
+
|
|
469
|
+
| Property | Value |
|
|
470
|
+
| ------------ | ---------------------------------- |
|
|
471
|
+
| **Category** | dev |
|
|
472
|
+
| **Requires** | `nodejs` |
|
|
473
|
+
| **Tags** | `dev`, `ai`, `claude`, `anthropic` |
|
|
474
|
+
|
|
445
475
|
### Cloudflared (`cloudflared`)
|
|
446
476
|
|
|
447
477
|
Cloudflare Tunnel for securely exposing local services to the internet
|
|
@@ -502,6 +532,16 @@ Isolated Docker daemon inside container (portable, works in Codespaces)
|
|
|
502
532
|
| **Conflicts** | `docker-sock` |
|
|
503
533
|
| **Tags** | `dev`, `docker` |
|
|
504
534
|
|
|
535
|
+
### Gemini CLI (`gemini-cli`)
|
|
536
|
+
|
|
537
|
+
Google Gemini CLI for AI-powered development assistance
|
|
538
|
+
|
|
539
|
+
| Property | Value |
|
|
540
|
+
| ------------ | ------------------------------- |
|
|
541
|
+
| **Category** | dev |
|
|
542
|
+
| **Requires** | `nodejs` |
|
|
543
|
+
| **Tags** | `dev`, `ai`, `gemini`, `google` |
|
|
544
|
+
|
|
505
545
|
### Git Helpers (`git-helpers`)
|
|
506
546
|
|
|
507
547
|
Git LFS, GitHub CLI, GPG/SSH support for secure Git operations
|
|
@@ -582,6 +622,16 @@ OpenAPI/Swagger tooling for API development and documentation
|
|
|
582
622
|
| **Suggests** | `nodejs` |
|
|
583
623
|
| **Tags** | `dev`, `openapi`, `swagger`, `api`, `documentation` |
|
|
584
624
|
|
|
625
|
+
### opencode (`opencode`)
|
|
626
|
+
|
|
627
|
+
opencode AI coding agent for terminal-based development assistance
|
|
628
|
+
|
|
629
|
+
| Property | Value |
|
|
630
|
+
| ------------ | ----------------------- |
|
|
631
|
+
| **Category** | dev |
|
|
632
|
+
| **Requires** | `nodejs` |
|
|
633
|
+
| **Tags** | `dev`, `ai`, `opencode` |
|
|
634
|
+
|
|
585
635
|
### Playwright (`playwright`)
|
|
586
636
|
|
|
587
637
|
Browser automation and testing framework
|
|
@@ -614,6 +664,16 @@ Live update and orchestration for Kubernetes development
|
|
|
614
664
|
| **Tags** | `dev`, `kubernetes`, `k8s`, `development`, `live-reload` |
|
|
615
665
|
| **Ports** | 10350 |
|
|
616
666
|
|
|
667
|
+
### Windsurf CLI (`windsurf-cli`)
|
|
668
|
+
|
|
669
|
+
Codeium Windsurf CLI for AI-powered development assistance
|
|
670
|
+
|
|
671
|
+
| Property | Value |
|
|
672
|
+
| ------------ | ---------------------------------- |
|
|
673
|
+
| **Category** | dev |
|
|
674
|
+
| **Requires** | `nodejs` |
|
|
675
|
+
| **Tags** | `dev`, `ai`, `windsurf`, `codeium` |
|
|
676
|
+
|
|
617
677
|
## Dependency Model
|
|
618
678
|
|
|
619
679
|
### Dependency Types
|
package/docs/presets.md
CHANGED
package/docs/publishing.md
CHANGED
|
@@ -5,9 +5,9 @@ This guide explains how to publish `container-superposition` to npm, making it a
|
|
|
5
5
|
## Package Overview
|
|
6
6
|
|
|
7
7
|
**Package Name:** `container-superposition`
|
|
8
|
-
**Current Version:** `
|
|
9
|
-
**Size:**
|
|
10
|
-
**Files:**
|
|
8
|
+
**Current Version:** See `package.json`
|
|
9
|
+
**Size:** Varies by release (use `npm pack --dry-run`)
|
|
10
|
+
**Files:** Varies by release
|
|
11
11
|
**Entry Point:** `dist/scripts/init.js`
|
|
12
12
|
|
|
13
13
|
**Available Commands:**
|
|
@@ -23,33 +23,45 @@ Publishing is **automated via GitHub Actions** when a new release is created.
|
|
|
23
23
|
|
|
24
24
|
### Automated Publishing (Recommended)
|
|
25
25
|
|
|
26
|
-
1. **Update
|
|
26
|
+
1. **Update CHANGELOG.md** with release notes
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
npm version patch # 0.1.0 → 0.1.1 (bug fixes)
|
|
30
|
-
npm version minor # 0.1.0 → 0.2.0 (new features)
|
|
31
|
-
npm version major # 0.1.0 → 1.0.0 (breaking changes)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
2. **Update CHANGELOG.md** with release notes
|
|
35
|
-
|
|
36
|
-
3. **Commit and push changes:**
|
|
28
|
+
2. **Commit and push changes:**
|
|
37
29
|
|
|
38
30
|
```bash
|
|
39
|
-
git add
|
|
40
|
-
git commit -m "
|
|
31
|
+
git add CHANGELOG.md
|
|
32
|
+
git commit -m "docs: update changelog for X.Y.Z"
|
|
41
33
|
git push
|
|
42
34
|
```
|
|
43
35
|
|
|
44
|
-
|
|
36
|
+
3. **Create GitHub Release:**
|
|
45
37
|
- Go to https://github.com/veggerby/container-superposition/releases/new
|
|
46
38
|
- Tag: `vX.Y.Z` (e.g., `v0.1.1`)
|
|
47
|
-
- Title: `
|
|
48
|
-
- Description: Copy from CHANGELOG.md
|
|
39
|
+
- Title: `Version X.Y.Z` (e.g., `Version 0.1.1`)
|
|
40
|
+
- Description: Copy the full release section from `CHANGELOG.md`, including the header line
|
|
41
|
+
- Example (include all subsections like `### Added`, `### Changed`, `### Fixed`):
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
## [0.1.5] - 2026-03-01
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- **Foo overlay** — Adds Foo service for local dev
|
|
49
|
+
- **Bar CLI helpers** — Convenience scripts for common tasks
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- **Template defaults** — Compose stack now includes a healthcheck by default
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
- **Port offsets** — Resolved collisions for default web ports
|
|
58
|
+
```
|
|
59
|
+
|
|
49
60
|
- Click "Publish release"
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
4. **GitHub Actions will automatically:**
|
|
52
63
|
- ✅ Validate semantic version format
|
|
64
|
+
- ✅ Set `package.json` version from the tag
|
|
53
65
|
- ✅ Install dependencies
|
|
54
66
|
- ✅ Run tests
|
|
55
67
|
- ✅ Build TypeScript
|
|
@@ -181,12 +193,13 @@ npm pack --dry-run
|
|
|
181
193
|
- Compressed: ~122 KB
|
|
182
194
|
- Unpacked: ~462 KB
|
|
183
195
|
|
|
184
|
-
### 4.
|
|
196
|
+
### 4. Version Source (Automated)
|
|
185
197
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
198
|
+
For GitHub Releases, the publish workflow sets `package.json` version from the tag (`vX.Y.Z`). You should not run `npm version` locally for automated releases.
|
|
199
|
+
|
|
200
|
+
If you are doing a manual publish (outside GitHub Releases), you can use:
|
|
189
201
|
|
|
202
|
+
```bash
|
|
190
203
|
# Patch release (bug fixes): 0.1.0 → 0.1.1
|
|
191
204
|
npm version patch
|
|
192
205
|
|
package/docs/security.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Security Considerations
|
|
2
|
+
|
|
3
|
+
Container Superposition is designed for **development environments only**. Use these guardrails to avoid common pitfalls.
|
|
4
|
+
|
|
5
|
+
## Docker Socket Access (`docker-sock`)
|
|
6
|
+
|
|
7
|
+
**Risk**: Mounting `/var/run/docker.sock` gives the container full control of the host Docker daemon.
|
|
8
|
+
|
|
9
|
+
Recommended usage:
|
|
10
|
+
|
|
11
|
+
- Use `docker-sock` only on local machines with trusted code.
|
|
12
|
+
- Prefer `docker-in-docker` for isolation or cloud IDEs.
|
|
13
|
+
- Never use `docker-sock` in multi-tenant or production environments.
|
|
14
|
+
|
|
15
|
+
## Database Defaults
|
|
16
|
+
|
|
17
|
+
Database overlays ship with **development-only defaults** (e.g., `postgres/postgres`).
|
|
18
|
+
|
|
19
|
+
Recommended usage:
|
|
20
|
+
|
|
21
|
+
- Rotate credentials for any shared or networked environment.
|
|
22
|
+
- Keep services on private networks.
|
|
23
|
+
- Put real credentials in `.env` (gitignored), not `.env.example`.
|
|
24
|
+
|
|
25
|
+
## Environment Files
|
|
26
|
+
|
|
27
|
+
- `.env.example` is committed and contains templates.
|
|
28
|
+
- `.env` is gitignored and contains real values.
|
|
29
|
+
|
|
30
|
+
Recommended usage:
|
|
31
|
+
|
|
32
|
+
- Copy `.env.example` to `.env` and customize.
|
|
33
|
+
- Keep `.env` out of version control.
|
|
34
|
+
- Use placeholder values in `.env.example`.
|
|
35
|
+
|
|
36
|
+
## General Principles
|
|
37
|
+
|
|
38
|
+
- Treat generated configs as dev-only.
|
|
39
|
+
- Avoid exposing devcontainer ports publicly.
|
|
40
|
+
- Keep base images and overlays updated.
|
|
41
|
+
- Audit dependencies in your devcontainer.
|
|
42
|
+
|
|
43
|
+
For overlay-specific notes, see each overlay README (for example, `overlays/docker-sock/README.md`).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Specification Quality Checklist: Verbose Plan Graph
|
|
2
|
+
|
|
3
|
+
**Purpose**: Validate specification completeness and quality before proceeding to planning
|
|
4
|
+
**Created**: 2026-03-10
|
|
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-10 after the manifest-driven scope update.
|
|
35
|
+
- No checklist failures found during the validation pass for the revised scope.
|
|
36
|
+
- Spec is ready for `/speckit.plan` after review of the updated scope.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Contract: Plan Verbose Output
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
This contract defines the user-visible behavior of the `plan` command when `--verbose` is requested. It covers terminal output and structured JSON output for the normal planning path.
|
|
6
|
+
|
|
7
|
+
## Command Surface
|
|
8
|
+
|
|
9
|
+
### New Option
|
|
10
|
+
|
|
11
|
+
- `--verbose`: Include dependency-resolution narration that explains why each overlay appears in the final plan.
|
|
12
|
+
|
|
13
|
+
### Existing Manifest Input
|
|
14
|
+
|
|
15
|
+
- Manifest-driven planning must support the existing manifest workflow and apply `--verbose` when overlays are loaded from `superposition.json`.
|
|
16
|
+
|
|
17
|
+
### Compatibility Rules
|
|
18
|
+
|
|
19
|
+
- `plan` without `--verbose` keeps the existing concise output contract.
|
|
20
|
+
- `plan --json --verbose` returns the standard plan data plus structured explanation data.
|
|
21
|
+
- `plan` run from an existing manifest with `--verbose` uses the same explanation structure as overlay-list-driven planning.
|
|
22
|
+
- `plan --diff` remains a separate mode; verbose planning must not silently change diff semantics.
|
|
23
|
+
|
|
24
|
+
## Text Output Contract
|
|
25
|
+
|
|
26
|
+
When `--verbose` is present and the command completes normal planning:
|
|
27
|
+
|
|
28
|
+
1. The standard summary remains visible:
|
|
29
|
+
- stack
|
|
30
|
+
- overlays selected
|
|
31
|
+
- auto-added dependencies
|
|
32
|
+
- conflicts, if any
|
|
33
|
+
- port mappings
|
|
34
|
+
- files to create/modify
|
|
35
|
+
2. A dedicated explanation section appears after the overlay summary.
|
|
36
|
+
3. The explanation section must:
|
|
37
|
+
- identify each included overlay exactly once
|
|
38
|
+
- state whether it was selected directly or added automatically
|
|
39
|
+
- treat manifest-defined overlays as the explicit root configuration when planning is loaded from a manifest
|
|
40
|
+
- name the parent overlay or overlays that required it
|
|
41
|
+
- show transitive chains in request-to-dependency order
|
|
42
|
+
- call out failure boundaries when conflicts or invalid selections prevent successful completion
|
|
43
|
+
|
|
44
|
+
### Example Shape
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Dependency Resolution:
|
|
48
|
+
nodejs
|
|
49
|
+
selected directly by the user
|
|
50
|
+
grafana
|
|
51
|
+
selected directly by the user
|
|
52
|
+
prometheus
|
|
53
|
+
required by grafana
|
|
54
|
+
path: grafana -> prometheus
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The wording may vary, but the content requirements above are mandatory.
|
|
58
|
+
|
|
59
|
+
## JSON Output Contract
|
|
60
|
+
|
|
61
|
+
When `--json --verbose` is present, the result must include:
|
|
62
|
+
|
|
63
|
+
- the existing standard plan fields
|
|
64
|
+
- an additional explanation payload that:
|
|
65
|
+
- records whether the plan input came from explicit overlays or a manifest
|
|
66
|
+
- lists each included overlay once
|
|
67
|
+
- distinguishes direct selections from dependency-driven inclusions
|
|
68
|
+
- records one or more parent reasons for dependencies with shared ancestry
|
|
69
|
+
- includes ordered dependency paths for transitive inclusions
|
|
70
|
+
- optionally records failure context when planning cannot complete normally
|
|
71
|
+
|
|
72
|
+
### Minimum Field Expectations
|
|
73
|
+
|
|
74
|
+
The verbose payload must support these questions without requiring text parsing:
|
|
75
|
+
|
|
76
|
+
- Was this overlay selected by the user or added automatically?
|
|
77
|
+
- Which overlay or overlays caused this inclusion?
|
|
78
|
+
- What dependency path led to this overlay?
|
|
79
|
+
- Did resolution stop or skip anything, and why?
|
|
80
|
+
|
|
81
|
+
## Error and Failure Contract
|
|
82
|
+
|
|
83
|
+
- Unknown overlay IDs remain hard failures.
|
|
84
|
+
- Missing or invalid manifests remain hard failures for manifest-driven planning.
|
|
85
|
+
- Conflicts remain visible in both concise and verbose modes.
|
|
86
|
+
- Verbose mode adds context about the dependency path and failure boundary; it does not suppress or soften existing error behavior.
|
|
87
|
+
|
|
88
|
+
## Documentation Contract
|
|
89
|
+
|
|
90
|
+
The command reference and examples must show:
|
|
91
|
+
|
|
92
|
+
- one direct-selection example
|
|
93
|
+
- one manifest-driven verbose example
|
|
94
|
+
- one auto-added dependency example
|
|
95
|
+
- one transitive or multi-parent explanation example
|
|
96
|
+
- one note confirming that default `plan` output stays concise without `--verbose`
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Data Model: Verbose Plan Graph
|
|
2
|
+
|
|
3
|
+
## Entity: PlanRequest
|
|
4
|
+
|
|
5
|
+
**Purpose**: Describes a single `plan` invocation and the presentation options that shape the response.
|
|
6
|
+
|
|
7
|
+
**Fields**:
|
|
8
|
+
|
|
9
|
+
- `stack`: requested base template type
|
|
10
|
+
- `selectedOverlayIds`: user-provided overlay IDs after trimming and de-duplication
|
|
11
|
+
- `manifestPath`: optional path to an existing `superposition.json` manifest
|
|
12
|
+
- `manifestOverlayIds`: overlays loaded from a manifest when manifest-driven planning is used
|
|
13
|
+
- `portOffset`: optional numeric port offset
|
|
14
|
+
- `jsonRequested`: whether structured output is requested
|
|
15
|
+
- `diffRequested`: whether diff mode is requested
|
|
16
|
+
- `verboseRequested`: whether dependency narration is requested
|
|
17
|
+
- `outputPath`: optional comparison target for diff mode
|
|
18
|
+
|
|
19
|
+
**Validation rules**:
|
|
20
|
+
|
|
21
|
+
- `stack` must be present and valid for the command
|
|
22
|
+
- `selectedOverlayIds` must contain only known overlay IDs
|
|
23
|
+
- duplicate overlay IDs are normalized before planning
|
|
24
|
+
- manifest-driven requests must resolve to a valid manifest before explanation data is generated
|
|
25
|
+
- `verboseRequested` must not change resolution behavior, only presentation and additional metadata
|
|
26
|
+
|
|
27
|
+
## Entity: IncludedOverlay
|
|
28
|
+
|
|
29
|
+
**Purpose**: Represents one overlay that appears in the resolved final plan.
|
|
30
|
+
|
|
31
|
+
**Fields**:
|
|
32
|
+
|
|
33
|
+
- `id`: stable overlay identifier
|
|
34
|
+
- `displayName`: human-readable overlay name if available
|
|
35
|
+
- `selectionKind`: `direct` or `dependency` based on how the overlay first entered the resolved set
|
|
36
|
+
- `selectionSource`: `command-line`, `manifest`, or `dependency`
|
|
37
|
+
- `reasons`: one or more inclusion reasons attached to this overlay
|
|
38
|
+
- `dependencyPaths`: one or more ordered paths from a direct selection to this overlay
|
|
39
|
+
- `compatibleWithStack`: whether the overlay remains in the final stack-specific plan
|
|
40
|
+
|
|
41
|
+
**Validation rules**:
|
|
42
|
+
|
|
43
|
+
- each included overlay appears only once in the final resolved set
|
|
44
|
+
- `reasons` must contain at least one entry
|
|
45
|
+
- `dependencyPaths` may have multiple entries when multiple parents lead to the same overlay
|
|
46
|
+
- if `selectionKind` is `direct`, at least one reason must identify the user request as the source
|
|
47
|
+
- if `selectionSource` is `manifest`, at least one reason must identify the manifest-defined root set as the source
|
|
48
|
+
|
|
49
|
+
## Entity: InclusionReason
|
|
50
|
+
|
|
51
|
+
**Purpose**: Explains why a single overlay was kept in the plan.
|
|
52
|
+
|
|
53
|
+
**Fields**:
|
|
54
|
+
|
|
55
|
+
- `kind`: `selected`, `required`, `transitive`, or `skipped`
|
|
56
|
+
- `origin`: `command-line` or `manifest`
|
|
57
|
+
- `sourceOverlayId`: the overlay that directly caused this reason, if applicable
|
|
58
|
+
- `rootOverlayId`: the original user-selected overlay at the start of the path
|
|
59
|
+
- `message`: user-facing explanation text
|
|
60
|
+
- `depth`: number of dependency edges between the root selection and the included overlay
|
|
61
|
+
|
|
62
|
+
**Validation rules**:
|
|
63
|
+
|
|
64
|
+
- direct selections use `kind: selected` and `depth: 0`
|
|
65
|
+
- manifest-defined root overlays also use `kind: selected` and `depth: 0`
|
|
66
|
+
- dependency-driven inclusions must include `sourceOverlayId`
|
|
67
|
+
- transitive reasons must include both `sourceOverlayId` and `rootOverlayId`
|
|
68
|
+
- failure or skip reasons must remain attached to the affected overlay or attempted overlay so users can identify the boundary condition
|
|
69
|
+
|
|
70
|
+
## Entity: DependencyPath
|
|
71
|
+
|
|
72
|
+
**Purpose**: Captures the ordered chain from a requested overlay to an included dependency.
|
|
73
|
+
|
|
74
|
+
**Fields**:
|
|
75
|
+
|
|
76
|
+
- `rootOverlayId`: directly selected starting overlay
|
|
77
|
+
- `segments`: ordered overlay IDs showing the path from root to final overlay
|
|
78
|
+
- `finalOverlayId`: included overlay reached by the path
|
|
79
|
+
|
|
80
|
+
**Validation rules**:
|
|
81
|
+
|
|
82
|
+
- `segments[0]` must match `rootOverlayId`
|
|
83
|
+
- `segments[segments.length - 1]` must match `finalOverlayId`
|
|
84
|
+
- repeated paths for the same overlay should be de-duplicated before output
|
|
85
|
+
|
|
86
|
+
## Entity: VerbosePlanOutput
|
|
87
|
+
|
|
88
|
+
**Purpose**: Extends the standard plan result with explanation data when verbose mode is requested.
|
|
89
|
+
|
|
90
|
+
**Fields**:
|
|
91
|
+
|
|
92
|
+
- `standardPlan`: the existing plan summary data
|
|
93
|
+
- `includedOverlays`: ordered list of `IncludedOverlay` records for human and JSON rendering
|
|
94
|
+
- `resolutionSummary`: concise summary of how many overlays were selected directly vs added automatically
|
|
95
|
+
- `failureContext`: optional description of the point where planning stopped or skipped overlays
|
|
96
|
+
- `inputMode`: `overlay-list` or `manifest`
|
|
97
|
+
|
|
98
|
+
**Relationships**:
|
|
99
|
+
|
|
100
|
+
- one `PlanRequest` produces one `VerbosePlanOutput`
|
|
101
|
+
- one `PlanRequest` may be sourced from explicit overlay flags or a manifest
|
|
102
|
+
- one `VerbosePlanOutput` contains many `IncludedOverlay` records
|
|
103
|
+
- one `IncludedOverlay` contains many `InclusionReason` records and zero or more `DependencyPath` records
|
|
104
|
+
|
|
105
|
+
## State Notes
|
|
106
|
+
|
|
107
|
+
- Resolution begins with the user-selected overlays.
|
|
108
|
+
- Resolution begins with either the user-selected overlays or the manifest-defined overlay roots.
|
|
109
|
+
- Dependencies are added recursively as required relationships are traversed.
|
|
110
|
+
- Stack compatibility filtering may remove overlays from the final renderable set after dependency discovery.
|
|
111
|
+
- Conflict detection runs against the resolved compatible set and may attach failure context to the verbose result.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Implementation Plan: Verbose Plan Graph
|
|
2
|
+
|
|
3
|
+
**Branch**: `001-verbose-plan-graph` | **Date**: 2026-03-10 | **Spec**: [spec.md](spec.md)
|
|
4
|
+
**Input**: Feature specification from `/docs/specs/001-verbose-plan-graph/spec.md`
|
|
5
|
+
|
|
6
|
+
## Summary
|
|
7
|
+
|
|
8
|
+
Extend the `plan` command so `--verbose` explains dependency resolution for both direct overlay selection and manifest-driven planning from an existing `superposition.json`. The design must keep one shared resolution and explanation model so text output, JSON output, and manifest-based workflows stay consistent.
|
|
9
|
+
|
|
10
|
+
## Technical Context
|
|
11
|
+
|
|
12
|
+
**Language/Version**: TypeScript 5.3.3 on Node.js 20+
|
|
13
|
+
**Primary Dependencies**: Commander, chalk, boxen, js-yaml, ora, Inquirer
|
|
14
|
+
**Storage**: Filesystem-based overlay manifests, project `superposition.json` manifests, templates, and generated devcontainer artifacts
|
|
15
|
+
**Testing**: Vitest unit and command tests, shell-based smoke tests, TypeScript compile checks
|
|
16
|
+
**Target Platform**: Node.js CLI on Linux, macOS, and Windows developer environments
|
|
17
|
+
**Project Type**: CLI scaffolding tool
|
|
18
|
+
**Performance Goals**: Preserve the current fast interactive feel of the `plan` command for typical overlay selections and avoid introducing noticeable delay when verbose explanation is enabled
|
|
19
|
+
**Constraints**: Preserve current concise output unless `--verbose` is requested; preserve source/dist path compatibility patterns; keep manifest-driven and overlay-list-driven planning aligned to one resolved overlay set; keep JSON and text views consistent
|
|
20
|
+
**Scale/Scope**: Single command enhancement affecting `scripts/init.ts`, `tool/commands/plan.ts`, command tests, user-facing docs, and manifest-driven planning behavior
|
|
21
|
+
|
|
22
|
+
## Constitution Check
|
|
23
|
+
|
|
24
|
+
_GATE: Must pass before Phase 0 research. Re-check after Phase 1 design and before implementation._
|
|
25
|
+
|
|
26
|
+
- [x] Spec exists at `docs/specs/001-verbose-plan-graph/spec.md`.
|
|
27
|
+
- [x] Spec is committed and reviewed before implementation tasks or code begin.
|
|
28
|
+
- [x] Plan scope, compatibility impact, and complexity notes match the approved spec.
|
|
29
|
+
- [x] Verification scope covers tests, smoke checks, and documentation updates needed for the change.
|
|
30
|
+
- [x] User-visible changes include documentation updates and an `[Unreleased]` `CHANGELOG.md` entry.
|
|
31
|
+
|
|
32
|
+
## Project Structure
|
|
33
|
+
|
|
34
|
+
### Documentation (this feature)
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
docs/specs/001-verbose-plan-graph/
|
|
38
|
+
├── plan.md
|
|
39
|
+
├── research.md
|
|
40
|
+
├── data-model.md
|
|
41
|
+
├── quickstart.md
|
|
42
|
+
├── contracts/
|
|
43
|
+
│ └── plan-verbose-output.md
|
|
44
|
+
└── tasks.md
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Source Code (repository root)
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
scripts/
|
|
51
|
+
└── init.ts
|
|
52
|
+
|
|
53
|
+
tool/
|
|
54
|
+
├── commands/
|
|
55
|
+
│ └── plan.ts
|
|
56
|
+
├── __tests__/
|
|
57
|
+
│ └── commands.test.ts
|
|
58
|
+
├── schema/
|
|
59
|
+
└── utils/
|
|
60
|
+
|
|
61
|
+
docs/
|
|
62
|
+
├── discovery-commands.md
|
|
63
|
+
└── specs/
|
|
64
|
+
|
|
65
|
+
README.md
|
|
66
|
+
CHANGELOG.md
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Structure Decision**: Keep the existing CLI structure centered on `scripts/init.ts` for command options and manifest-loading hooks, and `tool/commands/plan.ts` for shared planning logic. Keep verification concentrated in `tool/__tests__/commands.test.ts`, with documentation updates in `README.md` and `docs/discovery-commands.md`.
|
|
70
|
+
|
|
71
|
+
## Phase 0: Research
|
|
72
|
+
|
|
73
|
+
### Research Goals
|
|
74
|
+
|
|
75
|
+
- Confirm the simplest way to reuse the verbose explanation model for manifest-driven planning.
|
|
76
|
+
- Decide how manifest-loaded overlays should appear in explanation data relative to directly requested overlays.
|
|
77
|
+
- Confirm failure behavior for missing or invalid manifests in verbose mode.
|
|
78
|
+
|
|
79
|
+
### Research Outputs
|
|
80
|
+
|
|
81
|
+
- [research.md](research.md)
|
|
82
|
+
|
|
83
|
+
## Phase 1: Design
|
|
84
|
+
|
|
85
|
+
### Data Model
|
|
86
|
+
|
|
87
|
+
- [data-model.md](data-model.md)
|
|
88
|
+
|
|
89
|
+
### Contracts
|
|
90
|
+
|
|
91
|
+
- [plan-verbose-output.md](contracts/plan-verbose-output.md)
|
|
92
|
+
|
|
93
|
+
### Quickstart
|
|
94
|
+
|
|
95
|
+
- [quickstart.md](quickstart.md)
|
|
96
|
+
|
|
97
|
+
## Implementation Approach
|
|
98
|
+
|
|
99
|
+
1. Extend `plan` input handling so it can build the same verbose explanation model whether overlays come from explicit flags or an existing manifest.
|
|
100
|
+
2. Reuse one dependency-resolution and explanation path inside `tool/commands/plan.ts` for concise, verbose, JSON, and manifest-driven planning.
|
|
101
|
+
3. Define manifest-aware explanation semantics so manifest-defined overlays remain distinguishable from auto-added dependencies without inventing a separate output format.
|
|
102
|
+
4. Add regression tests for manifest-driven verbose text output, verbose JSON output, and manifest failure paths.
|
|
103
|
+
5. Update README, discovery docs, quickstart guidance, and changelog entries to document manifest-driven verbose planning.
|
|
104
|
+
|
|
105
|
+
## Verification Strategy
|
|
106
|
+
|
|
107
|
+
- Add or update command tests in `tool/__tests__/commands.test.ts` for:
|
|
108
|
+
- verbose text output from direct overlay selection
|
|
109
|
+
- verbose text output from an existing manifest
|
|
110
|
+
- verbose JSON output from an existing manifest
|
|
111
|
+
- manifest failure behavior when the manifest is missing, invalid, or contains invalid overlays
|
|
112
|
+
- non-verbose output remaining unchanged
|
|
113
|
+
- Run `npm test` for automated coverage.
|
|
114
|
+
- Run `npm run lint` to verify TypeScript and formatting constraints.
|
|
115
|
+
- Perform targeted manual validation using the commands documented in `quickstart.md`, including manifest-driven scenarios.
|
|
116
|
+
|
|
117
|
+
## Post-Design Constitution Check
|
|
118
|
+
|
|
119
|
+
- [x] Design still preserves spec-first workflow and traces directly to the approved spec.
|
|
120
|
+
- [x] The planned change preserves overlay contract integrity by extending the existing planning model rather than creating a parallel manifest-only explanation path.
|
|
121
|
+
- [x] Verification remains proportional to risk: command tests plus documentation updates are planned before merge.
|
|
122
|
+
- [x] Documentation synchronization is explicitly included: `README.md`, `docs/discovery-commands.md`, `quickstart.md`, and `CHANGELOG.md`.
|
|
123
|
+
- [x] Simplicity and compatibility remain intact: verbose mode stays opt-in and manifest-driven planning uses the same reasoning model as direct selection.
|
|
124
|
+
|
|
125
|
+
## Complexity Tracking
|
|
126
|
+
|
|
127
|
+
No constitution violations require a design exception.
|