oh-my-copilot 5.26.0 → 5.28.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 +2 -2
- package/.claude-plugin/plugin.json +2 -1
- package/agents/executor.md +1 -0
- package/bridge/claude-md-coordinator.cjs +2 -2
- package/bridge/cli.cjs +23572 -17129
- package/bridge/mcp-server.cjs +2721 -1497
- package/bridge/runtime-cli.cjs +4707 -1925
- package/bridge/team-mcp.cjs +2917 -816
- package/bridge/team.js +5397 -2381
- package/copilot/agents/executor.md +1 -0
- package/copilot/hooks.json +3 -3
- package/dist/__tests__/arguments-literal-substitution.test.d.ts +2 -0
- package/dist/__tests__/arguments-literal-substitution.test.d.ts.map +1 -0
- package/dist/__tests__/arguments-literal-substitution.test.js +34 -0
- package/dist/__tests__/arguments-literal-substitution.test.js.map +1 -0
- package/dist/__tests__/bridge-self-contained.test.d.ts +2 -0
- package/dist/__tests__/bridge-self-contained.test.d.ts.map +1 -0
- package/dist/__tests__/bridge-self-contained.test.js +44 -0
- package/dist/__tests__/bridge-self-contained.test.js.map +1 -0
- package/dist/__tests__/context-safety.test.js +1 -1
- package/dist/__tests__/context-safety.test.js.map +1 -1
- package/dist/__tests__/copilot-hook-dispatch.test.js +5 -1
- package/dist/__tests__/copilot-hook-dispatch.test.js.map +1 -1
- package/dist/__tests__/copilot-hooks-manifest.test.js +15 -1
- package/dist/__tests__/copilot-hooks-manifest.test.js.map +1 -1
- package/dist/__tests__/directory-context-injector-registration.test.js +5 -2
- package/dist/__tests__/directory-context-injector-registration.test.js.map +1 -1
- package/dist/__tests__/doctor-conflicts.test.js +61 -0
- package/dist/__tests__/doctor-conflicts.test.js.map +1 -1
- package/dist/__tests__/hook-command-normalizer.test.js +96 -58
- package/dist/__tests__/hook-command-normalizer.test.js.map +1 -1
- package/dist/__tests__/hooks/session-end-cleanup.test.js +87 -1
- package/dist/__tests__/hooks/session-end-cleanup.test.js.map +1 -1
- package/dist/__tests__/hooks-command-escaping.test.js +18 -16
- package/dist/__tests__/hooks-command-escaping.test.js.map +1 -1
- package/dist/__tests__/hud/omc-state.test.js +62 -1
- package/dist/__tests__/hud/omc-state.test.js.map +1 -1
- package/dist/__tests__/installer-mcp-config.test.js +39 -1
- package/dist/__tests__/installer-mcp-config.test.js.map +1 -1
- package/dist/__tests__/issue-2652-runtime-wiring-and-output-contract.test.js +1 -1
- package/dist/__tests__/issue-2652-runtime-wiring-and-output-contract.test.js.map +1 -1
- package/dist/__tests__/keyword-detector-echo-guard.test.js +13 -1
- package/dist/__tests__/keyword-detector-echo-guard.test.js.map +1 -1
- package/dist/__tests__/keyword-detector-script.test.js +201 -0
- package/dist/__tests__/keyword-detector-script.test.js.map +1 -1
- package/dist/__tests__/npm-package-surface-helpers.d.ts.map +1 -1
- package/dist/__tests__/npm-package-surface-helpers.js +8 -4
- package/dist/__tests__/npm-package-surface-helpers.js.map +1 -1
- package/dist/__tests__/plugin-setup-deps.test.js +144 -71
- package/dist/__tests__/plugin-setup-deps.test.js.map +1 -1
- package/dist/__tests__/preemptive-compaction-hook.test.js +62 -5
- package/dist/__tests__/preemptive-compaction-hook.test.js.map +1 -1
- package/dist/__tests__/ralph-prd-mandatory.test.js +3 -0
- package/dist/__tests__/ralph-prd-mandatory.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/herdr-daemon.test.d.ts +10 -0
- package/dist/__tests__/rate-limit-wait/herdr-daemon.test.d.ts.map +1 -0
- package/dist/__tests__/rate-limit-wait/herdr-daemon.test.js +241 -0
- package/dist/__tests__/rate-limit-wait/herdr-daemon.test.js.map +1 -0
- package/dist/__tests__/rate-limit-wait/herdr-detector.test.d.ts +9 -0
- package/dist/__tests__/rate-limit-wait/herdr-detector.test.d.ts.map +1 -0
- package/dist/__tests__/rate-limit-wait/herdr-detector.test.js +162 -0
- package/dist/__tests__/rate-limit-wait/herdr-detector.test.js.map +1 -0
- package/dist/__tests__/repair-plugin-cache-script.test.js +7 -1
- package/dist/__tests__/repair-plugin-cache-script.test.js.map +1 -1
- package/dist/__tests__/run-cjs-graceful-fallback.test.js +3 -2
- package/dist/__tests__/run-cjs-graceful-fallback.test.js.map +1 -1
- package/dist/__tests__/run-cjs-windows-stdio-contract.test.js +4 -1
- package/dist/__tests__/run-cjs-windows-stdio-contract.test.js.map +1 -1
- package/dist/__tests__/setup-contracts-regression.test.js +13 -10
- package/dist/__tests__/setup-contracts-regression.test.js.map +1 -1
- package/dist/__tests__/skills.test.js +10 -9
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/alias-retirement/__tests__/registry.test.js +2 -2
- package/dist/cli/__tests__/doctor-conflicts-json.test.js +2 -2
- package/dist/cli/__tests__/doctor-conflicts-json.test.js.map +1 -1
- package/dist/cli/__tests__/herdr-no-raw-calls.test.d.ts +10 -0
- package/dist/cli/__tests__/herdr-no-raw-calls.test.d.ts.map +1 -0
- package/dist/cli/__tests__/herdr-no-raw-calls.test.js +54 -0
- package/dist/cli/__tests__/herdr-no-raw-calls.test.js.map +1 -0
- package/dist/cli/__tests__/interop-herdr.test.d.ts +9 -0
- package/dist/cli/__tests__/interop-herdr.test.d.ts.map +1 -0
- package/dist/cli/__tests__/interop-herdr.test.js +138 -0
- package/dist/cli/__tests__/interop-herdr.test.js.map +1 -0
- package/dist/cli/__tests__/launch-herdr.test.d.ts +10 -0
- package/dist/cli/__tests__/launch-herdr.test.d.ts.map +1 -0
- package/dist/cli/__tests__/launch-herdr.test.js +141 -0
- package/dist/cli/__tests__/launch-herdr.test.js.map +1 -0
- package/dist/cli/__tests__/launch.test.js +140 -10
- package/dist/cli/__tests__/launch.test.js.map +1 -1
- package/dist/cli/__tests__/plugin-dir-capture.test.js +2 -0
- package/dist/cli/__tests__/plugin-dir-capture.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-afk.test.js +392 -2
- package/dist/cli/__tests__/ralph-afk.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-closeout.test.d.ts +2 -0
- package/dist/cli/__tests__/ralph-closeout.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralph-closeout.test.js +156 -0
- package/dist/cli/__tests__/ralph-closeout.test.js.map +1 -0
- package/dist/cli/__tests__/subcommand-json-flag.test.d.ts +2 -0
- package/dist/cli/__tests__/subcommand-json-flag.test.d.ts.map +1 -0
- package/dist/cli/__tests__/subcommand-json-flag.test.js +86 -0
- package/dist/cli/__tests__/subcommand-json-flag.test.js.map +1 -0
- package/dist/cli/__tests__/team-resume-v2.test.js +46 -0
- package/dist/cli/__tests__/team-resume-v2.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +24 -0
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/wait-teleport-json.test.js +2 -2
- package/dist/cli/__tests__/wait-teleport-json.test.js.map +1 -1
- package/dist/cli/commands/__tests__/factory-run-cli.test.js +20 -0
- package/dist/cli/commands/__tests__/factory-run-cli.test.js.map +1 -1
- package/dist/cli/commands/__tests__/release-cli.test.js +11 -0
- package/dist/cli/commands/__tests__/release-cli.test.js.map +1 -1
- package/dist/cli/commands/__tests__/ship-cli.test.js +1 -1
- package/dist/cli/commands/__tests__/ship-cli.test.js.map +1 -1
- package/dist/cli/commands/__tests__/teleport.test.js +42 -0
- package/dist/cli/commands/__tests__/teleport.test.js.map +1 -1
- package/dist/cli/commands/__tests__/wait.test.js +33 -1
- package/dist/cli/commands/__tests__/wait.test.js.map +1 -1
- package/dist/cli/commands/doctor-conflicts.d.ts.map +1 -1
- package/dist/cli/commands/doctor-conflicts.js +6 -2
- package/dist/cli/commands/doctor-conflicts.js.map +1 -1
- package/dist/cli/commands/factory-bench.d.ts.map +1 -1
- package/dist/cli/commands/factory-bench.js +17 -3
- package/dist/cli/commands/factory-bench.js.map +1 -1
- package/dist/cli/commands/factory-dashboard.d.ts +5 -1
- package/dist/cli/commands/factory-dashboard.d.ts.map +1 -1
- package/dist/cli/commands/factory-dashboard.js +6 -2
- package/dist/cli/commands/factory-dashboard.js.map +1 -1
- package/dist/cli/commands/factory.d.ts +6 -0
- package/dist/cli/commands/factory.d.ts.map +1 -1
- package/dist/cli/commands/factory.js +45 -4
- package/dist/cli/commands/factory.js.map +1 -1
- package/dist/cli/commands/ralph.d.ts +36 -1
- package/dist/cli/commands/ralph.d.ts.map +1 -1
- package/dist/cli/commands/ralph.js +298 -50
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/release.d.ts +3 -1
- package/dist/cli/commands/release.d.ts.map +1 -1
- package/dist/cli/commands/release.js +12 -3
- package/dist/cli/commands/release.js.map +1 -1
- package/dist/cli/commands/ship.d.ts.map +1 -1
- package/dist/cli/commands/ship.js +8 -4
- package/dist/cli/commands/ship.js.map +1 -1
- package/dist/cli/commands/team.d.ts.map +1 -1
- package/dist/cli/commands/team.js +2 -0
- package/dist/cli/commands/team.js.map +1 -1
- package/dist/cli/commands/teleport.d.ts.map +1 -1
- package/dist/cli/commands/teleport.js +6 -1
- package/dist/cli/commands/teleport.js.map +1 -1
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +3 -1
- package/dist/cli/commands/wait.js.map +1 -1
- package/dist/cli/index.js +8 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/interop.d.ts +4 -3
- package/dist/cli/interop.d.ts.map +1 -1
- package/dist/cli/interop.js +95 -4
- package/dist/cli/interop.js.map +1 -1
- package/dist/cli/launch.d.ts +17 -2
- package/dist/cli/launch.d.ts.map +1 -1
- package/dist/cli/launch.js +110 -12
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +4 -1
- package/dist/cli/team.js.map +1 -1
- package/dist/commands/index.js +1 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +17 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/copilot-run/job.d.ts +2 -0
- package/dist/copilot-run/job.d.ts.map +1 -1
- package/dist/copilot-run/job.js +3 -0
- package/dist/copilot-run/job.js.map +1 -1
- package/dist/copilot-run/sandbox.d.ts +16 -0
- package/dist/copilot-run/sandbox.d.ts.map +1 -1
- package/dist/copilot-run/sandbox.js +29 -2
- package/dist/copilot-run/sandbox.js.map +1 -1
- package/dist/factory/bench/__tests__/bench.units.test.js +133 -1
- package/dist/factory/bench/__tests__/bench.units.test.js.map +1 -1
- package/dist/factory/bench/score.d.ts +33 -1
- package/dist/factory/bench/score.d.ts.map +1 -1
- package/dist/factory/bench/score.js +95 -5
- package/dist/factory/bench/score.js.map +1 -1
- package/dist/factory/board/__tests__/board.test.js +31 -1
- package/dist/factory/board/__tests__/board.test.js.map +1 -1
- package/dist/factory/board/collect.d.ts +5 -2
- package/dist/factory/board/collect.d.ts.map +1 -1
- package/dist/factory/board/collect.js +7 -2
- package/dist/factory/board/collect.js.map +1 -1
- package/dist/factory/check/cli.d.ts.map +1 -1
- package/dist/factory/check/cli.js +6 -2
- package/dist/factory/check/cli.js.map +1 -1
- package/dist/factory/dashboard/__tests__/dashboard.test.js +10 -0
- package/dist/factory/dashboard/__tests__/dashboard.test.js.map +1 -1
- package/dist/factory/run/__tests__/auto-merge.test.js +2 -0
- package/dist/factory/run/__tests__/auto-merge.test.js.map +1 -1
- package/dist/factory/run/__tests__/claims.test.js +15 -0
- package/dist/factory/run/__tests__/claims.test.js.map +1 -1
- package/dist/factory/run/__tests__/container-gate.test.js +59 -1
- package/dist/factory/run/__tests__/container-gate.test.js.map +1 -1
- package/dist/factory/run/__tests__/engine-local-harness.d.ts.map +1 -1
- package/dist/factory/run/__tests__/engine-local-harness.js +6 -0
- package/dist/factory/run/__tests__/engine-local-harness.js.map +1 -1
- package/dist/factory/run/__tests__/engine-local-harness.test.d.ts +2 -0
- package/dist/factory/run/__tests__/engine-local-harness.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/engine-local-harness.test.js +23 -0
- package/dist/factory/run/__tests__/engine-local-harness.test.js.map +1 -0
- package/dist/factory/run/__tests__/engine.gates-git-transport.test.d.ts +2 -0
- package/dist/factory/run/__tests__/engine.gates-git-transport.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/engine.gates-git-transport.test.js +392 -0
- package/dist/factory/run/__tests__/engine.gates-git-transport.test.js.map +1 -0
- package/dist/factory/run/__tests__/engine.gates-test-delta.test.d.ts +2 -0
- package/dist/factory/run/__tests__/engine.gates-test-delta.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/engine.gates-test-delta.test.js +347 -0
- package/dist/factory/run/__tests__/engine.gates-test-delta.test.js.map +1 -0
- package/dist/factory/run/__tests__/engine.gates-tree-copy.test.d.ts +2 -0
- package/dist/factory/run/__tests__/engine.gates-tree-copy.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/engine.gates-tree-copy.test.js +235 -0
- package/dist/factory/run/__tests__/engine.gates-tree-copy.test.js.map +1 -0
- package/dist/factory/run/__tests__/engine.human-merged.test.d.ts +2 -0
- package/dist/factory/run/__tests__/engine.human-merged.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/engine.human-merged.test.js +171 -0
- package/dist/factory/run/__tests__/engine.human-merged.test.js.map +1 -0
- package/dist/factory/run/__tests__/engine.local.conflict-reprepare.test.d.ts +2 -0
- package/dist/factory/run/__tests__/engine.local.conflict-reprepare.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/engine.local.conflict-reprepare.test.js +56 -0
- package/dist/factory/run/__tests__/engine.local.conflict-reprepare.test.js.map +1 -0
- package/dist/factory/run/__tests__/engine.local.human-merged.test.d.ts +2 -0
- package/dist/factory/run/__tests__/engine.local.human-merged.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/engine.local.human-merged.test.js +48 -0
- package/dist/factory/run/__tests__/engine.local.human-merged.test.js.map +1 -0
- package/dist/factory/run/__tests__/engine.stall.test.d.ts +2 -0
- package/dist/factory/run/__tests__/engine.stall.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/engine.stall.test.js +137 -0
- package/dist/factory/run/__tests__/engine.stall.test.js.map +1 -0
- package/dist/factory/run/__tests__/fake-lanes.d.ts +6 -0
- package/dist/factory/run/__tests__/fake-lanes.d.ts.map +1 -1
- package/dist/factory/run/__tests__/fake-lanes.js +17 -1
- package/dist/factory/run/__tests__/fake-lanes.js.map +1 -1
- package/dist/factory/run/__tests__/human-merged.test.d.ts +2 -0
- package/dist/factory/run/__tests__/human-merged.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/human-merged.test.js +301 -0
- package/dist/factory/run/__tests__/human-merged.test.js.map +1 -0
- package/dist/factory/run/__tests__/lane.test.js +2 -0
- package/dist/factory/run/__tests__/lane.test.js.map +1 -1
- package/dist/factory/run/__tests__/merge-policy.test.js +16 -0
- package/dist/factory/run/__tests__/merge-policy.test.js.map +1 -1
- package/dist/factory/run/__tests__/prepare-gates.conflict-reprepare.test.d.ts +2 -0
- package/dist/factory/run/__tests__/prepare-gates.conflict-reprepare.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/prepare-gates.conflict-reprepare.test.js +137 -0
- package/dist/factory/run/__tests__/prepare-gates.conflict-reprepare.test.js.map +1 -0
- package/dist/factory/run/__tests__/prepare-gates.crash.test.js +21 -0
- package/dist/factory/run/__tests__/prepare-gates.crash.test.js.map +1 -1
- package/dist/factory/run/__tests__/prepare-gates.gates-resume.test.js +11 -0
- package/dist/factory/run/__tests__/prepare-gates.gates-resume.test.js.map +1 -1
- package/dist/factory/run/__tests__/prepare-gates.test.js +39 -0
- package/dist/factory/run/__tests__/prepare-gates.test.js.map +1 -1
- package/dist/factory/run/__tests__/private-store.test.js +22 -1
- package/dist/factory/run/__tests__/private-store.test.js.map +1 -1
- package/dist/factory/run/__tests__/test-delta.test.d.ts +2 -0
- package/dist/factory/run/__tests__/test-delta.test.d.ts.map +1 -0
- package/dist/factory/run/__tests__/test-delta.test.js +239 -0
- package/dist/factory/run/__tests__/test-delta.test.js.map +1 -0
- package/dist/factory/run/__tests__/units.test.js +219 -2
- package/dist/factory/run/__tests__/units.test.js.map +1 -1
- package/dist/factory/run/__tests__/workspace-tree.test.js +16 -4
- package/dist/factory/run/__tests__/workspace-tree.test.js.map +1 -1
- package/dist/factory/run/auto-merge.d.ts +4 -0
- package/dist/factory/run/auto-merge.d.ts.map +1 -1
- package/dist/factory/run/auto-merge.js +3 -0
- package/dist/factory/run/auto-merge.js.map +1 -1
- package/dist/factory/run/budget.d.ts +6 -0
- package/dist/factory/run/budget.d.ts.map +1 -1
- package/dist/factory/run/budget.js +5 -0
- package/dist/factory/run/budget.js.map +1 -1
- package/dist/factory/run/claims.d.ts.map +1 -1
- package/dist/factory/run/claims.js +5 -3
- package/dist/factory/run/claims.js.map +1 -1
- package/dist/factory/run/container-gate.d.ts +14 -1
- package/dist/factory/run/container-gate.d.ts.map +1 -1
- package/dist/factory/run/container-gate.js +42 -4
- package/dist/factory/run/container-gate.js.map +1 -1
- package/dist/factory/run/engine.d.ts +46 -1
- package/dist/factory/run/engine.d.ts.map +1 -1
- package/dist/factory/run/engine.js +779 -68
- package/dist/factory/run/engine.js.map +1 -1
- package/dist/factory/run/human-merged.d.ts +105 -0
- package/dist/factory/run/human-merged.d.ts.map +1 -0
- package/dist/factory/run/human-merged.js +256 -0
- package/dist/factory/run/human-merged.js.map +1 -0
- package/dist/factory/run/lane.d.ts +2 -0
- package/dist/factory/run/lane.d.ts.map +1 -1
- package/dist/factory/run/lane.js +1 -0
- package/dist/factory/run/lane.js.map +1 -1
- package/dist/factory/run/merge-policy.d.ts +1 -2
- package/dist/factory/run/merge-policy.d.ts.map +1 -1
- package/dist/factory/run/merge-policy.js +5 -12
- package/dist/factory/run/merge-policy.js.map +1 -1
- package/dist/factory/run/prepare.d.ts +40 -1
- package/dist/factory/run/prepare.d.ts.map +1 -1
- package/dist/factory/run/prepare.js +240 -38
- package/dist/factory/run/prepare.js.map +1 -1
- package/dist/factory/run/private-run.d.ts +2 -1
- package/dist/factory/run/private-run.d.ts.map +1 -1
- package/dist/factory/run/private-run.js +5 -2
- package/dist/factory/run/private-run.js.map +1 -1
- package/dist/factory/run/prompts.d.ts +2 -2
- package/dist/factory/run/prompts.d.ts.map +1 -1
- package/dist/factory/run/prompts.js +7 -6
- package/dist/factory/run/prompts.js.map +1 -1
- package/dist/factory/run/sandbox-exec.d.ts +9 -1
- package/dist/factory/run/sandbox-exec.d.ts.map +1 -1
- package/dist/factory/run/sandbox-exec.js.map +1 -1
- package/dist/factory/run/state.d.ts +54 -1
- package/dist/factory/run/state.d.ts.map +1 -1
- package/dist/factory/run/state.js +23 -2
- package/dist/factory/run/state.js.map +1 -1
- package/dist/factory/run/test-delta.d.ts +123 -0
- package/dist/factory/run/test-delta.d.ts.map +1 -0
- package/dist/factory/run/test-delta.js +236 -0
- package/dist/factory/run/test-delta.js.map +1 -0
- package/dist/features/__tests__/checkpoint.test.js +118 -1
- package/dist/features/__tests__/checkpoint.test.js.map +1 -1
- package/dist/features/__tests__/jev-model-routing.test.js +20 -2
- package/dist/features/__tests__/jev-model-routing.test.js.map +1 -1
- package/dist/features/__tests__/jev-slop-warning.test.js +22 -2
- package/dist/features/__tests__/jev-slop-warning.test.js.map +1 -1
- package/dist/features/checkpoint/index.d.ts.map +1 -1
- package/dist/features/checkpoint/index.js +25 -8
- package/dist/features/checkpoint/index.js.map +1 -1
- package/dist/features/jev-slop-warning.d.ts +3 -2
- package/dist/features/jev-slop-warning.d.ts.map +1 -1
- package/dist/features/jev-slop-warning.js +5 -3
- package/dist/features/jev-slop-warning.js.map +1 -1
- package/dist/features/rate-limit-wait/daemon.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/daemon.js +55 -9
- package/dist/features/rate-limit-wait/daemon.js.map +1 -1
- package/dist/features/rate-limit-wait/tmux-detector.d.ts +33 -0
- package/dist/features/rate-limit-wait/tmux-detector.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/tmux-detector.js +156 -0
- package/dist/features/rate-limit-wait/tmux-detector.js.map +1 -1
- package/dist/forge/__tests__/gh-argv-baseline.factory.test.js +4 -2
- package/dist/forge/__tests__/gh-argv-baseline.factory.test.js.map +1 -1
- package/dist/forge/ado/__tests__/adapter.test.js +7 -0
- package/dist/forge/ado/__tests__/adapter.test.js.map +1 -1
- package/dist/forge/ado/reviews.d.ts.map +1 -1
- package/dist/forge/ado/reviews.js +6 -0
- package/dist/forge/ado/reviews.js.map +1 -1
- package/dist/forge/github/__tests__/mergeability.test.d.ts +2 -0
- package/dist/forge/github/__tests__/mergeability.test.d.ts.map +1 -0
- package/dist/forge/github/__tests__/mergeability.test.js +34 -0
- package/dist/forge/github/__tests__/mergeability.test.js.map +1 -0
- package/dist/forge/github/reviews.d.ts +7 -1
- package/dist/forge/github/reviews.d.ts.map +1 -1
- package/dist/forge/github/reviews.js +13 -0
- package/dist/forge/github/reviews.js.map +1 -1
- package/dist/forge/local/__tests__/mirror.test.js +3 -1
- package/dist/forge/local/__tests__/mirror.test.js.map +1 -1
- package/dist/forge/local/__tests__/reviews.test.js +19 -0
- package/dist/forge/local/__tests__/reviews.test.js.map +1 -1
- package/dist/forge/local/mirror.d.ts +2 -0
- package/dist/forge/local/mirror.d.ts.map +1 -1
- package/dist/forge/local/mirror.js +2 -0
- package/dist/forge/local/mirror.js.map +1 -1
- package/dist/forge/local/reviews.d.ts.map +1 -1
- package/dist/forge/local/reviews.js +12 -1
- package/dist/forge/local/reviews.js.map +1 -1
- package/dist/forge/types.d.ts +13 -0
- package/dist/forge/types.d.ts.map +1 -1
- package/dist/graph/schema.d.ts +10 -10
- package/dist/hooks/__tests__/precompact-restore.test.js +38 -0
- package/dist/hooks/__tests__/precompact-restore.test.js.map +1 -1
- package/dist/hooks/__tests__/workflow-drift-guard-script.test.js +7 -2
- package/dist/hooks/__tests__/workflow-drift-guard-script.test.js.map +1 -1
- package/dist/hooks/auto-slash-command/executor.js +1 -1
- package/dist/hooks/auto-slash-command/executor.js.map +1 -1
- package/dist/hooks/code-simplifier/__tests__/jev-trigger-shadow.test.js +24 -2
- package/dist/hooks/code-simplifier/__tests__/jev-trigger-shadow.test.js.map +1 -1
- package/dist/hooks/code-simplifier/jev-shadow.d.ts.map +1 -1
- package/dist/hooks/code-simplifier/jev-shadow.js +6 -4
- package/dist/hooks/code-simplifier/jev-shadow.js.map +1 -1
- package/dist/hooks/jev/__tests__/client.test.js +20 -1
- package/dist/hooks/jev/__tests__/client.test.js.map +1 -1
- package/dist/hooks/jev/__tests__/log-context.test.d.ts +2 -0
- package/dist/hooks/jev/__tests__/log-context.test.d.ts.map +1 -0
- package/dist/hooks/jev/__tests__/log-context.test.js +97 -0
- package/dist/hooks/jev/__tests__/log-context.test.js.map +1 -0
- package/dist/hooks/jev/__tests__/log-rotation.test.d.ts +2 -0
- package/dist/hooks/jev/__tests__/log-rotation.test.d.ts.map +1 -0
- package/dist/hooks/jev/__tests__/log-rotation.test.js +148 -0
- package/dist/hooks/jev/__tests__/log-rotation.test.js.map +1 -0
- package/dist/hooks/jev/__tests__/resolver-request-count.test.d.ts +2 -0
- package/dist/hooks/jev/__tests__/resolver-request-count.test.d.ts.map +1 -0
- package/dist/hooks/jev/__tests__/resolver-request-count.test.js +117 -0
- package/dist/hooks/jev/__tests__/resolver-request-count.test.js.map +1 -0
- package/dist/hooks/jev/__tests__/resolver.test.js +63 -1
- package/dist/hooks/jev/__tests__/resolver.test.js.map +1 -1
- package/dist/hooks/jev/__tests__/shared-breaker.test.d.ts +2 -0
- package/dist/hooks/jev/__tests__/shared-breaker.test.d.ts.map +1 -0
- package/dist/hooks/jev/__tests__/shared-breaker.test.js +294 -0
- package/dist/hooks/jev/__tests__/shared-breaker.test.js.map +1 -0
- package/dist/hooks/jev/__tests__/state-omit-ids.test.d.ts +2 -0
- package/dist/hooks/jev/__tests__/state-omit-ids.test.d.ts.map +1 -0
- package/dist/hooks/jev/__tests__/state-omit-ids.test.js +88 -0
- package/dist/hooks/jev/__tests__/state-omit-ids.test.js.map +1 -0
- package/dist/hooks/jev/client.d.ts +34 -2
- package/dist/hooks/jev/client.d.ts.map +1 -1
- package/dist/hooks/jev/client.js +80 -5
- package/dist/hooks/jev/client.js.map +1 -1
- package/dist/hooks/jev/config.d.ts +78 -4
- package/dist/hooks/jev/config.d.ts.map +1 -1
- package/dist/hooks/jev/config.js +123 -9
- package/dist/hooks/jev/config.js.map +1 -1
- package/dist/hooks/jev/points.d.ts +2 -0
- package/dist/hooks/jev/points.d.ts.map +1 -1
- package/dist/hooks/jev/points.js +41 -10
- package/dist/hooks/jev/points.js.map +1 -1
- package/dist/hooks/jev/resolver.d.ts +27 -2
- package/dist/hooks/jev/resolver.d.ts.map +1 -1
- package/dist/hooks/jev/resolver.js +176 -20
- package/dist/hooks/jev/resolver.js.map +1 -1
- package/dist/hooks/jev/types.d.ts +21 -4
- package/dist/hooks/jev/types.d.ts.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/autopilot-command-parity.test.d.ts +2 -0
- package/dist/hooks/keyword-detector/__tests__/autopilot-command-parity.test.d.ts.map +1 -0
- package/dist/hooks/keyword-detector/__tests__/autopilot-command-parity.test.js +209 -0
- package/dist/hooks/keyword-detector/__tests__/autopilot-command-parity.test.js.map +1 -0
- package/dist/hooks/keyword-detector/__tests__/index.test.js +6 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/jev-shadow.test.js +15 -0
- package/dist/hooks/keyword-detector/__tests__/jev-shadow.test.js.map +1 -1
- package/dist/hooks/keyword-detector/index.d.ts.map +1 -1
- package/dist/hooks/keyword-detector/index.js +200 -2
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/keyword-detector/jev-shadow.js +3 -3
- package/dist/hooks/keyword-detector/jev-shadow.js.map +1 -1
- package/dist/hooks/learner/__tests__/jev-extraction-shadow.test.js +20 -1
- package/dist/hooks/learner/__tests__/jev-extraction-shadow.test.js.map +1 -1
- package/dist/hooks/learner/jev-shadow.js +3 -3
- package/dist/hooks/learner/jev-shadow.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/architect-approval-transcript.test.d.ts +2 -0
- package/dist/hooks/persistent-mode/__tests__/architect-approval-transcript.test.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/architect-approval-transcript.test.js +280 -0
- package/dist/hooks/persistent-mode/__tests__/architect-approval-transcript.test.js.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/error-handling.test.js +2 -2
- package/dist/hooks/persistent-mode/__tests__/error-handling.test.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/jev-loop-continuation-shadow.test.js +47 -1
- package/dist/hooks/persistent-mode/__tests__/jev-loop-continuation-shadow.test.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +136 -40
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/jev-shadow.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/jev-shadow.js +11 -7
- package/dist/hooks/persistent-mode/jev-shadow.js.map +1 -1
- package/dist/hooks/pre-compact/index.d.ts.map +1 -1
- package/dist/hooks/pre-compact/index.js +8 -5
- package/dist/hooks/pre-compact/index.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/rescan-concurrency.test.d.ts +11 -0
- package/dist/hooks/project-memory/__tests__/rescan-concurrency.test.d.ts.map +1 -0
- package/dist/hooks/project-memory/__tests__/rescan-concurrency.test.js +227 -0
- package/dist/hooks/project-memory/__tests__/rescan-concurrency.test.js.map +1 -0
- package/dist/hooks/project-memory/index.d.ts.map +1 -1
- package/dist/hooks/project-memory/index.js +26 -6
- package/dist/hooks/project-memory/index.js.map +1 -1
- package/dist/hooks/ralph/__tests__/closeout.test.d.ts +2 -0
- package/dist/hooks/ralph/__tests__/closeout.test.d.ts.map +1 -0
- package/dist/hooks/ralph/__tests__/closeout.test.js +82 -0
- package/dist/hooks/ralph/__tests__/closeout.test.js.map +1 -0
- package/dist/hooks/ralph/__tests__/feedback-baseline.test.js +572 -4
- package/dist/hooks/ralph/__tests__/feedback-baseline.test.js.map +1 -1
- package/dist/hooks/ralph/__tests__/jev-verdict-shadow.test.js +23 -2
- package/dist/hooks/ralph/__tests__/jev-verdict-shadow.test.js.map +1 -1
- package/dist/hooks/ralph/closeout.d.ts +34 -0
- package/dist/hooks/ralph/closeout.d.ts.map +1 -0
- package/dist/hooks/ralph/closeout.js +66 -0
- package/dist/hooks/ralph/closeout.js.map +1 -0
- package/dist/hooks/ralph/feedback-baseline.d.ts +60 -6
- package/dist/hooks/ralph/feedback-baseline.d.ts.map +1 -1
- package/dist/hooks/ralph/feedback-baseline.js +302 -15
- package/dist/hooks/ralph/feedback-baseline.js.map +1 -1
- package/dist/hooks/ralph/index.d.ts +1 -1
- package/dist/hooks/ralph/index.d.ts.map +1 -1
- package/dist/hooks/ralph/index.js +1 -1
- package/dist/hooks/ralph/index.js.map +1 -1
- package/dist/hooks/ralph/jev-shadow.js +3 -3
- package/dist/hooks/ralph/jev-shadow.js.map +1 -1
- package/dist/hooks/ralph/verifier.d.ts +5 -0
- package/dist/hooks/ralph/verifier.d.ts.map +1 -1
- package/dist/hooks/ralph/verifier.js +21 -10
- package/dist/hooks/ralph/verifier.js.map +1 -1
- package/dist/hooks/registry/__tests__/registry.test.js +6 -0
- package/dist/hooks/registry/__tests__/registry.test.js.map +1 -1
- package/dist/hooks/registry/registry.d.ts +6 -2
- package/dist/hooks/registry/registry.d.ts.map +1 -1
- package/dist/hooks/registry/registry.js +21 -6
- package/dist/hooks/registry/registry.js.map +1 -1
- package/dist/hooks/registry/types.d.ts +2 -0
- package/dist/hooks/registry/types.d.ts.map +1 -1
- package/dist/hooks/session-end/__tests__/callbacks.test.js +10 -1
- package/dist/hooks/session-end/__tests__/callbacks.test.js.map +1 -1
- package/dist/hooks/session-end/__tests__/worker.test.js +111 -2
- package/dist/hooks/session-end/__tests__/worker.test.js.map +1 -1
- package/dist/hooks/session-end/callbacks.js +1 -1
- package/dist/hooks/session-end/callbacks.js.map +1 -1
- package/dist/hooks/session-end/cleanup-manifest.d.ts +2 -0
- package/dist/hooks/session-end/cleanup-manifest.d.ts.map +1 -1
- package/dist/hooks/session-end/cleanup-manifest.js +8 -0
- package/dist/hooks/session-end/cleanup-manifest.js.map +1 -1
- package/dist/hooks/session-end/index.d.ts.map +1 -1
- package/dist/hooks/session-end/index.js +21 -3
- package/dist/hooks/session-end/index.js.map +1 -1
- package/dist/hooks/session-end/worker.d.ts.map +1 -1
- package/dist/hooks/session-end/worker.js +32 -2
- package/dist/hooks/session-end/worker.js.map +1 -1
- package/dist/hooks/setup/__tests__/windows-patch.test.js +89 -17
- package/dist/hooks/setup/__tests__/windows-patch.test.js.map +1 -1
- package/dist/hooks/setup/index.d.ts +10 -21
- package/dist/hooks/setup/index.d.ts.map +1 -1
- package/dist/hooks/setup/index.js +14 -48
- package/dist/hooks/setup/index.js.map +1 -1
- package/dist/hooks/task-size-detector/__tests__/jev-shadow.test.js +2 -1
- package/dist/hooks/task-size-detector/__tests__/jev-shadow.test.js.map +1 -1
- package/dist/hud/omc-state.d.ts +8 -0
- package/dist/hud/omc-state.d.ts.map +1 -1
- package/dist/hud/omc-state.js +23 -2
- package/dist/hud/omc-state.js.map +1 -1
- package/dist/installer/__tests__/claude-mcp-config-path.test.d.ts +2 -0
- package/dist/installer/__tests__/claude-mcp-config-path.test.d.ts.map +1 -0
- package/dist/installer/__tests__/claude-mcp-config-path.test.js +323 -0
- package/dist/installer/__tests__/claude-mcp-config-path.test.js.map +1 -0
- package/dist/installer/__tests__/mcp-registry.test.js +81 -3
- package/dist/installer/__tests__/mcp-registry.test.js.map +1 -1
- package/dist/installer/__tests__/standalone-hook-reconcile.test.js +36 -0
- package/dist/installer/__tests__/standalone-hook-reconcile.test.js.map +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +16 -4
- package/dist/installer/index.js.map +1 -1
- package/dist/installer/mcp-registry.d.ts +21 -1
- package/dist/installer/mcp-registry.d.ts.map +1 -1
- package/dist/installer/mcp-registry.js +101 -20
- package/dist/installer/mcp-registry.js.map +1 -1
- package/dist/lib/atomic-write.d.ts.map +1 -1
- package/dist/lib/atomic-write.js +61 -2
- package/dist/lib/atomic-write.js.map +1 -1
- package/dist/lib/one-line.d.ts +3 -0
- package/dist/lib/one-line.d.ts.map +1 -0
- package/dist/lib/one-line.js +5 -0
- package/dist/lib/one-line.js.map +1 -0
- package/dist/mcp/__tests__/team-cleanup.test.js +13 -0
- package/dist/mcp/__tests__/team-cleanup.test.js.map +1 -1
- package/dist/mcp/team-job-convergence.d.ts.map +1 -1
- package/dist/mcp/team-job-convergence.js +4 -1
- package/dist/mcp/team-job-convergence.js.map +1 -1
- package/dist/mcp/team-server.js +2 -2
- package/dist/mcp/team-server.js.map +1 -1
- package/dist/notifications/__tests__/approval-reply.test.js +8 -0
- package/dist/notifications/__tests__/approval-reply.test.js.map +1 -1
- package/dist/notifications/__tests__/reply-herdr.test.d.ts +8 -0
- package/dist/notifications/__tests__/reply-herdr.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/reply-herdr.test.js +125 -0
- package/dist/notifications/__tests__/reply-herdr.test.js.map +1 -0
- package/dist/notifications/__tests__/tmux.test.js +56 -1
- package/dist/notifications/__tests__/tmux.test.js.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +22 -7
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/reply-listener.d.ts +28 -12
- package/dist/notifications/reply-listener.d.ts.map +1 -1
- package/dist/notifications/reply-listener.js +326 -172
- package/dist/notifications/reply-listener.js.map +1 -1
- package/dist/notifications/tmux.d.ts +22 -2
- package/dist/notifications/tmux.d.ts.map +1 -1
- package/dist/notifications/tmux.js +57 -2
- package/dist/notifications/tmux.js.map +1 -1
- package/dist/release/__tests__/engine.test.js +74 -2
- package/dist/release/__tests__/engine.test.js.map +1 -1
- package/dist/release/engine.d.ts +9 -1
- package/dist/release/engine.d.ts.map +1 -1
- package/dist/release/engine.js +41 -4
- package/dist/release/engine.js.map +1 -1
- package/dist/shared/types.d.ts +5 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/ship/__tests__/check-name.test.d.ts +2 -0
- package/dist/ship/__tests__/check-name.test.d.ts.map +1 -0
- package/dist/ship/__tests__/check-name.test.js +17 -0
- package/dist/ship/__tests__/check-name.test.js.map +1 -0
- package/dist/ship/__tests__/gates-settle.test.js +13 -1
- package/dist/ship/__tests__/gates-settle.test.js.map +1 -1
- package/dist/ship/__tests__/prepare-build.test.d.ts +2 -0
- package/dist/ship/__tests__/prepare-build.test.d.ts.map +1 -0
- package/dist/ship/__tests__/prepare-build.test.js +287 -0
- package/dist/ship/__tests__/prepare-build.test.js.map +1 -0
- package/dist/ship/__tests__/prepare-merge.test.js +8 -1
- package/dist/ship/__tests__/prepare-merge.test.js.map +1 -1
- package/dist/ship/__tests__/safety-state.test.js +4 -0
- package/dist/ship/__tests__/safety-state.test.js.map +1 -1
- package/dist/ship/check-name.d.ts +12 -0
- package/dist/ship/check-name.d.ts.map +1 -0
- package/dist/ship/check-name.js +13 -0
- package/dist/ship/check-name.js.map +1 -0
- package/dist/ship/config.d.ts +13 -0
- package/dist/ship/config.d.ts.map +1 -1
- package/dist/ship/config.js +18 -1
- package/dist/ship/config.js.map +1 -1
- package/dist/ship/exec.d.ts +8 -0
- package/dist/ship/exec.d.ts.map +1 -1
- package/dist/ship/exec.js +33 -5
- package/dist/ship/exec.js.map +1 -1
- package/dist/ship/gates.d.ts.map +1 -1
- package/dist/ship/gates.js +3 -2
- package/dist/ship/gates.js.map +1 -1
- package/dist/ship/merge.d.ts +11 -2
- package/dist/ship/merge.d.ts.map +1 -1
- package/dist/ship/merge.js +55 -10
- package/dist/ship/merge.js.map +1 -1
- package/dist/ship/prepare.d.ts +16 -4
- package/dist/ship/prepare.d.ts.map +1 -1
- package/dist/ship/prepare.js +108 -2
- package/dist/ship/prepare.js.map +1 -1
- package/dist/team/__tests__/herdr-session-realherdr.test.d.ts +9 -0
- package/dist/team/__tests__/herdr-session-realherdr.test.d.ts.map +1 -0
- package/dist/team/__tests__/herdr-session-realherdr.test.js +140 -0
- package/dist/team/__tests__/herdr-session-realherdr.test.js.map +1 -0
- package/dist/team/__tests__/herdr-session.test.d.ts +9 -0
- package/dist/team/__tests__/herdr-session.test.d.ts.map +1 -0
- package/dist/team/__tests__/herdr-session.test.js +270 -0
- package/dist/team/__tests__/herdr-session.test.js.map +1 -0
- package/dist/team/__tests__/idle-nudge.test.js +17 -0
- package/dist/team/__tests__/idle-nudge.test.js.map +1 -1
- package/dist/team/__tests__/mailbox-notification-guard.test.js +403 -181
- package/dist/team/__tests__/mailbox-notification-guard.test.js.map +1 -1
- package/dist/team/__tests__/scaling-launch-config.test.js +12 -0
- package/dist/team/__tests__/scaling-launch-config.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +12 -0
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/task-claim-renewal.test.d.ts +2 -0
- package/dist/team/__tests__/task-claim-renewal.test.d.ts.map +1 -0
- package/dist/team/__tests__/task-claim-renewal.test.js +421 -0
- package/dist/team/__tests__/task-claim-renewal.test.js.map +1 -0
- package/dist/team/__tests__/task-storage-integrity.test.js +34 -0
- package/dist/team/__tests__/task-storage-integrity.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.create-team-herdr.test.d.ts +11 -0
- package/dist/team/__tests__/tmux-session.create-team-herdr.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-session.create-team-herdr.test.js +99 -0
- package/dist/team/__tests__/tmux-session.create-team-herdr.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session.herdr-arms.test.d.ts +10 -0
- package/dist/team/__tests__/tmux-session.herdr-arms.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-session.herdr-arms.test.js +226 -0
- package/dist/team/__tests__/tmux-session.herdr-arms.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session.test.js +888 -721
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +19 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/api-interop.d.ts +1 -1
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +13 -1
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/herdr-session.d.ts +267 -0
- package/dist/team/herdr-session.d.ts.map +1 -0
- package/dist/team/herdr-session.js +508 -0
- package/dist/team/herdr-session.js.map +1 -0
- package/dist/team/idle-nudge.d.ts +1 -1
- package/dist/team/idle-nudge.d.ts.map +1 -1
- package/dist/team/idle-nudge.js +4 -4
- package/dist/team/idle-nudge.js.map +1 -1
- package/dist/team/mailbox-notification-guard.d.ts +24 -19
- package/dist/team/mailbox-notification-guard.d.ts.map +1 -1
- package/dist/team/mailbox-notification-guard.js +241 -148
- package/dist/team/mailbox-notification-guard.js.map +1 -1
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +1 -0
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/runtime-v2.d.ts +33 -33
- package/dist/team/runtime-v2.d.ts.map +1 -1
- package/dist/team/runtime-v2.js +2810 -1591
- package/dist/team/runtime-v2.js.map +1 -1
- package/dist/team/scaling.d.ts +3 -3
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +766 -402
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/tasks.d.ts +15 -1
- package/dist/team/state/tasks.d.ts.map +1 -1
- package/dist/team/state/tasks.js +56 -2
- package/dist/team/state/tasks.js.map +1 -1
- package/dist/team/team-ops.d.ts +3 -2
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js +32 -5
- package/dist/team/team-ops.js.map +1 -1
- package/dist/team/tmux-session.d.ts +66 -40
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +1733 -1096
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/types.d.ts +8 -0
- package/dist/team/types.d.ts.map +1 -1
- package/dist/team/types.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +3 -0
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/tools/lsp/__tests__/devcontainer.test.js +39 -5
- package/dist/tools/lsp/__tests__/devcontainer.test.js.map +1 -1
- package/dist/tools/lsp/devcontainer.d.ts.map +1 -1
- package/dist/tools/lsp/devcontainer.js +25 -8
- package/dist/tools/lsp/devcontainer.js.map +1 -1
- package/dist/utils/__tests__/windows-search.test.js +17 -3
- package/dist/utils/__tests__/windows-search.test.js.map +1 -1
- package/dist/utils/plugin-cache-validation.d.ts.map +1 -1
- package/dist/utils/plugin-cache-validation.js +27 -18
- package/dist/utils/plugin-cache-validation.js.map +1 -1
- package/dist/workflow/__tests__/projections.test.js +3 -3
- package/dist/workflow/__tests__/projections.test.js.map +1 -1
- package/dist/workflow/__tests__/registry.test.js +3 -3
- package/dist/workflow/__tests__/registry.test.js.map +1 -1
- package/dist/workflow/registry.d.ts.map +1 -1
- package/dist/workflow/registry.js +1 -0
- package/dist/workflow/registry.js.map +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLAUDE.md +1 -1
- package/docs/CREDITS.md +1 -0
- package/docs/FEATURES.md +18 -0
- package/docs/FIELD-TESTING.md +10 -0
- package/docs/HOOKS.md +339 -36
- package/docs/REFERENCE.md +82 -17
- package/docs/TEAM-MULTIPLEXER.md +107 -0
- package/hooks/hooks.json +204 -66
- package/hooks/jev-compaction.mjs +2404 -0
- package/package.json +2 -2
- package/plugin.json +1 -1
- package/scripts/check-omc-playbooks.mjs +214 -124
- package/scripts/code-simplifier.mjs +26 -3
- package/scripts/copilot/build-hooks.mjs +24 -7
- package/scripts/generate-inventory-graph.mjs +77 -92
- package/scripts/jev-eval.mjs +123 -22
- package/scripts/jev-repair-transcript.mjs +331 -0
- package/scripts/jev-resolve.mjs +374 -22
- package/scripts/keyword-detector.mjs +427 -29
- package/scripts/lib/hook-command-normalizer.d.mts +33 -0
- package/scripts/lib/hook-command-normalizer.mjs +157 -60
- package/scripts/lib/jev-breaker.d.mts +73 -0
- package/scripts/lib/jev-breaker.mjs +830 -0
- package/scripts/lib/jev-compaction-state.mjs +320 -0
- package/scripts/lib/jev-delivery-guard.mjs +567 -0
- package/scripts/lib/jev-mask.mjs +36 -0
- package/scripts/lib/jev-shadow.mjs +363 -14
- package/scripts/lib/shell-checks.mjs +1121 -0
- package/scripts/lib/state-root.cjs +19 -8
- package/scripts/lib/state-root.mjs +19 -8
- package/scripts/persistent-mode.cjs +289 -1
- package/scripts/persistent-mode.mjs +540 -91
- package/scripts/plugin-setup.mjs +26 -30
- package/scripts/plugin-shipping-surface.mjs +4 -1
- package/scripts/post-tool-use-failure.mjs +18 -0
- package/scripts/post-tool-verifier.mjs +49 -3
- package/scripts/pre-tool-enforcer.mjs +658 -64
- package/scripts/run.cjs +4 -2
- package/scripts/session-start.mjs +54 -0
- package/skills/AGENTS.md +1 -0
- package/skills/ai-slop-cleaner/SKILL.md +14 -0
- package/skills/arena/SKILL.md +8 -1
- package/skills/babysit/SKILL.md +2 -1
- package/skills/create-formal-verification-skill/SKILL.md +6 -4
- package/skills/figure-it-out/SKILL.md +5 -0
- package/skills/fix-ci/SKILL.md +3 -1
- package/skills/how/references/explainer-prompt.md +7 -4
- package/skills/interrogate/SKILL.md +10 -6
- package/skills/ralph/SKILL.md +27 -2
- package/skills/ralph-experiment/SKILL.md +1 -1
- package/skills/sdd/SKILL.md +67 -0
- package/skills/sdd/phases/criteria.md +144 -0
- package/skills/sdd/phases/execute.md +226 -0
- package/skills/sdd/phases/review.md +216 -0
- package/skills/sdd/phases/rules.md +195 -0
- package/skills/sdd/phases/spec.md +75 -0
- package/skills/sdd/phases/tasks.md +162 -0
- package/skills/statechart/scripts/run.ts +6 -3
- package/skills/statechart/scripts/test/child-env.test.ts +53 -0
- package/templates/hooks/keyword-detector.mjs +172 -5
- package/templates/hooks/lib/state-root.mjs +19 -8
- package/templates/hooks/persistent-mode.mjs +296 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closeout.test.js","sourceRoot":"","sources":["../../../../src/hooks/ralph/__tests__/closeout.test.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import { spawn } from 'child_process';
|
|
3
|
+
import { chmodSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'fs';
|
|
3
4
|
import { tmpdir } from 'os';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import {
|
|
5
|
+
import { dirname, join, resolve } from 'path';
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
7
|
+
import { baselinePath, diffAgainstBaseline, FEEDBACK_BASELINE_HISTORY_DIRNAME, MAX_FEEDBACK_BASELINE_HISTORY, readBaseline, recordBaseline, signatureLines, writeBaseline, } from '../feedback-baseline.js';
|
|
8
|
+
// chmod-based failure injection does not restrict UID 0, so those tests would
|
|
9
|
+
// assert failure against a write that actually succeeds under root.
|
|
10
|
+
const isRoot = typeof process.getuid === 'function' && process.getuid() === 0;
|
|
11
|
+
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../../../..');
|
|
6
12
|
function baseline(commands) {
|
|
7
13
|
return { version: 1, recordedAt: '2026-09-30T00:00:00.000Z', commands };
|
|
8
14
|
}
|
|
@@ -84,10 +90,39 @@ describe('diffAgainstBaseline', () => {
|
|
|
84
90
|
expect(diff.newSignatures).toEqual([]);
|
|
85
91
|
expect(diff.resolvedSignatures).toEqual(['test: FAIL env-specific']);
|
|
86
92
|
});
|
|
93
|
+
it('flags a command that used to exit 0 and now exits nonzero, even with no signatures', () => {
|
|
94
|
+
const diff = diffAgainstBaseline(baseline({ test: { signatures: [], exitCode: 0 } }), { test: { signatures: [], exitCode: 1 } });
|
|
95
|
+
expect(diff.newSignatures).toEqual(['test: <exited with code 1>']);
|
|
96
|
+
});
|
|
97
|
+
it('does not re-flag a nonzero exit that was already the baseline state', () => {
|
|
98
|
+
const diff = diffAgainstBaseline(baseline({ test: { signatures: ['FAIL a'], exitCode: 1 } }), { test: { signatures: ['FAIL a'], exitCode: 1 } });
|
|
99
|
+
expect(diff.newSignatures).toEqual([]);
|
|
100
|
+
});
|
|
101
|
+
it('reports a recovery from nonzero to zero as resolved', () => {
|
|
102
|
+
const diff = diffAgainstBaseline(baseline({ test: { signatures: [], exitCode: 2 } }), { test: { signatures: [], exitCode: 0 } });
|
|
103
|
+
expect(diff.newSignatures).toEqual([]);
|
|
104
|
+
expect(diff.resolvedSignatures).toEqual(['test: <no longer exits with code 2>']);
|
|
105
|
+
});
|
|
106
|
+
it('treats a baseline without exitCode as success for the transition check', () => {
|
|
107
|
+
const diff = diffAgainstBaseline(baseline({ test: { signatures: [] } }), { test: { signatures: [], exitCode: 1 } });
|
|
108
|
+
expect(diff.newSignatures).toEqual(['test: <exited with code 1>']);
|
|
109
|
+
});
|
|
110
|
+
it('flags a command absent from the baseline that exits nonzero with no signatures', () => {
|
|
111
|
+
const diff = diffAgainstBaseline(baseline({ build: { signatures: [] } }), { build: { signatures: [] }, test: { signatures: [], exitCode: 1 } });
|
|
112
|
+
expect(diff.newSignatures).toEqual(['test: <exited with code 1>']);
|
|
113
|
+
});
|
|
114
|
+
it('flags a nonzero command when there is no baseline at all', () => {
|
|
115
|
+
const diff = diffAgainstBaseline(null, { test: { signatures: [], exitCode: 1 } });
|
|
116
|
+
expect(diff.newSignatures).toEqual(['test: <exited with code 1>']);
|
|
117
|
+
});
|
|
87
118
|
it('treats a command that used to run and now cannot execute as new', () => {
|
|
88
119
|
const diff = diffAgainstBaseline(baseline({ test: { signatures: ['FAIL a'] } }), { test: { signatures: [], unrunnable: true } });
|
|
89
120
|
expect(diff.newSignatures).toEqual(['test: <command became unrunnable>']);
|
|
90
121
|
});
|
|
122
|
+
it('reports a new timeout as its own signal and a baseline timeout as noise', () => {
|
|
123
|
+
expect(diffAgainstBaseline(baseline({ test: { signatures: [] } }), { test: { signatures: [], timedOut: true } }).newSignatures).toEqual(['test: <command timed out>']);
|
|
124
|
+
expect(diffAgainstBaseline(baseline({ test: { signatures: [], timedOut: true } }), { test: { signatures: [], timedOut: true } }).newSignatures).toEqual([]);
|
|
125
|
+
});
|
|
91
126
|
it('treats a command missing from the baseline as all-new, and a same-shape unrunnable as noise', () => {
|
|
92
127
|
expect(diffAgainstBaseline(baseline({}), { lint: { signatures: ['FAIL lint'] } }).newSignatures).toEqual(['lint: FAIL lint']);
|
|
93
128
|
expect(diffAgainstBaseline(baseline({ test: { signatures: [], unrunnable: true } }), { test: { signatures: [], unrunnable: true } }).newSignatures).toEqual([]);
|
|
@@ -95,6 +130,11 @@ describe('diffAgainstBaseline', () => {
|
|
|
95
130
|
it('with no baseline, reports everything present as new for the caller to interpret', () => {
|
|
96
131
|
expect(diffAgainstBaseline(null, { test: { signatures: ['FAIL a', 'FAIL b'] } }).newSignatures).toEqual(['test: FAIL a', 'test: FAIL b']);
|
|
97
132
|
});
|
|
133
|
+
it('reports signatures under a command that disappeared from the current set as resolved', () => {
|
|
134
|
+
const diff = diffAgainstBaseline(baseline({ test: { signatures: ['FAIL gone'] }, lint: { signatures: ['FAIL kept'] } }), { lint: { signatures: ['FAIL kept'] } });
|
|
135
|
+
expect(diff.newSignatures).toEqual([]);
|
|
136
|
+
expect(diff.resolvedSignatures).toEqual(['test: FAIL gone']);
|
|
137
|
+
});
|
|
98
138
|
});
|
|
99
139
|
describe('baseline IO', () => {
|
|
100
140
|
it('round-trips a baseline and rejects malformed documents', () => {
|
|
@@ -102,14 +142,426 @@ describe('baseline IO', () => {
|
|
|
102
142
|
try {
|
|
103
143
|
const path = baselinePath(dir, 'sess-1');
|
|
104
144
|
expect(path).toContain(join('state', 'sessions', 'sess-1', 'feedback-baseline.json'));
|
|
105
|
-
expect(writeBaseline(path, { test: { signatures: ['FAIL a'] } })).toBe(true);
|
|
145
|
+
expect(writeBaseline(path, { test: { signatures: ['FAIL a'], exitCode: 1 } })).toBe(true);
|
|
106
146
|
expect(readBaseline(path)?.commands.test?.signatures).toEqual(['FAIL a']);
|
|
147
|
+
expect(readBaseline(path)?.commands.test?.exitCode).toBe(1);
|
|
107
148
|
expect(readBaseline(join(dir, 'nope.json'))).toBeNull();
|
|
108
149
|
}
|
|
109
150
|
finally {
|
|
110
151
|
rmSync(dir, { recursive: true, force: true });
|
|
111
152
|
}
|
|
112
153
|
});
|
|
154
|
+
it('keeps a replaced baseline in history and the newest document at the live path', () => {
|
|
155
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
156
|
+
try {
|
|
157
|
+
const path = baselinePath(dir, 'sess-1');
|
|
158
|
+
const first = recordBaseline(path, { test: { signatures: ['FAIL old'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
159
|
+
expect(first.previousPath).toBeUndefined();
|
|
160
|
+
expect(first.added).toBe(0);
|
|
161
|
+
expect(first.removed).toBe(0);
|
|
162
|
+
const second = recordBaseline(path, { test: { signatures: ['FAIL old'] } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
163
|
+
expect(second.written).toBe(true);
|
|
164
|
+
expect(second.previousPath).toBeDefined();
|
|
165
|
+
expect(existsSync(second.previousPath)).toBe(true);
|
|
166
|
+
const history = readdirSync(join(dir, 'state', 'sessions', 'sess-1', FEEDBACK_BASELINE_HISTORY_DIRNAME));
|
|
167
|
+
expect(history).toHaveLength(1);
|
|
168
|
+
expect(history[0]).toContain('2026-09-30T00-00-00.000Z-1.json');
|
|
169
|
+
// The archived document is the first one; the live path holds the second.
|
|
170
|
+
expect(readBaseline(second.previousPath)).toEqual({
|
|
171
|
+
version: 1,
|
|
172
|
+
recordedAt: '2026-09-30T00:00:00.000Z',
|
|
173
|
+
commands: { test: { signatures: ['FAIL old'] } },
|
|
174
|
+
});
|
|
175
|
+
expect(readBaseline(path)?.recordedAt).toBe('2026-10-01T00:00:00.000Z');
|
|
176
|
+
}
|
|
177
|
+
finally {
|
|
178
|
+
rmSync(dir, { recursive: true, force: true });
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
it('reports signatures added and removed by a re-record', () => {
|
|
182
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
183
|
+
try {
|
|
184
|
+
const path = baselinePath(dir, 'sess-1');
|
|
185
|
+
recordBaseline(path, { test: { signatures: ['FAIL a', 'FAIL b'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
186
|
+
const result = recordBaseline(path, { test: { signatures: ['FAIL b', 'FAIL c', 'FAIL d'] } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
187
|
+
expect(result.added).toBe(2);
|
|
188
|
+
expect(result.removed).toBe(1);
|
|
189
|
+
expect(result.previousPath).toBeDefined();
|
|
190
|
+
}
|
|
191
|
+
finally {
|
|
192
|
+
rmSync(dir, { recursive: true, force: true });
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
it('counts the stored signatures a replacement removed when a command becomes unrunnable', () => {
|
|
196
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
197
|
+
try {
|
|
198
|
+
const path = baselinePath(dir, 'sess-1');
|
|
199
|
+
recordBaseline(path, { test: { signatures: ['FAIL a', 'FAIL b'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
200
|
+
const result = recordBaseline(path, { test: { signatures: [], unrunnable: true } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
201
|
+
// The audit describes the document replacement, not the gate marker.
|
|
202
|
+
expect(result.added).toBe(0);
|
|
203
|
+
expect(result.removed).toBe(2);
|
|
204
|
+
expect(result.becameUnrunnable).toEqual(['test']);
|
|
205
|
+
// Gate semantics remain untouched: the command is still newly unrunnable.
|
|
206
|
+
const diff = diffAgainstBaseline(readBaseline(result.previousPath), readBaseline(path)?.commands ?? {});
|
|
207
|
+
expect(diff.newSignatures).toEqual(['test: <command became unrunnable>']);
|
|
208
|
+
expect(diff.resolvedSignatures).toEqual([]);
|
|
209
|
+
}
|
|
210
|
+
finally {
|
|
211
|
+
rmSync(dir, { recursive: true, force: true });
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
it('keeps colliding same-timestamp archives distinct and retains the newest below the cap', () => {
|
|
215
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
216
|
+
try {
|
|
217
|
+
const path = baselinePath(dir, 'sess-1');
|
|
218
|
+
const now = new Date('2026-09-30T00:00:00.000Z');
|
|
219
|
+
recordBaseline(path, { test: { signatures: ['FAIL 0'] } }, now);
|
|
220
|
+
const secondDoc = readFileSync(path);
|
|
221
|
+
const second = recordBaseline(path, { test: { signatures: ['FAIL 1'] } }, now);
|
|
222
|
+
expect(second.previousPath).toBeDefined();
|
|
223
|
+
expect(readFileSync(second.previousPath)).toEqual(secondDoc);
|
|
224
|
+
const thirdDoc = readFileSync(path);
|
|
225
|
+
const third = recordBaseline(path, { test: { signatures: ['FAIL 2'] } }, now);
|
|
226
|
+
expect(third.previousPath).not.toBe(second.previousPath);
|
|
227
|
+
expect(readFileSync(third.previousPath)).toEqual(thirdDoc);
|
|
228
|
+
// Continue with the same `recordedAt` so every archive shares one stamp.
|
|
229
|
+
const total = MAX_FEEDBACK_BASELINE_HISTORY + 5;
|
|
230
|
+
let last = third;
|
|
231
|
+
for (let index = 3; index <= total; index += 1) {
|
|
232
|
+
last = recordBaseline(path, { test: { signatures: [`FAIL ${index}`] } }, now);
|
|
233
|
+
}
|
|
234
|
+
const historyDir = join(dir, 'state', 'sessions', 'sess-1', FEEDBACK_BASELINE_HISTORY_DIRNAME);
|
|
235
|
+
const history = readdirSync(historyDir).filter((name) => name.endsWith('.json'));
|
|
236
|
+
expect(history).toHaveLength(MAX_FEEDBACK_BASELINE_HISTORY);
|
|
237
|
+
// The newest archive is the document the final write replaced.
|
|
238
|
+
expect(readBaseline(last.previousPath)?.commands.test?.signatures).toEqual([`FAIL ${total - 1}`]);
|
|
239
|
+
// Retention keeps the newest MAX documents, not whichever names sort first.
|
|
240
|
+
const archived = history
|
|
241
|
+
.map((name) => readBaseline(join(historyDir, name))?.commands.test?.signatures?.[0])
|
|
242
|
+
.sort();
|
|
243
|
+
const expected = Array.from({ length: MAX_FEEDBACK_BASELINE_HISTORY }, (_, offset) => `FAIL ${total - MAX_FEEDBACK_BASELINE_HISTORY + offset}`);
|
|
244
|
+
expect(archived).toEqual(expected.sort());
|
|
245
|
+
}
|
|
246
|
+
finally {
|
|
247
|
+
rmSync(dir, { recursive: true, force: true });
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
it('caps the history at the configured maximum, pruning the oldest entries', () => {
|
|
251
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
252
|
+
try {
|
|
253
|
+
const path = baselinePath(dir, 'sess-1');
|
|
254
|
+
const total = MAX_FEEDBACK_BASELINE_HISTORY + 5;
|
|
255
|
+
for (let index = 0; index < total; index += 1) {
|
|
256
|
+
recordBaseline(path, { test: { signatures: [`FAIL ${index}`] } }, new Date(Date.UTC(2026, 0, 1, 0, 0, index)));
|
|
257
|
+
}
|
|
258
|
+
const history = readdirSync(join(dir, 'state', 'sessions', 'sess-1', FEEDBACK_BASELINE_HISTORY_DIRNAME)).sort();
|
|
259
|
+
expect(history).toHaveLength(MAX_FEEDBACK_BASELINE_HISTORY);
|
|
260
|
+
// The first four records were pruned; the oldest survivor is record 4.
|
|
261
|
+
expect(history[0]).toContain('2026-01-01T00-00-04.000Z');
|
|
262
|
+
expect(readBaseline(path)?.commands.test?.signatures).toEqual([`FAIL ${total - 1}`]);
|
|
263
|
+
}
|
|
264
|
+
finally {
|
|
265
|
+
rmSync(dir, { recursive: true, force: true });
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
it('never prunes the archive it just created when newer-named entries fill the history', () => {
|
|
269
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
270
|
+
try {
|
|
271
|
+
const path = baselinePath(dir, 'sess-1');
|
|
272
|
+
recordBaseline(path, { test: { signatures: ['FAIL original'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
273
|
+
const historyDir = join(dir, 'state', 'sessions', 'sess-1', FEEDBACK_BASELINE_HISTORY_DIRNAME);
|
|
274
|
+
mkdirSync(historyDir, { recursive: true });
|
|
275
|
+
// Entries that sort AFTER the new archive's old `recordedAt` stem.
|
|
276
|
+
for (let index = 0; index < MAX_FEEDBACK_BASELINE_HISTORY; index += 1) {
|
|
277
|
+
writeFileSync(join(historyDir, `2099-01-01T00-00-${String(index).padStart(2, '0')}.000Z-1.json`), '{}\n', 'utf8');
|
|
278
|
+
}
|
|
279
|
+
const result = recordBaseline(path, { test: { signatures: ['FAIL next'] } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
280
|
+
expect(result.written).toBe(true);
|
|
281
|
+
expect(result.previousPath).toBeDefined();
|
|
282
|
+
expect(existsSync(result.previousPath)).toBe(true);
|
|
283
|
+
expect(readBaseline(result.previousPath)?.commands.test?.signatures).toEqual(['FAIL original']);
|
|
284
|
+
expect(readdirSync(historyDir).filter((name) => name.endsWith('.json'))).toHaveLength(MAX_FEEDBACK_BASELINE_HISTORY);
|
|
285
|
+
}
|
|
286
|
+
finally {
|
|
287
|
+
rmSync(dir, { recursive: true, force: true });
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
it('fails closed without touching the live baseline when history cannot be archived', () => {
|
|
291
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
292
|
+
try {
|
|
293
|
+
const path = baselinePath(dir, 'sess-1');
|
|
294
|
+
recordBaseline(path, { test: { signatures: ['FAIL original'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
295
|
+
const before = readFileSync(path);
|
|
296
|
+
// A regular file where the history directory must go makes archiving fail.
|
|
297
|
+
writeFileSync(join(dirname(path), FEEDBACK_BASELINE_HISTORY_DIRNAME), 'not a directory', 'utf8');
|
|
298
|
+
const result = recordBaseline(path, { test: { signatures: ['FAIL changed'] } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
299
|
+
expect(result.written).toBe(false);
|
|
300
|
+
expect(readFileSync(path)).toEqual(before);
|
|
301
|
+
}
|
|
302
|
+
finally {
|
|
303
|
+
rmSync(dir, { recursive: true, force: true });
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
it.skipIf(isRoot)('covers archive-failure path: fails when history directory is unwritable (issue #4798)', () => {
|
|
307
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
308
|
+
const path = baselinePath(dir, 'sess-1');
|
|
309
|
+
try {
|
|
310
|
+
recordBaseline(path, { test: { signatures: ['FAIL original'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
311
|
+
const before = readFileSync(path);
|
|
312
|
+
const historyDir = join(dirname(path), FEEDBACK_BASELINE_HISTORY_DIRNAME);
|
|
313
|
+
mkdirSync(historyDir, { recursive: true });
|
|
314
|
+
// Make the history directory read-only so copyFileSync fails.
|
|
315
|
+
chmodSync(historyDir, 0o555);
|
|
316
|
+
const result = recordBaseline(path, { test: { signatures: ['FAIL changed'] } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
317
|
+
expect(result.written).toBe(false);
|
|
318
|
+
expect(readFileSync(path)).toEqual(before);
|
|
319
|
+
// Verify no stale archive was created in the failed attempt.
|
|
320
|
+
chmodSync(historyDir, 0o755);
|
|
321
|
+
const history = readdirSync(historyDir).filter((name) => name.endsWith('.json'));
|
|
322
|
+
expect(history).toHaveLength(0); // archiveBaseline failed, so no archive was created
|
|
323
|
+
}
|
|
324
|
+
finally {
|
|
325
|
+
// Reset permissions before cleanup.
|
|
326
|
+
try {
|
|
327
|
+
chmodSync(join(dirname(path), FEEDBACK_BASELINE_HISTORY_DIRNAME), 0o755);
|
|
328
|
+
}
|
|
329
|
+
catch (_err) {
|
|
330
|
+
// Ignore cleanup errors when resetting permissions.
|
|
331
|
+
}
|
|
332
|
+
rmSync(dir, { recursive: true, force: true });
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
it.skipIf(isRoot)('retains the archived file when the live write fails, so a partial write keeps its intact recovery copy (issue #4798)', () => {
|
|
336
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
337
|
+
const path = baselinePath(dir, 'sess-1');
|
|
338
|
+
try {
|
|
339
|
+
recordBaseline(path, { test: { signatures: ['FAIL first'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
340
|
+
const before = readFileSync(path);
|
|
341
|
+
const historyDir = join(dirname(path), FEEDBACK_BASELINE_HISTORY_DIRNAME);
|
|
342
|
+
// Make the baseline file read-only so writeFileSync fails after the archive.
|
|
343
|
+
chmodSync(path, 0o444);
|
|
344
|
+
const result = recordBaseline(path, { test: { signatures: ['FAIL second'] } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
345
|
+
expect(result.written).toBe(false);
|
|
346
|
+
// The archive must survive: a partially written live file leaves it as the
|
|
347
|
+
// only intact copy of the document that was being replaced.
|
|
348
|
+
chmodSync(path, 0o644);
|
|
349
|
+
const history = readdirSync(historyDir).filter((name) => name.endsWith('.json'));
|
|
350
|
+
expect(history).toHaveLength(1);
|
|
351
|
+
expect(readFileSync(join(historyDir, history[0]))).toEqual(before);
|
|
352
|
+
expect(readBaseline(join(historyDir, history[0]))?.commands.test?.signatures).toEqual(['FAIL first']);
|
|
353
|
+
}
|
|
354
|
+
finally {
|
|
355
|
+
try {
|
|
356
|
+
chmodSync(path, 0o644);
|
|
357
|
+
}
|
|
358
|
+
catch (_err) {
|
|
359
|
+
// Ignore cleanup errors when resetting permissions.
|
|
360
|
+
}
|
|
361
|
+
rmSync(dir, { recursive: true, force: true });
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
it('never prunes the archive created by the current call, even when its timestamp sorts before newer entries (issue #4798)', () => {
|
|
365
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
366
|
+
try {
|
|
367
|
+
const path = baselinePath(dir, 'sess-1');
|
|
368
|
+
recordBaseline(path, { test: { signatures: ['FAIL v1'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
369
|
+
const historyDir = join(dir, 'state', 'sessions', 'sess-1', FEEDBACK_BASELINE_HISTORY_DIRNAME);
|
|
370
|
+
mkdirSync(historyDir, { recursive: true });
|
|
371
|
+
// Fill the history with entries that sort after the old baseline's timestamp.
|
|
372
|
+
for (let index = 0; index < MAX_FEEDBACK_BASELINE_HISTORY; index += 1) {
|
|
373
|
+
writeFileSync(join(historyDir, `2099-12-31T23-59-${String(index).padStart(2, '0')}.000Z-1.json`), '{"version":1}\n', 'utf8');
|
|
374
|
+
}
|
|
375
|
+
const result = recordBaseline(path, { test: { signatures: ['FAIL v2'] } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
376
|
+
expect(result.written).toBe(true);
|
|
377
|
+
expect(result.previousPath).toBeDefined();
|
|
378
|
+
expect(existsSync(result.previousPath)).toBe(true);
|
|
379
|
+
expect(readBaseline(result.previousPath)?.commands.test?.signatures).toEqual(['FAIL v1']);
|
|
380
|
+
const history = readdirSync(historyDir).filter((n) => n.endsWith('.json'));
|
|
381
|
+
expect(history).toHaveLength(MAX_FEEDBACK_BASELINE_HISTORY);
|
|
382
|
+
}
|
|
383
|
+
finally {
|
|
384
|
+
rmSync(dir, { recursive: true, force: true });
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
it('handles concurrent archive creation: retries collision detection until a unique filename is found (issue #4798)', () => {
|
|
388
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
389
|
+
try {
|
|
390
|
+
const path = baselinePath(dir, 'sess-1');
|
|
391
|
+
const now = new Date('2026-09-30T00:00:00.000Z');
|
|
392
|
+
recordBaseline(path, { test: { signatures: ['FAIL first'] } }, now);
|
|
393
|
+
// Simulate a collision: pre-create the archive that would be created next.
|
|
394
|
+
const secondDoc = readFileSync(path);
|
|
395
|
+
const secondPath = recordBaseline(path, { test: { signatures: ['FAIL second'] } }, now).previousPath;
|
|
396
|
+
expect(secondPath).toBeDefined();
|
|
397
|
+
expect(existsSync(secondPath)).toBe(true);
|
|
398
|
+
// Re-record with the same timestamp; archiveBaseline should find the collision and use the next counter.
|
|
399
|
+
const thirdDoc = readFileSync(path);
|
|
400
|
+
const third = recordBaseline(path, { test: { signatures: ['FAIL third'] } }, now);
|
|
401
|
+
expect(third.previousPath).toBeDefined();
|
|
402
|
+
expect(third.previousPath).not.toBe(secondPath);
|
|
403
|
+
expect(existsSync(third.previousPath)).toBe(true);
|
|
404
|
+
expect(readFileSync(third.previousPath)).toEqual(thirdDoc);
|
|
405
|
+
// Verify all archives are byte-identical to what they replaced.
|
|
406
|
+
expect(readFileSync(secondPath)).toEqual(secondDoc);
|
|
407
|
+
}
|
|
408
|
+
finally {
|
|
409
|
+
rmSync(dir, { recursive: true, force: true });
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
it('does not mark a newly added unrunnable command as "became unrunnable" (issue #4798)', () => {
|
|
413
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
414
|
+
try {
|
|
415
|
+
const path = baselinePath(dir, 'sess-1');
|
|
416
|
+
// First record has no lint command.
|
|
417
|
+
recordBaseline(path, { test: { signatures: ['FAIL a'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
418
|
+
// Second record adds a lint command that is unavailable (unrunnable).
|
|
419
|
+
const result = recordBaseline(path, { test: { signatures: ['FAIL a'] }, lint: { signatures: [], unrunnable: true } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
420
|
+
// The newly added lint command should NOT appear in becameUnrunnable,
|
|
421
|
+
// because it was never runnable in the replaced baseline.
|
|
422
|
+
expect(result.becameUnrunnable).toBeUndefined();
|
|
423
|
+
expect(result.added).toBe(0);
|
|
424
|
+
expect(result.removed).toBe(0);
|
|
425
|
+
}
|
|
426
|
+
finally {
|
|
427
|
+
rmSync(dir, { recursive: true, force: true });
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
it('marks an existing runnable command as "became unrunnable" in the audit (issue #4798)', () => {
|
|
431
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
432
|
+
try {
|
|
433
|
+
const path = baselinePath(dir, 'sess-1');
|
|
434
|
+
// First record has lint as runnable.
|
|
435
|
+
recordBaseline(path, { test: { signatures: ['FAIL a'] }, lint: { signatures: ['FAIL lint'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
436
|
+
// Second record marks lint as unrunnable.
|
|
437
|
+
const result = recordBaseline(path, { test: { signatures: ['FAIL a'] }, lint: { signatures: [], unrunnable: true } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
438
|
+
// The lint command transitions from runnable to unrunnable, so it should be reported.
|
|
439
|
+
expect(result.becameUnrunnable).toEqual(['lint']);
|
|
440
|
+
expect(result.removed).toBe(1); // One signature from lint was removed.
|
|
441
|
+
}
|
|
442
|
+
finally {
|
|
443
|
+
rmSync(dir, { recursive: true, force: true });
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
it('counts removed commands when a feedback command is dropped entirely (issue #4798)', () => {
|
|
447
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-'));
|
|
448
|
+
try {
|
|
449
|
+
const path = baselinePath(dir, 'sess-1');
|
|
450
|
+
// First record has both test and lint.
|
|
451
|
+
recordBaseline(path, { test: { signatures: ['FAIL test-a', 'FAIL test-b'] }, lint: { signatures: ['FAIL lint-a'] } }, new Date('2026-09-30T00:00:00.000Z'));
|
|
452
|
+
// Second record drops lint entirely (removed command).
|
|
453
|
+
const result = recordBaseline(path, { test: { signatures: ['FAIL test-a', 'FAIL test-b'] } }, new Date('2026-10-01T00:00:00.000Z'));
|
|
454
|
+
// The audit must count signatures from the removed lint command.
|
|
455
|
+
expect(result.removed).toBe(1);
|
|
456
|
+
expect(result.added).toBe(0);
|
|
457
|
+
// The replacement is auditable in history: the archive keeps the dropped
|
|
458
|
+
// command and its signature, while the live document no longer has it.
|
|
459
|
+
const archived = readBaseline(result.previousPath);
|
|
460
|
+
expect(archived?.commands.lint).toEqual({ signatures: ['FAIL lint-a'] });
|
|
461
|
+
expect(readBaseline(path)?.commands ?? {}).not.toHaveProperty('lint');
|
|
462
|
+
// The audit must report the union of old and new command keys.
|
|
463
|
+
const diff = diffAgainstBaseline(archived, readBaseline(path)?.commands ?? {});
|
|
464
|
+
expect(diff.resolvedSignatures).toEqual(['lint: FAIL lint-a']);
|
|
465
|
+
}
|
|
466
|
+
finally {
|
|
467
|
+
rmSync(dir, { recursive: true, force: true });
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
});
|
|
471
|
+
const WORKER_SOURCE = (moduleUrl) => `
|
|
472
|
+
import { existsSync, writeFileSync } from 'node:fs';
|
|
473
|
+
import { recordBaseline } from ${JSON.stringify(moduleUrl)};
|
|
474
|
+
|
|
475
|
+
const [baselinePath, signature, readySelf, readyOther] = process.argv.slice(2);
|
|
476
|
+
writeFileSync(readySelf, '');
|
|
477
|
+
const deadline = Date.now() + 10000;
|
|
478
|
+
while (!existsSync(readyOther)) {
|
|
479
|
+
if (Date.now() > deadline) break;
|
|
480
|
+
await new Promise((done) => setTimeout(done, 5));
|
|
481
|
+
}
|
|
482
|
+
const result = recordBaseline(
|
|
483
|
+
baselinePath,
|
|
484
|
+
{ test: { signatures: ['FAIL ' + signature] } },
|
|
485
|
+
new Date('2026-10-01T00:00:00.000Z'),
|
|
486
|
+
);
|
|
487
|
+
process.stdout.write(JSON.stringify({ written: result.written, previousPath: result.previousPath ?? null }));
|
|
488
|
+
`;
|
|
489
|
+
function runWorker(children, workerPath, args) {
|
|
490
|
+
return new Promise((settle, fail) => {
|
|
491
|
+
const child = spawn(process.execPath, ['--import', 'tsx', workerPath, ...args], {
|
|
492
|
+
cwd: repoRoot,
|
|
493
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
494
|
+
});
|
|
495
|
+
children.push(child);
|
|
496
|
+
let stdout = '';
|
|
497
|
+
let stderr = '';
|
|
498
|
+
const timer = setTimeout(() => {
|
|
499
|
+
child.kill('SIGKILL');
|
|
500
|
+
fail(new Error(`worker timed out\nstderr: ${stderr}`));
|
|
501
|
+
}, 20_000);
|
|
502
|
+
child.stdout?.on('data', (chunk) => {
|
|
503
|
+
stdout += chunk.toString();
|
|
504
|
+
});
|
|
505
|
+
child.stderr?.on('data', (chunk) => {
|
|
506
|
+
stderr += chunk.toString();
|
|
507
|
+
});
|
|
508
|
+
child.on('error', (err) => {
|
|
509
|
+
clearTimeout(timer);
|
|
510
|
+
fail(err);
|
|
511
|
+
});
|
|
512
|
+
child.on('close', (code) => {
|
|
513
|
+
clearTimeout(timer);
|
|
514
|
+
settle({ code, stdout, stderr });
|
|
515
|
+
});
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
describe('cross-process baseline serialization', () => {
|
|
519
|
+
it('serializes overlapping writers so each replacement archives the document that preceded it', async () => {
|
|
520
|
+
const dir = mkdtempSync(join(tmpdir(), 'omc-fb-xproc-'));
|
|
521
|
+
const children = [];
|
|
522
|
+
try {
|
|
523
|
+
const path = baselinePath(dir, 'sess-1');
|
|
524
|
+
expect(recordBaseline(path, { test: { signatures: ['FAIL original'] } }, new Date('2026-09-30T00:00:00.000Z')).written).toBe(true);
|
|
525
|
+
const workerPath = join(dir, 'worker.mjs');
|
|
526
|
+
writeFileSync(workerPath, WORKER_SOURCE(pathToFileURL(join(repoRoot, 'src/hooks/ralph/feedback-baseline.ts')).href), 'utf8');
|
|
527
|
+
const readyA = join(dir, 'ready-a');
|
|
528
|
+
const readyB = join(dir, 'ready-b');
|
|
529
|
+
// Each worker waits for the OTHER's ready file, so the two recordBaseline
|
|
530
|
+
// transactions genuinely overlap instead of running back to back.
|
|
531
|
+
const [a, b] = await Promise.all([
|
|
532
|
+
runWorker(children, workerPath, [path, 'writer-a', readyA, readyB]),
|
|
533
|
+
runWorker(children, workerPath, [path, 'writer-b', readyB, readyA]),
|
|
534
|
+
]);
|
|
535
|
+
expect(a.code, a.stderr).toBe(0);
|
|
536
|
+
expect(b.code, b.stderr).toBe(0);
|
|
537
|
+
const resultA = JSON.parse(a.stdout.trim());
|
|
538
|
+
const resultB = JSON.parse(b.stdout.trim());
|
|
539
|
+
expect(resultA.written).toBe(true);
|
|
540
|
+
expect(resultB.written).toBe(true);
|
|
541
|
+
expect(resultA.previousPath).not.toBeNull();
|
|
542
|
+
expect(resultB.previousPath).not.toBeNull();
|
|
543
|
+
// Distinct archives are the whole point: the second writer must archive
|
|
544
|
+
// the first replacement instead of overwriting it unarchived.
|
|
545
|
+
expect(resultA.previousPath).not.toBe(resultB.previousPath);
|
|
546
|
+
const archived = [readBaseline(resultA.previousPath), readBaseline(resultB.previousPath)];
|
|
547
|
+
const archivedSignals = archived.map((doc) => doc?.commands.test?.signatures?.[0]);
|
|
548
|
+
const liveSignal = readBaseline(path)?.commands.test?.signatures?.[0];
|
|
549
|
+
expect(['FAIL writer-a', 'FAIL writer-b']).toContain(liveSignal);
|
|
550
|
+
const firstWriterSignal = liveSignal === 'FAIL writer-a' ? 'FAIL writer-b' : 'FAIL writer-a';
|
|
551
|
+
// Together the archives preserve the original and the first replacement.
|
|
552
|
+
expect(archivedSignals).toContain('FAIL original');
|
|
553
|
+
expect(archivedSignals).toContain(firstWriterSignal);
|
|
554
|
+
// The lock must not leak after either transaction.
|
|
555
|
+
expect(existsSync(`${path}.lock`)).toBe(false);
|
|
556
|
+
}
|
|
557
|
+
finally {
|
|
558
|
+
for (const child of children) {
|
|
559
|
+
if (child.exitCode === null)
|
|
560
|
+
child.kill('SIGKILL');
|
|
561
|
+
}
|
|
562
|
+
rmSync(dir, { recursive: true, force: true });
|
|
563
|
+
}
|
|
564
|
+
}, 30_000);
|
|
113
565
|
});
|
|
114
566
|
describe('pytest summary normalization (issue #4795)', () => {
|
|
115
567
|
it('adding a passing test does not register as a new failure', () => {
|
|
@@ -445,4 +897,120 @@ describe('Node warning process id', () => {
|
|
|
445
897
|
expect(first).toEqual([`packages/a test: (node:<v>) ${punycode}`]);
|
|
446
898
|
});
|
|
447
899
|
});
|
|
900
|
+
describe('signature noise from environment output', () => {
|
|
901
|
+
it('normalizes macOS temp dirs so the same warning fingerprints identically across runs', () => {
|
|
902
|
+
const first = signatureLines('│ No config files with names ["lefthook"] have been found in "/private/var/folders/t8/abc/T/scr-unit-repo-0yogcC"');
|
|
903
|
+
const second = signatureLines('│ No config files with names ["lefthook"] have been found in "/private/var/folders/t8/abc/T/scr-unit-repo-Zz9QwE"');
|
|
904
|
+
expect(first).toEqual(second);
|
|
905
|
+
expect(first.join('\n')).not.toContain('scr-unit-repo');
|
|
906
|
+
});
|
|
907
|
+
it('normalizes random temp dirs inside a real failure without dropping the failure', () => {
|
|
908
|
+
const first = signatureLines("Error: ENOTEMPTY, Directory not empty: /var/folders/t8/abc/T/scr-cp-repo-AXe2kO '/var/folders/t8/abc/T/scr-cp-repo-AXe2kO'");
|
|
909
|
+
const second = signatureLines("Error: ENOTEMPTY, Directory not empty: /var/folders/t8/abc/T/scr-cp-repo-Qw3ErT '/var/folders/t8/abc/T/scr-cp-repo-Qw3ErT'");
|
|
910
|
+
expect(first).toEqual(second);
|
|
911
|
+
expect(first[0]).toContain('ENOTEMPTY');
|
|
912
|
+
});
|
|
913
|
+
it('keeps exception-class diagnostics from low-level log lines', () => {
|
|
914
|
+
const lines = signatureLines([
|
|
915
|
+
'2026-11-04T09:09:15.262Z INFO TypeError: Cannot read properties of undefined',
|
|
916
|
+
'INFO AssertionError: expected 1 to be 2',
|
|
917
|
+
'INFO ReferenceError: x is not defined',
|
|
918
|
+
].join('\n'));
|
|
919
|
+
expect(lines).toEqual([
|
|
920
|
+
'<v> INFO TypeError: Cannot read properties of undefined',
|
|
921
|
+
'INFO AssertionError: expected 1 to be 2',
|
|
922
|
+
'INFO ReferenceError: x is not defined',
|
|
923
|
+
]);
|
|
924
|
+
});
|
|
925
|
+
it('normalizes the random temp segment and keeps stable suffixes', () => {
|
|
926
|
+
const first = signatureLines('Error: /var/folders/t8/abc/T/scr-e2e-repo-85IacC/src/a.ts:1:1 boom');
|
|
927
|
+
const second = signatureLines('Error: /private/var/folders/t8/abc/T/scr-e2e-repo-q2vh5d/src/a.ts:1:1 boom');
|
|
928
|
+
expect(first).toEqual(second);
|
|
929
|
+
expect(first[0]).toContain('src/a.ts:1:1');
|
|
930
|
+
// A different failure location stays distinct across runs.
|
|
931
|
+
const otherLocation = signatureLines('Error: /var/folders/t8/abc/T/scr-e2e-repo-85IacC/src/b.ts:2:2 boom');
|
|
932
|
+
expect(otherLocation).not.toEqual(first);
|
|
933
|
+
});
|
|
934
|
+
it('keeps stable repo-relative directories inside macOS temp paths', () => {
|
|
935
|
+
const first = signatureLines('Error: /var/folders/t8/abc/T/repo-A/packages/a/index.ts:1:1 boom');
|
|
936
|
+
const second = signatureLines('Error: /var/folders/t8/abc/T/repo-B/packages/b/index.ts:1:1 boom');
|
|
937
|
+
expect(first[0]).toContain('packages/a/index.ts:1:1');
|
|
938
|
+
expect(second[0]).toContain('packages/b/index.ts:1:1');
|
|
939
|
+
expect(first).not.toEqual(second);
|
|
940
|
+
});
|
|
941
|
+
it('normalizes digit-free mixed-case mkdtemp suffixes', () => {
|
|
942
|
+
const first = signatureLines('found in "/var/folders/t8/abc/T/scr-cp-repo-EmATcf"');
|
|
943
|
+
const second = signatureLines('found in "/private/var/folders/t8/abc/T/scr-cp-repo-TthoUQ"');
|
|
944
|
+
expect(first).toEqual(second);
|
|
945
|
+
expect(first[0]).toContain('"<v>"');
|
|
946
|
+
});
|
|
947
|
+
it('normalizes random segments below a stable temp subdirectory', () => {
|
|
948
|
+
const first = signatureLines('pmd -r /var/folders/t8/abc/T/pmd/scr-e2e-repo-85IacC/pmd.sarif');
|
|
949
|
+
const second = signatureLines('pmd -r /var/folders/t8/abc/T/pmd/scr-e2e-repo-q2vh5d/pmd.sarif');
|
|
950
|
+
expect(first).toEqual(second);
|
|
951
|
+
expect(first[0]).toContain('pmd -r <v>/<v>/pmd.sarif');
|
|
952
|
+
});
|
|
953
|
+
it('drops below-WARN log levels but keeps WARN, ERROR, and failure-bearing INFO', () => {
|
|
954
|
+
const lines = signatureLines([
|
|
955
|
+
'2026-11-04T09:09:15.262Z INFO zqjz.pmd_scan - B0 完成:findings=1',
|
|
956
|
+
'[2026-11-04T09:09:15.262Z] INFO bracketed timestamp',
|
|
957
|
+
'[INFO] bracketed level',
|
|
958
|
+
'DEBUG cache hit',
|
|
959
|
+
'TRACE resolved dependency',
|
|
960
|
+
'INFO validation failed',
|
|
961
|
+
'WARN deprecated option',
|
|
962
|
+
'ERROR build failed',
|
|
963
|
+
].join('\n'));
|
|
964
|
+
expect(lines).toEqual(['ERROR build failed', 'INFO validation failed', 'WARN deprecated option']);
|
|
965
|
+
});
|
|
966
|
+
it('drops package-manager chrome and green summaries but keeps a failed summary', () => {
|
|
967
|
+
const lines = signatureLines([
|
|
968
|
+
'> shenkuo-code-review@0.1.0 typecheck',
|
|
969
|
+
'> tsc --noEmit',
|
|
970
|
+
'npm warn Unknown user config "PUPPETEER_DOWNLOAD_BASE_URL"',
|
|
971
|
+
'RUN v3.2.7 /Users/someone/work/repo',
|
|
972
|
+
' Start at 17:14:48',
|
|
973
|
+
'Duration 12.3s (transform 1.2s, setup 0ms, collect 3.4s)',
|
|
974
|
+
'Test Files 66 passed (66)',
|
|
975
|
+
'Tests 1002 passed (1002)',
|
|
976
|
+
'Test Files 1 failed | 65 passed (66)',
|
|
977
|
+
'Tests: 2 failures',
|
|
978
|
+
'Tests: 1 error',
|
|
979
|
+
].join('\n'));
|
|
980
|
+
expect(lines).toEqual(['Test Files 1 failed | 65 passed (66)', 'Tests: 1 error', 'Tests: 2 failures']);
|
|
981
|
+
});
|
|
982
|
+
it('never treats a passing case as a failure, even when its name mentions Error', () => {
|
|
983
|
+
expect(signatureLines('✓ collectDiff — workspace 模式 > range 模式两端相同 → EmptyDiffError(不再静默产出空报告) 12ms')).toEqual([]);
|
|
984
|
+
// A genuinely failing case is still kept and normalized.
|
|
985
|
+
expect(signatureLines('× suite > boom 45ms')).toEqual(['× suite > boom <v>']);
|
|
986
|
+
});
|
|
987
|
+
it('drops source-context frames from failure reports', () => {
|
|
988
|
+
expect(signatureLines(['168| function cleanupTempArtifacts(): void {', '| ^'].join('\n'))).toEqual([]);
|
|
989
|
+
});
|
|
990
|
+
it('a rerun over volatile temp paths and timestamps reports no new or resolved signatures', () => {
|
|
991
|
+
const run = (tmp, time) => [
|
|
992
|
+
`2026-11-04T09:09:15.262Z INFO zqjz.pmd_scan - 执行 PMD: /Users/x/bin/pmd check --file-list /var/folders/t8/abc/T/${tmp}/pmd-file-list.txt`,
|
|
993
|
+
`│ No config files with names ["lefthook"] have been found in "/private/var/folders/t8/abc/T/scr-unit-repo-${tmp}"`,
|
|
994
|
+
` Start at ${time}`,
|
|
995
|
+
'Test Files 66 passed (66)',
|
|
996
|
+
].join('\n');
|
|
997
|
+
const base = baseline({ test: { signatures: signatureLines(run('pmd_scan_80gbSQ', '15:30:47')) } });
|
|
998
|
+
const rerun = { test: { signatures: signatureLines(run('pmd_scan_GNl3U2', '17:14:48')) } };
|
|
999
|
+
const diff = diffAgainstBaseline(base, rerun);
|
|
1000
|
+
expect(diff.newSignatures).toEqual([]);
|
|
1001
|
+
expect(diff.resolvedSignatures).toEqual([]);
|
|
1002
|
+
});
|
|
1003
|
+
it('still detects a genuine new failure alongside the same environmental noise', () => {
|
|
1004
|
+
const run = (tmp, time) => [
|
|
1005
|
+
`2026-11-04T09:09:15.262Z INFO zqjz.pmd_scan - 执行 PMD: /var/folders/t8/abc/T/${tmp}/pmd-file-list.txt`,
|
|
1006
|
+
` Start at ${time}`,
|
|
1007
|
+
].join('\n');
|
|
1008
|
+
const base = baseline({ test: { signatures: signatureLines(run('pmd_scan_80gbSQ', '15:30:47')) } });
|
|
1009
|
+
const failing = `${run('pmd_scan_GNl3U2', '17:14:48')}
|
|
1010
|
+
FAIL src/cli/__tests__/checkpoint-resume.test.ts
|
|
1011
|
+
Error: ENOTEMPTY, Directory not empty: /var/folders/t8/abc/T/scr-cp-repo-AXe2kO '/var/folders/t8/abc/T/scr-cp-repo-AXe2kO'`;
|
|
1012
|
+
const diff = diffAgainstBaseline(base, { test: { signatures: signatureLines(failing) } });
|
|
1013
|
+
expect(diff.newSignatures.some((signature) => signature.includes('ENOTEMPTY'))).toBe(true);
|
|
1014
|
+
});
|
|
1015
|
+
});
|
|
448
1016
|
//# sourceMappingURL=feedback-baseline.test.js.map
|