@polymorphism-tech/morph-spec 10.12.1 → 11.0.0
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/CLAUDE.md +27 -57
- package/README.md +51 -340
- package/bin/morph-spec.js +22 -373
- package/docs/CHEATSHEET.md +37 -166
- package/docs/QUICKSTART.md +14 -74
- package/framework/CLAUDE.md +15 -26
- package/framework/MORPH.md +34 -101
- package/framework/agents.json +8 -8
- package/framework/commands/morph-apply.md +5 -5
- package/framework/commands/morph-infra.md +1 -1
- package/framework/docs/CLI.md +74 -886
- package/framework/evals/review-checklist.md +14 -14
- package/framework/hooks/README.md +21 -189
- package/framework/hooks/claude-code/core/README.md +2 -5
- package/framework/hooks/claude-code/core/conventional-commit.js +2 -2
- package/framework/hooks/claude-code/core/denylist.json +3 -3
- package/framework/hooks/claude-code/core/graph-refresh-kick.js +2 -2
- package/framework/hooks/claude-code/core/masked-exit.js +6 -6
- package/framework/hooks/claude-code/core/pre-bash-denylist.js +2 -2
- package/framework/hooks/claude-code/core/protect-spec-files.js +17 -61
- package/framework/hooks/claude-code/core/stack-changed.js +35 -0
- package/framework/hooks/claude-code/core/validate-completion.js +32 -87
- package/framework/hooks/shared/{heavy-command.js → command-kind.js} +6 -79
- package/framework/hooks/shared/command-tokens.js +0 -139
- package/framework/hooks/shared/contract.js +14 -0
- package/framework/hooks/shared/feature-slug.js +21 -0
- package/framework/hooks/shared/frontend-locations.js +0 -1
- package/framework/hooks/shared/git-paths.js +0 -15
- package/framework/hooks/shared/graph-freshness.js +0 -19
- package/framework/hooks/shared/hook-response.js +0 -7
- package/framework/hooks/shared/morph-cli.js +2 -81
- package/framework/hooks/shared/owner-words.js +2 -120
- package/framework/hooks/shared/payload-utils.js +0 -39
- package/framework/hooks/shared/report-progress.js +7 -101
- package/framework/hooks/statusline.js +16 -60
- package/framework/mcp/registry.json +2 -2
- package/framework/rules/ai-agents-standards.md +1 -1
- package/framework/rules/asaas-standards.md +1 -1
- package/framework/rules/ef-standards.md +1 -1
- package/framework/rules/gsap-standards.md +1 -1
- package/framework/rules/hangfire-standards.md +1 -1
- package/framework/rules/implement-report.md +3 -3
- package/framework/rules/neon-auth-standards.md +1 -1
- package/framework/rules/nextjs-standards.md +1 -1
- package/framework/rules/plan-grammar.md +13 -11
- package/framework/rules/resend-standards.md +1 -1
- package/framework/rules/ui-design.md +4 -0
- package/framework/schemas/config.schema.json +95 -310
- package/framework/skills/README.md +12 -32
- package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
- package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
- package/framework/skills/core/morph-apply/SKILL.md +21 -46
- package/framework/skills/core/morph-plan/SKILL.md +28 -63
- package/framework/skills/core/morph-uiux/SKILL.md +23 -25
- package/framework/{templates/docs/ui-mockups.md → skills/core/morph-uiux/references/mockups.md} +4 -4
- package/framework/standards/STANDARDS.json +10 -11
- package/framework/standards/STANDARDS.meta.json +1 -1
- package/framework/standards/ai-agents/evals-with-cache.md +18 -32
- package/framework/standards/ai-agents/observability-patterns.md +2 -2
- package/framework/standards/architecture/code-comments.md +2 -5
- package/framework/standards/architecture/engineering-lens.md +1 -1
- package/framework/standards/backend/dotnet/testing.md +4 -4
- package/framework/standards/frontend/nextjs/lint.md +24 -10
- package/framework/standards/frontend/nextjs/testing.md +2 -2
- package/framework/standards/infrastructure/docker/local-compose-isolation.md +14 -30
- package/framework/templates/CLAUDE.md.core.guide.md +2 -2
- package/framework/templates/README.md +1 -1
- package/framework/templates/REGISTRY.json +3 -33
- package/framework/templates/docs/plan.md +3 -2
- package/framework/templates/dotnet/ai-kit/README.md +2 -4
- package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Evals/EvalCacheMissException.cs +1 -1
- package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Evals/EvalFixture.cs +1 -1
- package/package.json +1 -2
- package/src/commands/graph/explain.js +2 -1
- package/src/commands/graph/status.js +2 -1
- package/src/commands/mcp/mcp-setup.js +1 -2
- package/src/commands/project/doctor.js +5 -341
- package/src/commands/project/env.js +21 -52
- package/src/commands/project/init-contract.js +47 -0
- package/src/commands/project/init.js +36 -66
- package/src/commands/project/stack-scan.js +1 -1
- package/src/commands/project/update.js +15 -50
- package/src/commands/validation/check.js +128 -0
- package/src/commands/validation/plan-check.js +41 -64
- package/src/commands/validation/prove-red.js +1 -1
- package/src/core/paths/output-schema.js +0 -22
- package/src/core/templates/template-renderer.js +0 -14
- package/src/lib/ai/ai-project-scan.js +1 -6
- package/src/lib/check/attempts.js +38 -0
- package/src/lib/check/signals.js +145 -0
- package/src/lib/config/project-config.js +13 -0
- package/src/lib/contract/apply.js +62 -0
- package/src/lib/contract/defaults.js +96 -0
- package/src/lib/contract/merge.js +79 -0
- package/src/lib/contract/ports.js +43 -0
- package/src/lib/contract/scan.js +102 -0
- package/src/lib/detectors/claude-config-detector.js +7 -0
- package/src/lib/{procs → detectors}/mcp-config.js +1 -37
- package/src/lib/diff/diff-lines.js +64 -0
- package/src/lib/generators/architecture-scanner.js +1 -1
- package/src/lib/generators/scaffold-generator.js +0 -7
- package/src/lib/git/default-branch.js +0 -122
- package/src/lib/graph/diff-tree.js +2 -1
- package/src/lib/graph/god-nodes.js +2 -1
- package/src/lib/graph/graphify-runtime.js +0 -1
- package/src/lib/graph/graphifyignore.js +1 -1
- package/src/lib/graph/sanitize.js +2 -8
- package/src/lib/installers/memory-installer.js +15 -30
- package/src/lib/installers/stack-sync.js +16 -9
- package/src/lib/plan/checks.js +20 -64
- package/src/lib/plan/media.js +1 -1
- package/src/lib/plan/plan-parser.js +5 -5
- package/src/lib/review-reports.js +3 -77
- package/src/lib/scan/worktree-dirs.js +3 -0
- package/src/lib/specs/adr-index.js +2 -2
- package/src/lib/stack/dotnet-build-ignores.js +10 -2
- package/src/lib/stack/stack-scan.js +2 -2
- package/src/lib/stack-filter.js +3 -2
- package/src/lib/tests-audit/audit.js +1 -1
- package/src/scripts/setup-infra.js +6 -59
- package/src/utils/agents-installer.js +1 -34
- package/src/utils/atomic-json.js +27 -0
- package/src/utils/file-copier.js +4 -12
- package/src/utils/hooks-installer.js +9 -107
- package/claude-plugin.json +0 -14
- package/framework/commands/morph-archive.md +0 -46
- package/framework/commands/morph-hotfix.md +0 -17
- package/framework/commands/morph-preflight.md +0 -180
- package/framework/commands/morph-review.md +0 -15
- package/framework/commands/morph-status.md +0 -37
- package/framework/hooks/claude-code/core/block-destructive-worktree-removal.js +0 -80
- package/framework/hooks/claude-code/core/block-raw-worktree-add.js +0 -72
- package/framework/hooks/claude-code/core/enforce-phase-writes.js +0 -100
- package/framework/hooks/claude-code/core/gate-guard.js +0 -148
- package/framework/hooks/claude-code/core/heavy-gate.js +0 -78
- package/framework/hooks/claude-code/core/heavy-release.js +0 -23
- package/framework/hooks/claude-code/core/loop-detect.js +0 -79
- package/framework/hooks/claude-code/core/state-sync.js +0 -214
- package/framework/hooks/claude-code/core/telemetry-log.js +0 -259
- package/framework/hooks/claude-code/core/test-budget.js +0 -29
- package/framework/hooks/claude-code/core/worktree-context.js +0 -249
- package/framework/hooks/claude-code/core/worktree-create.js +0 -119
- package/framework/hooks/claude-code/core/worktree-env-inject.js +0 -68
- package/framework/hooks/claude-code/core/worktree-remove.js +0 -55
- package/framework/hooks/shared/build-check.js +0 -120
- package/framework/hooks/shared/claim-registry.js +0 -125
- package/framework/hooks/shared/e2e-check.js +0 -1022
- package/framework/hooks/shared/feature-locator.js +0 -82
- package/framework/hooks/shared/gate-event.js +0 -18
- package/framework/hooks/shared/gate-question.js +0 -20
- package/framework/hooks/shared/heavy-config.js +0 -113
- package/framework/hooks/shared/heavy-holders.js +0 -85
- package/framework/hooks/shared/heavy-slots.js +0 -280
- package/framework/hooks/shared/host-services.js +0 -440
- package/framework/hooks/shared/next-step.js +0 -181
- package/framework/hooks/shared/redact-secrets.js +0 -44
- package/framework/hooks/shared/reparse-scan.js +0 -40
- package/framework/hooks/shared/state-reader.js +0 -220
- package/framework/hooks/shared/state-writer.js +0 -112
- package/framework/hooks/shared/telemetry-logger.js +0 -101
- package/framework/hooks/shared/transcript-usage.js +0 -58
- package/framework/hooks/shared/worktree-root.js +0 -71
- package/framework/phases.json +0 -92
- package/framework/schemas/feature.schema.json +0 -242
- package/framework/skills/core/morph-apply/references/hotfix.md +0 -46
- package/framework/skills/core/morph-apply/references/machine.md +0 -30
- package/framework/skills/core/morph-apply/references/review.md +0 -77
- package/framework/skills/core/morph-plan/references/critique.md +0 -51
- package/framework/skills/core/morph-plan/references/interview.md +0 -37
- package/framework/templates/state.template.json +0 -17
- package/src/commands/dashboard/dashboard.js +0 -74
- package/src/commands/e2e/e2e.js +0 -400
- package/src/commands/observability/cost.js +0 -283
- package/src/commands/project/branch.js +0 -129
- package/src/commands/project/claim.js +0 -132
- package/src/commands/project/doctor-procs.js +0 -162
- package/src/commands/project/fleet.js +0 -66
- package/src/commands/project/heavy.js +0 -81
- package/src/commands/project/install-plugin-cmd.js +0 -27
- package/src/commands/project/status.js +0 -61
- package/src/commands/project/worktree.js +0 -1234
- package/src/commands/state/advance.js +0 -248
- package/src/commands/state/approve.js +0 -303
- package/src/commands/state/archive.js +0 -231
- package/src/commands/state/auto-approval.js +0 -67
- package/src/commands/state/create.js +0 -274
- package/src/commands/state/delete.js +0 -192
- package/src/commands/state/finish.js +0 -1247
- package/src/commands/state/gate-check.js +0 -244
- package/src/commands/state/gate-decision.js +0 -122
- package/src/commands/state/list.js +0 -244
- package/src/commands/state/next.js +0 -24
- package/src/commands/state/recap.js +0 -80
- package/src/commands/state/report-check.js +0 -244
- package/src/commands/state/retype.js +0 -110
- package/src/commands/validation/verify.js +0 -421
- package/src/core/state/feature-identity.js +0 -10
- package/src/core/state/gate-order.js +0 -23
- package/src/core/state/lifecycle-audit.js +0 -171
- package/src/core/state/state-manager.js +0 -523
- package/src/core/templates/template-seed.js +0 -21
- package/src/core/work-types.js +0 -44
- package/src/dashboard/app/App.jsx +0 -84
- package/src/dashboard/app/components/ActivityFeed.jsx +0 -166
- package/src/dashboard/app/components/CommandPalette.jsx +0 -144
- package/src/dashboard/app/components/DetailPanel.jsx +0 -43
- package/src/dashboard/app/components/EntityLink.jsx +0 -42
- package/src/dashboard/app/components/ErrorBoundary.jsx +0 -47
- package/src/dashboard/app/components/FlowGraph.jsx +0 -19
- package/src/dashboard/app/components/GatePauses.jsx +0 -116
- package/src/dashboard/app/components/KnowledgeMarkdown.jsx +0 -42
- package/src/dashboard/app/components/Markdown.jsx +0 -38
- package/src/dashboard/app/components/PhaseRail.jsx +0 -100
- package/src/dashboard/app/components/SearchFilter.jsx +0 -36
- package/src/dashboard/app/components/SessionMap.jsx +0 -77
- package/src/dashboard/app/components/Sidebar.jsx +0 -147
- package/src/dashboard/app/hooks/useMorphQuery.js +0 -44
- package/src/dashboard/app/hooks/usePref.js +0 -34
- package/src/dashboard/app/lib/format.js +0 -69
- package/src/dashboard/app/lib/phases.js +0 -75
- package/src/dashboard/app/lib/project.js +0 -38
- package/src/dashboard/app/main.jsx +0 -13
- package/src/dashboard/app/pages/Activity.jsx +0 -28
- package/src/dashboard/app/pages/AgentMap.jsx +0 -363
- package/src/dashboard/app/pages/FeatureDetail.jsx +0 -579
- package/src/dashboard/app/pages/Features.jsx +0 -393
- package/src/dashboard/app/pages/Guide.jsx +0 -145
- package/src/dashboard/app/pages/HookInspector.jsx +0 -444
- package/src/dashboard/app/pages/PhasePipeline.jsx +0 -273
- package/src/dashboard/app/pages/Portfolio.jsx +0 -190
- package/src/dashboard/app/pages/RulesMap.jsx +0 -285
- package/src/dashboard/app/pages/SkillsLibrary.jsx +0 -468
- package/src/dashboard/app/pages/Standards.jsx +0 -392
- package/src/dashboard/app/styles/index.css +0 -187
- package/src/dashboard/index.html +0 -14
- package/src/dashboard/package.json +0 -32
- package/src/dashboard/scanner/activity-scanner.js +0 -321
- package/src/dashboard/scanner/agents-scanner.js +0 -67
- package/src/dashboard/scanner/docs-scanner.js +0 -34
- package/src/dashboard/scanner/feature-status.js +0 -7
- package/src/dashboard/scanner/features-scanner.js +0 -397
- package/src/dashboard/scanner/hooks-scanner.js +0 -96
- package/src/dashboard/scanner/index.js +0 -21
- package/src/dashboard/scanner/phases-scanner.js +0 -14
- package/src/dashboard/scanner/portfolio.js +0 -129
- package/src/dashboard/scanner/project-api.js +0 -160
- package/src/dashboard/scanner/rules-scanner.js +0 -46
- package/src/dashboard/scanner/skills-scanner.js +0 -104
- package/src/dashboard/scanner/standards-scanner.js +0 -38
- package/src/dashboard/vite-plugin-morph-data.js +0 -120
- package/src/dashboard/vite.config.js +0 -26
- package/src/lib/ci/ci-verify.js +0 -30
- package/src/lib/ci/github-ci.js +0 -52
- package/src/lib/ci/pr-checks.js +0 -76
- package/src/lib/e2e/applicability.js +0 -39
- package/src/lib/e2e/compose-env.js +0 -80
- package/src/lib/e2e/stack-teardown.js +0 -96
- package/src/lib/git/branch-classifier.js +0 -104
- package/src/lib/git/evidence-staleness.js +0 -40
- package/src/lib/git/gh.js +0 -15
- package/src/lib/git/pending-prs.js +0 -58
- package/src/lib/git/pr-files.js +0 -31
- package/src/lib/git/pr-index.js +0 -39
- package/src/lib/git/tree-fingerprint.js +0 -58
- package/src/lib/git/tree-state.js +0 -125
- package/src/lib/heavy/cleanup.js +0 -72
- package/src/lib/heavy/gate.js +0 -168
- package/src/lib/heavy/live-stacks.js +0 -64
- package/src/lib/heavy/reclaim.js +0 -107
- package/src/lib/heavy/watchdog.js +0 -46
- package/src/lib/next-step.js +0 -12
- package/src/lib/plan/critique.js +0 -67
- package/src/lib/plan/plan-template.js +0 -18
- package/src/lib/procs/classify.js +0 -91
- package/src/lib/procs/list.js +0 -124
- package/src/lib/procs/prune.js +0 -47
- package/src/lib/procs/wslconfig.js +0 -70
- package/src/lib/projects/registry.js +0 -121
- package/src/lib/recap/piper.js +0 -36
- package/src/lib/recap/recap.js +0 -259
- package/src/lib/review-confirmation.js +0 -66
- package/src/lib/risk/diff-risk.js +0 -137
- package/src/lib/risk-detector.js +0 -638
- package/src/lib/specs/design-seed.js +0 -18
- package/src/lib/specs/screen-checklist.js +0 -315
- package/src/lib/stack/stack-profile.js +0 -69
- package/src/lib/tasks/eval-node.js +0 -293
- package/src/lib/tasks/linux-runner.js +0 -200
- package/src/lib/tasks/test-nodes.js +0 -414
- package/src/lib/tasks/test-runner.js +0 -569
- package/src/lib/telemetry/metrics.js +0 -384
- package/src/lib/telemetry/telemetry-reader.js +0 -276
- package/src/lib/telemetry/verify-event.js +0 -57
- package/src/lib/validators/code-budget/code-budget-validator.js +0 -170
- package/src/lib/validators/contracts/contract-compliance-validator.js +0 -219
- package/src/lib/validators/nextjs/next-component-validator.js +0 -142
- package/src/lib/validators/packages/package-validator.js +0 -310
- package/src/lib/validators/reuse/reuse-validator.js +0 -202
- package/src/lib/validators/reuse/symbol-scanner.js +0 -64
- package/src/lib/validators/validation-runner.js +0 -188
- package/src/lib/validators/verify-cache.js +0 -63
- package/src/lib/validators/verify-runner.js +0 -971
- package/src/lib/verify/affected.js +0 -143
- package/src/lib/verify/detached.js +0 -159
- package/src/lib/view/feature-html.js +0 -480
- package/src/lib/view/feature-page.client.js +0 -109
- package/src/lib/view/feature-page.css +0 -278
- package/src/lib/view/feature-view.js +0 -113
- package/src/lib/view/flow-layers.js +0 -79
- package/src/lib/view/flow-svg.js +0 -63
- package/src/lib/view/tokens.css +0 -18
- package/src/lib/work-type-detector.js +0 -81
- package/src/lib/worktree/dirs.js +0 -3
- package/src/lib/worktree/docker-audit.js +0 -175
- package/src/lib/worktree/env-allocator.js +0 -177
- package/src/lib/worktree/feature-truth.js +0 -145
- package/src/lib/worktree/finish-backup.js +0 -529
- package/src/lib/worktree/fleet-scanner.js +0 -223
- package/src/lib/worktree/ignored-triage.js +0 -136
- package/src/lib/worktree/vscode-settings.js +0 -112
- package/src/lib/worktree/worktree-audit.js +0 -323
- package/src/lib/worktree/worktree-include.js +0 -44
- package/src/scripts/install-plugin.js +0 -114
package/bin/morph-spec.js
CHANGED
|
@@ -12,55 +12,23 @@ const lazy = (path, name) => async (...args) => (await import(path))[name](...ar
|
|
|
12
12
|
|
|
13
13
|
const initCommand = lazy('../src/commands/project/init.js', 'initCommand');
|
|
14
14
|
const setupInfraCommand = lazy('../src/commands/project/setup-infra-cmd.js', 'setupInfraCommand');
|
|
15
|
-
const installPluginCommand = lazy('../src/commands/project/install-plugin-cmd.js', 'installPluginCommand');
|
|
16
15
|
const updateCommand = lazy('../src/commands/project/update.js', 'updateCommand');
|
|
17
16
|
const doctorCommand = lazy('../src/commands/project/doctor.js', 'doctorCommand');
|
|
18
|
-
const statusCommand = lazy('../src/commands/project/status.js', 'statusCommand');
|
|
19
|
-
const heavyStatusCommand = lazy('../src/commands/project/heavy.js', 'heavyStatusCommand');
|
|
20
|
-
const heavyRunCommand = lazy('../src/commands/project/heavy.js', 'heavyRunCommand');
|
|
21
|
-
const heavyReclaimCommand = lazy('../src/commands/project/heavy.js', 'heavyReclaimCommand');
|
|
22
|
-
const worktreeSetupCommand = lazy('../src/commands/project/worktree.js', 'worktreeSetupCommand');
|
|
23
|
-
const worktreeProvisionCommand = lazy('../src/commands/project/worktree.js', 'worktreeProvisionCommand');
|
|
24
|
-
const worktreeLinkCommand = lazy('../src/commands/project/worktree.js', 'worktreeLinkCommand');
|
|
25
|
-
const worktreeListCommand = lazy('../src/commands/project/worktree.js', 'worktreeListCommand');
|
|
26
|
-
const worktreeRemoveCommand = lazy('../src/commands/project/worktree.js', 'worktreeRemoveCommand');
|
|
27
|
-
const branchPruneCommand = lazy('../src/commands/project/branch.js', 'branchPruneCommand');
|
|
28
|
-
const fleetCommand = lazy('../src/commands/project/fleet.js', 'fleetCommand');
|
|
29
17
|
const envCommand = lazy('../src/commands/project/env.js', 'envCommand');
|
|
30
|
-
const claimCommand = lazy('../src/commands/project/claim.js', 'claimCommand');
|
|
31
18
|
const standardsCommand = lazy('../src/commands/project/standards.js', 'standardsCommand');
|
|
32
|
-
const reportCheckCommand = lazy('../src/commands/state/report-check.js', 'reportCheckCommand');
|
|
33
19
|
const planCheckCommand = lazy('../src/commands/validation/plan-check.js', 'planCheckCommand');
|
|
34
20
|
const stackScanCommand = lazy('../src/commands/project/stack-scan.js', 'stackScanCommand');
|
|
35
21
|
const stackSetCommand = lazy('../src/commands/project/stack-set.js', 'stackSetCommand');
|
|
36
22
|
const testsAuditCommand = lazy('../src/commands/validation/tests-audit.js', 'testsAuditCommand');
|
|
37
23
|
|
|
38
|
-
const approveCommand = lazy('../src/commands/state/approve.js', 'approveCommand');
|
|
39
|
-
const unapproveCommand = lazy('../src/commands/state/approve.js', 'unapproveCommand');
|
|
40
|
-
const advanceCommand = lazy('../src/commands/state/advance.js', 'advanceCommand');
|
|
41
|
-
const archiveCommand = lazy('../src/commands/state/archive.js', 'archiveCommand');
|
|
42
|
-
const recapCommand = lazy('../src/commands/state/recap.js', 'recapCommand');
|
|
43
|
-
const finishCommand = lazy('../src/commands/state/finish.js', 'finishCommand');
|
|
44
|
-
const gateDecisionCommand = lazy('../src/commands/state/gate-decision.js', 'gateDecisionCommand');
|
|
45
|
-
const gateCheckCommand = lazy('../src/commands/state/gate-check.js', 'gateCheckCommand');
|
|
46
|
-
const createCommand = lazy('../src/commands/state/create.js', 'createCommand');
|
|
47
|
-
const retypeCommand = lazy('../src/commands/state/retype.js', 'retypeCommand');
|
|
48
|
-
const nextCommand = lazy('../src/commands/state/next.js', 'nextCommand');
|
|
49
|
-
const listCommand = lazy('../src/commands/state/list.js', 'listCommand');
|
|
50
|
-
const deleteCommand = lazy('../src/commands/state/delete.js', 'deleteCommand');
|
|
51
|
-
|
|
52
24
|
const graphStatusCommand = lazy('../src/commands/graph/status.js', 'graphStatusCommand');
|
|
53
25
|
const graphBuildCommand = lazy('../src/commands/graph/build.js', 'graphBuildCommand');
|
|
54
26
|
const graphAffectedCommand = lazy('../src/commands/graph/affected.js', 'graphAffectedCommand');
|
|
55
27
|
const graphExplainCommand = lazy('../src/commands/graph/explain.js', 'graphExplainCommand');
|
|
56
28
|
const graphDiffCommand = lazy('../src/commands/graph/diff.js', 'graphDiffCommand');
|
|
57
29
|
|
|
58
|
-
const verifyCommand = lazy('../src/commands/validation/verify.js', 'verifyCommand');
|
|
59
30
|
const proveRedCommand = lazy('../src/commands/validation/prove-red.js', 'proveRedCommand');
|
|
60
|
-
const
|
|
61
|
-
const e2eStatusCommand = lazy('../src/commands/e2e/e2e.js', 'e2eStatusCommand');
|
|
62
|
-
const e2eDownCommand = lazy('../src/commands/e2e/e2e.js', 'e2eDownCommand');
|
|
63
|
-
const e2eResetCommand = lazy('../src/commands/e2e/e2e.js', 'e2eResetCommand');
|
|
31
|
+
const checkCommand = lazy('../src/commands/validation/check.js', 'checkCommand');
|
|
64
32
|
|
|
65
33
|
const scaffoldDotnetCommand = lazy('../src/commands/scaffold/scaffold.js', 'scaffoldDotnetCommand');
|
|
66
34
|
const scaffoldNextjsCommand = lazy('../src/commands/scaffold/scaffold.js', 'scaffoldNextjsCommand');
|
|
@@ -69,10 +37,6 @@ const mcpSetupCommand = lazy('../src/commands/mcp/mcp-setup.js', 'mcpSetupComman
|
|
|
69
37
|
|
|
70
38
|
const contextRefreshCommand = lazy('../src/commands/context/context-refresh.js', 'contextRefreshCommand');
|
|
71
39
|
|
|
72
|
-
const dashboardCommand = lazy('../src/commands/dashboard/dashboard.js', 'dashboardCommand');
|
|
73
|
-
|
|
74
|
-
const costCommand = lazy('../src/commands/observability/cost.js', 'costCommand');
|
|
75
|
-
|
|
76
40
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
77
41
|
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
|
|
78
42
|
|
|
@@ -96,11 +60,13 @@ program
|
|
|
96
60
|
|
|
97
61
|
program
|
|
98
62
|
.command('init')
|
|
99
|
-
.description('
|
|
63
|
+
.description('Install MORPH-SPEC and write the repo contract (.morph/config/config.json) from a scan; run again to refresh it — hand edits are kept')
|
|
100
64
|
.option('-f, --force', 'Overwrite existing MORPH installation')
|
|
65
|
+
.option('--dry-run', 'Print the scanned stack, the contract and what would be installed; write nothing')
|
|
66
|
+
.option('--json', 'With --dry-run: output as JSON')
|
|
101
67
|
.option('-p, --path <path>', 'Target path (default: current directory)')
|
|
102
68
|
.option('--skip-mcp', 'Skip MCP server auto-setup')
|
|
103
|
-
.option('--stack <stack>', 'Empty project: declare the stack without asking (dotnet, nextjs
|
|
69
|
+
.option('--stack <stack>', 'Empty project: declare the stack without asking (dotnet, nextjs, node, python, joined by +)')
|
|
104
70
|
.option('--with <integrations>', 'With --stack: comma-separated integrations (neon, maf, docker)')
|
|
105
71
|
.action(initCommand);
|
|
106
72
|
|
|
@@ -111,14 +77,9 @@ program
|
|
|
111
77
|
.option('--reinstall', 'Re-install only stack-aware assets (rules, skills, agents)')
|
|
112
78
|
.action(setupInfraCommand);
|
|
113
79
|
|
|
114
|
-
program
|
|
115
|
-
.command('install-plugin <name>')
|
|
116
|
-
.description('Install a Claude Code plugin (context7)')
|
|
117
|
-
.action(installPluginCommand);
|
|
118
|
-
|
|
119
80
|
program
|
|
120
81
|
.command('update')
|
|
121
|
-
.description('
|
|
82
|
+
.description('Reinstall the framework payloads (standards, hooks, skills, rules, agents) from the installed CLI version')
|
|
122
83
|
.option('--templates', 'Update only templates')
|
|
123
84
|
.option('--standards', 'Update only standards')
|
|
124
85
|
.option('--dry-run', 'Prever os efeitos sem escrever, apagar ou executar nada — inclui o que acontece fora do projeto e dentro do pacote da CLI')
|
|
@@ -131,142 +92,9 @@ program
|
|
|
131
92
|
.option('--full', 'Run full health check')
|
|
132
93
|
.option('--mcp', 'Check MCP server configuration')
|
|
133
94
|
.option('--ai', 'Auditar um projeto .NET com agentes: pin × projeto, API renomeada, tarifa e `api` por alias, prompt sem fonte')
|
|
134
|
-
.option('--worktrees', "Reconcile git's worktree registry × the directories on disk × known features")
|
|
135
|
-
.option('--procs', 'Listar node/dotnet/testhost/esbuild/chrome headless sem pai vivo, MCP duplicado (projeto × plugin) e .wslconfig ausente. Somente leitura; os consertos de MCP e WSL são só sugeridos')
|
|
136
|
-
.option('--prune', "With --worktrees: drop git records for worktree directories that are already gone, clear any feature's root worktree registration pointing at one of them, and apply the finish-backup retention (.git/morph-spec/finish-backup) — the only path that also prunes backups written before it (no manifest). With --procs: encerrar por PID só os órfãos sem proteção (nunca por nome de imagem, nunca MCP configurado nem worker de build)")
|
|
137
|
-
.option('--json', 'With --worktrees or --procs: output as JSON')
|
|
138
95
|
.option('--reset', 'Remove morph-managed entries from .claude/settings.local.json')
|
|
139
96
|
.action(doctorCommand);
|
|
140
97
|
|
|
141
|
-
program
|
|
142
|
-
.command('status <feature>')
|
|
143
|
-
.description('Show feature status (phase, gate state, task counts)')
|
|
144
|
-
.option('--json', 'Output as JSON')
|
|
145
|
-
.option('-v, --verbose', 'Show detailed output')
|
|
146
|
-
.action(statusCommand);
|
|
147
|
-
|
|
148
|
-
program
|
|
149
|
-
.command('list')
|
|
150
|
-
.description('List every feature × status × gates (G1 plan / Gd uiux / G3 review) × workType — the audit board')
|
|
151
|
-
.option('--all', 'Include archived features (.morph/archive)')
|
|
152
|
-
.option('--archived', 'Include archived features (alias of --all)')
|
|
153
|
-
.option('--no-branch', 'Skip reading morph/{feature} for truth — report only what is on disk in this tree')
|
|
154
|
-
.option('--json', 'Output as JSON')
|
|
155
|
-
.action((options) => listCommand(options));
|
|
156
|
-
|
|
157
|
-
program
|
|
158
|
-
.command('approve <feature> <gate>')
|
|
159
|
-
.description('Approve a phase gate (plan, uiux, review). Enforces gate order (uiux and review require plan)')
|
|
160
|
-
.option('--approver <name>', 'Name of approver (default: current user when interactive, "auto" otherwise)')
|
|
161
|
-
.option('--mode <mode>', 'Approval mode: "user" or "auto" (default: detected from TTY)')
|
|
162
|
-
.option('--notes <notes>', 'Approval notes')
|
|
163
|
-
.option('--force', 'Approve out of order (bypass the gate-monotonicity check)')
|
|
164
|
-
.option('--self-assessed', 'Gate 3 only: approve without the review reports (verifier.md, reviewer.md, security.md), recording the degradation in feature.json')
|
|
165
|
-
.action((feature, gate, options) => approveCommand(feature, gate, options));
|
|
166
|
-
|
|
167
|
-
program
|
|
168
|
-
.command('advance <feature>')
|
|
169
|
-
.description('Approve the current phase gate and scaffold the next phase folder (one step)')
|
|
170
|
-
.option('--approver <name>', 'Name of approver (default: current user when interactive, "auto" otherwise)')
|
|
171
|
-
.option('--mode <mode>', 'Approval mode: "user" or "auto" (default: detected from TTY)')
|
|
172
|
-
.option('--design', 'From plan, advance into the optional design (uiux) phase instead of implement')
|
|
173
|
-
.option('--notes <notes>', 'Approval notes')
|
|
174
|
-
.option('--force', 'Advance even if a prerequisite gate is unapproved (out-of-order recovery)')
|
|
175
|
-
.action((feature, options) => advanceCommand(feature, options));
|
|
176
|
-
|
|
177
|
-
program
|
|
178
|
-
.command('archive <feature>')
|
|
179
|
-
.description('Archive a completed feature (atomic, git-aware): move folder + update state. Archive WITHOUT integrating (legacy features, cleanup) — the close path is `finish`')
|
|
180
|
-
.option('--no-git', 'Skip git staging of the move')
|
|
181
|
-
.option('--force', 'Archive even if Gate 3 (review) is not approved')
|
|
182
|
-
.action((feature, options) => archiveCommand(feature, options));
|
|
183
|
-
|
|
184
|
-
program
|
|
185
|
-
.command('recap <feature>')
|
|
186
|
-
.description('Recap animado da feature (cenários provados, estados, o que mudou, gates), com legenda e narração; o finish já gera')
|
|
187
|
-
.option('--piper', 'Narra com o Piper local (áudio embutido, gravado no temp); sem ele, voz do sistema')
|
|
188
|
-
.option('-p, --path <path>', 'Target path (default: current directory)')
|
|
189
|
-
.option('--json', 'Output as JSON')
|
|
190
|
-
.action((feature, options) => recapCommand(feature, options));
|
|
191
|
-
|
|
192
|
-
program
|
|
193
|
-
.command('finish <feature>')
|
|
194
|
-
.description('Close a feature: archive → integrate. --merge merges morph/{f} into the default (local); --pr pushes it + opens a PR. Works with and without a worktree')
|
|
195
|
-
.option('--pr', 'Push morph/{feature} and open a PR against the default branch (no local merge)')
|
|
196
|
-
.option('--merge', 'Merge morph/{feature} into the default branch locally (no push)')
|
|
197
|
-
.option('--push', 'With --merge only: publish the default branch to origin right after the merge (without it, finish only reports how many commits are ahead and the push command). REFUSED with --pr (exit 1): --pr already publishes the feature branch and has no local merge to publish')
|
|
198
|
-
.option('--keep', 'Keep the worktree/branch after integrating (worktree flow only)')
|
|
199
|
-
.option('--keep-volumes', 'Keep the e2e stack\'s named volumes (e.g. a seeded database) instead of reclaiming them with the containers')
|
|
200
|
-
.option('--force', 'Skip the Gate-3-approved precondition')
|
|
201
|
-
.option('--discard-ignored', 'Allow removing the worktree even though it holds gitignored files that exist nowhere else (e.g. .env) — they are destroyed')
|
|
202
|
-
.option('--dry-run', 'PRE-FLIGHT: explain what this finish would archive, back up, discard and remove — and whether the default branch advanced since the feature branched — WITHOUT mutating anything (no commit, no archive, no worktree removal, no gh call, no git fetch). Exits 0 even from inside the worktree, reporting that as a warning')
|
|
203
|
-
.action((feature, options) => finishCommand(feature, options));
|
|
204
|
-
|
|
205
|
-
program
|
|
206
|
-
.command('delete <feature>')
|
|
207
|
-
.description('Delete a feature (hard by default; --archive marks it abandoned). Refuses if a gate is approved unless --force. Also refuses if a worktree is alive elsewhere, unless --with-worktree')
|
|
208
|
-
.option('--archive', 'Soft delete: move to .morph/archive with status "abandoned" instead of removing')
|
|
209
|
-
.option('--force', 'Delete even when a gate is approved (does NOT bypass the live-worktree refusal — see --with-worktree)')
|
|
210
|
-
.option('--with-worktree', 'Tear down the live worktree first (PROVE-or-DECLINE); only deletes if that succeeds. Branch survives unless --delete-branch')
|
|
211
|
-
.option('--delete-branch', 'With --with-worktree, also delete the feature branch (default: kept — it is the work)')
|
|
212
|
-
.option('--discard-ignored', 'With --with-worktree, discard gitignored files unique to the worktree instead of declining removal')
|
|
213
|
-
.option('--no-git', 'Skip git staging of the removal')
|
|
214
|
-
.option('--json', 'Output as JSON')
|
|
215
|
-
.action((feature, options) => deleteCommand(feature, options));
|
|
216
|
-
|
|
217
|
-
program
|
|
218
|
-
.command('unapprove <feature> <gate>')
|
|
219
|
-
.description('Revoke a phase gate approval (recovery only)')
|
|
220
|
-
.option('--revoker <name>', 'Name of person revoking (default: current user when interactive, "auto" otherwise)')
|
|
221
|
-
.option('--mode <mode>', 'Revocation mode: "user" or "auto" (default: detected from TTY)')
|
|
222
|
-
.option('--reason <reason>', 'Reason for revocation')
|
|
223
|
-
.action((feature, gate, options) => unapproveCommand(feature, gate, options));
|
|
224
|
-
|
|
225
|
-
program
|
|
226
|
-
.command('gate-check <feature> <gate>')
|
|
227
|
-
.description('Decide + record a gate\'s trust decision from disk-derived signals (shouldPauseGate) — the deterministic default; see gate-decision for the manual escape hatch')
|
|
228
|
-
.option('--signals <json>', 'Override ONLY standardsViolations/designSystemDivergence (not derivable from disk) — everything else is read from feature.json/checks.json/git and cannot be overridden here')
|
|
229
|
-
.option('--trust <mode>', 'Trust mode to decide with (default: config.json → trust, or "auto")')
|
|
230
|
-
.option('--json', 'Output as JSON')
|
|
231
|
-
.action((feature, gateArg, options) => gateCheckCommand(feature, gateArg, options));
|
|
232
|
-
|
|
233
|
-
program
|
|
234
|
-
.command('gate-decision <feature> <gate>')
|
|
235
|
-
.description('Record the trust decision for a gate in feature.json (gateDecisions, server-side timestamp)')
|
|
236
|
-
.option('--pause <bool>', 'Whether the gate must pause for a human (true|false) — required')
|
|
237
|
-
.option('--reason <text>', 'Why this decision was taken (defaults by pause value)')
|
|
238
|
-
.option('--signals <json>', 'Risk signals as a JSON object, e.g. \'{"taskCount":12}\'')
|
|
239
|
-
.option('--trust <mode>', 'Trust mode used for the decision (default: config.json → trust, or "auto")')
|
|
240
|
-
.option('--json', 'Output as JSON')
|
|
241
|
-
.action((feature, gateArg, options) => gateDecisionCommand(feature, gateArg, options));
|
|
242
|
-
|
|
243
|
-
program
|
|
244
|
-
.command('create <feature>')
|
|
245
|
-
.description('Classify work type (--type/--request), scaffold + stamp policy gates, and create the canonical feature.json (explicit birth — see framework/schemas/feature.schema.json)')
|
|
246
|
-
.option('--name <name>', 'Human-readable feature name (default: the slug)')
|
|
247
|
-
.option('--description <text>', 'What/why of the feature — required at birth unless --request is given (it seeds the description)')
|
|
248
|
-
.option('--status <status>', 'Initial feature status (default: in_progress)')
|
|
249
|
-
.option('--type <type>', 'Work type: feature|bug|chore|hotfix (default: feature) — each type stamps its own gate policy')
|
|
250
|
-
.option('--request <text>', 'Free-text request classified by the deterministic detector; tie/none exits 2 with candidates for an LLM/user decision (feature NOT created)')
|
|
251
|
-
.option('--detect-source <source>', 'workTypeDetection.source recorded when --type is explicit: deterministic|llm|user (default: user)')
|
|
252
|
-
.option('--worktree', 'Create the feature already inside its own git worktree (branch morph/{feature}) — fails open outside a git repo')
|
|
253
|
-
.option('--no-checkout', 'Create the branch morph/{feature} WITHOUT moving this checkout to it (default: the working tree switches, and says so). The branch is created either way, so finish --pr|--merge stays symmetric. REFUSED with --worktree (exit 1): the worktree flow never moves this checkout, so the flag would be inert')
|
|
254
|
-
.option('--json', 'Output as JSON')
|
|
255
|
-
.action((feature, options) => createCommand(feature, options));
|
|
256
|
-
|
|
257
|
-
program
|
|
258
|
-
.command('retype <feature> <newType>')
|
|
259
|
-
.description('Change a feature work type mid-flight (feature|bug|chore|hotfix) — resets only policy-stamped gates, preserves human approvals')
|
|
260
|
-
.option('--reason <text>', 'Why the type changed')
|
|
261
|
-
.option('--json', 'Output as JSON')
|
|
262
|
-
.action((feature, newType, options) => retypeCommand(feature, newType, options));
|
|
263
|
-
|
|
264
|
-
program
|
|
265
|
-
.command('next <feature>')
|
|
266
|
-
.description('The next step of the loop, decided from disk (phase, gates, slice reports, verify stamp, fail streak) in the tree that owns the feature. Read-only.')
|
|
267
|
-
.option('--json', 'Output as JSON')
|
|
268
|
-
.action((feature, options) => nextCommand(feature, options));
|
|
269
|
-
|
|
270
98
|
const graphCommand = program
|
|
271
99
|
.command('graph')
|
|
272
100
|
.description('Grafo de codebase (graphify) com saneamento determinístico — fail-open: sem grafo, tudo segue por grep');
|
|
@@ -316,29 +144,6 @@ graphCommand
|
|
|
316
144
|
.option('--json', 'Output as JSON')
|
|
317
145
|
.action((options) => graphDiffCommand(options));
|
|
318
146
|
|
|
319
|
-
program
|
|
320
|
-
.command('verify <feature>')
|
|
321
|
-
.description('Run the deterministic verification chain (build + tests + validators + e2e) — code before the LLM judge')
|
|
322
|
-
.option('--json', 'Output as JSON')
|
|
323
|
-
.option('--timeout <ms>', 'Timeout in ms for the build AND tests nodes (build default 120000; tests default 120000 per test project, or project.testTimeoutMs)', (v) => parseInt(v, 10))
|
|
324
|
-
.option('--filter <ids>', 'Run only the test nodes whose id matches (comma-separated; exact or substring). Unmatched nodes are reported as skip; matching nothing is a usage error (exit 2)')
|
|
325
|
-
.option('--linux', 'Run the test nodes inside a Linux container, on a COPY of the tree (the host tree is mounted read-only and copied in — a bind mount is case-insensitive and cannot reproduce case defects). No Docker = usage error, never a skip')
|
|
326
|
-
.option('--linux-image <img>', 'Image used by --linux (default: mcr.microsoft.com/dotnet/sdk:10.0)')
|
|
327
|
-
.option('--record-baseline', 'Measure every test node and write expectedCount of the node-test/evals nodes back into .morph/config/config.json, removing it from the other runners (only from an all-green run; never creates config.json)')
|
|
328
|
-
.option('--refresh-cache', 'Rewrite the response cache of every `runner: "evals"` node against the real provider. NEVER implicit: a cache rewrite is a paid call nobody asked for. Requires the declared envFile; no eval node declared, --skip-tests, or a --filter that excludes them all are usage errors (exit 2), refused BEFORE the cache is touched')
|
|
329
|
-
.option('--skip-tests', 'Skip the test node. The run is partial, so the verification stamp is NOT written (reason "skip-tests")')
|
|
330
|
-
.option('--skip-build', 'Skip the build node. The run is partial, so the verification stamp is NOT written (reason "skip-build")')
|
|
331
|
-
.option('--skip-e2e', 'Skip the e2e node (Docker bring-up + Playwright)')
|
|
332
|
-
.option('--fresh-e2e', 'Recreate the e2e stack from scratch: down -v (named volumes included), drop the freshness stamp, rebuild, re-seed auth')
|
|
333
|
-
.option('--fresh', 'Run every node again, ignoring the green nodes of an earlier run on this same tree. Use it when something outside the tree changed (.env, database, tool version)')
|
|
334
|
-
.option('--no-persist', 'Do not persist the result to feature.json')
|
|
335
|
-
.option('--ci', 'Push morph/<feature> and take the proof from the project CI; never creates a workflow or a commit. Same stamp, source "ci". No GitHub/gh/workflow = local verify with the reason; uncommitted code = exit 2; CI still running after 50 min = exit 3, no stamp')
|
|
336
|
-
.option('--affected', 'Run only the tests the diff reaches, with build and validators and without e2e. Keeps its own record: the review gate still asks for one complete run. Migration, contract, project-wide files or code shared by too many tests run complete by themselves')
|
|
337
|
-
.option('--detach', 'Run the verify in its own process, out of the calling session: a killed session or background shell does not take the run with it. This call waits and prints the same result; the same command reattaches')
|
|
338
|
-
.action((feature, options) =>
|
|
339
|
-
verifyCommand(feature, { ...options, noPersist: options.persist === false })
|
|
340
|
-
);
|
|
341
|
-
|
|
342
147
|
const scaffoldCmd = program
|
|
343
148
|
.command('scaffold')
|
|
344
149
|
.description('Generate feature files from templates');
|
|
@@ -383,142 +188,12 @@ contextCommand
|
|
|
383
188
|
.option('--json', 'Output scan result as JSON')
|
|
384
189
|
.action((options) => contextRefreshCommand(options));
|
|
385
190
|
|
|
386
|
-
const e2eCommand = program
|
|
387
|
-
.command('e2e')
|
|
388
|
-
.description("Lifecycle of the feature's verification stack: docker compose, then the host processes of e2e.hostServices")
|
|
389
|
-
.addHelpText('after', `
|
|
390
|
-
e2e.hostServices (.morph/config/config.json): apps that run as host processes instead of containers.
|
|
391
|
-
[{ "name", "start", "cwd": ".", "build"?, "env"?, "health"?, "timeoutMs": 180000 }] name and start required
|
|
392
|
-
Order on up and on the verify e2e node: compose up --wait -> each service in array order
|
|
393
|
-
(build -> start detached -> health) -> auth seed. \${VAR} in env/health comes from the stack env
|
|
394
|
-
(port block + e2e.auth.envFile) or process.env; an unset one refuses before any build.
|
|
395
|
-
They stay up until e2e down, finish, delete or worktree remove; e2e status --json lists them.`);
|
|
396
|
-
|
|
397
|
-
e2eCommand
|
|
398
|
-
.command('up <feature>')
|
|
399
|
-
.description('Bring the stack up, then e2e.hostServices, then the seed (reusing what still matches the working tree)')
|
|
400
|
-
.option('--fresh', 'Recreate from scratch: down -v (named volumes included), drop the stamp, rebuild and restart host services, re-seed auth')
|
|
401
|
-
.option('--json', 'Output as JSON')
|
|
402
|
-
.action((feature, options) => e2eUpCommand(feature, options));
|
|
403
|
-
|
|
404
|
-
e2eCommand
|
|
405
|
-
.command('status <feature>')
|
|
406
|
-
.description('Is the stack up, healthy, and built from the current source? Exit 0 only if all three; --json adds hostServices [{name, pid, alive, health}]')
|
|
407
|
-
.option('--json', 'Output as JSON')
|
|
408
|
-
.action((feature, options) => e2eStatusCommand(feature, options));
|
|
409
|
-
|
|
410
|
-
e2eCommand
|
|
411
|
-
.command('down <feature>')
|
|
412
|
-
.description('Tear the stack and the e2e.hostServices processes down (best-effort — never blocks)')
|
|
413
|
-
.option('--volumes', 'Also remove named volumes')
|
|
414
|
-
.option('--json', 'Output as JSON')
|
|
415
|
-
.action((feature, options) => e2eDownCommand(feature, options));
|
|
416
|
-
|
|
417
|
-
e2eCommand
|
|
418
|
-
.command('reset <feature>')
|
|
419
|
-
.description('Put the running stack\'s data back in a known state between verification flows: e2e.resetCommand, or recreate the non-built services that own a named volume; the other compose services and e2e.hostServices are then restarted without a rebuild (an app that migrates at startup would serve an empty database); then the auth seed. Exit 1 when the stack is not up or a step fails')
|
|
420
|
-
.option('--json', 'Output as JSON')
|
|
421
|
-
.action((feature, options) => e2eResetCommand(feature, options));
|
|
422
|
-
|
|
423
|
-
const heavyCommand = program
|
|
424
|
-
.command('heavy')
|
|
425
|
-
.description('Slots por usuário para os nós pesados (build, testes, e2e), compartilhados entre as sessões');
|
|
426
|
-
|
|
427
|
-
heavyCommand
|
|
428
|
-
.command('status')
|
|
429
|
-
.description('Quem segura os slots, a RAM livre e o diretório do semáforo (somente leitura)')
|
|
430
|
-
.option('--json', 'Output as JSON')
|
|
431
|
-
.action((options) => heavyStatusCommand(options));
|
|
432
|
-
|
|
433
|
-
heavyCommand
|
|
434
|
-
.command('reclaim')
|
|
435
|
-
.description('Derruba stacks e2e ociosas de todos os projetos e containers de teste abandonados; dado de feature ativa fica')
|
|
436
|
-
.option('--json', 'Output as JSON')
|
|
437
|
-
.action((options) => heavyReclaimCommand(options));
|
|
438
|
-
|
|
439
|
-
heavyCommand
|
|
440
|
-
.command('run <command...>')
|
|
441
|
-
.description('Rodar um comando pesado dentro de um slot: morph-spec heavy run [--label x] -- dotnet build. Repassa o exit code; exit 3 = ocupado, não é vermelho')
|
|
442
|
-
.option('--label <label>', 'Nome do que roda, mostrado a quem espera pelo slot')
|
|
443
|
-
.action((command, options) => heavyRunCommand(command, options));
|
|
444
|
-
|
|
445
|
-
const worktreeCommand = program
|
|
446
|
-
.command('worktree')
|
|
447
|
-
.description('Manage git worktrees for feature isolation');
|
|
448
|
-
|
|
449
|
-
worktreeCommand
|
|
450
|
-
.command('setup <feature>')
|
|
451
|
-
.description('Create a worktree at worktrees/{feature}/ on branch morph/{feature}')
|
|
452
|
-
.option('--fresh', 'Create a new dated branch even if one already exists')
|
|
453
|
-
.option('--json', 'Output as JSON (always JSON — accepted so the WorktreeCreate hook can call setup and provision uniformly)')
|
|
454
|
-
.action((feature, options) => worktreeSetupCommand(feature, options));
|
|
455
|
-
|
|
456
|
-
worktreeCommand
|
|
457
|
-
.command('provision <name>')
|
|
458
|
-
.description('Create a task-isolation worktree at worktrees/{name}/ on branch morph-task/{name} — full morph infra, no feature identity')
|
|
459
|
-
.option('--base <ref>', 'Branch off this ref instead of the default branch')
|
|
460
|
-
.option('--json', 'Output as JSON (always JSON)')
|
|
461
|
-
.action((name, options) => worktreeProvisionCommand(name, options));
|
|
462
|
-
|
|
463
|
-
worktreeCommand
|
|
464
|
-
.command('link')
|
|
465
|
-
.description('Link shared infra (node_modules[, .claude, .morph/framework]) into the current worktree')
|
|
466
|
-
.option('--target <path>', 'Worktree path to link into (default: cwd)')
|
|
467
|
-
.option('--all', 'Link all shared dirs, not just node_modules')
|
|
468
|
-
.action((options) => worktreeLinkCommand(options));
|
|
469
|
-
|
|
470
|
-
// Raw `git worktree remove` follows the infra junctions and empties the primary root's .claude/
|
|
471
|
-
// and .morph/framework/: nothing in this repo may point at it, only at this command.
|
|
472
|
-
worktreeCommand
|
|
473
|
-
.command('remove [feature]')
|
|
474
|
-
.description('Safely tear down a worktree (drops infra junctions first, PROVE-or-DECLINE) — does NOT close the feature; that is `finish`')
|
|
475
|
-
.option('--target <path>', 'Remove the worktree at this path (for worktrees with no feature registration)')
|
|
476
|
-
.option('--discard-ignored', 'Skip the backup: gitignored files unique to the worktree are deleted instead of copied to .git/morph-spec/finish-backup (by default they are backed up and the removal proceeds anyway)')
|
|
477
|
-
.option('--delete-branch', 'Also delete the branch (default: kept — unintegrated commits live there)')
|
|
478
|
-
.option('--if-clean', 'Refuse (exit 1, worktree-dirty) if the tree has any uncommitted or untracked file — nothing is touched on a refusal. What the WorktreeRemove hook passes')
|
|
479
|
-
.option('--json', 'Output as JSON (always JSON)')
|
|
480
|
-
.action((feature, options) => worktreeRemoveCommand(feature, options));
|
|
481
|
-
|
|
482
|
-
worktreeCommand
|
|
483
|
-
.command('list')
|
|
484
|
-
.description('List active feature worktrees with their phase and gate status')
|
|
485
|
-
.option('--json', 'Output as JSON')
|
|
486
|
-
.action((options) => worktreeListCommand(options));
|
|
487
|
-
|
|
488
|
-
const branchCommand = program
|
|
489
|
-
.command('branch')
|
|
490
|
-
.description('Local branch housekeeping');
|
|
491
|
-
|
|
492
|
-
branchCommand
|
|
493
|
-
.command('prune')
|
|
494
|
-
.description('Delete local branches whose work is already in the default branch — including squash-merged ones git cannot see. Never touches a branch with an OPEN PR, one in use by a worktree, or one whose integration could not be proven')
|
|
495
|
-
.option('--remote', 'Also delete origin/<branch> for each pruned branch (default: remote branches are left alone)')
|
|
496
|
-
.option('--dry-run', 'Classify and report without deleting anything')
|
|
497
|
-
.option('--json', 'Output as JSON')
|
|
498
|
-
.action((options) => branchPruneCommand(options));
|
|
499
|
-
|
|
500
191
|
program
|
|
501
|
-
.command('env
|
|
502
|
-
.description('Print the worktree
|
|
192
|
+
.command('env')
|
|
193
|
+
.description('Print the worktree ports and COMPOSE_PROJECT_NAME, derived from the branch name (same branch, same ports, no registry): eval "$(morph-spec env)". morph-spec check injects the same env into the test commands')
|
|
503
194
|
.option('--json', 'Output as JSON')
|
|
504
195
|
.option('--powershell', 'Emit $env:K="V" lines instead of POSIX exports')
|
|
505
|
-
.
|
|
506
|
-
.action((feature, options) => envCommand(feature, options));
|
|
507
|
-
|
|
508
|
-
program
|
|
509
|
-
.command('fleet')
|
|
510
|
-
.description('Fleet view — every active feature across primary root and worktrees (phase, gates, scenarios, ports, activity)')
|
|
511
|
-
.option('--json', 'Output as JSON')
|
|
512
|
-
.action((options) => fleetCommand(options));
|
|
513
|
-
|
|
514
|
-
program
|
|
515
|
-
.command('claim [feature]')
|
|
516
|
-
.description('claim [feature] acquires it (moves this tree\'s previous claim in the same step); no args shows the board (claims are advisory warnings, never locks)')
|
|
517
|
-
.option('--release', 'Release the claim on <feature> (recovery: the owning session died)')
|
|
518
|
-
.option('--list', 'Read-only: show claims without acquiring (default when no feature is given)')
|
|
519
|
-
.option('--all', 'Include dead claims (past the 30min TTL) — hidden by default, they no longer warn about anything')
|
|
520
|
-
.option('--json', 'Output as JSON')
|
|
521
|
-
.action((feature, options) => claimCommand(feature, options));
|
|
196
|
+
.action((options) => envCommand(options));
|
|
522
197
|
|
|
523
198
|
program
|
|
524
199
|
.command('standards')
|
|
@@ -530,6 +205,15 @@ program
|
|
|
530
205
|
.option('--json', 'Output as JSON')
|
|
531
206
|
.action((options) => standardsCommand(options));
|
|
532
207
|
|
|
208
|
+
program
|
|
209
|
+
.command('check')
|
|
210
|
+
.description('Run the test commands of the repo contract (project.tests) and report the risk signals of the diff. No cache, no state beyond the attempt counter. Exit 0 = green, 1 = red, 2 = no contract')
|
|
211
|
+
.option('--tier <tier>', 'fast (default), full or e2e', 'fast')
|
|
212
|
+
.option('--feature <f>', 'Feature folder (default: from the branch)')
|
|
213
|
+
.option('--report', 'Write ## Resultado (pronto | precisa-humano) into 3-implement/report.md')
|
|
214
|
+
.option('--json', 'Output as JSON')
|
|
215
|
+
.action((options) => checkCommand(options));
|
|
216
|
+
|
|
533
217
|
program
|
|
534
218
|
.command('prove-red <feature>')
|
|
535
219
|
.description('Mutation proof of a scenario: run its test with the change, put the feature production files back to the merge-base, run it again, restore. Exit 0 = red without the change; 1 = still green (proves nothing); 2 = already red or nothing to revert')
|
|
@@ -539,15 +223,8 @@ program
|
|
|
539
223
|
.action((feature, options) => proveRedCommand(feature, options));
|
|
540
224
|
|
|
541
225
|
program
|
|
542
|
-
.command('
|
|
543
|
-
.description('
|
|
544
|
-
.option('--before-eval', 'Save a snapshot of the tree before dispatching the review agents and print their models; later runs report what changed since')
|
|
545
|
-
.option('--json', 'Output as JSON')
|
|
546
|
-
.action((feature, options) => reportCheckCommand(feature, options));
|
|
547
|
-
|
|
548
|
-
program
|
|
549
|
-
.command('plan-check <feature>')
|
|
550
|
-
.description('Parse 2-plan/plan.md (scenarios, slices, decisions, reuse) and, with no error, write 2-plan/checks.json — the only writer of checks.json. Refuses to rewrite it once the plan gate is approved and the plan changed outside ## Errata. Exits 1 on errors, 2 when plan.md is missing')
|
|
226
|
+
.command('plan-check [feature]')
|
|
227
|
+
.description('Parse 2-plan/plan.md (summary, scenarios, decisions, reuse) and, with no error, write 2-plan/checks.json — the only writer of checks.json; from then on plan.md changes only through ## Errata. Exits 1 on errors, 2 when plan.md is missing or there is no contract')
|
|
551
228
|
.option('--json', 'Output as JSON')
|
|
552
229
|
.addHelpText('after', () => '\nGramática (framework/templates/docs/plan.md):\n\n' +
|
|
553
230
|
readFileSync(join(__dirname, '..', 'framework', 'templates', 'docs', 'plan.md'), 'utf8').replace(/\{\{FEATURE_NAME\}\}/g, '<feature>'))
|
|
@@ -572,39 +249,11 @@ program
|
|
|
572
249
|
.option('--json', 'Output as JSON')
|
|
573
250
|
.action((options) => testsAuditCommand(options));
|
|
574
251
|
|
|
575
|
-
program
|
|
576
|
-
.command('dashboard')
|
|
577
|
-
.description('Open the morph-spec inspector dashboard')
|
|
578
|
-
.option('-p, --port <port>', 'Port number', '3200')
|
|
579
|
-
.option('--no-open', 'Don\'t auto-open browser')
|
|
580
|
-
.action(dashboardCommand);
|
|
581
|
-
|
|
582
|
-
program
|
|
583
|
-
.command('cost [feature]')
|
|
584
|
-
.description('Cost-facing view over .morph/logs/events.jsonl: bytes re-ingested by kind (proxy, not tokens), dispatch counts, real tokens when observed')
|
|
585
|
-
.option('--by <mode>', 'Group by: phase (default: feature-wide summary; with --all-trees, applies to the combined aggregate)')
|
|
586
|
-
.option('--all-trees', 'Aggregate across every git worktree with a log plus the logs finish saved in .git/morph-spec/finish-backup — per-tree breakdown + combined total')
|
|
587
|
-
.option('--metrics', 'Loop measurements: turns, tool calls (orchestrator x sub-agent), time per command class, identical reruns, rereads, verify count per feature, git calls, reuse validator per tree')
|
|
588
|
-
.option('--top <n>', 'With --metrics: how many reread files to list (default 10)', (v) => Number.parseInt(v, 10))
|
|
589
|
-
.option('--json', 'Output the aggregate as JSON')
|
|
590
|
-
.action((feature, options) => costCommand(feature, options));
|
|
591
|
-
|
|
592
|
-
// The page follows every command that moves the feature; 'exit' also covers their process.exit().
|
|
593
|
-
const VIEW_COMMANDS = new Set(['plan-check', 'gate-check', 'gate-decision', 'approve', 'unapprove', 'advance', 'verify', 'report-check']);
|
|
594
252
|
program.hook('preAction', async (_, action) => {
|
|
595
253
|
const { installOwnerView } = await import('../src/utils/audience.js');
|
|
596
254
|
installOwnerView();
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
const { installRefusalLine } = await import('../src/utils/refusal-line.js');
|
|
600
|
-
installRefusalLine(action.parent?.name() && action.parent !== program ? `${action.parent.name()} ${action.name()}` : action.name());
|
|
601
|
-
}
|
|
602
|
-
const [feature] = action.args;
|
|
603
|
-
if (!VIEW_COMMANDS.has(action.name()) || !/^[a-z0-9][\w-]*$/i.test(feature ?? '')) return;
|
|
604
|
-
const { refreshesFeatureView } = await import('../src/lib/verify/detached.js');
|
|
605
|
-
if (!refreshesFeatureView()) return;
|
|
606
|
-
const { refreshFeatureView } = await import('../src/lib/view/feature-view.js');
|
|
607
|
-
process.on('exit', () => refreshFeatureView(process.cwd(), feature));
|
|
255
|
+
const { installRefusalLine } = await import('../src/utils/refusal-line.js');
|
|
256
|
+
installRefusalLine(action.parent?.name() && action.parent !== program ? `${action.parent.name()} ${action.name()}` : action.name());
|
|
608
257
|
});
|
|
609
258
|
|
|
610
259
|
await program.parseAsync();
|