@lannguyensi/harness 0.63.0 → 1.0.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/CHANGELOG.md +90 -0
- package/README.md +46 -42
- package/dist/cli/add/index.js +17 -21
- package/dist/cli/add/index.js.map +1 -1
- package/dist/cli/adopt/derive.d.ts +2 -2
- package/dist/cli/adopt/derive.js +2 -19
- package/dist/cli/adopt/derive.js.map +1 -1
- package/dist/cli/adopt/index.d.ts +1 -1
- package/dist/cli/adopt/index.js +1 -12
- package/dist/cli/adopt/index.js.map +1 -1
- package/dist/cli/apply/apply.d.ts +20 -35
- package/dist/cli/apply/apply.js +61 -136
- package/dist/cli/apply/apply.js.map +1 -1
- package/dist/cli/apply/generate-codex-config.js +10 -58
- package/dist/cli/apply/generate-codex-config.js.map +1 -1
- package/dist/cli/apply/generate-memory-index.js +1 -2
- package/dist/cli/apply/generate-memory-index.js.map +1 -1
- package/dist/cli/apply/generate-opencode-config.d.ts +2 -10
- package/dist/cli/apply/generate-opencode-config.js +74 -113
- package/dist/cli/apply/generate-opencode-config.js.map +1 -1
- package/dist/cli/apply/generate-settings.d.ts +11 -64
- package/dist/cli/apply/generate-settings.js +27 -132
- package/dist/cli/apply/generate-settings.js.map +1 -1
- package/dist/cli/apply/index.d.ts +1 -1
- package/dist/cli/apply/index.js +1 -1
- package/dist/cli/apply/index.js.map +1 -1
- package/dist/cli/apply/install-codex-config.d.ts +153 -1
- package/dist/cli/apply/install-codex-config.js +445 -70
- package/dist/cli/apply/install-codex-config.js.map +1 -1
- package/dist/cli/apply/next-steps.d.ts +7 -0
- package/dist/cli/apply/next-steps.js +13 -1
- package/dist/cli/apply/next-steps.js.map +1 -1
- package/dist/cli/bounded-stdin.d.ts +0 -23
- package/dist/cli/bounded-stdin.js +2 -49
- package/dist/cli/bounded-stdin.js.map +1 -1
- package/dist/cli/describe.d.ts +1 -1
- package/dist/cli/describe.js +0 -3
- package/dist/cli/describe.js.map +1 -1
- package/dist/cli/diff/engine.d.ts +0 -11
- package/dist/cli/diff/engine.js +1 -17
- package/dist/cli/diff/engine.js.map +1 -1
- package/dist/cli/diff/index.js +14 -25
- package/dist/cli/diff/index.js.map +1 -1
- package/dist/cli/doctor/claude-mcp.d.ts +4 -19
- package/dist/cli/doctor/claude-mcp.js +11 -22
- package/dist/cli/doctor/claude-mcp.js.map +1 -1
- package/dist/cli/doctor/codex.d.ts +12 -14
- package/dist/cli/doctor/codex.js +31 -144
- package/dist/cli/doctor/codex.js.map +1 -1
- package/dist/cli/doctor/format.js +23 -338
- package/dist/cli/doctor/format.js.map +1 -1
- package/dist/cli/doctor/hook-liveness.d.ts +56 -0
- package/dist/cli/doctor/hook-liveness.js +455 -0
- package/dist/cli/doctor/hook-liveness.js.map +1 -0
- package/dist/cli/doctor/index.d.ts +13 -87
- package/dist/cli/doctor/index.js +57 -705
- package/dist/cli/doctor/index.js.map +1 -1
- package/dist/cli/doctor/opencode.d.ts +2 -1
- package/dist/cli/doctor/opencode.js.map +1 -1
- package/dist/cli/doctor/types.d.ts +21 -378
- package/dist/cli/doctor/types.js.map +1 -1
- package/dist/cli/drain-stdio.d.ts +31 -0
- package/dist/cli/drain-stdio.js +76 -0
- package/dist/cli/drain-stdio.js.map +1 -0
- package/dist/cli/export.d.ts +3 -1
- package/dist/cli/export.js +7 -16
- package/dist/cli/export.js.map +1 -1
- package/dist/cli/gate/codex-disable.d.ts +29 -0
- package/dist/cli/gate/codex-disable.js +195 -0
- package/dist/cli/gate/codex-disable.js.map +1 -0
- package/dist/cli/gate/codex-enable.d.ts +41 -0
- package/dist/cli/gate/codex-enable.js +127 -0
- package/dist/cli/gate/codex-enable.js.map +1 -0
- package/dist/cli/gate/codex-snapshot.d.ts +208 -0
- package/dist/cli/gate/codex-snapshot.js +402 -0
- package/dist/cli/gate/codex-snapshot.js.map +1 -0
- package/dist/cli/gate/disable.d.ts +9 -0
- package/dist/cli/gate/disable.js +263 -28
- package/dist/cli/gate/disable.js.map +1 -1
- package/dist/cli/gate/enable.d.ts +26 -6
- package/dist/cli/gate/enable.js +152 -80
- package/dist/cli/gate/enable.js.map +1 -1
- package/dist/cli/gate/link-chain.d.ts +53 -0
- package/dist/cli/gate/link-chain.js +122 -0
- package/dist/cli/gate/link-chain.js.map +1 -0
- package/dist/cli/gate/snapshot.d.ts +289 -12
- package/dist/cli/gate/snapshot.js +481 -22
- package/dist/cli/gate/snapshot.js.map +1 -1
- package/dist/cli/index.d.ts +0 -9
- package/dist/cli/index.js +15 -2607
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/composer.d.ts +3 -6
- package/dist/cli/init/composer.js +6 -370
- package/dist/cli/init/composer.js.map +1 -1
- package/dist/cli/init/dependencies.d.ts +1 -2
- package/dist/cli/init/dependencies.js +4 -80
- package/dist/cli/init/dependencies.js.map +1 -1
- package/dist/cli/init/detect.js +5 -4
- package/dist/cli/init/detect.js.map +1 -1
- package/dist/cli/init/interactive.d.ts +1 -23
- package/dist/cli/init/interactive.js +33 -247
- package/dist/cli/init/interactive.js.map +1 -1
- package/dist/cli/init/profiles.d.ts +2 -2
- package/dist/cli/init/profiles.js +51 -243
- package/dist/cli/init/profiles.js.map +1 -1
- package/dist/cli/init/templates.d.ts +2 -37
- package/dist/cli/init/templates.js +25 -1237
- package/dist/cli/init/templates.js.map +1 -1
- package/dist/cli/list.d.ts +1 -1
- package/dist/cli/list.js +1 -38
- package/dist/cli/list.js.map +1 -1
- package/dist/cli/loader.d.ts +15 -1
- package/dist/cli/loader.js +56 -39
- package/dist/cli/loader.js.map +1 -1
- package/dist/cli/main.js +7 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migrate-home/index.js +2 -2
- package/dist/cli/migrate-home/index.js.map +1 -1
- package/dist/cli/pack/add.js +1 -1
- package/dist/cli/pack/add.js.map +1 -1
- package/dist/cli/pack/hook-bootstrap.d.ts +5 -164
- package/dist/cli/pack/hook-bootstrap.js +15 -291
- package/dist/cli/pack/hook-bootstrap.js.map +1 -1
- package/dist/cli/pack/hook-branch-protection.d.ts +28 -21
- package/dist/cli/pack/hook-branch-protection.js +365 -340
- package/dist/cli/pack/hook-branch-protection.js.map +1 -1
- package/dist/cli/pack/index.d.ts +0 -1
- package/dist/cli/pack/index.js +0 -1
- package/dist/cli/pack/index.js.map +1 -1
- package/dist/cli/pack/list.js +1 -6
- package/dist/cli/pack/list.js.map +1 -1
- package/dist/cli/pack/mutate.d.ts +7 -9
- package/dist/cli/pack/mutate.js +6 -9
- package/dist/cli/pack/mutate.js.map +1 -1
- package/dist/cli/pack/reseed.d.ts +2 -2
- package/dist/cli/pack/reseed.js +16 -22
- package/dist/cli/pack/reseed.js.map +1 -1
- package/dist/cli/register-gate-group.d.ts +5 -0
- package/dist/cli/register-gate-group.js +348 -0
- package/dist/cli/register-gate-group.js.map +1 -0
- package/dist/cli/register-inspect-group.d.ts +6 -0
- package/dist/cli/register-inspect-group.js +189 -0
- package/dist/cli/register-inspect-group.js.map +1 -0
- package/dist/cli/register-operator-lifecycle.d.ts +5 -0
- package/dist/cli/register-operator-lifecycle.js +20 -0
- package/dist/cli/register-operator-lifecycle.js.map +1 -0
- package/dist/cli/register-pack-group.d.ts +5 -0
- package/dist/cli/register-pack-group.js +134 -0
- package/dist/cli/register-pack-group.js.map +1 -0
- package/dist/cli/register-setup-group.d.ts +5 -0
- package/dist/cli/register-setup-group.js +495 -0
- package/dist/cli/register-setup-group.js.map +1 -0
- package/dist/cli/remove/index.d.ts +0 -14
- package/dist/cli/remove/index.js +2 -115
- package/dist/cli/remove/index.js.map +1 -1
- package/dist/cli/remove/mutate.d.ts +0 -2
- package/dist/cli/remove/mutate.js +1 -19
- package/dist/cli/remove/mutate.js.map +1 -1
- package/dist/cli/remove/register.d.ts +5 -0
- package/dist/cli/remove/register.js +25 -0
- package/dist/cli/remove/register.js.map +1 -0
- package/dist/cli/shell-quote.d.ts +7 -0
- package/dist/cli/shell-quote.js +17 -0
- package/dist/cli/shell-quote.js.map +1 -0
- package/dist/cli/uninstall/index.d.ts +4 -2
- package/dist/cli/uninstall/index.js +15 -7
- package/dist/cli/uninstall/index.js.map +1 -1
- package/dist/cli/uninstall/register.d.ts +5 -0
- package/dist/cli/uninstall/register.js +171 -0
- package/dist/cli/uninstall/register.js.map +1 -0
- package/dist/cli/uninstall/snapshot.d.ts +15 -0
- package/dist/cli/uninstall/snapshot.js +38 -0
- package/dist/cli/uninstall/snapshot.js.map +1 -1
- package/dist/cli/validate/checks.d.ts +0 -77
- package/dist/cli/validate/checks.js +3 -1049
- package/dist/cli/validate/checks.js.map +1 -1
- package/dist/cli/validate/index.js +19 -15
- package/dist/cli/validate/index.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/io/claude-mcp.d.ts +1 -1
- package/dist/io/claude-mcp.js +27 -14
- package/dist/io/claude-mcp.js.map +1 -1
- package/dist/io/harness-lock.js +2 -2
- package/dist/io/harness-lock.js.map +1 -1
- package/dist/io/lock.d.ts +0 -26
- package/dist/io/lock.js +10 -27
- package/dist/io/lock.js.map +1 -1
- package/dist/io/merge-settings.js +6 -4
- package/dist/io/merge-settings.js.map +1 -1
- package/dist/io/project-name.d.ts +22 -39
- package/dist/io/project-name.js +25 -42
- package/dist/io/project-name.js.map +1 -1
- package/dist/io/read-regular-file.d.ts +103 -40
- package/dist/io/read-regular-file.js +196 -35
- package/dist/io/read-regular-file.js.map +1 -1
- package/dist/io/restart-hints.js +3 -6
- package/dist/io/restart-hints.js.map +1 -1
- package/dist/io/version-compare.d.ts +1 -3
- package/dist/io/version-compare.js +1 -3
- package/dist/io/version-compare.js.map +1 -1
- package/dist/io/write-regular-file.d.ts +30 -0
- package/dist/io/write-regular-file.js +85 -0
- package/dist/io/write-regular-file.js.map +1 -0
- package/dist/overrides/index.d.ts +1 -0
- package/dist/overrides/index.js +1 -0
- package/dist/overrides/index.js.map +1 -1
- package/dist/overrides/merge-layers.d.ts +43 -0
- package/dist/overrides/merge-layers.js +76 -0
- package/dist/overrides/merge-layers.js.map +1 -0
- package/dist/overrides/merge.d.ts +16 -0
- package/dist/overrides/merge.js +21 -8
- package/dist/overrides/merge.js.map +1 -1
- package/dist/policy-packs/builtin/branch-protection-runtime.d.ts +4 -69
- package/dist/policy-packs/builtin/branch-protection-runtime.js +12 -84
- package/dist/policy-packs/builtin/branch-protection-runtime.js.map +1 -1
- package/dist/policy-packs/builtin/branch-protection.d.ts +7 -30
- package/dist/policy-packs/builtin/branch-protection.js +56 -89
- package/dist/policy-packs/builtin/branch-protection.js.map +1 -1
- package/dist/policy-packs/config-check.d.ts +7 -5
- package/dist/policy-packs/config-check.js +2 -2
- package/dist/policy-packs/config-check.js.map +1 -1
- package/dist/policy-packs/expand.d.ts +1 -3
- package/dist/policy-packs/expand.js +5 -42
- package/dist/policy-packs/expand.js.map +1 -1
- package/dist/policy-packs/index.d.ts +3 -3
- package/dist/policy-packs/index.js +2 -2
- package/dist/policy-packs/index.js.map +1 -1
- package/dist/policy-packs/registry.d.ts +9 -38
- package/dist/policy-packs/registry.js +5 -65
- package/dist/policy-packs/registry.js.map +1 -1
- package/dist/policy-packs/runtime.d.ts +0 -4
- package/dist/policy-packs/runtime.js +9 -22
- package/dist/policy-packs/runtime.js.map +1 -1
- package/dist/policy-packs/types.d.ts +0 -19
- package/dist/policy-packs/ux-compare.d.ts +1 -11
- package/dist/policy-packs/ux-compare.js +6 -42
- package/dist/policy-packs/ux-compare.js.map +1 -1
- package/dist/policy-packs/ux-drift-check.d.ts +5 -5
- package/dist/policy-packs/ux-drift-check.js +17 -22
- package/dist/policy-packs/ux-drift-check.js.map +1 -1
- package/dist/policy-packs/version-check.d.ts +5 -26
- package/dist/policy-packs/version-check.js +19 -74
- package/dist/policy-packs/version-check.js.map +1 -1
- package/dist/probes/memory.d.ts +1 -1
- package/dist/probes/memory.js +1 -1
- package/dist/probes/memory.js.map +1 -1
- package/dist/runtime/agent-facing.d.ts +9 -0
- package/dist/runtime/agent-facing.js +28 -14
- package/dist/runtime/agent-facing.js.map +1 -1
- package/dist/runtime/bounded-text.d.ts +15 -0
- package/dist/runtime/bounded-text.js +27 -0
- package/dist/runtime/bounded-text.js.map +1 -0
- package/dist/runtime/git-branch.d.ts +125 -0
- package/dist/runtime/git-branch.js +381 -0
- package/dist/runtime/git-branch.js.map +1 -0
- package/dist/runtime/hermetic-spawn-guard.d.ts +2 -2
- package/dist/runtime/hermetic-spawn-guard.js +24 -34
- package/dist/runtime/hermetic-spawn-guard.js.map +1 -1
- package/dist/runtime/home-dir.js +3 -2
- package/dist/runtime/home-dir.js.map +1 -1
- package/dist/runtime/tool-name-aliases.d.ts +0 -6
- package/dist/runtime/tool-name-aliases.js +5 -18
- package/dist/runtime/tool-name-aliases.js.map +1 -1
- package/dist/schema/grounding.d.ts +7 -54
- package/dist/schema/grounding.js +10 -12
- package/dist/schema/grounding.js.map +1 -1
- package/dist/schema/hooks.d.ts +39 -136
- package/dist/schema/hooks.js +3 -6
- package/dist/schema/hooks.js.map +1 -1
- package/dist/schema/index.d.ts +114 -3828
- package/dist/schema/index.js +41 -80
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/memory.d.ts +54 -131
- package/dist/schema/memory.js +2 -2
- package/dist/schema/memory.js.map +1 -1
- package/dist/schema/policy-packs.d.ts +3 -45
- package/dist/schema/policy-packs.js +7 -13
- package/dist/schema/policy-packs.js.map +1 -1
- package/dist/schema/policy-ux.d.ts +7 -0
- package/dist/schema/policy-ux.js +18 -0
- package/dist/schema/policy-ux.js.map +1 -0
- package/dist/schema/removed-keys.d.ts +185 -0
- package/dist/schema/removed-keys.js +531 -0
- package/dist/schema/removed-keys.js.map +1 -0
- package/dist/schema/tools.d.ts +30 -268
- package/dist/schema/tools.js +4 -4
- package/dist/schema/tools.js.map +1 -1
- package/package.json +5 -16
- package/dist/cli/approve/branch-protection.d.ts +0 -69
- package/dist/cli/approve/branch-protection.js +0 -144
- package/dist/cli/approve/branch-protection.js.map +0 -1
- package/dist/cli/approve/risk.d.ts +0 -112
- package/dist/cli/approve/risk.js +0 -197
- package/dist/cli/approve/risk.js.map +0 -1
- package/dist/cli/approve/stdin-report.d.ts +0 -57
- package/dist/cli/approve/stdin-report.js +0 -145
- package/dist/cli/approve/stdin-report.js.map +0 -1
- package/dist/cli/approve/understanding.d.ts +0 -410
- package/dist/cli/approve/understanding.js +0 -996
- package/dist/cli/approve/understanding.js.map +0 -1
- package/dist/cli/audit.d.ts +0 -80
- package/dist/cli/audit.js +0 -252
- package/dist/cli/audit.js.map +0 -1
- package/dist/cli/delegate/index.d.ts +0 -76
- package/dist/cli/delegate/index.js +0 -443
- package/dist/cli/delegate/index.js.map +0 -1
- package/dist/cli/doctor/auto-approve-mode.d.ts +0 -37
- package/dist/cli/doctor/auto-approve-mode.js +0 -80
- package/dist/cli/doctor/auto-approve-mode.js.map +0 -1
- package/dist/cli/doctor/bypass-without-auto-approve.d.ts +0 -38
- package/dist/cli/doctor/bypass-without-auto-approve.js +0 -95
- package/dist/cli/doctor/bypass-without-auto-approve.js.map +0 -1
- package/dist/cli/doctor/codex-config-drift.d.ts +0 -28
- package/dist/cli/doctor/codex-config-drift.js +0 -240
- package/dist/cli/doctor/codex-config-drift.js.map +0 -1
- package/dist/cli/doctor/rogue-ledger.d.ts +0 -53
- package/dist/cli/doctor/rogue-ledger.js +0 -153
- package/dist/cli/doctor/rogue-ledger.js.map +0 -1
- package/dist/cli/doctor/session-start-preflight-setup-version.d.ts +0 -83
- package/dist/cli/doctor/session-start-preflight-setup-version.js +0 -114
- package/dist/cli/doctor/session-start-preflight-setup-version.js.map +0 -1
- package/dist/cli/doctor/settings-drift.d.ts +0 -25
- package/dist/cli/doctor/settings-drift.js +0 -213
- package/dist/cli/doctor/settings-drift.js.map +0 -1
- package/dist/cli/doctor/toolchain-parity.d.ts +0 -63
- package/dist/cli/doctor/toolchain-parity.js +0 -154
- package/dist/cli/doctor/toolchain-parity.js.map +0 -1
- package/dist/cli/doctor/ug-auto-approvals.d.ts +0 -40
- package/dist/cli/doctor/ug-auto-approvals.js +0 -91
- package/dist/cli/doctor/ug-auto-approvals.js.map +0 -1
- package/dist/cli/doctor/ug-delegations.d.ts +0 -26
- package/dist/cli/doctor/ug-delegations.js +0 -121
- package/dist/cli/doctor/ug-delegations.js.map +0 -1
- package/dist/cli/doctor/ug-inflight.d.ts +0 -35
- package/dist/cli/doctor/ug-inflight.js +0 -57
- package/dist/cli/doctor/ug-inflight.js.map +0 -1
- package/dist/cli/doctor/understanding-mode-env.d.ts +0 -51
- package/dist/cli/doctor/understanding-mode-env.js +0 -98
- package/dist/cli/doctor/understanding-mode-env.js.map +0 -1
- package/dist/cli/dry-run.d.ts +0 -46
- package/dist/cli/dry-run.js +0 -250
- package/dist/cli/dry-run.js.map +0 -1
- package/dist/cli/event-input.d.ts +0 -28
- package/dist/cli/event-input.js +0 -73
- package/dist/cli/event-input.js.map +0 -1
- package/dist/cli/explain-action.d.ts +0 -20
- package/dist/cli/explain-action.js +0 -27
- package/dist/cli/explain-action.js.map +0 -1
- package/dist/cli/explain-policy.d.ts +0 -135
- package/dist/cli/explain-policy.js +0 -266
- package/dist/cli/explain-policy.js.map +0 -1
- package/dist/cli/explain.d.ts +0 -31
- package/dist/cli/explain.js +0 -159
- package/dist/cli/explain.js.map +0 -1
- package/dist/cli/gc/index.d.ts +0 -63
- package/dist/cli/gc/index.js +0 -566
- package/dist/cli/gc/index.js.map +0 -1
- package/dist/cli/pack/approve-escape.d.ts +0 -19
- package/dist/cli/pack/approve-escape.js +0 -190
- package/dist/cli/pack/approve-escape.js.map +0 -1
- package/dist/cli/pack/auto-approve-path.d.ts +0 -146
- package/dist/cli/pack/auto-approve-path.js +0 -462
- package/dist/cli/pack/auto-approve-path.js.map +0 -1
- package/dist/cli/pack/hook-codex-post-tool-use.d.ts +0 -25
- package/dist/cli/pack/hook-codex-post-tool-use.js +0 -160
- package/dist/cli/pack/hook-codex-post-tool-use.js.map +0 -1
- package/dist/cli/pack/hook-codex-pre-tool-use.d.ts +0 -48
- package/dist/cli/pack/hook-codex-pre-tool-use.js +0 -474
- package/dist/cli/pack/hook-codex-pre-tool-use.js.map +0 -1
- package/dist/cli/pack/hook-codex-stop.d.ts +0 -35
- package/dist/cli/pack/hook-codex-stop.js +0 -329
- package/dist/cli/pack/hook-codex-stop.js.map +0 -1
- package/dist/cli/pack/hook-codex-user-prompt-submit.d.ts +0 -24
- package/dist/cli/pack/hook-codex-user-prompt-submit.js +0 -93
- package/dist/cli/pack/hook-codex-user-prompt-submit.js.map +0 -1
- package/dist/cli/pack/hook-post-merge-gate-record.d.ts +0 -37
- package/dist/cli/pack/hook-post-merge-gate-record.js +0 -190
- package/dist/cli/pack/hook-post-merge-gate-record.js.map +0 -1
- package/dist/cli/pack/hook-post-merge-gate.d.ts +0 -34
- package/dist/cli/pack/hook-post-merge-gate.js +0 -277
- package/dist/cli/pack/hook-post-merge-gate.js.map +0 -1
- package/dist/cli/pack/hook-post-tool-use.d.ts +0 -45
- package/dist/cli/pack/hook-post-tool-use.js +0 -137
- package/dist/cli/pack/hook-post-tool-use.js.map +0 -1
- package/dist/cli/pack/hook-pre-tool-use.d.ts +0 -92
- package/dist/cli/pack/hook-pre-tool-use.js +0 -1328
- package/dist/cli/pack/hook-pre-tool-use.js.map +0 -1
- package/dist/cli/pack/hook-runtime-reality.d.ts +0 -63
- package/dist/cli/pack/hook-runtime-reality.js +0 -210
- package/dist/cli/pack/hook-runtime-reality.js.map +0 -1
- package/dist/cli/pack/hook-solution-acceptance-writeguard.d.ts +0 -32
- package/dist/cli/pack/hook-solution-acceptance-writeguard.js +0 -337
- package/dist/cli/pack/hook-solution-acceptance-writeguard.js.map +0 -1
- package/dist/cli/pack/hook-solution-acceptance.d.ts +0 -157
- package/dist/cli/pack/hook-solution-acceptance.js +0 -530
- package/dist/cli/pack/hook-solution-acceptance.js.map +0 -1
- package/dist/cli/pack/hook-stay-in-scope.d.ts +0 -37
- package/dist/cli/pack/hook-stay-in-scope.js +0 -128
- package/dist/cli/pack/hook-stay-in-scope.js.map +0 -1
- package/dist/cli/pack/hook-subagent-start.d.ts +0 -23
- package/dist/cli/pack/hook-subagent-start.js +0 -88
- package/dist/cli/pack/hook-subagent-start.js.map +0 -1
- package/dist/cli/pack/hook-subagent-stop.d.ts +0 -19
- package/dist/cli/pack/hook-subagent-stop.js +0 -41
- package/dist/cli/pack/hook-subagent-stop.js.map +0 -1
- package/dist/cli/pack/hook-track-active-claim.d.ts +0 -27
- package/dist/cli/pack/hook-track-active-claim.js +0 -275
- package/dist/cli/pack/hook-track-active-claim.js.map +0 -1
- package/dist/cli/pack/transcript-report-scan.d.ts +0 -71
- package/dist/cli/pack/transcript-report-scan.js +0 -359
- package/dist/cli/pack/transcript-report-scan.js.map +0 -1
- package/dist/cli/pack/understanding-report-schema-hint.d.ts +0 -26
- package/dist/cli/pack/understanding-report-schema-hint.js +0 -120
- package/dist/cli/pack/understanding-report-schema-hint.js.map +0 -1
- package/dist/cli/pack/upgrade.d.ts +0 -32
- package/dist/cli/pack/upgrade.js +0 -273
- package/dist/cli/pack/upgrade.js.map +0 -1
- package/dist/cli/pause/index.d.ts +0 -113
- package/dist/cli/pause/index.js +0 -251
- package/dist/cli/pause/index.js.map +0 -1
- package/dist/cli/pause-check.d.ts +0 -22
- package/dist/cli/pause-check.js +0 -54
- package/dist/cli/pause-check.js.map +0 -1
- package/dist/cli/policy/intercept.d.ts +0 -233
- package/dist/cli/policy/intercept.js +0 -1020
- package/dist/cli/policy/intercept.js.map +0 -1
- package/dist/cli/policy/risk-envelope-enrichment.d.ts +0 -40
- package/dist/cli/policy/risk-envelope-enrichment.js +0 -108
- package/dist/cli/policy/risk-envelope-enrichment.js.map +0 -1
- package/dist/cli/record/index.d.ts +0 -81
- package/dist/cli/record/index.js +0 -348
- package/dist/cli/record/index.js.map +0 -1
- package/dist/cli/resolve-env.d.ts +0 -32
- package/dist/cli/resolve-env.js +0 -47
- package/dist/cli/resolve-env.js.map +0 -1
- package/dist/cli/session-export/index.d.ts +0 -46
- package/dist/cli/session-export/index.js +0 -169
- package/dist/cli/session-export/index.js.map +0 -1
- package/dist/cli/session-export/redact.d.ts +0 -22
- package/dist/cli/session-export/redact.js +0 -47
- package/dist/cli/session-export/redact.js.map +0 -1
- package/dist/cli/session-export/transcript.d.ts +0 -24
- package/dist/cli/session-export/transcript.js +0 -164
- package/dist/cli/session-export/transcript.js.map +0 -1
- package/dist/cli/session-start/branch-check.d.ts +0 -18
- package/dist/cli/session-start/branch-check.js +0 -140
- package/dist/cli/session-start/branch-check.js.map +0 -1
- package/dist/cli/session-start/index.d.ts +0 -121
- package/dist/cli/session-start/index.js +0 -591
- package/dist/cli/session-start/index.js.map +0 -1
- package/dist/cli/session-start/shared-options.d.ts +0 -103
- package/dist/cli/session-start/shared-options.js +0 -107
- package/dist/cli/session-start/shared-options.js.map +0 -1
- package/dist/cli/session-start/stale-base-check.d.ts +0 -46
- package/dist/cli/session-start/stale-base-check.js +0 -352
- package/dist/cli/session-start/stale-base-check.js.map +0 -1
- package/dist/cli/session-start/toolchain-parity.d.ts +0 -267
- package/dist/cli/session-start/toolchain-parity.js +0 -797
- package/dist/cli/session-start/toolchain-parity.js.map +0 -1
- package/dist/cli/smoke/assertions.d.ts +0 -46
- package/dist/cli/smoke/assertions.js +0 -170
- package/dist/cli/smoke/assertions.js.map +0 -1
- package/dist/cli/smoke/index.d.ts +0 -76
- package/dist/cli/smoke/index.js +0 -245
- package/dist/cli/smoke/index.js.map +0 -1
- package/dist/cli/smoke/runner.d.ts +0 -55
- package/dist/cli/smoke/runner.js +0 -134
- package/dist/cli/smoke/runner.js.map +0 -1
- package/dist/cli/smoke/stream-parser.d.ts +0 -65
- package/dist/cli/smoke/stream-parser.js +0 -115
- package/dist/cli/smoke/stream-parser.js.map +0 -1
- package/dist/cli/test-risk.d.ts +0 -26
- package/dist/cli/test-risk.js +0 -34
- package/dist/cli/test-risk.js.map +0 -1
- package/dist/io/display-path.d.ts +0 -11
- package/dist/io/display-path.js +0 -29
- package/dist/io/display-path.js.map +0 -1
- package/dist/io/duration.d.ts +0 -5
- package/dist/io/duration.js +0 -50
- package/dist/io/duration.js.map +0 -1
- package/dist/io/extract.d.ts +0 -79
- package/dist/io/extract.js +0 -226
- package/dist/io/extract.js.map +0 -1
- package/dist/io/ledger-record.d.ts +0 -83
- package/dist/io/ledger-record.js +0 -301
- package/dist/io/ledger-record.js.map +0 -1
- package/dist/io/read-json-dir-entries.d.ts +0 -36
- package/dist/io/read-json-dir-entries.js +0 -48
- package/dist/io/read-json-dir-entries.js.map +0 -1
- package/dist/io/safe-json-parse.d.ts +0 -5
- package/dist/io/safe-json-parse.js +0 -21
- package/dist/io/safe-json-parse.js.map +0 -1
- package/dist/policies/index.d.ts +0 -5
- package/dist/policies/index.js +0 -6
- package/dist/policies/index.js.map +0 -1
- package/dist/policies/ledger-client.d.ts +0 -113
- package/dist/policies/ledger-client.js +0 -500
- package/dist/policies/ledger-client.js.map +0 -1
- package/dist/policies/producers.d.ts +0 -12
- package/dist/policies/producers.js +0 -61
- package/dist/policies/producers.js.map +0 -1
- package/dist/policies/requires.d.ts +0 -75
- package/dist/policies/requires.js +0 -240
- package/dist/policies/requires.js.map +0 -1
- package/dist/policies/timestamp.d.ts +0 -14
- package/dist/policies/timestamp.js +0 -36
- package/dist/policies/timestamp.js.map +0 -1
- package/dist/policy-packs/builtin/permission-profiles.d.ts +0 -11
- package/dist/policy-packs/builtin/permission-profiles.js +0 -74
- package/dist/policy-packs/builtin/permission-profiles.js.map +0 -1
- package/dist/policy-packs/builtin/post-merge-gate-runtime.d.ts +0 -286
- package/dist/policy-packs/builtin/post-merge-gate-runtime.js +0 -397
- package/dist/policy-packs/builtin/post-merge-gate-runtime.js.map +0 -1
- package/dist/policy-packs/builtin/post-merge-gate.d.ts +0 -56
- package/dist/policy-packs/builtin/post-merge-gate.js +0 -347
- package/dist/policy-packs/builtin/post-merge-gate.js.map +0 -1
- package/dist/policy-packs/builtin/solution-acceptance-reconnect.d.ts +0 -50
- package/dist/policy-packs/builtin/solution-acceptance-reconnect.js +0 -151
- package/dist/policy-packs/builtin/solution-acceptance-reconnect.js.map +0 -1
- package/dist/policy-packs/builtin/solution-acceptance-runtime.d.ts +0 -323
- package/dist/policy-packs/builtin/solution-acceptance-runtime.js +0 -672
- package/dist/policy-packs/builtin/solution-acceptance-runtime.js.map +0 -1
- package/dist/policy-packs/builtin/solution-acceptance.d.ts +0 -45
- package/dist/policy-packs/builtin/solution-acceptance.js +0 -226
- package/dist/policy-packs/builtin/solution-acceptance.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/active-claim.d.ts +0 -25
- package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js +0 -94
- package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.d.ts +0 -35
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js +0 -86
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.d.ts +0 -210
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js +0 -361
- package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.d.ts +0 -304
- package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js +0 -734
- package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.d.ts +0 -36
- package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js +0 -73
- package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/index.d.ts +0 -19
- package/dist/policy-packs/builtin/understanding-before-execution/index.js +0 -83
- package/dist/policy-packs/builtin/understanding-before-execution/index.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.d.ts +0 -135
- package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js +0 -618
- package/dist/policy-packs/builtin/understanding-before-execution/inflight-records.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/ledger.d.ts +0 -25
- package/dist/policy-packs/builtin/understanding-before-execution/ledger.js +0 -56
- package/dist/policy-packs/builtin/understanding-before-execution/ledger.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.d.ts +0 -20
- package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js +0 -93
- package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/markers.d.ts +0 -126
- package/dist/policy-packs/builtin/understanding-before-execution/markers.js +0 -245
- package/dist/policy-packs/builtin/understanding-before-execution/markers.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.d.ts +0 -29
- package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js +0 -82
- package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.d.ts +0 -71
- package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js +0 -175
- package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.d.ts +0 -620
- package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js +0 -1047
- package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.d.ts +0 -128
- package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js +0 -213
- package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.d.ts +0 -129
- package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js +0 -166
- package/dist/policy-packs/builtin/understanding-before-execution/stay-in-scope-config.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution/task-markers.d.ts +0 -164
- package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js +0 -275
- package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.d.ts +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js +0 -10
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js.map +0 -1
- package/dist/policy-packs/builtin/understanding-before-execution.d.ts +0 -526
- package/dist/policy-packs/builtin/understanding-before-execution.js +0 -1074
- package/dist/policy-packs/builtin/understanding-before-execution.js.map +0 -1
- package/dist/policy-packs/permission-translator.d.ts +0 -9
- package/dist/policy-packs/permission-translator.js +0 -76
- package/dist/policy-packs/permission-translator.js.map +0 -1
- package/dist/runtime/action-envelope.d.ts +0 -64
- package/dist/runtime/action-envelope.js +0 -46
- package/dist/runtime/action-envelope.js.map +0 -1
- package/dist/runtime/approval-signing.d.ts +0 -111
- package/dist/runtime/approval-signing.js +0 -384
- package/dist/runtime/approval-signing.js.map +0 -1
- package/dist/runtime/bash-match-facts.d.ts +0 -60
- package/dist/runtime/bash-match-facts.js +0 -196
- package/dist/runtime/bash-match-facts.js.map +0 -1
- package/dist/runtime/bash-match-registry.d.ts +0 -112
- package/dist/runtime/bash-match-registry.js +0 -406
- package/dist/runtime/bash-match-registry.js.map +0 -1
- package/dist/runtime/bash-prefix-parse.d.ts +0 -31
- package/dist/runtime/bash-prefix-parse.js +0 -576
- package/dist/runtime/bash-prefix-parse.js.map +0 -1
- package/dist/runtime/command-normalize.d.ts +0 -658
- package/dist/runtime/command-normalize.js +0 -2410
- package/dist/runtime/command-normalize.js.map +0 -1
- package/dist/runtime/deletion-target-resolve.d.ts +0 -28
- package/dist/runtime/deletion-target-resolve.js +0 -1078
- package/dist/runtime/deletion-target-resolve.js.map +0 -1
- package/dist/runtime/destructive-shell-floor.d.ts +0 -19
- package/dist/runtime/destructive-shell-floor.js +0 -611
- package/dist/runtime/destructive-shell-floor.js.map +0 -1
- package/dist/runtime/environment-resolver.d.ts +0 -36
- package/dist/runtime/environment-resolver.js +0 -138
- package/dist/runtime/environment-resolver.js.map +0 -1
- package/dist/runtime/git-context.d.ts +0 -201
- package/dist/runtime/git-context.js +0 -422
- package/dist/runtime/git-context.js.map +0 -1
- package/dist/runtime/index.d.ts +0 -12
- package/dist/runtime/index.js +0 -13
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/intercept.d.ts +0 -494
- package/dist/runtime/intercept.js +0 -1313
- package/dist/runtime/intercept.js.map +0 -1
- package/dist/runtime/kube-context.d.ts +0 -16
- package/dist/runtime/kube-context.js +0 -63
- package/dist/runtime/kube-context.js.map +0 -1
- package/dist/runtime/kubectl-target-parse.d.ts +0 -31
- package/dist/runtime/kubectl-target-parse.js +0 -249
- package/dist/runtime/kubectl-target-parse.js.map +0 -1
- package/dist/runtime/ledger-add.d.ts +0 -16
- package/dist/runtime/ledger-add.js +0 -150
- package/dist/runtime/ledger-add.js.map +0 -1
- package/dist/runtime/ledger-writer.d.ts +0 -27
- package/dist/runtime/ledger-writer.js +0 -46
- package/dist/runtime/ledger-writer.js.map +0 -1
- package/dist/runtime/pause-sentinel.d.ts +0 -60
- package/dist/runtime/pause-sentinel.js +0 -156
- package/dist/runtime/pause-sentinel.js.map +0 -1
- package/dist/runtime/pending-approval.d.ts +0 -23
- package/dist/runtime/pending-approval.js +0 -67
- package/dist/runtime/pending-approval.js.map +0 -1
- package/dist/runtime/read-only-bash.d.ts +0 -141
- package/dist/runtime/read-only-bash.js +0 -2204
- package/dist/runtime/read-only-bash.js.map +0 -1
- package/dist/runtime/recovery-git-commit.d.ts +0 -22
- package/dist/runtime/recovery-git-commit.js +0 -284
- package/dist/runtime/recovery-git-commit.js.map +0 -1
- package/dist/runtime/reject-malformed-session-id.d.ts +0 -8
- package/dist/runtime/reject-malformed-session-id.js +0 -16
- package/dist/runtime/reject-malformed-session-id.js.map +0 -1
- package/dist/runtime/risk-classifier.d.ts +0 -38
- package/dist/runtime/risk-classifier.js +0 -311
- package/dist/runtime/risk-classifier.js.map +0 -1
- package/dist/runtime/session-id.d.ts +0 -113
- package/dist/runtime/session-id.js +0 -193
- package/dist/runtime/session-id.js.map +0 -1
- package/dist/runtime/shell-word.d.ts +0 -62
- package/dist/runtime/shell-word.js +0 -410
- package/dist/runtime/shell-word.js.map +0 -1
- package/dist/runtime/task-providers/agent-tasks.d.ts +0 -103
- package/dist/runtime/task-providers/agent-tasks.js +0 -245
- package/dist/runtime/task-providers/agent-tasks.js.map +0 -1
- package/dist/runtime/when-eval.d.ts +0 -62
- package/dist/runtime/when-eval.js +0 -212
- package/dist/runtime/when-eval.js.map +0 -1
- package/dist/runtime/workflow-policies.d.ts +0 -207
- package/dist/runtime/workflow-policies.js +0 -596
- package/dist/runtime/workflow-policies.js.map +0 -1
- package/dist/schema/audit.d.ts +0 -71
- package/dist/schema/audit.js +0 -32
- package/dist/schema/audit.js.map +0 -1
- package/dist/schema/doctor.d.ts +0 -25
- package/dist/schema/doctor.js +0 -23
- package/dist/schema/doctor.js.map +0 -1
- package/dist/schema/environments.d.ts +0 -215
- package/dist/schema/environments.js +0 -101
- package/dist/schema/environments.js.map +0 -1
- package/dist/schema/extract.d.ts +0 -9
- package/dist/schema/extract.js +0 -86
- package/dist/schema/extract.js.map +0 -1
- package/dist/schema/permission-profiles.d.ts +0 -2292
- package/dist/schema/permission-profiles.js +0 -60
- package/dist/schema/permission-profiles.js.map +0 -1
- package/dist/schema/policies.d.ts +0 -974
- package/dist/schema/policies.js +0 -298
- package/dist/schema/policies.js.map +0 -1
- package/dist/schema/requires.d.ts +0 -131
- package/dist/schema/requires.js +0 -88
- package/dist/schema/requires.js.map +0 -1
- package/dist/schema/risk.d.ts +0 -144
- package/dist/schema/risk.js +0 -194
- package/dist/schema/risk.js.map +0 -1
- package/dist/schema/session-start-preflight.d.ts +0 -10
- package/dist/schema/session-start-preflight.js +0 -106
- package/dist/schema/session-start-preflight.js.map +0 -1
- package/dist/schema/stale-base-check.d.ts +0 -18
- package/dist/schema/stale-base-check.js +0 -37
- package/dist/schema/stale-base-check.js.map +0 -1
- package/dist/schema/toolchain-parity.d.ts +0 -21
- package/dist/schema/toolchain-parity.js +0 -48
- package/dist/schema/toolchain-parity.js.map +0 -1
- package/dist/schema/workflows.d.ts +0 -519
- package/dist/schema/workflows.js +0 -81
- package/dist/schema/workflows.js.map +0 -1
- package/scripts/runtime-reality-docker-probe.mjs +0 -71
|
@@ -1,462 +0,0 @@
|
|
|
1
|
-
// Step 9 of the understanding-gate PreToolUse decision order: the
|
|
2
|
-
// operator-opt-in auto-approval attempt (agent-tasks/74b4b17d, slice 1 of
|
|
3
|
-
// docs/decisions/2026-08-27-ug-auto-mode-approval.md, "Option A").
|
|
4
|
-
//
|
|
5
|
-
// WHERE THIS RUNS, AND WHY IT MATTERS. `hook-pre-tool-use.ts` calls
|
|
6
|
-
// `attemptAutoApproval` on a call that EVERY branch above it has already
|
|
7
|
-
// declined: the signed-marker check (step 3), the read-only Bash
|
|
8
|
-
// exemption (step 6), the recovery-commit exemption (step 7) and the
|
|
9
|
-
// escape `ask` (step 8). So the auto path only ever acts on a call that
|
|
10
|
-
// would otherwise reach the final block. Three consequences the ADR's
|
|
11
|
-
// decision-order table spells out: the session's first `ls` or `git
|
|
12
|
-
// status` mints nothing, `max_age` starts counting from the call that
|
|
13
|
-
// actually needed an approval, and a bare `harness approve understanding`
|
|
14
|
-
// keeps whatever the interactive prompt resolves it to. The negative
|
|
15
|
-
// controls in tests/cli/pack-hook-pre-tool-use-auto-approve.test.ts pin
|
|
16
|
-
// that ordering; moving this call site up is a mutation those tests
|
|
17
|
-
// catch.
|
|
18
|
-
//
|
|
19
|
-
// WHAT IT IS NOT. This function never returns an allow of its own. On
|
|
20
|
-
// success it consumes the report, writes the signed SESSION marker
|
|
21
|
-
// through the same `writeApprovalMarker` path `harness approve
|
|
22
|
-
// understanding` uses, records an audit-only ledger fact, and then
|
|
23
|
-
// re-runs `checkOperatorApprovalMarkers` — that re-check, and nothing
|
|
24
|
-
// else, is what produces the allow. The gate's decision input stays
|
|
25
|
-
// exactly one signed marker (invariant 1). Every failure returns
|
|
26
|
-
// `approved: false` and the caller falls through to the existing final
|
|
27
|
-
// block with step 3's `markerExpired` / `markerForged` intact.
|
|
28
|
-
//
|
|
29
|
-
// FAIL CLOSED ON EVERY MISSING INPUT. Absent opt-in, unlisted
|
|
30
|
-
// `permission_mode`, a forged marker already detected at step 3, a
|
|
31
|
-
// failed session-consistency check, a missing signing key, a missing /
|
|
32
|
-
// already-consumed / foreign / invalid report: each one declines with
|
|
33
|
-
// one stderr line and no write.
|
|
34
|
-
//
|
|
35
|
-
// TWO CALL SITES, ONE BODY (slice 2, agent-tasks/57058364).
|
|
36
|
-
// `hook-codex-pre-tool-use.ts` calls this same function at the same
|
|
37
|
-
// place in its own decision order. Everything that differs between the
|
|
38
|
-
// two runtimes is an ARGUMENT, never a fork: the `harness` segment of
|
|
39
|
-
// the minted `approvedBy`, which session-consistency evidence the
|
|
40
|
-
// payload can be held against (`sessionConsistency`), the ledger fact's
|
|
41
|
-
// `source` verb, and the stderr `label`. Claude Code carries
|
|
42
|
-
// `$CLAUDE_CODE_SESSION_ID` in the hook environment; Codex carries no
|
|
43
|
-
// session-id environment variable at all (measured live, Codex 0.150.1)
|
|
44
|
-
// but does name a per-session `transcript_path` that exists on disk at
|
|
45
|
-
// PreToolUse time.
|
|
46
|
-
//
|
|
47
|
-
// TWO ALTERNATIVE KEY-ONE SIGNALS (slice 3, agent-tasks 37ad0b05). The
|
|
48
|
-
// ADR's "Decision: two-key design" makes the trusted signal a
|
|
49
|
-
// disjunction: a `when`-listed `permission_mode`, OR a valid delegation
|
|
50
|
-
// for this child session that the CALLING HOOK has already verified and
|
|
51
|
-
// passes in as `delegation`. Both are only key ONE. Key two, the child's
|
|
52
|
-
// own strict-session `pending` report, is condition (6) below and is
|
|
53
|
-
// identical on both paths; nothing about a delegation relaxes it, and no
|
|
54
|
-
// branch here reads a delegation file, so the one verifier stays in
|
|
55
|
-
// `understanding-before-execution/delegation-markers.ts`.
|
|
56
|
-
//
|
|
57
|
-
// ONE BODY IS NOT ONE OPT-IN. Sharing the body would otherwise mean an
|
|
58
|
-
// `auto_approve` block written for Claude Code opts every Codex session
|
|
59
|
-
// in too; `auto_approve.harnesses` is the explicit per-harness
|
|
60
|
-
// allowlist that prevents it, defaulting to Claude Code only when the
|
|
61
|
-
// key is absent (step 1b below).
|
|
62
|
-
import * as fs from "node:fs";
|
|
63
|
-
import * as path from "node:path";
|
|
64
|
-
import { autoApprovedByFor, autoApprovedLedgerTagFor, canonicalReportHash, checkOperatorApprovalMarkers, harnessAllowed, listPersistedReportsBoundedWithSkips, MAX_HOOK_LISTING_ENTRIES, parseAutoApprove, permissionModeAllowed, readReportFileBounded, selectNewestStrictSessionReport, writeApprovalMarker, } from "../../policy-packs/builtin/understanding-before-execution-runtime.js";
|
|
65
|
-
import { signingKeyExists } from "../../runtime/approval-signing.js";
|
|
66
|
-
import { clearPendingApproval, readPendingApproval, } from "../../runtime/pending-approval.js";
|
|
67
|
-
import { ApprovedReportTooLargeError, renderApprovedReport, rewriteReportApproved, validatePersistedReport, } from "../approve/understanding.js";
|
|
68
|
-
/**
|
|
69
|
-
* Source string the CLAUDE CODE hook records on the audit-only ledger
|
|
70
|
-
* fact — the verb that actually made the write.
|
|
71
|
-
*/
|
|
72
|
-
export const AUTO_APPROVE_LEDGER_SOURCE = "harness-pack-hook-pre-tool-use";
|
|
73
|
-
/**
|
|
74
|
-
* The Codex hook's counterpart. A shared body must not stamp the Claude
|
|
75
|
-
* verb on a Codex write: the ledger fact is an audit surface, and an
|
|
76
|
-
* auditor reading `harness-pack-hook-pre-tool-use` on a Codex session
|
|
77
|
-
* would be reading a fact about a hook that never ran (reviewer round-1
|
|
78
|
-
* finding on slice 2). The `approvedBy` segment already distinguishes
|
|
79
|
-
* the runtimes; this makes the ledger row agree with it.
|
|
80
|
-
*/
|
|
81
|
-
export const AUTO_APPROVE_LEDGER_SOURCE_CODEX = "harness-pack-hook-codex-pre-tool-use";
|
|
82
|
-
/** Default stderr prefix: the Claude Code hook's, byte-for-byte. */
|
|
83
|
-
const DEFAULT_LABEL = "harness pack hook";
|
|
84
|
-
/**
|
|
85
|
-
* The `<mode>` segment an auto-marker carries whenever key one came from
|
|
86
|
-
* the DELEGATION rather than from a `when`-listed `permission_mode`.
|
|
87
|
-
* `auto-mode:claude-code:delegated;delegated:<parent-sid>` reads as what
|
|
88
|
-
* it is: a child whose trusted signal was the parent's pre-authorization,
|
|
89
|
-
* not a permission mode. Used unconditionally on that path, whatever the
|
|
90
|
-
* payload's own mode says, since that mode played no part in the decision.
|
|
91
|
-
*/
|
|
92
|
-
const DELEGATED_MODE_LABEL = "delegated";
|
|
93
|
-
function decline(reason) {
|
|
94
|
-
return { approved: false, reason };
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Attempt the operator-opted-in auto-approval for this PreToolUse call.
|
|
98
|
-
* See the module header for placement and the fail-closed contract; the
|
|
99
|
-
* numbered steps below are conditions 1-6 of the ADR's Option A.
|
|
100
|
-
*/
|
|
101
|
-
export async function attemptAutoApproval(args) {
|
|
102
|
-
const { stderr } = args;
|
|
103
|
-
const label = args.label ?? DEFAULT_LABEL;
|
|
104
|
-
const note = (msg) => {
|
|
105
|
-
stderr.write(`${label}: ${msg}\n`);
|
|
106
|
-
};
|
|
107
|
-
// (1) Opt-in. Absent is the ordinary case and stays SILENT; a
|
|
108
|
-
// malformed block already wrote its own single line inside
|
|
109
|
-
// `parseAutoApprove` (fail-closed: malformed means "not opted in",
|
|
110
|
-
// never a partial default).
|
|
111
|
-
const packConfigObj = args.packConfig !== null && typeof args.packConfig === "object" && !Array.isArray(args.packConfig)
|
|
112
|
-
? args.packConfig
|
|
113
|
-
: {};
|
|
114
|
-
const cfg = parseAutoApprove(packConfigObj["auto_approve"], stderr, label);
|
|
115
|
-
if (cfg === null)
|
|
116
|
-
return decline("auto_approve not configured");
|
|
117
|
-
// (1b) Per-harness opt-in, checked BEFORE the `when` allowlist and
|
|
118
|
-
// before the ledger thunk below, so an unlisted harness resolves
|
|
119
|
-
// nothing and never reaches any evidence lookup. Two call sites share
|
|
120
|
-
// this body; without this check an `auto_approve` block written for
|
|
121
|
-
// Claude Code before the Codex hook existed would silently start
|
|
122
|
-
// auto-approving every Codex session that runs in a listed
|
|
123
|
-
// `permission_mode` (reviewer round-1 finding on slice 2). `harnesses`
|
|
124
|
-
// is absent in exactly those older configs and resolves to Claude Code
|
|
125
|
-
// only, so opting a second runtime in stays an explicit config edit.
|
|
126
|
-
// Diagnosed, unlike the silent `when` miss below: an unlisted harness
|
|
127
|
-
// is a configuration mismatch worth seeing once per call, not the
|
|
128
|
-
// ordinary state of an opted-in session.
|
|
129
|
-
if (!harnessAllowed(cfg, args.harness)) {
|
|
130
|
-
note(`auto-approval declined: harness "${args.harness}" is not listed in auto_approve.harnesses`);
|
|
131
|
-
return decline("harness not in auto_approve.harnesses");
|
|
132
|
-
}
|
|
133
|
-
// (2) `when` allowlist, exact string equality against the payload
|
|
134
|
-
// literal (hardening item 2). Absent / empty / unlisted is the normal
|
|
135
|
-
// case for an opted-in repo whose session simply runs in a prompting
|
|
136
|
-
// mode, and it fires on EVERY such call once the opt-in is present, so
|
|
137
|
-
// this stays SILENT (no stderr line): a per-call note here would echo
|
|
138
|
-
// the configured `auto_approve.when` allowlist to stderr on every
|
|
139
|
-
// ordinary prompting-mode call (reviewer round-1 finding).
|
|
140
|
-
const mode = args.permissionMode;
|
|
141
|
-
const modeAllowed = permissionModeAllowed(cfg, mode);
|
|
142
|
-
if (!modeAllowed && args.delegation === undefined) {
|
|
143
|
-
return decline("permission_mode not in auto_approve.when");
|
|
144
|
-
}
|
|
145
|
-
// Which of the ADR's two alternative key-one signals actually applied.
|
|
146
|
-
// Logged only on the delegation path: the `when` hit is the ordinary
|
|
147
|
-
// slice-1 case and stays as silent as it was, so slice 1's stderr trail
|
|
148
|
-
// is byte-identical to what it was before this argument existed.
|
|
149
|
-
if (args.delegation !== undefined) {
|
|
150
|
-
note(modeAllowed
|
|
151
|
-
? `auto-approval key one: permission_mode ${JSON.stringify(mode)} in auto_approve.when (a valid delegation from parent session ${args.delegation.parentSessionId} is also present)`
|
|
152
|
-
: `auto-approval key one: valid delegation from parent session ${args.delegation.parentSessionId}`);
|
|
153
|
-
}
|
|
154
|
-
// The `<mode>` segment of `approvedBy` records WHICH key one applied,
|
|
155
|
-
// so it carries a payload literal in exactly one case: the mode itself
|
|
156
|
-
// was `when`-listed, i.e. the operator wrote that exact string in the
|
|
157
|
-
// config and this call matched it.
|
|
158
|
-
//
|
|
159
|
-
// On the delegation path the payload's mode is UNCONSTRAINED (that is
|
|
160
|
-
// the whole point: a `-p` child may carry `default`, or nothing) and it
|
|
161
|
-
// played no part in the decision, so it is replaced by the neutral
|
|
162
|
-
// `delegated` literal wholesale rather than filtered. Filtering only the
|
|
163
|
-
// encoding-breaking characters was not enough: `approvedBy` is a signed
|
|
164
|
-
// AUDIT record, and a payload-composed mode carrying a newline or a tab
|
|
165
|
-
// survives a `;`/`:` check, lands verbatim in the signed field, and then
|
|
166
|
-
// shows up in the doctor listing as a permission mode that never
|
|
167
|
-
// existed (reviewer finding L2). Nothing is lost: the payload's mode is
|
|
168
|
-
// not evidence of anything on this path.
|
|
169
|
-
const modeStr = modeAllowed ? mode : DELEGATED_MODE_LABEL;
|
|
170
|
-
// Resolve the audit-only ledger writer NOW, not earlier: this is the
|
|
171
|
-
// first point past both the opt-in check (1) and the `when` allowlist
|
|
172
|
-
// check (2), so `args.resolveLedger` runs only on a call that has an
|
|
173
|
-
// actual chance of reaching the ledger write below, never on the
|
|
174
|
-
// overwhelming majority of gated calls that are not opted in or run in
|
|
175
|
-
// an unlisted permission mode.
|
|
176
|
-
const ledger = args.resolveLedger();
|
|
177
|
-
// (3) A forgery detected at step 3 is never laundered into an
|
|
178
|
-
// approval (ADR condition 6). Declining also leaves the forged FILE and
|
|
179
|
-
// its distinct `forged/unsigned marker rejected` diagnostic on disk —
|
|
180
|
-
// `writeApprovalMarker` would atomically overwrite that exact path.
|
|
181
|
-
if (args.markerForged) {
|
|
182
|
-
const forgedKind = args.forgedKind ?? "marker";
|
|
183
|
-
const forgedNoun = forgedKind === "inflight" ? "in-flight record" : "marker";
|
|
184
|
-
note(`auto-approval declined: forged/unsigned ${forgedNoun} present`);
|
|
185
|
-
return decline(`forged ${forgedNoun} present`);
|
|
186
|
-
}
|
|
187
|
-
// (4) Session consistency (hardening item 1): the PAYLOAD's own
|
|
188
|
-
// `session_id` must be present and must agree with a SECOND input the
|
|
189
|
-
// hook reads for itself — the runtime's session-id environment
|
|
190
|
-
// variable on Claude Code, the named per-session transcript file on
|
|
191
|
-
// Codex. Compared against the payload field specifically, never the
|
|
192
|
-
// hook's env-fallback-resolved id, or the env variant would compare
|
|
193
|
-
// the environment with itself.
|
|
194
|
-
const payloadSid = typeof args.payloadSessionId === "string" && args.payloadSessionId.length > 0
|
|
195
|
-
? args.payloadSessionId
|
|
196
|
-
: null;
|
|
197
|
-
if (payloadSid === null) {
|
|
198
|
-
note("auto-approval declined: event payload carries no session_id");
|
|
199
|
-
return decline("no payload session_id");
|
|
200
|
-
}
|
|
201
|
-
const consistency = args.sessionConsistency;
|
|
202
|
-
if (consistency.kind === "env") {
|
|
203
|
-
const envSid = process.env[consistency.variable];
|
|
204
|
-
if (typeof envSid !== "string" || envSid.length === 0) {
|
|
205
|
-
note(`auto-approval declined: $${consistency.variable} is not set in the hook environment`);
|
|
206
|
-
return decline(`no ${consistency.variable}`);
|
|
207
|
-
}
|
|
208
|
-
if (envSid !== payloadSid) {
|
|
209
|
-
note(`auto-approval declined: payload session_id does not match $${consistency.variable} in the hook environment`);
|
|
210
|
-
return decline("session id mismatch");
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
// Codex carries no session-id environment variable in the hook
|
|
215
|
-
// process (measured live, Codex 0.150.1: only CODEX_HOME,
|
|
216
|
-
// CODEX_MANAGED_BY_NPM, CODEX_MANAGED_PACKAGE_ROOT), so the env
|
|
217
|
-
// variant has no counterpart there. The payload's own
|
|
218
|
-
// `transcript_path` is the second input instead: Codex names the
|
|
219
|
-
// session's rollout file
|
|
220
|
-
// `<CODEX_HOME>/sessions/YYYY/MM/DD/rollout-<timestamp>-<session_id>.jsonl`
|
|
221
|
-
// and the file already exists when PreToolUse fires.
|
|
222
|
-
//
|
|
223
|
-
// Three separately-diagnosed conditions, each fail-closed: the
|
|
224
|
-
// field is a non-empty string; its BASENAME names this exact
|
|
225
|
-
// session (`-<sid>.jsonl`, or a bare `<sid>.jsonl` for a shim that
|
|
226
|
-
// drops the `rollout-<timestamp>` prefix); and the path resolves to
|
|
227
|
-
// a REGULAR FILE. `statSync().isFile()`, not `existsSync`: a
|
|
228
|
-
// directory named `<sid>.jsonl` is not a transcript, and neither is
|
|
229
|
-
// a socket or a device node, yet all of them satisfy mere existence
|
|
230
|
-
// (reviewer round-1 finding on slice 2). It is deliberately not a
|
|
231
|
-
// content check: reading and parsing the rollout would make the hook
|
|
232
|
-
// depend on Codex's internal transcript format for a check that is
|
|
233
|
-
// not a boundary anyway (see SessionConsistencyCheck).
|
|
234
|
-
const transcriptPath = typeof consistency.transcriptPath === "string" && consistency.transcriptPath.length > 0
|
|
235
|
-
? consistency.transcriptPath
|
|
236
|
-
: null;
|
|
237
|
-
if (transcriptPath === null) {
|
|
238
|
-
note("auto-approval declined: event payload carries no transcript_path");
|
|
239
|
-
return decline("no transcript_path");
|
|
240
|
-
}
|
|
241
|
-
const base = path.basename(transcriptPath);
|
|
242
|
-
if (base !== `${payloadSid}.jsonl` && !base.endsWith(`-${payloadSid}.jsonl`)) {
|
|
243
|
-
note(`auto-approval declined: transcript_path does not name session ${payloadSid} (basename ${base})`);
|
|
244
|
-
return decline("transcript_path session mismatch");
|
|
245
|
-
}
|
|
246
|
-
// `throwIfNoEntry: false` covers the ordinary ENOENT; the try/catch
|
|
247
|
-
// covers every other stat failure (a permission error, a symlink
|
|
248
|
-
// loop), which fails closed here rather than throwing out of a hook
|
|
249
|
-
// whose caller treats a throw as neither allow nor block.
|
|
250
|
-
let transcriptIsFile = false;
|
|
251
|
-
try {
|
|
252
|
-
transcriptIsFile = fs.statSync(transcriptPath, { throwIfNoEntry: false })?.isFile() === true;
|
|
253
|
-
}
|
|
254
|
-
catch {
|
|
255
|
-
transcriptIsFile = false;
|
|
256
|
-
}
|
|
257
|
-
if (!transcriptIsFile) {
|
|
258
|
-
note(`auto-approval declined: transcript_path does not name an existing file (${transcriptPath})`);
|
|
259
|
-
return decline("transcript_path missing");
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
// (5) Key precheck BEFORE any write (hardening item 5). The shared
|
|
263
|
-
// write path would otherwise mint the key it is supposed to require:
|
|
264
|
-
// `writeApprovalMarker` -> `signMarker` -> `getOrCreateSigningKey`
|
|
265
|
-
// generates one on ENOENT. Key creation stays an operator-side act.
|
|
266
|
-
if (args.generatedDir === undefined) {
|
|
267
|
-
note("auto-approval declined: harness.generated/ could not be resolved");
|
|
268
|
-
return decline("generatedDir unresolvable");
|
|
269
|
-
}
|
|
270
|
-
const generatedDir = args.generatedDir;
|
|
271
|
-
if (!signingKeyExists(generatedDir)) {
|
|
272
|
-
note("auto-approval declined: signing key absent (never created by the hook)");
|
|
273
|
-
return decline("signing key absent");
|
|
274
|
-
}
|
|
275
|
-
// (6) The report precondition: the NEWEST strict-session report, and
|
|
276
|
-
// only that one, must be exactly `pending`, parse, and pass the
|
|
277
|
-
// approve CLI's own content validation.
|
|
278
|
-
//
|
|
279
|
-
// The directory holds files the gated agent can write, so it is listed
|
|
280
|
-
// through the bounded reader (a FIFO or a huge file cannot block or kill
|
|
281
|
-
// the hook), and an entry that listing had to skip declines the whole
|
|
282
|
-
// attempt: an unreadable or oversized NEWEST report must not let the
|
|
283
|
-
// selection fall back to an older pending one.
|
|
284
|
-
//
|
|
285
|
-
// Bounded by entry count and by bytes as well: past `MAX_HOOK_LISTING_ENTRIES`
|
|
286
|
-
// entries, or past the hash scan's byte budget, nothing is returned and the
|
|
287
|
-
// attempt declines, since a listing that cannot see every entry cannot say
|
|
288
|
-
// which report is the newest (a hidden newer one may already be approved).
|
|
289
|
-
const listing = listPersistedReportsBoundedWithSkips(args.reportsDir, {
|
|
290
|
-
maxEntries: MAX_HOOK_LISTING_ENTRIES,
|
|
291
|
-
});
|
|
292
|
-
if (listing.truncated) {
|
|
293
|
-
note(`auto-approval declined: the reports directory ${listing.truncatedDetail}`);
|
|
294
|
-
return decline("report listing over the bound");
|
|
295
|
-
}
|
|
296
|
-
if (listing.skipped.length > 0) {
|
|
297
|
-
const oversized = listing.skipped.find((entry) => entry.reason === "too-large");
|
|
298
|
-
if (oversized !== undefined) {
|
|
299
|
-
note(`auto-approval declined: report invalid (${oversized.detail})`);
|
|
300
|
-
return decline("report invalid: size");
|
|
301
|
-
}
|
|
302
|
-
const first = listing.skipped[0];
|
|
303
|
-
note(`auto-approval declined: report listing skipped ${listing.skipped.length} unreadable entr${listing.skipped.length === 1 ? "y" : "ies"} (${first?.detail ?? "unknown"})`);
|
|
304
|
-
return decline("report listing incomplete");
|
|
305
|
-
}
|
|
306
|
-
const newest = selectNewestStrictSessionReport(listing.reports, args.sessionId);
|
|
307
|
-
if (newest === null) {
|
|
308
|
-
note(`auto-approval declined: no persisted report bound to session ${args.sessionId}`);
|
|
309
|
-
return decline("no report for session");
|
|
310
|
-
}
|
|
311
|
-
if (newest.approvalStatus !== "pending") {
|
|
312
|
-
note(`auto-approval declined: newest report for session ${args.sessionId} is approvalStatus=${newest.approvalStatus ?? "<missing>"}, not pending`);
|
|
313
|
-
return decline("newest report not pending");
|
|
314
|
-
}
|
|
315
|
-
// Read exactly as the gate-read scan reads it (`readReportFileBounded`):
|
|
316
|
-
// a report over the size cap there matches nothing, so a marker minted
|
|
317
|
-
// from it would bind content the gate never finds; it declines as an
|
|
318
|
-
// invalid report instead, like one nested too deeply to hash.
|
|
319
|
-
const read = readReportFileBounded(newest.filePath);
|
|
320
|
-
if (!read.ok) {
|
|
321
|
-
if (read.reason === "too-large") {
|
|
322
|
-
note(`auto-approval declined: report invalid (${read.detail})`);
|
|
323
|
-
return decline("report invalid: size");
|
|
324
|
-
}
|
|
325
|
-
note(`auto-approval declined: report unreadable (${read.detail})`);
|
|
326
|
-
return decline("report unreadable");
|
|
327
|
-
}
|
|
328
|
-
const raw = read.raw;
|
|
329
|
-
let parsed;
|
|
330
|
-
try {
|
|
331
|
-
parsed = JSON.parse(raw);
|
|
332
|
-
}
|
|
333
|
-
catch (err) {
|
|
334
|
-
note(`auto-approval declined: report invalid (unparseable JSON: ${err.message})`);
|
|
335
|
-
return decline("report unparseable");
|
|
336
|
-
}
|
|
337
|
-
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
338
|
-
note("auto-approval declined: report invalid (body is not a JSON object)");
|
|
339
|
-
return decline("report not an object");
|
|
340
|
-
}
|
|
341
|
-
const validation = validatePersistedReport(parsed);
|
|
342
|
-
if (!validation.ok) {
|
|
343
|
-
note(`auto-approval declined: report invalid (${validation.field}: ${validation.reason})`);
|
|
344
|
-
return decline(`report invalid: ${validation.field}`);
|
|
345
|
-
}
|
|
346
|
-
// Success sequence. `reportContentHash` is the canonical hash of the
|
|
347
|
-
// report as it stands BEFORE the approval rewrite, exactly as the approve
|
|
348
|
-
// CLI computes it; the lifecycle fields the rewrite changes are not part
|
|
349
|
-
// of it, so the gate-read cross-check (some report file must still hash to
|
|
350
|
-
// it) matches afterwards. A report nested too deeply to hash would mint a
|
|
351
|
-
// marker that binds no content, so it declines like any other invalid report.
|
|
352
|
-
const reportContentHash = canonicalReportHash(parsed);
|
|
353
|
-
if (reportContentHash === null) {
|
|
354
|
-
note("auto-approval declined: report invalid (nested too deeply to hash its content)");
|
|
355
|
-
return decline("report invalid: nesting depth");
|
|
356
|
-
}
|
|
357
|
-
const approvedAt = new Date().toISOString();
|
|
358
|
-
// The parent linkage rides in the same signed `approvedBy` field the
|
|
359
|
-
// source already travels in (ADR "Audit and doctor"): no new signed
|
|
360
|
-
// field, therefore no `SIGNING_ALG` bump. `parseAutoApprovedBy` strips
|
|
361
|
-
// the suffix, so the doctor listing still buckets the marker by
|
|
362
|
-
// harness/mode. The parent id needs no escaping here: it comes out of a
|
|
363
|
-
// verified delegation whose own writer already refused a `;` or `=` in
|
|
364
|
-
// it (`buildDelegationApprovedBy`'s `rejectUnsafeSegmentValue`).
|
|
365
|
-
const approvedBy = args.delegation === undefined
|
|
366
|
-
? autoApprovedByFor(args.harness, modeStr)
|
|
367
|
-
: `${autoApprovedByFor(args.harness, modeStr)};delegated:${args.delegation.parentSessionId}`;
|
|
368
|
-
// The rewrite below pretty-prints the report and adds its approval fields,
|
|
369
|
-
// which can carry a report read just under the size cap over it. The
|
|
370
|
-
// gate-read scan reads no file over the cap, so a marker minted for it would
|
|
371
|
-
// deny on every call: check the rewritten bytes first and decline, before
|
|
372
|
-
// the report is consumed or any marker is written.
|
|
373
|
-
try {
|
|
374
|
-
renderApprovedReport(raw, approvedAt, approvedBy, args.sessionId);
|
|
375
|
-
}
|
|
376
|
-
catch (err) {
|
|
377
|
-
if (err instanceof ApprovedReportTooLargeError) {
|
|
378
|
-
note(`auto-approval declined: report invalid (${err.message})`);
|
|
379
|
-
return decline("report invalid: size");
|
|
380
|
-
}
|
|
381
|
-
// Any other failure surfaces through the consume step below.
|
|
382
|
-
}
|
|
383
|
-
// CONSUME FIRST, then sign. If the marker write fails after this, the
|
|
384
|
-
// report is spent and no marker exists: the call blocks and the same
|
|
385
|
-
// report can never mint again. The reverse order would leave a
|
|
386
|
-
// still-`pending` report behind a failed write, i.e. a report that is
|
|
387
|
-
// mintable on the very next call — the direction this design refuses.
|
|
388
|
-
// The rewrite takes the text read above through the bounded reader instead
|
|
389
|
-
// of re-reading the path: a report symlink retargeted (to a FIFO, a huge
|
|
390
|
-
// file) after that read can then neither block nor kill the hook here.
|
|
391
|
-
try {
|
|
392
|
-
rewriteReportApproved(newest.filePath, approvedAt, approvedBy, args.sessionId, raw);
|
|
393
|
-
}
|
|
394
|
-
catch (err) {
|
|
395
|
-
note(`auto-approval declined: could not consume the report (${err.message})`);
|
|
396
|
-
return decline("report consumption failed");
|
|
397
|
-
}
|
|
398
|
-
let markerPath;
|
|
399
|
-
try {
|
|
400
|
-
markerPath = writeApprovalMarker(generatedDir, args.sessionId, {
|
|
401
|
-
approvedAt,
|
|
402
|
-
approvedBy,
|
|
403
|
-
reportContentHash,
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
catch (err) {
|
|
407
|
-
note(`auto-approval declined: failed to write the approval marker (${err.message}); the report was consumed, so this session needs a fresh report`);
|
|
408
|
-
return decline("marker write failed");
|
|
409
|
-
}
|
|
410
|
-
// Audit-only ledger fact. Never a gate input, so every failure here is
|
|
411
|
-
// one stderr line and nothing more.
|
|
412
|
-
const tag = autoApprovedLedgerTagFor(args.sessionId);
|
|
413
|
-
if (ledger.write === null) {
|
|
414
|
-
note(`auto-approval ledger fact ${tag} not recorded (${ledger.reason ?? "ledger writer unavailable"}); audit only, continuing`);
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
try {
|
|
418
|
-
const result = await ledger.write({
|
|
419
|
-
sessionId: args.sessionId,
|
|
420
|
-
content: tag,
|
|
421
|
-
source: args.ledgerSource,
|
|
422
|
-
});
|
|
423
|
-
if (!result.ok) {
|
|
424
|
-
note(`auto-approval ledger fact ${tag} not recorded (${result.reason ?? "unknown error"}); audit only, continuing`);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
catch (err) {
|
|
428
|
-
note(`auto-approval ledger fact ${tag} not recorded (${err.message}); audit only, continuing`);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
// Drop this session's `.pending-approval` staging entry (decision-order
|
|
432
|
-
// table, step 9). It is tier 5 of the approve verbs' session
|
|
433
|
-
// resolution and is otherwise cleared only by `harness approve
|
|
434
|
-
// understanding`, which auto mode never runs — so leaving it would let
|
|
435
|
-
// a later env-less operator `harness approve ...` resolve to this
|
|
436
|
-
// already-auto-approved id. Only ever clears OUR OWN id.
|
|
437
|
-
try {
|
|
438
|
-
if (readPendingApproval(generatedDir) === args.sessionId) {
|
|
439
|
-
clearPendingApproval(generatedDir);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
catch {
|
|
443
|
-
/* best-effort; staging is not a gate input */
|
|
444
|
-
}
|
|
445
|
-
// The verdict comes from the same marker check every other approval
|
|
446
|
-
// goes through — the auto path itself never allows.
|
|
447
|
-
const recheck = checkOperatorApprovalMarkers(generatedDir, args.sessionId, args.packConfig, stderr);
|
|
448
|
-
if (!recheck.matched) {
|
|
449
|
-
note(`auto-approval wrote a marker but the re-check did not match (${recheck.detail}); falling through to the block`);
|
|
450
|
-
return decline("post-write marker re-check did not match");
|
|
451
|
-
}
|
|
452
|
-
note(`auto-approved via session marker by ${approvedBy}`);
|
|
453
|
-
return {
|
|
454
|
-
approved: true,
|
|
455
|
-
detail: recheck.detail,
|
|
456
|
-
approvedBy,
|
|
457
|
-
markerPath,
|
|
458
|
-
reportPath: newest.filePath,
|
|
459
|
-
reportContentHash,
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
//# sourceMappingURL=auto-approve-path.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-approve-path.js","sourceRoot":"","sources":["../../../src/cli/pack/auto-approve-path.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,0EAA0E;AAC1E,mEAAmE;AACnE,EAAE;AACF,oEAAoE;AACpE,yEAAyE;AACzE,iEAAiE;AACjE,qEAAqE;AACrE,wEAAwE;AACxE,sEAAsE;AACtE,oEAAoE;AACpE,sEAAsE;AACtE,0EAA0E;AAC1E,qEAAqE;AACrE,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J,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CACF,6BAA6B,GAAG,kBAAmB,GAAa,CAAC,OAAO,2BAA2B,CACpG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,wEAAwE;IACxE,6DAA6D;IAC7D,+DAA+D;IAC/D,uEAAuE;IACvE,kEAAkE;IAClE,yDAAyD;IACzD,IAAI,CAAC;QACH,IAAI,mBAAmB,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;YACzD,oBAAoB,CAAC,YAAY,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,8CAA8C;IAChD,CAAC;IAED,oEAAoE;IACpE,oDAAoD;IACpD,MAAM,OAAO,GAAG,4BAA4B,CAC1C,YAAY,EACZ,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,UAAU,EACf,MAAM,CACP,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CACF,gEAAgE,OAAO,CAAC,MAAM,iCAAiC,CAChH,CAAC;QACF,OAAO,OAAO,CAAC,0CAA0C,CAAC,CAAC;IAC7D,CAAC;IACD,IAAI,CAAC,uCAAuC,UAAU,EAAE,CAAC,CAAC;IAC1D,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,UAAU;QACV,UAAU;QACV,UAAU,EAAE,MAAM,CAAC,QAAQ;QAC3B,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Manifest } from "../../schema/index.js";
|
|
2
|
-
import { type LoaderOptions } from "../loader.js";
|
|
3
|
-
export interface PackHookCodexPostToolUseOptions extends LoaderOptions {
|
|
4
|
-
pack?: string;
|
|
5
|
-
generatedDir?: string;
|
|
6
|
-
reportsDir?: string;
|
|
7
|
-
stdin?: NodeJS.ReadableStream;
|
|
8
|
-
stderr?: NodeJS.WritableStream;
|
|
9
|
-
manifest?: Manifest;
|
|
10
|
-
/** Override "now" for deterministic tests. */
|
|
11
|
-
now?: Date;
|
|
12
|
-
}
|
|
13
|
-
export interface PackHookCodexPostToolUseResult {
|
|
14
|
-
exitCode: number;
|
|
15
|
-
/** Did the just-completed tool match a configured expiry boundary? */
|
|
16
|
-
matchedExpiry: boolean;
|
|
17
|
-
/** Was the session marker actually cleared (false if already absent). */
|
|
18
|
-
markerCleared: boolean;
|
|
19
|
-
/** Was a task-scoped marker also cleared (harness/1ee26e77 parity)? */
|
|
20
|
-
taskMarkerCleared: boolean;
|
|
21
|
-
/** Was the persisted report flipped from `approved` to `expired`? */
|
|
22
|
-
persistedReportExpired: boolean;
|
|
23
|
-
diagnostic: string;
|
|
24
|
-
}
|
|
25
|
-
export declare function runPackHookCodexPostToolUseCli(opts?: PackHookCodexPostToolUseOptions): Promise<PackHookCodexPostToolUseResult>;
|