@jokerized/getresearchdone 0.4.1
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-plugin/plugin.json +103 -0
- package/README.md +211 -0
- package/agents/grd-baseline-assessor.md +684 -0
- package/agents/grd-code-reviewer.md +300 -0
- package/agents/grd-codebase-mapper.md +355 -0
- package/agents/grd-critique-agent.md +119 -0
- package/agents/grd-debugger.md +519 -0
- package/agents/grd-deep-diver.md +737 -0
- package/agents/grd-eval-planner.md +913 -0
- package/agents/grd-eval-reporter.md +717 -0
- package/agents/grd-executor.md +683 -0
- package/agents/grd-feasibility-analyst.md +624 -0
- package/agents/grd-integration-checker.md +367 -0
- package/agents/grd-knowledge-miner.md +81 -0
- package/agents/grd-migrator.md +88 -0
- package/agents/grd-phase-researcher.md +697 -0
- package/agents/grd-plan-checker.md +443 -0
- package/agents/grd-planner.md +1532 -0
- package/agents/grd-product-owner.md +562 -0
- package/agents/grd-project-researcher.md +513 -0
- package/agents/grd-research-synthesizer.md +273 -0
- package/agents/grd-roadmapper.md +798 -0
- package/agents/grd-surveyor.md +566 -0
- package/agents/grd-verifier.md +893 -0
- package/bin/gd.js +4 -0
- package/bin/gd.ts +227 -0
- package/bin/grd-manifest.js +4 -0
- package/bin/grd-manifest.ts +286 -0
- package/bin/grd-mcp-server.js +4 -0
- package/bin/grd-mcp-server.ts +124 -0
- package/bin/grd-tools.js +4 -0
- package/bin/grd-tools.ts +2471 -0
- package/bin/postinstall.js +4 -0
- package/bin/postinstall.ts +80 -0
- package/commands/add-phase.md +123 -0
- package/commands/add-todo.md +87 -0
- package/commands/assess-baseline.md +289 -0
- package/commands/autopilot.md +100 -0
- package/commands/autoplan.md +55 -0
- package/commands/check-todos.md +87 -0
- package/commands/compare-methods.md +262 -0
- package/commands/complete-milestone.md +225 -0
- package/commands/debug.md +372 -0
- package/commands/deep-dive.md +288 -0
- package/commands/discover.md +281 -0
- package/commands/discuss-phase.md +188 -0
- package/commands/discuss.md +55 -0
- package/commands/eval-report.md +310 -0
- package/commands/evolve.md +79 -0
- package/commands/execute-phase.md +1017 -0
- package/commands/feasibility.md +292 -0
- package/commands/help.md +407 -0
- package/commands/init.md +1508 -0
- package/commands/insert-phase.md +113 -0
- package/commands/iterate.md +327 -0
- package/commands/list-phase-assumptions.md +217 -0
- package/commands/long-term-roadmap.md +202 -0
- package/commands/map-codebase.md +111 -0
- package/commands/migrate.md +159 -0
- package/commands/new-milestone.md +169 -0
- package/commands/pause-work.md +83 -0
- package/commands/plan-milestone-gaps.md +373 -0
- package/commands/plan-phase.md +655 -0
- package/commands/principles.md +328 -0
- package/commands/product-plan.md +319 -0
- package/commands/progress.md +481 -0
- package/commands/quick.md +167 -0
- package/commands/reapply-patches.md +154 -0
- package/commands/remove-phase.md +97 -0
- package/commands/requirement.md +96 -0
- package/commands/resume-project.md +113 -0
- package/commands/settings.md +1144 -0
- package/commands/survey.md +242 -0
- package/commands/sync.md +246 -0
- package/commands/tracker-setup.md +322 -0
- package/commands/update.md +202 -0
- package/commands/verify-phase.md +335 -0
- package/commands/verify-work.md +701 -0
- package/commands/wireup.md +29 -0
- package/dist/bin/gd.d.ts +3 -0
- package/dist/bin/gd.d.ts.map +1 -0
- package/dist/bin/gd.js +178 -0
- package/dist/bin/gd.js.map +1 -0
- package/dist/bin/grd-manifest.d.ts +3 -0
- package/dist/bin/grd-manifest.d.ts.map +1 -0
- package/dist/bin/grd-manifest.js +202 -0
- package/dist/bin/grd-manifest.js.map +1 -0
- package/dist/bin/grd-mcp-server.d.ts +3 -0
- package/dist/bin/grd-mcp-server.d.ts.map +1 -0
- package/dist/bin/grd-mcp-server.js +71 -0
- package/dist/bin/grd-mcp-server.js.map +1 -0
- package/dist/bin/grd-tools.d.ts +3 -0
- package/dist/bin/grd-tools.d.ts.map +1 -0
- package/dist/bin/grd-tools.js +1680 -0
- package/dist/bin/grd-tools.js.map +1 -0
- package/dist/bin/postinstall.d.ts +3 -0
- package/dist/bin/postinstall.d.ts.map +1 -0
- package/dist/bin/postinstall.js +61 -0
- package/dist/bin/postinstall.js.map +1 -0
- package/dist/lib/autopilot-milestone.d.ts +2 -0
- package/dist/lib/autopilot-milestone.d.ts.map +1 -0
- package/dist/lib/autopilot-milestone.js +94 -0
- package/dist/lib/autopilot-milestone.js.map +1 -0
- package/dist/lib/autopilot-pipeline.d.ts +2 -0
- package/dist/lib/autopilot-pipeline.d.ts.map +1 -0
- package/dist/lib/autopilot-pipeline.js +830 -0
- package/dist/lib/autopilot-pipeline.js.map +1 -0
- package/dist/lib/autopilot-waves.d.ts +2 -0
- package/dist/lib/autopilot-waves.d.ts.map +1 -0
- package/dist/lib/autopilot-waves.js +266 -0
- package/dist/lib/autopilot-waves.js.map +1 -0
- package/dist/lib/autopilot.d.ts +2 -0
- package/dist/lib/autopilot.d.ts.map +1 -0
- package/dist/lib/autopilot.js +1314 -0
- package/dist/lib/autopilot.js.map +1 -0
- package/dist/lib/autoplan.d.ts +2 -0
- package/dist/lib/autoplan.d.ts.map +1 -0
- package/dist/lib/autoplan.js +198 -0
- package/dist/lib/autoplan.js.map +1 -0
- package/dist/lib/autoresearch.d.ts +2 -0
- package/dist/lib/autoresearch.d.ts.map +1 -0
- package/dist/lib/autoresearch.js +626 -0
- package/dist/lib/autoresearch.js.map +1 -0
- package/dist/lib/backend.d.ts +2 -0
- package/dist/lib/backend.d.ts.map +1 -0
- package/dist/lib/backend.js +1036 -0
- package/dist/lib/backend.js.map +1 -0
- package/dist/lib/benchmark.d.ts +99 -0
- package/dist/lib/benchmark.d.ts.map +1 -0
- package/dist/lib/benchmark.js +278 -0
- package/dist/lib/benchmark.js.map +1 -0
- package/dist/lib/citations.d.ts +2 -0
- package/dist/lib/citations.d.ts.map +1 -0
- package/dist/lib/citations.js +642 -0
- package/dist/lib/citations.js.map +1 -0
- package/dist/lib/cleanup.d.ts +2 -0
- package/dist/lib/cleanup.d.ts.map +1 -0
- package/dist/lib/cleanup.js +1222 -0
- package/dist/lib/cleanup.js.map +1 -0
- package/dist/lib/cli/adapters.d.ts +10 -0
- package/dist/lib/cli/adapters.d.ts.map +1 -0
- package/dist/lib/cli/adapters.js +27 -0
- package/dist/lib/cli/adapters.js.map +1 -0
- package/dist/lib/cli/agent.d.ts +17 -0
- package/dist/lib/cli/agent.d.ts.map +1 -0
- package/dist/lib/cli/agent.js +53 -0
- package/dist/lib/cli/agent.js.map +1 -0
- package/dist/lib/cli/index.d.ts +21 -0
- package/dist/lib/cli/index.d.ts.map +1 -0
- package/dist/lib/cli/index.js +264 -0
- package/dist/lib/cli/index.js.map +1 -0
- package/dist/lib/cli/output.d.ts +20 -0
- package/dist/lib/cli/output.d.ts.map +1 -0
- package/dist/lib/cli/output.js +22 -0
- package/dist/lib/cli/output.js.map +1 -0
- package/dist/lib/cli/scan-dispatch.d.ts +9 -0
- package/dist/lib/cli/scan-dispatch.d.ts.map +1 -0
- package/dist/lib/cli/scan-dispatch.js +107 -0
- package/dist/lib/cli/scan-dispatch.js.map +1 -0
- package/dist/lib/cli/tools.d.ts +16 -0
- package/dist/lib/cli/tools.d.ts.map +1 -0
- package/dist/lib/cli/tools.js +168 -0
- package/dist/lib/cli/tools.js.map +1 -0
- package/dist/lib/commands/_dashboard-parsers.d.ts +2 -0
- package/dist/lib/commands/_dashboard-parsers.d.ts.map +1 -0
- package/dist/lib/commands/_dashboard-parsers.js +192 -0
- package/dist/lib/commands/_dashboard-parsers.js.map +1 -0
- package/dist/lib/commands/analysis.d.ts +2 -0
- package/dist/lib/commands/analysis.d.ts.map +1 -0
- package/dist/lib/commands/analysis.js +1418 -0
- package/dist/lib/commands/analysis.js.map +1 -0
- package/dist/lib/commands/assumptions.d.ts +2 -0
- package/dist/lib/commands/assumptions.d.ts.map +1 -0
- package/dist/lib/commands/assumptions.js +166 -0
- package/dist/lib/commands/assumptions.js.map +1 -0
- package/dist/lib/commands/blame.d.ts +2 -0
- package/dist/lib/commands/blame.d.ts.map +1 -0
- package/dist/lib/commands/blame.js +133 -0
- package/dist/lib/commands/blame.js.map +1 -0
- package/dist/lib/commands/budget.d.ts +2 -0
- package/dist/lib/commands/budget.d.ts.map +1 -0
- package/dist/lib/commands/budget.js +100 -0
- package/dist/lib/commands/budget.js.map +1 -0
- package/dist/lib/commands/check-plans.d.ts +2 -0
- package/dist/lib/commands/check-plans.d.ts.map +1 -0
- package/dist/lib/commands/check-plans.js +190 -0
- package/dist/lib/commands/check-plans.js.map +1 -0
- package/dist/lib/commands/config.d.ts +2 -0
- package/dist/lib/commands/config.d.ts.map +1 -0
- package/dist/lib/commands/config.js +188 -0
- package/dist/lib/commands/config.js.map +1 -0
- package/dist/lib/commands/dashboard.d.ts +2 -0
- package/dist/lib/commands/dashboard.d.ts.map +1 -0
- package/dist/lib/commands/dashboard.js +466 -0
- package/dist/lib/commands/dashboard.js.map +1 -0
- package/dist/lib/commands/estimate.d.ts +2 -0
- package/dist/lib/commands/estimate.d.ts.map +1 -0
- package/dist/lib/commands/estimate.js +148 -0
- package/dist/lib/commands/estimate.js.map +1 -0
- package/dist/lib/commands/eval-diff.d.ts +2 -0
- package/dist/lib/commands/eval-diff.d.ts.map +1 -0
- package/dist/lib/commands/eval-diff.js +213 -0
- package/dist/lib/commands/eval-diff.js.map +1 -0
- package/dist/lib/commands/freshness.d.ts +2 -0
- package/dist/lib/commands/freshness.d.ts.map +1 -0
- package/dist/lib/commands/freshness.js +163 -0
- package/dist/lib/commands/freshness.js.map +1 -0
- package/dist/lib/commands/health.d.ts +2 -0
- package/dist/lib/commands/health.d.ts.map +1 -0
- package/dist/lib/commands/health.js +435 -0
- package/dist/lib/commands/health.js.map +1 -0
- package/dist/lib/commands/index.d.ts +2 -0
- package/dist/lib/commands/index.d.ts.map +1 -0
- package/dist/lib/commands/index.js +128 -0
- package/dist/lib/commands/index.js.map +1 -0
- package/dist/lib/commands/install.d.ts +56 -0
- package/dist/lib/commands/install.d.ts.map +1 -0
- package/dist/lib/commands/install.js +214 -0
- package/dist/lib/commands/install.js.map +1 -0
- package/dist/lib/commands/knowhow-aggregator.d.ts +2 -0
- package/dist/lib/commands/knowhow-aggregator.d.ts.map +1 -0
- package/dist/lib/commands/knowhow-aggregator.js +279 -0
- package/dist/lib/commands/knowhow-aggregator.js.map +1 -0
- package/dist/lib/commands/knowledge-search.d.ts +2 -0
- package/dist/lib/commands/knowledge-search.d.ts.map +1 -0
- package/dist/lib/commands/knowledge-search.js +113 -0
- package/dist/lib/commands/knowledge-search.js.map +1 -0
- package/dist/lib/commands/long-term-roadmap.d.ts +2 -0
- package/dist/lib/commands/long-term-roadmap.d.ts.map +1 -0
- package/dist/lib/commands/long-term-roadmap.js +272 -0
- package/dist/lib/commands/long-term-roadmap.js.map +1 -0
- package/dist/lib/commands/patterns.d.ts +91 -0
- package/dist/lib/commands/patterns.d.ts.map +1 -0
- package/dist/lib/commands/patterns.js +391 -0
- package/dist/lib/commands/patterns.js.map +1 -0
- package/dist/lib/commands/phase-info.d.ts +2 -0
- package/dist/lib/commands/phase-info.d.ts.map +1 -0
- package/dist/lib/commands/phase-info.js +509 -0
- package/dist/lib/commands/phase-info.js.map +1 -0
- package/dist/lib/commands/plan-lint.d.ts +56 -0
- package/dist/lib/commands/plan-lint.d.ts.map +1 -0
- package/dist/lib/commands/plan-lint.js +481 -0
- package/dist/lib/commands/plan-lint.js.map +1 -0
- package/dist/lib/commands/plan-phase.d.ts +53 -0
- package/dist/lib/commands/plan-phase.d.ts.map +1 -0
- package/dist/lib/commands/plan-phase.js +288 -0
- package/dist/lib/commands/plan-phase.js.map +1 -0
- package/dist/lib/commands/progress.d.ts +2 -0
- package/dist/lib/commands/progress.d.ts.map +1 -0
- package/dist/lib/commands/progress.js +266 -0
- package/dist/lib/commands/progress.js.map +1 -0
- package/dist/lib/commands/quality.d.ts +2 -0
- package/dist/lib/commands/quality.d.ts.map +1 -0
- package/dist/lib/commands/quality.js +80 -0
- package/dist/lib/commands/quality.js.map +1 -0
- package/dist/lib/commands/rollback.d.ts +2 -0
- package/dist/lib/commands/rollback.d.ts.map +1 -0
- package/dist/lib/commands/rollback.js +145 -0
- package/dist/lib/commands/rollback.js.map +1 -0
- package/dist/lib/commands/scan.d.ts +25 -0
- package/dist/lib/commands/scan.d.ts.map +1 -0
- package/dist/lib/commands/scan.js +28 -0
- package/dist/lib/commands/scan.js.map +1 -0
- package/dist/lib/commands/search.d.ts +2 -0
- package/dist/lib/commands/search.d.ts.map +1 -0
- package/dist/lib/commands/search.js +212 -0
- package/dist/lib/commands/search.js.map +1 -0
- package/dist/lib/commands/select-candidate.d.ts +128 -0
- package/dist/lib/commands/select-candidate.d.ts.map +1 -0
- package/dist/lib/commands/select-candidate.js +518 -0
- package/dist/lib/commands/select-candidate.js.map +1 -0
- package/dist/lib/commands/singularity.d.ts +2 -0
- package/dist/lib/commands/singularity.d.ts.map +1 -0
- package/dist/lib/commands/singularity.js +185 -0
- package/dist/lib/commands/singularity.js.map +1 -0
- package/dist/lib/commands/slug-timestamp.d.ts +2 -0
- package/dist/lib/commands/slug-timestamp.d.ts.map +1 -0
- package/dist/lib/commands/slug-timestamp.js +54 -0
- package/dist/lib/commands/slug-timestamp.js.map +1 -0
- package/dist/lib/commands/tail.d.ts +2 -0
- package/dist/lib/commands/tail.d.ts.map +1 -0
- package/dist/lib/commands/tail.js +100 -0
- package/dist/lib/commands/tail.js.map +1 -0
- package/dist/lib/commands/todo.d.ts +2 -0
- package/dist/lib/commands/todo.d.ts.map +1 -0
- package/dist/lib/commands/todo.js +200 -0
- package/dist/lib/commands/todo.js.map +1 -0
- package/dist/lib/commands/watch.d.ts +2 -0
- package/dist/lib/commands/watch.d.ts.map +1 -0
- package/dist/lib/commands/watch.js +72 -0
- package/dist/lib/commands/watch.js.map +1 -0
- package/dist/lib/complexity.d.ts +55 -0
- package/dist/lib/complexity.d.ts.map +1 -0
- package/dist/lib/complexity.js +80 -0
- package/dist/lib/complexity.js.map +1 -0
- package/dist/lib/context/agents.d.ts +2 -0
- package/dist/lib/context/agents.d.ts.map +1 -0
- package/dist/lib/context/agents.js +344 -0
- package/dist/lib/context/agents.js.map +1 -0
- package/dist/lib/context/base.d.ts +2 -0
- package/dist/lib/context/base.d.ts.map +1 -0
- package/dist/lib/context/base.js +81 -0
- package/dist/lib/context/base.js.map +1 -0
- package/dist/lib/context/execute.d.ts +2 -0
- package/dist/lib/context/execute.d.ts.map +1 -0
- package/dist/lib/context/execute.js +753 -0
- package/dist/lib/context/execute.js.map +1 -0
- package/dist/lib/context/index.d.ts +2 -0
- package/dist/lib/context/index.d.ts.map +1 -0
- package/dist/lib/context/index.js +88 -0
- package/dist/lib/context/index.js.map +1 -0
- package/dist/lib/context/progress.d.ts +2 -0
- package/dist/lib/context/progress.d.ts.map +1 -0
- package/dist/lib/context/progress.js +178 -0
- package/dist/lib/context/progress.js.map +1 -0
- package/dist/lib/context/project.d.ts +2 -0
- package/dist/lib/context/project.d.ts.map +1 -0
- package/dist/lib/context/project.js +413 -0
- package/dist/lib/context/project.js.map +1 -0
- package/dist/lib/context/research.d.ts +2 -0
- package/dist/lib/context/research.d.ts.map +1 -0
- package/dist/lib/context/research.js +466 -0
- package/dist/lib/context/research.js.map +1 -0
- package/dist/lib/dead-ends.d.ts +28 -0
- package/dist/lib/dead-ends.d.ts.map +1 -0
- package/dist/lib/dead-ends.js +451 -0
- package/dist/lib/dead-ends.js.map +1 -0
- package/dist/lib/deps.d.ts +2 -0
- package/dist/lib/deps.d.ts.map +1 -0
- package/dist/lib/deps.js +630 -0
- package/dist/lib/deps.js.map +1 -0
- package/dist/lib/discussion.d.ts +2 -0
- package/dist/lib/discussion.d.ts.map +1 -0
- package/dist/lib/discussion.js +1041 -0
- package/dist/lib/discussion.js.map +1 -0
- package/dist/lib/drift.d.ts +36 -0
- package/dist/lib/drift.d.ts.map +1 -0
- package/dist/lib/drift.js +481 -0
- package/dist/lib/drift.js.map +1 -0
- package/dist/lib/evolve/_dimensions-features.d.ts +2 -0
- package/dist/lib/evolve/_dimensions-features.d.ts.map +1 -0
- package/dist/lib/evolve/_dimensions-features.js +369 -0
- package/dist/lib/evolve/_dimensions-features.js.map +1 -0
- package/dist/lib/evolve/_dimensions.d.ts +2 -0
- package/dist/lib/evolve/_dimensions.d.ts.map +1 -0
- package/dist/lib/evolve/_dimensions.js +358 -0
- package/dist/lib/evolve/_dimensions.js.map +1 -0
- package/dist/lib/evolve/_product-ideation.d.ts +2 -0
- package/dist/lib/evolve/_product-ideation.d.ts.map +1 -0
- package/dist/lib/evolve/_product-ideation.js +281 -0
- package/dist/lib/evolve/_product-ideation.js.map +1 -0
- package/dist/lib/evolve/_prompts.d.ts +2 -0
- package/dist/lib/evolve/_prompts.d.ts.map +1 -0
- package/dist/lib/evolve/_prompts.js +153 -0
- package/dist/lib/evolve/_prompts.js.map +1 -0
- package/dist/lib/evolve/cli.d.ts +2 -0
- package/dist/lib/evolve/cli.d.ts.map +1 -0
- package/dist/lib/evolve/cli.js +224 -0
- package/dist/lib/evolve/cli.js.map +1 -0
- package/dist/lib/evolve/discovery.d.ts +2 -0
- package/dist/lib/evolve/discovery.d.ts.map +1 -0
- package/dist/lib/evolve/discovery.js +391 -0
- package/dist/lib/evolve/discovery.js.map +1 -0
- package/dist/lib/evolve/index.d.ts +2 -0
- package/dist/lib/evolve/index.d.ts.map +1 -0
- package/dist/lib/evolve/index.js +88 -0
- package/dist/lib/evolve/index.js.map +1 -0
- package/dist/lib/evolve/orchestrator.d.ts +2 -0
- package/dist/lib/evolve/orchestrator.d.ts.map +1 -0
- package/dist/lib/evolve/orchestrator.js +851 -0
- package/dist/lib/evolve/orchestrator.js.map +1 -0
- package/dist/lib/evolve/scoring.d.ts +2 -0
- package/dist/lib/evolve/scoring.d.ts.map +1 -0
- package/dist/lib/evolve/scoring.js +118 -0
- package/dist/lib/evolve/scoring.js.map +1 -0
- package/dist/lib/evolve/state.d.ts +2 -0
- package/dist/lib/evolve/state.d.ts.map +1 -0
- package/dist/lib/evolve/state.js +264 -0
- package/dist/lib/evolve/state.js.map +1 -0
- package/dist/lib/evolve/types.d.ts +249 -0
- package/dist/lib/evolve/types.d.ts.map +1 -0
- package/dist/lib/evolve/types.js +3 -0
- package/dist/lib/evolve/types.js.map +1 -0
- package/dist/lib/frontmatter.d.ts +2 -0
- package/dist/lib/frontmatter.d.ts.map +1 -0
- package/dist/lib/frontmatter.js +513 -0
- package/dist/lib/frontmatter.js.map +1 -0
- package/dist/lib/gates.d.ts +2 -0
- package/dist/lib/gates.d.ts.map +1 -0
- package/dist/lib/gates.js +578 -0
- package/dist/lib/gates.js.map +1 -0
- package/dist/lib/genome.d.ts +10 -0
- package/dist/lib/genome.d.ts.map +1 -0
- package/dist/lib/genome.js +368 -0
- package/dist/lib/genome.js.map +1 -0
- package/dist/lib/got.d.ts +2 -0
- package/dist/lib/got.d.ts.map +1 -0
- package/dist/lib/got.js +280 -0
- package/dist/lib/got.js.map +1 -0
- package/dist/lib/invariants.d.ts +2 -0
- package/dist/lib/invariants.d.ts.map +1 -0
- package/dist/lib/invariants.js +298 -0
- package/dist/lib/invariants.js.map +1 -0
- package/dist/lib/knowledge.d.ts +2 -0
- package/dist/lib/knowledge.d.ts.map +1 -0
- package/dist/lib/knowledge.js +658 -0
- package/dist/lib/knowledge.js.map +1 -0
- package/dist/lib/long-term-roadmap.d.ts +2 -0
- package/dist/lib/long-term-roadmap.d.ts.map +1 -0
- package/dist/lib/long-term-roadmap.js +602 -0
- package/dist/lib/long-term-roadmap.js.map +1 -0
- package/dist/lib/markdown-split.d.ts +2 -0
- package/dist/lib/markdown-split.d.ts.map +1 -0
- package/dist/lib/markdown-split.js +199 -0
- package/dist/lib/markdown-split.js.map +1 -0
- package/dist/lib/mcp-server.d.ts +2 -0
- package/dist/lib/mcp-server.d.ts.map +1 -0
- package/dist/lib/mcp-server.js +2424 -0
- package/dist/lib/mcp-server.js.map +1 -0
- package/dist/lib/metrics.d.ts +16 -0
- package/dist/lib/metrics.d.ts.map +1 -0
- package/dist/lib/metrics.js +48 -0
- package/dist/lib/metrics.js.map +1 -0
- package/dist/lib/overstory.d.ts +2 -0
- package/dist/lib/overstory.d.ts.map +1 -0
- package/dist/lib/overstory.js +211 -0
- package/dist/lib/overstory.js.map +1 -0
- package/dist/lib/parallel.d.ts +2 -0
- package/dist/lib/parallel.d.ts.map +1 -0
- package/dist/lib/parallel.js +349 -0
- package/dist/lib/parallel.js.map +1 -0
- package/dist/lib/paths.d.ts +2 -0
- package/dist/lib/paths.d.ts.map +1 -0
- package/dist/lib/paths.js +254 -0
- package/dist/lib/paths.js.map +1 -0
- package/dist/lib/phase-complete-llm.d.ts +22 -0
- package/dist/lib/phase-complete-llm.d.ts.map +1 -0
- package/dist/lib/phase-complete-llm.js +331 -0
- package/dist/lib/phase-complete-llm.js.map +1 -0
- package/dist/lib/phase-complete.d.ts +46 -0
- package/dist/lib/phase-complete.d.ts.map +1 -0
- package/dist/lib/phase-complete.js +278 -0
- package/dist/lib/phase-complete.js.map +1 -0
- package/dist/lib/phase-io.d.ts +2 -0
- package/dist/lib/phase-io.d.ts.map +1 -0
- package/dist/lib/phase-io.js +126 -0
- package/dist/lib/phase-io.js.map +1 -0
- package/dist/lib/phase.d.ts +2 -0
- package/dist/lib/phase.d.ts.map +1 -0
- package/dist/lib/phase.js +1344 -0
- package/dist/lib/phase.js.map +1 -0
- package/dist/lib/plan-tournament.d.ts +63 -0
- package/dist/lib/plan-tournament.d.ts.map +1 -0
- package/dist/lib/plan-tournament.js +353 -0
- package/dist/lib/plan-tournament.js.map +1 -0
- package/dist/lib/refinement.d.ts +74 -0
- package/dist/lib/refinement.d.ts.map +1 -0
- package/dist/lib/refinement.js +283 -0
- package/dist/lib/refinement.js.map +1 -0
- package/dist/lib/requirements.d.ts +2 -0
- package/dist/lib/requirements.d.ts.map +1 -0
- package/dist/lib/requirements.js +355 -0
- package/dist/lib/requirements.js.map +1 -0
- package/dist/lib/research-bundle.d.ts +2 -0
- package/dist/lib/research-bundle.d.ts.map +1 -0
- package/dist/lib/research-bundle.js +246 -0
- package/dist/lib/research-bundle.js.map +1 -0
- package/dist/lib/roadmap.d.ts +2 -0
- package/dist/lib/roadmap.d.ts.map +1 -0
- package/dist/lib/roadmap.js +541 -0
- package/dist/lib/roadmap.js.map +1 -0
- package/dist/lib/sample.d.ts +16 -0
- package/dist/lib/sample.d.ts.map +1 -0
- package/dist/lib/sample.js +20 -0
- package/dist/lib/sample.js.map +1 -0
- package/dist/lib/scaffold.d.ts +2 -0
- package/dist/lib/scaffold.d.ts.map +1 -0
- package/dist/lib/scaffold.js +355 -0
- package/dist/lib/scaffold.js.map +1 -0
- package/dist/lib/scan/_utils.d.ts +11 -0
- package/dist/lib/scan/_utils.d.ts.map +1 -0
- package/dist/lib/scan/_utils.js +36 -0
- package/dist/lib/scan/_utils.js.map +1 -0
- package/dist/lib/scan/base64.d.ts +15 -0
- package/dist/lib/scan/base64.d.ts.map +1 -0
- package/dist/lib/scan/base64.js +66 -0
- package/dist/lib/scan/base64.js.map +1 -0
- package/dist/lib/scan/ignorefile.d.ts +30 -0
- package/dist/lib/scan/ignorefile.d.ts.map +1 -0
- package/dist/lib/scan/ignorefile.js +101 -0
- package/dist/lib/scan/ignorefile.js.map +1 -0
- package/dist/lib/scan/injection.d.ts +14 -0
- package/dist/lib/scan/injection.d.ts.map +1 -0
- package/dist/lib/scan/injection.js +39 -0
- package/dist/lib/scan/injection.js.map +1 -0
- package/dist/lib/scan/patterns.d.ts +17 -0
- package/dist/lib/scan/patterns.d.ts.map +1 -0
- package/dist/lib/scan/patterns.js +123 -0
- package/dist/lib/scan/patterns.js.map +1 -0
- package/dist/lib/scan/strip-markdown.d.ts +7 -0
- package/dist/lib/scan/strip-markdown.d.ts.map +1 -0
- package/dist/lib/scan/strip-markdown.js +38 -0
- package/dist/lib/scan/strip-markdown.js.map +1 -0
- package/dist/lib/scan/types.d.ts +23 -0
- package/dist/lib/scan/types.d.ts.map +1 -0
- package/dist/lib/scan/types.js +3 -0
- package/dist/lib/scan/types.js.map +1 -0
- package/dist/lib/scheduler-wait.d.ts +2 -0
- package/dist/lib/scheduler-wait.d.ts.map +1 -0
- package/dist/lib/scheduler-wait.js +59 -0
- package/dist/lib/scheduler-wait.js.map +1 -0
- package/dist/lib/scheduler.d.ts +254 -0
- package/dist/lib/scheduler.d.ts.map +1 -0
- package/dist/lib/scheduler.js +1147 -0
- package/dist/lib/scheduler.js.map +1 -0
- package/dist/lib/state.d.ts +2 -0
- package/dist/lib/state.d.ts.map +1 -0
- package/dist/lib/state.js +744 -0
- package/dist/lib/state.js.map +1 -0
- package/dist/lib/think.d.ts +18 -0
- package/dist/lib/think.d.ts.map +1 -0
- package/dist/lib/think.js +317 -0
- package/dist/lib/think.js.map +1 -0
- package/dist/lib/tracker.d.ts +2 -0
- package/dist/lib/tracker.d.ts.map +1 -0
- package/dist/lib/tracker.js +1121 -0
- package/dist/lib/tracker.js.map +1 -0
- package/dist/lib/types.d.ts +1514 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +4 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +1363 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/verify.d.ts +2 -0
- package/dist/lib/verify.d.ts.map +1 -0
- package/dist/lib/verify.js +1153 -0
- package/dist/lib/verify.js.map +1 -0
- package/dist/lib/wireup/autofix.d.ts +2 -0
- package/dist/lib/wireup/autofix.d.ts.map +1 -0
- package/dist/lib/wireup/autofix.js +188 -0
- package/dist/lib/wireup/autofix.js.map +1 -0
- package/dist/lib/wireup/cli.d.ts +2 -0
- package/dist/lib/wireup/cli.d.ts.map +1 -0
- package/dist/lib/wireup/cli.js +194 -0
- package/dist/lib/wireup/cli.js.map +1 -0
- package/dist/lib/wireup/detection.d.ts +47 -0
- package/dist/lib/wireup/detection.d.ts.map +1 -0
- package/dist/lib/wireup/detection.js +410 -0
- package/dist/lib/wireup/detection.js.map +1 -0
- package/dist/lib/wireup/discovery.d.ts +2 -0
- package/dist/lib/wireup/discovery.d.ts.map +1 -0
- package/dist/lib/wireup/discovery.js +934 -0
- package/dist/lib/wireup/discovery.js.map +1 -0
- package/dist/lib/wireup/execution.d.ts +2 -0
- package/dist/lib/wireup/execution.d.ts.map +1 -0
- package/dist/lib/wireup/execution.js +573 -0
- package/dist/lib/wireup/execution.js.map +1 -0
- package/dist/lib/wireup/index.d.ts +2 -0
- package/dist/lib/wireup/index.d.ts.map +1 -0
- package/dist/lib/wireup/index.js +85 -0
- package/dist/lib/wireup/index.js.map +1 -0
- package/dist/lib/wireup/orchestrator.d.ts +2 -0
- package/dist/lib/wireup/orchestrator.d.ts.map +1 -0
- package/dist/lib/wireup/orchestrator.js +366 -0
- package/dist/lib/wireup/orchestrator.js.map +1 -0
- package/dist/lib/wireup/report.d.ts +47 -0
- package/dist/lib/wireup/report.d.ts.map +1 -0
- package/dist/lib/wireup/report.js +201 -0
- package/dist/lib/wireup/report.js.map +1 -0
- package/dist/lib/wireup/scenarios.d.ts +2 -0
- package/dist/lib/wireup/scenarios.d.ts.map +1 -0
- package/dist/lib/wireup/scenarios.js +516 -0
- package/dist/lib/wireup/scenarios.js.map +1 -0
- package/dist/lib/wireup/state.d.ts +2 -0
- package/dist/lib/wireup/state.d.ts.map +1 -0
- package/dist/lib/wireup/state.js +102 -0
- package/dist/lib/wireup/state.js.map +1 -0
- package/dist/lib/wireup/types.d.ts +376 -0
- package/dist/lib/wireup/types.d.ts.map +1 -0
- package/dist/lib/wireup/types.js +3 -0
- package/dist/lib/wireup/types.js.map +1 -0
- package/dist/lib/worktree.d.ts +2 -0
- package/dist/lib/worktree.d.ts.map +1 -0
- package/dist/lib/worktree.js +999 -0
- package/dist/lib/worktree.js.map +1 -0
- package/lib/autopilot-milestone.ts +136 -0
- package/lib/autopilot-pipeline.ts +1179 -0
- package/lib/autopilot-waves.ts +361 -0
- package/lib/autopilot.ts +1874 -0
- package/lib/autoplan.ts +280 -0
- package/lib/autoresearch.js +4 -0
- package/lib/autoresearch.ts +886 -0
- package/lib/backend.ts +1252 -0
- package/lib/benchmark.ts +341 -0
- package/lib/citations.ts +760 -0
- package/lib/cleanup.ts +1588 -0
- package/lib/cli/adapters.ts +41 -0
- package/lib/cli/agent.ts +83 -0
- package/lib/cli/index.ts +273 -0
- package/lib/cli/output.ts +33 -0
- package/lib/cli/scan-dispatch.ts +130 -0
- package/lib/cli/tools.ts +198 -0
- package/lib/commands/_dashboard-parsers.ts +275 -0
- package/lib/commands/analysis.ts +1851 -0
- package/lib/commands/assumptions.ts +232 -0
- package/lib/commands/blame.ts +174 -0
- package/lib/commands/budget.ts +148 -0
- package/lib/commands/check-plans.ts +233 -0
- package/lib/commands/config.ts +287 -0
- package/lib/commands/dashboard.ts +680 -0
- package/lib/commands/estimate.ts +204 -0
- package/lib/commands/eval-diff.ts +252 -0
- package/lib/commands/freshness.ts +213 -0
- package/lib/commands/health.ts +607 -0
- package/lib/commands/index.ts +266 -0
- package/lib/commands/install.ts +307 -0
- package/lib/commands/knowhow-aggregator.ts +345 -0
- package/lib/commands/knowledge-search.ts +153 -0
- package/lib/commands/long-term-roadmap.ts +390 -0
- package/lib/commands/patterns.ts +465 -0
- package/lib/commands/phase-info.ts +698 -0
- package/lib/commands/plan-lint.ts +546 -0
- package/lib/commands/plan-phase.ts +375 -0
- package/lib/commands/progress.ts +319 -0
- package/lib/commands/quality.ts +138 -0
- package/lib/commands/rollback.ts +195 -0
- package/lib/commands/scan.ts +72 -0
- package/lib/commands/search.ts +300 -0
- package/lib/commands/select-candidate.ts +687 -0
- package/lib/commands/singularity.ts +222 -0
- package/lib/commands/slug-timestamp.ts +74 -0
- package/lib/commands/tail.ts +129 -0
- package/lib/commands/todo.ts +273 -0
- package/lib/commands/watch.ts +80 -0
- package/lib/complexity.ts +117 -0
- package/lib/context/agents.ts +505 -0
- package/lib/context/base.ts +123 -0
- package/lib/context/execute.ts +977 -0
- package/lib/context/index.ts +110 -0
- package/lib/context/progress.ts +278 -0
- package/lib/context/project.ts +531 -0
- package/lib/context/research.ts +646 -0
- package/lib/dead-ends.ts +506 -0
- package/lib/deps.ts +773 -0
- package/lib/discussion.ts +1275 -0
- package/lib/drift.ts +519 -0
- package/lib/evolve/_dimensions-features.ts +525 -0
- package/lib/evolve/_dimensions.ts +511 -0
- package/lib/evolve/_product-ideation.ts +405 -0
- package/lib/evolve/_prompts.ts +178 -0
- package/lib/evolve/cli.ts +330 -0
- package/lib/evolve/discovery.ts +571 -0
- package/lib/evolve/index.ts +105 -0
- package/lib/evolve/orchestrator.ts +1139 -0
- package/lib/evolve/scoring.ts +167 -0
- package/lib/evolve/state.ts +330 -0
- package/lib/evolve/types.ts +290 -0
- package/lib/frontmatter.ts +615 -0
- package/lib/gates.ts +695 -0
- package/lib/genome.ts +402 -0
- package/lib/got.js +4 -0
- package/lib/got.ts +361 -0
- package/lib/invariants.ts +378 -0
- package/lib/knowledge.ts +768 -0
- package/lib/long-term-roadmap.ts +806 -0
- package/lib/markdown-split.ts +273 -0
- package/lib/mcp-server.ts +3292 -0
- package/lib/metrics.ts +49 -0
- package/lib/overstory.ts +270 -0
- package/lib/parallel.ts +570 -0
- package/lib/paths.ts +293 -0
- package/lib/phase-complete-llm.ts +376 -0
- package/lib/phase-complete.ts +366 -0
- package/lib/phase-io.ts +101 -0
- package/lib/phase.ts +1981 -0
- package/lib/plan-tournament.ts +426 -0
- package/lib/refinement.ts +349 -0
- package/lib/requirements.ts +469 -0
- package/lib/research-bundle.ts +300 -0
- package/lib/roadmap.ts +775 -0
- package/lib/scaffold.ts +480 -0
- package/lib/scan/_utils.ts +37 -0
- package/lib/scan/base64.ts +90 -0
- package/lib/scan/ignorefile.ts +109 -0
- package/lib/scan/injection.ts +67 -0
- package/lib/scan/patterns.ts +139 -0
- package/lib/scan/strip-markdown.ts +39 -0
- package/lib/scan/types.ts +28 -0
- package/lib/scheduler-wait.ts +58 -0
- package/lib/scheduler.ts +1370 -0
- package/lib/state.ts +1000 -0
- package/lib/think.ts +365 -0
- package/lib/tracker.ts +1591 -0
- package/lib/types.ts +1663 -0
- package/lib/utils.ts +1479 -0
- package/lib/verify.ts +1434 -0
- package/lib/wireup/autofix.ts +241 -0
- package/lib/wireup/cli.ts +278 -0
- package/lib/wireup/detection.ts +542 -0
- package/lib/wireup/discovery.ts +1063 -0
- package/lib/wireup/execution.ts +686 -0
- package/lib/wireup/index.ts +117 -0
- package/lib/wireup/orchestrator.ts +519 -0
- package/lib/wireup/report.ts +286 -0
- package/lib/wireup/scenarios.ts +616 -0
- package/lib/wireup/state.ts +139 -0
- package/lib/wireup/types.ts +436 -0
- package/lib/worktree.ts +1309 -0
- package/package.json +67 -0
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const { fs, path, safeReadFile, safeReadMarkdown, loadConfig, findPhaseInternal, resolveModelInternal, pathExistsInternal, generateSlugInternal, getMilestoneInfo, resolveModelForAgent, resolveEffortForAgent, execGit, output, error, } = require('../utils');
|
|
4
|
+
const { detectBackend, getBackendCapabilities, detectWebMcp, detectAvailableBackends, } = require('../backend');
|
|
5
|
+
const { detectOverstory, loadOverstoryConfig, } = require('../overstory');
|
|
6
|
+
const { worktreePath, } = require('../worktree');
|
|
7
|
+
const { runPreflightGates, } = require('../gates');
|
|
8
|
+
const { buildKnowledgeInjectionBlock, extractModuleHints, } = require('../knowledge');
|
|
9
|
+
const { freezeInterfaces, } = require('../got');
|
|
10
|
+
const { buildArtifactDAG, } = require('../deps');
|
|
11
|
+
const { planningDir: getPlanningDir, phasesDir: getPhasesDirPath, researchDir: getResearchDirPath, codebaseDir: getCodebaseDirPath, todosDir: getTodosDirPath, quickDir: getQuickDirPath, standardsDir: getStandardsDirPath, } = require('../paths');
|
|
12
|
+
const { inferCeremonyLevel, } = require('./base');
|
|
13
|
+
const { extractFrontmatter, } = require('../frontmatter');
|
|
14
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
15
|
+
/** Detect whether modelOverrides is configured in Claude settings. */
|
|
16
|
+
function _detectModelOverridesActive(cwd) {
|
|
17
|
+
try {
|
|
18
|
+
const locations = [
|
|
19
|
+
path.join(cwd, '.claude', 'settings.json'),
|
|
20
|
+
path.join(process.env.HOME || '', '.claude', 'settings.json'),
|
|
21
|
+
];
|
|
22
|
+
for (const loc of locations) {
|
|
23
|
+
if (!fs.existsSync(loc))
|
|
24
|
+
continue;
|
|
25
|
+
const data = JSON.parse(fs.readFileSync(loc, 'utf-8'));
|
|
26
|
+
if (data &&
|
|
27
|
+
typeof data === 'object' &&
|
|
28
|
+
data.modelOverrides &&
|
|
29
|
+
typeof data.modelOverrides === 'object' &&
|
|
30
|
+
Object.keys(data.modelOverrides).length > 0) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
const code = err.code;
|
|
38
|
+
if (code !== 'ENOENT' && code !== 'ENOTDIR' && !(err instanceof SyntaxError)) {
|
|
39
|
+
process.stderr.write(`[grd] WARNING: failed to detect model overrides: ${err.message}\n`);
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** Try to find and read a file matching a suffix in a phase directory. */
|
|
45
|
+
function _readPhaseFile(cwd, phaseDir, suffix) {
|
|
46
|
+
const phaseDirFull = path.join(cwd, phaseDir);
|
|
47
|
+
try {
|
|
48
|
+
const files = fs.readdirSync(phaseDirFull);
|
|
49
|
+
const match = files.find((f) => f.endsWith(suffix) || f === suffix.replace(/^-/, ''));
|
|
50
|
+
if (match)
|
|
51
|
+
return safeReadMarkdown(path.join(phaseDirFull, match));
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Phase directory may not exist yet
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Extract the `## Reflection` section from a VERIFICATION.md body.
|
|
60
|
+
* Returns the section content (without the heading) up to the next `## `
|
|
61
|
+
* heading or the closing `---` separator, or null if the section is absent.
|
|
62
|
+
*/
|
|
63
|
+
function _extractReflectionSection(verificationContent) {
|
|
64
|
+
const idx = verificationContent.indexOf('## Reflection');
|
|
65
|
+
if (idx === -1)
|
|
66
|
+
return null;
|
|
67
|
+
const after = verificationContent.slice(idx + '## Reflection'.length);
|
|
68
|
+
// Stop at next H2 (`\n## `), at a horizontal rule (`\n---`), or end of file.
|
|
69
|
+
const endMatch = after.search(/\n(?:## |---\s*\n)/);
|
|
70
|
+
const body = endMatch === -1 ? after : after.slice(0, endMatch);
|
|
71
|
+
const trimmed = body.trim();
|
|
72
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Walk prior phase directories and collect their `## Reflection` sections
|
|
76
|
+
* from `{phase}-VERIFICATION.md`. Returns the most recent `limit` entries in
|
|
77
|
+
* ascending phase order, excluding the current phase.
|
|
78
|
+
*
|
|
79
|
+
* Used by cmdInitPlanPhase to inject the hypothesis/predicted_outcome/
|
|
80
|
+
* actual_outcome history into the planner agent's context (Ouroboros
|
|
81
|
+
* integration Tier-1 #4).
|
|
82
|
+
*/
|
|
83
|
+
/**
|
|
84
|
+
* Normalise a user-supplied phase argument to match the `phase_number`
|
|
85
|
+
* format that findPhaseInternal returns (zero-padded major component,
|
|
86
|
+
* decimal suffix preserved). Examples: `1` -> `01`, `01.10` -> `01.10`,
|
|
87
|
+
* `12.3` -> `12.3`. Returns null for empty/invalid input.
|
|
88
|
+
*/
|
|
89
|
+
function _normalizePhaseArg(phase) {
|
|
90
|
+
if (!phase)
|
|
91
|
+
return null;
|
|
92
|
+
const m = phase.match(/^(\d+)(?:\.(\d+))?/);
|
|
93
|
+
if (!m)
|
|
94
|
+
return null;
|
|
95
|
+
const major = m[1].padStart(2, '0');
|
|
96
|
+
return m[2] !== undefined ? `${major}.${m[2]}` : major;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Compare two phase IDs componentwise. Handles inserted decimal phases
|
|
100
|
+
* correctly (e.g. `01.10` > `01.9`, which `parseFloat` would reverse since
|
|
101
|
+
* it treats them as 1.1 and 1.9).
|
|
102
|
+
* @returns negative if a < b, 0 if equal, positive if a > b
|
|
103
|
+
*/
|
|
104
|
+
function _comparePhaseIds(a, b) {
|
|
105
|
+
const partsA = a.split('.').map((p) => parseInt(p, 10));
|
|
106
|
+
const partsB = b.split('.').map((p) => parseInt(p, 10));
|
|
107
|
+
const len = Math.max(partsA.length, partsB.length);
|
|
108
|
+
for (let i = 0; i < len; i++) {
|
|
109
|
+
const ai = partsA[i] ?? 0;
|
|
110
|
+
const bi = partsB[i] ?? 0;
|
|
111
|
+
if (ai !== bi)
|
|
112
|
+
return ai - bi;
|
|
113
|
+
}
|
|
114
|
+
return 0;
|
|
115
|
+
}
|
|
116
|
+
function _extractPriorReflections(cwd, currentPhaseNumber, limit) {
|
|
117
|
+
if (limit <= 0)
|
|
118
|
+
return [];
|
|
119
|
+
const phasesDir = getPhasesDirPath(cwd);
|
|
120
|
+
let entries;
|
|
121
|
+
try {
|
|
122
|
+
entries = fs.readdirSync(phasesDir, { withFileTypes: true });
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
// Phase dirs look like `01-test`, `02-build`, `12-something`, or decimal-
|
|
128
|
+
// inserted like `01.10-foo`. Sort componentwise — parseFloat would treat
|
|
129
|
+
// `01.10` as 1.1 and misorder it against `01.2`/`01.9`.
|
|
130
|
+
const prior = [];
|
|
131
|
+
for (const entry of entries) {
|
|
132
|
+
if (!entry.isDirectory())
|
|
133
|
+
continue;
|
|
134
|
+
const m = entry.name.match(/^(\d+(?:\.\d+)?)-/);
|
|
135
|
+
if (!m)
|
|
136
|
+
continue;
|
|
137
|
+
const phaseNum = m[1];
|
|
138
|
+
if (currentPhaseNumber && _comparePhaseIds(phaseNum, currentPhaseNumber) >= 0)
|
|
139
|
+
continue;
|
|
140
|
+
prior.push({ phase: phaseNum, dir: entry.name });
|
|
141
|
+
}
|
|
142
|
+
prior.sort((a, b) => _comparePhaseIds(a.phase, b.phase));
|
|
143
|
+
const results = [];
|
|
144
|
+
// Walk most-recent-first so we collect up to `limit` newest reflections,
|
|
145
|
+
// then reverse to emit in ascending phase order (matches planner reading flow).
|
|
146
|
+
for (let i = prior.length - 1; i >= 0 && results.length < limit; i--) {
|
|
147
|
+
const { phase, dir } = prior[i];
|
|
148
|
+
const verification = _readPhaseFile(cwd, path.relative(cwd, path.join(phasesDir, dir)), '-VERIFICATION.md');
|
|
149
|
+
if (!verification)
|
|
150
|
+
continue;
|
|
151
|
+
const reflection = _extractReflectionSection(verification);
|
|
152
|
+
if (reflection)
|
|
153
|
+
results.push({ phase, reflection });
|
|
154
|
+
}
|
|
155
|
+
results.reverse();
|
|
156
|
+
return results;
|
|
157
|
+
}
|
|
158
|
+
// ─── Execute-Phase Init ──────────────────────────────────────────────────────
|
|
159
|
+
/**
|
|
160
|
+
* CLI command: Initialize execute-phase context with models, config, phase info, and plan inventory.
|
|
161
|
+
*/
|
|
162
|
+
function cmdInitExecutePhase(cwd, phase, includes, raw) {
|
|
163
|
+
if (!phase) {
|
|
164
|
+
error('phase required for init execute-phase. Usage: init execute-phase <phase-number>. Run `grd-tools roadmap get-phase` to list available phases, then pass the phase number, e.g.: init execute-phase 2');
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
// Pre-flight gate checks
|
|
168
|
+
const gates = runPreflightGates(cwd, 'execute-phase', { phase });
|
|
169
|
+
if (!gates.passed) {
|
|
170
|
+
output({ gate_failed: true, gate_errors: gates.errors, gate_warnings: gates.warnings }, raw);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const config = loadConfig(cwd);
|
|
174
|
+
const backend = detectBackend(cwd);
|
|
175
|
+
const backendCaps = getBackendCapabilities(backend);
|
|
176
|
+
const phaseInfo = findPhaseInternal(cwd, phase);
|
|
177
|
+
const milestone = getMilestoneInfo(cwd);
|
|
178
|
+
const webmcp = detectWebMcp(cwd);
|
|
179
|
+
const overstoryConfig = backend === 'overstory' ? loadOverstoryConfig(cwd) : null;
|
|
180
|
+
// Cache detectAvailableBackends result to avoid multiple calls
|
|
181
|
+
const availableBackends = detectAvailableBackends(cwd);
|
|
182
|
+
const result = {
|
|
183
|
+
// Backend
|
|
184
|
+
backend,
|
|
185
|
+
backend_capabilities: backendCaps,
|
|
186
|
+
// MCP elicitation and model overrides awareness (REQ-105, REQ-106)
|
|
187
|
+
mcp_elicitation_available: backendCaps.mcp_elicitation === true,
|
|
188
|
+
model_overrides_available: _detectModelOverridesActive(cwd),
|
|
189
|
+
// Models
|
|
190
|
+
executor_model: resolveModelInternal(cwd, 'grd-executor'),
|
|
191
|
+
verifier_model: resolveModelInternal(cwd, 'grd-verifier'),
|
|
192
|
+
reviewer_model: resolveModelInternal(cwd, 'grd-code-reviewer'),
|
|
193
|
+
// Effort levels (null if backend does not support effort)
|
|
194
|
+
executor_effort: resolveEffortForAgent(config, 'grd-executor', cwd),
|
|
195
|
+
verifier_effort: resolveEffortForAgent(config, 'grd-verifier', cwd),
|
|
196
|
+
reviewer_effort: resolveEffortForAgent(config, 'grd-code-reviewer', cwd),
|
|
197
|
+
// Config flags
|
|
198
|
+
commit_docs: config.commit_docs,
|
|
199
|
+
parallelization: config.parallelization,
|
|
200
|
+
branching_strategy: config.branching_strategy,
|
|
201
|
+
phase_branch_template: config.phase_branch_template,
|
|
202
|
+
milestone_branch_template: config.milestone_branch_template,
|
|
203
|
+
base_branch: config.branching_strategy !== 'none' ? config.base_branch : null,
|
|
204
|
+
verifier_enabled: config.verifier,
|
|
205
|
+
// Code review config
|
|
206
|
+
code_review_enabled: config.code_review_enabled,
|
|
207
|
+
code_review_timing: config.code_review_timing,
|
|
208
|
+
code_review_severity_gate: config.code_review_severity_gate,
|
|
209
|
+
code_review_auto_fix_warnings: config.code_review_auto_fix_warnings,
|
|
210
|
+
// Discussion & review config
|
|
211
|
+
discussion_before_execution: config.discussion?.before_execution ?? false,
|
|
212
|
+
discussion_enabled: config.discussion?.enabled ?? true,
|
|
213
|
+
brainstormer_backend: config.backend_roles?.brainstormer ?? null,
|
|
214
|
+
brainstormer_available: (() => {
|
|
215
|
+
const brainstormer = config.backend_roles?.brainstormer ?? null;
|
|
216
|
+
if (!brainstormer)
|
|
217
|
+
return false;
|
|
218
|
+
return availableBackends[brainstormer]?.available === true;
|
|
219
|
+
})(),
|
|
220
|
+
reviewer_backend: config.backend_roles?.reviewer ?? null,
|
|
221
|
+
reviewer_available: (() => {
|
|
222
|
+
const reviewer = config.backend_roles?.reviewer ?? null;
|
|
223
|
+
if (!reviewer)
|
|
224
|
+
return false;
|
|
225
|
+
return availableBackends[reviewer]?.available === true;
|
|
226
|
+
})(),
|
|
227
|
+
pr_review_enabled: config.code_review_enabled === true && !!(config.backend_roles?.reviewer),
|
|
228
|
+
// Execution config
|
|
229
|
+
use_teams: config.use_teams,
|
|
230
|
+
team_timeout_minutes: config.team_timeout_minutes,
|
|
231
|
+
max_concurrent_teammates: config.max_concurrent_teammates,
|
|
232
|
+
// Phase info
|
|
233
|
+
phase_found: !!phaseInfo,
|
|
234
|
+
phase_dir: phaseInfo?.directory || null,
|
|
235
|
+
phase_number: phaseInfo?.phase_number || null,
|
|
236
|
+
phase_name: phaseInfo?.phase_name || null,
|
|
237
|
+
phase_slug: phaseInfo?.phase_slug || null,
|
|
238
|
+
// Plan inventory
|
|
239
|
+
plans: phaseInfo?.plans || [],
|
|
240
|
+
summaries: phaseInfo?.summaries || [],
|
|
241
|
+
incomplete_plans: phaseInfo?.incomplete_plans || [],
|
|
242
|
+
plan_count: phaseInfo?.plans?.length || 0,
|
|
243
|
+
incomplete_count: phaseInfo?.incomplete_plans?.length || 0,
|
|
244
|
+
// Write-intent manifests (REQ-167): files each plan declares it will modify
|
|
245
|
+
plan_files_modified: (() => {
|
|
246
|
+
if (!phaseInfo?.plans || !phaseInfo?.directory)
|
|
247
|
+
return {};
|
|
248
|
+
const phaseDirFull = path.join(cwd, phaseInfo.directory);
|
|
249
|
+
const result = {};
|
|
250
|
+
for (const planFile of phaseInfo.plans) {
|
|
251
|
+
// Derive plan ID from filename: "89-01-PLAN.md" -> "89-01"
|
|
252
|
+
const planId = planFile.replace(/-PLAN\.md$/i, '');
|
|
253
|
+
const planPath = path.join(phaseDirFull, planFile);
|
|
254
|
+
try {
|
|
255
|
+
const planContent = fs.readFileSync(planPath, 'utf-8');
|
|
256
|
+
const fm = extractFrontmatter(planContent);
|
|
257
|
+
const filesModified = fm.files_modified;
|
|
258
|
+
if (Array.isArray(filesModified)) {
|
|
259
|
+
result[planId] = filesModified;
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
result[planId] = [];
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
result[planId] = [];
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return result;
|
|
270
|
+
})(),
|
|
271
|
+
// Knowledge injection (NERFIFY): inject prior-phase patterns into executor context
|
|
272
|
+
knowhow_block: (() => {
|
|
273
|
+
if (!phaseInfo?.directory || !phaseInfo?.phase_number)
|
|
274
|
+
return null;
|
|
275
|
+
const hints = extractModuleHints(path.join(cwd, phaseInfo.directory));
|
|
276
|
+
const block = buildKnowledgeInjectionBlock(cwd, phaseInfo.phase_number, hints);
|
|
277
|
+
return block || null;
|
|
278
|
+
})(),
|
|
279
|
+
// GoT frozen interfaces (NERFIFY): artifact contracts from plan DAG
|
|
280
|
+
frozen_interfaces: (() => {
|
|
281
|
+
if (!phaseInfo?.plans || !phaseInfo?.directory || !phaseInfo?.phase_number)
|
|
282
|
+
return [];
|
|
283
|
+
const phaseDirFull = path.join(cwd, phaseInfo.directory);
|
|
284
|
+
const planArtifacts = [];
|
|
285
|
+
for (let i = 0; i < phaseInfo.plans.length; i++) {
|
|
286
|
+
const planFile = phaseInfo.plans[i];
|
|
287
|
+
const planPath = path.join(phaseDirFull, planFile);
|
|
288
|
+
try {
|
|
289
|
+
const planContent = fs.readFileSync(planPath, 'utf-8');
|
|
290
|
+
const fm = extractFrontmatter(planContent);
|
|
291
|
+
planArtifacts.push({
|
|
292
|
+
objective: fm.objective || '',
|
|
293
|
+
files_modified: fm.files_modified || [],
|
|
294
|
+
phase: phaseInfo.phase_number,
|
|
295
|
+
plan: i + 1,
|
|
296
|
+
type: fm.type || 'implementation',
|
|
297
|
+
wave: fm.wave || 1,
|
|
298
|
+
depends_on: fm.depends_on || [],
|
|
299
|
+
autonomous: fm.autonomous ?? true,
|
|
300
|
+
provides: fm.provides || [],
|
|
301
|
+
requires: fm.requires || [],
|
|
302
|
+
integration_points: fm.integration_points || [],
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
catch {
|
|
306
|
+
// Plan file may not have artifact declarations
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (planArtifacts.length === 0)
|
|
310
|
+
return [];
|
|
311
|
+
try {
|
|
312
|
+
const dag = buildArtifactDAG(planArtifacts);
|
|
313
|
+
return freezeInterfaces(dag);
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
return [];
|
|
317
|
+
}
|
|
318
|
+
})(),
|
|
319
|
+
// Branch name (pre-computed)
|
|
320
|
+
branch_name: config.branching_strategy === 'phase' && phaseInfo
|
|
321
|
+
? (config.phase_branch_template || 'grd/{milestone}/{phase}-{slug}')
|
|
322
|
+
.replace('{milestone}', milestone.version)
|
|
323
|
+
.replace('{phase}', phaseInfo.phase_number)
|
|
324
|
+
.replace('{slug}', phaseInfo.phase_slug || 'phase')
|
|
325
|
+
: config.branching_strategy === 'milestone'
|
|
326
|
+
? (config.milestone_branch_template || 'grd/{milestone}-{slug}')
|
|
327
|
+
.replace('{milestone}', milestone.version)
|
|
328
|
+
.replace('{slug}', generateSlugInternal(milestone.name) || 'milestone')
|
|
329
|
+
: null,
|
|
330
|
+
// Worktree fields (computed, not created)
|
|
331
|
+
worktree_path: phaseInfo ? worktreePath(cwd, milestone.version, phaseInfo.phase_number) : null,
|
|
332
|
+
worktree_branch: config.branching_strategy !== 'none' && phaseInfo
|
|
333
|
+
? (config.phase_branch_template || 'grd/{milestone}/{phase}-{slug}')
|
|
334
|
+
.replace('{milestone}', milestone.version)
|
|
335
|
+
.replace('{phase}', phaseInfo.phase_number)
|
|
336
|
+
.replace('{slug}', phaseInfo.phase_slug || 'phase')
|
|
337
|
+
: null,
|
|
338
|
+
// Milestone branch (phase branches fork from this, merge back into it)
|
|
339
|
+
milestone_branch: config.branching_strategy !== 'none'
|
|
340
|
+
? (config.milestone_branch_template || 'grd/{milestone}-{slug}')
|
|
341
|
+
.replace('{milestone}', milestone.version)
|
|
342
|
+
.replace('{slug}', generateSlugInternal(milestone.name) || 'milestone')
|
|
343
|
+
: null,
|
|
344
|
+
// Predecessor branch for stacked PRs
|
|
345
|
+
predecessor_branch: (() => {
|
|
346
|
+
if (config.branching_strategy !== 'phase' || !phaseInfo)
|
|
347
|
+
return null;
|
|
348
|
+
const phaseNum = parseInt(phaseInfo.phase_number, 10);
|
|
349
|
+
if (isNaN(phaseNum) || phaseNum <= 1)
|
|
350
|
+
return null;
|
|
351
|
+
const baseBranch = config.base_branch || 'main';
|
|
352
|
+
const template = config.phase_branch_template || 'grd/{milestone}/{phase}-{slug}';
|
|
353
|
+
const prefix = template
|
|
354
|
+
.replace('{milestone}', milestone.version)
|
|
355
|
+
.replace('{phase}', '')
|
|
356
|
+
.replace('{slug}', '');
|
|
357
|
+
const branchList = execGit(cwd, ['branch', '--list', '--format', '%(refname:short)']);
|
|
358
|
+
if (branchList.exitCode !== 0)
|
|
359
|
+
return null;
|
|
360
|
+
const localBranches = branchList.stdout.trim().split('\n').filter(Boolean);
|
|
361
|
+
const milestonePrefix = prefix.split('/').slice(0, -1).join('/');
|
|
362
|
+
let bestBranch = null;
|
|
363
|
+
let bestPhaseNum = 0;
|
|
364
|
+
for (const br of localBranches) {
|
|
365
|
+
if (!br.startsWith(milestonePrefix + '/'))
|
|
366
|
+
continue;
|
|
367
|
+
const suffix = br.slice(milestonePrefix.length + 1);
|
|
368
|
+
const match = suffix.match(/^(\d+)-/);
|
|
369
|
+
if (!match)
|
|
370
|
+
continue;
|
|
371
|
+
const brPhaseNum = parseInt(match[1], 10);
|
|
372
|
+
if (brPhaseNum >= phaseNum || brPhaseNum <= bestPhaseNum)
|
|
373
|
+
continue;
|
|
374
|
+
const merged = execGit(cwd, ['merge-base', '--is-ancestor', br, baseBranch]);
|
|
375
|
+
if (merged.exitCode === 0)
|
|
376
|
+
continue;
|
|
377
|
+
bestBranch = br;
|
|
378
|
+
bestPhaseNum = brPhaseNum;
|
|
379
|
+
}
|
|
380
|
+
return bestBranch;
|
|
381
|
+
})(),
|
|
382
|
+
// Milestone info
|
|
383
|
+
milestone_version: milestone.version,
|
|
384
|
+
milestone_name: milestone.name,
|
|
385
|
+
milestone_slug: generateSlugInternal(milestone.name),
|
|
386
|
+
// File existence
|
|
387
|
+
state_exists: pathExistsInternal(cwd, path.join(getPlanningDir(cwd), 'STATE.md')),
|
|
388
|
+
roadmap_exists: pathExistsInternal(cwd, path.join(getPlanningDir(cwd), 'ROADMAP.md')),
|
|
389
|
+
config_exists: pathExistsInternal(cwd, path.join(getPlanningDir(cwd), 'config.json')),
|
|
390
|
+
principles_exists: pathExistsInternal(cwd, path.join(getPlanningDir(cwd), 'PRINCIPLES.md')),
|
|
391
|
+
standards_exists: fs.existsSync(path.join(getStandardsDirPath(cwd), 'index.yml')),
|
|
392
|
+
// Milestone-scoped paths (REQ-56)
|
|
393
|
+
phases_dir: path.relative(cwd, getPhasesDirPath(cwd)),
|
|
394
|
+
research_dir: path.relative(cwd, getResearchDirPath(cwd)),
|
|
395
|
+
codebase_dir: path.relative(cwd, getCodebaseDirPath(cwd)),
|
|
396
|
+
quick_dir: path.relative(cwd, getQuickDirPath(cwd)),
|
|
397
|
+
todos_dir: path.relative(cwd, getTodosDirPath(cwd)),
|
|
398
|
+
standards_dir: path.relative(cwd, getStandardsDirPath(cwd)),
|
|
399
|
+
// Ceremony level
|
|
400
|
+
ceremony_level: inferCeremonyLevel(config, phaseInfo, cwd),
|
|
401
|
+
// WebMCP availability (REQ-96)
|
|
402
|
+
webmcp_available: webmcp.available,
|
|
403
|
+
webmcp_skip_reason: webmcp.available ? null : webmcp.reason,
|
|
404
|
+
// Native worktree isolation capability (Phase 45)
|
|
405
|
+
// For overstory, this is false — Overstory manages its own worktrees, not Claude Code
|
|
406
|
+
native_worktree_available: backend !== 'overstory' && backendCaps.native_worktree_isolation === true,
|
|
407
|
+
// Overstory backend fields (config preloaded, pass to detectOverstory to avoid re-read)
|
|
408
|
+
overstory_available: backend === 'overstory' ? detectOverstory(cwd, overstoryConfig ?? undefined) !== null : false,
|
|
409
|
+
overstory_runtime: overstoryConfig ? overstoryConfig.runtime : null,
|
|
410
|
+
overstory_config: overstoryConfig,
|
|
411
|
+
// Isolation mode and main repo path (Phase 46)
|
|
412
|
+
isolation_mode: config.branching_strategy === 'none'
|
|
413
|
+
? 'none'
|
|
414
|
+
: backend === 'overstory'
|
|
415
|
+
? 'overstory'
|
|
416
|
+
: backendCaps.native_worktree_isolation === true
|
|
417
|
+
? 'native'
|
|
418
|
+
: 'manual',
|
|
419
|
+
main_repo_path: config.branching_strategy !== 'none'
|
|
420
|
+
? (() => {
|
|
421
|
+
try {
|
|
422
|
+
return fs.realpathSync(cwd);
|
|
423
|
+
}
|
|
424
|
+
catch (err) {
|
|
425
|
+
process.stderr.write(`[grd] WARNING: realpathSync failed: ${err.message}, using raw cwd\n`);
|
|
426
|
+
return cwd;
|
|
427
|
+
}
|
|
428
|
+
})()
|
|
429
|
+
: null,
|
|
430
|
+
// CLAUDE_PLUGIN_DATA (v2.1.78): persistent directory for cross-project plugin state.
|
|
431
|
+
// When available, agents can use this for state that should survive plugin updates
|
|
432
|
+
// and be shared across projects (e.g., global scheduler config, evolve history).
|
|
433
|
+
// .planning/ remains the source of truth for project-scoped state.
|
|
434
|
+
plugin_data_available: !!process.env.CLAUDE_PLUGIN_DATA,
|
|
435
|
+
plugin_data_dir: process.env.CLAUDE_PLUGIN_DATA || null,
|
|
436
|
+
};
|
|
437
|
+
// Include gate warnings if any
|
|
438
|
+
if (gates.warnings.length > 0) {
|
|
439
|
+
result.gate_warnings = gates.warnings;
|
|
440
|
+
}
|
|
441
|
+
// Include file contents if requested via --include
|
|
442
|
+
if (includes.has('state')) {
|
|
443
|
+
result.state_content = safeReadMarkdown(path.join(cwd, '.planning', 'STATE.md'));
|
|
444
|
+
}
|
|
445
|
+
if (includes.has('config')) {
|
|
446
|
+
result.config_content = safeReadFile(path.join(cwd, '.planning', 'config.json'));
|
|
447
|
+
}
|
|
448
|
+
if (includes.has('roadmap')) {
|
|
449
|
+
result.roadmap_content = safeReadMarkdown(path.join(cwd, '.planning', 'ROADMAP.md'));
|
|
450
|
+
}
|
|
451
|
+
if (includes.has('principles')) {
|
|
452
|
+
result.principles_content = safeReadMarkdown(path.join(cwd, '.planning', 'PRINCIPLES.md'));
|
|
453
|
+
}
|
|
454
|
+
if (includes.has('context') && phaseInfo?.directory) {
|
|
455
|
+
const ctx = _readPhaseFile(cwd, phaseInfo.directory, '-CONTEXT.md');
|
|
456
|
+
if (ctx)
|
|
457
|
+
result.context_content = ctx;
|
|
458
|
+
}
|
|
459
|
+
output(result, raw, `Backend: ${result.backend}, phase: ${result.phase_number || 'unknown'}, milestone: ${result.milestone_version}`);
|
|
460
|
+
}
|
|
461
|
+
// ─── Plan-Phase Init ─────────────────────────────────────────────────────────
|
|
462
|
+
/**
|
|
463
|
+
* CLI command: Initialize plan-phase context with models, workflow flags, and existing artifacts.
|
|
464
|
+
*/
|
|
465
|
+
function cmdInitPlanPhase(cwd, phase, includes, raw) {
|
|
466
|
+
if (!phase) {
|
|
467
|
+
error('phase required for init plan-phase. Usage: init plan-phase <phase-number>. Pass the phase number as an argument, e.g.: init plan-phase 01');
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const gates = runPreflightGates(cwd, 'plan-phase', { phase });
|
|
471
|
+
if (!gates.passed) {
|
|
472
|
+
output({ gate_failed: true, gate_errors: gates.errors, gate_warnings: gates.warnings }, raw);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
const config = loadConfig(cwd);
|
|
476
|
+
const backend = detectBackend(cwd);
|
|
477
|
+
const backendCaps = getBackendCapabilities(backend);
|
|
478
|
+
const phaseInfo = findPhaseInternal(cwd, phase);
|
|
479
|
+
const webmcp = detectWebMcp(cwd);
|
|
480
|
+
const availableBackendsPlan = detectAvailableBackends(cwd);
|
|
481
|
+
const result = {
|
|
482
|
+
// Backend
|
|
483
|
+
backend,
|
|
484
|
+
backend_capabilities: backendCaps,
|
|
485
|
+
// MCP elicitation and model overrides awareness (REQ-105, REQ-106)
|
|
486
|
+
mcp_elicitation_available: backendCaps.mcp_elicitation === true,
|
|
487
|
+
model_overrides_available: _detectModelOverridesActive(cwd),
|
|
488
|
+
// Models
|
|
489
|
+
researcher_model: resolveModelInternal(cwd, 'grd-phase-researcher'),
|
|
490
|
+
planner_model: resolveModelInternal(cwd, 'grd-planner'),
|
|
491
|
+
checker_model: resolveModelInternal(cwd, 'grd-plan-checker'),
|
|
492
|
+
// Effort levels (null if backend does not support effort)
|
|
493
|
+
researcher_effort: resolveEffortForAgent(config, 'grd-phase-researcher', cwd),
|
|
494
|
+
planner_effort: resolveEffortForAgent(config, 'grd-planner', cwd),
|
|
495
|
+
checker_effort: resolveEffortForAgent(config, 'grd-plan-checker', cwd),
|
|
496
|
+
// Workflow flags
|
|
497
|
+
research_enabled: config.research,
|
|
498
|
+
plan_checker_enabled: config.plan_checker,
|
|
499
|
+
commit_docs: config.commit_docs,
|
|
500
|
+
// Phase info
|
|
501
|
+
phase_found: !!phaseInfo,
|
|
502
|
+
phase_dir: phaseInfo?.directory || null,
|
|
503
|
+
phase_number: phaseInfo?.phase_number || null,
|
|
504
|
+
phase_name: phaseInfo?.phase_name || null,
|
|
505
|
+
phase_slug: phaseInfo?.phase_slug || null,
|
|
506
|
+
padded_phase: phaseInfo?.phase_number?.padStart(2, '0') || null,
|
|
507
|
+
// Existing artifacts
|
|
508
|
+
has_research: phaseInfo?.has_research || false,
|
|
509
|
+
has_context: phaseInfo?.has_context || false,
|
|
510
|
+
has_plans: (phaseInfo?.plans?.length || 0) > 0,
|
|
511
|
+
plan_count: phaseInfo?.plans?.length || 0,
|
|
512
|
+
// Environment
|
|
513
|
+
planning_exists: pathExistsInternal(cwd, '.planning'),
|
|
514
|
+
roadmap_exists: pathExistsInternal(cwd, path.join(getPlanningDir(cwd), 'ROADMAP.md')),
|
|
515
|
+
principles_exists: pathExistsInternal(cwd, path.join(getPlanningDir(cwd), 'PRINCIPLES.md')),
|
|
516
|
+
standards_exists: fs.existsSync(path.join(getStandardsDirPath(cwd), 'index.yml')),
|
|
517
|
+
// Milestone-scoped paths (REQ-56)
|
|
518
|
+
phases_dir: path.relative(cwd, getPhasesDirPath(cwd)),
|
|
519
|
+
research_dir: path.relative(cwd, getResearchDirPath(cwd)),
|
|
520
|
+
codebase_dir: path.relative(cwd, getCodebaseDirPath(cwd)),
|
|
521
|
+
quick_dir: path.relative(cwd, getQuickDirPath(cwd)),
|
|
522
|
+
todos_dir: path.relative(cwd, getTodosDirPath(cwd)),
|
|
523
|
+
standards_dir: path.relative(cwd, getStandardsDirPath(cwd)),
|
|
524
|
+
// Ceremony level
|
|
525
|
+
ceremony_level: inferCeremonyLevel(config, phaseInfo, cwd),
|
|
526
|
+
// WebMCP availability (REQ-96)
|
|
527
|
+
webmcp_available: webmcp.available,
|
|
528
|
+
webmcp_skip_reason: webmcp.available ? null : webmcp.reason,
|
|
529
|
+
// CLAUDE_PLUGIN_DATA (v2.1.78): persistent directory for cross-project plugin state.
|
|
530
|
+
// When available, agents can use this for state that should survive plugin updates
|
|
531
|
+
// and be shared across projects (e.g., global scheduler config, evolve history).
|
|
532
|
+
// .planning/ remains the source of truth for project-scoped state.
|
|
533
|
+
plugin_data_available: !!process.env.CLAUDE_PLUGIN_DATA,
|
|
534
|
+
plugin_data_dir: process.env.CLAUDE_PLUGIN_DATA || null,
|
|
535
|
+
// Knowledge injection (NERFIFY): inject prior-phase patterns into planner/researcher context
|
|
536
|
+
knowhow_block: (() => {
|
|
537
|
+
if (!phaseInfo?.phase_number)
|
|
538
|
+
return null;
|
|
539
|
+
const phaseDir = phaseInfo.directory ? path.join(cwd, phaseInfo.directory) : null;
|
|
540
|
+
const hints = phaseDir ? extractModuleHints(phaseDir) : [];
|
|
541
|
+
const block = buildKnowledgeInjectionBlock(cwd, phaseInfo.phase_number, hints);
|
|
542
|
+
return block || null;
|
|
543
|
+
})(),
|
|
544
|
+
// Prior reflection sections from previous phases' VERIFICATION.md files.
|
|
545
|
+
// Tier-1 #4 of the Ouroboros integration: the planner sees prior
|
|
546
|
+
// hypothesis -> predicted_outcome -> actual_outcome -> verdict history
|
|
547
|
+
// so it can build on confirmed claims, refine partials, and avoid
|
|
548
|
+
// restating falsified hypotheses. Capped at 5 to bound context size.
|
|
549
|
+
//
|
|
550
|
+
// Use phaseInfo.phase_number when the phase dir exists. When it does
|
|
551
|
+
// not (planning a roadmap phase before its directory is created),
|
|
552
|
+
// fall back to the user-supplied `phase` argument so the >= current
|
|
553
|
+
// filter still excludes future phases. Without this fallback, codex
|
|
554
|
+
// r2 P2: `null` disables the filter and future reflections leak in.
|
|
555
|
+
prior_reflections: _extractPriorReflections(cwd, phaseInfo?.phase_number || _normalizePhaseArg(phase), 5),
|
|
556
|
+
// DEAD-ENDS.md registry (Tier-2 #6 of the Ouroboros integration).
|
|
557
|
+
// Project-scoped (NOT milestone-scoped) — dead ends are knowledge that
|
|
558
|
+
// crosses milestones. Planner consults this before proposing a new
|
|
559
|
+
// hypothesis so previously-falsified approaches do not re-surface
|
|
560
|
+
// without explicit re-test. Read path only in this PR; writes are a
|
|
561
|
+
// future PR. Null when the file does not exist.
|
|
562
|
+
dead_ends_md: safeReadMarkdown(path.join(cwd, '.planning', 'DEAD-ENDS.md')),
|
|
563
|
+
// GENOME.md strategy snapshot (Tier-2 #8 of the Ouroboros integration).
|
|
564
|
+
// Project-scoped, captures the current planning meta-strategy: which
|
|
565
|
+
// heuristics work, which agents are favored, what verdict-thresholds.
|
|
566
|
+
// Planner reads it and adapts; per-iteration rewrites are tracked in
|
|
567
|
+
// git (rollback policy = `git revert`). Read path only; snapshot CLI
|
|
568
|
+
// is a follow-up PR. Null when the file does not exist.
|
|
569
|
+
genome_md: safeReadMarkdown(path.join(cwd, '.planning', 'GENOME.md')),
|
|
570
|
+
// Citation traversal config
|
|
571
|
+
transitive_citation_gate_enabled: !!config.transitive_citation_gate,
|
|
572
|
+
// Discussion & review config
|
|
573
|
+
discussion_before_planning: config.discussion?.before_planning ?? true,
|
|
574
|
+
discussion_enabled: config.discussion?.enabled ?? true,
|
|
575
|
+
brainstormer_backend: config.backend_roles?.brainstormer ?? null,
|
|
576
|
+
brainstormer_available: (() => {
|
|
577
|
+
const brainstormer = config.backend_roles?.brainstormer ?? null;
|
|
578
|
+
if (!brainstormer)
|
|
579
|
+
return false;
|
|
580
|
+
return availableBackendsPlan[brainstormer]?.available === true;
|
|
581
|
+
})(),
|
|
582
|
+
reviewer_backend: config.backend_roles?.reviewer ?? null,
|
|
583
|
+
reviewer_available: (() => {
|
|
584
|
+
const reviewer = config.backend_roles?.reviewer ?? null;
|
|
585
|
+
if (!reviewer)
|
|
586
|
+
return false;
|
|
587
|
+
return availableBackendsPlan[reviewer]?.available === true;
|
|
588
|
+
})(),
|
|
589
|
+
};
|
|
590
|
+
if (gates.warnings.length > 0) {
|
|
591
|
+
result.gate_warnings = gates.warnings;
|
|
592
|
+
}
|
|
593
|
+
// Include file contents if requested via --include
|
|
594
|
+
if (includes.has('state')) {
|
|
595
|
+
result.state_content = safeReadMarkdown(path.join(cwd, '.planning', 'STATE.md'));
|
|
596
|
+
}
|
|
597
|
+
if (includes.has('roadmap')) {
|
|
598
|
+
result.roadmap_content = safeReadMarkdown(path.join(cwd, '.planning', 'ROADMAP.md'));
|
|
599
|
+
}
|
|
600
|
+
if (includes.has('requirements')) {
|
|
601
|
+
result.requirements_content = safeReadMarkdown(path.join(cwd, '.planning', 'REQUIREMENTS.md'));
|
|
602
|
+
}
|
|
603
|
+
if (includes.has('context') && phaseInfo?.directory) {
|
|
604
|
+
const ctx = _readPhaseFile(cwd, phaseInfo.directory, '-CONTEXT.md');
|
|
605
|
+
if (ctx)
|
|
606
|
+
result.context_content = ctx;
|
|
607
|
+
}
|
|
608
|
+
if (includes.has('research') && phaseInfo?.directory) {
|
|
609
|
+
const res = _readPhaseFile(cwd, phaseInfo.directory, '-RESEARCH.md');
|
|
610
|
+
if (res)
|
|
611
|
+
result.research_content = res;
|
|
612
|
+
}
|
|
613
|
+
if (includes.has('verification') && phaseInfo?.directory) {
|
|
614
|
+
const ver = _readPhaseFile(cwd, phaseInfo.directory, '-VERIFICATION.md');
|
|
615
|
+
if (ver)
|
|
616
|
+
result.verification_content = ver;
|
|
617
|
+
}
|
|
618
|
+
if (includes.has('uat') && phaseInfo?.directory) {
|
|
619
|
+
const uat = _readPhaseFile(cwd, phaseInfo.directory, '-UAT.md');
|
|
620
|
+
if (uat)
|
|
621
|
+
result.uat_content = uat;
|
|
622
|
+
}
|
|
623
|
+
if (includes.has('principles')) {
|
|
624
|
+
result.principles_content = safeReadMarkdown(path.join(cwd, '.planning', 'PRINCIPLES.md'));
|
|
625
|
+
}
|
|
626
|
+
output(result, raw, `Backend: ${result.backend}, phase: ${result.phase_number || 'unknown'}`);
|
|
627
|
+
}
|
|
628
|
+
// ─── Verify-Work Init ────────────────────────────────────────────────────────
|
|
629
|
+
/**
|
|
630
|
+
* CLI command: Initialize verify-work context with phase info and verification artifact status.
|
|
631
|
+
*/
|
|
632
|
+
function cmdInitVerifyWork(cwd, phase, raw) {
|
|
633
|
+
if (!phase) {
|
|
634
|
+
error('phase required for init verify-work');
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
const config = loadConfig(cwd);
|
|
638
|
+
const backend = detectBackend(cwd);
|
|
639
|
+
const phaseInfo = findPhaseInternal(cwd, phase);
|
|
640
|
+
const webmcp = detectWebMcp(cwd);
|
|
641
|
+
const result = {
|
|
642
|
+
backend,
|
|
643
|
+
backend_capabilities: getBackendCapabilities(backend),
|
|
644
|
+
planner_model: resolveModelInternal(cwd, 'grd-planner'),
|
|
645
|
+
planner_effort: resolveEffortForAgent(config, 'grd-planner', cwd),
|
|
646
|
+
checker_model: resolveModelInternal(cwd, 'grd-plan-checker'),
|
|
647
|
+
checker_effort: resolveEffortForAgent(config, 'grd-plan-checker', cwd),
|
|
648
|
+
commit_docs: config.commit_docs,
|
|
649
|
+
phase_found: !!phaseInfo,
|
|
650
|
+
phase_dir: phaseInfo?.directory || null,
|
|
651
|
+
phase_number: phaseInfo?.phase_number || null,
|
|
652
|
+
phase_name: phaseInfo?.phase_name || null,
|
|
653
|
+
has_verification: phaseInfo?.has_verification || false,
|
|
654
|
+
phases_dir: path.relative(cwd, getPhasesDirPath(cwd)),
|
|
655
|
+
research_dir: path.relative(cwd, getResearchDirPath(cwd)),
|
|
656
|
+
codebase_dir: path.relative(cwd, getCodebaseDirPath(cwd)),
|
|
657
|
+
quick_dir: path.relative(cwd, getQuickDirPath(cwd)),
|
|
658
|
+
todos_dir: path.relative(cwd, getTodosDirPath(cwd)),
|
|
659
|
+
standards_dir: path.relative(cwd, getStandardsDirPath(cwd)),
|
|
660
|
+
standards_exists: fs.existsSync(path.join(getStandardsDirPath(cwd), 'index.yml')),
|
|
661
|
+
webmcp_available: webmcp.available,
|
|
662
|
+
webmcp_skip_reason: webmcp.available ? null : webmcp.reason,
|
|
663
|
+
};
|
|
664
|
+
output(result, raw, `Backend: ${result.backend}, phase: ${result.phase_number || 'unknown'}`);
|
|
665
|
+
}
|
|
666
|
+
// ─── Code-Review Init ────────────────────────────────────────────────────────
|
|
667
|
+
/**
|
|
668
|
+
* CLI command: Initialize code-review context with phase plans, summaries, and reviewer model.
|
|
669
|
+
*/
|
|
670
|
+
function cmdInitCodeReview(cwd, phase, raw) {
|
|
671
|
+
if (!phase) {
|
|
672
|
+
error('phase required for init code-review. Usage: init code-review <phase-number>. Provide a phase number, e.g.: init code-review 2');
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
const config = loadConfig(cwd);
|
|
676
|
+
const backend = detectBackend(cwd);
|
|
677
|
+
const phaseInfo = findPhaseInternal(cwd, phase);
|
|
678
|
+
const planningDir = getPlanningDir(cwd);
|
|
679
|
+
const result = {
|
|
680
|
+
backend,
|
|
681
|
+
backend_capabilities: getBackendCapabilities(backend),
|
|
682
|
+
reviewer_model: resolveModelInternal(cwd, 'grd-code-reviewer'),
|
|
683
|
+
reviewer_effort: resolveEffortForAgent(config, 'grd-code-reviewer', cwd),
|
|
684
|
+
code_review_enabled: config.code_review_enabled,
|
|
685
|
+
code_review_timing: config.code_review_timing,
|
|
686
|
+
code_review_severity_gate: config.code_review_severity_gate,
|
|
687
|
+
phase_found: !!phaseInfo,
|
|
688
|
+
phase_dir: phaseInfo?.directory || null,
|
|
689
|
+
phase_number: phaseInfo?.phase_number || null,
|
|
690
|
+
phase_name: phaseInfo?.phase_name || null,
|
|
691
|
+
plans: phaseInfo?.plans || [],
|
|
692
|
+
summaries: phaseInfo?.summaries || [],
|
|
693
|
+
plan_count: phaseInfo?.plans?.length || 0,
|
|
694
|
+
summary_count: phaseInfo?.summaries?.length || 0,
|
|
695
|
+
has_research: phaseInfo?.has_research || false,
|
|
696
|
+
roadmap_exists: pathExistsInternal(cwd, path.join(planningDir, 'ROADMAP.md')),
|
|
697
|
+
requirements_exists: pathExistsInternal(cwd, path.join(planningDir, 'REQUIREMENTS.md')),
|
|
698
|
+
phases_dir: path.relative(cwd, getPhasesDirPath(cwd)),
|
|
699
|
+
};
|
|
700
|
+
output(result, raw, `Backend: ${result.backend}, phase: ${result.phase_number || 'unknown'}, plans: ${result.plan_count}`);
|
|
701
|
+
}
|
|
702
|
+
// ─── Phase-Research Init ─────────────────────────────────────────────────────
|
|
703
|
+
/**
|
|
704
|
+
* CLI command: Initialize phase-research context with research files and phase details.
|
|
705
|
+
*/
|
|
706
|
+
function cmdInitPhaseResearch(cwd, phase, includes, raw) {
|
|
707
|
+
if (!phase) {
|
|
708
|
+
error('phase required for init phase-research. Usage: init phase-research <phase-number>. Provide a phase number, e.g.: init phase-research 2');
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
const config = loadConfig(cwd);
|
|
712
|
+
const backend = detectBackend(cwd);
|
|
713
|
+
const phaseInfo = findPhaseInternal(cwd, phase);
|
|
714
|
+
const planningDir = getPlanningDir(cwd);
|
|
715
|
+
const researchDir = getResearchDirPath(cwd);
|
|
716
|
+
const result = {
|
|
717
|
+
backend,
|
|
718
|
+
backend_capabilities: getBackendCapabilities(backend),
|
|
719
|
+
researcher_model: resolveModelForAgent(config, 'grd-phase-researcher'),
|
|
720
|
+
researcher_effort: resolveEffortForAgent(config, 'grd-phase-researcher', cwd),
|
|
721
|
+
phase_found: !!phaseInfo,
|
|
722
|
+
phase_dir: phaseInfo?.directory || null,
|
|
723
|
+
phase_number: phaseInfo?.phase_number || null,
|
|
724
|
+
phase_name: phaseInfo?.phase_name || null,
|
|
725
|
+
landscape_exists: fs.existsSync(path.join(researchDir, 'LANDSCAPE.md')),
|
|
726
|
+
papers_exists: fs.existsSync(path.join(researchDir, 'PAPERS.md')),
|
|
727
|
+
knowhow_exists: fs.existsSync(path.join(researchDir, 'KNOWHOW.md')),
|
|
728
|
+
baseline_exists: pathExistsInternal(cwd, path.join(planningDir, 'BASELINE.md')),
|
|
729
|
+
roadmap_exists: pathExistsInternal(cwd, path.join(planningDir, 'ROADMAP.md')),
|
|
730
|
+
requirements_exists: pathExistsInternal(cwd, path.join(planningDir, 'REQUIREMENTS.md')),
|
|
731
|
+
phases_dir: path.relative(cwd, getPhasesDirPath(cwd)),
|
|
732
|
+
research_dir: path.relative(cwd, researchDir),
|
|
733
|
+
};
|
|
734
|
+
// Include file contents if requested
|
|
735
|
+
if (includes.has('landscape')) {
|
|
736
|
+
result.landscape_content = safeReadMarkdown(path.join(researchDir, 'LANDSCAPE.md'));
|
|
737
|
+
}
|
|
738
|
+
if (includes.has('roadmap')) {
|
|
739
|
+
result.roadmap_content = safeReadMarkdown(path.join(planningDir, 'ROADMAP.md'));
|
|
740
|
+
}
|
|
741
|
+
if (includes.has('state')) {
|
|
742
|
+
result.state_content = safeReadMarkdown(path.join(planningDir, 'STATE.md'));
|
|
743
|
+
}
|
|
744
|
+
output(result, raw, `Backend: ${result.backend}, phase: ${result.phase_number || 'unknown'}`);
|
|
745
|
+
}
|
|
746
|
+
module.exports = {
|
|
747
|
+
cmdInitExecutePhase,
|
|
748
|
+
cmdInitPlanPhase,
|
|
749
|
+
cmdInitVerifyWork,
|
|
750
|
+
cmdInitCodeReview,
|
|
751
|
+
cmdInitPhaseResearch,
|
|
752
|
+
};
|
|
753
|
+
//# sourceMappingURL=execute.js.map
|