@opengsd/gsd-core 1.18.0 → 1.20.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-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +2 -1
- package/.opencode/plugins/gsd-core.js +2 -3
- package/agents/gsd-code-fixer.compact.md +7 -7
- package/agents/gsd-code-fixer.md +13 -7
- package/agents/gsd-code-reviewer.compact.md +49 -8
- package/agents/gsd-code-reviewer.md +53 -14
- package/agents/gsd-executor.md +8 -4
- package/agents/gsd-verifier.md +1 -1
- package/bin/install.js +422 -103
- package/commands/gsd/update.md +5 -2
- package/gsd-core/bin/gsd-tools.cjs +179 -30
- package/gsd-core/bin/lib/agent-install-check.cjs +29 -3
- package/gsd-core/bin/lib/args-terminator.cjs +114 -0
- package/gsd-core/bin/lib/broken-windows.cjs +59 -1
- package/gsd-core/bin/lib/capability-lifecycle.cjs +1 -12
- package/gsd-core/bin/lib/capability-lock.cjs +13 -2
- package/gsd-core/bin/lib/capability-registry.cjs +376 -103
- package/gsd-core/bin/lib/capability-state.cjs +14 -8
- package/gsd-core/bin/lib/capability-validator.cjs +32 -0
- package/gsd-core/bin/lib/commands.cjs +27 -17
- package/gsd-core/bin/lib/config-loader.cjs +13 -3
- package/gsd-core/bin/lib/config.cjs +256 -58
- package/gsd-core/bin/lib/core-utils.cjs +45 -0
- package/gsd-core/bin/lib/decision-coverage-support.cjs +74 -0
- package/gsd-core/bin/lib/frontmatter.cjs +21 -3
- package/gsd-core/bin/lib/gate-api-coverage-verify-pre.cjs +2 -2
- package/gsd-core/bin/lib/gate-context-drift.cjs +9 -4
- package/gsd-core/bin/lib/gate-decision-coverage-plan.cjs +6 -1
- package/gsd-core/bin/lib/gate-decision-coverage-verify.cjs +6 -1
- package/gsd-core/bin/lib/gate-evaluation-scope.cjs +134 -13
- package/gsd-core/bin/lib/gate-phase-context.cjs +7 -8
- package/gsd-core/bin/lib/gate-schema-drift.cjs +1 -1
- package/gsd-core/bin/lib/gate-tdd-review-checkpoint.cjs +63 -22
- package/gsd-core/bin/lib/gate-ui-safety.cjs +23 -5
- package/gsd-core/bin/lib/git-info-exclude.cjs +52 -0
- package/gsd-core/bin/lib/health-diagnostic-rules/phase-structure.cjs +31 -12
- package/gsd-core/bin/lib/health-diagnostic-rules/roadmap-disk-consistency.cjs +9 -7
- package/gsd-core/bin/lib/health-diagnostic-rules/state-consistency.cjs +3 -3
- package/gsd-core/bin/lib/health-diagnostic-types.cjs +4 -0
- package/gsd-core/bin/lib/health-diagnostic.cjs +52 -1
- package/gsd-core/bin/lib/host-integration.cjs +13 -6
- package/gsd-core/bin/lib/init.cjs +245 -68
- package/gsd-core/bin/lib/install-engine.cjs +246 -32
- package/gsd-core/bin/lib/install-profiles.cjs +9 -4
- package/gsd-core/bin/lib/installer-migration-report.cjs +2 -0
- package/gsd-core/bin/lib/io.cjs +6 -0
- package/gsd-core/bin/lib/markdown-line-diff.cjs +147 -0
- package/gsd-core/bin/lib/markdown-sectionizer.cjs +147 -1
- package/gsd-core/bin/lib/markdown-table.cjs +23 -0
- package/gsd-core/bin/lib/mcp-server.cjs +8 -5
- package/gsd-core/bin/lib/milestone-lock.cjs +8 -1
- package/gsd-core/bin/lib/milestone-release-map.cjs +244 -0
- package/gsd-core/bin/lib/milestone-release-tags.cjs +440 -0
- package/gsd-core/bin/lib/milestone.cjs +61 -51
- package/gsd-core/bin/lib/model-catalog.cjs +8 -0
- package/gsd-core/bin/lib/normalize-test-command.cjs +67 -0
- package/gsd-core/bin/lib/phase-entry-grammar.cjs +119 -0
- package/gsd-core/bin/lib/phase-id-display.cjs +2 -0
- package/gsd-core/bin/lib/phase-id.cjs +629 -38
- package/gsd-core/bin/lib/phase-lifecycle.cjs +12 -44
- package/gsd-core/bin/lib/phase-locator.cjs +328 -19
- package/gsd-core/bin/lib/phase.cjs +3066 -653
- package/gsd-core/bin/lib/planning-document.cjs +26 -5
- package/gsd-core/bin/lib/planning-inspect.cjs +27 -35
- package/gsd-core/bin/lib/planning-snapshot.cjs +15 -8
- package/gsd-core/bin/lib/planning-workspace.cjs +21 -3
- package/gsd-core/bin/lib/pristine-baseline.cjs +11 -3
- package/gsd-core/bin/lib/read-only-git-env.cjs +79 -0
- package/gsd-core/bin/lib/refactor-trigger-command-router.cjs +2 -2
- package/gsd-core/bin/lib/review-lane-descriptor.cjs +57 -2
- package/gsd-core/bin/lib/review-lane-invocation.cjs +125 -18
- package/gsd-core/bin/lib/review-lane-runner.cjs +33 -4
- package/gsd-core/bin/lib/reviewer-step-dispatch.cjs +11 -9
- package/gsd-core/bin/lib/roadmap-parser.cjs +735 -137
- package/gsd-core/bin/lib/roadmap-progress.cjs +136 -0
- package/gsd-core/bin/lib/roadmap-upgrade.cjs +47 -7
- package/gsd-core/bin/lib/roadmap.cjs +383 -123
- package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +381 -14
- package/gsd-core/bin/lib/runtime-artifact-layout.cjs +8 -4
- package/gsd-core/bin/lib/runtime-hooks-surface.cjs +60 -16
- package/gsd-core/bin/lib/shell-command-projection.cjs +151 -19
- package/gsd-core/bin/lib/smart-entry.cjs +35 -11
- package/gsd-core/bin/lib/state-contract.cjs +39 -15
- package/gsd-core/bin/lib/state-document.cjs +344 -27
- package/gsd-core/bin/lib/state-transition.cjs +156 -32
- package/gsd-core/bin/lib/state.cjs +527 -186
- package/gsd-core/bin/lib/surface.cjs +9 -0
- package/gsd-core/bin/lib/task-command-router.cjs +5 -25
- package/gsd-core/bin/lib/task-content-resolution.cjs +46 -1
- package/gsd-core/bin/lib/template.cjs +2 -2
- package/gsd-core/bin/lib/validate.cjs +3 -2
- package/gsd-core/bin/lib/vendor/re2js.cjs +863 -577
- package/gsd-core/bin/lib/vendor/re2js.d.cts +284 -219
- package/gsd-core/bin/lib/verification.cjs +96 -9
- package/gsd-core/bin/lib/verify.cjs +4 -2
- package/gsd-core/bin/lib/workstream-inventory.cjs +26 -20
- package/gsd-core/bin/lib/worktree-safety.cjs +22 -1
- package/gsd-core/bin/shared/config-defaults.manifest.json +1 -0
- package/gsd-core/bin/shared/config-schema.manifest.json +1 -0
- package/gsd-core/bin/verify-reapply-patches.cjs +411 -10
- package/gsd-core/references/cicd-review-patterns.md +45 -0
- package/gsd-core/references/git-integration.md +11 -0
- package/gsd-core/references/loop-hook-dispatch.md +13 -6
- package/gsd-core/references/necessity-review.md +48 -0
- package/gsd-core/references/planning-config.md +2 -0
- package/gsd-core/references/tdd.md +2 -2
- package/gsd-core/templates/DEBUG.md +16 -0
- package/gsd-core/templates/config.json +2 -1
- package/gsd-core/templates/verification-report.md +1 -1
- package/gsd-core/workflows/audit-fix.md +2 -1
- package/gsd-core/workflows/code-review/steps/structural-pre-pass.md +10 -1
- package/gsd-core/workflows/code-review-fix.md +46 -5
- package/gsd-core/workflows/code-review.md +64 -7
- package/gsd-core/workflows/complete-milestone/steps/project-md-evolution-review.md +145 -0
- package/gsd-core/workflows/complete-milestone/steps/release-map.md +80 -0
- package/gsd-core/workflows/complete-milestone.md +37 -150
- package/gsd-core/workflows/diagnose-issues.md +29 -5
- package/gsd-core/workflows/discuss-phase/modes/power.md +1 -1
- package/gsd-core/workflows/discuss-phase-assumptions.md +33 -2
- package/gsd-core/workflows/discuss-phase-power.md +19 -2
- package/gsd-core/workflows/discuss-phase.md +6 -10
- package/gsd-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +13 -7
- package/gsd-core/workflows/execute-phase/steps/post-merge-gate.md +7 -2
- package/gsd-core/workflows/execute-phase/steps/regression-gate-run.md +2 -1
- package/gsd-core/workflows/execute-phase/steps/verify-phase-goal.md +2 -2
- package/gsd-core/workflows/execute-phase/steps/wave-post-gate-hooks.md +11 -2
- package/gsd-core/workflows/execute-phase.md +10 -6
- package/gsd-core/workflows/execute-plan.md +1 -1
- package/gsd-core/workflows/health.md +2 -1
- package/gsd-core/workflows/import.md +1 -1
- package/gsd-core/workflows/plan-phase/steps/chunked-planning-mode.md +2 -2
- package/gsd-core/workflows/plan-phase/steps/stall-detection-helpers.md +13 -9
- package/gsd-core/workflows/plan-phase.md +14 -14
- package/gsd-core/workflows/pr-branch.md +2 -0
- package/gsd-core/workflows/quick/steps/plan-checker-loop.md +1 -1
- package/gsd-core/workflows/quick/steps/worktree-pre-dispatch-commit.md +8 -1
- package/gsd-core/workflows/quick-batch/steps/plan-checker-loop.md +2 -1
- package/gsd-core/workflows/quick.md +1 -1
- package/gsd-core/workflows/reapply-patches.md +104 -0
- package/gsd-core/workflows/review.md +70 -154
- package/gsd-core/workflows/section-manifest.json +5 -0
- package/gsd-core/workflows/secure-phase.md +1 -1
- package/gsd-core/workflows/settings-advanced.md +57 -9
- package/gsd-core/workflows/settings.md +1 -0
- package/gsd-core/workflows/ship.md +15 -4
- package/gsd-core/workflows/spec-phase.md +3 -6
- package/gsd-core/workflows/verify-work.md +4 -3
- package/hooks/dist/gsd-agent-isolation-guard.js +11 -1
- package/hooks/dist/gsd-cursor-subagent-start.js +6 -2
- package/hooks/dist/gsd-graphify-update.sh +6 -0
- package/hooks/dist/gsd-path-export.js +95 -0
- package/hooks/dist/gsd-secret-read-guard.js +172 -39
- package/hooks/dist/gsd-statusline.js +37 -3
- package/hooks/dist/gsd-windsurf-pre-write.js +29 -2
- package/hooks/dist/gsd-workflow-guard.js +3 -2
- package/hooks/dist/gsd-worktree-path-guard.js +29 -2
- package/hooks/dist/lib/git-probe.js +16 -0
- package/hooks/dist/lib/isolation-sentinel.js +44 -0
- package/hooks/dist/managed-hooks-registry.cjs +1 -0
- package/hooks/gsd-agent-isolation-guard.js +11 -1
- package/hooks/gsd-cursor-subagent-start.js +6 -2
- package/hooks/gsd-graphify-update.sh +6 -0
- package/hooks/gsd-path-export.js +95 -0
- package/hooks/gsd-secret-read-guard.js +172 -39
- package/hooks/gsd-statusline.js +37 -3
- package/hooks/gsd-windsurf-pre-write.js +29 -2
- package/hooks/gsd-workflow-guard.js +3 -2
- package/hooks/gsd-worktree-path-guard.js +29 -2
- package/hooks/hooks.json +1 -0
- package/hooks/lib/git-probe.js +16 -0
- package/hooks/lib/isolation-sentinel.js +44 -0
- package/hooks/managed-hooks-registry.cjs +1 -0
- package/package.json +15 -8
- package/pi/gsd.cjs +1047 -10
- package/pi/package-agents/gsd-advisor-researcher.md +113 -0
- package/pi/package-agents/gsd-ai-researcher.md +111 -0
- package/pi/package-agents/gsd-assumptions-analyzer.md +110 -0
- package/pi/package-agents/gsd-code-fixer.md +774 -0
- package/pi/package-agents/gsd-code-reviewer.md +441 -0
- package/pi/package-agents/gsd-codebase-mapper.md +850 -0
- package/pi/package-agents/gsd-debug-session-manager.md +416 -0
- package/pi/package-agents/gsd-debugger.md +1274 -0
- package/pi/package-agents/gsd-doc-classifier.md +269 -0
- package/pi/package-agents/gsd-doc-synthesizer.md +259 -0
- package/pi/package-agents/gsd-doc-verifier.md +212 -0
- package/pi/package-agents/gsd-doc-writer.md +626 -0
- package/pi/package-agents/gsd-dom-verifier.md +164 -0
- package/pi/package-agents/gsd-domain-researcher.md +144 -0
- package/pi/package-agents/gsd-eval-auditor.md +185 -0
- package/pi/package-agents/gsd-eval-planner.md +149 -0
- package/pi/package-agents/gsd-executor.md +898 -0
- package/pi/package-agents/gsd-framework-selector.md +159 -0
- package/pi/package-agents/gsd-integration-checker.md +476 -0
- package/pi/package-agents/gsd-intel-updater.md +338 -0
- package/pi/package-agents/gsd-mempalace-curator.md +49 -0
- package/pi/package-agents/gsd-nyquist-auditor.md +200 -0
- package/pi/package-agents/gsd-pattern-mapper.md +340 -0
- package/pi/package-agents/gsd-phase-researcher.md +897 -0
- package/pi/package-agents/gsd-plan-checker.md +1077 -0
- package/pi/package-agents/gsd-planner.md +1003 -0
- package/pi/package-agents/gsd-project-researcher.md +611 -0
- package/pi/package-agents/gsd-research-synthesizer.md +259 -0
- package/pi/package-agents/gsd-roadmapper.md +779 -0
- package/pi/package-agents/gsd-security-auditor.md +171 -0
- package/pi/package-agents/gsd-ui-auditor.md +581 -0
- package/pi/package-agents/gsd-ui-checker.md +417 -0
- package/pi/package-agents/gsd-ui-researcher.md +469 -0
- package/pi/package-agents/gsd-user-profiler.md +174 -0
- package/pi/package-agents/gsd-verifier.md +963 -0
- package/pi/package-agents/manifest.json +39 -0
- package/pi/package-skills/gsd-add-tests/SKILL.md +39 -0
- package/pi/package-skills/gsd-ai-integration-phase/SKILL.md +36 -0
- package/pi/package-skills/gsd-audit-fix/SKILL.md +34 -0
- package/pi/package-skills/gsd-audit-milestone/SKILL.md +40 -0
- package/pi/package-skills/gsd-audit-uat/SKILL.md +26 -0
- package/pi/package-skills/gsd-autonomous/SKILL.md +52 -0
- package/pi/package-skills/gsd-capture/SKILL.md +68 -0
- package/pi/package-skills/gsd-cleanup/SKILL.md +25 -0
- package/pi/package-skills/gsd-code-review/SKILL.md +71 -0
- package/pi/package-skills/gsd-complete-milestone/SKILL.md +147 -0
- package/pi/package-skills/gsd-config/SKILL.md +60 -0
- package/pi/package-skills/gsd-debug/SKILL.md +64 -0
- package/pi/package-skills/gsd-discuss-phase/SKILL.md +74 -0
- package/pi/package-skills/gsd-docs-update/SKILL.md +50 -0
- package/pi/package-skills/gsd-eval-review/SKILL.md +35 -0
- package/pi/package-skills/gsd-execute-phase/SKILL.md +62 -0
- package/pi/package-skills/gsd-explore/SKILL.md +26 -0
- package/pi/package-skills/gsd-extract-learnings/SKILL.md +25 -0
- package/pi/package-skills/gsd-fast/SKILL.md +33 -0
- package/pi/package-skills/gsd-forensics/SKILL.md +59 -0
- package/pi/package-skills/gsd-graphify/SKILL.md +210 -0
- package/pi/package-skills/gsd-health/SKILL.md +36 -0
- package/pi/package-skills/gsd-help/SKILL.md +37 -0
- package/pi/package-skills/gsd-import/SKILL.md +46 -0
- package/pi/package-skills/gsd-inbox/SKILL.md +42 -0
- package/pi/package-skills/gsd-ingest-docs/SKILL.md +43 -0
- package/pi/package-skills/gsd-manager/SKILL.md +46 -0
- package/pi/package-skills/gsd-map-codebase/SKILL.md +85 -0
- package/pi/package-skills/gsd-mempalace-capture/SKILL.md +111 -0
- package/pi/package-skills/gsd-mempalace-recall/SKILL.md +111 -0
- package/pi/package-skills/gsd-milestone-summary/SKILL.md +54 -0
- package/pi/package-skills/gsd-mvp-phase/SKILL.md +45 -0
- package/pi/package-skills/gsd-new-milestone/SKILL.md +49 -0
- package/pi/package-skills/gsd-new-project/SKILL.md +49 -0
- package/pi/package-skills/gsd-next/SKILL.md +34 -0
- package/pi/package-skills/gsd-ns-context/SKILL.md +31 -0
- package/pi/package-skills/gsd-ns-ideate/SKILL.md +30 -0
- package/pi/package-skills/gsd-ns-manage/SKILL.md +42 -0
- package/pi/package-skills/gsd-ns-project/SKILL.md +34 -0
- package/pi/package-skills/gsd-ns-review/SKILL.md +35 -0
- package/pi/package-skills/gsd-ns-workflow/SKILL.md +44 -0
- package/pi/package-skills/gsd-onboard/SKILL.md +46 -0
- package/pi/package-skills/gsd-pause-work/SKILL.md +48 -0
- package/pi/package-skills/gsd-phase/SKILL.md +61 -0
- package/pi/package-skills/gsd-plan-phase/SKILL.md +62 -0
- package/pi/package-skills/gsd-plan-review-convergence/SKILL.md +63 -0
- package/pi/package-skills/gsd-pr-branch/SKILL.md +31 -0
- package/pi/package-skills/gsd-profile-user/SKILL.md +48 -0
- package/pi/package-skills/gsd-progress/SKILL.md +51 -0
- package/pi/package-skills/gsd-quick/SKILL.md +179 -0
- package/pi/package-skills/gsd-quick-batch/SKILL.md +114 -0
- package/pi/package-skills/gsd-resume-work/SKILL.md +31 -0
- package/pi/package-skills/gsd-review/SKILL.md +50 -0
- package/pi/package-skills/gsd-review-backlog/SKILL.md +65 -0
- package/pi/package-skills/gsd-secure-phase/SKILL.md +37 -0
- package/pi/package-skills/gsd-settings/SKILL.md +30 -0
- package/pi/package-skills/gsd-ship/SKILL.md +27 -0
- package/pi/package-skills/gsd-sketch/SKILL.md +56 -0
- package/pi/package-skills/gsd-spec-phase/SKILL.md +63 -0
- package/pi/package-skills/gsd-spike/SKILL.md +53 -0
- package/pi/package-skills/gsd-stats/SKILL.md +22 -0
- package/pi/package-skills/gsd-surface/SKILL.md +177 -0
- package/pi/package-skills/gsd-thread/SKILL.md +29 -0
- package/pi/package-skills/gsd-ui-phase/SKILL.md +35 -0
- package/pi/package-skills/gsd-ui-review/SKILL.md +35 -0
- package/pi/package-skills/gsd-ultraplan-phase/SKILL.md +38 -0
- package/pi/package-skills/gsd-undo/SKILL.md +38 -0
- package/pi/package-skills/gsd-update/SKILL.md +54 -0
- package/pi/package-skills/gsd-validate-phase/SKILL.md +37 -0
- package/pi/package-skills/gsd-verify-work/SKILL.md +41 -0
- package/pi/package-skills/gsd-workspace/SKILL.md +57 -0
- package/pi/package-skills/gsd-workstreams/SKILL.md +73 -0
- package/scripts/build-hooks.js +4 -0
- package/scripts/ci-next-health.cjs +246 -23
- package/scripts/command-contract-helpers.cjs +1 -1
- package/scripts/docs-guard-registry.cjs +22 -7
- package/scripts/gen-features.cjs +14 -2
- package/scripts/gen-health-docs.cjs +13 -1
- package/scripts/gen-pi-package-skills.cjs +217 -0
- package/scripts/lib/drift-scan.cjs +27 -0
- package/scripts/lib/macos-conformance-tier.generated.cjs +17 -1
- package/scripts/lib/platform-conformance-tier.generated.cjs +37 -1
- package/scripts/lint-docs-guard-registration.exempt-baseline.cjs +3 -3
- package/scripts/lint-phase-enumeration-drift.cjs +8 -4
- package/scripts/lint-retired-runtime-name.cjs +5 -0
- package/scripts/lint-roadmap-progress-drift.cjs +421 -0
- package/scripts/mutation-matrix.cjs +23 -1
- package/scripts/npm-audit-baseline.cjs +41 -7
- package/scripts/reviewed-or-maintainer-policy.cjs +181 -0
- package/scripts/select-docs-guards.cjs +1 -1
- package/scripts/self-test-report-policy.cjs +350 -0
- package/scripts/sync-next-version.cjs +38 -6
- package/skills/gsd-update/SKILL.md +5 -2
- package/vscode/package.json +1 -1
- package/scripts/diagnose-validate-commit-in-tier.cjs +0 -270
- package/scripts/diagnose-validate-commit-phases.cjs +0 -348
- package/scripts/xtrace-phase-timing.cjs +0 -205
|
@@ -36,6 +36,7 @@ const node_os_1 = __importDefault(require("node:os"));
|
|
|
36
36
|
const node_path_1 = __importDefault(require("node:path"));
|
|
37
37
|
const shell_command_projection_cjs_1 = require("./shell-command-projection.cjs");
|
|
38
38
|
const runtime_name_policy_cjs_1 = require("./runtime-name-policy.cjs");
|
|
39
|
+
const args_terminator_cjs_1 = require("./args-terminator.cjs");
|
|
39
40
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
40
41
|
const installProfiles = require("./install-profiles.cjs");
|
|
41
42
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
@@ -322,6 +323,14 @@ function applySurface(runtimeConfigDir, layout, manifest, clusterMap, registry,
|
|
|
322
323
|
if (node_path_1.default.resolve(runtimeConfigDir) !== node_path_1.default.resolve(layout.configDir)) {
|
|
323
324
|
throw new TypeError('applySurface runtimeConfigDir must match layout.configDir');
|
|
324
325
|
}
|
|
326
|
+
// #5637: re-staged commands and skills keep the typed-text terminator nonce the install wrote,
|
|
327
|
+
// when it wrote one; this process is not an installer, so nothing armed it.
|
|
328
|
+
// A directory with no nonce (an install from before this change) is re-staged canonical, and a
|
|
329
|
+
// nonce armed earlier in this process for another directory is not carried over.
|
|
330
|
+
if ((0, args_terminator_cjs_1.readInstalledNonce)(layout.configDir) !== null)
|
|
331
|
+
(0, args_terminator_cjs_1.armArgsNonce)(layout.configDir, true);
|
|
332
|
+
else
|
|
333
|
+
(0, args_terminator_cjs_1.disarmArgsNonce)();
|
|
325
334
|
// #3712: the dest selection below prefers `kind.home` over layout.configDir and
|
|
326
335
|
// then hands it to the destructive _syncGsdDir, so surface apply is a third
|
|
327
336
|
// escape route into the developer's real home alongside install/uninstall.
|
|
@@ -20,10 +20,8 @@ const { output, error, ERROR_REASON } = ioMod;
|
|
|
20
20
|
const planDocumentMod = require("./plan-document.cjs");
|
|
21
21
|
const { parsePlanDocument } = planDocumentMod;
|
|
22
22
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
23
|
-
const capabilityLoaderMod = require("./capability-loader.cjs");
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
25
23
|
const taskContentResolutionMod = require("./task-content-resolution.cjs");
|
|
26
|
-
const { resolveTaskContent,
|
|
24
|
+
const { resolveTaskContent, loadResolverCapabilities, isResolverFailure, } = taskContentResolutionMod;
|
|
27
25
|
// ─── Implementation ───────────────────────────────────────────────────────────
|
|
28
26
|
function isBehaviorAddingTaskContent(content) {
|
|
29
27
|
const tddTrue = /\btdd\s*=\s*["']true["']/i.test(content);
|
|
@@ -60,19 +58,6 @@ function isBehaviorAddingTaskContent(content) {
|
|
|
60
58
|
reason: isBehaviorAdding ? null : `Not behavior-adding: ${missing.join('; ')}`,
|
|
61
59
|
};
|
|
62
60
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Default (production) capability loader for `resolve-content`: the merged
|
|
65
|
-
* first-party + validated-installed-overlay registry (ADR-1244 D2), the
|
|
66
|
-
* established runtime read path for "installed capabilities including
|
|
67
|
-
* third-party" — as opposed to `capability-loader.cts`'s heavier build-time
|
|
68
|
-
* validation entry points or the static `capability-registry.cjs` alone
|
|
69
|
-
* (first-party only, would miss a third-party capability's
|
|
70
|
-
* `taskContentResolver` declaration entirely).
|
|
71
|
-
*/
|
|
72
|
-
function defaultLoadCapabilities(cwd) {
|
|
73
|
-
const registry = capabilityLoaderMod.loadRegistry({ includeInstalled: true, cwd });
|
|
74
|
-
return Object.values(registry.capabilities ?? {});
|
|
75
|
-
}
|
|
76
61
|
function parseResolveContentArgs(args) {
|
|
77
62
|
let plan = null;
|
|
78
63
|
let taskId = null;
|
|
@@ -93,12 +78,10 @@ function parseResolveContentArgs(args) {
|
|
|
93
78
|
* (ADR-3646 Decision 2). Resolves one task's content from the external
|
|
94
79
|
* tracker its `tracker-id` attribute names, via `task-content-resolution.cts`.
|
|
95
80
|
*
|
|
96
|
-
* HARD-HALT CONTRACT: a thrown
|
|
97
|
-
* / `ResolverTimeoutError` / `ResolverMalformedOutputError` from
|
|
81
|
+
* HARD-HALT CONTRACT: a thrown resolver failure (`isResolverFailure`) from
|
|
98
82
|
* `resolveTaskContent` is turned into this CLI's own non-zero exit via
|
|
99
83
|
* `error()` — never swallowed into a `{resolved: false}` JSON answer. Any
|
|
100
|
-
* other thrown error is not
|
|
101
|
-
* classes and is allowed to propagate uncaught.
|
|
84
|
+
* other thrown error is not a documented resolver-error class and is allowed to propagate uncaught.
|
|
102
85
|
*/
|
|
103
86
|
function routeResolveContent({ args, cwd, raw }, deps = {}) {
|
|
104
87
|
const usage = 'Usage: task resolve-content --plan <path> --task-id <tracker-id> --raw';
|
|
@@ -127,7 +110,7 @@ function routeResolveContent({ args, cwd, raw }, deps = {}) {
|
|
|
127
110
|
error(`No task with tracker-id '${taskId}' found in plan: ${plan}`, ERROR_REASON.USAGE);
|
|
128
111
|
return;
|
|
129
112
|
}
|
|
130
|
-
const loadCapabilities = deps.loadCapabilities ??
|
|
113
|
+
const loadCapabilities = deps.loadCapabilities ?? loadResolverCapabilities;
|
|
131
114
|
const capabilities = loadCapabilities(projectRoot);
|
|
132
115
|
const resolveFn = deps.resolveTaskContentFn ?? resolveTaskContent;
|
|
133
116
|
let result;
|
|
@@ -135,10 +118,7 @@ function routeResolveContent({ args, cwd, raw }, deps = {}) {
|
|
|
135
118
|
result = resolveFn({ trackerId: task.trackerId, capabilities });
|
|
136
119
|
}
|
|
137
120
|
catch (err) {
|
|
138
|
-
if (err
|
|
139
|
-
err instanceof ResolverFailedError ||
|
|
140
|
-
err instanceof ResolverTimeoutError ||
|
|
141
|
-
err instanceof ResolverMalformedOutputError) {
|
|
121
|
+
if (isResolverFailure(err)) {
|
|
142
122
|
error(err.message, ERROR_REASON.UNKNOWN);
|
|
143
123
|
return;
|
|
144
124
|
}
|
|
@@ -43,6 +43,8 @@ const node_child_process_1 = __importDefault(require("node:child_process"));
|
|
|
43
43
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
44
44
|
const ioMod = require("./io.cjs");
|
|
45
45
|
const { formatDiagnosticToken } = ioMod;
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
47
|
+
const capabilityLoaderMod = require("./capability-loader.cjs");
|
|
46
48
|
// ─── Result taxonomy ──────────────────────────────────────────────────────────
|
|
47
49
|
/**
|
|
48
50
|
* The four non-throwing outcomes of `resolveTaskContent`. Frozen because the
|
|
@@ -102,6 +104,17 @@ class ResolverFailedError extends Error {
|
|
|
102
104
|
this.stderrTail = stderrTail;
|
|
103
105
|
}
|
|
104
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* The tracker-id's id segment cannot safely be one argv element: a leading `-`
|
|
109
|
+
* reads as an option to the resolver binary, and control characters are never
|
|
110
|
+
* legitimate. Thrown before any spawn.
|
|
111
|
+
*/
|
|
112
|
+
class ResolverUnsafeIdError extends Error {
|
|
113
|
+
constructor() {
|
|
114
|
+
super('tracker-id rejected: id must not start with "-" or contain control characters');
|
|
115
|
+
this.name = 'ResolverUnsafeIdError';
|
|
116
|
+
}
|
|
117
|
+
}
|
|
105
118
|
/** The resolver subprocess exceeded its declared `invoke.timeoutMs` bound. */
|
|
106
119
|
class ResolverTimeoutError extends Error {
|
|
107
120
|
timeoutMs;
|
|
@@ -312,6 +325,9 @@ function resolveTaskContent(input) {
|
|
|
312
325
|
const split = splitTrackerId(input.trackerId);
|
|
313
326
|
if (split === null)
|
|
314
327
|
return { kind: TASK_CONTENT_RESULT.NOT_APPLICABLE };
|
|
328
|
+
if (split.id.trimStart().startsWith('-') || /[\u0000-\u001f\u007f]/.test(input.trackerId ?? '')) {
|
|
329
|
+
throw new ResolverUnsafeIdError();
|
|
330
|
+
}
|
|
315
331
|
const resolver = findResolver(split.prefix, input.capabilities ?? []);
|
|
316
332
|
if (resolver === null)
|
|
317
333
|
return { kind: TASK_CONTENT_RESULT.NO_RESOLVER };
|
|
@@ -327,7 +343,7 @@ function resolveTaskContent(input) {
|
|
|
327
343
|
throw new ResolverAmbiguousError(split.prefix, ids);
|
|
328
344
|
}
|
|
329
345
|
const invocation = buildInvocation(resolver, split.id);
|
|
330
|
-
const timeoutMs = input.timeoutOverrideMs ?? invocation.timeoutMs;
|
|
346
|
+
const timeoutMs = Math.floor(Math.min(input.timeoutOverrideMs ?? invocation.timeoutMs, invocation.timeoutMs));
|
|
331
347
|
const execFn = input.execFn ?? realExec;
|
|
332
348
|
const result = execFn(invocation.binary, invocation.args, { timeout: timeoutMs });
|
|
333
349
|
if (isExecTimeout(result)) {
|
|
@@ -354,12 +370,41 @@ function resolveTaskContent(input) {
|
|
|
354
370
|
}
|
|
355
371
|
return { kind: TASK_CONTENT_RESULT.RESOLVED, content };
|
|
356
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* Production capability loader for tracker-id resolution: the merged
|
|
375
|
+
* first-party + validated-installed-overlay registry (ADR-1244 D2), the
|
|
376
|
+
* established runtime read path for "installed capabilities including
|
|
377
|
+
* third-party" — as opposed to `capability-loader.cts`'s heavier build-time
|
|
378
|
+
* validation entry points or the static `capability-registry.cjs` alone
|
|
379
|
+
* (first-party only, would miss a third-party capability's
|
|
380
|
+
* `taskContentResolver` declaration entirely).
|
|
381
|
+
*/
|
|
382
|
+
function loadResolverCapabilities(cwd) {
|
|
383
|
+
const registry = capabilityLoaderMod.loadRegistry({ includeInstalled: true, cwd });
|
|
384
|
+
return Object.values(registry.capabilities ?? {});
|
|
385
|
+
}
|
|
386
|
+
/** True for every error `resolveTaskContent` throws as a hard halt (the one classifier all consumers share). */
|
|
387
|
+
function isResolverFailure(err) {
|
|
388
|
+
return (err instanceof ResolverAmbiguousError ||
|
|
389
|
+
err instanceof ResolverFailedError ||
|
|
390
|
+
err instanceof ResolverTimeoutError ||
|
|
391
|
+
err instanceof ResolverMalformedOutputError ||
|
|
392
|
+
err instanceof ResolverUnsafeIdError);
|
|
393
|
+
}
|
|
394
|
+
/** Every text field of resolved content, so a consumer scanning for text cannot miss one when the shape grows. */
|
|
395
|
+
function contentTexts(c) {
|
|
396
|
+
return [c.action, c.verify, ...c.acceptanceCriteria, ...c.readFirst, c.done].filter((v) => v !== null);
|
|
397
|
+
}
|
|
357
398
|
const taskContentResolution = {
|
|
358
399
|
TASK_CONTENT_RESULT,
|
|
359
400
|
splitTrackerId,
|
|
360
401
|
findResolver,
|
|
361
402
|
buildInvocation,
|
|
362
403
|
resolveTaskContent,
|
|
404
|
+
loadResolverCapabilities,
|
|
405
|
+
isResolverFailure,
|
|
406
|
+
contentTexts,
|
|
407
|
+
ResolverUnsafeIdError,
|
|
363
408
|
ResolverAmbiguousError,
|
|
364
409
|
ResolverFailedError,
|
|
365
410
|
ResolverTimeoutError,
|
|
@@ -23,7 +23,7 @@ const phaseIdMod = require("./phase-id.cjs");
|
|
|
23
23
|
const { normalizePhaseName } = phaseIdMod;
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
25
25
|
const phaseLocatorMod = require("./phase-locator.cjs");
|
|
26
|
-
const { findPhaseInternal } = phaseLocatorMod;
|
|
26
|
+
const { phaseDirectoryOptions, findPhaseInternal } = phaseLocatorMod;
|
|
27
27
|
const shell_command_projection_cjs_1 = require("./shell-command-projection.cjs");
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
29
29
|
const planningWorkspace = require("./planning-workspace.cjs");
|
|
@@ -80,7 +80,7 @@ function cmdTemplateFill(cwd, templateType, options, raw) {
|
|
|
80
80
|
if (!options.phase) {
|
|
81
81
|
error('--phase required');
|
|
82
82
|
}
|
|
83
|
-
const phaseInfo = findPhaseInternal(cwd, options.phase);
|
|
83
|
+
const phaseInfo = findPhaseInternal(cwd, options.phase, undefined, phaseDirectoryOptions(cwd));
|
|
84
84
|
if (!phaseInfo || !phaseInfo.found) {
|
|
85
85
|
output({ error: 'Phase not found', phase: options.phase }, raw, undefined);
|
|
86
86
|
return;
|
|
@@ -43,6 +43,7 @@ exports.checkBracketCoherence = checkBracketCoherence;
|
|
|
43
43
|
exports.textEncodingError = textEncodingError;
|
|
44
44
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
45
45
|
const phaseIdMod = require("./phase-id.cjs");
|
|
46
|
+
const phase_entry_grammar_cjs_1 = require("./phase-entry-grammar.cjs");
|
|
46
47
|
const { OPTIONAL_PROJECT_CODE_PREFIX_SOURCE,
|
|
47
48
|
// #2528 review: taken from the owner rather than derived here by
|
|
48
49
|
// `replaceAll('A-Z', 'A-Za-z')` — that derivation silently no-ops (and narrows
|
|
@@ -228,7 +229,7 @@ function buildRoadmapPhaseVariants(roadmapContent, convention) {
|
|
|
228
229
|
// shape (bold bullet index + detail headings) where the icebox appears as both.
|
|
229
230
|
// `validate health` stayed silent on the same repo, so the two verbs disagreed
|
|
230
231
|
// — the disagreement `sentinelPhases` exists to close.
|
|
231
|
-
const checklistPattern =
|
|
232
|
+
const checklistPattern = (0, phase_entry_grammar_cjs_1.phaseEntryRegExp)(`${phaseHeadingPrefixSrcFor(PHASE_HEADING_BASELINE.LABEL_ONLY, convention, capturing)}([\\w][\\w.-]*)\\s*:`, 'gi');
|
|
232
233
|
let cm;
|
|
233
234
|
while ((cm = checklistPattern.exec(roadmapContent)) !== null) {
|
|
234
235
|
const cBracketId = g ? cm[1] : undefined;
|
|
@@ -252,7 +253,7 @@ function buildNotStartedPhaseVariants(roadmapContent, convention) {
|
|
|
252
253
|
// Trailing class is `[:\s*]` — a SPACE terminates the token here, not only a
|
|
253
254
|
// colon — so this site is the loosest of the three and the one where a
|
|
254
255
|
// retro-granted bracket tolerance would suppress a live W006.
|
|
255
|
-
const uncheckedPattern =
|
|
256
|
+
const uncheckedPattern = (0, phase_entry_grammar_cjs_1.phaseEntryRegExp)(`${phaseHeadingPrefixSrcFor(PHASE_HEADING_BASELINE.LABEL_ONLY, convention)}([\\w][\\w.-]*)[:\\s*]`, 'gi', { state: 'unchecked' });
|
|
256
257
|
let um;
|
|
257
258
|
while ((um = uncheckedPattern.exec(roadmapContent)) !== null) {
|
|
258
259
|
for (const variant of phaseVariants(um[1]))
|