@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
package/dist/cli/pack/upgrade.js
DELETED
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
// `harness pack upgrade <name>`: text-level insertion of a pack's
|
|
2
|
-
// missing default config block into an existing manifest, WITHOUT
|
|
3
|
-
// parsing and reserializing the operator's YAML (unlike `pack add` /
|
|
4
|
-
// `pack reseed`, which both mutate via the `yaml` Document API). Task
|
|
5
|
-
// 8f637efd: the one upgrade this ships is `auto_approve` for
|
|
6
|
-
// `understanding-before-execution` (D-004,
|
|
7
|
-
// docs/decisions/2026-08-27-ug-auto-mode-approval.md, "Amendment:
|
|
8
|
-
// install default").
|
|
9
|
-
//
|
|
10
|
-
// WHY TEXT-LEVEL, NOT DOCUMENT-LEVEL. The `yaml` package's Document API
|
|
11
|
-
// (`withDocument`, used by `pack reseed`) round-trips comments
|
|
12
|
-
// reasonably well for a single field REPLACEMENT, but this upgrade
|
|
13
|
-
// INSERTS a brand-new key with its own multi-line comment block into an
|
|
14
|
-
// operator manifest that may carry hand edits `pack add` / `reseed`
|
|
15
|
-
// never touch (custom producers, an extra top-level key, a reordered
|
|
16
|
-
// field). Re-serializing the whole document risks reformatting content
|
|
17
|
-
// this verb has no business touching. Insertion by line position,
|
|
18
|
-
// guided by indentation, keeps every byte outside the inserted block
|
|
19
|
-
// untouched.
|
|
20
|
-
//
|
|
21
|
-
// IDEMPOTENT. If `auto_approve:` already exists anywhere inside the
|
|
22
|
-
// pack's `config:` mapping (any indentation), this is a no-op: the
|
|
23
|
-
// output is byte-identical to the input. An operator who already
|
|
24
|
-
// hand-applied the workaround (the ADR's own "Workaround, bereits
|
|
25
|
-
// angewendet" paragraph) gets nothing rewritten out from under them.
|
|
26
|
-
//
|
|
27
|
-
// REFUSES ON AMBIGUITY. Zero or more than one
|
|
28
|
-
// `understanding-before-execution` pack block, more than one `config:`
|
|
29
|
-
// key inside it, or no `config:` key found at all, is a refusal
|
|
30
|
-
// (non-zero exit, a clear message), never a guess at where to insert.
|
|
31
|
-
import * as fs from "node:fs";
|
|
32
|
-
import * as path from "node:path";
|
|
33
|
-
import { parse as parseYaml } from "yaml";
|
|
34
|
-
import { atomicWriteFile } from "../../io/atomic-write.js";
|
|
35
|
-
import { unifiedDiff } from "../../io/patch.js";
|
|
36
|
-
import { withFileLock } from "../../io/lock.js";
|
|
37
|
-
import { formatValidationErrors, validateBeforeWrite, } from "../../io/validate-before-write.js";
|
|
38
|
-
import { resolveHomeDir } from "../../runtime/home-dir.js";
|
|
39
|
-
import { renderAutoApproveSnippet } from "../../policy-packs/builtin/understanding-before-execution-runtime.js";
|
|
40
|
-
import { EX_FAIL, EX_NOINPUT, HarnessExitError } from "../exit-codes.js";
|
|
41
|
-
const DEFAULT_BASENAME = "harness.yaml";
|
|
42
|
-
const LOCK_BASENAME = ".harness.lock";
|
|
43
|
-
function resolveTargetPath(opts) {
|
|
44
|
-
if (opts.configPath)
|
|
45
|
-
return path.resolve(opts.configPath);
|
|
46
|
-
return path.join(resolveHomeDir({ ...(opts.homeDir !== undefined ? { homeDir: opts.homeDir } : {}) }).path, DEFAULT_BASENAME);
|
|
47
|
-
}
|
|
48
|
-
function countLeadingSpaces(line) {
|
|
49
|
-
return line.length - line.trimStart().length;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Text-level insertion of the `auto_approve` default snippet into the
|
|
53
|
-
* `understanding-before-execution` pack's `config:` mapping. Pure: text
|
|
54
|
-
* in, text (+ a change flag) out, or an error string on ambiguity.
|
|
55
|
-
* Exported for direct unit testing without going through the CLI/file
|
|
56
|
-
* layer.
|
|
57
|
-
*/
|
|
58
|
-
/**
|
|
59
|
-
* The line ending most of `text` uses, so an insertion into a CRLF
|
|
60
|
-
* manifest does not mix in bare-LF lines (task 8f637efd review round 2
|
|
61
|
-
* F6): counts `\r\n` occurrences against LF-only ones (every `\n` not
|
|
62
|
-
* part of a `\r\n` pair) and picks whichever is more common, defaulting
|
|
63
|
-
* to `\n` on a tie or an all-LF file.
|
|
64
|
-
*/
|
|
65
|
-
function detectDominantEol(text) {
|
|
66
|
-
const crlfCount = (text.match(/\r\n/g) ?? []).length;
|
|
67
|
-
const totalLf = (text.match(/\n/g) ?? []).length;
|
|
68
|
-
const lfOnlyCount = totalLf - crlfCount;
|
|
69
|
-
return crlfCount > lfOnlyCount ? "\r\n" : "\n";
|
|
70
|
-
}
|
|
71
|
-
export function applyAutoApproveUpgrade(original) {
|
|
72
|
-
const eol = detectDominantEol(original);
|
|
73
|
-
// Split on either line ending so every line in `lines` is `\r`-free
|
|
74
|
-
// (its own trailing `\r`, if any, is consumed by the delimiter, not
|
|
75
|
-
// left dangling on the line content); the array is rejoined with the
|
|
76
|
-
// detected `eol` below, so a CRLF manifest stays CRLF end to end
|
|
77
|
-
// instead of picking up bare-LF lines from the inserted snippet.
|
|
78
|
-
const lines = original.split(/\r\n|\n/);
|
|
79
|
-
// Accepts a bare, double-quoted, or single-quoted scalar for the pack
|
|
80
|
-
// name (task 8f637efd review round 2 F4): `- name: understanding-before-execution`,
|
|
81
|
-
// `- name: "understanding-before-execution"`, and
|
|
82
|
-
// `- name: 'understanding-before-execution'` are all schema-valid YAML
|
|
83
|
-
// for the same value; the bare-only form previously refused the
|
|
84
|
-
// quoted spellings with "could not find a ... entry".
|
|
85
|
-
const packNameRe = /^(\s*)-\s*name:\s*(?:"understanding-before-execution"|'understanding-before-execution'|understanding-before-execution)\s*(#.*)?$/;
|
|
86
|
-
const packMatches = [];
|
|
87
|
-
for (let i = 0; i < lines.length; i++) {
|
|
88
|
-
const m = packNameRe.exec(lines[i] ?? "");
|
|
89
|
-
if (m)
|
|
90
|
-
packMatches.push({ index: i, indent: (m[1] ?? "").length });
|
|
91
|
-
}
|
|
92
|
-
if (packMatches.length === 0) {
|
|
93
|
-
return {
|
|
94
|
-
ok: false,
|
|
95
|
-
error: "could not find a `- name: understanding-before-execution` policy_packs entry in this manifest",
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
if (packMatches.length > 1) {
|
|
99
|
-
return {
|
|
100
|
-
ok: false,
|
|
101
|
-
error: `found ${packMatches.length} \`understanding-before-execution\` policy_packs entries; refusing (ambiguous)`,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
const pack = packMatches[0];
|
|
105
|
-
const itemIndent = pack.indent;
|
|
106
|
-
function findBoundary(startIdx, indentThreshold) {
|
|
107
|
-
for (let i = startIdx; i < lines.length; i++) {
|
|
108
|
-
const line = lines[i] ?? "";
|
|
109
|
-
if (line.trim() === "")
|
|
110
|
-
continue;
|
|
111
|
-
if (countLeadingSpaces(line) <= indentThreshold)
|
|
112
|
-
return i;
|
|
113
|
-
}
|
|
114
|
-
return lines.length;
|
|
115
|
-
}
|
|
116
|
-
const packEnd = findBoundary(pack.index + 1, itemIndent);
|
|
117
|
-
const configIndent = itemIndent + 2;
|
|
118
|
-
const configRe = /^config:\s*(#.*)?$/;
|
|
119
|
-
let configIdx = -1;
|
|
120
|
-
for (let i = pack.index + 1; i < packEnd; i++) {
|
|
121
|
-
const line = lines[i] ?? "";
|
|
122
|
-
if (line.trim() === "")
|
|
123
|
-
continue;
|
|
124
|
-
if (countLeadingSpaces(line) === configIndent && configRe.test(line.trim())) {
|
|
125
|
-
if (configIdx !== -1) {
|
|
126
|
-
return {
|
|
127
|
-
ok: false,
|
|
128
|
-
error: "found more than one `config:` key in the understanding-before-execution pack block; refusing (ambiguous)",
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
configIdx = i;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (configIdx === -1) {
|
|
135
|
-
return {
|
|
136
|
-
ok: false,
|
|
137
|
-
error: "could not find a `config:` key in the understanding-before-execution pack block",
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
let lastContentIdx = configIdx;
|
|
141
|
-
let autoApprovePresent = false;
|
|
142
|
-
for (let i = configIdx + 1; i < packEnd; i++) {
|
|
143
|
-
const line = lines[i] ?? "";
|
|
144
|
-
const trimmed = line.trim();
|
|
145
|
-
if (trimmed === "")
|
|
146
|
-
continue;
|
|
147
|
-
const indent = countLeadingSpaces(line);
|
|
148
|
-
if (indent <= configIndent)
|
|
149
|
-
break;
|
|
150
|
-
lastContentIdx = i;
|
|
151
|
-
// Review round 3, F3: any line whose trimmed form starts with
|
|
152
|
-
// `auto_approve:` counts as "already present", not only the exact
|
|
153
|
-
// bare-key spelling `auto_approve:` with nothing else on the line.
|
|
154
|
-
// That exact-equality check missed a hand-applied flow-style value
|
|
155
|
-
// (`auto_approve: {when: [bypassPermissions], ...}`) and a bare key
|
|
156
|
-
// with a trailing comment (`auto_approve: # already configured`):
|
|
157
|
-
// both are schema-valid YAML for the same key, but neither passed
|
|
158
|
-
// `trimmed === "auto_approve:"`, so this verb would insert a SECOND
|
|
159
|
-
// `auto_approve` key and `parseYaml` below would throw "Map keys
|
|
160
|
-
// must be unique" uncaught (exit 70, a raw YAML message) instead of
|
|
161
|
-
// recognizing the upgrade as already applied.
|
|
162
|
-
// Known limit: a line starting with `auto_approve:` inside a block scalar
|
|
163
|
-
// under another key would also count as present; the verb then no-ops
|
|
164
|
-
// (fail-safe, never a corrupted manifest) rather than inserting twice.
|
|
165
|
-
if (trimmed.startsWith("auto_approve:"))
|
|
166
|
-
autoApprovePresent = true;
|
|
167
|
-
}
|
|
168
|
-
if (autoApprovePresent) {
|
|
169
|
-
return { ok: true, text: original, changed: false };
|
|
170
|
-
}
|
|
171
|
-
const snippetLines = renderAutoApproveSnippet(configIndent + 2).split("\n");
|
|
172
|
-
const insertAt = lastContentIdx + 1;
|
|
173
|
-
const next = [...lines.slice(0, insertAt), ...snippetLines, ...lines.slice(insertAt)];
|
|
174
|
-
return { ok: true, text: next.join(eol), changed: true };
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* `parseYaml`, but a parse failure on the PROPOSED (post-insertion) text
|
|
178
|
-
* surfaces as this verb's own refusal (`HarnessExitError`, `EX_FAIL`,
|
|
179
|
-
* naming the pack and that the proposed text did not parse) rather than
|
|
180
|
-
* an uncaught exception (review round 3, F3: before this wrapper, a
|
|
181
|
-
* proposal `applyAutoApproveUpgrade` mis-recognized as a genuine
|
|
182
|
-
* insertion (e.g. a duplicate key under a different quoting style this
|
|
183
|
-
* heuristic does not special-case) reached the operator as a raw
|
|
184
|
-
* "Map keys must be unique" crash at exit 70 instead of a normal
|
|
185
|
-
* refusal). `original` is never passed here: it is the operator's own
|
|
186
|
-
* file, already on disk, and is not re-validated by this verb.
|
|
187
|
-
*/
|
|
188
|
-
function parseProposedYamlOrRefuse(text, name, context) {
|
|
189
|
-
try {
|
|
190
|
-
return parseYaml(text);
|
|
191
|
-
}
|
|
192
|
-
catch (err) {
|
|
193
|
-
throw new HarnessExitError(`harness pack upgrade: proposed manifest for pack ${JSON.stringify(name)} did not parse as YAML (${context}): ${err instanceof Error ? err.message : String(err)}`, EX_FAIL);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* `harness pack upgrade <name>` implementation. `name` is validated
|
|
198
|
-
* against the (currently one-entry) set of known upgrades before any
|
|
199
|
-
* file I/O; an unknown name refuses with `EX_FAIL` rather than silently
|
|
200
|
-
* doing nothing.
|
|
201
|
-
*/
|
|
202
|
-
export async function packUpgrade(name, opts = {}) {
|
|
203
|
-
if (name !== "understanding-before-execution") {
|
|
204
|
-
throw new HarnessExitError(`harness pack upgrade does not support ${JSON.stringify(name)} yet; only "understanding-before-execution" (auto_approve default, task 8f637efd) is wired.`, EX_FAIL);
|
|
205
|
-
}
|
|
206
|
-
const target = resolveTargetPath(opts);
|
|
207
|
-
if (!fs.existsSync(target)) {
|
|
208
|
-
throw new HarnessExitError(`harness manifest not found at ${target}; run \`harness init\` first`, EX_NOINPUT);
|
|
209
|
-
}
|
|
210
|
-
const original = fs.readFileSync(target, "utf8");
|
|
211
|
-
const result = applyAutoApproveUpgrade(original);
|
|
212
|
-
if (!result.ok) {
|
|
213
|
-
throw new HarnessExitError(`harness pack upgrade: ${result.error}`, EX_FAIL);
|
|
214
|
-
}
|
|
215
|
-
const diff = unifiedDiff({
|
|
216
|
-
fileName: path.basename(target),
|
|
217
|
-
oldText: original,
|
|
218
|
-
newText: result.text,
|
|
219
|
-
oldHeader: "current",
|
|
220
|
-
newHeader: "proposed",
|
|
221
|
-
});
|
|
222
|
-
if (!result.changed) {
|
|
223
|
-
return { path: target, name, diff, applied: false, alreadyPresent: true };
|
|
224
|
-
}
|
|
225
|
-
// Schema gate before ever touching disk, mirroring `pack add` / `pack
|
|
226
|
-
// reseed`: catches an insertion that would somehow produce an invalid
|
|
227
|
-
// manifest (e.g. a config: key this heuristic mis-located) before it
|
|
228
|
-
// reaches the operator's file.
|
|
229
|
-
const schemaResult = validateBeforeWrite(parseProposedYamlOrRefuse(result.text, name, "post-insertion validation"));
|
|
230
|
-
if (!schemaResult.ok) {
|
|
231
|
-
throw new HarnessExitError(`proposed manifest fails schema validation:\n${formatValidationErrors(schemaResult.errors)}`, EX_FAIL);
|
|
232
|
-
}
|
|
233
|
-
if (opts.dryRun) {
|
|
234
|
-
return { path: target, name, diff, applied: false, alreadyPresent: false };
|
|
235
|
-
}
|
|
236
|
-
const lockPath = path.join(path.dirname(target), LOCK_BASENAME);
|
|
237
|
-
// Review round 3, F4: whether the locked callback actually WROTE is
|
|
238
|
-
// tracked here rather than assumed. The pre-lock read above can be
|
|
239
|
-
// stale by the time the lock is acquired: if a concurrent writer
|
|
240
|
-
// already inserted the block, the callback below returns early
|
|
241
|
-
// (`recomputed.changed === false`) without writing anything, and the
|
|
242
|
-
// result reported to the caller/CLI must say so (`applied: false,
|
|
243
|
-
// alreadyPresent: true`, so `harness pack upgrade` prints the
|
|
244
|
-
// "already carries this upgrade" message) instead of the hardcoded
|
|
245
|
-
// `applied: true` this used to return unconditionally.
|
|
246
|
-
let wroteUnderLock = false;
|
|
247
|
-
await withFileLock(lockPath, () => {
|
|
248
|
-
// Re-read and recompute under the lock (mirrors `pack add`): a
|
|
249
|
-
// concurrent writer may have inserted the block (or changed the
|
|
250
|
-
// file entirely) between the pre-lock read above and now.
|
|
251
|
-
const current = fs.readFileSync(target, "utf8");
|
|
252
|
-
const recomputed = applyAutoApproveUpgrade(current);
|
|
253
|
-
if (!recomputed.ok) {
|
|
254
|
-
throw new HarnessExitError(`harness pack upgrade: ${recomputed.error}`, EX_FAIL);
|
|
255
|
-
}
|
|
256
|
-
if (!recomputed.changed)
|
|
257
|
-
return; // raced: someone else already inserted it
|
|
258
|
-
const recheck = validateBeforeWrite(parseProposedYamlOrRefuse(recomputed.text, name, "post-insertion validation after lock acquisition"));
|
|
259
|
-
if (!recheck.ok) {
|
|
260
|
-
throw new HarnessExitError(`proposed manifest fails schema validation after lock acquisition:\n${formatValidationErrors(recheck.errors)}`, EX_FAIL);
|
|
261
|
-
}
|
|
262
|
-
atomicWriteFile(target, recomputed.text);
|
|
263
|
-
wroteUnderLock = true;
|
|
264
|
-
});
|
|
265
|
-
return {
|
|
266
|
-
path: target,
|
|
267
|
-
name,
|
|
268
|
-
diff,
|
|
269
|
-
applied: wroteUnderLock,
|
|
270
|
-
alreadyPresent: !wroteUnderLock,
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
//# sourceMappingURL=upgrade.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../src/cli/pack/upgrade.ts"],"names":[],"mappings":"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AAE,OAAO,CAAC,0CAA0C;QAC3E,MAAM,OAAO,GAAG,mBAAmB,CACjC,yBAAyB,CACvB,UAAU,CAAC,IAAI,EACf,IAAI,EACJ,kDAAkD,CACnD,CACF,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;YAChB,MAAM,IAAI,gBAAgB,CACxB,sEAAsE,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC9G,OAAO,CACR,CAAC;QACJ,CAAC;QACD,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;QACzC,cAAc,GAAG,IAAI,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI;QACJ,IAAI;QACJ,OAAO,EAAE,cAAc;QACvB,cAAc,EAAE,CAAC,cAAc;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { type PauseSentinel } from "../../runtime/pause-sentinel.js";
|
|
2
|
-
import type { Manifest } from "../../schema/index.js";
|
|
3
|
-
import { type LoaderOptions } from "../loader.js";
|
|
4
|
-
/**
|
|
5
|
-
* Synthetic grounding session bucket for operator-side pause/resume
|
|
6
|
-
* events. Audit consumers (`harness audit --since 24h`, the `explain
|
|
7
|
-
* --last` walker, any custom ledger query) need to know to look in
|
|
8
|
-
* `default` for these facts, not in a per-agent session id — pause runs
|
|
9
|
-
* from the operator shell where no `$CLAUDE_SESSION_ID` is set, so a
|
|
10
|
-
* synthetic bucket is the only option that keeps the audit trail
|
|
11
|
-
* queryable. This matches the convention `harness audit` already uses
|
|
12
|
-
* when `$CLAUDE_SESSION_ID` is unset.
|
|
13
|
-
*/
|
|
14
|
-
export declare const OPERATOR_LEDGER_SESSION = "default";
|
|
15
|
-
export interface PauseOptions extends LoaderOptions {
|
|
16
|
-
/** Duration string ("5m", "1h", "PT30S"); ignored when `indefinite=true`. */
|
|
17
|
-
forDuration?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Skip the auto-expiry. The CLI requires `acceptNoAutoResume=true`
|
|
20
|
-
* alongside or it refuses with usage help — the verbose flag itself
|
|
21
|
-
* is the friction against routine indefinite-pausing.
|
|
22
|
-
*/
|
|
23
|
-
indefinite?: boolean;
|
|
24
|
-
/** Acknowledges the no-auto-resume contract of `--indefinite`. */
|
|
25
|
-
acceptNoAutoResume?: boolean;
|
|
26
|
-
/** Free-form reason recorded in the sentinel + announced on each hook fire. */
|
|
27
|
-
reason?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Acknowledges the non-TTY stdin escape hatch. Without this, a
|
|
30
|
-
* scripted invocation (no controlling terminal) is refused.
|
|
31
|
-
*/
|
|
32
|
-
iAmTheOperator?: boolean;
|
|
33
|
-
/** Override "now" for deterministic tests. */
|
|
34
|
-
now?: Date;
|
|
35
|
-
/** Override the harness.generated/ directory (test injection). */
|
|
36
|
-
generatedDir?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Override the inherited legacy `$CLAUDE_SESSION_ID` (test injection).
|
|
39
|
-
* When set to a non-empty string, the verb refuses to run.
|
|
40
|
-
*/
|
|
41
|
-
claudeSessionIdEnv?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Override the inherited canonical `$CLAUDE_CODE_SESSION_ID` (test
|
|
44
|
-
* injection). When set to a non-empty string, the verb refuses to run.
|
|
45
|
-
*/
|
|
46
|
-
claudeCodeSessionIdEnv?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Override the inherited `$CODEX_SESSION_ID` (test injection). When
|
|
49
|
-
* set to a non-empty string, the verb refuses to run.
|
|
50
|
-
*/
|
|
51
|
-
codexSessionIdEnv?: string;
|
|
52
|
-
/** Override stdin TTY detection (test injection). */
|
|
53
|
-
stdinIsTTY?: boolean;
|
|
54
|
-
/** Override the recorded `pausedBy` identity (test injection). */
|
|
55
|
-
pausedBy?: string;
|
|
56
|
-
/** Inject a manifest (test). */
|
|
57
|
-
manifest?: Manifest;
|
|
58
|
-
/** Inject a fake ledger writer (test). */
|
|
59
|
-
ledgerAdd?: (sessionId: string, content: string) => Promise<{
|
|
60
|
-
ok: true;
|
|
61
|
-
} | {
|
|
62
|
-
ok: false;
|
|
63
|
-
reason: string;
|
|
64
|
-
}>;
|
|
65
|
-
}
|
|
66
|
-
export interface PauseResult {
|
|
67
|
-
sentinelPath: string;
|
|
68
|
-
sentinel: PauseSentinel;
|
|
69
|
-
alreadyPaused: boolean;
|
|
70
|
-
ledger: {
|
|
71
|
-
ok: boolean;
|
|
72
|
-
tag: string;
|
|
73
|
-
reason?: string;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
export interface ResumeOptions extends LoaderOptions {
|
|
77
|
-
/** Override "now" for tests. */
|
|
78
|
-
now?: Date;
|
|
79
|
-
/** Override the harness.generated/ directory (test injection). */
|
|
80
|
-
generatedDir?: string;
|
|
81
|
-
/** Override the inherited legacy `$CLAUDE_SESSION_ID` (test injection). */
|
|
82
|
-
claudeSessionIdEnv?: string;
|
|
83
|
-
/** Override the inherited canonical `$CLAUDE_CODE_SESSION_ID` (test injection). */
|
|
84
|
-
claudeCodeSessionIdEnv?: string;
|
|
85
|
-
/** Override the inherited `$CODEX_SESSION_ID` (test injection). */
|
|
86
|
-
codexSessionIdEnv?: string;
|
|
87
|
-
/** Override stdin TTY detection (test injection). */
|
|
88
|
-
stdinIsTTY?: boolean;
|
|
89
|
-
/** Acknowledges the non-TTY stdin escape hatch (mirror of pause). */
|
|
90
|
-
iAmTheOperator?: boolean;
|
|
91
|
-
/** Inject a manifest (test). */
|
|
92
|
-
manifest?: Manifest;
|
|
93
|
-
/** Inject a fake ledger writer (test). */
|
|
94
|
-
ledgerAdd?: (sessionId: string, content: string) => Promise<{
|
|
95
|
-
ok: true;
|
|
96
|
-
} | {
|
|
97
|
-
ok: false;
|
|
98
|
-
reason: string;
|
|
99
|
-
}>;
|
|
100
|
-
}
|
|
101
|
-
export interface ResumeResult {
|
|
102
|
-
sentinelPath: string;
|
|
103
|
-
wasPaused: boolean;
|
|
104
|
-
/** Last known sentinel state, or null when none existed. */
|
|
105
|
-
previousSentinel: PauseSentinel | null;
|
|
106
|
-
ledger: {
|
|
107
|
-
ok: boolean;
|
|
108
|
-
tag: string;
|
|
109
|
-
reason?: string;
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
export declare function pause(opts?: PauseOptions): Promise<PauseResult>;
|
|
113
|
-
export declare function resume(opts?: ResumeOptions): Promise<ResumeResult>;
|
package/dist/cli/pause/index.js
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
// `harness pause` / `harness resume` — temporary hook bypass.
|
|
2
|
-
//
|
|
3
|
-
// Sentinel-based, all-or-nothing, operator-only. Lives next to the
|
|
4
|
-
// existing `harness.generated/` artefacts; the per-hook integration is
|
|
5
|
-
// in `src/runtime/pause-sentinel.ts`.
|
|
6
|
-
//
|
|
7
|
-
// The verbs are intentionally not a debugging convenience: they exist
|
|
8
|
-
// for three narrow flows and the guardrails (refuse-when-agent-session-env,
|
|
9
|
-
// refuse-non-TTY, `--indefinite` requires a verbose accept-flag) push
|
|
10
|
-
// back against any other use. See the task description on agent-tasks
|
|
11
|
-
// `07850f73-511b-44dc-b5aa-f8564fd15fff` for the design rationale and
|
|
12
|
-
// the slippery-slope analysis.
|
|
13
|
-
//
|
|
14
|
-
// Agent-shell detection looks at three env vars (any one set is enough
|
|
15
|
-
// to refuse): `$CLAUDE_CODE_SESSION_ID` (what Claude Code actually
|
|
16
|
-
// exports), legacy `$CLAUDE_SESSION_ID`, and `$CODEX_SESSION_ID` for
|
|
17
|
-
// the Codex runtime. The legacy `$CLAUDE_SESSION_ID` is kept for
|
|
18
|
-
// back-compat with hand-rolled wrappers that export it manually.
|
|
19
|
-
import * as os from "node:os";
|
|
20
|
-
import { parseDurationSeconds, InvalidDurationError } from "../../policies/index.js";
|
|
21
|
-
import { resolveGeneratedDir } from "../../io/generated-dir.js";
|
|
22
|
-
import { deleteSentinel, readSentinel, sentinelPath, writeSentinel, } from "../../runtime/pause-sentinel.js";
|
|
23
|
-
import { addLedgerFact } from "../../runtime/ledger-add.js";
|
|
24
|
-
import { EX_FAIL, EX_USAGE, HarnessExitError } from "../exit-codes.js";
|
|
25
|
-
import { loadManifest, resolvePaths } from "../loader.js";
|
|
26
|
-
import { expandHome } from "../../io/expand-home.js";
|
|
27
|
-
const DEFAULT_PAUSE_SECONDS = 15 * 60;
|
|
28
|
-
/**
|
|
29
|
-
* Synthetic grounding session bucket for operator-side pause/resume
|
|
30
|
-
* events. Audit consumers (`harness audit --since 24h`, the `explain
|
|
31
|
-
* --last` walker, any custom ledger query) need to know to look in
|
|
32
|
-
* `default` for these facts, not in a per-agent session id — pause runs
|
|
33
|
-
* from the operator shell where no `$CLAUDE_SESSION_ID` is set, so a
|
|
34
|
-
* synthetic bucket is the only option that keeps the audit trail
|
|
35
|
-
* queryable. This matches the convention `harness audit` already uses
|
|
36
|
-
* when `$CLAUDE_SESSION_ID` is unset.
|
|
37
|
-
*/
|
|
38
|
-
export const OPERATOR_LEDGER_SESSION = "default";
|
|
39
|
-
function findGroundingMcp(manifest) {
|
|
40
|
-
return manifest.tools.mcp.find((m) => m.name === "grounding-mcp") ?? null;
|
|
41
|
-
}
|
|
42
|
-
async function writeLedgerTag(manifest, content, source, injected) {
|
|
43
|
-
if (injected)
|
|
44
|
-
return injected(OPERATOR_LEDGER_SESSION, content);
|
|
45
|
-
if (!manifest) {
|
|
46
|
-
return { ok: false, reason: "manifest unreadable; skipped ledger write" };
|
|
47
|
-
}
|
|
48
|
-
const server = findGroundingMcp(manifest);
|
|
49
|
-
if (!server) {
|
|
50
|
-
return { ok: false, reason: "grounding-mcp not declared in manifest" };
|
|
51
|
-
}
|
|
52
|
-
const command = Array.isArray(server.command)
|
|
53
|
-
? server.command.map((p) => expandHome(p))
|
|
54
|
-
: server.command.trim().split(/\s+/).map((p) => expandHome(p));
|
|
55
|
-
return addLedgerFact({
|
|
56
|
-
mcpCommand: command,
|
|
57
|
-
...(server.env && { mcpEnv: server.env }),
|
|
58
|
-
timeoutMs: server.health?.timeout_ms ?? 5_000,
|
|
59
|
-
sessionId: OPERATOR_LEDGER_SESSION,
|
|
60
|
-
content,
|
|
61
|
-
source,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function resolveGeneratedDirForVerb(opts) {
|
|
65
|
-
if (opts.generatedDir !== undefined)
|
|
66
|
-
return opts.generatedDir;
|
|
67
|
-
return resolveGeneratedDir({
|
|
68
|
-
...(opts.homeDir !== undefined ? { homeDir: opts.homeDir } : {}),
|
|
69
|
-
manifestPath: resolvePaths(opts).base,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
function refuseIfAgentShell(opts) {
|
|
73
|
-
const slots = [
|
|
74
|
-
{
|
|
75
|
-
name: "$CLAUDE_CODE_SESSION_ID",
|
|
76
|
-
value: opts.claudeCodeSessionIdEnv !== undefined
|
|
77
|
-
? opts.claudeCodeSessionIdEnv
|
|
78
|
-
: process.env.CLAUDE_CODE_SESSION_ID,
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: "$CLAUDE_SESSION_ID",
|
|
82
|
-
value: opts.claudeSessionIdEnv !== undefined
|
|
83
|
-
? opts.claudeSessionIdEnv
|
|
84
|
-
: process.env.CLAUDE_SESSION_ID,
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: "$CODEX_SESSION_ID",
|
|
88
|
-
value: opts.codexSessionIdEnv !== undefined
|
|
89
|
-
? opts.codexSessionIdEnv
|
|
90
|
-
: process.env.CODEX_SESSION_ID,
|
|
91
|
-
},
|
|
92
|
-
];
|
|
93
|
-
const hit = slots.find((s) => typeof s.value === "string" && s.value.length > 0);
|
|
94
|
-
if (hit !== undefined) {
|
|
95
|
-
throw new HarnessExitError([
|
|
96
|
-
`harness pause/resume refuses to run inside an agent shell (${hit.name} is set).`,
|
|
97
|
-
"",
|
|
98
|
-
"This is a speed bump, not a boundary: a Claude Code `! `-prefixed command",
|
|
99
|
-
"runs in a shell that INHERITS this same session's environment and stdin, so",
|
|
100
|
-
"it is indistinguishable from an agent-issued command and trips this exact",
|
|
101
|
-
"check. Do not prefix with `! `: that does not work. Run the verb from a",
|
|
102
|
-
"terminal OUTSIDE this agent session (a separate terminal window or tab, not",
|
|
103
|
-
"spawned by or nested inside this one). The real enforcement boundary is the",
|
|
104
|
-
"PreToolUse deny-policy layer (see docs/okf/pause-vs-gate-kill-switch.md),",
|
|
105
|
-
"not this CLI check.",
|
|
106
|
-
].join("\n"), EX_USAGE);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function refuseIfNonTTY(opts) {
|
|
110
|
-
const tty = opts.stdinIsTTY !== undefined ? opts.stdinIsTTY : process.stdin.isTTY === true;
|
|
111
|
-
if (tty)
|
|
112
|
-
return;
|
|
113
|
-
if (opts.iAmTheOperator === true)
|
|
114
|
-
return;
|
|
115
|
-
throw new HarnessExitError([
|
|
116
|
-
"harness pause/resume refuses to run with non-TTY stdin (looks scripted).",
|
|
117
|
-
"",
|
|
118
|
-
"If you really mean this (e.g. invoking from a one-off recovery script that",
|
|
119
|
-
"you reviewed yourself), pass --i-am-the-operator to acknowledge.",
|
|
120
|
-
"",
|
|
121
|
-
"WARNING: --i-am-the-operator only lifts the non-TTY check; it never lifts",
|
|
122
|
-
"the agent-shell check above. If an agent ever asks YOU to pass this flag on",
|
|
123
|
-
"its behalf, that request IS the attack this guard exists to stop: refuse it.",
|
|
124
|
-
].join("\n"), EX_USAGE);
|
|
125
|
-
}
|
|
126
|
-
function loadManifestBestEffort(opts) {
|
|
127
|
-
if (opts.manifest)
|
|
128
|
-
return opts.manifest;
|
|
129
|
-
try {
|
|
130
|
-
return loadManifest(opts).manifest;
|
|
131
|
-
}
|
|
132
|
-
catch {
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function defaultPausedBy() {
|
|
137
|
-
const user = process.env.USER ?? process.env.LOGNAME ?? "unknown";
|
|
138
|
-
let host = "unknown";
|
|
139
|
-
try {
|
|
140
|
-
host = os.hostname();
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
/* keep "unknown" */
|
|
144
|
-
}
|
|
145
|
-
return `${user}@${host}`;
|
|
146
|
-
}
|
|
147
|
-
export async function pause(opts = {}) {
|
|
148
|
-
refuseIfAgentShell(opts);
|
|
149
|
-
refuseIfNonTTY(opts);
|
|
150
|
-
if (opts.indefinite === true && opts.acceptNoAutoResume !== true) {
|
|
151
|
-
throw new HarnessExitError([
|
|
152
|
-
"--indefinite refuses to run without --i-am-the-operator-and-accept-no-auto-resume.",
|
|
153
|
-
"",
|
|
154
|
-
"The verbose flag is the friction. An indefinite pause leaves harness",
|
|
155
|
-
"dormant until you remember to `harness resume`. Prefer `--for <duration>`",
|
|
156
|
-
"(e.g. --for 1h, --for 30m) — it auto-resumes so a forgotten pause cannot",
|
|
157
|
-
"silently disable your gates across sessions.",
|
|
158
|
-
].join("\n"), EX_USAGE);
|
|
159
|
-
}
|
|
160
|
-
const now = opts.now ?? new Date();
|
|
161
|
-
let expiresAt;
|
|
162
|
-
if (opts.indefinite === true) {
|
|
163
|
-
expiresAt = null;
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
let seconds;
|
|
167
|
-
if (typeof opts.forDuration === "string" && opts.forDuration.length > 0) {
|
|
168
|
-
try {
|
|
169
|
-
seconds = parseDurationSeconds(opts.forDuration);
|
|
170
|
-
}
|
|
171
|
-
catch (err) {
|
|
172
|
-
if (err instanceof InvalidDurationError) {
|
|
173
|
-
throw new HarnessExitError(err.message, EX_USAGE);
|
|
174
|
-
}
|
|
175
|
-
throw err;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
seconds = DEFAULT_PAUSE_SECONDS;
|
|
180
|
-
}
|
|
181
|
-
if (seconds <= 0) {
|
|
182
|
-
throw new HarnessExitError(`--for must be a positive duration (got "${opts.forDuration ?? ""}")`, EX_USAGE);
|
|
183
|
-
}
|
|
184
|
-
expiresAt = new Date(now.getTime() + seconds * 1000).toISOString();
|
|
185
|
-
}
|
|
186
|
-
const generatedDir = resolveGeneratedDirForVerb(opts);
|
|
187
|
-
const file = sentinelPath(generatedDir);
|
|
188
|
-
// Surface an existing pause without overwriting silently. Operators
|
|
189
|
-
// who re-run `harness pause` usually want to extend; we detect it and
|
|
190
|
-
// overwrite, but flag it via `alreadyPaused: true` in the result so the
|
|
191
|
-
// CLI can mention it in the human-readable output.
|
|
192
|
-
const prior = readSentinel(generatedDir, now);
|
|
193
|
-
const alreadyPaused = prior.kind === "active";
|
|
194
|
-
const sentinel = {
|
|
195
|
-
pausedAt: now.toISOString(),
|
|
196
|
-
expiresAt,
|
|
197
|
-
reason: typeof opts.reason === "string" && opts.reason.length > 0 ? opts.reason : null,
|
|
198
|
-
pausedBy: opts.pausedBy ?? defaultPausedBy(),
|
|
199
|
-
};
|
|
200
|
-
try {
|
|
201
|
-
writeSentinel(generatedDir, sentinel);
|
|
202
|
-
}
|
|
203
|
-
catch (err) {
|
|
204
|
-
throw new HarnessExitError(`failed to write sentinel at ${file}: ${err.message}`, EX_FAIL);
|
|
205
|
-
}
|
|
206
|
-
const manifest = loadManifestBestEffort(opts);
|
|
207
|
-
const tag = `harness-paused:${sentinel.pausedAt}`;
|
|
208
|
-
const ledgerResult = await writeLedgerTag(manifest, tag, "harness-pause-cli", opts.ledgerAdd);
|
|
209
|
-
return {
|
|
210
|
-
sentinelPath: file,
|
|
211
|
-
sentinel,
|
|
212
|
-
alreadyPaused,
|
|
213
|
-
ledger: ledgerResult.ok
|
|
214
|
-
? { ok: true, tag }
|
|
215
|
-
: { ok: false, tag, reason: ledgerResult.reason },
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
export async function resume(opts = {}) {
|
|
219
|
-
refuseIfAgentShell(opts);
|
|
220
|
-
refuseIfNonTTY(opts);
|
|
221
|
-
const now = opts.now ?? new Date();
|
|
222
|
-
const generatedDir = resolveGeneratedDirForVerb(opts);
|
|
223
|
-
const file = sentinelPath(generatedDir);
|
|
224
|
-
const prior = readSentinel(generatedDir, now);
|
|
225
|
-
const previousSentinel = prior.kind === "active" || prior.kind === "expired" ? prior.sentinel : null;
|
|
226
|
-
// Idempotent: missing sentinel is exit-0 with a notice. No-op ledger
|
|
227
|
-
// write either — the audit log only carries actual resume events, not
|
|
228
|
-
// the case where the operator typed `harness resume` against an
|
|
229
|
-
// already-clean install.
|
|
230
|
-
if (prior.kind === "absent") {
|
|
231
|
-
return {
|
|
232
|
-
sentinelPath: file,
|
|
233
|
-
wasPaused: false,
|
|
234
|
-
previousSentinel: null,
|
|
235
|
-
ledger: { ok: false, tag: "", reason: "no active pause; ledger write skipped" },
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
deleteSentinel(generatedDir);
|
|
239
|
-
const manifest = loadManifestBestEffort(opts);
|
|
240
|
-
const tag = `harness-resumed:${previousSentinel?.pausedAt ?? now.toISOString()}`;
|
|
241
|
-
const ledgerResult = await writeLedgerTag(manifest, tag, "harness-resume-cli", opts.ledgerAdd);
|
|
242
|
-
return {
|
|
243
|
-
sentinelPath: file,
|
|
244
|
-
wasPaused: true,
|
|
245
|
-
previousSentinel,
|
|
246
|
-
ledger: ledgerResult.ok
|
|
247
|
-
? { ok: true, tag }
|
|
248
|
-
: { ok: false, tag, reason: ledgerResult.reason },
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/pause/index.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,mEAAmE;AACnE,uEAAuE;AACvE,sCAAsC;AACtC,EAAE;AACF,sEAAsE;AACtE,4EAA4E;AAC5E,sEAAsE;AACtE,sEAAsE;AACtE,sEAAsE;AACtE,+BAA+B;AAC/B,EAAE;AACF,uEAAuE;AACvE,mEAAmE;AAC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