@opengsd/gsd-core 1.11.0 → 1.13.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 +1 -1
- package/.opencode/plugins/gsd-core.js +12 -0
- package/agents/gsd-code-fixer.md +1 -1
- package/agents/gsd-debug-session-manager.md +1 -1
- package/agents/gsd-debugger.md +1 -1
- package/agents/gsd-dom-verifier.md +169 -0
- package/agents/gsd-eval-auditor.md +1 -1
- package/agents/gsd-executor.md +78 -42
- package/agents/gsd-framework-selector.md +1 -3
- package/agents/gsd-intel-updater.md +1 -1
- package/agents/gsd-mempalace-curator.md +0 -1
- package/agents/gsd-pattern-mapper.md +11 -0
- package/agents/gsd-phase-researcher.md +3 -1
- package/agents/gsd-plan-checker.md +91 -112
- package/agents/gsd-planner.md +20 -4
- package/agents/gsd-project-researcher.md +1 -1
- package/agents/gsd-research-synthesizer.md +2 -2
- package/agents/gsd-roadmapper.md +15 -11
- package/agents/gsd-ui-checker.md +82 -7
- package/agents/gsd-ui-researcher.md +70 -3
- package/agents/gsd-verifier.md +24 -2
- package/bin/install.js +847 -200
- package/commands/gsd/discuss-phase.md +1 -1
- package/commands/gsd/execute-phase.md +1 -1
- package/commands/gsd/import.md +1 -1
- package/commands/gsd/ns-workflow.md +2 -1
- package/commands/gsd/phase.md +1 -1
- package/commands/gsd/quick-batch.md +105 -0
- package/commands/gsd/quick.md +8 -4
- package/commands/gsd/surface.md +18 -8
- package/gsd-core/bin/gsd-tools.cjs +761 -100
- package/gsd-core/bin/lib/active-workstream-store.cjs +8 -0
- package/gsd-core/bin/lib/adr-parser.cjs +13 -7
- package/gsd-core/bin/lib/agent-install-check.cjs +162 -0
- package/gsd-core/bin/lib/api-coverage.cjs +30 -9
- package/gsd-core/bin/lib/artifacts.cjs +2 -0
- package/gsd-core/bin/lib/assumption-delta.cjs +30 -11
- package/gsd-core/bin/lib/audit.cjs +163 -41
- package/gsd-core/bin/lib/broken-windows.cjs +306 -28
- package/gsd-core/bin/lib/capability-activation.cjs +27 -0
- package/gsd-core/bin/lib/capability-lock.cjs +10 -4
- package/gsd-core/bin/lib/capability-registry.cjs +785 -144
- package/gsd-core/bin/lib/capability-state.cjs +25 -4
- package/gsd-core/bin/lib/capability-validator.cjs +321 -18
- package/gsd-core/bin/lib/capability-writer.cjs +14 -4
- package/gsd-core/bin/lib/check-command-router.cjs +229 -6
- package/gsd-core/bin/lib/claude-orchestration.cjs +10 -25
- package/gsd-core/bin/lib/cli-exit.cjs +496 -10
- package/gsd-core/bin/lib/clusters.cjs +1 -0
- package/gsd-core/bin/lib/code-review-depth.cjs +288 -0
- package/gsd-core/bin/lib/codex-agent-toml.cjs +410 -4
- package/gsd-core/bin/lib/command-aliases.cjs +16 -0
- package/gsd-core/bin/lib/command-arg-projection.cjs +144 -14
- package/gsd-core/bin/lib/command-routing-hub.cjs +31 -2
- package/gsd-core/bin/lib/commands.cjs +877 -54
- package/gsd-core/bin/lib/complexity-trigger.cjs +26 -6
- package/gsd-core/bin/lib/config-loader.cjs +121 -29
- package/gsd-core/bin/lib/config.cjs +92 -2
- package/gsd-core/bin/lib/configuration.cjs +129 -37
- package/gsd-core/bin/lib/core-utils.cjs +118 -14
- package/gsd-core/bin/lib/decisions.cjs +213 -1
- package/gsd-core/bin/lib/edge-probe.cjs +23 -2
- package/gsd-core/bin/lib/estimate-cli.cjs +55 -11
- package/gsd-core/bin/lib/exit-code-registry.cjs +98 -0
- package/gsd-core/bin/lib/file-overlap-partitioner.cjs +74 -0
- package/gsd-core/bin/lib/frontmatter.cjs +975 -326
- package/gsd-core/bin/lib/gap-checker.cjs +41 -8
- package/gsd-core/bin/lib/git-base-branch.cjs +182 -39
- package/gsd-core/bin/lib/health-diagnostic-rules/consistency.cjs +7 -3
- package/gsd-core/bin/lib/health-diagnostic-rules/phase-structure.cjs +8 -2
- package/gsd-core/bin/lib/health-diagnostic-rules/roadmap-disk-consistency.cjs +60 -14
- package/gsd-core/bin/lib/health-diagnostic-rules/state-consistency.cjs +75 -22
- package/gsd-core/bin/lib/health-diagnostic-rules/worktree-health.cjs +22 -8
- package/gsd-core/bin/lib/health-diagnostic.cjs +23 -3
- package/gsd-core/bin/lib/host-integration.cjs +96 -11
- package/gsd-core/bin/lib/init-command-router.cjs +132 -21
- package/gsd-core/bin/lib/init.cjs +252 -56
- package/gsd-core/bin/lib/install-engine.cjs +252 -15
- package/gsd-core/bin/lib/install-model-override-resolver.cjs +78 -1
- package/gsd-core/bin/lib/install-profiles.cjs +100 -18
- package/gsd-core/bin/lib/installer-migration-report.cjs +4 -0
- package/gsd-core/bin/lib/installer-migrations/010-antigravity-retire-confighome-artifacts.cjs +169 -0
- package/gsd-core/bin/lib/installer-migrations.cjs +10 -7
- package/gsd-core/bin/lib/intel.cjs +101 -26
- package/gsd-core/bin/lib/io.cjs +195 -15
- package/gsd-core/bin/lib/learnings.cjs +85 -14
- package/gsd-core/bin/lib/legacy-cleanup.cjs +8 -2
- package/gsd-core/bin/lib/loop-resolver.cjs +14 -8
- package/gsd-core/bin/lib/markdown-table.cjs +175 -4
- package/gsd-core/bin/lib/milestone.cjs +112 -7
- package/gsd-core/bin/lib/model-catalog.cjs +177 -19
- package/gsd-core/bin/lib/model-resolver.cjs +10 -28
- package/gsd-core/bin/lib/onboard-projection.cjs +5 -1
- package/gsd-core/bin/lib/phase-command-router.cjs +13 -6
- package/gsd-core/bin/lib/phase-estimation.cjs +17 -8
- package/gsd-core/bin/lib/phase-id.cjs +321 -13
- package/gsd-core/bin/lib/phase-lifecycle.cjs +24 -16
- package/gsd-core/bin/lib/phase-locator.cjs +138 -17
- package/gsd-core/bin/lib/phase.cjs +1175 -115
- package/gsd-core/bin/lib/plan-document.cjs +273 -0
- package/gsd-core/bin/lib/plan-scan.cjs +13 -2
- package/gsd-core/bin/lib/planning-command-router.cjs +61 -0
- package/gsd-core/bin/lib/planning-inspect.cjs +1168 -0
- package/gsd-core/bin/lib/planning-snapshot.cjs +165 -34
- package/gsd-core/bin/lib/planning-workspace.cjs +159 -28
- package/gsd-core/bin/lib/probe-core.cjs +4 -1
- package/gsd-core/bin/lib/profile-pipeline-command-router.cjs +50 -7
- package/gsd-core/bin/lib/profile-pipeline.cjs +6 -3
- package/gsd-core/bin/lib/quick-batch-command-router.cjs +285 -0
- package/gsd-core/bin/lib/quick-batch-dispatch.cjs +250 -0
- package/gsd-core/bin/lib/quick-batch.cjs +840 -0
- package/gsd-core/bin/lib/real-home-guard.cjs +419 -0
- package/gsd-core/bin/lib/refactor-trigger-command-router.cjs +71 -45
- package/gsd-core/bin/lib/review-lane-descriptor.cjs +62 -14
- package/gsd-core/bin/lib/review-lane-invocation.cjs +73 -1
- package/gsd-core/bin/lib/review-lane-runner.cjs +136 -10
- package/gsd-core/bin/lib/roadmap-command-router.cjs +45 -31
- package/gsd-core/bin/lib/roadmap-parser.cjs +577 -41
- package/gsd-core/bin/lib/roadmap.cjs +248 -64
- package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +329 -41
- package/gsd-core/bin/lib/runtime-artifact-install-plan.cjs +16 -17
- package/gsd-core/bin/lib/runtime-artifact-layout.cjs +320 -109
- package/gsd-core/bin/lib/runtime-hooks-surface.cjs +487 -83
- package/gsd-core/bin/lib/runtime-identity.cjs +234 -0
- package/gsd-core/bin/lib/runtime-slash.cjs +72 -2
- package/gsd-core/bin/lib/shell-command-projection.cjs +75 -8
- package/gsd-core/bin/lib/smart-entry.cjs +19 -31
- package/gsd-core/bin/lib/spec-section.cjs +12 -7
- package/gsd-core/bin/lib/state-command-router.cjs +47 -18
- package/gsd-core/bin/lib/state-contract.cjs +359 -0
- package/gsd-core/bin/lib/state-document.cjs +216 -5
- package/gsd-core/bin/lib/state-md-schema.cjs +231 -0
- package/gsd-core/bin/lib/state-transition.cjs +850 -145
- package/gsd-core/bin/lib/state.cjs +1629 -287
- package/gsd-core/bin/lib/surface.cjs +33 -10
- package/gsd-core/bin/lib/task-command-router.cjs +111 -1
- package/gsd-core/bin/lib/task-content-resolution.cjs +368 -0
- package/gsd-core/bin/lib/tdd-red-evidence.cjs +133 -0
- package/gsd-core/bin/lib/teams-status.cjs +4 -1
- package/gsd-core/bin/lib/uat-predicate.cjs +58 -20
- package/gsd-core/bin/lib/uat.cjs +2542 -387
- package/gsd-core/bin/lib/ui-consideration-probe.cjs +9 -1
- package/gsd-core/bin/lib/ui-safety-gate.cjs +37 -7
- package/gsd-core/bin/lib/unusable-input.cjs +13 -0
- package/gsd-core/bin/lib/update-context.cjs +6 -2
- package/gsd-core/bin/lib/validate-command-router.cjs +2 -2
- package/gsd-core/bin/lib/validate.cjs +230 -12
- package/gsd-core/bin/lib/vendor/README.md +43 -5
- package/gsd-core/bin/lib/vendor/js-yaml.cjs +3014 -0
- package/gsd-core/bin/lib/verification-command-router.cjs +2 -1
- package/gsd-core/bin/lib/verification.cjs +287 -13
- package/gsd-core/bin/lib/verify-command-grounding.cjs +846 -0
- package/gsd-core/bin/lib/verify-command-router.cjs +1 -0
- package/gsd-core/bin/lib/verify.cjs +441 -56
- package/gsd-core/bin/lib/workstream-inventory.cjs +20 -2
- package/gsd-core/bin/lib/workstream-name-policy.cjs +25 -4
- package/gsd-core/bin/lib/worktree-base-ref.cjs +66 -12
- package/gsd-core/bin/lib/worktree-safety.cjs +185 -21
- package/gsd-core/bin/shared/config-defaults.manifest.json +7 -1
- package/gsd-core/bin/shared/config-schema.manifest.json +13 -0
- package/gsd-core/bin/shared/exit-codes.json +8 -0
- package/gsd-core/bin/shared/exit-codes.sh +20 -0
- package/gsd-core/bin/shared/model-catalog.json +8 -1
- package/gsd-core/bin/verify-reapply-patches.cjs +70 -3
- package/gsd-core/references/agent-contracts.md +6 -5
- package/gsd-core/references/api-coverage.md +24 -2
- package/gsd-core/references/autonomous-smart-discuss.md +3 -3
- package/gsd-core/references/checkpoints.md +37 -19
- package/gsd-core/references/decimal-phase-calculation.md +5 -5
- package/gsd-core/references/edge-probe.md +17 -5
- package/gsd-core/references/execute-mvp-tdd.md +18 -18
- package/gsd-core/references/execute-phase-between-wave-reset.md +9 -12
- package/gsd-core/references/execute-phase-response-language.md +6 -0
- package/gsd-core/references/execute-phase-wave-guard.md +11 -9
- package/gsd-core/references/executor-examples.md +42 -0
- package/gsd-core/references/failing-direction.md +78 -0
- package/gsd-core/references/few-shot-examples/plan-checker.md +15 -15
- package/gsd-core/references/gate-prompts.md +1 -1
- package/gsd-core/references/git-integration.md +5 -5
- package/gsd-core/references/git-planning-commit.md +3 -3
- package/gsd-core/references/gsd-run-resolver.md +1 -1
- package/gsd-core/references/loop-hook-dispatch.md +22 -0
- package/gsd-core/references/model-profiles.md +1 -1
- package/gsd-core/references/mvp-concepts.md +2 -2
- package/gsd-core/references/nyquist-compliance.md +74 -0
- package/gsd-core/references/offer-next.md +3 -5
- package/gsd-core/references/phase-argument-parsing.md +3 -3
- package/gsd-core/references/plan-checker-examples.md +41 -0
- package/gsd-core/references/planner-antipatterns.md +25 -0
- package/gsd-core/references/planner-chunked.md +5 -1
- package/gsd-core/references/planner-coupling.md +42 -0
- package/gsd-core/references/planner-failing-direction.md +53 -0
- package/gsd-core/references/planner-human-verify-mode.md +15 -1
- package/gsd-core/references/planner-quick-batch.md +71 -0
- package/gsd-core/references/planner-reviews.md +47 -0
- package/gsd-core/references/planner-revision.md +76 -3
- package/gsd-core/references/planner-verify-command-grounding.md +17 -0
- package/gsd-core/references/planning-config.md +39 -9
- package/gsd-core/references/response-language-directive.md +9 -0
- package/gsd-core/references/reviewer-instances.md +31 -0
- package/gsd-core/references/revision-loop.md +118 -11
- package/gsd-core/references/runtime-aware-dispatch.md +1 -1
- package/gsd-core/references/tdd.md +15 -12
- package/gsd-core/references/ui-brand.md +65 -21
- package/gsd-core/references/ui-consideration-probe.md +1 -1
- package/gsd-core/references/universal-anti-patterns.md +2 -2
- package/gsd-core/references/verifier-evidence-gate.md +160 -0
- package/gsd-core/references/verify-command-path-resolvability.md +42 -0
- package/gsd-core/references/verify-mvp-mode.md +1 -1
- package/gsd-core/references/workstream-flag.md +11 -11
- package/gsd-core/templates/README.md +1 -1
- package/gsd-core/templates/SECURITY.md +3 -3
- package/gsd-core/templates/UI-SPEC.md +25 -3
- package/gsd-core/templates/VALIDATION.md +3 -3
- package/gsd-core/templates/phase-prompt.md +7 -0
- package/gsd-core/templates/state.md +7 -0
- package/gsd-core/templates/verification-report.md +5 -0
- package/gsd-core/workflows/_runtime-launcher.snippet.sh +1 -1
- package/gsd-core/workflows/add-backlog.md +3 -1
- package/gsd-core/workflows/add-phase.md +5 -3
- package/gsd-core/workflows/add-tests.md +4 -9
- package/gsd-core/workflows/add-todo.md +2 -2
- package/gsd-core/workflows/ai-integration-phase.md +5 -10
- package/gsd-core/workflows/analyze-dependencies.md +2 -0
- package/gsd-core/workflows/audit-fix.md +14 -3
- package/gsd-core/workflows/audit-milestone.md +11 -9
- package/gsd-core/workflows/audit-uat.md +19 -2
- package/gsd-core/workflows/autonomous/steps/converge-fail-fast.md +2 -2
- package/gsd-core/workflows/autonomous.md +12 -26
- package/gsd-core/workflows/check-todos.md +2 -2
- package/gsd-core/workflows/cleanup.md +3 -3
- package/gsd-core/workflows/code-review/steps/structural-pre-pass.md +16 -14
- package/gsd-core/workflows/code-review-fix.md +3 -1
- package/gsd-core/workflows/code-review.md +192 -69
- package/gsd-core/workflows/complete-milestone.md +28 -14
- package/gsd-core/workflows/debug.md +6 -4
- package/gsd-core/workflows/diagnose-issues.md +17 -7
- package/gsd-core/workflows/discuss-phase/modes/advisor.md +3 -1
- package/gsd-core/workflows/discuss-phase/modes/all.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/analyze.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/auto.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/batch.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/chain.md +5 -7
- package/gsd-core/workflows/discuss-phase/modes/default.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/power.md +2 -0
- package/gsd-core/workflows/discuss-phase/modes/text.md +3 -1
- package/gsd-core/workflows/discuss-phase/templates/context.md +2 -0
- package/gsd-core/workflows/discuss-phase/templates/discussion-log.md +2 -0
- package/gsd-core/workflows/discuss-phase-assumptions/steps/auto-advance-dispatch.md +1 -3
- package/gsd-core/workflows/discuss-phase-assumptions.md +3 -3
- package/gsd-core/workflows/discuss-phase-power.md +2 -0
- package/gsd-core/workflows/discuss-phase.md +2 -2
- package/gsd-core/workflows/do.md +46 -19
- package/gsd-core/workflows/docs-update.md +6 -5
- package/gsd-core/workflows/edit-phase.md +3 -1
- package/gsd-core/workflows/eval-review.md +5 -10
- package/gsd-core/workflows/execute-phase/steps/codebase-drift-gate.md +3 -1
- package/gsd-core/workflows/execute-phase/steps/executor-isolation-dispatch.md +129 -11
- package/gsd-core/workflows/execute-phase/steps/gap-closure-artifacts.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/partial-wave.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/per-plan-executor-routing.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +29 -5
- package/gsd-core/workflows/execute-phase/steps/post-merge-gate.md +2 -2
- package/gsd-core/workflows/execute-phase/steps/protected-branch.md +21 -0
- package/gsd-core/workflows/execute-phase/steps/regression-gate-run.md +4 -2
- package/gsd-core/workflows/execute-phase/steps/tdd-applicability-resolution.md +25 -0
- package/gsd-core/workflows/execute-phase/steps/wave-post-gate-hooks.md +39 -0
- package/gsd-core/workflows/execute-phase/steps/worktree-recovery-policy.md +2 -0
- package/gsd-core/workflows/execute-phase.md +68 -66
- package/gsd-core/workflows/execute-plan.md +25 -20
- package/gsd-core/workflows/explore.md +3 -1
- package/gsd-core/workflows/extract-learnings.md +3 -1
- package/gsd-core/workflows/fast.md +8 -2
- package/gsd-core/workflows/forensics.md +3 -1
- package/gsd-core/workflows/graduation.md +6 -6
- package/gsd-core/workflows/health.md +4 -7
- package/gsd-core/workflows/help/modes/brief.md +2 -0
- package/gsd-core/workflows/help/modes/default.md +2 -0
- package/gsd-core/workflows/help/modes/full.md +12 -0
- package/gsd-core/workflows/help/modes/topic.md +2 -0
- package/gsd-core/workflows/help.md +2 -0
- package/gsd-core/workflows/import.md +17 -14
- package/gsd-core/workflows/inbox.md +5 -6
- package/gsd-core/workflows/ingest-docs.md +45 -12
- package/gsd-core/workflows/insert-phase.md +7 -5
- package/gsd-core/workflows/list-phase-assumptions.md +2 -0
- package/gsd-core/workflows/list-seeds.md +7 -3
- package/gsd-core/workflows/list-workspaces.md +3 -1
- package/gsd-core/workflows/manager.md +15 -26
- package/gsd-core/workflows/map-codebase.md +3 -1
- package/gsd-core/workflows/milestone-summary.md +3 -1
- package/gsd-core/workflows/mvp-phase.md +3 -3
- package/gsd-core/workflows/new-milestone.md +10 -22
- package/gsd-core/workflows/new-project/steps/auto-mode-config.md +1 -1
- package/gsd-core/workflows/new-project.md +17 -29
- package/gsd-core/workflows/new-workspace.md +2 -2
- package/gsd-core/workflows/next.md +4 -2
- package/gsd-core/workflows/node-repair.md +2 -0
- package/gsd-core/workflows/note.md +2 -0
- package/gsd-core/workflows/onboard.md +1 -1
- package/gsd-core/workflows/pause-work.md +20 -5
- package/gsd-core/workflows/plan-phase/steps/adr-ingest-express-path.md +1 -1
- package/gsd-core/workflows/plan-phase/steps/chunked-planning-mode.md +100 -18
- package/gsd-core/workflows/plan-phase/steps/prd-express-path.md +4 -4
- package/gsd-core/workflows/plan-phase/steps/stall-detection-helpers.md +12 -3
- package/gsd-core/workflows/plan-phase.md +251 -54
- package/gsd-core/workflows/plan-review-convergence.md +148 -19
- package/gsd-core/workflows/plant-seed.md +3 -3
- package/gsd-core/workflows/pr-branch.md +195 -51
- package/gsd-core/workflows/profile-user.md +17 -15
- package/gsd-core/workflows/progress/steps/forensic-audit.md +1 -1
- package/gsd-core/workflows/progress.md +52 -15
- package/gsd-core/workflows/quick/steps/discussion-phase.md +1 -3
- package/gsd-core/workflows/quick/steps/plan-checker-loop.md +38 -5
- package/gsd-core/workflows/quick/steps/quick-verification.md +2 -4
- package/gsd-core/workflows/quick/steps/research-phase.md +5 -7
- package/gsd-core/workflows/quick/steps/worktree-pre-dispatch-commit.md +3 -3
- package/gsd-core/workflows/quick-batch/steps/batch-init.md +55 -0
- package/gsd-core/workflows/quick-batch/steps/completion.md +65 -0
- package/gsd-core/workflows/quick-batch/steps/merge-wave.md +100 -0
- package/gsd-core/workflows/quick-batch/steps/plan-checker-loop.md +147 -0
- package/gsd-core/workflows/quick-batch/steps/planner-wave.md +158 -0
- package/gsd-core/workflows/quick-batch/steps/research-phase.md +95 -0
- package/gsd-core/workflows/quick-batch/steps/resume-mode.md +49 -0
- package/gsd-core/workflows/quick-batch/steps/verification-wave.md +73 -0
- package/gsd-core/workflows/quick-batch/steps/worktree-dispatch.md +169 -0
- package/gsd-core/workflows/quick-batch.md +203 -0
- package/gsd-core/workflows/quick.md +33 -32
- package/gsd-core/workflows/reapply-patches.md +2 -0
- package/gsd-core/workflows/remove-phase.md +6 -4
- package/gsd-core/workflows/remove-workspace.md +3 -3
- package/gsd-core/workflows/resume-project.md +14 -14
- package/gsd-core/workflows/review.md +404 -21
- package/gsd-core/workflows/scan.md +3 -1
- package/gsd-core/workflows/section-manifest.json +12 -0
- package/gsd-core/workflows/secure-phase.md +3 -3
- package/gsd-core/workflows/session-report.md +2 -0
- package/gsd-core/workflows/settings-advanced.md +9 -9
- package/gsd-core/workflows/settings-integrations.md +66 -32
- package/gsd-core/workflows/settings.md +4 -6
- package/gsd-core/workflows/ship.md +22 -16
- package/gsd-core/workflows/sketch-wrap-up.md +13 -17
- package/gsd-core/workflows/sketch.md +13 -19
- package/gsd-core/workflows/smart-entry.md +4 -6
- package/gsd-core/workflows/spec-phase.md +31 -4
- package/gsd-core/workflows/spike-wrap-up.md +9 -11
- package/gsd-core/workflows/spike.md +21 -32
- package/gsd-core/workflows/stats.md +4 -2
- package/gsd-core/workflows/sync-skills.md +13 -5
- package/gsd-core/workflows/thread.md +13 -7
- package/gsd-core/workflows/transition.md +7 -5
- package/gsd-core/workflows/ui-phase.md +36 -21
- package/gsd-core/workflows/ui-review.md +7 -11
- package/gsd-core/workflows/ultraplan-phase.md +7 -13
- package/gsd-core/workflows/undo.md +9 -17
- package/gsd-core/workflows/update.md +47 -48
- package/gsd-core/workflows/validate-phase.md +3 -3
- package/gsd-core/workflows/verify-work/steps/automated-ui-verification.md +25 -1
- package/gsd-core/workflows/verify-work/steps/mvp-uat-framing.md +1 -1
- package/gsd-core/workflows/verify-work.md +106 -21
- package/hooks/dist/gsd-agent-isolation-guard.js +77 -38
- package/hooks/dist/gsd-check-update-worker.js +19 -2
- package/hooks/dist/gsd-config-reload.js +18 -12
- package/hooks/dist/gsd-context-monitor.js +302 -22
- package/hooks/dist/gsd-cursor-post-tool.js +3 -1
- package/hooks/dist/gsd-cursor-pre-tool.js +3 -1
- package/hooks/dist/gsd-cursor-session-start.js +2 -1
- package/hooks/dist/gsd-cursor-stop.js +2 -1
- package/hooks/dist/gsd-cursor-subagent-start.js +28 -23
- package/hooks/dist/gsd-cursor-subagent-stop.js +3 -1
- package/hooks/dist/gsd-ensure-canonical-path.js +2 -1
- package/hooks/dist/gsd-graphify-update.sh +22 -18
- package/hooks/dist/gsd-node-runner.sh +77 -0
- package/hooks/dist/gsd-phase-boundary.sh +1 -0
- package/hooks/dist/gsd-prompt-guard.js +46 -12
- package/hooks/dist/gsd-read-guard.js +18 -7
- package/hooks/dist/gsd-read-injection-scanner.js +22 -13
- package/hooks/dist/gsd-secret-read-guard.js +1079 -0
- package/hooks/dist/gsd-session-state.sh +1 -0
- package/hooks/dist/gsd-statusline.js +222 -29
- package/hooks/dist/gsd-validate-commit.sh +523 -12
- package/hooks/dist/gsd-windsurf-pre-command.js +16 -11
- package/hooks/dist/gsd-windsurf-pre-write.js +22 -13
- package/hooks/dist/gsd-workflow-guard.js +36 -17
- package/hooks/dist/gsd-worktree-path-guard.js +36 -21
- package/hooks/dist/gsd-write-guard.js +35 -25
- package/hooks/dist/lib/cli-exit.js +560 -0
- package/hooks/dist/lib/exit-code-registry.js +98 -0
- package/hooks/dist/lib/git-cmd.js +210 -1
- package/hooks/dist/lib/git-probe.js +84 -0
- package/hooks/dist/lib/hook-exit.js +81 -0
- package/hooks/dist/lib/injection-patterns.js +36 -6
- package/hooks/dist/managed-hooks-registry.cjs +4 -0
- package/hooks/gsd-agent-isolation-guard.js +77 -38
- package/hooks/gsd-check-update-worker.js +19 -2
- package/hooks/gsd-config-reload.js +18 -12
- package/hooks/gsd-context-monitor.js +302 -22
- package/hooks/gsd-cursor-post-tool.js +3 -1
- package/hooks/gsd-cursor-pre-tool.js +3 -1
- package/hooks/gsd-cursor-session-start.js +2 -1
- package/hooks/gsd-cursor-stop.js +2 -1
- package/hooks/gsd-cursor-subagent-start.js +28 -23
- package/hooks/gsd-cursor-subagent-stop.js +3 -1
- package/hooks/gsd-ensure-canonical-path.js +2 -1
- package/hooks/gsd-graphify-update.sh +22 -18
- package/hooks/gsd-node-runner.sh +77 -0
- package/hooks/gsd-phase-boundary.sh +1 -0
- package/hooks/gsd-prompt-guard.js +46 -12
- package/hooks/gsd-read-guard.js +18 -7
- package/hooks/gsd-read-injection-scanner.js +22 -13
- package/hooks/gsd-secret-read-guard.js +1079 -0
- package/hooks/gsd-session-state.sh +1 -0
- package/hooks/gsd-statusline.js +222 -29
- package/hooks/gsd-validate-commit.sh +523 -12
- package/hooks/gsd-windsurf-pre-command.js +16 -11
- package/hooks/gsd-windsurf-pre-write.js +22 -13
- package/hooks/gsd-workflow-guard.js +36 -17
- package/hooks/gsd-worktree-path-guard.js +36 -21
- package/hooks/gsd-write-guard.js +35 -25
- package/hooks/hooks.json +6 -0
- package/hooks/lib/cli-exit.js +560 -0
- package/hooks/lib/exit-code-registry.js +98 -0
- package/hooks/lib/git-cmd.js +210 -1
- package/hooks/lib/git-probe.js +84 -0
- package/hooks/lib/hook-exit.js +81 -0
- package/hooks/lib/injection-patterns.js +36 -6
- package/hooks/managed-hooks-registry.cjs +4 -0
- package/package.json +14 -9
- package/scripts/base64-scan.sh +74 -12
- package/scripts/build-hooks.js +12 -0
- package/scripts/check-glossary-refs.cjs +77 -15
- package/scripts/check-mutation-score-ratchet.cjs +156 -0
- package/scripts/ci-check-job-near-cap.cjs +49 -0
- package/scripts/ci-pr-mergeability.cjs +262 -0
- package/scripts/ci-test-scope.cjs +52 -12
- package/scripts/ci-timeout-report.cjs +230 -0
- package/scripts/docs-guard-registry.cjs +406 -0
- package/scripts/gen-capability-registry.cjs +8 -6
- package/scripts/gen-exit-code-docs.cjs +318 -0
- package/scripts/gen-exit-code-registry.cjs +891 -0
- package/scripts/gen-features.cjs +836 -0
- package/scripts/gen-hooks-cli-exit.cjs +239 -0
- package/scripts/gen-install-tree-fixtures.cjs +2 -2
- package/scripts/gen-loop-host-contract.cjs +189 -4
- package/scripts/gen-scripts-cli-exit.cjs +185 -0
- package/scripts/gen-state-md-docs.cjs +727 -0
- package/scripts/{test-failure-reasons.cjs → gsd-test-gate-reasons.cjs} +6 -0
- package/scripts/lib/ci-job-timing.cjs +72 -0
- package/scripts/lib/cli-exit.cjs +546 -44
- package/scripts/lib/drift-scan.cjs +32 -2
- package/scripts/lib/exit-code-registry.cjs +98 -0
- package/scripts/lib/ndjson-reporter.cjs +119 -0
- package/scripts/lib/shellcheck-fetch.cjs +247 -0
- package/scripts/lint-allow-test-rule-refs.allowlist.json +0 -6
- package/scripts/lint-allow-test-rule-refs.effective-ceiling.json +1 -1
- package/scripts/lint-allow-test-rule-refs.unverified-ceiling.json +1 -1
- package/scripts/lint-docs-guard-registration.cjs +495 -0
- package/scripts/lint-docs-guard-registration.exempt-baseline.cjs +198 -0
- package/scripts/lint-eslint-glob-coverage.allowlist.json +4 -0
- package/scripts/{lint-fix-has-regression-test.cjs → lint-fix-has-regression-tests.cjs} +12 -6
- package/scripts/lint-health-diagnostic-rule-table.cjs +65 -8
- package/scripts/lint-mutation-test-derivation-drift.cjs +86 -0
- package/scripts/lint-phase-enumeration-drift.cjs +45 -14
- package/scripts/lint-phase-id-drift.cjs +133 -8
- package/scripts/lint-planning-prompt-drift.cjs +38 -1
- package/scripts/lint-portable-grep.cjs +176 -0
- package/scripts/lint-removed-but-needed.cjs +184 -16
- package/scripts/lint-response-language-coverage.cjs +524 -0
- package/scripts/lint-seam-enforcement.cjs +182 -0
- package/scripts/lint-slug-derivation-drift.cjs +921 -0
- package/scripts/lint-source-test-name-collision.cjs +241 -0
- package/scripts/lint-state-write-path-drift.cjs +337 -432
- package/scripts/lint-test-file-count.allowlist.json +124 -4
- package/scripts/lint-test-file-count.cjs +25 -3
- package/scripts/lint-unreachable-guard-drift.cjs +51 -64
- package/scripts/lint-vendored-deps.cjs +208 -35
- package/scripts/lint-workflow-shellcheck-baseline.json +1027 -0
- package/scripts/lint-workflow-shellcheck.cjs +614 -0
- package/scripts/mutation-matrix.cjs +599 -50
- package/scripts/npm-audit-baseline.cjs +376 -0
- package/scripts/prompt-injection-scan.sh +83 -14
- package/scripts/require-issue-link-policy.cjs +16 -1
- package/scripts/secret-scan.sh +75 -13
- package/scripts/select-docs-guards.cjs +56 -0
- package/scripts/sync-runtime-launcher.cjs +22 -3
- package/skills/gsd-discuss-phase/SKILL.md +1 -1
- package/skills/gsd-execute-phase/SKILL.md +1 -1
- package/skills/gsd-import/SKILL.md +1 -1
- package/skills/gsd-ns-workflow/SKILL.md +1 -0
- package/skills/gsd-phase/SKILL.md +1 -1
- package/skills/gsd-quick/SKILL.md +8 -4
- package/skills/gsd-quick-batch/SKILL.md +105 -0
- package/skills/gsd-surface/SKILL.md +18 -8
- package/vscode/package.json +1 -1
- package/bin/lib/ui-safety-gate.cjs +0 -109
- package/scripts/lint-emitted-drift-ack.cjs +0 -344
- package/scripts/state-write-path-drift-baseline.json +0 -19
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* #3712 — refuse to let an in-process test run reach the developer's REAL home.
|
|
7
|
+
*
|
|
8
|
+
* NAMED `real-home-guard`, NOT `test-home-guard`: this is a SOURCE module, and a
|
|
9
|
+
* source filename matching Node's `test-*` convention gets COLLECTED and EXECUTED
|
|
10
|
+
* as a test by the remote runner, which never imports it and throws immediately
|
|
11
|
+
* on load — proven against the unmodified `next` tip 622f43353 (linux-node24,
|
|
12
|
+
* 37199 passed / 1 failed, failure at `src/test-home-guard.cts`). Meanwhile
|
|
13
|
+
* `scripts/run-tests.cjs` only globs `tests/**\/*.test.cjs`, so GitHub CI never
|
|
14
|
+
* sees the failure and stays green while the remote push-gate runner goes red.
|
|
15
|
+
* Any name works except one matching `test-*`, `*-test`, `*_test`, `*.test.*`,
|
|
16
|
+
* or `test.*`.
|
|
17
|
+
*
|
|
18
|
+
* A runtime kind may declare a global `home` override that is resolved from
|
|
19
|
+
* `os.homedir()` rather than from the caller's `configDir` (today: codex's
|
|
20
|
+
* skills kind, `home: ".agents"`, ADR-1239 / #2088 — Codex auto-discovers
|
|
21
|
+
* global skills from `$HOME/.agents/skills`). Sandboxing `configDir`/`targetDir`
|
|
22
|
+
* therefore does NOT contain such a kind, and no `assertDestWithinConfigHome`
|
|
23
|
+
* check can see it: that gate confines a destSubpath to whatever root it is
|
|
24
|
+
* handed, and here the root IS the escaped home.
|
|
25
|
+
*
|
|
26
|
+
* The live defect: an in-process caller that forgot to sandbox HOME installed —
|
|
27
|
+
* and, via `_removeGsdEntries` / `_syncGsdDir`, PRUNED — inside the real
|
|
28
|
+
* `~/.agents/skills`, deleting every `gsd-*` skill (observed 71 -> 0, a foreign
|
|
29
|
+
* `cloudflare` skill surviving) while the suite still exited 0. It is silent
|
|
30
|
+
* because the runtime's own config home is untouched, so the manifest keeps
|
|
31
|
+
* reporting a healthy install.
|
|
32
|
+
*
|
|
33
|
+
* This lives in its own module because SIX writers resolve a kind `home` and then
|
|
34
|
+
* write or destroy what is under it. Four are reachable today —
|
|
35
|
+
* `installRuntimeArtifacts` and `uninstallRuntimeArtifacts` (install-engine.cts)
|
|
36
|
+
* and `applySurface` (surface.cts); guarding only the install path, as the first
|
|
37
|
+
* cut of this fix did, left the other two as live bypasses. Two more are
|
|
38
|
+
* descriptor-dependent and guarded against a future descriptor change rather than
|
|
39
|
+
* a present escape: `installOpencodeFamilySkills`, which sits behind the
|
|
40
|
+
* combined-family early return and honors `skillsKindEntry.home` (no
|
|
41
|
+
* combined-family runtime declares one), and `installAgentsKindStandalone`, which
|
|
42
|
+
* honors `agentsKindEntry.home` and prunes it (antigravity's global agents kind declares one since #3738; it was the first agents-kind override).
|
|
43
|
+
* The sixth is `migrateLegacyDevPreferencesToSkill`, which resolves the skills
|
|
44
|
+
* kind's `home` and writes `SKILL.md` under it. It CREATES rather than prunes,
|
|
45
|
+
* which is why the first pass of this fix missed it, and it runs from
|
|
46
|
+
* `_runLegacyInstallMigrations` — i.e. BEFORE `installRuntimeArtifacts`' own
|
|
47
|
+
* assertion — so it carries its own call.
|
|
48
|
+
*
|
|
49
|
+
* DETECTION — three signals, in order:
|
|
50
|
+
*
|
|
51
|
+
* 1. `NODE_TEST_CONTEXT` is set by `node --test` and inherited by children, and
|
|
52
|
+
* is absent from normal installs outside a Node test context, so ordinary
|
|
53
|
+
* production installs are untouched. Precisely: an install spawned BENEATH a
|
|
54
|
+
* `node --test` process with an un-sandboxed HOME is refused — that is the
|
|
55
|
+
* point, and it is also why this is not stated as "never affects installs".
|
|
56
|
+
* `GSD_TEST_MODE` is NOT usable: several in-process test files — including
|
|
57
|
+
* the one that caused #3712 — never set it, so gating on it would miss the
|
|
58
|
+
* exact case this guard exists for.
|
|
59
|
+
* 2. `os.userInfo().homedir` reads the passwd entry and ignores `$HOME`, while
|
|
60
|
+
* `os.homedir()` prefers `$HOME`. They disagree exactly when a caller
|
|
61
|
+
* redirected HOME and agree when one forgot. This is the PRIMARY signal and
|
|
62
|
+
* the only one used whenever a passwd entry is readable. It is asked about
|
|
63
|
+
* the DESTINATION, not about HOME state: a destination outside the passwd
|
|
64
|
+
* home is allowed, and one inside it is refused UNLESS it sits beneath a
|
|
65
|
+
* HOME that was sandboxed away from the passwd home. That last exemption is
|
|
66
|
+
* not a softening — on Windows the temp root is inside the user's home, so
|
|
67
|
+
* without it every sandboxed run is refused (#3725). Both halves are
|
|
68
|
+
* required; see `derivesFromSandboxedHome`.
|
|
69
|
+
* 3. `SANDBOX_MARKER` — consulted ONLY when the passwd entry cannot be read.
|
|
70
|
+
*
|
|
71
|
+
* FAILS CLOSED, with one named exception. If the passwd entry is unreadable
|
|
72
|
+
* (some CI images) we cannot establish that HOME is sandboxed, so a home-override
|
|
73
|
+
* kind is refused rather than allowed — UNLESS the marker below names the home in
|
|
74
|
+
* effect. That branch is a deliberate weakening, not a closed door: with no passwd
|
|
75
|
+
* entry there is nothing that could contradict a marker naming the real home, so a
|
|
76
|
+
* caller that sandboxed to its own real home would be believed. The alternative is
|
|
77
|
+
* refusing every run on such a host. Everything else in that branch answers NO
|
|
78
|
+
* when it cannot tell — see `sameDirectory`. The cost of a false refusal is a failed test naming its own fix;
|
|
79
|
+
* the cost of a false allow is silent, unrecoverable deletion of a developer's
|
|
80
|
+
* skills.
|
|
81
|
+
*
|
|
82
|
+
* The marker carries the sandbox PATH, not a boolean, and is checked only in that
|
|
83
|
+
* unreadable-passwd branch — deliberately, because a boolean checked first is not
|
|
84
|
+
* proof of anything. An ambient or stale `=1` inherited from a parent process, or
|
|
85
|
+
* left set by an earlier in-process test, would have disarmed the guard entirely
|
|
86
|
+
* even when HOME plainly equalled the passwd home. Requiring the value to EQUAL
|
|
87
|
+
* the home now in effect means a leftover marker from some other directory cannot
|
|
88
|
+
* vouch for this call.
|
|
89
|
+
*/
|
|
90
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
91
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
92
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
93
|
+
/**
|
|
94
|
+
* Set by tests/helpers.cjs `sandboxHome()` to the sandboxed home PATH. Only
|
|
95
|
+
* consulted when the passwd entry is unreadable; see the module docblock.
|
|
96
|
+
*/
|
|
97
|
+
const SANDBOX_MARKER = 'GSD_TEST_HOME_SANDBOX';
|
|
98
|
+
/**
|
|
99
|
+
* Are these two paths the same directory on disk?
|
|
100
|
+
*
|
|
101
|
+
* Compared by FILESYSTEM IDENTITY — `st_dev` + `st_ino` — not by pathname.
|
|
102
|
+
* `path.resolve()` normalizes separators and `..` but resolves neither symlinks
|
|
103
|
+
* nor case, and `realpathSync` returns a canonical *pathname*, which two routes to
|
|
104
|
+
* one directory can still disagree on (a Linux bind mount is the standard case).
|
|
105
|
+
* `statSync` follows symlinks and reports the inode itself, so a case-variant
|
|
106
|
+
* HOME, a symlinked HOME, and a bind-mounted HOME all compare equal.
|
|
107
|
+
*
|
|
108
|
+
* Fails CLOSED, and "closed" here means returning FALSE. The sole caller is the
|
|
109
|
+
* passwd-less marker branch, which READS a true as permission to proceed:
|
|
110
|
+
*
|
|
111
|
+
* if (marker && sameDirectory(marker, osMod.homedir())) return; // allows
|
|
112
|
+
*
|
|
113
|
+
* So "cannot tell" must answer NO. An earlier revision returned true for the
|
|
114
|
+
* unknown/unknown case (both stats failing with something other than
|
|
115
|
+
* ENOENT/ENOTDIR — EACCES, EPERM, EIO) on the reasoning that "cannot tell" should
|
|
116
|
+
* make the caller refuse; that reasoning was inverted with respect to this
|
|
117
|
+
* caller, and it turned an unreadable-stat environment into an unconditional
|
|
118
|
+
* bypass for anyone who set the marker to any value at all. Reported in review of
|
|
119
|
+
* #3725. Only two things now answer yes: the same resolved pathname, or two
|
|
120
|
+
* readable identities that match.
|
|
121
|
+
*/
|
|
122
|
+
function sameDirectory(a, b) {
|
|
123
|
+
if (node_path_1.default.resolve(a) === node_path_1.default.resolve(b))
|
|
124
|
+
return true;
|
|
125
|
+
const ia = identify(a);
|
|
126
|
+
const ib = identify(b);
|
|
127
|
+
if (ia.kind === 'ok' && ib.kind === 'ok')
|
|
128
|
+
return ia.dev === ib.dev && ia.ino === ib.ino;
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
function identify(p) {
|
|
132
|
+
try {
|
|
133
|
+
const st = node_fs_1.default.statSync(p);
|
|
134
|
+
return { kind: 'ok', dev: st.dev, ino: st.ino };
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
const code = err?.code;
|
|
138
|
+
if (code === 'ENOENT' || code === 'ENOTDIR')
|
|
139
|
+
return { kind: 'absent' };
|
|
140
|
+
return { kind: 'unknown' };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @param operation - the writer being guarded, for the error message
|
|
145
|
+
* (e.g. `installRuntimeArtifacts`), so a failure names its own call site.
|
|
146
|
+
* @param runtime - canonical runtime id, for the error message.
|
|
147
|
+
* @param kinds - resolved layout kinds; only those carrying `home` can escape.
|
|
148
|
+
* @param deps - test seam. The guard's own trigger condition is "HOME equals the
|
|
149
|
+
* passwd home", which cannot be reproduced without pointing at the developer's
|
|
150
|
+
* real home, so it is injected rather than simulated. Mirrors the `deps.os`
|
|
151
|
+
* seam in scripts/live-config-guard.cjs.
|
|
152
|
+
* @throws {Error} when a global `home` override cannot be shown to be sandboxed.
|
|
153
|
+
*/
|
|
154
|
+
/**
|
|
155
|
+
* Stamped on every Error this module throws.
|
|
156
|
+
*
|
|
157
|
+
* A refusal happens before any LAYOUT-DRIVEN write — legacy install migrations
|
|
158
|
+
* run first and are rolled back on their own path — so it is not a partial
|
|
159
|
+
* codex-skills install and must not trigger that rollback. `bin/install.js`'s
|
|
160
|
+
* pre-config rollback
|
|
161
|
+
* deletes and recreates every snapshotted `gsd-*` directory in the resolved
|
|
162
|
+
* skills root, which for an un-sandboxed codex install IS the real
|
|
163
|
+
* `~/.agents/skills`. Without this marker the guard's own refusal would provoke
|
|
164
|
+
* the mutation it exists to prevent. Found by review, not by CI.
|
|
165
|
+
*/
|
|
166
|
+
const REFUSAL_FLAG = 'gsdTestHomeGuardRefusal';
|
|
167
|
+
/**
|
|
168
|
+
* Static remediation line, shared by every refusal this module raises. Hoisted to
|
|
169
|
+
* module scope because `resolveThroughLinks` refuses too and sits outside
|
|
170
|
+
* `assertTestHomeSandboxed`'s body, where this used to be a local.
|
|
171
|
+
*/
|
|
172
|
+
const SANDBOX_FIX_HINT = `Fix the TEST, not this guard: sandbox HOME and USERPROFILE BEFORE resolving the ` +
|
|
173
|
+
`layout, for the duration of the call — use sandboxHome(t, dir) from tests/helpers.cjs ` +
|
|
174
|
+
`(see #3712).`;
|
|
175
|
+
function refusal(message) {
|
|
176
|
+
const err = new Error(message);
|
|
177
|
+
err[REFUSAL_FLAG] = true;
|
|
178
|
+
return err;
|
|
179
|
+
}
|
|
180
|
+
/** Did `err` come from this guard refusing before any write happened? */
|
|
181
|
+
function isTestHomeGuardRefusal(err) {
|
|
182
|
+
return Boolean(err && typeof err === 'object' && err[REFUSAL_FLAG]);
|
|
183
|
+
}
|
|
184
|
+
function assertTestHomeSandboxed(operation, runtime, kinds, deps = {}) {
|
|
185
|
+
const osMod = deps.os ?? node_os_1.default;
|
|
186
|
+
const env = deps.env ?? process.env;
|
|
187
|
+
if (!env['NODE_TEST_CONTEXT'])
|
|
188
|
+
return; // a real install
|
|
189
|
+
const overriding = (kinds ?? []).filter((k) => k && k.home);
|
|
190
|
+
if (overriding.length === 0)
|
|
191
|
+
return; // nothing can escape
|
|
192
|
+
let passwdHome = null;
|
|
193
|
+
try {
|
|
194
|
+
passwdHome = osMod.userInfo().homedir || null;
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
passwdHome = null;
|
|
198
|
+
}
|
|
199
|
+
const fix = SANDBOX_FIX_HINT;
|
|
200
|
+
const realHome = passwdHome === null ? { kind: 'unknown' } : identify(passwdHome);
|
|
201
|
+
if (realHome.kind === 'ok') {
|
|
202
|
+
let effectiveHome = null;
|
|
203
|
+
try {
|
|
204
|
+
effectiveHome = osMod.homedir() || null;
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
effectiveHome = null;
|
|
208
|
+
}
|
|
209
|
+
// The question is NOT "is HOME sandboxed right now" — it is "does this
|
|
210
|
+
// destination land in the real home, other than by deriving from a sandbox
|
|
211
|
+
// beneath it". The first half alone is not enough: a layout resolved BEFORE
|
|
212
|
+
// sandboxHome() captures the real `~/.agents` in `kind.home`, and applySurface
|
|
213
|
+
// takes an already-resolved layout, so a HOME-state check returns "sandboxed"
|
|
214
|
+
// while the stale destination still points at the real home.
|
|
215
|
+
//
|
|
216
|
+
// The second half is not optional either — see `derivesFromSandboxedHome`.
|
|
217
|
+
// Containment in the real home is not by itself evidence of danger on a
|
|
218
|
+
// platform whose temp root lives inside the home.
|
|
219
|
+
for (const kind of overriding) {
|
|
220
|
+
const declared = node_path_1.default.resolve(node_path_1.default.join(kind.home, kind.destSubpath ?? ''));
|
|
221
|
+
// Both questions are asked of the path the write will REACH, not the one
|
|
222
|
+
// it was spelled as; see resolveThroughLinks.
|
|
223
|
+
const dest = resolveThroughLinks(declared);
|
|
224
|
+
if (!isInside(dest, realHome))
|
|
225
|
+
continue;
|
|
226
|
+
if (derivesFromSandboxedHome(dest, effectiveHome, realHome, passwdHome))
|
|
227
|
+
continue;
|
|
228
|
+
throw refusal(`${operation}("${runtime}") was called under a test runner with a destination inside ` +
|
|
229
|
+
`your REAL home. The "${kind.kind}" kind declares a global home override, so it ` +
|
|
230
|
+
`resolves from os.homedir() and NOT from the sandboxed configDir — this call would ` +
|
|
231
|
+
`write inside ${dest} (and install, uninstall and surface-apply also PRUNE GSD ` +
|
|
232
|
+
`entries there).\nThe real home it was ` +
|
|
233
|
+
`compared against is ${passwdHome} — if that is not your home, this ` +
|
|
234
|
+
`refusal is the bug and not the call.\n${fix}`);
|
|
235
|
+
}
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
// The real home cannot be identified, so containment against it cannot be
|
|
239
|
+
// evaluated at all. Fall back to the weaker signal: a marker naming the home
|
|
240
|
+
// currently in effect. Only reachable on hosts with no readable passwd entry,
|
|
241
|
+
// where the alternative is refusing every such run.
|
|
242
|
+
//
|
|
243
|
+
// TWO things are required, not one. An earlier revision returned as soon as the
|
|
244
|
+
// marker matched the effective HOME, which attested that a caller sandboxed HOME
|
|
245
|
+
// but said NOTHING about where these destinations resolve — so a layout captured
|
|
246
|
+
// BEFORE sandboxHome(), still naming the real `~/.agents`, was waved straight
|
|
247
|
+
// through on a passwd-less host. That is the same stale-layout shape the primary
|
|
248
|
+
// branch above refuses by design, and it made the marker a bypass for exactly
|
|
249
|
+
// the case the guard exists for. Reported in Codex review of #3725.
|
|
250
|
+
//
|
|
251
|
+
// The marker must also IDENTIFY: `sameDirectory` answers yes for two identical
|
|
252
|
+
// unidentifiable pathnames (see its docblock), and that is not enough to place a
|
|
253
|
+
// destination against.
|
|
254
|
+
const marker = env[SANDBOX_MARKER];
|
|
255
|
+
const markerId = marker ? identify(marker) : { kind: 'unknown' };
|
|
256
|
+
if (marker && markerId.kind === 'ok' && sameDirectory(marker, osMod.homedir())) {
|
|
257
|
+
const stale = overriding.find((kind) => !isInside(resolveThroughLinks(node_path_1.default.resolve(node_path_1.default.join(kind.home, kind.destSubpath ?? ''))), markerId));
|
|
258
|
+
if (!stale)
|
|
259
|
+
return;
|
|
260
|
+
throw refusal(`${operation}("${runtime}") was called under a test runner on a host with no identifiable ` +
|
|
261
|
+
`passwd home. HOME was sandboxed and recorded, but the "${stale.kind}" kind resolves to ` +
|
|
262
|
+
`${resolveThroughLinks(node_path_1.default.resolve(node_path_1.default.join(stale.home, stale.destSubpath ?? '')))}, ` +
|
|
263
|
+
`which is NOT beneath that sandbox — so this layout was resolved before the sandbox and still ` +
|
|
264
|
+
`names another home. A recorded sandbox vouches for HOME, never for a destination that does ` +
|
|
265
|
+
`not derive from it.\n${fix}`);
|
|
266
|
+
}
|
|
267
|
+
throw refusal(`${operation}("${runtime}") was called under a test runner and this environment has no ` +
|
|
268
|
+
`identifiable passwd home, so GSD cannot establish where the real home is. The ` +
|
|
269
|
+
`"${overriding[0]?.kind}" kind declares a global home override, which resolves from ` +
|
|
270
|
+
`os.homedir() and would write inside whatever real home that is (and, for the pruning ` +
|
|
271
|
+
`writers, delete GSD entries there). Refusing rather than guessing.\n${fix}`);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* The path `dest` will actually resolve to when it is written.
|
|
275
|
+
*
|
|
276
|
+
* `dest` usually does not exist yet — that is the point, it is about to be
|
|
277
|
+
* created — so `realpathSync` cannot be called on it directly. Walk up to the
|
|
278
|
+
* nearest ancestor that DOES exist, canonicalize that, and re-append the tail.
|
|
279
|
+
*
|
|
280
|
+
* Without this the sandbox exemption below is escapable: with HOME sandboxed to
|
|
281
|
+
* `$REAL/tmp-home` and `$REAL/tmp-home/.agents` a symlink (or Windows junction)
|
|
282
|
+
* onto the real `$REAL/.agents`, the lexical ancestor
|
|
283
|
+
* walk reaches the sandbox and the write is allowed — straight into the real
|
|
284
|
+
* home. Identity comparison alone does not close it, because each ancestor is
|
|
285
|
+
* identified in isolation and the alias sits BETWEEN dest and the sandbox.
|
|
286
|
+
* Found by review, not by CI.
|
|
287
|
+
*
|
|
288
|
+
* KNOWN LIMITATION — a subordinate BIND MOUNT of the real `~/.agents` at
|
|
289
|
+
* `<sandbox>/.agents` is NOT closed by this. A bind mount is not a link:
|
|
290
|
+
* `realpathSync` keeps the mount-point spelling, so the canonical destination
|
|
291
|
+
* still reads as "beneath the sandbox" while the write reaches the real
|
|
292
|
+
* directory. `sameDirectory` above already records that realpath cannot unify
|
|
293
|
+
* bind-mounted spellings; this inherits that limit. Closing it needs mount-table
|
|
294
|
+
* introspection, which is not portable, and the setup — deliberately mounting the
|
|
295
|
+
* one directory this guard protects into a sandbox inside the home — is not a
|
|
296
|
+
* shape any caller here produces. A cross-process swap of a checked directory
|
|
297
|
+
* between this call and the write (TOCTOU) is likewise out of reach and not
|
|
298
|
+
* claimed.
|
|
299
|
+
*
|
|
300
|
+
* Canonicalization itself fails CLOSED — see the errno split below. A component
|
|
301
|
+
* that EXISTS but cannot be resolved is refused, because falling back to the
|
|
302
|
+
* lexical spelling is the exact ALLOW an unresolvable alias needs.
|
|
303
|
+
*/
|
|
304
|
+
function resolveThroughLinks(dest) {
|
|
305
|
+
const tail = [];
|
|
306
|
+
let cur = node_path_1.default.resolve(dest);
|
|
307
|
+
for (;;) {
|
|
308
|
+
try {
|
|
309
|
+
return node_path_1.default.join(node_fs_1.default.realpathSync(cur), ...tail);
|
|
310
|
+
}
|
|
311
|
+
catch (err) {
|
|
312
|
+
// Same errno split `identify` already draws, and deliberately the same one:
|
|
313
|
+
// both functions are asking "does this path exist as named?", so they must
|
|
314
|
+
// not disagree. ENOENT/ENOTDIR mean NOT THERE — the expected case, since a
|
|
315
|
+
// fresh install resolves a destination that does not exist yet and realpath
|
|
316
|
+
// fails on the leaf and on every not-yet-created ancestor. That is what this
|
|
317
|
+
// walk is FOR, so keep walking.
|
|
318
|
+
//
|
|
319
|
+
// Any other errno means the component EXISTS but could not be canonicalized —
|
|
320
|
+
// EACCES/EPERM on a directory whose mode changed, ELOOP on a symlink cycle,
|
|
321
|
+
// EIO on a failing mount. Falling through to the lexical spelling there is a
|
|
322
|
+
// FAIL-OPEN that precisely inverts this function's purpose: an aliased
|
|
323
|
+
// `<sandbox>/.agents` that cannot be resolved keeps its sandbox spelling,
|
|
324
|
+
// satisfies the nested-sandbox exemption, and the write is ALLOWED straight
|
|
325
|
+
// into the real home. The module documents that it fails CLOSED with exactly
|
|
326
|
+
// ONE named exception (the marker branch); a swallowed canonicalization error
|
|
327
|
+
// was a second, unnamed one. Refuse instead. (Codex review of #3725.)
|
|
328
|
+
const code = err?.code;
|
|
329
|
+
if (code !== 'ENOENT' && code !== 'ENOTDIR') {
|
|
330
|
+
throw refusal(`A component of the destination could not be canonicalized, so this guard cannot ` +
|
|
331
|
+
`tell whether the write would reach your REAL home.\nFailed on: ${cur} ` +
|
|
332
|
+
`(${code ?? 'unknown error'})\nSymlinks and junctions are resolved BEFORE the ` +
|
|
333
|
+
`decision, because an aliased "<sandbox>/.agents" would otherwise read as confined ` +
|
|
334
|
+
`while pointing at the real one. A component that cannot be resolved is refused ` +
|
|
335
|
+
`rather than assumed safe.\n${SANDBOX_FIX_HINT}`);
|
|
336
|
+
}
|
|
337
|
+
const parent = node_path_1.default.dirname(cur);
|
|
338
|
+
if (parent === cur)
|
|
339
|
+
return node_path_1.default.resolve(dest);
|
|
340
|
+
tail.unshift(node_path_1.default.basename(cur));
|
|
341
|
+
cur = parent;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Is `dest` inside a HOME that has been sandboxed away from the passwd home?
|
|
347
|
+
*
|
|
348
|
+
* Asked only once `dest` is already known to be inside the real home, and it is
|
|
349
|
+
* what makes that fact non-fatal on Windows: there `os.tmpdir()` is
|
|
350
|
+
* `%USERPROFILE%\AppData\Local\Temp` by default (Node honors `TEMP`/`TMP`,
|
|
351
|
+
* so this is the usual case rather than a guarantee) — so in practice every
|
|
352
|
+
* sandbox a test creates is a descendant of the real home. Containment in the
|
|
353
|
+
* real home is therefore true of the correctly-sandboxed case and the dangerous
|
|
354
|
+
* one alike, and cannot separate them by itself. POSIX conceals this, because
|
|
355
|
+
* `/tmp` and `/var/folders` both sit outside `$HOME`. All six Windows shards of
|
|
356
|
+
* #3725 failed on legitimately sandboxed destinations before this conjunct
|
|
357
|
+
* existed.
|
|
358
|
+
*
|
|
359
|
+
* TWO conditions carry the decision, and neither suffices alone:
|
|
360
|
+
*
|
|
361
|
+
* - the passwd home is NOT beneath that HOME — see the comment on that check;
|
|
362
|
+
* without it a HOME that merely spells the real home more widely (`/Users`,
|
|
363
|
+
* `C:\Users`) is mistaken for a sandbox.
|
|
364
|
+
* - `dest` is beneath that sandboxed HOME — otherwise this decays into the
|
|
365
|
+
* "is HOME sandboxed?" check the module docblock rejects, and a layout
|
|
366
|
+
* resolved before the sandbox walks straight through.
|
|
367
|
+
*
|
|
368
|
+
* The first check below — HOME differs from the passwd home — is a cheap fast
|
|
369
|
+
* path, NOT an independent condition: `isInside` is reflexive, so whenever HOME
|
|
370
|
+
* identifies the passwd home the second check already returns false on its own.
|
|
371
|
+
* Removing it changes no outcome; it is kept to answer the common case without
|
|
372
|
+
* an ancestor walk. Raised in review of #3725 against prose that claimed the
|
|
373
|
+
* three were independent.
|
|
374
|
+
*
|
|
375
|
+
* Fails CLOSED: an unreadable or unidentifiable HOME returns false, so the
|
|
376
|
+
* caller refuses rather than exempting a destination it cannot place.
|
|
377
|
+
*/
|
|
378
|
+
function derivesFromSandboxedHome(dest, effectiveHome, realHome, passwdHome) {
|
|
379
|
+
if (effectiveHome === null)
|
|
380
|
+
return false;
|
|
381
|
+
const eff = identify(effectiveHome);
|
|
382
|
+
if (eff.kind !== 'ok')
|
|
383
|
+
return false;
|
|
384
|
+
if (eff.dev === realHome.dev && eff.ino === realHome.ino)
|
|
385
|
+
return false;
|
|
386
|
+
// A sandbox sits BENEATH the real home (the Windows temp shape) — never above
|
|
387
|
+
// it. A destination's ancestor chain is linear, so "inside the real home AND
|
|
388
|
+
// inside the effective HOME" admits two arrangements, not one: the intended
|
|
389
|
+
// `effectiveHome ⊂ realHome`, and `realHome ⊂ effectiveHome` — HOME pointed at
|
|
390
|
+
// `/Users`, `/home`, or `C:\Users`. The second is not a sandbox, it is the real
|
|
391
|
+
// home reached by a wider spelling, and without this it exempts a stale
|
|
392
|
+
// destination. Reported in review of #3725 as the one leaking cell of a
|
|
393
|
+
// six-row truth table.
|
|
394
|
+
if (isInside(passwdHome, eff))
|
|
395
|
+
return false;
|
|
396
|
+
return isInside(dest, eff);
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Is `child` at or beneath the directory identified by `rootId`?
|
|
400
|
+
*
|
|
401
|
+
* Walks `child`'s ancestors comparing filesystem identity rather than string
|
|
402
|
+
* prefixes, because `child` typically does not exist yet (that is the point — it
|
|
403
|
+
* is about to be created) while its ancestors do. A prefix test would miss a
|
|
404
|
+
* case-variant or symlinked spelling of the same ancestor, which is the exact
|
|
405
|
+
* class this guard exists to catch.
|
|
406
|
+
*/
|
|
407
|
+
function isInside(child, rootId) {
|
|
408
|
+
let cur = node_path_1.default.resolve(child);
|
|
409
|
+
for (;;) {
|
|
410
|
+
const id = identify(cur);
|
|
411
|
+
if (id.kind === 'ok' && id.dev === rootId.dev && id.ino === rootId.ino)
|
|
412
|
+
return true;
|
|
413
|
+
const parent = node_path_1.default.dirname(cur);
|
|
414
|
+
if (parent === cur)
|
|
415
|
+
return false;
|
|
416
|
+
cur = parent;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
module.exports = { assertTestHomeSandboxed, isTestHomeGuardRefusal, SANDBOX_MARKER };
|
|
@@ -379,42 +379,18 @@ function resolveLedgerWindow(cwd, padded, file, line, kind, reasonText, windowsO
|
|
|
379
379
|
}
|
|
380
380
|
// ─── evaluate ────────────────────────────────────────────────────────────────
|
|
381
381
|
const EVALUATE_USAGE = 'Usage: gsd-tools refactor evaluate --phase <N> [--since <ref>] [--raw]';
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
const { phaseDir, padded } = resolved;
|
|
394
|
-
const sinceFlag = readFlag(rest, '--since');
|
|
395
|
-
const sinceOverride = sinceFlag.present && !sinceFlag.flagShaped ? sinceFlag.value.trim() : '';
|
|
396
|
-
const sinceRef = sinceOverride !== '' ? sinceOverride : git.phaseStartCommit(cwd, phaseDir);
|
|
397
|
-
if (sinceRef === null) {
|
|
398
|
-
c.output({ verdict: complexity.VERDICT.SKIPPED, reason: complexity.REASON.REFACTOR_GIT_UNAVAILABLE, phase: padded }, raw);
|
|
399
|
-
return undefined;
|
|
400
|
-
}
|
|
401
|
-
const touched = git.changedFilesSince(cwd, sinceRef);
|
|
402
|
-
if (touched === null) {
|
|
403
|
-
c.output({ verdict: complexity.VERDICT.SKIPPED, reason: complexity.REASON.REFACTOR_GIT_UNAVAILABLE, phase: padded }, raw);
|
|
404
|
-
return undefined;
|
|
405
|
-
}
|
|
406
|
-
// Step 4: empty touched set.
|
|
407
|
-
if (touched.length === 0) {
|
|
408
|
-
c.output({ verdict: complexity.VERDICT.BELOW_THRESHOLD, reason: complexity.REASON.REFACTOR_NO_TOUCHED_FILES, phase: padded }, raw);
|
|
409
|
-
return undefined;
|
|
410
|
-
}
|
|
411
|
-
// Step 5: filter with isAnalyzablePath; read each survivor. A read failure
|
|
412
|
-
// (or a path that escapes the project root) skips that one file with a
|
|
413
|
-
// reason and the run continues — never aborts the evaluation.
|
|
382
|
+
/**
|
|
383
|
+
* Step 5 of `evaluate`: filter `touched` with `isAnalyzablePath`, read each
|
|
384
|
+
* survivor and classify it into `analyzed`. A read failure (or a path that
|
|
385
|
+
* escapes the project root) skips that one file with
|
|
386
|
+
* `REFACTOR_FILE_UNREADABLE` and the loop continues — never aborts the
|
|
387
|
+
* evaluation. Only files that were SUCCESSFULLY analyzed feed
|
|
388
|
+
* `successfullyAnalyzedFiles` — an unreadable file must never wipe that
|
|
389
|
+
* file's baseline history via nextBaseline's "file in analyzedFiles but
|
|
390
|
+
* function missing" prune rule.
|
|
391
|
+
*/
|
|
392
|
+
function analyzeTouchedFiles(cwd, touched, complexity) {
|
|
414
393
|
const analyzed = [];
|
|
415
|
-
// Only files that were SUCCESSFULLY analyzed feed nextBaseline's prune set
|
|
416
|
-
// — an unreadable file must never wipe that file's baseline history via
|
|
417
|
-
// the "file in analyzedFiles but function missing" prune rule.
|
|
418
394
|
const successfullyAnalyzedFiles = [];
|
|
419
395
|
for (const relFile of touched) {
|
|
420
396
|
if (!complexity.isAnalyzablePath(relFile))
|
|
@@ -441,16 +417,18 @@ function handleEvaluate(args, cwd, raw, c, complexity, git, windowsOverride) {
|
|
|
441
417
|
successfullyAnalyzedFiles.push(relFile);
|
|
442
418
|
}
|
|
443
419
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
420
|
+
return { analyzed, successfullyAnalyzedFiles };
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Steps 7-9 of `evaluate`: write the proposal artifact when TRIGGERED, write
|
|
424
|
+
* the next baseline (failure is reported but never fails the command),
|
|
425
|
+
* record the strict-mode ledger window when applicable, and assemble the
|
|
426
|
+
* final result object. Pure orchestration over the side-effecting helpers —
|
|
427
|
+
* every degrade path (artifact write throw, baseline write failure, ledger
|
|
428
|
+
* unavailable) keeps its existing reason code and result shape.
|
|
429
|
+
*/
|
|
430
|
+
function finalizeEvaluation(opts) {
|
|
431
|
+
const { cwd, phaseDir, padded, planningDirPath, complexity, evaluation, evalConfig, baselineRead, analyzed, successfullyAnalyzedFiles, windowsOverride, } = opts;
|
|
454
432
|
// Step 7.
|
|
455
433
|
let artifactWritten = false;
|
|
456
434
|
let artifactPath = null;
|
|
@@ -518,6 +496,54 @@ function handleEvaluate(args, cwd, raw, c, complexity, git, windowsOverride) {
|
|
|
518
496
|
result.ledger_note = ledgerNote;
|
|
519
497
|
if (warnings.length > 0)
|
|
520
498
|
result.warnings = warnings;
|
|
499
|
+
return result;
|
|
500
|
+
}
|
|
501
|
+
function handleEvaluate(args, cwd, raw, c, complexity, git, windowsOverride) {
|
|
502
|
+
const rest = args.slice(2);
|
|
503
|
+
const phaseCheck = requirePhaseArg(rest, complexity, EVALUATE_USAGE);
|
|
504
|
+
if (!phaseCheck.ok)
|
|
505
|
+
return phaseCheck.result;
|
|
506
|
+
// Step 3: resolve PHASE_DIR + anchor (phaseStartCommit, or --since override).
|
|
507
|
+
const resolved = resolvePhaseDirForArg(cwd, phaseCheck.phase);
|
|
508
|
+
if (resolved === null) {
|
|
509
|
+
c.output({ verdict: complexity.VERDICT.SKIPPED, reason: complexity.REASON.REFACTOR_INVALID_PHASE, phase: phaseCheck.phase }, raw);
|
|
510
|
+
return undefined;
|
|
511
|
+
}
|
|
512
|
+
const { phaseDir, padded } = resolved;
|
|
513
|
+
const sinceFlag = readFlag(rest, '--since');
|
|
514
|
+
const sinceOverride = sinceFlag.present && !sinceFlag.flagShaped ? sinceFlag.value.trim() : '';
|
|
515
|
+
const sinceRef = sinceOverride !== '' ? sinceOverride : git.phaseStartCommit(cwd, phaseDir);
|
|
516
|
+
if (sinceRef === null) {
|
|
517
|
+
c.output({ verdict: complexity.VERDICT.SKIPPED, reason: complexity.REASON.REFACTOR_GIT_UNAVAILABLE, phase: padded }, raw);
|
|
518
|
+
return undefined;
|
|
519
|
+
}
|
|
520
|
+
const touched = git.changedFilesSince(cwd, sinceRef);
|
|
521
|
+
if (touched === null) {
|
|
522
|
+
c.output({ verdict: complexity.VERDICT.SKIPPED, reason: complexity.REASON.REFACTOR_GIT_UNAVAILABLE, phase: padded }, raw);
|
|
523
|
+
return undefined;
|
|
524
|
+
}
|
|
525
|
+
// Step 4: empty touched set.
|
|
526
|
+
if (touched.length === 0) {
|
|
527
|
+
c.output({ verdict: complexity.VERDICT.BELOW_THRESHOLD, reason: complexity.REASON.REFACTOR_NO_TOUCHED_FILES, phase: padded }, raw);
|
|
528
|
+
return undefined;
|
|
529
|
+
}
|
|
530
|
+
// Step 5: filter, read, and classify each touched file.
|
|
531
|
+
const { analyzed, successfullyAnalyzedFiles } = analyzeTouchedFiles(cwd, touched, complexity);
|
|
532
|
+
// Step 6.
|
|
533
|
+
const planningDirPath = planningDir(cwd);
|
|
534
|
+
const baselineRead = complexity.readBaseline(planningDirPath);
|
|
535
|
+
const evalConfig = readEvalConfig(cwd);
|
|
536
|
+
const evaluation = complexity.evaluateCandidates({
|
|
537
|
+
analyzed,
|
|
538
|
+
baseline: baselineRead.baseline,
|
|
539
|
+
threshold: evalConfig.threshold,
|
|
540
|
+
jumpDelta: evalConfig.jumpDelta,
|
|
541
|
+
});
|
|
542
|
+
// Steps 7-9: artifact write, baseline persistence, strict-mode ledger.
|
|
543
|
+
const result = finalizeEvaluation({
|
|
544
|
+
cwd, phaseDir, padded, planningDirPath, complexity, evaluation, evalConfig,
|
|
545
|
+
baselineRead, analyzed, successfullyAnalyzedFiles, windowsOverride,
|
|
546
|
+
});
|
|
521
547
|
c.output(result, raw);
|
|
522
548
|
return undefined;
|
|
523
549
|
}
|