dev-ready 0.5.0__tar.gz → 0.6.0__tar.gz
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.
- {dev_ready-0.5.0 → dev_ready-0.6.0}/PKG-INFO +17 -2
- {dev_ready-0.5.0 → dev_ready-0.6.0}/README-pypi.md +16 -1
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/architecture.md +5 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/cli-spec.md +27 -7
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/requirements.md +3 -4
- dev_ready-0.6.0/docs/v0.6-overview.md +54 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/version-plan.md +14 -4
- {dev_ready-0.5.0 → dev_ready-0.6.0}/pyproject.toml +1 -1
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/__init__.py +1 -1
- dev_ready-0.6.0/src/dev_ready/check.py +195 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/cli.py +50 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/errors.py +31 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/overlay/__init__.py +95 -132
- dev_ready-0.6.0/src/dev_ready/stamp.py +166 -0
- dev_ready-0.6.0/src/dev_ready/upgrade.py +245 -0
- dev_ready-0.6.0/tests/unit/test_check.py +223 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_cli.py +29 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_overlay.py +19 -10
- dev_ready-0.6.0/tests/unit/test_upgrade.py +229 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/uv.lock +1 -1
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.agents/skills/handoff/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.agents/skills/handoff/references/templates.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.agents/skills/planning/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.agents/skills/release/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.agents/skills/review/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.agents/skills/review/references/qa.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.agents/skills/review/references/security.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.agents/skills/review/references/sre.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.claude/skills/handoff/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.claude/skills/planning/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.claude/skills/release/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.claude/skills/review/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.github/dependabot.yml +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.github/workflows/ci.yml +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.github/workflows/release.yml +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.github/workflows/upstream-bump.yml +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.github/workflows/vendored-bump.yml +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.gitignore +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/.python-version +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/AGENTS.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/CLAUDE.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/LICENSE +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/README.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/THIRD_PARTY_NOTICES.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/catalog-candidates.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-001-two-stage-generation-no-fork.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-002-manifest-pinned-upstream.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-003-distribution-via-uvx.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-004-interactive-prompts-escape-hatch.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-005-consume-upstream-via-copier.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-006-manifest-prune-list.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-007-multi-agent-handoff-protocol.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-008-integration-modes-vendor-vs-pinned.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-009-manifest-vendored-provenance.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-010-item-level-catalog-selection.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/decisions/adr-011-agent-config-restructure.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/pin-maintenance.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/releasing.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/v0.1-overview.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/v0.2-overview.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/v0.3-overview.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/v0.4-overview.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/docs/v0.5-overview.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/scripts/bump_upstream.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/scripts/bump_vendored.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/scripts/check_notices_sync.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/scripts/sync_vendored.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/README.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/__main__.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/fetch/__init__.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/fetch/snapshot.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/generate.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/manifest/__init__.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/manifest/loader.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/manifest/models.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/manifest.json +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/prompts/__init__.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/prompts/_questionary_asker.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/prompts/answers.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/prompts/asker.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/prompts/collect.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/report/__init__.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/report/render.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/agents/README.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/agents/phase-N/01-plan.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/agents/phase-N/02-implementation.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/agents/phase-N/03-review.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/agents/phase-N/04-qa-review.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/agents/phase-N/05-security-review.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/agents/phase-N/06-sre-review.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/CLAUDE.md.tmpl +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/caveman/README.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/caveman/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/code-review/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/code-review/agents/openai.yaml +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/diagnosing-bugs/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/diagnosing-bugs/agents/openai.yaml +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/frontend-design/LICENSE.txt +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/frontend-design/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/project-orientation/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/react-doctor/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/AI-AND-LLM.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/ATTACK-CLASSES.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/CLIENT-SIDE.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/HUNTING.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/MEMORY-SAFETY-AND-BINARY.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/RECONNAISSANCE.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/VALIDATION-AND-REPORTING.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/WEB-PROTOCOL-AND-AUTH.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/report-schema.json +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/security-audit/validate-findings.cjs +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/tdd/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/tdd/agents/openai.yaml +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/tdd/mocking.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/tdd/tests.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/webapp-testing/LICENSE.txt +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/webapp-testing/SKILL.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/webapp-testing/examples/console_logging.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/webapp-testing/examples/element_discovery.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/webapp-testing/examples/static_html_automation.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/claude/skills/webapp-testing/scripts/with_server.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/docs/architecture.md.tmpl +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/docs/design-linear.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/docs/design-stripe.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/docs/requirements.md.tmpl +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/mcp/mcp.json +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/templates/readme/README.md.tmpl +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/src/dev_ready/verify.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/templates/README.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/README.md +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/e2e/.gitkeep +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/e2e/test_init_real.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/integration/.gitkeep +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/integration/test_fetch_real.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_bump_upstream.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_fetch.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_generate.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_manifest.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_notices_sync.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_prompts.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_report.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_sync_vendored.py +0 -0
- {dev_ready-0.5.0 → dev_ready-0.6.0}/tests/unit/test_verify.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dev-ready
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Scaffold AI-development-ready FastAPI projects: pinned upstream template plus Claude Code skills, MCP config, and design docs
|
|
5
5
|
License: MIT License
|
|
6
6
|
|
|
@@ -105,9 +105,24 @@ uvx dev-ready init my-app \
|
|
|
105
105
|
--no-agents # skip the agent-team handoff scaffold
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
+
```bash
|
|
109
|
+
# Inspect a generated project against its stamp and the current CLI (read-only)
|
|
110
|
+
uvx dev-ready check path/to/project
|
|
111
|
+
uvx dev-ready check path/to/project --json # machine-readable report
|
|
112
|
+
|
|
113
|
+
# Re-apply managed overlay files to an existing project (never touches app code)
|
|
114
|
+
uvx dev-ready upgrade path/to/project
|
|
115
|
+
uvx dev-ready upgrade path/to/project --dry-run # preview; writes nothing
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
`check` is read-only and offline. `upgrade` re-applies only overlay-managed
|
|
119
|
+
whole files, skips and reports user-modified or shared files, and applies its
|
|
120
|
+
planned writes all-or-nothing. Both commands default to the current directory
|
|
121
|
+
when `PATH` is omitted.
|
|
122
|
+
|
|
108
123
|
Then follow the printed next steps (typically `docker compose watch` inside the generated project).
|
|
109
124
|
|
|
110
|
-
Exit codes: 0 success; 1 unexpected error or user abort; 2 argument error; 3 network/fetch failure; 4 target directory conflict; 5 structural verification failure.
|
|
125
|
+
Exit codes: 0 success; 1 unexpected error or user abort; 2 argument error; 3 network/fetch failure; 4 target directory conflict; 5 structural verification failure; 6 stamp missing or invalid; 7 drift detected; 8 upgrade not supported (pre-v3 stamp; projects generated before v0.6); 9 upgrade failed (rolled back).
|
|
111
126
|
|
|
112
127
|
## How it works
|
|
113
128
|
|
|
@@ -74,9 +74,24 @@ uvx dev-ready init my-app \
|
|
|
74
74
|
--no-agents # skip the agent-team handoff scaffold
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
+
```bash
|
|
78
|
+
# Inspect a generated project against its stamp and the current CLI (read-only)
|
|
79
|
+
uvx dev-ready check path/to/project
|
|
80
|
+
uvx dev-ready check path/to/project --json # machine-readable report
|
|
81
|
+
|
|
82
|
+
# Re-apply managed overlay files to an existing project (never touches app code)
|
|
83
|
+
uvx dev-ready upgrade path/to/project
|
|
84
|
+
uvx dev-ready upgrade path/to/project --dry-run # preview; writes nothing
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`check` is read-only and offline. `upgrade` re-applies only overlay-managed
|
|
88
|
+
whole files, skips and reports user-modified or shared files, and applies its
|
|
89
|
+
planned writes all-or-nothing. Both commands default to the current directory
|
|
90
|
+
when `PATH` is omitted.
|
|
91
|
+
|
|
77
92
|
Then follow the printed next steps (typically `docker compose watch` inside the generated project).
|
|
78
93
|
|
|
79
|
-
Exit codes: 0 success; 1 unexpected error or user abort; 2 argument error; 3 network/fetch failure; 4 target directory conflict; 5 structural verification failure.
|
|
94
|
+
Exit codes: 0 success; 1 unexpected error or user abort; 2 argument error; 3 network/fetch failure; 4 target directory conflict; 5 structural verification failure; 6 stamp missing or invalid; 7 drift detected; 8 upgrade not supported (pre-v3 stamp; projects generated before v0.6); 9 upgrade failed (rolled back).
|
|
80
95
|
|
|
81
96
|
## How it works
|
|
82
97
|
|
|
@@ -55,11 +55,16 @@ ADRs live in `docs/decisions/`, one file per decision (moved out of this file by
|
|
|
55
55
|
| `manifest` | Load/validate manifest.json; single source of truth for pins | be bypassed by other modules |
|
|
56
56
|
| `report` | Post-generation summary and next steps | mutate the generated project |
|
|
57
57
|
| `verify` | Cheap, offline, structural post-generation checks on the staging dir | perform network I/O, write to the project, or run the heavy FR-5 checks (docker build, health endpoint — those run in CI, see Deployment Architecture) |
|
|
58
|
+
| `stamp` | Load, parse, and validate `.dev-ready.json` project stamp | import `fetch` or perform network I/O |
|
|
59
|
+
| `check` | Offline, read-only structural drift inspection of generated project against manifest | import `fetch`, perform network I/O, or modify target project |
|
|
60
|
+
| `upgrade` | Offline re-apply of overlay-managed files onto an existing project; all-or-nothing | import `fetch`, perform network I/O, or touch upstream/non-overlay paths |
|
|
61
|
+
|
|
58
62
|
|
|
59
63
|
## Dependency Rules
|
|
60
64
|
|
|
61
65
|
- Direction: `cli` -> `prompts`/`manifest`/`fetch`/`overlay`/`report`/`verify`. Lower modules never import `cli`.
|
|
62
66
|
- `fetch`, `overlay`, and `verify` are independent of each other; only `generate` (called only by `cli`) sequences them.
|
|
67
|
+
- `upgrade` (called only by `cli`) sequences `overlay` and `stamp` offline, analogous to `generate`.
|
|
63
68
|
- Runtime dependencies are kept minimal (current: questionary, copier — see ADR-005; rich optional). Every new dependency requires a note here.
|
|
64
69
|
- No module reads `manifest.json` directly except `manifest`.
|
|
65
70
|
- `scripts/` (CI-only maintainer tooling, e.g. `scripts/bump_upstream.py`) is not part of the wheel and is not subject to the `fetch/`-only network-call rule above, which governs `src/dev_ready` only.
|
|
@@ -21,13 +21,38 @@ Generate a new project.
|
|
|
21
21
|
|
|
22
22
|
Unknown item ids in `--skills` or `--mcp` fail fast with an invalid-arguments error (exit 2) listing valid item ids. Conflicting flags (e.g. `--no-skills` with `--skills <id>`) exit 2.
|
|
23
23
|
|
|
24
|
-
Exit codes: 0 success; 1 unexpected error or user abort; 2 invalid arguments; 3 network/fetch failure; 4 target directory conflict; 5 generated project failed verification.
|
|
24
|
+
Exit codes: 0 success; 1 unexpected error or user abort; 2 invalid arguments; 3 network/fetch failure; 4 target directory conflict; 5 generated project failed verification; 6 stamp missing or unparseable/invalid; 7 drift detected; 8 upgrade not supported (pre-v3 stamp); 9 upgrade failed (rolled back).
|
|
25
|
+
|
|
26
|
+
### `dev-ready check [PATH]`
|
|
27
|
+
|
|
28
|
+
Inspect an existing generated project directory against its `.dev-ready.json` stamp and the running CLI manifest. Read-only operation.
|
|
29
|
+
|
|
30
|
+
| Flag | Type | Default | Description |
|
|
31
|
+
|---|---|---|---|
|
|
32
|
+
| `PATH` | path | `.` | Target project directory to check |
|
|
33
|
+
| `--json` | bool | false | Output report in JSON format |
|
|
34
|
+
|
|
35
|
+
Exit codes: 0 clean (no drift); 6 stamp missing or unparseable/invalid (including projects generated before v0.3); 7 drift detected.
|
|
36
|
+
|
|
37
|
+
### `dev-ready upgrade [PATH]`
|
|
38
|
+
|
|
39
|
+
Re-apply only overlay-managed whole-file content to an existing generated project. It never touches upstream application code. User-modified files, missing files, and shared injection targets are reported and left unchanged; all planned writes commit all-or-nothing.
|
|
40
|
+
|
|
41
|
+
| Flag | Type | Default | Description |
|
|
42
|
+
|---|---|---|---|
|
|
43
|
+
| `PATH` | path | `.` | Target project directory to upgrade |
|
|
44
|
+
| `--dry-run` | bool | false | Report planned changes without modifying the project |
|
|
45
|
+
|
|
46
|
+
The project stamp is now `stamp_version` 3 and records the project name and a managed-file inventory. Version 1 and 2 stamps remain checkable but cannot be upgraded. Exit codes: 0 success; 6 invalid or missing stamp; 8 pre-v3 stamp cannot be upgraded; 9 upgrade failure after rollback.
|
|
25
47
|
|
|
26
48
|
### `dev-ready --version` / `dev-ready --help`
|
|
27
49
|
|
|
28
50
|
Standard version and help output.
|
|
29
51
|
|
|
30
|
-
## Interactive Prompt Flow (default path)
|
|
52
|
+
## Interactive Prompt Flow (default `init` path)
|
|
53
|
+
|
|
54
|
+
This flow applies only to `init`. `check` and `upgrade` are non-interactive by
|
|
55
|
+
construction and dispatch directly to their respective operations.
|
|
31
56
|
|
|
32
57
|
1. Project name (if not given as argument)
|
|
33
58
|
2. Level-1 component selection (skills / MCP / docs / agents — multi-select, all on by default)
|
|
@@ -41,8 +66,3 @@ All answers collect into a single `Answers` model shared with the flag-based pat
|
|
|
41
66
|
Declining the confirmation, or cancelling any prompt (Ctrl-C), prints `aborted: nothing was written` to stderr and exits 1 — nothing has been written at that point by construction. `--yes` bypasses every prompt in this flow, including confirmation. A non-TTY stdin with missing inputs and no `--yes` fails fast with an invalid-arguments error (exit 2) instead of hanging.
|
|
42
67
|
|
|
43
68
|
**Windows compatibility:** interactive prompts are tested against Windows Terminal. Legacy `cmd.exe` may render the checkbox prompt incorrectly (missing VT/ANSI support). In environments where terminal support is uncertain, use `--yes` with explicit `--no-skills`/`--no-mcp`/`--no-docs`/`--no-agents` flags instead of relying on prompts.
|
|
44
|
-
|
|
45
|
-
## Planned (see docs/version-plan.md)
|
|
46
|
-
|
|
47
|
-
- v0.6 — `dev-ready check` (validate an existing generated project against its `.dev-ready.json` stamp and the manifest) and `dev-ready upgrade` (re-apply overlay-managed files only).
|
|
48
|
-
|
|
@@ -57,8 +57,8 @@ Agreed 2026-07-17. Full detail, rationale, and per-version grouping live in
|
|
|
57
57
|
- FR-18 (v0.4, shipped). THIRD_PARTY_NOTICES ↔ manifest `vendored` sync check in CI.
|
|
58
58
|
- FR-19 (v0.5, shipped). anthropics/skills Apache 2.0 example subset with NOTICE propagation (document-processing skills permanently excluded).
|
|
59
59
|
- FR-20 (v0.5, shipped). Karpathy guardrails content in generated CLAUDE.md — MIT per the upstream README declaration (no standalone LICENSE file; pinned commit preserves the grant), with attribution in NOTICES.
|
|
60
|
-
- FR-21 (v0.6). `dev-ready check`: read-only validation of an existing project against its stamp and the CLI's manifest.
|
|
61
|
-
- FR-22 (v0.6). `dev-ready upgrade`: re-apply overlay-managed files only (per the stamp's item selection); never touches upstream application code
|
|
60
|
+
- FR-21 (v0.6, shipped). `dev-ready check`: read-only validation of an existing project against its stamp and the CLI's manifest.
|
|
61
|
+
- FR-22 (v0.6, shipped). `dev-ready upgrade`: re-apply overlay-managed whole files only (per the stamp's item selection); refuses pre-v3 stamps, never touches upstream application code, and never silently overwrites user edits.
|
|
62
62
|
|
|
63
63
|
## Non-functional Requirements
|
|
64
64
|
|
|
@@ -76,7 +76,6 @@ NFR-5. Cross-platform: macOS, Linux, Windows.
|
|
|
76
76
|
|
|
77
77
|
- Web UI companion (deferred, see roadmap)
|
|
78
78
|
- Support for base templates other than fastapi/full-stack-fastapi-template
|
|
79
|
-
- Post-generation project upgrade/migration commands
|
|
80
79
|
|
|
81
80
|
## Future Roadmap
|
|
82
81
|
|
|
@@ -85,7 +84,7 @@ NFR-5. Cross-platform: macOS, Linux, Windows.
|
|
|
85
84
|
3. v0.3: pinned tool integrations + selection — generation stamp (FR-11), codebase-memory MCP (FR-12), react-doctor (FR-13), item-level selection (FR-14). See [version-plan.md](version-plan.md). DONE (v0.3.0).
|
|
86
85
|
4. v0.4: vendoring infrastructure + MIT wave (FR-15..FR-18). DONE (v0.4.0).
|
|
87
86
|
5. v0.5: Apache wave + karpathy guardrails (FR-19, FR-20). DONE (v0.5.0).
|
|
88
|
-
6. v0.6: lifecycle commands — `check` / `upgrade` (FR-21, FR-22).
|
|
87
|
+
6. v0.6: lifecycle commands — `check` / `upgrade` (FR-21, FR-22). DONE (v0.6.0).
|
|
89
88
|
7. Beyond: additional base templates; possible Web UI companion (decisions deferred).
|
|
90
89
|
|
|
91
90
|
## Pre-start Checklist (carried from planning)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# v0.6 Overview — dev-ready
|
|
2
|
+
|
|
3
|
+
Released: v0.6.0 | Status: Released
|
|
4
|
+
Scope: FR-21, FR-22
|
|
5
|
+
|
|
6
|
+
## What v0.6 shipped
|
|
7
|
+
|
|
8
|
+
dev-ready v0.6 adds two lifecycle commands for projects that have already been
|
|
9
|
+
generated. Both operate from the project's `.dev-ready.json` stamp (FR-11) and
|
|
10
|
+
the running CLI manifest, without network access. The CLI remains argparse-based;
|
|
11
|
+
standard reports are plain text, with an optional JSON report for `check`. This
|
|
12
|
+
release adds no runtime or development dependencies.
|
|
13
|
+
|
|
14
|
+
## Phase 1 — `dev-ready check` (FR-21)
|
|
15
|
+
|
|
16
|
+
- Added offline, read-only drift inspection in `check.py`, which explicitly must
|
|
17
|
+
not import `fetch`, perform network I/O, or modify the target project
|
|
18
|
+
(`src/dev_ready/check.py:1-8`).
|
|
19
|
+
- `check` compares the recorded dev-ready version and upstream pin with the
|
|
20
|
+
running manifest, validates required and forbidden paths, and checks selected
|
|
21
|
+
item pins, paths, and injection effects (`src/dev_ready/check.py:48-175`).
|
|
22
|
+
- Exit code 0 means clean; 6 means a missing or invalid stamp (including a
|
|
23
|
+
pre-v0.3 project); and 7 reports drift. `--json` provides the same report for
|
|
24
|
+
CI (`src/dev_ready/cli.py:75-89`, `src/dev_ready/check.py:158-193`).
|
|
25
|
+
- Read-only behavior is enforced by `test_check_read_only_assertion` in
|
|
26
|
+
`tests/unit/test_check.py`, which compares byte-identical project-tree
|
|
27
|
+
snapshots after clean, JSON, and drift inspections.
|
|
28
|
+
|
|
29
|
+
## Phase 2 — `dev-ready upgrade` (FR-22)
|
|
30
|
+
|
|
31
|
+
- Introduced `stamp_version` 3, adding `project_name` and a SHA-256 inventory of
|
|
32
|
+
managed files (`src/dev_ready/overlay/__init__.py:49-61,112-116`; parsed in
|
|
33
|
+
`src/dev_ready/stamp.py:47-48,136-152`).
|
|
34
|
+
- `upgrade` re-applies only overlay-managed whole files using the stamp's
|
|
35
|
+
recorded item selection. It never touches upstream application code or shared
|
|
36
|
+
injection targets (`src/dev_ready/upgrade.py:107-172`).
|
|
37
|
+
- The conflict rule is conservative: a file whose current hash matches the
|
|
38
|
+
recorded inventory may be replaced; a user-modified file is skipped and
|
|
39
|
+
reported, never silently overwritten (`src/dev_ready/upgrade.py:143-163`).
|
|
40
|
+
- Planned writes are staged with backups and rolled back on failure; `--dry-run`
|
|
41
|
+
previews the report without writing (`src/dev_ready/upgrade.py:189-244`).
|
|
42
|
+
Version-1 and version-2 stamps remain checkable, but upgrade refuses them with
|
|
43
|
+
an explanation and exit code 8 (`src/dev_ready/upgrade.py:89-93`); the other
|
|
44
|
+
upgrade outcomes are 0, 6, and 9.
|
|
45
|
+
|
|
46
|
+
## Notable decisions
|
|
47
|
+
|
|
48
|
+
- No new dependencies: lifecycle commands use the existing standard-library and
|
|
49
|
+
package facilities.
|
|
50
|
+
- Module boundaries hold: `check`, `stamp`, and `upgrade` are offline and do not
|
|
51
|
+
import `fetch`.
|
|
52
|
+
- All-or-nothing behavior now covers `upgrade` as well as initial generation.
|
|
53
|
+
- Read-only `check` and overlay-only `upgrade` behavior are enforced by tests,
|
|
54
|
+
including byte-identical tree assertions, rather than convention alone.
|
|
@@ -92,8 +92,9 @@ the CLI contract changes once, not twice).
|
|
|
92
92
|
FR-11. **Generation stamp.** `generate` writes `.dev-ready.json` at the root of every
|
|
93
93
|
generated project: dev-ready version, selected components *and selected items per
|
|
94
94
|
component* (FR-14), upstream pin (repo + commit), and — from v0.4 on — vendored
|
|
95
|
-
pins.
|
|
96
|
-
`upgrade`d
|
|
95
|
+
pins. Projects generated before v0.3 have no stamp and cannot be `check`ed or
|
|
96
|
+
`upgrade`d; version-1 and version-2 stamps remain checkable but cannot be
|
|
97
|
+
upgraded. Schema is versioned (`stamp_version: 1`). verify treats its presence as
|
|
97
98
|
a required path.
|
|
98
99
|
|
|
99
100
|
FR-12. **Codebase-memory MCP item.** The `mcp` component gains a `code-memory` item:
|
|
@@ -194,15 +195,17 @@ v0.3 by decision, not deferral.)
|
|
|
194
195
|
FR-21. **`dev-ready check`.** Reads `.dev-ready.json` (FR-11) from an existing
|
|
195
196
|
project, compares against the running CLI's manifest: which dev-ready version
|
|
196
197
|
generated it, which components and items, whether pins are behind, whether
|
|
197
|
-
required/forbidden paths still hold.
|
|
198
|
+
required/forbidden paths still hold. It is read-only and exits 0 when clean, 6
|
|
199
|
+
for a missing or invalid stamp, and 7 when drift is detected.
|
|
198
200
|
|
|
199
201
|
FR-22. **`dev-ready upgrade`.** Re-applies a newer overlay onto an existing project.
|
|
200
|
-
Scope deliberately conservative: overlay-managed files only (skills,
|
|
202
|
+
Scope deliberately conservative: overlay-managed whole files only (skills,
|
|
201
203
|
handoff templates, CLAUDE.md sections we own — per the stamp's item selection),
|
|
202
204
|
never upstream application code — that path was closed when `.copier/` was pruned
|
|
203
205
|
(ADR-005 amendment). Conflict rule: never overwrite user-modified files silently;
|
|
204
206
|
report and skip. Requires FR-21's stamp reading plus a recorded file inventory
|
|
205
207
|
(added to the stamp in this version).
|
|
208
|
+
Shared injection targets are reported and left unchanged.
|
|
206
209
|
|
|
207
210
|
Explicitly still out of scope after v0.6: additional base templates, Web UI
|
|
208
211
|
companion — now planned in detail; see "Post-v0.6 roadmap" below.
|
|
@@ -365,3 +368,10 @@ it?" — the same test as the curation principle.
|
|
|
365
368
|
| v0.7 | FR-23 workflow config, FR-24 generate skill | Cheap, self-contained; deepens the existing agents/skills story with no new external surface |
|
|
366
369
|
| v0.8 | FR-25 CLI i18n, FR-26 multi-agent render targets | Widens the audience once content and catalog are stable |
|
|
367
370
|
| v1.0 | FR-27 second template; Web UI decision revisited | Platform step; gated on real-user feedback and the D-5 hard gates |
|
|
371
|
+
|
|
372
|
+
**2026-07-24 — v0.6 close-out re-confirmation (CEO-confirmed, Moofon):**
|
|
373
|
+
At v0.6 close the proposed post-v0.6 sequencing is confirmed unchanged — v0.7 =
|
|
374
|
+
FR-23 (workflow config) + FR-24 (generate skill); v0.8 = FR-25 (CLI i18n) +
|
|
375
|
+
FR-26 (multi-agent render targets); v1.0 = FR-27 (second template) + Web UI
|
|
376
|
+
decision. No amendment. Ratified by the CEO (Moofon) on 2026-07-24; the v0.6.0
|
|
377
|
+
release commit may proceed.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dev-ready"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.6.0"
|
|
4
4
|
description = "Scaffold AI-development-ready FastAPI projects: pinned upstream template plus Claude Code skills, MCP config, and design docs"
|
|
5
5
|
readme = "README-pypi.md"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"""Offline, read-only structural drift inspection module.
|
|
2
|
+
|
|
3
|
+
Compares target project directory state and `.dev-ready.json` stamp against the
|
|
4
|
+
running CLI manifest and expected filesystem layout.
|
|
5
|
+
|
|
6
|
+
Must not import `dev_ready.fetch`, perform network I/O, or modify target project.
|
|
7
|
+
See docs/architecture.md.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import json
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import Any
|
|
13
|
+
|
|
14
|
+
from dev_ready import __version__
|
|
15
|
+
from dev_ready.errors import DriftError
|
|
16
|
+
from dev_ready.manifest import CatalogItem, load_default_manifest
|
|
17
|
+
from dev_ready.stamp import load_stamp
|
|
18
|
+
from dev_ready.verify import FORBIDDEN_PATHS, REQUIRED_OVERLAY_PATHS, REQUIRED_UPSTREAM_PATHS, _check_inject_present
|
|
19
|
+
|
|
20
|
+
__all__ = ["check_project"]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _is_path_safe(base_dir: Path, target_path: Path) -> bool:
|
|
25
|
+
"""Ensure `target_path` is strictly contained within `base_dir`."""
|
|
26
|
+
try:
|
|
27
|
+
base_resolved = base_dir.resolve()
|
|
28
|
+
target_resolved = target_path.resolve()
|
|
29
|
+
return base_resolved == target_resolved or base_resolved in target_resolved.parents
|
|
30
|
+
except OSError:
|
|
31
|
+
return False
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def check_project(project_dir: Path, json_output: bool = False) -> str:
|
|
35
|
+
"""Inspect `project_dir` for structural or pin drift.
|
|
36
|
+
|
|
37
|
+
Returns formatted report string if clean.
|
|
38
|
+
Raises `DriftError` containing detailed drift report if any drift is found.
|
|
39
|
+
Never mutates target project directory under any code path.
|
|
40
|
+
"""
|
|
41
|
+
resolved_dir = project_dir.resolve()
|
|
42
|
+
stamp = load_stamp(project_dir)
|
|
43
|
+
manifest = load_default_manifest()
|
|
44
|
+
|
|
45
|
+
drifts: list[str] = []
|
|
46
|
+
vendored_map = {v.repo: v.commit for v in manifest.vendored}
|
|
47
|
+
|
|
48
|
+
# 1. Upstream pin check
|
|
49
|
+
current_upstream = manifest.upstream.get("base_template")
|
|
50
|
+
if current_upstream is None:
|
|
51
|
+
drifts.append("[manifest error] base_template missing from current manifest")
|
|
52
|
+
else:
|
|
53
|
+
if (
|
|
54
|
+
stamp.upstream.repo != current_upstream.repo
|
|
55
|
+
or stamp.upstream.commit != current_upstream.commit
|
|
56
|
+
):
|
|
57
|
+
drifts.append(
|
|
58
|
+
f"[upstream pin drift] recorded {stamp.upstream.repo}@{stamp.upstream.commit[:7]} "
|
|
59
|
+
f"differs from current {current_upstream.repo}@{current_upstream.commit[:7]}"
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# 2. Required upstream & overlay paths
|
|
63
|
+
for rel_path in REQUIRED_UPSTREAM_PATHS:
|
|
64
|
+
target = resolved_dir / rel_path
|
|
65
|
+
if not _is_path_safe(resolved_dir, target):
|
|
66
|
+
drifts.append(f"[security error] unsafe path traversal detected for path '{rel_path}'")
|
|
67
|
+
continue
|
|
68
|
+
if not target.exists():
|
|
69
|
+
drifts.append(f"[missing upstream path] required path '{rel_path}' is missing")
|
|
70
|
+
|
|
71
|
+
for rel_path in REQUIRED_OVERLAY_PATHS:
|
|
72
|
+
target = resolved_dir / rel_path
|
|
73
|
+
if not _is_path_safe(resolved_dir, target):
|
|
74
|
+
drifts.append(f"[security error] unsafe path traversal detected for path '{rel_path}'")
|
|
75
|
+
continue
|
|
76
|
+
if not target.exists():
|
|
77
|
+
drifts.append(f"[missing overlay path] required path '{rel_path}' is missing")
|
|
78
|
+
|
|
79
|
+
# Always required overlay files
|
|
80
|
+
for req_file in ("CLAUDE.md", "README.md"):
|
|
81
|
+
target = resolved_dir / req_file
|
|
82
|
+
if not target.exists():
|
|
83
|
+
drifts.append(f"[missing overlay file] required file '{req_file}' is missing")
|
|
84
|
+
|
|
85
|
+
# Optional component root paths
|
|
86
|
+
if stamp.docs_included:
|
|
87
|
+
if not (resolved_dir / "docs").exists():
|
|
88
|
+
drifts.append("[missing overlay directory] recorded 'docs' component but 'docs/' directory is missing")
|
|
89
|
+
|
|
90
|
+
if stamp.agents_included:
|
|
91
|
+
if not (resolved_dir / "docs" / "handoffs").exists():
|
|
92
|
+
drifts.append(
|
|
93
|
+
"[missing overlay directory] recorded 'agents' component but 'docs/handoffs/' directory is missing"
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# 3. Forbidden paths
|
|
97
|
+
for rel_path in FORBIDDEN_PATHS:
|
|
98
|
+
target = resolved_dir / rel_path
|
|
99
|
+
if target.exists():
|
|
100
|
+
drifts.append(f"[forbidden path present] target directory contains forbidden path '{rel_path}'")
|
|
101
|
+
|
|
102
|
+
# 4. Item selection and pin checks
|
|
103
|
+
def _verify_component_items(
|
|
104
|
+
comp_name: str, stamp_items: tuple[Any, ...], catalog_items: tuple[CatalogItem, ...]
|
|
105
|
+
) -> None:
|
|
106
|
+
catalog_map = {item.id: item for item in catalog_items}
|
|
107
|
+
for s_item in stamp_items:
|
|
108
|
+
item_id = s_item.id
|
|
109
|
+
recorded_pin = s_item.pin
|
|
110
|
+
|
|
111
|
+
if item_id not in catalog_map:
|
|
112
|
+
drifts.append(
|
|
113
|
+
f"[removed catalog item] recorded {comp_name} item '{item_id}' is no longer present in CLI catalog"
|
|
114
|
+
)
|
|
115
|
+
continue
|
|
116
|
+
|
|
117
|
+
cat_item = catalog_map[item_id]
|
|
118
|
+
|
|
119
|
+
# Pin check for stamp version 2
|
|
120
|
+
if stamp.stamp_version >= 2 and recorded_pin is not None:
|
|
121
|
+
expected_pin = cat_item.pin
|
|
122
|
+
if (
|
|
123
|
+
cat_item.mode == "vendor"
|
|
124
|
+
and cat_item.vendored_repo
|
|
125
|
+
and cat_item.vendored_repo in vendored_map
|
|
126
|
+
):
|
|
127
|
+
expected_pin = vendored_map[cat_item.vendored_repo]
|
|
128
|
+
|
|
129
|
+
if recorded_pin != expected_pin:
|
|
130
|
+
drifts.append(
|
|
131
|
+
f"[{comp_name} pin drift] item '{item_id}' pin recorded '{recorded_pin}' "
|
|
132
|
+
f"differs from current '{expected_pin}'"
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
# Paths check for item
|
|
136
|
+
for item_path in cat_item.paths:
|
|
137
|
+
dest_path = resolved_dir / item_path.dest
|
|
138
|
+
if not _is_path_safe(resolved_dir, dest_path):
|
|
139
|
+
drifts.append(
|
|
140
|
+
f"[security error] item '{item_id}' destination '{item_path.dest}' escapes target directory"
|
|
141
|
+
)
|
|
142
|
+
continue
|
|
143
|
+
if not dest_path.exists():
|
|
144
|
+
drifts.append(
|
|
145
|
+
f"[missing item path] selected {comp_name} item '{item_id}' path '{item_path.dest}' is missing"
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
# Inject effect check
|
|
149
|
+
if cat_item.inject is not None:
|
|
150
|
+
if not _check_inject_present(resolved_dir, cat_item):
|
|
151
|
+
drifts.append(
|
|
152
|
+
f"[missing inject effect] selected {comp_name} item '{item_id}' missing inject effect in '{cat_item.inject.target}'"
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
_verify_component_items("skills", stamp.skills_items, manifest.components.get("skills", ()))
|
|
156
|
+
_verify_component_items("mcp", stamp.mcp_items, manifest.components.get("mcp", ()))
|
|
157
|
+
|
|
158
|
+
report_data = {
|
|
159
|
+
"project_dir": str(resolved_dir),
|
|
160
|
+
"stamp_version": stamp.stamp_version,
|
|
161
|
+
"dev_ready_version_recorded": stamp.dev_ready_version,
|
|
162
|
+
"dev_ready_version_current": __version__,
|
|
163
|
+
"upstream_pin_recorded": {"repo": stamp.upstream.repo, "commit": stamp.upstream.commit},
|
|
164
|
+
"upstream_pin_current": (
|
|
165
|
+
{"repo": current_upstream.repo, "commit": current_upstream.commit}
|
|
166
|
+
if current_upstream
|
|
167
|
+
else None
|
|
168
|
+
),
|
|
169
|
+
"clean": len(drifts) == 0,
|
|
170
|
+
"drift_count": len(drifts),
|
|
171
|
+
"drifts": drifts,
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if json_output:
|
|
175
|
+
formatted_report = json.dumps(report_data, indent=2) + "\n"
|
|
176
|
+
else:
|
|
177
|
+
lines = [
|
|
178
|
+
f"dev-ready check report for {resolved_dir}",
|
|
179
|
+
f"Generated with: dev-ready {stamp.dev_ready_version} (stamp version {stamp.stamp_version})",
|
|
180
|
+
f"Current CLI: dev-ready {__version__}",
|
|
181
|
+
f"Upstream pin: {stamp.upstream.repo}@{stamp.upstream.commit[:7]}",
|
|
182
|
+
"",
|
|
183
|
+
]
|
|
184
|
+
if drifts:
|
|
185
|
+
lines.append(f"Drift detected ({len(drifts)} items):")
|
|
186
|
+
for drift in drifts:
|
|
187
|
+
lines.append(f" - {drift}")
|
|
188
|
+
else:
|
|
189
|
+
lines.append("Status: CLEAN (0 drift detected)")
|
|
190
|
+
formatted_report = "\n".join(lines) + "\n"
|
|
191
|
+
|
|
192
|
+
if drifts:
|
|
193
|
+
raise DriftError(formatted_report.rstrip())
|
|
194
|
+
|
|
195
|
+
return formatted_report
|
|
@@ -12,11 +12,13 @@ from collections.abc import Mapping
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
|
|
14
14
|
from dev_ready import __version__
|
|
15
|
+
from dev_ready.check import check_project
|
|
15
16
|
from dev_ready.errors import AbortedError, DevReadyError, InvalidArgumentsError
|
|
16
17
|
from dev_ready.generate import generate
|
|
17
18
|
from dev_ready.manifest import CatalogItem, load_default_manifest
|
|
18
19
|
from dev_ready.prompts import Answers, PartialAnswers, collect_answers, confirm_generation
|
|
19
20
|
from dev_ready.report import render_report
|
|
21
|
+
from dev_ready.upgrade import upgrade_project
|
|
20
22
|
|
|
21
23
|
_PROJECT_NAME_PATTERN = re.compile(r"^[a-zA-Z0-9][a-zA-Z0-9._-]*$")
|
|
22
24
|
|
|
@@ -69,9 +71,40 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
69
71
|
init_parser.add_argument(
|
|
70
72
|
"--no-agents", action="store_true", help="Exclude the agent-team handoff scaffold (docs/handoffs/)."
|
|
71
73
|
)
|
|
74
|
+
|
|
75
|
+
check_parser = subparsers.add_parser(
|
|
76
|
+
"check", help="Inspect an existing project for structural or pin drift"
|
|
77
|
+
)
|
|
78
|
+
check_parser.add_argument(
|
|
79
|
+
"target_dir",
|
|
80
|
+
nargs="?",
|
|
81
|
+
type=Path,
|
|
82
|
+
default=Path("."),
|
|
83
|
+
help="Target project directory to check (default: .)",
|
|
84
|
+
)
|
|
85
|
+
check_parser.add_argument(
|
|
86
|
+
"--json",
|
|
87
|
+
action="store_true",
|
|
88
|
+
help="Output report in JSON format",
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
upgrade_parser = subparsers.add_parser(
|
|
92
|
+
"upgrade", help="Re-apply managed overlay files without touching application code"
|
|
93
|
+
)
|
|
94
|
+
upgrade_parser.add_argument(
|
|
95
|
+
"target_dir",
|
|
96
|
+
nargs="?",
|
|
97
|
+
type=Path,
|
|
98
|
+
default=Path("."),
|
|
99
|
+
help="Target project directory to upgrade (default: .)",
|
|
100
|
+
)
|
|
101
|
+
upgrade_parser.add_argument(
|
|
102
|
+
"--dry-run", action="store_true", help="Report planned changes without writing files"
|
|
103
|
+
)
|
|
72
104
|
return parser
|
|
73
105
|
|
|
74
106
|
|
|
107
|
+
|
|
75
108
|
def _resolve_item_selection(
|
|
76
109
|
component: str, raw_value: str | None, no_flag: bool, catalog_ids: frozenset[str]
|
|
77
110
|
) -> frozenset[str] | None:
|
|
@@ -223,6 +256,19 @@ def _run_init(args: argparse.Namespace) -> int:
|
|
|
223
256
|
return 0
|
|
224
257
|
|
|
225
258
|
|
|
259
|
+
def _run_check(args: argparse.Namespace) -> int:
|
|
260
|
+
target_dir = args.target_dir if args.target_dir is not None else Path(".")
|
|
261
|
+
report = check_project(target_dir, json_output=args.json)
|
|
262
|
+
print(report, end="")
|
|
263
|
+
return 0
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def _run_upgrade(args: argparse.Namespace) -> int:
|
|
267
|
+
report = upgrade_project(args.target_dir, dry_run=args.dry_run)
|
|
268
|
+
print(report, end="")
|
|
269
|
+
return 0
|
|
270
|
+
|
|
271
|
+
|
|
226
272
|
def main(argv: list[str] | None = None) -> int:
|
|
227
273
|
parser = build_parser()
|
|
228
274
|
args = parser.parse_args(argv)
|
|
@@ -232,6 +278,10 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
232
278
|
try:
|
|
233
279
|
if args.command == "init":
|
|
234
280
|
return _run_init(args)
|
|
281
|
+
if args.command == "check":
|
|
282
|
+
return _run_check(args)
|
|
283
|
+
if args.command == "upgrade":
|
|
284
|
+
return _run_upgrade(args)
|
|
235
285
|
raise InvalidArgumentsError(f"unknown command: {args.command}")
|
|
236
286
|
except AbortedError:
|
|
237
287
|
print("aborted: nothing was written", file=sys.stderr)
|
|
@@ -51,3 +51,34 @@ class VerificationError(DevReadyError):
|
|
|
51
51
|
"""Generated project failed a post-generation structural check."""
|
|
52
52
|
|
|
53
53
|
exit_code = 5
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class StampMissingError(DevReadyError):
|
|
57
|
+
"""The target directory is missing a .dev-ready.json stamp file."""
|
|
58
|
+
|
|
59
|
+
exit_code = 6
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class StampInvalidError(DevReadyError):
|
|
63
|
+
"""The .dev-ready.json stamp is unparseable or has an invalid schema/version."""
|
|
64
|
+
|
|
65
|
+
exit_code = 6
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class DriftError(DevReadyError):
|
|
69
|
+
"""The project state has drifted from the running CLI manifest or required paths."""
|
|
70
|
+
|
|
71
|
+
exit_code = 7
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class UpgradeNotSupportedError(DevReadyError):
|
|
75
|
+
"""The project's stamp predates the upgrade inventory."""
|
|
76
|
+
|
|
77
|
+
exit_code = 8
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class UpgradeError(DevReadyError):
|
|
81
|
+
"""An upgrade failed after changes began and was rolled back."""
|
|
82
|
+
|
|
83
|
+
exit_code = 9
|
|
84
|
+
|