@memnexus-ai/mx-agent-cli 0.1.296 → 0.1.298
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/dist/agent-config/hooks/gh-pr-edit-guard.sh +21 -9
- package/dist/agent-config/settings.json +7 -1
- package/dist/commands/check.d.ts +20 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +30 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/create.d.ts +36 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +85 -8
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/gh.d.ts +38 -0
- package/dist/commands/gh.d.ts.map +1 -0
- package/dist/commands/gh.js +162 -0
- package/dist/commands/gh.js.map +1 -0
- package/dist/commands/git-credential.d.ts +22 -0
- package/dist/commands/git-credential.d.ts.map +1 -0
- package/dist/commands/git-credential.js +53 -0
- package/dist/commands/git-credential.js.map +1 -0
- package/dist/commands/new.d.ts +24 -0
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +56 -5
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/pr-set-body.d.ts +120 -35
- package/dist/commands/pr-set-body.d.ts.map +1 -1
- package/dist/commands/pr-set-body.js +343 -108
- package/dist/commands/pr-set-body.js.map +1 -1
- package/dist/commands/pr-sync.d.ts +2 -1
- package/dist/commands/pr-sync.d.ts.map +1 -1
- package/dist/commands/pr-sync.js +129 -32
- package/dist/commands/pr-sync.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +82 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/check-run.d.ts +131 -0
- package/dist/lib/check-run.d.ts.map +1 -0
- package/dist/lib/check-run.js +291 -0
- package/dist/lib/check-run.js.map +1 -0
- package/dist/lib/coordination-token.d.ts +33 -1
- package/dist/lib/coordination-token.d.ts.map +1 -1
- package/dist/lib/coordination-token.js +138 -9
- package/dist/lib/coordination-token.js.map +1 -1
- package/dist/lib/gh-remote.d.ts +20 -0
- package/dist/lib/gh-remote.d.ts.map +1 -1
- package/dist/lib/gh-remote.js +26 -0
- package/dist/lib/gh-remote.js.map +1 -1
- package/dist/lib/gh-token-run.d.ts +551 -0
- package/dist/lib/gh-token-run.d.ts.map +1 -0
- package/dist/lib/gh-token-run.js +1246 -0
- package/dist/lib/gh-token-run.js.map +1 -0
- package/dist/lib/git-credential.d.ts +120 -0
- package/dist/lib/git-credential.d.ts.map +1 -0
- package/dist/lib/git-credential.js +204 -0
- package/dist/lib/git-credential.js.map +1 -0
- package/dist/lib/github-app-token.d.ts +288 -0
- package/dist/lib/github-app-token.d.ts.map +1 -0
- package/dist/lib/github-app-token.js +519 -0
- package/dist/lib/github-app-token.js.map +1 -0
- package/dist/lib/memory.d.ts.map +1 -1
- package/dist/lib/memory.js +35 -2
- package/dist/lib/memory.js.map +1 -1
- package/dist/lib/repo-guard-state-dirs.d.ts +39 -0
- package/dist/lib/repo-guard-state-dirs.d.ts.map +1 -0
- package/dist/lib/repo-guard-state-dirs.js +170 -0
- package/dist/lib/repo-guard-state-dirs.js.map +1 -0
- package/dist/standards/decision-request.md +6 -57
- package/dist/standards/po-communication-standard.md +0 -34
- package/dist/standards/report-format.md +0 -90
- package/dist/standards/writing-standard.md +0 -312
- package/package.json +3 -1
- package/dist/__tests__/agent-attribution.test.d.ts +0 -16
- package/dist/__tests__/agent-attribution.test.d.ts.map +0 -1
- package/dist/__tests__/agent-attribution.test.js +0 -250
- package/dist/__tests__/agent-attribution.test.js.map +0 -1
- package/dist/__tests__/agents-md-canonicalization.test.d.ts +0 -23
- package/dist/__tests__/agents-md-canonicalization.test.d.ts.map +0 -1
- package/dist/__tests__/agents-md-canonicalization.test.js +0 -319
- package/dist/__tests__/agents-md-canonicalization.test.js.map +0 -1
- package/dist/__tests__/behavioral-compliance.test.d.ts +0 -8
- package/dist/__tests__/behavioral-compliance.test.d.ts.map +0 -1
- package/dist/__tests__/behavioral-compliance.test.js +0 -226
- package/dist/__tests__/behavioral-compliance.test.js.map +0 -1
- package/dist/__tests__/behavioral-extraction.test.d.ts +0 -12
- package/dist/__tests__/behavioral-extraction.test.d.ts.map +0 -1
- package/dist/__tests__/behavioral-extraction.test.js +0 -330
- package/dist/__tests__/behavioral-extraction.test.js.map +0 -1
- package/dist/__tests__/behavioral-git-read.test.d.ts +0 -21
- package/dist/__tests__/behavioral-git-read.test.d.ts.map +0 -1
- package/dist/__tests__/behavioral-git-read.test.js +0 -955
- package/dist/__tests__/behavioral-git-read.test.js.map +0 -1
- package/dist/__tests__/behavioral-injection.test.d.ts +0 -13
- package/dist/__tests__/behavioral-injection.test.d.ts.map +0 -1
- package/dist/__tests__/behavioral-injection.test.js +0 -384
- package/dist/__tests__/behavioral-injection.test.js.map +0 -1
- package/dist/__tests__/binary-smoke.test.d.ts +0 -12
- package/dist/__tests__/binary-smoke.test.d.ts.map +0 -1
- package/dist/__tests__/binary-smoke.test.js +0 -88
- package/dist/__tests__/binary-smoke.test.js.map +0 -1
- package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts +0 -18
- package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts.map +0 -1
- package/dist/__tests__/bootstrap-behavioral-contract.test.js +0 -104
- package/dist/__tests__/bootstrap-behavioral-contract.test.js.map +0 -1
- package/dist/__tests__/bundle-config.test.d.ts +0 -18
- package/dist/__tests__/bundle-config.test.d.ts.map +0 -1
- package/dist/__tests__/bundle-config.test.js +0 -123
- package/dist/__tests__/bundle-config.test.js.map +0 -1
- package/dist/__tests__/catalog-interaction.test.d.ts +0 -25
- package/dist/__tests__/catalog-interaction.test.d.ts.map +0 -1
- package/dist/__tests__/catalog-interaction.test.js +0 -269
- package/dist/__tests__/catalog-interaction.test.js.map +0 -1
- package/dist/__tests__/catalog-named-memories.test.d.ts +0 -2
- package/dist/__tests__/catalog-named-memories.test.d.ts.map +0 -1
- package/dist/__tests__/catalog-named-memories.test.js +0 -204
- package/dist/__tests__/catalog-named-memories.test.js.map +0 -1
- package/dist/__tests__/catalog-origin-main.test.d.ts +0 -15
- package/dist/__tests__/catalog-origin-main.test.d.ts.map +0 -1
- package/dist/__tests__/catalog-origin-main.test.js +0 -305
- package/dist/__tests__/catalog-origin-main.test.js.map +0 -1
- package/dist/__tests__/catalog.test.d.ts +0 -2
- package/dist/__tests__/catalog.test.d.ts.map +0 -1
- package/dist/__tests__/catalog.test.js +0 -131
- package/dist/__tests__/catalog.test.js.map +0 -1
- package/dist/__tests__/claude-local-sanitizer.test.d.ts +0 -24
- package/dist/__tests__/claude-local-sanitizer.test.d.ts.map +0 -1
- package/dist/__tests__/claude-local-sanitizer.test.js +0 -906
- package/dist/__tests__/claude-local-sanitizer.test.js.map +0 -1
- package/dist/__tests__/claude-md-compose.test.d.ts +0 -17
- package/dist/__tests__/claude-md-compose.test.d.ts.map +0 -1
- package/dist/__tests__/claude-md-compose.test.js +0 -119
- package/dist/__tests__/claude-md-compose.test.js.map +0 -1
- package/dist/__tests__/claude-sync.test.d.ts +0 -2
- package/dist/__tests__/claude-sync.test.d.ts.map +0 -1
- package/dist/__tests__/claude-sync.test.js +0 -571
- package/dist/__tests__/claude-sync.test.js.map +0 -1
- package/dist/__tests__/cli-build-integration.test.d.ts +0 -2
- package/dist/__tests__/cli-build-integration.test.d.ts.map +0 -1
- package/dist/__tests__/cli-build-integration.test.js +0 -64
- package/dist/__tests__/cli-build-integration.test.js.map +0 -1
- package/dist/__tests__/cli-build.test.d.ts +0 -2
- package/dist/__tests__/cli-build.test.d.ts.map +0 -1
- package/dist/__tests__/cli-build.test.js +0 -640
- package/dist/__tests__/cli-build.test.js.map +0 -1
- package/dist/__tests__/codex-agent-gate.test.d.ts +0 -2
- package/dist/__tests__/codex-agent-gate.test.d.ts.map +0 -1
- package/dist/__tests__/codex-agent-gate.test.js +0 -480
- package/dist/__tests__/codex-agent-gate.test.js.map +0 -1
- package/dist/__tests__/codex-deploy-config.test.d.ts +0 -2
- package/dist/__tests__/codex-deploy-config.test.d.ts.map +0 -1
- package/dist/__tests__/codex-deploy-config.test.js +0 -1230
- package/dist/__tests__/codex-deploy-config.test.js.map +0 -1
- package/dist/__tests__/codex-trust-keys.test.d.ts +0 -2
- package/dist/__tests__/codex-trust-keys.test.d.ts.map +0 -1
- package/dist/__tests__/codex-trust-keys.test.js +0 -731
- package/dist/__tests__/codex-trust-keys.test.js.map +0 -1
- package/dist/__tests__/codex-write-race.test.d.ts +0 -2
- package/dist/__tests__/codex-write-race.test.d.ts.map +0 -1
- package/dist/__tests__/codex-write-race.test.js +0 -2253
- package/dist/__tests__/codex-write-race.test.js.map +0 -1
- package/dist/__tests__/completion-rows-discriminate.test.d.ts +0 -20
- package/dist/__tests__/completion-rows-discriminate.test.d.ts.map +0 -1
- package/dist/__tests__/completion-rows-discriminate.test.js +0 -481
- package/dist/__tests__/completion-rows-discriminate.test.js.map +0 -1
- package/dist/__tests__/config-command.test.d.ts +0 -9
- package/dist/__tests__/config-command.test.d.ts.map +0 -1
- package/dist/__tests__/config-command.test.js +0 -75
- package/dist/__tests__/config-command.test.js.map +0 -1
- package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts +0 -2
- package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts.map +0 -1
- package/dist/__tests__/config-fidelity-archived-symlinks.test.js +0 -127
- package/dist/__tests__/config-fidelity-archived-symlinks.test.js.map +0 -1
- package/dist/__tests__/config-fidelity-display.test.d.ts +0 -2
- package/dist/__tests__/config-fidelity-display.test.d.ts.map +0 -1
- package/dist/__tests__/config-fidelity-display.test.js +0 -77
- package/dist/__tests__/config-fidelity-display.test.js.map +0 -1
- package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts +0 -32
- package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts.map +0 -1
- package/dist/__tests__/config-fidelity-unreadable-fixture.js +0 -37
- package/dist/__tests__/config-fidelity-unreadable-fixture.js.map +0 -1
- package/dist/__tests__/config-fidelity.test.d.ts +0 -16
- package/dist/__tests__/config-fidelity.test.d.ts.map +0 -1
- package/dist/__tests__/config-fidelity.test.js +0 -2679
- package/dist/__tests__/config-fidelity.test.js.map +0 -1
- package/dist/__tests__/config-generation-gate.test.d.ts +0 -46
- package/dist/__tests__/config-generation-gate.test.d.ts.map +0 -1
- package/dist/__tests__/config-generation-gate.test.js +0 -435
- package/dist/__tests__/config-generation-gate.test.js.map +0 -1
- package/dist/__tests__/config-generation.test.d.ts +0 -7
- package/dist/__tests__/config-generation.test.d.ts.map +0 -1
- package/dist/__tests__/config-generation.test.js +0 -141
- package/dist/__tests__/config-generation.test.js.map +0 -1
- package/dist/__tests__/config-sync.test.d.ts +0 -10
- package/dist/__tests__/config-sync.test.d.ts.map +0 -1
- package/dist/__tests__/config-sync.test.js +0 -268
- package/dist/__tests__/config-sync.test.js.map +0 -1
- package/dist/__tests__/coordination-401-production-wiring.test.d.ts +0 -19
- package/dist/__tests__/coordination-401-production-wiring.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-401-production-wiring.test.js +0 -286
- package/dist/__tests__/coordination-401-production-wiring.test.js.map +0 -1
- package/dist/__tests__/coordination-401-recovery.test.d.ts +0 -22
- package/dist/__tests__/coordination-401-recovery.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-401-recovery.test.js +0 -601
- package/dist/__tests__/coordination-401-recovery.test.js.map +0 -1
- package/dist/__tests__/coordination-brief-pin.test.d.ts +0 -20
- package/dist/__tests__/coordination-brief-pin.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-brief-pin.test.js +0 -66
- package/dist/__tests__/coordination-brief-pin.test.js.map +0 -1
- package/dist/__tests__/coordination-brief.test.d.ts +0 -9
- package/dist/__tests__/coordination-brief.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-brief.test.js +0 -290
- package/dist/__tests__/coordination-brief.test.js.map +0 -1
- package/dist/__tests__/coordination-client.test.d.ts +0 -9
- package/dist/__tests__/coordination-client.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-client.test.js +0 -517
- package/dist/__tests__/coordination-client.test.js.map +0 -1
- package/dist/__tests__/coordination-command.test.d.ts +0 -9
- package/dist/__tests__/coordination-command.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-command.test.js +0 -1082
- package/dist/__tests__/coordination-command.test.js.map +0 -1
- package/dist/__tests__/coordination-credential-endpoint.test.d.ts +0 -24
- package/dist/__tests__/coordination-credential-endpoint.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-credential-endpoint.test.js +0 -1292
- package/dist/__tests__/coordination-credential-endpoint.test.js.map +0 -1
- package/dist/__tests__/coordination-expected-team.test.d.ts +0 -19
- package/dist/__tests__/coordination-expected-team.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-expected-team.test.js +0 -423
- package/dist/__tests__/coordination-expected-team.test.js.map +0 -1
- package/dist/__tests__/coordination-fallback.test.d.ts +0 -9
- package/dist/__tests__/coordination-fallback.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-fallback.test.js +0 -192
- package/dist/__tests__/coordination-fallback.test.js.map +0 -1
- package/dist/__tests__/coordination-file-guards.test.d.ts +0 -29
- package/dist/__tests__/coordination-file-guards.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-file-guards.test.js +0 -380
- package/dist/__tests__/coordination-file-guards.test.js.map +0 -1
- package/dist/__tests__/coordination-history.test.d.ts +0 -8
- package/dist/__tests__/coordination-history.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-history.test.js +0 -447
- package/dist/__tests__/coordination-history.test.js.map +0 -1
- package/dist/__tests__/coordination-memory.test.d.ts +0 -14
- package/dist/__tests__/coordination-memory.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-memory.test.js +0 -401
- package/dist/__tests__/coordination-memory.test.js.map +0 -1
- package/dist/__tests__/coordination-mode.test.d.ts +0 -13
- package/dist/__tests__/coordination-mode.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-mode.test.js +0 -180
- package/dist/__tests__/coordination-mode.test.js.map +0 -1
- package/dist/__tests__/coordination-plain-shell-commands.test.d.ts +0 -22
- package/dist/__tests__/coordination-plain-shell-commands.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-plain-shell-commands.test.js +0 -1875
- package/dist/__tests__/coordination-plain-shell-commands.test.js.map +0 -1
- package/dist/__tests__/coordination-provision.test.d.ts +0 -12
- package/dist/__tests__/coordination-provision.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-provision.test.js +0 -103
- package/dist/__tests__/coordination-provision.test.js.map +0 -1
- package/dist/__tests__/coordination-render.test.d.ts +0 -9
- package/dist/__tests__/coordination-render.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-render.test.js +0 -335
- package/dist/__tests__/coordination-render.test.js.map +0 -1
- package/dist/__tests__/coordination-setup.test.d.ts +0 -6
- package/dist/__tests__/coordination-setup.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-setup.test.js +0 -448
- package/dist/__tests__/coordination-setup.test.js.map +0 -1
- package/dist/__tests__/coordination-status-plain-shell.test.d.ts +0 -19
- package/dist/__tests__/coordination-status-plain-shell.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-status-plain-shell.test.js +0 -332
- package/dist/__tests__/coordination-status-plain-shell.test.js.map +0 -1
- package/dist/__tests__/coordination-status-registration.test.d.ts +0 -16
- package/dist/__tests__/coordination-status-registration.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-status-registration.test.js +0 -480
- package/dist/__tests__/coordination-status-registration.test.js.map +0 -1
- package/dist/__tests__/coordination-token-multitenant.test.d.ts +0 -11
- package/dist/__tests__/coordination-token-multitenant.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-token-multitenant.test.js +0 -106
- package/dist/__tests__/coordination-token-multitenant.test.js.map +0 -1
- package/dist/__tests__/coordination-token.test.d.ts +0 -11
- package/dist/__tests__/coordination-token.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-token.test.js +0 -201
- package/dist/__tests__/coordination-token.test.js.map +0 -1
- package/dist/__tests__/coordination-wiring.test.d.ts +0 -11
- package/dist/__tests__/coordination-wiring.test.d.ts.map +0 -1
- package/dist/__tests__/coordination-wiring.test.js +0 -43
- package/dist/__tests__/coordination-wiring.test.js.map +0 -1
- package/dist/__tests__/creation-pr-class-check.test.d.ts +0 -17
- package/dist/__tests__/creation-pr-class-check.test.d.ts.map +0 -1
- package/dist/__tests__/creation-pr-class-check.test.js +0 -346
- package/dist/__tests__/creation-pr-class-check.test.js.map +0 -1
- package/dist/__tests__/creation-step6a-push-check.test.d.ts +0 -15
- package/dist/__tests__/creation-step6a-push-check.test.d.ts.map +0 -1
- package/dist/__tests__/creation-step6a-push-check.test.js +0 -150
- package/dist/__tests__/creation-step6a-push-check.test.js.map +0 -1
- package/dist/__tests__/decision-check.test.d.ts +0 -2
- package/dist/__tests__/decision-check.test.d.ts.map +0 -1
- package/dist/__tests__/decision-check.test.js +0 -105
- package/dist/__tests__/decision-check.test.js.map +0 -1
- package/dist/__tests__/digest-fail-closed.test.d.ts +0 -16
- package/dist/__tests__/digest-fail-closed.test.d.ts.map +0 -1
- package/dist/__tests__/digest-fail-closed.test.js +0 -248
- package/dist/__tests__/digest-fail-closed.test.js.map +0 -1
- package/dist/__tests__/digest-team-omission.test.d.ts +0 -15
- package/dist/__tests__/digest-team-omission.test.d.ts.map +0 -1
- package/dist/__tests__/digest-team-omission.test.js +0 -247
- package/dist/__tests__/digest-team-omission.test.js.map +0 -1
- package/dist/__tests__/doctor-config-fidelity.test.d.ts +0 -19
- package/dist/__tests__/doctor-config-fidelity.test.d.ts.map +0 -1
- package/dist/__tests__/doctor-config-fidelity.test.js +0 -324
- package/dist/__tests__/doctor-config-fidelity.test.js.map +0 -1
- package/dist/__tests__/doctor-framework-version.test.d.ts +0 -2
- package/dist/__tests__/doctor-framework-version.test.d.ts.map +0 -1
- package/dist/__tests__/doctor-framework-version.test.js +0 -146
- package/dist/__tests__/doctor-framework-version.test.js.map +0 -1
- package/dist/__tests__/doctor-worktree-path.test.d.ts +0 -17
- package/dist/__tests__/doctor-worktree-path.test.d.ts.map +0 -1
- package/dist/__tests__/doctor-worktree-path.test.js +0 -158
- package/dist/__tests__/doctor-worktree-path.test.js.map +0 -1
- package/dist/__tests__/doctor.test.d.ts +0 -20
- package/dist/__tests__/doctor.test.d.ts.map +0 -1
- package/dist/__tests__/doctor.test.js +0 -849
- package/dist/__tests__/doctor.test.js.map +0 -1
- package/dist/__tests__/event-shipper.test.d.ts +0 -16
- package/dist/__tests__/event-shipper.test.d.ts.map +0 -1
- package/dist/__tests__/event-shipper.test.js +0 -287
- package/dist/__tests__/event-shipper.test.js.map +0 -1
- package/dist/__tests__/fleet-data.test.d.ts +0 -2
- package/dist/__tests__/fleet-data.test.d.ts.map +0 -1
- package/dist/__tests__/fleet-data.test.js +0 -501
- package/dist/__tests__/fleet-data.test.js.map +0 -1
- package/dist/__tests__/fleet-devpod.test.d.ts +0 -12
- package/dist/__tests__/fleet-devpod.test.d.ts.map +0 -1
- package/dist/__tests__/fleet-devpod.test.js +0 -260
- package/dist/__tests__/fleet-devpod.test.js.map +0 -1
- package/dist/__tests__/fleet-tmux.test.d.ts +0 -2
- package/dist/__tests__/fleet-tmux.test.d.ts.map +0 -1
- package/dist/__tests__/fleet-tmux.test.js +0 -289
- package/dist/__tests__/fleet-tmux.test.js.map +0 -1
- package/dist/__tests__/fleet.test.d.ts +0 -16
- package/dist/__tests__/fleet.test.d.ts.map +0 -1
- package/dist/__tests__/fleet.test.js +0 -75
- package/dist/__tests__/fleet.test.js.map +0 -1
- package/dist/__tests__/generate-claude.test.d.ts +0 -18
- package/dist/__tests__/generate-claude.test.d.ts.map +0 -1
- package/dist/__tests__/generate-claude.test.js +0 -1015
- package/dist/__tests__/generate-claude.test.js.map +0 -1
- package/dist/__tests__/gh-remote.test.d.ts +0 -2
- package/dist/__tests__/gh-remote.test.d.ts.map +0 -1
- package/dist/__tests__/gh-remote.test.js +0 -136
- package/dist/__tests__/gh-remote.test.js.map +0 -1
- package/dist/__tests__/git-env.test.d.ts +0 -14
- package/dist/__tests__/git-env.test.d.ts.map +0 -1
- package/dist/__tests__/git-env.test.js +0 -131
- package/dist/__tests__/git-env.test.js.map +0 -1
- package/dist/__tests__/git-identity-isolation.test.d.ts +0 -33
- package/dist/__tests__/git-identity-isolation.test.d.ts.map +0 -1
- package/dist/__tests__/git-identity-isolation.test.js +0 -626
- package/dist/__tests__/git-identity-isolation.test.js.map +0 -1
- package/dist/__tests__/harness-extract.test.d.ts +0 -19
- package/dist/__tests__/harness-extract.test.d.ts.map +0 -1
- package/dist/__tests__/harness-extract.test.js +0 -566
- package/dist/__tests__/harness-extract.test.js.map +0 -1
- package/dist/__tests__/harness-wiring.test.d.ts +0 -16
- package/dist/__tests__/harness-wiring.test.d.ts.map +0 -1
- package/dist/__tests__/harness-wiring.test.js +0 -469
- package/dist/__tests__/harness-wiring.test.js.map +0 -1
- package/dist/__tests__/hook-completeness.test.d.ts +0 -13
- package/dist/__tests__/hook-completeness.test.d.ts.map +0 -1
- package/dist/__tests__/hook-completeness.test.js +0 -238
- package/dist/__tests__/hook-completeness.test.js.map +0 -1
- package/dist/__tests__/hook-heal.test.d.ts +0 -8
- package/dist/__tests__/hook-heal.test.d.ts.map +0 -1
- package/dist/__tests__/hook-heal.test.js +0 -156
- package/dist/__tests__/hook-heal.test.js.map +0 -1
- package/dist/__tests__/human-turn-classifier.test.d.ts +0 -17
- package/dist/__tests__/human-turn-classifier.test.d.ts.map +0 -1
- package/dist/__tests__/human-turn-classifier.test.js +0 -311
- package/dist/__tests__/human-turn-classifier.test.js.map +0 -1
- package/dist/__tests__/init-coordination-url.test.d.ts +0 -11
- package/dist/__tests__/init-coordination-url.test.d.ts.map +0 -1
- package/dist/__tests__/init-coordination-url.test.js +0 -217
- package/dist/__tests__/init-coordination-url.test.js.map +0 -1
- package/dist/__tests__/isolation-probe.test.d.ts +0 -15
- package/dist/__tests__/isolation-probe.test.d.ts.map +0 -1
- package/dist/__tests__/isolation-probe.test.js +0 -611
- package/dist/__tests__/isolation-probe.test.js.map +0 -1
- package/dist/__tests__/leader-lock.test.d.ts +0 -12
- package/dist/__tests__/leader-lock.test.d.ts.map +0 -1
- package/dist/__tests__/leader-lock.test.js +0 -293
- package/dist/__tests__/leader-lock.test.js.map +0 -1
- package/dist/__tests__/memory-archive-checks.test.d.ts +0 -22
- package/dist/__tests__/memory-archive-checks.test.d.ts.map +0 -1
- package/dist/__tests__/memory-archive-checks.test.js +0 -748
- package/dist/__tests__/memory-archive-checks.test.js.map +0 -1
- package/dist/__tests__/memory-archive-prep.test.d.ts +0 -8
- package/dist/__tests__/memory-archive-prep.test.d.ts.map +0 -1
- package/dist/__tests__/memory-archive-prep.test.js +0 -524
- package/dist/__tests__/memory-archive-prep.test.js.map +0 -1
- package/dist/__tests__/memory-autocreate.test.d.ts +0 -10
- package/dist/__tests__/memory-autocreate.test.d.ts.map +0 -1
- package/dist/__tests__/memory-autocreate.test.js +0 -709
- package/dist/__tests__/memory-autocreate.test.js.map +0 -1
- package/dist/__tests__/memory-log-result.test.d.ts +0 -13
- package/dist/__tests__/memory-log-result.test.d.ts.map +0 -1
- package/dist/__tests__/memory-log-result.test.js +0 -149
- package/dist/__tests__/memory-log-result.test.js.map +0 -1
- package/dist/__tests__/memory-named-exists.test.d.ts +0 -16
- package/dist/__tests__/memory-named-exists.test.d.ts.map +0 -1
- package/dist/__tests__/memory-named-exists.test.js +0 -288
- package/dist/__tests__/memory-named-exists.test.js.map +0 -1
- package/dist/__tests__/message-bus.test.d.ts +0 -10
- package/dist/__tests__/message-bus.test.d.ts.map +0 -1
- package/dist/__tests__/message-bus.test.js +0 -526
- package/dist/__tests__/message-bus.test.js.map +0 -1
- package/dist/__tests__/monitor.test.d.ts +0 -6
- package/dist/__tests__/monitor.test.d.ts.map +0 -1
- package/dist/__tests__/monitor.test.js +0 -458
- package/dist/__tests__/monitor.test.js.map +0 -1
- package/dist/__tests__/mx-agent-cli-pin-validation.test.d.ts +0 -2
- package/dist/__tests__/mx-agent-cli-pin-validation.test.d.ts.map +0 -1
- package/dist/__tests__/mx-agent-cli-pin-validation.test.js +0 -232
- package/dist/__tests__/mx-agent-cli-pin-validation.test.js.map +0 -1
- package/dist/__tests__/mx-agent-cli-version-pin.test.d.ts +0 -2
- package/dist/__tests__/mx-agent-cli-version-pin.test.d.ts.map +0 -1
- package/dist/__tests__/mx-agent-cli-version-pin.test.js +0 -236
- package/dist/__tests__/mx-agent-cli-version-pin.test.js.map +0 -1
- package/dist/__tests__/new-project-first-team.test.d.ts +0 -15
- package/dist/__tests__/new-project-first-team.test.d.ts.map +0 -1
- package/dist/__tests__/new-project-first-team.test.js +0 -444
- package/dist/__tests__/new-project-first-team.test.js.map +0 -1
- package/dist/__tests__/otel-env.test.d.ts +0 -2
- package/dist/__tests__/otel-env.test.d.ts.map +0 -1
- package/dist/__tests__/otel-env.test.js +0 -127
- package/dist/__tests__/otel-env.test.js.map +0 -1
- package/dist/__tests__/pager-fail-closed.test.d.ts +0 -19
- package/dist/__tests__/pager-fail-closed.test.d.ts.map +0 -1
- package/dist/__tests__/pager-fail-closed.test.js +0 -229
- package/dist/__tests__/pager-fail-closed.test.js.map +0 -1
- package/dist/__tests__/pr-set-body.test.d.ts +0 -29
- package/dist/__tests__/pr-set-body.test.d.ts.map +0 -1
- package/dist/__tests__/pr-set-body.test.js +0 -314
- package/dist/__tests__/pr-set-body.test.js.map +0 -1
- package/dist/__tests__/prior-sync-failure.test.d.ts +0 -2
- package/dist/__tests__/prior-sync-failure.test.d.ts.map +0 -1
- package/dist/__tests__/prior-sync-failure.test.js +0 -81
- package/dist/__tests__/prior-sync-failure.test.js.map +0 -1
- package/dist/__tests__/project-config.test.d.ts +0 -2
- package/dist/__tests__/project-config.test.d.ts.map +0 -1
- package/dist/__tests__/project-config.test.js +0 -458
- package/dist/__tests__/project-config.test.js.map +0 -1
- package/dist/__tests__/provision-behavioral-contract.test.d.ts +0 -13
- package/dist/__tests__/provision-behavioral-contract.test.d.ts.map +0 -1
- package/dist/__tests__/provision-behavioral-contract.test.js +0 -548
- package/dist/__tests__/provision-behavioral-contract.test.js.map +0 -1
- package/dist/__tests__/provision-catalog-precondition.test.d.ts +0 -26
- package/dist/__tests__/provision-catalog-precondition.test.d.ts.map +0 -1
- package/dist/__tests__/provision-catalog-precondition.test.js +0 -622
- package/dist/__tests__/provision-catalog-precondition.test.js.map +0 -1
- package/dist/__tests__/provision-completion-rows.test.d.ts +0 -17
- package/dist/__tests__/provision-completion-rows.test.d.ts.map +0 -1
- package/dist/__tests__/provision-completion-rows.test.js +0 -3473
- package/dist/__tests__/provision-completion-rows.test.js.map +0 -1
- package/dist/__tests__/provision-copy-containment.test.d.ts +0 -19
- package/dist/__tests__/provision-copy-containment.test.d.ts.map +0 -1
- package/dist/__tests__/provision-copy-containment.test.js +0 -187
- package/dist/__tests__/provision-copy-containment.test.js.map +0 -1
- package/dist/__tests__/provision-identity-gate.test.d.ts +0 -20
- package/dist/__tests__/provision-identity-gate.test.d.ts.map +0 -1
- package/dist/__tests__/provision-identity-gate.test.js +0 -602
- package/dist/__tests__/provision-identity-gate.test.js.map +0 -1
- package/dist/__tests__/provision-resume.test.d.ts +0 -26
- package/dist/__tests__/provision-resume.test.d.ts.map +0 -1
- package/dist/__tests__/provision-resume.test.js +0 -1344
- package/dist/__tests__/provision-resume.test.js.map +0 -1
- package/dist/__tests__/provision-roleguide-anchors.test.d.ts +0 -27
- package/dist/__tests__/provision-roleguide-anchors.test.d.ts.map +0 -1
- package/dist/__tests__/provision-roleguide-anchors.test.js +0 -747
- package/dist/__tests__/provision-roleguide-anchors.test.js.map +0 -1
- package/dist/__tests__/provision-row12-stub-server.test.d.ts +0 -21
- package/dist/__tests__/provision-row12-stub-server.test.d.ts.map +0 -1
- package/dist/__tests__/provision-row12-stub-server.test.js +0 -264
- package/dist/__tests__/provision-row12-stub-server.test.js.map +0 -1
- package/dist/__tests__/provision-skeleton-fill.test.d.ts +0 -16
- package/dist/__tests__/provision-skeleton-fill.test.d.ts.map +0 -1
- package/dist/__tests__/provision-skeleton-fill.test.js +0 -490
- package/dist/__tests__/provision-skeleton-fill.test.js.map +0 -1
- package/dist/__tests__/provision-step8-commit.test.d.ts +0 -40
- package/dist/__tests__/provision-step8-commit.test.d.ts.map +0 -1
- package/dist/__tests__/provision-step8-commit.test.js +0 -529
- package/dist/__tests__/provision-step8-commit.test.js.map +0 -1
- package/dist/__tests__/provision-teambuilder-flow.test.d.ts +0 -22
- package/dist/__tests__/provision-teambuilder-flow.test.d.ts.map +0 -1
- package/dist/__tests__/provision-teambuilder-flow.test.js +0 -253
- package/dist/__tests__/provision-teambuilder-flow.test.js.map +0 -1
- package/dist/__tests__/provision-write-integrity.test.d.ts +0 -18
- package/dist/__tests__/provision-write-integrity.test.d.ts.map +0 -1
- package/dist/__tests__/provision-write-integrity.test.js +0 -141
- package/dist/__tests__/provision-write-integrity.test.js.map +0 -1
- package/dist/__tests__/repo-guard-wiring.test.d.ts +0 -21
- package/dist/__tests__/repo-guard-wiring.test.d.ts.map +0 -1
- package/dist/__tests__/repo-guard-wiring.test.js +0 -638
- package/dist/__tests__/repo-guard-wiring.test.js.map +0 -1
- package/dist/__tests__/report-format.test.d.ts +0 -2
- package/dist/__tests__/report-format.test.d.ts.map +0 -1
- package/dist/__tests__/report-format.test.js +0 -219
- package/dist/__tests__/report-format.test.js.map +0 -1
- package/dist/__tests__/row15-detail-sanitizer.test.d.ts +0 -20
- package/dist/__tests__/row15-detail-sanitizer.test.d.ts.map +0 -1
- package/dist/__tests__/row15-detail-sanitizer.test.js +0 -61
- package/dist/__tests__/row15-detail-sanitizer.test.js.map +0 -1
- package/dist/__tests__/rows-9-10-zero-remotes.test.d.ts +0 -32
- package/dist/__tests__/rows-9-10-zero-remotes.test.d.ts.map +0 -1
- package/dist/__tests__/rows-9-10-zero-remotes.test.js +0 -203
- package/dist/__tests__/rows-9-10-zero-remotes.test.js.map +0 -1
- package/dist/__tests__/runtime-claude-adapter.test.d.ts +0 -2
- package/dist/__tests__/runtime-claude-adapter.test.d.ts.map +0 -1
- package/dist/__tests__/runtime-claude-adapter.test.js +0 -70
- package/dist/__tests__/runtime-claude-adapter.test.js.map +0 -1
- package/dist/__tests__/runtime-codex-adapter.test.d.ts +0 -2
- package/dist/__tests__/runtime-codex-adapter.test.d.ts.map +0 -1
- package/dist/__tests__/runtime-codex-adapter.test.js +0 -558
- package/dist/__tests__/runtime-codex-adapter.test.js.map +0 -1
- package/dist/__tests__/runtime-codex-config.test.d.ts +0 -2
- package/dist/__tests__/runtime-codex-config.test.d.ts.map +0 -1
- package/dist/__tests__/runtime-codex-config.test.js +0 -1421
- package/dist/__tests__/runtime-codex-config.test.js.map +0 -1
- package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts +0 -2
- package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts.map +0 -1
- package/dist/__tests__/runtime-codex-gateway-pilot.test.js +0 -309
- package/dist/__tests__/runtime-codex-gateway-pilot.test.js.map +0 -1
- package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts +0 -2
- package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts.map +0 -1
- package/dist/__tests__/runtime-codex-gateway-provider.test.js +0 -163
- package/dist/__tests__/runtime-codex-gateway-provider.test.js.map +0 -1
- package/dist/__tests__/runtime-codex-guard-proof.test.d.ts +0 -2
- package/dist/__tests__/runtime-codex-guard-proof.test.d.ts.map +0 -1
- package/dist/__tests__/runtime-codex-guard-proof.test.js +0 -822
- package/dist/__tests__/runtime-codex-guard-proof.test.js.map +0 -1
- package/dist/__tests__/runtime-codex-version-pin.test.d.ts +0 -2
- package/dist/__tests__/runtime-codex-version-pin.test.d.ts.map +0 -1
- package/dist/__tests__/runtime-codex-version-pin.test.js +0 -86
- package/dist/__tests__/runtime-codex-version-pin.test.js.map +0 -1
- package/dist/__tests__/runtime-identity.test.d.ts +0 -2
- package/dist/__tests__/runtime-identity.test.d.ts.map +0 -1
- package/dist/__tests__/runtime-identity.test.js +0 -117
- package/dist/__tests__/runtime-identity.test.js.map +0 -1
- package/dist/__tests__/runtime-resolve.test.d.ts +0 -2
- package/dist/__tests__/runtime-resolve.test.d.ts.map +0 -1
- package/dist/__tests__/runtime-resolve.test.js +0 -172
- package/dist/__tests__/runtime-resolve.test.js.map +0 -1
- package/dist/__tests__/security-posture.test.d.ts +0 -8
- package/dist/__tests__/security-posture.test.d.ts.map +0 -1
- package/dist/__tests__/security-posture.test.js +0 -82
- package/dist/__tests__/security-posture.test.js.map +0 -1
- package/dist/__tests__/session-model.test.d.ts +0 -2
- package/dist/__tests__/session-model.test.d.ts.map +0 -1
- package/dist/__tests__/session-model.test.js +0 -74
- package/dist/__tests__/session-model.test.js.map +0 -1
- package/dist/__tests__/session-pause-provisioning.test.d.ts +0 -19
- package/dist/__tests__/session-pause-provisioning.test.d.ts.map +0 -1
- package/dist/__tests__/session-pause-provisioning.test.js +0 -115
- package/dist/__tests__/session-pause-provisioning.test.js.map +0 -1
- package/dist/__tests__/session-reclamation.test.d.ts +0 -15
- package/dist/__tests__/session-reclamation.test.d.ts.map +0 -1
- package/dist/__tests__/session-reclamation.test.js +0 -73
- package/dist/__tests__/session-reclamation.test.js.map +0 -1
- package/dist/__tests__/session-record-disclosure.test.d.ts +0 -24
- package/dist/__tests__/session-record-disclosure.test.d.ts.map +0 -1
- package/dist/__tests__/session-record-disclosure.test.js +0 -494
- package/dist/__tests__/session-record-disclosure.test.js.map +0 -1
- package/dist/__tests__/session-status.test.d.ts +0 -11
- package/dist/__tests__/session-status.test.d.ts.map +0 -1
- package/dist/__tests__/session-status.test.js +0 -76
- package/dist/__tests__/session-status.test.js.map +0 -1
- package/dist/__tests__/session.test.d.ts +0 -15
- package/dist/__tests__/session.test.d.ts.map +0 -1
- package/dist/__tests__/session.test.js +0 -366
- package/dist/__tests__/session.test.js.map +0 -1
- package/dist/__tests__/shim-deploy-safety.test.d.ts +0 -24
- package/dist/__tests__/shim-deploy-safety.test.d.ts.map +0 -1
- package/dist/__tests__/shim-deploy-safety.test.js +0 -174
- package/dist/__tests__/shim-deploy-safety.test.js.map +0 -1
- package/dist/__tests__/slug-validation.test.d.ts +0 -13
- package/dist/__tests__/slug-validation.test.d.ts.map +0 -1
- package/dist/__tests__/slug-validation.test.js +0 -202
- package/dist/__tests__/slug-validation.test.js.map +0 -1
- package/dist/__tests__/standards-injection.test.d.ts +0 -2
- package/dist/__tests__/standards-injection.test.d.ts.map +0 -1
- package/dist/__tests__/standards-injection.test.js +0 -179
- package/dist/__tests__/standards-injection.test.js.map +0 -1
- package/dist/__tests__/start-config-conflict.test.d.ts +0 -17
- package/dist/__tests__/start-config-conflict.test.d.ts.map +0 -1
- package/dist/__tests__/start-config-conflict.test.js +0 -101
- package/dist/__tests__/start-config-conflict.test.js.map +0 -1
- package/dist/__tests__/start-interactive-role.test.d.ts +0 -22
- package/dist/__tests__/start-interactive-role.test.d.ts.map +0 -1
- package/dist/__tests__/start-interactive-role.test.js +0 -204
- package/dist/__tests__/start-interactive-role.test.js.map +0 -1
- package/dist/__tests__/start-rebase-never-ran.test.d.ts +0 -25
- package/dist/__tests__/start-rebase-never-ran.test.d.ts.map +0 -1
- package/dist/__tests__/start-rebase-never-ran.test.js +0 -227
- package/dist/__tests__/start-rebase-never-ran.test.js.map +0 -1
- package/dist/__tests__/start-report-generation-capture.test.d.ts +0 -17
- package/dist/__tests__/start-report-generation-capture.test.d.ts.map +0 -1
- package/dist/__tests__/start-report-generation-capture.test.js +0 -127
- package/dist/__tests__/start-report-generation-capture.test.js.map +0 -1
- package/dist/__tests__/start-report-integration.test.d.ts +0 -12
- package/dist/__tests__/start-report-integration.test.d.ts.map +0 -1
- package/dist/__tests__/start-report-integration.test.js +0 -138
- package/dist/__tests__/start-report-integration.test.js.map +0 -1
- package/dist/__tests__/start-runtime-wiring.test.d.ts +0 -31
- package/dist/__tests__/start-runtime-wiring.test.d.ts.map +0 -1
- package/dist/__tests__/start-runtime-wiring.test.js +0 -735
- package/dist/__tests__/start-runtime-wiring.test.js.map +0 -1
- package/dist/__tests__/start-stash.test.d.ts +0 -2
- package/dist/__tests__/start-stash.test.d.ts.map +0 -1
- package/dist/__tests__/start-stash.test.js +0 -131
- package/dist/__tests__/start-stash.test.js.map +0 -1
- package/dist/__tests__/start-sync-hardstop.test.d.ts +0 -15
- package/dist/__tests__/start-sync-hardstop.test.d.ts.map +0 -1
- package/dist/__tests__/start-sync-hardstop.test.js +0 -280
- package/dist/__tests__/start-sync-hardstop.test.js.map +0 -1
- package/dist/__tests__/start-team-identity.test.d.ts +0 -25
- package/dist/__tests__/start-team-identity.test.d.ts.map +0 -1
- package/dist/__tests__/start-team-identity.test.js +0 -307
- package/dist/__tests__/start-team-identity.test.js.map +0 -1
- package/dist/__tests__/startup-health-render.test.d.ts +0 -11
- package/dist/__tests__/startup-health-render.test.d.ts.map +0 -1
- package/dist/__tests__/startup-health-render.test.js +0 -60
- package/dist/__tests__/startup-health-render.test.js.map +0 -1
- package/dist/__tests__/startup-policy.test.d.ts +0 -2
- package/dist/__tests__/startup-policy.test.d.ts.map +0 -1
- package/dist/__tests__/startup-policy.test.js +0 -27
- package/dist/__tests__/startup-policy.test.js.map +0 -1
- package/dist/__tests__/startup-report.test.d.ts +0 -13
- package/dist/__tests__/startup-report.test.d.ts.map +0 -1
- package/dist/__tests__/startup-report.test.js +0 -278
- package/dist/__tests__/startup-report.test.js.map +0 -1
- package/dist/__tests__/startup-shipper.test.d.ts +0 -13
- package/dist/__tests__/startup-shipper.test.d.ts.map +0 -1
- package/dist/__tests__/startup-shipper.test.js +0 -149
- package/dist/__tests__/startup-shipper.test.js.map +0 -1
- package/dist/__tests__/stream-input-controller.test.d.ts +0 -10
- package/dist/__tests__/stream-input-controller.test.d.ts.map +0 -1
- package/dist/__tests__/stream-input-controller.test.js +0 -167
- package/dist/__tests__/stream-input-controller.test.js.map +0 -1
- package/dist/__tests__/team-memory-commands.test.d.ts +0 -11
- package/dist/__tests__/team-memory-commands.test.d.ts.map +0 -1
- package/dist/__tests__/team-memory-commands.test.js +0 -240
- package/dist/__tests__/team-memory-commands.test.js.map +0 -1
- package/dist/__tests__/team-name-propagation.test.d.ts +0 -13
- package/dist/__tests__/team-name-propagation.test.d.ts.map +0 -1
- package/dist/__tests__/team-name-propagation.test.js +0 -198
- package/dist/__tests__/team-name-propagation.test.js.map +0 -1
- package/dist/__tests__/team-token-probe.test.d.ts +0 -16
- package/dist/__tests__/team-token-probe.test.d.ts.map +0 -1
- package/dist/__tests__/team-token-probe.test.js +0 -295
- package/dist/__tests__/team-token-probe.test.js.map +0 -1
- package/dist/__tests__/template-budget.test.d.ts +0 -2
- package/dist/__tests__/template-budget.test.d.ts.map +0 -1
- package/dist/__tests__/template-budget.test.js +0 -119
- package/dist/__tests__/template-budget.test.js.map +0 -1
- package/dist/__tests__/template-sync.test.d.ts +0 -19
- package/dist/__tests__/template-sync.test.d.ts.map +0 -1
- package/dist/__tests__/template-sync.test.js +0 -480
- package/dist/__tests__/template-sync.test.js.map +0 -1
- package/dist/__tests__/test-project.test.d.ts +0 -18
- package/dist/__tests__/test-project.test.d.ts.map +0 -1
- package/dist/__tests__/test-project.test.js +0 -465
- package/dist/__tests__/test-project.test.js.map +0 -1
- package/dist/__tests__/tracked-instruction-files.test.d.ts +0 -21
- package/dist/__tests__/tracked-instruction-files.test.d.ts.map +0 -1
- package/dist/__tests__/tracked-instruction-files.test.js +0 -489
- package/dist/__tests__/tracked-instruction-files.test.js.map +0 -1
- package/dist/__tests__/unlock.test.d.ts +0 -11
- package/dist/__tests__/unlock.test.d.ts.map +0 -1
- package/dist/__tests__/unlock.test.js +0 -100
- package/dist/__tests__/unlock.test.js.map +0 -1
- package/dist/__tests__/usage-per-call-grouping.test.d.ts +0 -25
- package/dist/__tests__/usage-per-call-grouping.test.d.ts.map +0 -1
- package/dist/__tests__/usage-per-call-grouping.test.js +0 -952
- package/dist/__tests__/usage-per-call-grouping.test.js.map +0 -1
- package/dist/__tests__/usage-pricing.test.d.ts +0 -20
- package/dist/__tests__/usage-pricing.test.d.ts.map +0 -1
- package/dist/__tests__/usage-pricing.test.js +0 -176
- package/dist/__tests__/usage-pricing.test.js.map +0 -1
- package/dist/__tests__/usage-subagent-discovery.test.d.ts +0 -17
- package/dist/__tests__/usage-subagent-discovery.test.d.ts.map +0 -1
- package/dist/__tests__/usage-subagent-discovery.test.js +0 -213
- package/dist/__tests__/usage-subagent-discovery.test.js.map +0 -1
- package/dist/__tests__/verify-hooks-check-all.test.d.ts +0 -32
- package/dist/__tests__/verify-hooks-check-all.test.d.ts.map +0 -1
- package/dist/__tests__/verify-hooks-check-all.test.js +0 -563
- package/dist/__tests__/verify-hooks-check-all.test.js.map +0 -1
- package/dist/__tests__/verify-hooks-heal-log.test.d.ts +0 -11
- package/dist/__tests__/verify-hooks-heal-log.test.d.ts.map +0 -1
- package/dist/__tests__/verify-hooks-heal-log.test.js +0 -172
- package/dist/__tests__/verify-hooks-heal-log.test.js.map +0 -1
- package/dist/__tests__/worker-cap.test.d.ts +0 -14
- package/dist/__tests__/worker-cap.test.d.ts.map +0 -1
- package/dist/__tests__/worker-cap.test.js +0 -97
- package/dist/__tests__/worker-cap.test.js.map +0 -1
- package/dist/__tests__/worktree-link-repair.test.d.ts +0 -2
- package/dist/__tests__/worktree-link-repair.test.d.ts.map +0 -1
- package/dist/__tests__/worktree-link-repair.test.js +0 -471
- package/dist/__tests__/worktree-link-repair.test.js.map +0 -1
- package/dist/__tests__/worktree-sync-fixture.test.d.ts +0 -17
- package/dist/__tests__/worktree-sync-fixture.test.d.ts.map +0 -1
- package/dist/__tests__/worktree-sync-fixture.test.js +0 -519
- package/dist/__tests__/worktree-sync-fixture.test.js.map +0 -1
- package/dist/__tests__/worktree-sync-hardening.test.d.ts +0 -13
- package/dist/__tests__/worktree-sync-hardening.test.d.ts.map +0 -1
- package/dist/__tests__/worktree-sync-hardening.test.js +0 -919
- package/dist/__tests__/worktree-sync-hardening.test.js.map +0 -1
- package/dist/__tests__/worktree-sync-shell-free.test.d.ts +0 -25
- package/dist/__tests__/worktree-sync-shell-free.test.d.ts.map +0 -1
- package/dist/__tests__/worktree-sync-shell-free.test.js +0 -185
- package/dist/__tests__/worktree-sync-shell-free.test.js.map +0 -1
- package/dist/__tests__/worktree.test.d.ts +0 -2
- package/dist/__tests__/worktree.test.d.ts.map +0 -1
- package/dist/__tests__/worktree.test.js +0 -168
- package/dist/__tests__/worktree.test.js.map +0 -1
- package/dist/lib/code-context-file.test.d.ts +0 -19
- package/dist/lib/code-context-file.test.d.ts.map +0 -1
- package/dist/lib/code-context-file.test.js +0 -202
- package/dist/lib/code-context-file.test.js.map +0 -1
- package/dist/lib/harness/console/announce.test.d.ts +0 -2
- package/dist/lib/harness/console/announce.test.d.ts.map +0 -1
- package/dist/lib/harness/console/announce.test.js +0 -104
- package/dist/lib/harness/console/announce.test.js.map +0 -1
- package/dist/lib/harness/console/by-session.test.d.ts +0 -2
- package/dist/lib/harness/console/by-session.test.d.ts.map +0 -1
- package/dist/lib/harness/console/by-session.test.js +0 -86
- package/dist/lib/harness/console/by-session.test.js.map +0 -1
- package/dist/lib/harness/console/console.test.d.ts +0 -2
- package/dist/lib/harness/console/console.test.d.ts.map +0 -1
- package/dist/lib/harness/console/console.test.js +0 -269
- package/dist/lib/harness/console/console.test.js.map +0 -1
- package/dist/lib/harness/console/decision-request.test.d.ts +0 -2
- package/dist/lib/harness/console/decision-request.test.d.ts.map +0 -1
- package/dist/lib/harness/console/decision-request.test.js +0 -75
- package/dist/lib/harness/console/decision-request.test.js.map +0 -1
- package/dist/lib/harness/console/rank.test.d.ts +0 -2
- package/dist/lib/harness/console/rank.test.d.ts.map +0 -1
- package/dist/lib/harness/console/rank.test.js +0 -124
- package/dist/lib/harness/console/rank.test.js.map +0 -1
- package/dist/lib/harness/console/render.test.d.ts +0 -2
- package/dist/lib/harness/console/render.test.d.ts.map +0 -1
- package/dist/lib/harness/console/render.test.js +0 -96
- package/dist/lib/harness/console/render.test.js.map +0 -1
- package/dist/lib/harness/console/replay-cli.test.d.ts +0 -2
- package/dist/lib/harness/console/replay-cli.test.d.ts.map +0 -1
- package/dist/lib/harness/console/replay-cli.test.js +0 -96
- package/dist/lib/harness/console/replay-cli.test.js.map +0 -1
- package/dist/lib/harness/console/replay.test.d.ts +0 -2
- package/dist/lib/harness/console/replay.test.d.ts.map +0 -1
- package/dist/lib/harness/console/replay.test.js +0 -81
- package/dist/lib/harness/console/replay.test.js.map +0 -1
- package/dist/lib/harness/console/turn-reader.test.d.ts +0 -2
- package/dist/lib/harness/console/turn-reader.test.d.ts.map +0 -1
- package/dist/lib/harness/console/turn-reader.test.js +0 -108
- package/dist/lib/harness/console/turn-reader.test.js.map +0 -1
- package/dist/lib/harness/credential.test.d.ts +0 -2
- package/dist/lib/harness/credential.test.d.ts.map +0 -1
- package/dist/lib/harness/credential.test.js +0 -74
- package/dist/lib/harness/credential.test.js.map +0 -1
- package/dist/lib/harness/evaluate.test.d.ts +0 -2
- package/dist/lib/harness/evaluate.test.d.ts.map +0 -1
- package/dist/lib/harness/evaluate.test.js +0 -621
- package/dist/lib/harness/evaluate.test.js.map +0 -1
- package/dist/lib/harness/gate.test.d.ts +0 -2
- package/dist/lib/harness/gate.test.d.ts.map +0 -1
- package/dist/lib/harness/gate.test.js +0 -111
- package/dist/lib/harness/gate.test.js.map +0 -1
- package/dist/lib/harness/self-check.test.d.ts +0 -2
- package/dist/lib/harness/self-check.test.d.ts.map +0 -1
- package/dist/lib/harness/self-check.test.js +0 -43
- package/dist/lib/harness/self-check.test.js.map +0 -1
- package/dist/lib/harness/transcript.test.d.ts +0 -2
- package/dist/lib/harness/transcript.test.d.ts.map +0 -1
- package/dist/lib/harness/transcript.test.js +0 -118
- package/dist/lib/harness/transcript.test.js.map +0 -1
- package/dist/lib/projects-registry.test.d.ts +0 -2
- package/dist/lib/projects-registry.test.d.ts.map +0 -1
- package/dist/lib/projects-registry.test.js +0 -176
- package/dist/lib/projects-registry.test.js.map +0 -1
- package/dist/lib/roster.test.d.ts +0 -15
- package/dist/lib/roster.test.d.ts.map +0 -1
- package/dist/lib/roster.test.js +0 -299
- package/dist/lib/roster.test.js.map +0 -1
- package/dist/lib/vault.test.d.ts +0 -17
- package/dist/lib/vault.test.d.ts.map +0 -1
- package/dist/lib/vault.test.js +0 -169
- package/dist/lib/vault.test.js.map +0 -1
- package/dist/lib/window-view.test.d.ts +0 -2
- package/dist/lib/window-view.test.d.ts.map +0 -1
- package/dist/lib/window-view.test.js +0 -168
- package/dist/lib/window-view.test.js.map +0 -1
- package/dist/standards/fail-loud-standard.md +0 -495
- package/dist/standards/known-issues-standard.md +0 -380
- package/dist/standards/rulings.md +0 -104
|
@@ -1,638 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The repo-mutation prevention is wired where it has to be (#10, #33).
|
|
3
|
-
*
|
|
4
|
-
* Two kinds of test live here, and the boundary between them is the point.
|
|
5
|
-
*
|
|
6
|
-
* The WIRING tests read source. The behaviour they protect only appears when a
|
|
7
|
-
* push runs from a linked worktree, which no unit test and no CI job can stage:
|
|
8
|
-
* CI checks out a plain clone, and a main worktree does not export GIT_DIR. That
|
|
9
|
-
* is exactly why this bug survived. So the wiring is pinned here, and the
|
|
10
|
-
* behaviour is evidenced by the sandbox reproduction recorded in #33.
|
|
11
|
-
*
|
|
12
|
-
* The SCOPE tests, added for #282, run the real comparison.
|
|
13
|
-
* src/lib/repo-guard-scope.ts holds the snapshot parsing, the writable-set
|
|
14
|
-
* computation and the classification as pure functions, so the seven refusals recorded on 2026-09-01
|
|
15
|
-
* and 2026-09-02 are replayed here as snapshot pairs. Nothing in this file
|
|
16
|
-
* pushes, and nothing in it writes a ref: a test that verified the hook by
|
|
17
|
-
* pushing would move refs in the shared store, which is the hazard the guard
|
|
18
|
-
* exists for.
|
|
19
|
-
*/
|
|
20
|
-
import { describe, it, expect } from 'vitest';
|
|
21
|
-
import { readFileSync } from 'node:fs';
|
|
22
|
-
import { spawnSync } from 'node:child_process';
|
|
23
|
-
import { createRequire } from 'node:module';
|
|
24
|
-
import { join } from 'node:path';
|
|
25
|
-
import { PREPUSH_LOCAL_REFS_ENV, buildReport, classifyChanges, computeWritableRefs, isOutOfTripwireScope, parseRefs, parseWorktrees, readPushLocalRefs, } from '../lib/repo-guard-scope.js';
|
|
26
|
-
const CLI_ROOT = join(import.meta.dirname, '..', '..');
|
|
27
|
-
const read = (rel) => readFileSync(join(CLI_ROOT, rel), 'utf-8');
|
|
28
|
-
/**
|
|
29
|
-
* The guard's two source files together.
|
|
30
|
-
*
|
|
31
|
-
* vitest.repo-guard.ts is the vitest globalSetup entry point and holds the git
|
|
32
|
-
* calls and the lifecycle. src/lib/repo-guard-scope.ts holds the scope rule, the
|
|
33
|
-
* comparison and the report text, under `src/` so tsc typechecks it and this
|
|
34
|
-
* file can import it. A source-reading assertion about the guard's wording
|
|
35
|
-
* should not have to know which of the two currently holds the line.
|
|
36
|
-
*/
|
|
37
|
-
const readGuard = () => `${read('vitest.repo-guard.ts')}\n${read('src/lib/repo-guard-scope.ts')}`;
|
|
38
|
-
describe('the inherited git environment is stripped at both chokepoints', () => {
|
|
39
|
-
it('vitest.config.ts strips it at module scope, before any worker is forked', () => {
|
|
40
|
-
const cfg = read('vitest.config.ts');
|
|
41
|
-
expect(cfg).toContain('git-env.cjs');
|
|
42
|
-
expect(cfg).toContain('stripGitEnv(process.env)');
|
|
43
|
-
// Module scope, not inside defineConfig: workers inherit process.env when
|
|
44
|
-
// they are spawned, so the deletion has to have happened already.
|
|
45
|
-
const stripAt = cfg.indexOf('stripGitEnv(process.env)');
|
|
46
|
-
const configAt = cfg.indexOf('export default defineConfig');
|
|
47
|
-
expect(stripAt).toBeGreaterThan(-1);
|
|
48
|
-
expect(stripAt).toBeLessThan(configAt);
|
|
49
|
-
});
|
|
50
|
-
it('check-new-failures.mjs hands the vitest child a cleaned environment', () => {
|
|
51
|
-
const script = read('scripts/check-new-failures.mjs');
|
|
52
|
-
expect(script).toContain('git-env.cjs');
|
|
53
|
-
expect(script).toContain('env: gitCleanEnv(process.env)');
|
|
54
|
-
});
|
|
55
|
-
it('check-new-failures.mjs captures stderr on success, not only on throw', () => {
|
|
56
|
-
const script = read('scripts/check-new-failures.mjs');
|
|
57
|
-
// execFileSync discards stderr when the command succeeds, and the tripwire
|
|
58
|
-
// reports on stderr while leaving stdout's JSON intact.
|
|
59
|
-
//
|
|
60
|
-
// Asserted on the IMPORT, not on the whole file: the script explains in a
|
|
61
|
-
// comment why it no longer uses execFileSync, and a bare substring check
|
|
62
|
-
// fails on that explanation. A test that forbids naming the thing it
|
|
63
|
-
// replaced is a test that punishes the comment.
|
|
64
|
-
expect(script).toMatch(/import \{[^}]*\bspawnSync\b[^}]*\} from 'node:child_process'/);
|
|
65
|
-
expect(script).not.toMatch(/import \{[^}]*\bexecFileSync\b[^}]*\} from 'node:child_process'/);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
describe('a guard failure reaches the operator through the hook path', () => {
|
|
69
|
-
const SENTINEL = '[repo-guard] REPO_MUTATION_DETECTED';
|
|
70
|
-
it('the guard and the pre-push checker agree on the sentinel string', () => {
|
|
71
|
-
// A drifting literal would silently restore the blindness this fixed.
|
|
72
|
-
expect(read('vitest.repo-guard.ts')).toContain(`= '${SENTINEL}'`);
|
|
73
|
-
expect(read('scripts/check-new-failures.mjs')).toContain(`= '${SENTINEL}'`);
|
|
74
|
-
});
|
|
75
|
-
it('the checker refuses the push on the sentinel, matching a whole line', () => {
|
|
76
|
-
const script = read('scripts/check-new-failures.mjs');
|
|
77
|
-
expect(script).toContain('REPO_GUARD_SENTINEL');
|
|
78
|
-
// N1: a substring match would let any test that merely QUOTES the sentinel
|
|
79
|
-
// refuse a push. The guard prints it alone on its own line.
|
|
80
|
-
expect(script).toMatch(/\.some\(\(line\) => line\.trim\(\) === REPO_GUARD_SENTINEL\)/);
|
|
81
|
-
expect(script).not.toMatch(/errOut\.includes\(REPO_GUARD_SENTINEL\)/);
|
|
82
|
-
});
|
|
83
|
-
it('the guard prints the sentinel even when MX_TEST_ALLOW_REPO_MUTATION downgrades it', () => {
|
|
84
|
-
const guard = read('vitest.repo-guard.ts');
|
|
85
|
-
const sentinelAt = guard.indexOf('console.error(REPO_GUARD_SENTINEL)');
|
|
86
|
-
const flagAt = guard.indexOf("process.env.MX_TEST_ALLOW_REPO_MUTATION === '1'");
|
|
87
|
-
expect(sentinelAt).toBeGreaterThan(-1);
|
|
88
|
-
// Printed before the downgrade branch, so one variable cannot switch off
|
|
89
|
-
// both the report and the push refusal.
|
|
90
|
-
expect(sentinelAt).toBeLessThan(flagAt);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
describe('could-not-run is reported as itself (SF-1)', () => {
|
|
94
|
-
it('the guard separates "not a repository" from "git ran and failed"', () => {
|
|
95
|
-
const guard = read('vitest.repo-guard.ts');
|
|
96
|
-
expect(guard).toContain("kind: 'no-repo'");
|
|
97
|
-
expect(guard).toContain("kind: 'no-git'");
|
|
98
|
-
expect(guard).toContain("kind: 'failed'");
|
|
99
|
-
});
|
|
100
|
-
it('teardown prints COULD NOT RUN when the repository could not be resolved', () => {
|
|
101
|
-
const guard = read('vitest.repo-guard.ts');
|
|
102
|
-
expect(guard).toContain('COULD NOT RUN: cannot resolve the repository');
|
|
103
|
-
expect(guard).toContain('Repository mutation was NOT checked');
|
|
104
|
-
});
|
|
105
|
-
it('falls back for a git with no --path-format, rather than standing down', () => {
|
|
106
|
-
// --path-format needs git >= 2.31 and the hook has a WSL branch that runs
|
|
107
|
-
// the distribution's git. Standing down there would remove the guard from
|
|
108
|
-
// the least CI-like environment there is.
|
|
109
|
-
const guard = read('vitest.repo-guard.ts');
|
|
110
|
-
expect(guard).toMatch(/tryGit\(\['rev-parse', '--git-common-dir'\]/);
|
|
111
|
-
});
|
|
112
|
-
it('the checker bounds the suite and calls a timeout could-not-run', () => {
|
|
113
|
-
const script = read('scripts/check-new-failures.mjs');
|
|
114
|
-
expect(script).toContain('SUITE_TIMEOUT_MS');
|
|
115
|
-
expect(script).toMatch(/timeout: SUITE_TIMEOUT_MS/);
|
|
116
|
-
expect(script).toContain("'ETIMEDOUT'");
|
|
117
|
-
expect(script).toContain('could-not-run, not pass');
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
describe('the report does not assert a cause it cannot establish (SF-2, narrowed by #282)', () => {
|
|
121
|
-
it('the guard no longer asks the reader to rule out a neighbour after refusing', () => {
|
|
122
|
-
// SUPERSEDED BY #282, deliberately. The old body told the reader to check
|
|
123
|
-
// whether the moved ref belonged to another team before believing the
|
|
124
|
-
// refusal, which made "run it again" the documented response. Seven
|
|
125
|
-
// recorded occurrences later, that is trained behaviour. The guard now
|
|
126
|
-
// excludes those refs before it refuses, so the instruction has nothing
|
|
127
|
-
// left to describe and its removal is asserted here rather than assumed.
|
|
128
|
-
const guard = readGuard();
|
|
129
|
-
expect(guard).not.toContain('BEFORE TREATING THIS AS CORRUPTION, RULE OUT A NEIGHBOUR');
|
|
130
|
-
expect(guard).not.toContain('Check whether the');
|
|
131
|
-
});
|
|
132
|
-
it('the checker describes what it observed, not what caused it', () => {
|
|
133
|
-
const script = read('scripts/check-new-failures.mjs');
|
|
134
|
-
expect(script).toContain('refs this worktree could have written changed while the test suite ran');
|
|
135
|
-
expect(script).not.toContain('the test suite mutated the real repository.');
|
|
136
|
-
});
|
|
137
|
-
it('the guard headline agrees with its own body and with the checker', () => {
|
|
138
|
-
// The headline used to assert mutation while the body directly below it
|
|
139
|
-
// said a sibling worktree produces the same signal. One message, two
|
|
140
|
-
// claims, and the reader had to pick.
|
|
141
|
-
const guard = readGuard();
|
|
142
|
-
expect(guard).toContain('Refs this worktree could have written changed while the CLI test suite ran (#10).');
|
|
143
|
-
expect(guard).not.toContain('The CLI test suite mutated the real repository (#10).');
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
describe('the pre-push hook resolves its own path without the inherited git env', () => {
|
|
147
|
-
const HOOK = join(CLI_ROOT, '..', '..', '.githooks', 'pre-push');
|
|
148
|
-
const hook = () => readFileSync(HOOK, 'utf-8');
|
|
149
|
-
it('unsets GIT_DIR before asking git where the worktree root is', () => {
|
|
150
|
-
// Under inherited GIT_DIR, --show-toplevel EXITS 0 and returns the cwd, so a
|
|
151
|
-
// `a || b` fallback chain never fires. Unsetting first is the only form that
|
|
152
|
-
// gets the right answer.
|
|
153
|
-
expect(hook()).toMatch(/unset GIT_DIR/);
|
|
154
|
-
expect(hook()).toContain('rev-parse --show-toplevel');
|
|
155
|
-
});
|
|
156
|
-
it('refuses with a message when it cannot find the checker', () => {
|
|
157
|
-
// A bare repository has no work tree. Dying under `set -e` with no output is
|
|
158
|
-
// the failure mode this hook exists to prevent.
|
|
159
|
-
const h = hook();
|
|
160
|
-
expect(h).toContain('cannot locate');
|
|
161
|
-
expect(h).toContain('--no-verify');
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
describe('the guard identifies the repository it is actually guarding', () => {
|
|
165
|
-
it('resolves the common dir, not --show-toplevel alone', () => {
|
|
166
|
-
const guard = read('vitest.repo-guard.ts');
|
|
167
|
-
// --show-toplevel returns the CWD under an inherited GIT_DIR, and fails
|
|
168
|
-
// outright on a bare repository that still holds a working tree.
|
|
169
|
-
expect(guard).toContain('--git-common-dir');
|
|
170
|
-
expect(guard).toContain('commonDir');
|
|
171
|
-
});
|
|
172
|
-
it('still reports the work tree, and says so when there is none', () => {
|
|
173
|
-
const guard = readGuard();
|
|
174
|
-
expect(guard).toContain('Work tree:');
|
|
175
|
-
expect(guard).toContain('bare repository');
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
// ---------------------------------------------------------------------------
|
|
179
|
-
// #282: the tripwire refuses only on refs the pushing worktree could have written
|
|
180
|
-
// ---------------------------------------------------------------------------
|
|
181
|
-
//
|
|
182
|
-
// These are behavioural, not source-reading. The comparison was extracted into
|
|
183
|
-
// pure functions so the seven refusals recorded between 2026-09-01 and
|
|
184
|
-
// 2026-09-02 could be replayed as snapshot pairs. Every one of them named a ref
|
|
185
|
-
// belonging to a worktree other than the pusher's, and every one cleared on an
|
|
186
|
-
// unmodified retry, which is the training effect #282 is about.
|
|
187
|
-
const WT = {
|
|
188
|
-
gateway: '/workspace/.worktrees/gateway-20260821',
|
|
189
|
-
bootstrap: '/workspace/.worktrees/bootstrap-20260821',
|
|
190
|
-
product: '/workspace/.worktrees/product-20260821',
|
|
191
|
-
surface: '/workspace/.worktrees/surface-20260823',
|
|
192
|
-
teamBuilder: '/workspace/.worktrees/team-builder-20260821',
|
|
193
|
-
};
|
|
194
|
-
const BRANCH = {
|
|
195
|
-
gateway: 'refs/heads/worktree/gateway-20260821',
|
|
196
|
-
bootstrap: 'refs/heads/worktree/bootstrap-20260821',
|
|
197
|
-
product: 'refs/heads/worktree/product-20260821',
|
|
198
|
-
surface: 'refs/heads/worktree/surface-20260823',
|
|
199
|
-
teamBuilder: 'refs/heads/worktree/team-builder-20260821',
|
|
200
|
-
};
|
|
201
|
-
/** The shared ref store as five active worktrees leave it. */
|
|
202
|
-
const BASE_REFS = {
|
|
203
|
-
'refs/heads/main': '64c29120000000000000000000000000000000aa',
|
|
204
|
-
[BRANCH.gateway]: 'ea7e0000000000000000000000000000000000aa',
|
|
205
|
-
[BRANCH.bootstrap]: '1f6c39a0000000000000000000000000000000aa',
|
|
206
|
-
[BRANCH.product]: 'b00b0000000000000000000000000000000000aa',
|
|
207
|
-
[BRANCH.surface]: '5a4face000000000000000000000000000000aaa',
|
|
208
|
-
[BRANCH.teamBuilder]: 'fee1000000000000000000000000000000000aaa',
|
|
209
|
-
'refs/heads/docs/surface-v8-closeout': 'd0c50000000000000000000000000000000000aa',
|
|
210
|
-
'refs/heads/docs/307-roleguide-totals-correction': 'd3070000000000000000000000000000000000aa',
|
|
211
|
-
'refs/remotes/origin/main': '462c338f00000000000000000000000000000000',
|
|
212
|
-
'refs/remotes/origin/feat/255-egress-and-counter-hardening': 'a9c199310f7e28ccc8a083911fe12a8d9ccdc88f',
|
|
213
|
-
[`refs/remotes/origin/${BRANCH.bootstrap.replace('refs/heads/', '')}`]: '1f6c39a0000000000000000000000000000000aa',
|
|
214
|
-
};
|
|
215
|
-
const BASE_WORKTREES = [
|
|
216
|
-
'worktree /workspace',
|
|
217
|
-
'bare',
|
|
218
|
-
'',
|
|
219
|
-
`worktree ${WT.gateway}`,
|
|
220
|
-
`HEAD ${BASE_REFS[BRANCH.gateway]}`,
|
|
221
|
-
`branch ${BRANCH.gateway}`,
|
|
222
|
-
'',
|
|
223
|
-
`worktree ${WT.bootstrap}`,
|
|
224
|
-
`HEAD ${BASE_REFS[BRANCH.bootstrap]}`,
|
|
225
|
-
`branch ${BRANCH.bootstrap}`,
|
|
226
|
-
'',
|
|
227
|
-
`worktree ${WT.product}`,
|
|
228
|
-
`HEAD ${BASE_REFS[BRANCH.product]}`,
|
|
229
|
-
`branch ${BRANCH.product}`,
|
|
230
|
-
'',
|
|
231
|
-
`worktree ${WT.surface}`,
|
|
232
|
-
`HEAD ${BASE_REFS[BRANCH.surface]}`,
|
|
233
|
-
`branch ${BRANCH.surface}`,
|
|
234
|
-
'',
|
|
235
|
-
].join('\n');
|
|
236
|
-
function renderRefs(refs) {
|
|
237
|
-
return `${Object.entries(refs)
|
|
238
|
-
.map(([ref, sha]) => `${ref} ${sha}`)
|
|
239
|
-
.join('\n')}\n`;
|
|
240
|
-
}
|
|
241
|
-
/** A snapshot. `null` in `refs` deletes that ref. */
|
|
242
|
-
function snapshot(opts) {
|
|
243
|
-
const refs = { ...BASE_REFS };
|
|
244
|
-
for (const [ref, sha] of Object.entries(opts.refs ?? {})) {
|
|
245
|
-
if (sha === null)
|
|
246
|
-
delete refs[ref];
|
|
247
|
-
else
|
|
248
|
-
refs[ref] = sha;
|
|
249
|
-
}
|
|
250
|
-
return {
|
|
251
|
-
head: opts.head ?? BASE_REFS[BRANCH.gateway],
|
|
252
|
-
refs: renderRefs(refs),
|
|
253
|
-
worktrees: opts.worktrees ?? BASE_WORKTREES,
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
function scopeFor(workTree, headRef, pushRefs = []) {
|
|
257
|
-
return { ...computeWritableRefs(headRef, pushRefs, workTree), workTree };
|
|
258
|
-
}
|
|
259
|
-
/** Gateway pushing `HEAD:refs/heads/docs/...`, which is how this fleet pushes. */
|
|
260
|
-
const GATEWAY_PUSH = scopeFor(WT.gateway, BRANCH.gateway, ['HEAD']);
|
|
261
|
-
describe('#282: the seven recorded refusals pass on the first attempt', () => {
|
|
262
|
-
const before = snapshot({});
|
|
263
|
-
const occurrences = [
|
|
264
|
-
{
|
|
265
|
-
name: '2026-09-01: worktree/product-20260821 moves during a gateway push',
|
|
266
|
-
scope: GATEWAY_PUSH,
|
|
267
|
-
after: snapshot({ refs: { [BRANCH.product]: 'b00b0000000000000000000000000000000000bb' } }),
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
name: '2026-09-02: worktree/surface-20260823 moves during a gateway push',
|
|
271
|
-
scope: GATEWAY_PUSH,
|
|
272
|
-
after: snapshot({ refs: { [BRANCH.surface]: '5a4face000000000000000000000000000000bbb' } }),
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
// The hard one. This branch is checked out in NO worktree, so a filter
|
|
276
|
-
// keyed on "another worktree has it checked out" would still refuse here.
|
|
277
|
-
name: '2026-09-02: docs/surface-v8-closeout, a branch no worktree has checked out',
|
|
278
|
-
scope: GATEWAY_PUSH,
|
|
279
|
-
after: snapshot({
|
|
280
|
-
refs: { 'refs/heads/docs/surface-v8-closeout': 'd0c50000000000000000000000000000000000bb' },
|
|
281
|
-
}),
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
name: '2026-09-02: bootstrap 1f6c39a -> 04c5cb4, during a gateway push',
|
|
285
|
-
scope: GATEWAY_PUSH,
|
|
286
|
-
after: snapshot({ refs: { [BRANCH.bootstrap]: '04c5cb40000000000000000000000000000000aa' } }),
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
name: '2026-09-02: bootstrap 04c5cb4 -> 11400ab, during a gateway push',
|
|
290
|
-
scope: GATEWAY_PUSH,
|
|
291
|
-
after: snapshot({ refs: { [BRANCH.bootstrap]: '11400ab0000000000000000000000000000000aa' } }),
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
// The third bootstrap refusal in that hour. No SHAs were captured for it,
|
|
295
|
-
// and an amend also rewrites the worktree's HEAD line in the porcelain.
|
|
296
|
-
name: '2026-09-02: bootstrap commit/amend, ref and its worktree HEAD line both move',
|
|
297
|
-
scope: GATEWAY_PUSH,
|
|
298
|
-
after: snapshot({
|
|
299
|
-
refs: { [BRANCH.bootstrap]: '3300aba0000000000000000000000000000000aa' },
|
|
300
|
-
worktrees: BASE_WORKTREES.replace(`HEAD ${BASE_REFS[BRANCH.bootstrap]}`, 'HEAD 3300aba0000000000000000000000000000000aa'),
|
|
301
|
-
}),
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
// The guard's teardown fired during a bootstrap QA run: a sibling team's
|
|
305
|
-
// merge landing mid-test moved the tracking ref.
|
|
306
|
-
name: '2026-09-02: origin/main advances 462c338f -> 55afdf23 during a bootstrap run',
|
|
307
|
-
scope: scopeFor(WT.bootstrap, BRANCH.bootstrap),
|
|
308
|
-
after: snapshot({
|
|
309
|
-
head: BASE_REFS[BRANCH.bootstrap],
|
|
310
|
-
refs: { 'refs/remotes/origin/main': '55afdf2300000000000000000000000000000000' },
|
|
311
|
-
}),
|
|
312
|
-
},
|
|
313
|
-
];
|
|
314
|
-
it.each(occurrences)('does not refuse: $name', ({ after, scope }) => {
|
|
315
|
-
const verdict = classifyChanges({ ...before, head: scope.workTree === WT.bootstrap ? BASE_REFS[BRANCH.bootstrap] : before.head }, after, scope);
|
|
316
|
-
expect(verdict.refusals).toEqual([]);
|
|
317
|
-
// The movement is still reported, so nothing is hidden: it is just not the
|
|
318
|
-
// pusher's fault and not a reason to refuse.
|
|
319
|
-
expect(verdict.observations.length).toBeGreaterThan(0);
|
|
320
|
-
});
|
|
321
|
-
it('the two refusals filed on issue #282 itself also pass', () => {
|
|
322
|
-
// Both named refs/remotes/*, and the pushing branch was product's.
|
|
323
|
-
const scope = scopeFor(WT.product, BRANCH.product, ['HEAD']);
|
|
324
|
-
const head = BASE_REFS[BRANCH.product];
|
|
325
|
-
const first = classifyChanges(snapshot({ head }), snapshot({
|
|
326
|
-
head,
|
|
327
|
-
refs: {
|
|
328
|
-
'refs/remotes/origin/worktree/bootstrap-20260821': '04c5cb40000000000000000000000000000000aa',
|
|
329
|
-
},
|
|
330
|
-
}), scope);
|
|
331
|
-
const second = classifyChanges(snapshot({ head }), snapshot({
|
|
332
|
-
head,
|
|
333
|
-
refs: {
|
|
334
|
-
'refs/remotes/origin/feat/255-egress-and-counter-hardening': 'ffec40e3c17d393e34a000919a7bb2063c17562d',
|
|
335
|
-
},
|
|
336
|
-
}), scope);
|
|
337
|
-
expect(first.refusals).toEqual([]);
|
|
338
|
-
expect(second.refusals).toEqual([]);
|
|
339
|
-
});
|
|
340
|
-
it('a neighbour registering a worktree is an observation, not a refusal', () => {
|
|
341
|
-
// Bootstrap provisions worktrees as its ordinary work, so this happens
|
|
342
|
-
// during other teams' pushes by design.
|
|
343
|
-
const after = snapshot({
|
|
344
|
-
worktrees: `${BASE_WORKTREES}\nworktree /workspace/.worktrees/creation-probe-20260902\nHEAD 9999999000000000000000000000000000000aaa\nbranch refs/heads/worktree/creation-probe-20260902\n`,
|
|
345
|
-
});
|
|
346
|
-
const verdict = classifyChanges(snapshot({}), after, GATEWAY_PUSH);
|
|
347
|
-
expect(verdict.refusals).toEqual([]);
|
|
348
|
-
expect(verdict.observations.join('\n')).toContain('creation-probe-20260902');
|
|
349
|
-
});
|
|
350
|
-
});
|
|
351
|
-
describe('#282: the case the guard exists for still refuses', () => {
|
|
352
|
-
it("refuses when this worktree's own branch is repointed mid-run", () => {
|
|
353
|
-
const verdict = classifyChanges(snapshot({}), snapshot({ refs: { [BRANCH.gateway]: 'f1x7u4e000000000000000000000000000000aaa' } }), GATEWAY_PUSH);
|
|
354
|
-
expect(verdict.refusals).toHaveLength(1);
|
|
355
|
-
expect(verdict.refusals[0]).toContain(BRANCH.gateway);
|
|
356
|
-
expect(verdict.refusals[0]).toContain(WT.gateway);
|
|
357
|
-
});
|
|
358
|
-
it('refuses when a ref NAMED BY THE PUSH moves, even though HEAD is elsewhere', () => {
|
|
359
|
-
// `git push origin docs/307-...:refs/heads/docs/307-...` from the gateway
|
|
360
|
-
// worktree. The moved ref is not the checked-out branch, so a filter keyed
|
|
361
|
-
// on the worktree's own branch would miss it. This is the case the bootstrap
|
|
362
|
-
// lead flagged as the design's hard part.
|
|
363
|
-
const scope = scopeFor(WT.gateway, BRANCH.gateway, [
|
|
364
|
-
'refs/heads/docs/307-roleguide-totals-correction',
|
|
365
|
-
]);
|
|
366
|
-
const verdict = classifyChanges(snapshot({}), snapshot({
|
|
367
|
-
refs: {
|
|
368
|
-
'refs/heads/docs/307-roleguide-totals-correction': 'd3070000000000000000000000000000000000bb',
|
|
369
|
-
// A neighbour moves in the same window. It must not be a refusal, and
|
|
370
|
-
// it must still be reported next to the one that is.
|
|
371
|
-
[BRANCH.surface]: '5a4face000000000000000000000000000000bbb',
|
|
372
|
-
},
|
|
373
|
-
}), scope);
|
|
374
|
-
expect(verdict.refusals).toHaveLength(1);
|
|
375
|
-
expect(verdict.refusals[0]).toContain('docs/307-roleguide-totals-correction');
|
|
376
|
-
expect(verdict.refusals[0]).toContain('named by this push');
|
|
377
|
-
expect(verdict.observations.join('\n')).toContain(BRANCH.surface);
|
|
378
|
-
});
|
|
379
|
-
it('refuses when a short ref name from the push refspec moves', () => {
|
|
380
|
-
const scope = scopeFor(WT.gateway, BRANCH.gateway, ['docs/surface-v8-closeout']);
|
|
381
|
-
const verdict = classifyChanges(snapshot({}), snapshot({
|
|
382
|
-
refs: { 'refs/heads/docs/surface-v8-closeout': 'd0c50000000000000000000000000000000000bb' },
|
|
383
|
-
}), scope);
|
|
384
|
-
expect(verdict.refusals).toHaveLength(1);
|
|
385
|
-
expect(verdict.refusals[0]).toContain('named by this push');
|
|
386
|
-
});
|
|
387
|
-
it("refuses when this worktree's HEAD moves, which no neighbour can do", () => {
|
|
388
|
-
const verdict = classifyChanges(snapshot({}), snapshot({ head: 'dead0000000000000000000000000000000000aa' }), GATEWAY_PUSH);
|
|
389
|
-
expect(verdict.refusals).toHaveLength(1);
|
|
390
|
-
expect(verdict.refusals[0]).toContain('HEAD moved');
|
|
391
|
-
});
|
|
392
|
-
it("refuses when this worktree's own entry leaves the worktree list", () => {
|
|
393
|
-
const after = snapshot({
|
|
394
|
-
worktrees: BASE_WORKTREES.split('\n\n')
|
|
395
|
-
.filter((block) => !block.startsWith(`worktree ${WT.gateway}`))
|
|
396
|
-
.join('\n\n'),
|
|
397
|
-
});
|
|
398
|
-
const verdict = classifyChanges(snapshot({}), after, GATEWAY_PUSH);
|
|
399
|
-
expect(verdict.refusals.join('\n')).toContain(`worktree unregistered: ${WT.gateway}`);
|
|
400
|
-
});
|
|
401
|
-
it('replays the 2026-08-21 incident and still refuses on both work-losing changes', () => {
|
|
402
|
-
// The push came from the team-builder worktree. HEAD moved to a fixture
|
|
403
|
-
// commit and worktree/team-builder-20260821 was repointed at another; both
|
|
404
|
-
// destroy the pusher's work and both are still refusals. The stray `f3` and
|
|
405
|
-
// `feature` branches from the same incident are observations now, which
|
|
406
|
-
// vitest.repo-guard.ts states as a deliberate loss.
|
|
407
|
-
const scope = scopeFor(WT.teamBuilder, BRANCH.teamBuilder, ['HEAD']);
|
|
408
|
-
const head = BASE_REFS[BRANCH.teamBuilder];
|
|
409
|
-
const verdict = classifyChanges(snapshot({ head }), snapshot({
|
|
410
|
-
head: '1111111000000000000000000000000000000aaa',
|
|
411
|
-
refs: {
|
|
412
|
-
[BRANCH.teamBuilder]: '2222222000000000000000000000000000000aaa',
|
|
413
|
-
'refs/heads/f3': '3333333000000000000000000000000000000aaa',
|
|
414
|
-
'refs/heads/feature': '4444444000000000000000000000000000000aaa',
|
|
415
|
-
'refs/remotes/origin/main': '5555555000000000000000000000000000000aaa',
|
|
416
|
-
},
|
|
417
|
-
}), scope);
|
|
418
|
-
expect(verdict.refusals).toHaveLength(2);
|
|
419
|
-
expect(verdict.refusals.join('\n')).toContain('HEAD moved');
|
|
420
|
-
expect(verdict.refusals.join('\n')).toContain(BRANCH.teamBuilder);
|
|
421
|
-
expect(verdict.observations.join('\n')).toContain('refs/heads/f3');
|
|
422
|
-
});
|
|
423
|
-
it('refuses when a teammate commits in the SAME worktree, and says so', () => {
|
|
424
|
-
// Live evidence, 2026-09-02: 2e45a9c -> 8d115f9 -> 3cc9dbe -> ad0f27d in
|
|
425
|
-
// worktree/bootstrap-20260821 during one full suite run, by another session
|
|
426
|
-
// sharing this worktree. Under the scope rule that is a refusal, because the
|
|
427
|
-
// head the push reads moved underneath it. It differs from every one of the
|
|
428
|
-
// seven #282 cases, where the mover was a DIFFERENT worktree.
|
|
429
|
-
const verdict = classifyChanges(snapshot({}), snapshot({
|
|
430
|
-
head: 'ad0f27d1000000000000000000000000000000aa',
|
|
431
|
-
refs: { [BRANCH.gateway]: 'ad0f27d1000000000000000000000000000000aa' },
|
|
432
|
-
}), GATEWAY_PUSH);
|
|
433
|
-
expect(verdict.refusals).toHaveLength(2);
|
|
434
|
-
expect(verdict.refusals.join('\n')).toContain("this worktree's own HEAD");
|
|
435
|
-
expect(verdict.observations).toEqual([]);
|
|
436
|
-
});
|
|
437
|
-
it('refuses on a deleted writable ref, not only a moved one', () => {
|
|
438
|
-
const verdict = classifyChanges(snapshot({}), snapshot({ refs: { [BRANCH.gateway]: null } }), GATEWAY_PUSH);
|
|
439
|
-
expect(verdict.refusals).toHaveLength(1);
|
|
440
|
-
expect(verdict.refusals[0]).toContain('deleted, was');
|
|
441
|
-
});
|
|
442
|
-
it('an unchanged repository produces neither a refusal nor an observation', () => {
|
|
443
|
-
const verdict = classifyChanges(snapshot({}), snapshot({}), GATEWAY_PUSH);
|
|
444
|
-
expect(verdict).toEqual({ refusals: [], observations: [] });
|
|
445
|
-
});
|
|
446
|
-
});
|
|
447
|
-
describe('#282: what counts as writable, and what can never count', () => {
|
|
448
|
-
it("includes the branch HEAD is on, attributed to this worktree's path", () => {
|
|
449
|
-
const s = computeWritableRefs(BRANCH.gateway, [], WT.gateway);
|
|
450
|
-
expect([...s.writableRefs]).toContain(BRANCH.gateway);
|
|
451
|
-
expect(s.writableSources.get(BRANCH.gateway)).toContain(WT.gateway);
|
|
452
|
-
});
|
|
453
|
-
it('contributes nothing from a detached HEAD, rather than guessing', () => {
|
|
454
|
-
const s = computeWritableRefs(null, [], WT.gateway);
|
|
455
|
-
expect([...s.writableRefs]).toEqual([]);
|
|
456
|
-
});
|
|
457
|
-
it('ignores the (delete) token git writes for a delete refspec', () => {
|
|
458
|
-
const s = computeWritableRefs(null, ['(delete)'], WT.gateway);
|
|
459
|
-
expect([...s.writableRefs]).toEqual([]);
|
|
460
|
-
});
|
|
461
|
-
it('treats a bare HEAD token as already covered by the checked-out branch', () => {
|
|
462
|
-
const s = computeWritableRefs(BRANCH.gateway, ['HEAD'], WT.gateway);
|
|
463
|
-
expect([...s.writableRefs]).toEqual([BRANCH.gateway]);
|
|
464
|
-
});
|
|
465
|
-
it('qualifies a short name both ways, because a superset only widens refusal', () => {
|
|
466
|
-
const s = computeWritableRefs(null, ['v1.2.3'], WT.gateway);
|
|
467
|
-
expect([...s.writableRefs].sort()).toEqual(['refs/heads/v1.2.3', 'refs/tags/v1.2.3']);
|
|
468
|
-
});
|
|
469
|
-
it('never admits a remote-tracking ref, even when the push names one', () => {
|
|
470
|
-
// This guard is for local work loss (KI-SHARED-WORKTREE-GIT-MUTATION), not
|
|
471
|
-
// remote drift, and every team on this machine fetches into one ref store.
|
|
472
|
-
const s = computeWritableRefs('refs/remotes/origin/main', ['refs/remotes/origin/main'], WT.gateway);
|
|
473
|
-
expect([...s.writableRefs]).toEqual([]);
|
|
474
|
-
expect(isOutOfTripwireScope('refs/remotes/origin/main')).toBe(true);
|
|
475
|
-
expect(isOutOfTripwireScope('refs/heads/main')).toBe(false);
|
|
476
|
-
});
|
|
477
|
-
it('reads the push refs from the environment the hook sets', () => {
|
|
478
|
-
expect(PREPUSH_LOCAL_REFS_ENV).toBe('MX_PREPUSH_LOCAL_REFS');
|
|
479
|
-
expect(readPushLocalRefs({ [PREPUSH_LOCAL_REFS_ENV]: ' refs/heads/a refs/heads/b ' })).toEqual([
|
|
480
|
-
'refs/heads/a',
|
|
481
|
-
'refs/heads/b',
|
|
482
|
-
]);
|
|
483
|
-
expect(readPushLocalRefs({})).toEqual([]);
|
|
484
|
-
});
|
|
485
|
-
});
|
|
486
|
-
describe('#282: the snapshot parsers attribute lines to the right owner', () => {
|
|
487
|
-
it('parses ref lines into names and object ids', () => {
|
|
488
|
-
const parsed = parseRefs('refs/heads/a aaa\nrefs/heads/b bbb\n\n');
|
|
489
|
-
expect(parsed.get('refs/heads/a')).toBe('aaa');
|
|
490
|
-
expect(parsed.size).toBe(2);
|
|
491
|
-
});
|
|
492
|
-
it('keeps each porcelain HEAD line with the worktree that owns it', () => {
|
|
493
|
-
// A line-set diff of the porcelain loses this, so a sibling's HEAD line
|
|
494
|
-
// moving was indistinguishable from this worktree's. That is the same
|
|
495
|
-
// misattribution #282 is about, one level down.
|
|
496
|
-
const parsed = parseWorktrees(BASE_WORKTREES);
|
|
497
|
-
expect(parsed.get(WT.bootstrap)).toContain(`branch ${BRANCH.bootstrap}`);
|
|
498
|
-
expect(parsed.get(WT.gateway)).not.toContain(BRANCH.bootstrap);
|
|
499
|
-
expect(parsed.get('/workspace')).toBe('bare');
|
|
500
|
-
});
|
|
501
|
-
});
|
|
502
|
-
describe('#282: the refusal text stops the reader instead of training a retry', () => {
|
|
503
|
-
const report = buildReport({ commonDir: '/workspace/.git', workTree: WT.gateway }, classifyChanges(snapshot({}), snapshot({
|
|
504
|
-
refs: {
|
|
505
|
-
[BRANCH.gateway]: 'f1x7u4e000000000000000000000000000000aaa',
|
|
506
|
-
[BRANCH.surface]: '5a4face000000000000000000000000000000bbb',
|
|
507
|
-
},
|
|
508
|
-
}), GATEWAY_PUSH));
|
|
509
|
-
it('says what moved and that it is in this worktree\'s writable set', () => {
|
|
510
|
-
expect(report).toContain("IN THIS WORKTREE'S WRITABLE SET, which is why the push is refused:");
|
|
511
|
-
expect(report).toContain(BRANCH.gateway);
|
|
512
|
-
expect(report).toContain('moved:');
|
|
513
|
-
});
|
|
514
|
-
it('tells the reader to stop, and says the retry cannot clear it', () => {
|
|
515
|
-
expect(report).toContain('DO NOT RETRY THIS PUSH');
|
|
516
|
-
expect(report).toContain('a\n second run cannot clear it');
|
|
517
|
-
});
|
|
518
|
-
it('names both causes, so the reader is not sent to grep for a teammate', () => {
|
|
519
|
-
// Observed live on 2026-09-02 while this fix was being written: a second
|
|
520
|
-
// session committed three times in this worktree during a full suite run,
|
|
521
|
-
// and the guard refused on HEAD, the branch and the worktree entry. That
|
|
522
|
-
// refusal is correct, and "find the test that did it" is the wrong first
|
|
523
|
-
// instruction for it.
|
|
524
|
-
expect(report).toContain('CAUSE 1: ANOTHER SESSION COMMITTED IN THIS WORKTREE');
|
|
525
|
-
expect(report).toContain('CAUSE 2: A TEST DROVE GIT AGAINST THIS REPOSITORY');
|
|
526
|
-
expect(report).toContain('git reflog');
|
|
527
|
-
});
|
|
528
|
-
it('makes the only push-again advice conditional on reading the reflog first', () => {
|
|
529
|
-
// The one sentence that mentions pushing again must not stand alone. The
|
|
530
|
-
// documented response for seven recorded refusals was an unconditional
|
|
531
|
-
// retry, and that is the habit this whole change exists to unlearn.
|
|
532
|
-
expect(report).toContain('Push again only after reading the reflog and\n confirming the new head is work you meant to publish.');
|
|
533
|
-
expect(report).not.toMatch(/run the (identical|same) command again/i);
|
|
534
|
-
expect(report).not.toMatch(/retry(ing)? (the|this) push\b(?!\.)/i);
|
|
535
|
-
});
|
|
536
|
-
it('names the neighbour movement separately and says it is not the reason', () => {
|
|
537
|
-
expect(report).toContain('ALSO OBSERVED, AND NOT THE REASON FOR THIS REFUSAL');
|
|
538
|
-
expect(report).toContain(BRANCH.surface);
|
|
539
|
-
});
|
|
540
|
-
it('keeps the recovery steps, which are what an operator needs after a real one', () => {
|
|
541
|
-
expect(report).toContain('git reflog');
|
|
542
|
-
expect(report).toContain('git update-ref refs/heads/<your-branch> <your-sha>');
|
|
543
|
-
});
|
|
544
|
-
});
|
|
545
|
-
describe('#282: the hook tells the guard which refs the push names', () => {
|
|
546
|
-
const HOOK = join(CLI_ROOT, '..', '..', '.githooks', 'pre-push');
|
|
547
|
-
const hook = () => readFileSync(HOOK, 'utf-8');
|
|
548
|
-
it('reads field 1 of git\'s pre-push stdin and exports it', () => {
|
|
549
|
-
// Simulating the contract rather than pushing: a real push to verify the
|
|
550
|
-
// hook would need a remote and would move refs in the shared store, which is
|
|
551
|
-
// the hazard this guard exists for.
|
|
552
|
-
const h = hook();
|
|
553
|
-
expect(h).toMatch(/while read -r local_ref/);
|
|
554
|
-
expect(h).toContain('export MX_PREPUSH_LOCAL_REFS');
|
|
555
|
-
// git supplies stdin; a hand-run hook must not block waiting for a terminal.
|
|
556
|
-
expect(h).toContain('if [ ! -t 0 ]; then');
|
|
557
|
-
});
|
|
558
|
-
/**
|
|
559
|
-
* Run the hook's OWN read-loop under `sh` against fixture stdin, and report
|
|
560
|
-
* what it exported and how it exited.
|
|
561
|
-
*
|
|
562
|
-
* Behavioural rather than source-text (security review C1). The assertion this
|
|
563
|
-
* replaces was `expect(h).toContain('*[!A-Za-z0-9._/-]*)')`, which passed for
|
|
564
|
-
* the fail-open version and would pass for any version that still contains
|
|
565
|
-
* that string, including one that logs and continues. It could not tell the
|
|
566
|
-
* two apart, and the fail-open behaviour is what shipped.
|
|
567
|
-
*
|
|
568
|
-
* The loop is extracted from the hook by its own delimiters, so this exercises
|
|
569
|
-
* the shipped text and not a copy that can drift away from it.
|
|
570
|
-
*/
|
|
571
|
-
function runRefLoop(stdin) {
|
|
572
|
-
const h = hook();
|
|
573
|
-
const start = h.indexOf('MX_PREPUSH_LOCAL_REFS=""');
|
|
574
|
-
const end = h.indexOf('export MX_PREPUSH_LOCAL_REFS');
|
|
575
|
-
expect(start, 'the read-loop delimiters are still in the hook').toBeGreaterThan(-1);
|
|
576
|
-
expect(end).toBeGreaterThan(start);
|
|
577
|
-
const loop = h.slice(start, end);
|
|
578
|
-
const res = spawnSync('sh', ['-c', `${loop}\nprintf '%s' "$MX_PREPUSH_LOCAL_REFS"`], {
|
|
579
|
-
input: stdin,
|
|
580
|
-
encoding: 'utf-8',
|
|
581
|
-
});
|
|
582
|
-
return { status: res.status ?? -1, refs: res.stdout, stderr: res.stderr };
|
|
583
|
-
}
|
|
584
|
-
it('exports names inside the class and skips the (delete) token', () => {
|
|
585
|
-
const out = runRefLoop('refs/heads/feat/x aaa refs/heads/feat/x bbb\n'
|
|
586
|
-
+ '(delete) 0000 refs/heads/gone 1111\n'
|
|
587
|
-
+ 'refs/heads/main.2_v-3 ccc refs/heads/main ddd\n');
|
|
588
|
-
expect(out.status).toBe(0);
|
|
589
|
-
expect(out.refs).toBe('refs/heads/feat/x refs/heads/main.2_v-3 ');
|
|
590
|
-
});
|
|
591
|
-
it('REFUSES on a hostile name rather than dropping it, and exports nothing', () => {
|
|
592
|
-
// A single quote would end the quoted string run_wsl builds. The old
|
|
593
|
-
// behaviour logged and continued, which left the ref outside the writable
|
|
594
|
-
// set: `repo-guard-scope.ts:53` makes membership the thing that refuses, so
|
|
595
|
-
// a dropped name is a ref whose mid-run mutation would NOT be refused.
|
|
596
|
-
const out = runRefLoop("refs/heads/it's-fine aaa refs/heads/x bbb\n");
|
|
597
|
-
expect(out.status).toBe(1);
|
|
598
|
-
expect(out.refs).toBe('');
|
|
599
|
-
expect(out.stderr).toContain('REFUSED');
|
|
600
|
-
expect(out.stderr).toContain("refs/heads/it's-fine");
|
|
601
|
-
expect(out.stderr).toContain('--no-verify');
|
|
602
|
-
});
|
|
603
|
-
it('REFUSES a name git accepts but the class does not, so the gap fails closed', () => {
|
|
604
|
-
// Every one of these is `git check-ref-format`-legal and outside the class.
|
|
605
|
-
// They are the four the security review named, and they are the case the
|
|
606
|
-
// fail-open version was silently unprotected against.
|
|
607
|
-
for (const name of ['café-feature', 'a+b', 'feat@v2', "it's-fine"]) {
|
|
608
|
-
const out = runRefLoop(`refs/heads/${name} aaa refs/heads/${name} bbb\n`);
|
|
609
|
-
expect(out.status, name).toBe(1);
|
|
610
|
-
expect(out.refs, name).toBe('');
|
|
611
|
-
expect(out.stderr, name).toContain(name);
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
it('refuses even when a legal name precedes the offending one', () => {
|
|
615
|
-
// The refusal must not depend on position: an early good ref must not let a
|
|
616
|
-
// later bad one through on a partially-built value.
|
|
617
|
-
const out = runRefLoop('refs/heads/good aaa refs/heads/good bbb\nrefs/heads/a+b ccc refs/heads/a+b ddd\n');
|
|
618
|
-
expect(out.status).toBe(1);
|
|
619
|
-
expect(out.refs).toBe('');
|
|
620
|
-
});
|
|
621
|
-
it('carries the variable across the WSL boundary', () => {
|
|
622
|
-
expect(hook()).toContain("export MX_PREPUSH_LOCAL_REFS='$MX_PREPUSH_LOCAL_REFS';");
|
|
623
|
-
});
|
|
624
|
-
it('the guard and the hook agree on the variable name', () => {
|
|
625
|
-
expect(readGuard()).toContain(`= '${PREPUSH_LOCAL_REFS_ENV}'`);
|
|
626
|
-
expect(hook()).toContain(PREPUSH_LOCAL_REFS_ENV);
|
|
627
|
-
});
|
|
628
|
-
it('the git-env sweep does not remove it on the way to the vitest child', () => {
|
|
629
|
-
// gitCleanEnv strips GIT_-prefixed names. A sweep that also dropped this one
|
|
630
|
-
// would narrow the writable set to the checked-out branch, silently.
|
|
631
|
-
const require_ = createRequire(import.meta.url);
|
|
632
|
-
const { gitCleanEnv } = require_(join(CLI_ROOT, '..', '..', 'testing-tools', 'git-env.cjs'));
|
|
633
|
-
const out = gitCleanEnv({ [PREPUSH_LOCAL_REFS_ENV]: 'refs/heads/a', GIT_DIR: '/x' });
|
|
634
|
-
expect(out[PREPUSH_LOCAL_REFS_ENV]).toBe('refs/heads/a');
|
|
635
|
-
expect(out.GIT_DIR).toBeUndefined();
|
|
636
|
-
});
|
|
637
|
-
});
|
|
638
|
-
//# sourceMappingURL=repo-guard-wiring.test.js.map
|