@lannguyensi/harness 0.52.0 → 0.53.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/cli/doctor/bypass-without-auto-approve.d.ts +38 -0
  3. package/dist/cli/doctor/bypass-without-auto-approve.js +89 -0
  4. package/dist/cli/doctor/bypass-without-auto-approve.js.map +1 -0
  5. package/dist/cli/doctor/format.js +7 -0
  6. package/dist/cli/doctor/format.js.map +1 -1
  7. package/dist/cli/doctor/index.js +17 -0
  8. package/dist/cli/doctor/index.js.map +1 -1
  9. package/dist/cli/doctor/types.d.ts +11 -0
  10. package/dist/cli/doctor/types.js.map +1 -1
  11. package/dist/cli/doctor/ug-auto-approvals.js +18 -43
  12. package/dist/cli/doctor/ug-auto-approvals.js.map +1 -1
  13. package/dist/cli/gc/index.d.ts +13 -2
  14. package/dist/cli/gc/index.js +203 -1
  15. package/dist/cli/gc/index.js.map +1 -1
  16. package/dist/cli/index.js +44 -6
  17. package/dist/cli/index.js.map +1 -1
  18. package/dist/cli/init/composer.js +9 -0
  19. package/dist/cli/init/composer.js.map +1 -1
  20. package/dist/cli/init/profiles.d.ts +2 -2
  21. package/dist/cli/init/profiles.js +11 -0
  22. package/dist/cli/init/profiles.js.map +1 -1
  23. package/dist/cli/init/templates.d.ts +1 -1
  24. package/dist/cli/init/templates.js +11 -0
  25. package/dist/cli/init/templates.js.map +1 -1
  26. package/dist/cli/pack/hook-pre-tool-use.js +20 -21
  27. package/dist/cli/pack/hook-pre-tool-use.js.map +1 -1
  28. package/dist/cli/pack/index.d.ts +1 -0
  29. package/dist/cli/pack/index.js +1 -0
  30. package/dist/cli/pack/index.js.map +1 -1
  31. package/dist/cli/pack/upgrade.d.ts +32 -0
  32. package/dist/cli/pack/upgrade.js +273 -0
  33. package/dist/cli/pack/upgrade.js.map +1 -0
  34. package/dist/io/read-json-dir-entries.d.ts +36 -0
  35. package/dist/io/read-json-dir-entries.js +38 -0
  36. package/dist/io/read-json-dir-entries.js.map +1 -0
  37. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.d.ts +35 -0
  38. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js +86 -0
  39. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve-default.js.map +1 -0
  40. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.d.ts +14 -0
  41. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js +14 -0
  42. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js.map +1 -1
  43. package/dist/policy-packs/builtin/understanding-before-execution/index.d.ts +3 -1
  44. package/dist/policy-packs/builtin/understanding-before-execution/index.js +18 -1
  45. package/dist/policy-packs/builtin/understanding-before-execution/index.js.map +1 -1
  46. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.d.ts +71 -0
  47. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js +169 -0
  48. package/dist/policy-packs/builtin/understanding-before-execution/permission-mode-observations.js.map +1 -0
  49. package/dist/runtime/git-context.js +7 -1
  50. package/dist/runtime/git-context.js.map +1 -1
  51. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  export declare const MINIMAL_TEMPLATE = "# ~/.harness/harness.yaml (legacy: ~/.claude/harness.yaml)\n#\n# Bootstrapped by `harness init --template minimal`.\n#\n# This is the empty-but-valid manifest. Run `harness validate` to confirm it\n# parses, then add entries under the five top-level keys:\n#\n# grounding: evidence-ledger + claim-gate config (see docs/ARCHITECTURE.md \u00A72)\n# tools: mcp / cli / skills / builtin inventory (\u00A73)\n# memory: directories, retention, scopes (\u00A74)\n# hooks: event-bound shell commands (\u00A75)\n# policies: named rules that bind hooks to triggers (\u00A76)\n#\n# Phase 2 verbs to add entries safely: `harness add mcp <name> ...`,\n# `harness add cli`, `harness add hook`, `harness add skill`.\n# Per-machine overrides live at ~/.harness/machines/<discriminator>.harness.overrides.yaml\n# (ARCHITECTURE.md \u00A78) for paths that vary per host.\n#\n# Docs: https://github.com/LanNguyenSi/harness\n\nversion: 1\n";
2
- export declare const FULL_TEMPLATE = "# ~/.harness/harness.yaml (legacy: ~/.claude/harness.yaml)\n#\n# Bootstrapped by `harness init --template full`. The reference manifest:\n# every example policy from docs/examples/full-manifest.yaml wired through\n# the generic `harness policy intercept` engine, so no external shell\n# scripts under ~/.claude/hooks/ are required.\n#\n# Canonical source for the policy + policy_packs sections is\n# docs/examples/full-manifest.yaml. A parity vitest\n# (tests/cli/init-full-template-parity.test.ts) fails the build if the\n# two diverge on policy names or load-bearing fields.\n#\n# What you still need on PATH (the wizard offers to `npm i -g` these on\n# init): agent-tasks-mcp-bridge, grounding-mcp, memory-router-*,\n# understanding-gate-claude-*.\n\nversion: 1\n\ngrounding:\n session:\n auto_start: true\n id_format: \"gs-{repo}-{rand:8}\"\n evidence_ledger:\n path: ~/.evidence-ledger/ledger.db\n retention_days: 90\n policies_source: ~/.claude/harness.d/policies/claim-gate.yaml\n\ntools:\n mcp:\n # codebase-oracle (the Pandora RAG MCP server) is intentionally NOT\n # in the Full default. It is published as\n # `@lannguyensi/codebase-oracle` and works fine standalone, but it\n # is an opinionated workflow add-on (multi-repo semantic search)\n # rather than infrastructure harness itself assumes. Operators who\n # want it wire it explicitly:\n # npm i -g @lannguyensi/codebase-oracle\n # harness add mcp codebase-oracle --command codebase-oracle,mcp\n # Set ORACLE_SCAN_ROOT (absolute path; tilde is not expanded by the\n # MCP env block) and OPENAI_API_KEY (or switch providers via\n # ORACLE_LLM_PROVIDER) before the first call.\n - name: agent-tasks\n # Zero-setup entry: `@agent-tasks/mcp-bridge` exposes the\n # `agent-tasks-mcp-bridge` binary on PATH. The bridge owns token\n # storage and defaults to the hosted backend; override with\n # `AGENT_TASKS_BASE_URL` / `AGENT_TASKS_TOKEN` for self-hosted.\n # `min_version` floor: 0.6.0 added the `--version` short-circuit\n # the doctor probe needs (PR agent-tasks/240, release-cut PR 241).\n # Bump the floor whenever a fix you depend on lands; loose floors\n # are fine, the point is the drift signal not pinning a specific cut.\n command: [agent-tasks-mcp-bridge]\n min_version: \"0.6.0\"\n health:\n verb: projects_list\n timeout_ms: 5000\n enabled: true\n - name: grounding-mcp\n # Published bin from `@lannguyensi/grounding-mcp`. No env is set:\n # the bundled default resolves to `~/.evidence-ledger/ledger.db`\n # via os.homedir() at startup. Passing a literal tilde in env\n # bypasses shell expansion and creates rogue cwd-relative DB files\n # (see agent-tasks/42d224a6 incident). `min_version` floor: 0.2.0\n # added the `--version` short-circuit the doctor probe needs (PR\n # agent-grounding/76, release-cut PR 77).\n command: [grounding-mcp]\n min_version: \"0.2.0\"\n health:\n verb: ledger_status\n timeout_ms: 5000\n enabled: true\n\n cli:\n - name: gh\n binary: gh\n required: true\n\n skills:\n enabled:\n - simplify\n - init\n - review\n - security-review\n source_dirs:\n - ~/.claude/skills\n\n builtin:\n known: [Read, Edit, Write, Bash, Agent, Skill, TaskCreate, Glob, Grep]\n\nmemory:\n directories:\n - path: ~/.claude/projects/{project}/memory\n scope: project\n router:\n # Published bin from `@lannguyensi/memory-router`.\n # `min_version` floor: 0.3.0 added the `--version` short-circuit\n # the doctor probe needs (PR agent-memory/40, release-cut PR 41).\n command: [memory-router-user-prompt-submit]\n min_version: \"0.3.0\"\n enabled: true\n retention:\n staleness_days: 180\n broken_refs: warn\n scopes:\n default: project\n allowed: [project, user]\n\n# All PreToolUse hooks share the generic `harness policy intercept` CLI\n# entrypoint. The engine reads the tool event on stdin, evaluates whichever\n# policy below has a matching trigger (`match` + optional `bash_match`),\n# and emits Claude Code's deny envelope when the required ledger tag is\n# absent. No external shell scripts are required.\n#\n# The `git-preflight` SessionStart hook is the producer side of the\n# `preflight-before-*` policies: `harness session-start preflight` runs\n# agent-preflight against the session cwd and, on a ready:true result,\n# records `preflight:${REPO}` to the evidence ledger. It needs the\n# `preflight` binary on PATH (`npm i -g @lannguyensi/agent-preflight`); when\n# that is absent the hook logs to stderr and exits 0, so the session is\n# never broken \u2014 the preflight gates just stay closed until a tag is\n# produced some other way.\nhooks:\n - name: git-preflight\n event: SessionStart\n command: harness session-start preflight\n blocking: false\n # 70s budget gives the wrapped preflight (default 60s) headroom plus\n # ledger-write time. Was 30s through v0.17.4, but a healthy preflight\n # on a medium-size repo takes ~28s and the old 25s wrapper ceiling\n # blew through it. Bumped together with DEFAULT_PREFLIGHT_TIMEOUT_MS\n # (agent-tasks/7265599e).\n budget_ms: 70000\n # Floor at agent-preflight 0.2.0, the release that makes secret\n # detection git-aware and diff-scoped: a gitignored+untracked .env,\n # a .md doc, a non-git dir, or a secret in a tracked file the branch\n # never touched is a non-blocking warn, not a hard fail. Pre-0.2.0\n # installs hard-fail preflight on the normal correct state (a\n # gitignored .env holding real credentials), so this SessionStart\n # producer never writes a preflight: tag and the preflight-before-*\n # policies stay closed forever on any repo with a local .env. (0.1.1\n # had already fixed the wrapper-script \"tool not installed\" false\n # positive.) version_command points at the source-of-truth preflight\n # binary, not at the `harness session-start preflight` wrapper.\n min_version: \"0.2.0\"\n version_command: [\"preflight\", \"--version\"]\n\n # toolchain-parity (PATH-shim incident 2026-07-22 follow-up): writes THIS\n # machine's toolchain snapshot (node version, npm globals, OW-Kit\n # version, MCP server names) to `toolchain_parity.machine_state_dir`\n # and advisorily compares it against every peer machine's snapshot\n # already there, warning on drift (version mismatches, missing\n # packages, node/OW-Kit drift, MCP-name differences). Purely advisory \u2014\n # no policy consumes the `toolchain-parity:` ledger fact this writes,\n # it exists for `harness audit`/operator visibility only. If a policy\n # ever does consume it, match with the `:unparseable-peer:<n>` suffix\n # in mind: requires-matching is substring-based, so a bare\n # `toolchain-parity:ok` tag would also match `ok:unparseable-peer:2`\n # (a partial comparison). DISABLED by\n # default (no `toolchain_parity:` block above): opt in with\n # `toolchain_parity: { enabled: true }` (machine_state_dir/profile/\n # workspace_root all have sane defaults \u2014 see docs/CLI.md). No external\n # binary to floor-check (node/npm are assumed present already), so\n # unlike git-preflight this hook carries no min_version/version_command.\n - name: toolchain-parity\n event: SessionStart\n command: harness session-start toolchain-parity\n blocking: false\n # node --version + npm ls -g run in PARALLEL (bounded ~2s/~4s each, so\n # max(2s,4s)=4s worst case for that pair), plus two near-instant file\n # reads; the ledger write runs SEQUENTIALLY after those and carries its\n # own timeout floor (resolveManifestLedgerWriter's default 5s absent an\n # explicit grounding-mcp health.timeout_ms or a bound\n # SessionStartToolchainParityOptions.ledgerTimeoutMs). Worst case is\n # therefore additive, ~4s + 5s = 9s, not the sub-5s the collectors alone\n # would suggest \u2014 10s still clears it, but with only ~1s of margin, not\n # the \"comfortable\" headroom an earlier version of this comment claimed\n # (task c1b5ade5). Nowhere near git-preflight's 70s (which wraps a full\n # external test suite, a fundamentally heavier operation this hook\n # never performs).\n budget_ms: 10000\n\n # Budget note (task 7bf47554, follow-up to the ms/seconds unit fix\n # f2d2a29): every `harness policy intercept` hook below down through\n # `risk-gate` carries `budget_ms: 15000`, i.e. a Claude Code outer\n # kill-timeout of `ceil(15000/1000) = 15` seconds (generate-settings.ts's\n # `hookTimeoutSeconds`). This is deliberately UNIFORM across all eleven of\n # them, for two independent reasons:\n #\n # 1. FAIL-CLOSED MARGIN. `harness policy intercept` evaluates its FULL\n # `policies:` list against the incoming event (src/runtime/intercept.ts,\n # `intercept()`), not just the one named policy this hook happens to\n # also register. Every policy in that evaluation loop that reaches a\n # verdict has its decision written to the evidence ledger via\n # `options.ledger.record()` BEFORE `intercept()` returns and stdout is\n # flushed (intercept.ts ~L1362-1377) \u2014 this includes `operator_only`\n # policies (the three kill-switch denies below), whose VERDICT needs no\n # ledger read but whose AUDIT WRITE is still a live grounding-mcp\n # round-trip on the critical path. A `requires:`-based policy (the\n # require-*-evidence / risk-gate policies) additionally QUERIES the\n # ledger for its verdict (intercept.ts's `evaluateOnePolicy`,\n # ~L752-777) and, on a `deny-degraded` outcome, may retry the audit\n # write once more on a fresh session (`realLedgerClient`,\n # src/cli/policy/intercept.ts ~L276-306). Measured worst case with the\n # grounding-mcp health.timeout_ms=5000 default: query (~5s) + one\n # fresh-session deny-degraded retry (initialize + ledger_add, each\n # bounded by `auditRetryTimeoutMs(5000)` ~=1.25s) is ~10.8-13.75s. If\n # Claude Code's outer timeout fires FIRST, it kills the subprocess\n # before the deny JSON reaches stdout \u2014 a hook that Claude Code cannot\n # read in time is treated as ALLOW, silently turning a computed,\n # fail-closed `deny`/`deny-degraded` verdict into an unintended\n # fail-open one. 15000ms clears the measured worst case with margin,\n # for BOTH the evidence-requiring policies (their own query+retry) AND\n # the pure pattern-deny policies (bounded lower, ~1x\n # health.timeout_ms=~5s via the mandatory record() alone, but still\n # above the pre-fix 1-2s floor).\n # 2. DEDUP-SAFETY. `generate-settings.ts`'s `buildGroups` collapses\n # multiple manifest hooks that share the same `match` (settings.json's\n # tool-name matcher \u2014 `bash_match` is NOT projected there) AND the same\n # `(command, timeout)` fingerprint into ONE settings.json hook entry,\n # specifically so Claude Code spawns `harness policy intercept` ONCE\n # per matching tool call instead of once per manifest hook name (the\n # comment on `buildGroups` names this explicitly: avoiding \"redundant\n # Node bootstraps and ledger queries per tool call\"). All nine\n # `match: \"Bash\"` hooks below share one settings.json matcher group;\n # giving them a NON-uniform budget_ms would make their computed\n # `timeout` values diverge, split that one group into several entries,\n # and reintroduce exactly the redundant-invocation cost the dedup\n # exists to avoid \u2014 on top of leaving whichever entry keeps a low\n # timeout still exposed to the fail-open risk above. Keeping all\n # eleven at the identical 15000ms budget_ms preserves the existing\n # one-invocation-per-matcher-group collapse (previously they all\n # collapsed onto the shared 2s floor; now they collapse onto 15s).\n - name: require-review-evidence\n event: PreToolUse\n match: \"mcp__agent-tasks__pull_requests_merge\"\n command: harness policy intercept\n blocking: hard\n budget_ms: 15000\n\n # Tool-agnostic parallel of require-review-evidence for operators on the\n # gh-cli workflow (`gh pr merge`) instead of agent-tasks MCP. Same generic\n # `harness policy intercept` entrypoint; the matching review-before-merge-bash\n # policy below picks up the trigger. A PolicyTrigger can only AND-match one\n # surface (MCP tool-name OR Bash command), so two parallel definitions are\n # the minimum-scope way to cover both PR surfaces without bumping the schema.\n - name: require-review-evidence-bash\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*gh pr merge\\b'\n command: harness policy intercept\n blocking: hard\n budget_ms: 15000\n\n - name: require-dogfood-evidence\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*(npm publish\\b|git( -C \\S+)* tag v)'\n command: harness policy intercept\n blocking: hard\n budget_ms: 15000\n\n - name: require-preflight-evidence\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*git( -C \\S+)* (status|log|diff|branch)\\b'\n command: harness policy intercept\n blocking: hard\n budget_ms: 15000\n\n - name: require-review-subagent-evidence\n event: PreToolUse\n match: \"mcp__agent-tasks__pull_requests_create\"\n command: harness policy intercept\n blocking: hard\n budget_ms: 15000\n\n # Bash-surface parallel of require-review-subagent-evidence for operators\n # who open PRs with `gh pr create` instead of agent-tasks MCP. The matching\n # review-subagent-before-pr-create-bash policy below tags by branch\n # (`review-subagent:${BRANCH}`) because no task UUID is in `gh pr create`\n # arguments; the working branch is the closest stable handle for \"the\n # PR-in-progress\" at this point in the cycle.\n - name: require-review-subagent-evidence-bash\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*gh pr create\\b'\n command: harness policy intercept\n blocking: hard\n budget_ms: 15000\n\n - name: require-preflight-push-evidence\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*git( -C \\S+)* push\\b'\n command: harness policy intercept\n blocking: hard\n budget_ms: 15000\n\n # deny-kill-switch-bash / deny-session-env-strip-bash / deny-sentinel-write-bash\n # (task cf1fde6d): `harness pause` / `harness resume` refuse to run inside an\n # agent shell in CODE, but that CLI check is a speed bump, not a boundary: a\n # Claude Code `! `-prefixed shell inherits this session's env AND its non-TTY\n # stdin, so it is indistinguishable from an agent Bash call and trips the same\n # check the agent would trip (verified live; see\n # docs/okf/pause-vs-gate-kill-switch.md). The actual enforcement point that\n # runs BEFORE the agent's Bash executes is this PreToolUse deny-policy layer.\n # These three hooks/policies below deny, from Bash: the kill-switch verbs\n # themselves, the env-stripping wrappers that would otherwise defeat\n # `refuseIfAgentShell`, and direct writes to the unsigned pause sentinel file.\n - name: deny-kill-switch-bash\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S*\\s+)*(?:npx\\s+|\\S*/)?harness\\s+([\"\\x27]?)(?:pause|resume|gate\\s+([\"\\x27]?)(?:disable|enable)\\4)\\3(?![\\w-])'\n command: harness policy intercept\n blocking: hard\n # 15000, not a smaller pattern-only budget: see the budget note above\n # require-review-evidence. This policy's own verdict (operator_only)\n # needs no ledger read, but intercept()'s audit-record call for that\n # verdict is still a live grounding-mcp round-trip on the critical\n # path, AND this hook shares its settings.json matcher group with the\n # evidence-requiring Bash hooks above (dedup-safety).\n budget_ms: 15000\n\n - name: deny-session-env-strip-bash\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S*\\s+)*(env\\b[^;\\n|&]*-u\\s*(CLAUDE_CODE_SESSION_ID|CLAUDE_SESSION_ID|CODEX_SESSION_ID)\\b|env\\b[^;\\n|&]*--unset(?:=|\\s+)(CLAUDE_CODE_SESSION_ID|CLAUDE_SESSION_ID|CODEX_SESSION_ID)\\b|unset\\s+(\\S+\\s+)*(CLAUDE_CODE_SESSION_ID|CLAUDE_SESSION_ID|CODEX_SESSION_ID)\\b|(CLAUDE_CODE_SESSION_ID|CLAUDE_SESSION_ID|CODEX_SESSION_ID)=(?=\\s))'\n command: harness policy intercept\n blocking: hard\n # 15000: same rationale as deny-kill-switch-bash immediately above.\n budget_ms: 15000\n\n # Known gap, deliberately not faked as coverage: this only catches the\n # obvious shell shapes (`> .harness-paused`, `tee .harness-paused`,\n # `cp ... .harness-paused`). A regex over the raw command string cannot\n # see through a heredoc, `sh -c '...'`, `bash -lc`, `eval`,\n # `python -c`, base64-decoded payloads, an fs.write call inside a script\n # file the agent creates and then executes, a symlink swap, or the\n # sentinel-write equivalents of `cp`/`>` done via `mv`, `ln`,\n # `install`, or `dd`. These are NOT covered on purpose (regex whack-a-\n # mole against every file-write-capable tool does not meaningfully close\n # this class); closing it for real needs either signing the sentinel\n # (HMAC) or a filesystem-level write guard, neither of which is in scope\n # here; both are noted as follow-ups.\n - name: deny-sentinel-write-bash\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S*\\s+)*(tee|cp)\\b[^;\\n|&]*\\.harness-paused\\b|>{1,2}\\s*\\S*\\.harness-paused\\b'\n command: harness policy intercept\n blocking: hard\n # 15000: same rationale as deny-kill-switch-bash above.\n budget_ms: 15000\n\n # risk-gate (Phase 7 #6): the Risk Gate enforcement hook. The\n # gate-prod-destructive policies below reference it. Same generic\n # `harness policy intercept` entrypoint as every other policy hook;\n # the interceptor builds the Action Envelope, classifies risk against\n # `risk.classifiers[]`, resolves the environment against\n # `environments.resolvers[]`, and evaluates the policies' `when:`.\n - name: risk-gate\n event: PreToolUse\n match: \"Bash\"\n command: harness policy intercept\n blocking: hard\n # 15000: same rationale as the budget note above require-review-evidence.\n budget_ms: 15000\n\n # Optional: runtime-reality drift gate (NOT enabled by default).\n # Blocks destructive runtime commands (compose down/restart, systemctl,\n # kill/pkill, ./deploy-*) when the live process state has drifted from what\n # your expectations file says should be running. Left COMMENTED on purpose:\n # the hook is host-coupled and, without RUNTIME_REALITY_KEYWORD + an\n # expectations file + RUNTIME_REALITY_PROBE_CMD, degrades silently to allow,\n # a no-op that looks like protection. To arm it, uncomment the entry and\n # fill in the three env values. The expectations-file format and how to\n # install the probe are documented in docs/runtime-reality-hook.md.\n #\n # - name: runtime-reality\n # event: PreToolUse\n # command: >-\n # RUNTIME_REALITY_KEYWORD=<your-stack>\n # RUNTIME_REALITY_EXPECTATIONS_DIR=$HOME/.runtime-reality/expectations\n # RUNTIME_REALITY_PROBE_CMD=\"node $HOME/.runtime-reality/probes/runtime-reality-docker-probe.mjs\"\n # harness pack hook runtime-reality\n # blocking: hard\n # description: Block destructive runtime commands on critical process drift\n\npolicies:\n - name: review-before-merge\n description: Block PR merges unless a ledger entry tagged review:<pr-number> exists for this session.\n trigger:\n event: PreToolUse\n match: \"mcp__agent-tasks__pull_requests_merge\"\n extract:\n PR_NUMBER: \"toolArgs.prNumber\"\n requires:\n ledger_tag: \"review:${PR_NUMBER}\"\n hook: require-review-evidence\n enforcement: block\n producers:\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"review:${PR_NUMBER} \u2014 <verdict + key findings + nits>\", source:\"Agent(general-purpose) review\"}'\n description: Spawn a review subagent against the PR diff, capture its verdict, then persist a ledger entry tagged with the PR number. The content should be self-contained enough for an auditor to read without re-opening the chat.\n ux:\n cannot: \"You cannot merge PR #${PR_NUMBER} yet.\"\n required:\n - \"a recorded review of PR #${PR_NUMBER}\"\n run:\n - 'harness record review --pr ${PR_NUMBER} \"<summary>\"'\n\n # Bash-surface parallel of review-before-merge for operators on the gh-cli\n # workflow. Two scope notes:\n # 1. Tag shape: `review:${BRANCH}` instead of `review:${PR_NUMBER}`. The\n # `gh pr merge` invocation can target the PR by number, by URL, or by\n # the current branch (default), and PR_NUMBER is not extractable from\n # `tool_input.command` with today's JSONPath-only extract DSL. BRANCH\n # is the stable identifier the producer can record at review time.\n # 2. This sits ALONGSIDE review-before-merge \u2014 not as a replacement. An\n # operator using both surfaces (e.g. agent-tasks MCP for most repos\n # + gh-cli for a quick hotfix) will have both gates active, each with\n # its own tag shape, which is semantically honest.\n - name: review-before-merge-bash\n description: Block `gh pr merge` unless a ledger entry tagged review:<branch> exists for this session.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*gh pr merge\\b'\n requires:\n ledger_tag: \"review:${BRANCH}\"\n hook: require-review-evidence-bash\n enforcement: block\n producers:\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"review:${BRANCH} \u2014 <verdict + key findings + nits>\", source:\"Agent(general-purpose) review\"}'\n description: Spawn a review subagent against the branch diff, capture its verdict, then persist a ledger entry tagged with the branch name. Mirror of the review-before-merge producer for the gh-cli surface.\n ux:\n cannot: \"You cannot merge the PR for branch ${BRANCH} via `gh pr merge` yet.\"\n required:\n - \"a recorded review of the PR for branch ${BRANCH}\"\n run:\n - 'harness record review --pr <pr> \"<summary>\"'\n\n - name: dogfood-before-release\n description: Block npm publish / git tag v* without a recent dogfood ledger entry.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*(npm publish\\b|git( -C \\S+)* tag v)'\n requires:\n ledger_tag: \"dogfood:${SESSION_ID}\"\n within: 24h\n hook: require-dogfood-evidence\n enforcement: block\n producers:\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"dogfood:${SESSION_ID} \u2014 <end-to-end smoke summary against the live system>\", source:\"manual smoke test\"}'\n description: Before tagging or publishing, run the release path end-to-end against the live system (not just unit tests) and persist the result as a session-tagged ledger entry. Document what you exercised (install, CLI happy path, MCP handshake, etc.) so a future auditor can tell whether the smoke covered the change.\n ux:\n cannot: \"You cannot publish a release yet.\"\n required:\n - \"an end-to-end dogfood run in this session\"\n run:\n - 'harness record dogfood \"<was wurde real ausprobiert>\"'\n\n - name: two-reviewers-required\n description: At least two distinct reviewer ledger entries must exist for the PR.\n trigger:\n event: PreToolUse\n match: \"mcp__agent-tasks__pull_requests_merge\"\n extract:\n PR_NUMBER: \"toolArgs.prNumber\"\n requires:\n ledger_tag: \"review:${PR_NUMBER}\"\n count:\n min: 2\n hook: require-review-evidence\n enforcement: warn\n producers:\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"review:${PR_NUMBER} \u2014 <verdict + key findings + nits>\", source:\"Agent(general-purpose) review (reviewer 2)\"}'\n description: Same shape as review-before-merge but TWO DISTINCT reviewer entries must exist before the gate is satisfied (count.min 2). Distinguish reviewers by source so the count is honest. Warn-level enforcement, so the agent CAN merge with one reviewer but should consider spawning a second for load-bearing changes.\n\n - name: preflight-before-investigation\n description: Block investigative git reads (status/log/diff/branch) when agent-preflight has not run recently with ready:true for the current repo.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*git( -C \\S+)* (status|log|diff|branch)\\b'\n requires:\n ledger_tag: \"preflight:${REPO}\"\n within: 1h\n hook: require-preflight-evidence\n enforcement: block\n producers:\n - kind: bash\n command: harness session-start preflight\n description: Runs agent-preflight against the current cwd; on ready:true, records preflight:${REPO} to the ledger. Standard producer.\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"preflight:${REPO}\", source:\"manual\"}'\n description: Direct ledger write. Use when the Bash hook is locked down (e.g. understanding-gate active) or when the standard producer is unavailable.\n ux:\n cannot: \"You cannot investigate this repository yet.\"\n required:\n - \"verified repository preflight\"\n - \"an approved Understanding Report, if the Understanding Gate is still active (it blocks `harness preflight` itself)\"\n run:\n - \"harness preflight\"\n\n - name: review-subagent-before-pr-create\n description: Block agent-tasks PR creation unless a review-subagent ledger entry tagged for this task already exists. Forces the rigorous review BEFORE the PR opens, not after.\n trigger:\n event: PreToolUse\n match: \"mcp__agent-tasks__pull_requests_create\"\n extract:\n TASK_ID: \"toolArgs.taskId\"\n requires:\n ledger_tag: \"review-subagent:${TASK_ID}\"\n hook: require-review-subagent-evidence\n enforcement: block\n producers:\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"review-subagent:${TASK_ID} \u2014 <verdict + key findings + nits>\", source:\"Agent(general-purpose) review\"}'\n description: After running a review subagent against the staged diff, persist its verdict + load-bearing findings as a ledger entry tagged with the task UUID. The content should be self-contained enough to audit later without re-reading the chat.\n ux:\n cannot: \"You cannot open a pull request for task ${TASK_ID} yet.\"\n required:\n - \"a completed review-subagent pass on this task\"\n run:\n - 'harness record review-subagent --task ${TASK_ID} --verdict <verdict>'\n\n # Bash-surface parallel of review-subagent-before-pr-create. Tag shape is\n # `review-subagent:${BRANCH}` because TASK_ID is an agent-tasks-only\n # concept; for the gh-cli workflow the working branch is the closest stable\n # handle for \"the PR-in-progress\" at this point. Same rationale as\n # review-before-merge-bash: sits alongside the MCP variant, not as a\n # replacement.\n - name: review-subagent-before-pr-create-bash\n description: Block `gh pr create` unless a review-subagent ledger entry tagged review-subagent:<branch> exists for this session. Forces the rigorous review BEFORE the PR opens.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*gh pr create\\b'\n requires:\n ledger_tag: \"review-subagent:${BRANCH}\"\n hook: require-review-subagent-evidence-bash\n enforcement: block\n producers:\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"review-subagent:${BRANCH} \u2014 <verdict + key findings + nits>\", source:\"Agent(general-purpose) review\"}'\n description: After running a review subagent against the staged diff for the working branch, persist its verdict + load-bearing findings as a ledger entry tagged with the branch name. Mirror of the review-subagent-before-pr-create producer for the gh-cli surface.\n ux:\n cannot: \"You cannot open a pull request for branch ${BRANCH} via `gh pr create` yet.\"\n required:\n - \"a completed review-subagent pass on branch ${BRANCH}\"\n run:\n - 'harness record review-subagent --task <task-id> --verdict <verdict>'\n\n - name: preflight-before-push\n description: Block git push unless a fresh preflight ledger entry exists for the current branch. Catches the stale-checkout class of incident at the last reversible step.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S+\\s+)*git( -C \\S+)* push\\b'\n requires:\n ledger_tag: \"preflight:${BRANCH}\"\n within: 10m\n # at_head:true lets a preflight at the current HEAD satisfy the\n # gate at any age (the standard producer writes head:<sha> into\n # the tag content). The 10m window remains the freshness ceiling\n # for the head-mismatch case (operator switched branch, preflight\n # predates HEAD shift, runtime couldn't resolve a sha).\n at_head: true\n hook: require-preflight-push-evidence\n enforcement: block\n producers:\n - kind: bash\n command: harness session-start preflight\n description: Runs agent-preflight against the current cwd; on ready:true, records preflight:${BRANCH} ready:true confidence:<n> head:<sha> to the ledger. Standard producer.\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"preflight:${BRANCH} head:<full-sha> \u2014 <summary of what is on the branch + smoke results>\", source:\"manual\"}'\n description: Direct ledger write. Include head:<full-sha> if you want the entry to count under at_head; the branch is the WIP review surface and the content should summarise what is staged + the smoke evidence so a reviewer can audit later without re-reading the chat.\n ux:\n cannot: \"You cannot push branch ${BRANCH} yet.\"\n required:\n - \"a preflight for ${BRANCH} at the current HEAD (any age) OR any preflight within the last 10 minutes. Re-run `harness preflight` if you committed since the last preflight AND it has been more than 10 minutes.\"\n - \"if solution-acceptance is enabled, a ready HEAD-pinned verdict at the SAME commit too (run `solution_evaluate`). `git push` trips both gates, so commit first if the tree is dirty, then satisfy both at one HEAD.\"\n - \"an approved Understanding Report, if the Understanding Gate is still active (it blocks `harness preflight` itself)\"\n run:\n - \"harness preflight\"\n\n # Phase 7 Risk Gate \u2014 the canonical built-in worked example. These two\n # policies, with the dangerous-shell classifier and production-signals\n # resolver below, are the Risk Gate's default stance: a destructive\n # shell action whose target environment resolves to production is\n # gated before the runtime fires it. Both fire ONLY when the\n # environment resolves to production (a main / release branch, a\n # prod-looking DATABASE_URL, or a prod kube context); on an ordinary\n # feature branch the environment is unknown and neither fires. Ordered\n # deny-first so a critical action (which also matches the high\n # threshold) gets the hard-deny envelope. See docs/risk-gate.md.\n - name: gate-prod-destructive\n description: Deny critical-severity destructive shell actions against a production target.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n when:\n risk.severity_at_least: critical\n environment.name: production\n requires:\n ledger_tag: \"risk-override:${SESSION_ID}\"\n hook: risk-gate\n enforcement: block\n # Operator-in-the-loop gate: the override tag is written by the\n # operator verb (ask semantics), not by the agent. See\n # writing-custom-policies.md, tripwire 4 (the trust model).\n producers:\n - kind: ask\n command: harness approve risk --force <reason>\n description: Deliberate operator override for a critical production mutation; run from the operator shell.\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"risk-override:${SESSION_ID} \u2014 operator-authorized <reason>\", source:\"operator\"}'\n description: Recovery path if the approve verb is unavailable; only meaningful when the OPERATOR authorizes the content.\n ux:\n cannot: \"You cannot run this critical destructive action against production.\"\n required:\n - \"a deliberate operator override: a critical production mutation has no benign reading\"\n run:\n - \"Choose a non-destructive alternative, or ask the OPERATOR to run the command themselves, outside the agent.\"\n - \"Operator override (deliberate): the OPERATOR runs `harness approve risk --force <reason>` from their own shell (`! ` prefix in Claude Code, with --i-am-the-operator to acknowledge a non-TTY invocation).\"\n - name: gate-prod-destructive-approval\n description: Require operator approval for high-severity destructive shell actions against a production target.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n when:\n risk.severity_at_least: high\n environment.name: production\n requires:\n ledger_tag: \"risk-approved:${SESSION_ID}\"\n hook: risk-gate\n enforcement: require_approval\n producers:\n - kind: ask\n command: harness approve risk\n description: Operator approves this Risk Gate decision from their own shell.\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"risk-approved:${SESSION_ID} \u2014 operator-authorized\", source:\"operator\"}'\n description: Recovery path if the approve verb is unavailable; only meaningful when the OPERATOR authorizes the content.\n ux:\n cannot: \"You cannot run this destructive production action yet.\"\n required:\n - \"operator approval of this Risk Gate decision\"\n run:\n - \"harness approve risk\"\n\n # gate-dev-unsafe-deletion (task d03af8f6): the two policies above fire\n # ONLY when the environment resolves to production \u2014 on an ordinary\n # task branch (environment: unknown) a deletion command runs\n # unconfirmed even when its target is a stray variable or a relative\n # path pointing somewhere unintended. This policy is deliberately\n # environment-INDEPENDENT (no environment.name clause) and gates on the\n # new `action.deletion_target_unresolvable` clause instead of\n # `risk.severity_at_least`/`risk.category_in` specifically because\n # those fail-close to matched=true for ANY unclassified action \u2014\n # unscoped, that would gate every unrelated unclassified Bash call in\n # every environment. `action.deletion_target_unresolvable` only fires\n # for a recognized deletion verb (`rm -r*`/`-f*`, `find ... -delete`,\n # `git clean -f*`) whose target(s) cannot be statically proven inside\n # `risk.safe_deletion_roots` (below). See docs/risk-gate.md.\n #\n # This policy consults its OWN ledger tag\n # (`risk-approved:deletion:${SESSION_ID}`), never the tag\n # `gate-prod-destructive-approval` above consults \u2014 a routine dev-\n # context deletion approval must not also clear the production\n # approval gate. `harness approve risk --scope deletion` writes this\n # tag; the bare `harness approve risk` (no `--scope`) keeps writing\n # only the production tag. See CHANGELOG.md task d03af8f6 for the\n # measured incident this fixed.\n - name: gate-dev-unsafe-deletion\n description: Require approval for a deletion-verb command whose target cannot be statically proven safe, in every environment.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n when:\n action.deletion_target_unresolvable: true\n requires:\n ledger_tag: \"risk-approved:deletion:${SESSION_ID}\"\n hook: risk-gate\n enforcement: require_approval\n producers:\n - kind: ask\n command: harness approve risk --scope deletion\n description: Operator approves this Risk Gate decision from their own shell.\n - kind: mcp\n verb: mcp__grounding-mcp__ledger_add\n example: '{sessionId:\"${SESSION_ID}\", type:\"fact\", content:\"risk-approved:deletion:${SESSION_ID} \u2014 operator-authorized\", source:\"operator\"}'\n description: Recovery path if the approve verb is unavailable; only meaningful when the OPERATOR authorizes the content.\n ux:\n cannot: \"You cannot run this deletion command yet \u2014 its target cannot be statically proven safe.\"\n required:\n - \"operator approval of this Risk Gate decision, OR an absolute target inside a declared risk.safe_deletion_roots entry\"\n run:\n - \"harness approve risk --scope deletion\"\n - \"Or point the command at a path under risk.safe_deletion_roots (default: /tmp, /private/tmp) instead of an unresolved variable, relative path, or traversal.\"\n\n # deny-kill-switch-bypass / deny-session-env-strip / deny-pause-sentinel-forgery\n # (task cf1fde6d): `harness pause`/`harness resume` refuse to run inside an\n # agent shell in CODE, but that CLI check (refuseIfAgentShell / refuseIfNonTTY\n # in src/cli/pause/index.ts) is a speed bump, not a boundary: a Claude Code\n # `! `-prefixed shell inherits this session's env AND its non-TTY stdin, so\n # it is indistinguishable from an agent Bash call and trips the same checks\n # (verified live; docs/okf/pause-vs-gate-kill-switch.md). This PreToolUse\n # layer is the enforcement point that actually runs BEFORE the agent's Bash\n # executes.\n #\n # UPDATE (task 2cc73f55, closes the gap the HONESTY NOTE below used to\n # document): these three now declare `operator_only: true` instead of a\n # requires.ledger_tag. Every requires:-based policy in this engine is, by\n # construction, satisfiable by the SAME agent it gates: nothing stops it\n # from calling mcp__grounding-mcp__ledger_add with content matching the\n # tag for its own session before running the denied command, which used to\n # flip deny to allow (src/runtime/intercept.ts, the satisfied-requires\n # branch). `operator_only: true` closes that specific hole: the policy\n # declares NO requires: at all, and intercept() short-circuits to an\n # unconditional deny before the requires pipeline runs \u2014 no ledger query,\n # no template substitution, so no ledger write, marker file, or flag can\n # ever flip it to allow. See docs/writing-custom-policies.md tripwire 4 and\n # the \"Operator-only unconditional deny\" section for the schema contract,\n # and tests/cli/init-full-template-kill-switch-deny.test.ts for a test that\n # forges every ledger-evidence shape available to intercept() and asserts\n # the block holds.\n #\n # RESIDUAL GAP (still open, out of scope for task 2cc73f55): bash_match is\n # still a regex over the raw command string, matched BEFORE evaluation ever\n # reaches operator_only:, so it still cannot see through a heredoc,\n # `sh -c '...'`, `eval`, a base64-decoded payload, or a script file the\n # agent writes and then executes \u2014 an agent that defeats the TRIGGER match\n # never reaches this deny at all. That is a bash_match coverage gap, not a\n # requires-satisfaction gap, and is unrelated to the fix here (see PR #341\n # for the known uncoverable shapes). `harness validate` no longer warns\n # \"declares no producers\" on these three (checkPolicySelfAttestation now\n # recognises operator_only: true as correct-by-construction).\n #\n # UPDATE (task 432db3d3, 2026-07-28, follow-up to ea8becf5): PARTIALLY\n # closed \u2014 for THIS policy only. `src/runtime/command-normalize.ts` now\n # peels wrapper prefixes (`env`, `nice`, `command`, `sudo`, `doas`,\n # `time`, `timeout`, `stdbuf`, `setsid`, `exec`, `nohup`, leading\n # VAR=value) and\n # collapses whitespace runs for the closed head-token set\n # `git`/`gh`/`npm`/`harness`, so `env harness pause`, `nice harness\n # gate disable` and the like now reach this deny via the raw-OR-normalised\n # match \u2014 measured 2026-07-28 against the real trigger regex through the\n # real hook entry point, pinned in tests/runtime/intercept-cli.test.ts.\n # The OTHER TWO kill switches are NOT covered by that closed set:\n # deny-session-env-strip keys on `env`/`unset` head tokens, and `env`\n # is STRUCTURALLY unreachable for the normaliser (its peeling loop\n # consumes `env -u <VAR>` while hunting for a gated command behind it,\n # erasing the very text this trigger keys on); deny-pause-sentinel-forgery\n # keys on `tee`/`cp`. Both remain wrapper-bypassable (`nice env -u\n # CLAUDE_CODE_SESSION_ID ...`, `nice tee <sentinel>`), measured\n # 2026-07-28 and pinned as explicit not-covered tests plus a head-token\n # drift guard (tests/runtime/bash-match-head-token-drift.test.ts) that\n # goes red when a future bash_match policy gates a new head token.\n - name: deny-kill-switch-bypass\n description: Deny harness pause, harness resume, harness gate disable, and harness gate enable from the agent's Bash tool. These are operator-only kill switches.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S*\\s+)*(?:npx\\s+|\\S*/)?harness\\s+([\"\\x27]?)(?:pause|resume|gate\\s+([\"\\x27]?)(?:disable|enable)\\4)\\3(?![\\w-])'\n operator_only: true\n hook: deny-kill-switch-bash\n enforcement: block\n ux:\n cannot: \"You cannot run `harness pause`, `harness resume`, `harness gate disable`, or `harness gate enable`.\"\n required:\n - \"the OPERATOR to run this from a terminal genuinely outside your agent session, not a `! `-prefixed Claude Code shell, which inherits this session's env and stdin and does not count\"\n run:\n - \"Stop. Explain to the operator what you were trying to do and why, and let THEM decide whether to run that command from their own terminal. This is the only way to unblock this gate: it is an unconditional deny (operator_only: true) that no in-session evidence \u2014 a ledger write, a marker file, a flag \u2014 can ever satisfy; the only remaining gap is bash_match's regex coverage of exotic shell shapes, not this evaluation (see docs/okf/pause-vs-gate-kill-switch.md).\"\n\n - name: deny-session-env-strip\n description: Deny Bash attempts to strip or unset the agent-session env vars that harness pause/resume check ($CLAUDE_CODE_SESSION_ID, $CLAUDE_SESSION_ID, $CODEX_SESSION_ID). Closes the one-liner that otherwise defeats refuseIfAgentShell.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S*\\s+)*(env\\b[^;\\n|&]*-u\\s*(CLAUDE_CODE_SESSION_ID|CLAUDE_SESSION_ID|CODEX_SESSION_ID)\\b|env\\b[^;\\n|&]*--unset(?:=|\\s+)(CLAUDE_CODE_SESSION_ID|CLAUDE_SESSION_ID|CODEX_SESSION_ID)\\b|unset\\s+(\\S+\\s+)*(CLAUDE_CODE_SESSION_ID|CLAUDE_SESSION_ID|CODEX_SESSION_ID)\\b|(CLAUDE_CODE_SESSION_ID|CLAUDE_SESSION_ID|CODEX_SESSION_ID)=(?=\\s))'\n operator_only: true\n hook: deny-session-env-strip-bash\n enforcement: block\n ux:\n cannot: \"You cannot strip or unset your own agent-session id env vars from Bash.\"\n required:\n - \"no legitimate reason from inside this session: stripping $CLAUDE_CODE_SESSION_ID / $CLAUDE_SESSION_ID / $CODEX_SESSION_ID is recognised as an attempt to defeat the harness pause/resume agent-shell check\"\n run:\n - \"Stop. If you believe you have a legitimate reason to run a command without one of these env vars set, ask the OPERATOR to do it from their own terminal instead. This gate is an unconditional deny (operator_only: true); see docs/okf/pause-vs-gate-kill-switch.md for the honest trust model and the residual bash_match coverage gap.\"\n\n - name: deny-pause-sentinel-forgery\n description: Deny Bash writes (redirect, tee, cp) to the harness pause sentinel file (.harness-paused). The sentinel is unsigned JSON; a forged file silences every gate exactly like a real operator pause. Reads (cat, stat) are unaffected.\n trigger:\n event: PreToolUse\n match: \"Bash\"\n bash_match: '(^|\\n|;|\\||&|\\()\\s*(\\w+=\\S*\\s+)*(tee|cp)\\b[^;\\n|&]*\\.harness-paused\\b|>{1,2}\\s*\\S*\\.harness-paused\\b'\n operator_only: true\n hook: deny-sentinel-write-bash\n enforcement: block\n ux:\n cannot: \"You cannot write to the harness pause sentinel file (.harness-paused).\"\n required:\n - \"the OPERATOR to run `harness pause`/`harness resume` themselves, from a terminal outside your agent session, never a direct write to the sentinel file\"\n run:\n - \"Stop. Do not write, redirect, tee, or copy anything to .harness-paused. Ask the OPERATOR to silence the gates themselves, from their own terminal, using the operator-only command named under Required, if the session genuinely needs it. This gate is an unconditional deny (operator_only: true); see docs/okf/pause-vs-gate-kill-switch.md for the honest trust model and the residual bash_match coverage gap.\"\n\n# Full inherits the Solo/Team understanding-gate stack: the Stop hook\n# persists each Understanding Report and the PreToolUse pre-tool-use\n# blocker refuses Edit/Write/Bash until the report is approved. Drop\n# this block if you want the reference policies above without the\n# baseline gate.\npolicy_packs:\n - name: understanding-before-execution\n source: builtin\n enabled: true\n description: Force agents to expose their task interpretation and wait for explicit human approval before any write-capable tool fires.\n config:\n mode: grill_me\n # Producers (agent-tasks/25bced52): rendered into the gate's deny\n # envelope by the same engine as policy producers. Constraint at\n # this layer: at-least-one `ask`. Post-v0.14.0 the gate signal\n # is a filesystem marker and the mcp ledger_add path no longer\n # satisfies the gate; the canonical unblock surface is the\n # operator-approval prompt.\n #\n # KEEP IN SYNC (task 68b9ad9c): this text must match\n # defaultProducers() in\n # src/policy-packs/builtin/understanding-before-execution.ts \u2014\n # that function is what `harness pack reseed` and `harness doctor`'s\n # divergence warning treat as \"the shipped template\". A wording fix\n # landed here without updating defaultProducers() would make reseed\n # silently pull operators BACK to the stale wording. Pinned by\n # tests/cli/init-templates-ux-parity.test.ts.\n producers:\n - kind: ask\n command: harness approve understanding\n description: \"Bare command, no pipes or chaining. The hook recognises it via isEscapeCommand and emits permissionDecision:ask; the operator's go on that prompt IS the gate approval. Golden path.\"\n - kind: bash\n command: harness approve understanding\n description: Same command from any un-hooked terminal (operator only, not reachable from inside the gated session). Writes the canonical marker at harness.generated/.approvals/${SESSION_ID}.\n # ux (agent-tasks/e48e3b45): replaces the legacy engine-vocabulary\n # deny envelope with the plain-language { cannot, required, run }\n # shape. Engine details (the BLOCK reason naming session id /\n # marker / report state) still land in stderr for operator audit;\n # the agent only sees this.\n #\n # KEEP IN SYNC (task 68b9ad9c): see the producers: comment above \u2014\n # same rationale applies here, against defaultUx(\"grill_me\") in the\n # same builtin module.\n ux:\n cannot: \"You cannot use write-capable tools yet.\"\n required:\n - \"an approved Understanding Report for this session\"\n run:\n - \"Write an Understanding Report covering: Current Understanding, Intended Outcome, Derived Todos, Acceptance Criteria, Assumptions, Open Questions, Out Of Scope, Risks, Verification Plan, Prior Art (state what you searched for an existing solution and what you found, with an explicit adopt-or-build judgment)\"\n - \"Run `harness approve understanding` with the report attached as a quoted heredoc (harness approve understanding <<'UNDERSTANDING_REPORT' ...report... UNDERSTANDING_REPORT) so it is persisted for audit, then approve the prompt; the heredoc is the only extra shell shape the gate allows (no pipes, chaining, or other redirection)\"\n # approval_lifecycle (agent-tasks/d8ee60ca + harness/f54e0ecb,\n # v0.18.0+): expire the approval marker on task-completion\n # boundaries so a multi-task session re-prompts for an\n # Understanding Report between tasks. Without this the legacy\n # \"one approval per session\" contract lets a stale interpretation\n # drive the next task's edits.\n #\n # Full ships both boundary kinds: the agent-tasks MCP verbs for\n # operators on that workflow, plus a Bash regex list for hybrid\n # operators who also use gh-cli for PR mechanics. `max_age` is\n # the safety net. Operators who prefer the legacy per-session\n # behaviour opt out with `approval_lifecycle: { mode: session }`.\n # Operators on other task systems override the matchers.\n approval_lifecycle:\n expire_on_tool_match:\n - mcp__agent-tasks__task_finish\n - mcp__agent-tasks__task_abandon\n - mcp__agent-tasks__pull_requests_merge\n - mcp__agent-tasks__tasks_transition\n expire_on_bash_match:\n - '^gh pr (merge|close)\\b'\n - '^git push origin (master|main)\\b'\n max_age: 4h\n\n # branch-protection (agent-tasks/2fdc5bbe, default-enabled since v0.17.2):\n # blocks Write/Edit (claude-code) or apply_patch (codex) on protected\n # branches (default: master, main, develop). Complements\n # preflight-before-push, which fires at the LAST reversible step;\n # branch-protection fires at the FIRST source mutation, catching the\n # \"forgot to branch off master\" pattern earlier in the cycle.\n #\n # Two satisfying signals: a fresh `branch:non-protected:<branch>` tag\n # from the SessionStart producer (`harness session-start branch-check`),\n # or the operator-only override marker written by\n # `harness approve branch-protection --session <id>` for deliberate\n # protected-branch edits (version bumps, CI workflow patches, hotfixes).\n # A branch-protection-ack ledger tag is no longer a sufficient override\n # on its own (it is agent-writable); the marker file is the trusted signal.\n #\n # Fails closed (any load / parse / ledger error refuses). Disable by\n # setting `enabled: false` or removing this entry if your workflow\n # routinely edits master directly. Override the protected list via\n # `config.protected_branches`. Full reference:\n # docs/policy-packs/branch-protection.md.\n - name: branch-protection\n source: builtin\n enabled: true\n description: Block Write/Edit on protected branches (master, main, develop) at the first source mutation.\n config:\n # ux (agent-tasks/9806d4f8): replaces the legacy\n # \"branch-protection: refusing ...\" envelope with the\n # plain-language { cannot, required, run } shape. Engine details\n # (the BLOCK reason naming session id / freshness window) stay\n # on stderr for operator audit.\n #\n # KEEP IN SYNC (task 68b9ad9c): this text must match defaultUx() in\n # src/policy-packs/builtin/branch-protection.ts \u2014 see the identical\n # note on the understanding-before-execution pack above for why.\n # Pinned by tests/cli/init-templates-ux-parity.test.ts.\n ux:\n cannot: \"You cannot edit files on protected branch ${BRANCH} yet.\"\n required:\n - \"a checkout of a non-protected branch (current `${BRANCH}` is protected)\"\n run:\n - \"git checkout -b feat/<your-task>\"\n - \"harness session-start branch-check\"\n\n # solution-acceptance (harness cc43c7a4): Verifier-gated Done. Gates the\n # task-finishing tools (agent-tasks completion verbs + git push / gh pr\n # merge) on a ready, HEAD-pinned verdict that the grounding-mcp producer\n # (solution_evaluate) derives from a real preflight run, plus an\n # anti-forgery write-guard on the verdict marker. DISABLED by default: it\n # is a hard completion-gate and needs grounding-mcp (>= 0.3.2) under\n # tools.mcp plus the preflight binary on PATH. Flip enabled: true once the\n # producer is wired and you want completion earned, not claimed. The pack\n # emits its own instructions.md on apply; harness validate warns if you\n # enable it without the producer.\n - name: solution-acceptance\n source: builtin\n enabled: false\n description: Gate task completion on a ready, HEAD-pinned solution-acceptance verdict earned from a real preflight run.\n\n # post-merge-gate (harness T-001, post-merge-gate): catches \"kept working\n # on a branch after it was already merged\" \u2014 a PostToolUse producer\n # records a merged-tip fact on a successful `gh pr merge`; a PreToolUse\n # blocker denies curated history-mutating commands (git commit/add/push/\n # merge/rebase/cherry-pick/revert/reset/stash pop|apply, gh pr create/\n # merge) while the current branch tip still exactly matches that\n # recorded tip. The recovery vocabulary (git switch/checkout/pull/fetch,\n # git branch -d/-D, git stash list/show, any `harness ...` command)\n # always passes as its OWN command, classified before any manifest or\n # ledger access \u2014 the recovery path this gate itself recommends can never\n # be starved. Chaining one of those with a curated mutation does NOT\n # exempt the mutation (task 19356be7).\n # Fails OPEN (unlike branch-protection) when the ledger is unreachable.\n # DISABLED by default: a fresh gate, opt in once you've reviewed the\n # curated command list for your workflow. Full reference:\n # docs/policy-packs/post-merge-gate.md.\n - name: post-merge-gate\n source: builtin\n enabled: false\n description: Deny curated history-mutating git/gh commands on a branch whose current tip was already merged.\n config:\n # ux: replaces the legacy \"post-merge-gate: refusing ...\" envelope\n # with the plain-language { cannot, required, run } shape.\n #\n # KEEP IN SYNC: this text must match defaultUx() in\n # src/policy-packs/builtin/post-merge-gate.ts \u2014 see the identical\n # note on the branch-protection pack above for why. Pinned by\n # tests/cli/init-templates-ux-parity.test.ts.\n ux:\n cannot: \"You cannot run ${TOOL_NAME} on branch ${BRANCH} yet \u2014 its current tip was already merged.\"\n required:\n - \"a branch tip that is not sitting at an already-merged commit (switch off `${BRANCH}`, or move its tip with a new commit)\"\n run:\n - \"git switch ${DEFAULT_BRANCH}\"\n - \"git pull --ff-only\"\n - \"git branch -d ${BRANCH} # optional cleanup\"\n\n# Phase 7 Risk Gate vocabulary. The dangerous-shell classifier and\n# production-signals resolver feed the gate-prod-destructive policies\n# above: `harness policy intercept` builds the Action Envelope,\n# classifies the action against `risk.classifiers[]`, resolves the\n# target environment against `environments.resolvers[]`, and evaluates\n# each policy's `when:` clauses against the result. Full design and the\n# decision model: docs/risk-gate.md.\nrisk:\n # Fail posture when a policy's evidence cannot be READ (ledger timeout,\n # spawn failure, unresolved template): with `preserve_enforcement`\n # (the default) block/require_approval policies fail CLOSED\n # (`deny-degraded`) while warn policies stay non-blocking. Set\n # `fail_open` to restore the pre-0.45 availability-first behaviour\n # where EVERY degraded evaluation was a non-blocking `warn-degraded`.\n # Kept COMMENTED OUT on purpose: the schema is strict, so a manifest\n # carrying this key fails to parse on a pre-0.45 binary, and a manifest\n # load failure is ALLOW at the hook layer \u2014 on a mixed-version fleet an\n # emitted default would turn a downgrade into a silent full fail-open\n # (review 2026-08-08). See docs/okf/gate-fail-posture-matrix.md.\n # degraded_fail_posture: preserve_enforcement\n # Safe-deletion-root allowlist for gate-dev-unsafe-deletion's\n # `action.deletion_target_unresolvable` clause (task d03af8f6): an\n # absolute deletion target inside one of these roots is allowed; a\n # relative path, an unexpanded $VAR/~, or a traversal that normalizes\n # outside every root is gated. Shown explicitly even though it matches\n # the schema default (`/tmp`, `/private/tmp` \u2014 the two spellings this\n # harness's own scratchpad convention can use, macOS symlinks /tmp to\n # /private/tmp) so an operator sees the live config surface here rather\n # than having to know the schema default exists. An override REPLACES\n # this list, it does not merge with it. See docs/risk-gate.md.\n safe_deletion_roots:\n - /tmp\n - /private/tmp\n classifiers:\n - name: dangerous-shell\n tool: Bash\n patterns:\n - pattern: 'rm\\s+-rf\\s+(/|/var|/data|/mnt|~)'\n categories: [destructive, data_loss]\n severity: critical\n - pattern: 'DROP\\s+TABLE|TRUNCATE\\s+TABLE|DELETE\\s+FROM'\n categories: [destructive, data_loss]\n severity: high\n # Token-based, flag-tolerant: a flag between `kubectl` and\n # `delete` (e.g. `kubectl --context=x delete namespace payments`)\n # must not defeat the match, without matching `kubectl\n # get`/`describe` and without exponential-backtracking on a long\n # flag run. `(?:\\s+-\\S+(?:\\s+(?!delete\\b)(?!-)\\S+)?)*` consumes\n # zero or more `-`/`--` flag tokens (each optionally taking one\n # following, non-flag, non-\"delete\" value token), linear in\n # command length. See docs/risk-gate.md for the full rationale\n # and the earlier quadratic-alternation form this replaced.\n - pattern: 'kubectl(?:\\s+-\\S+(?:\\s+(?!delete\\b)(?!-)\\S+)?)*\\s+delete\\s+(namespace|deployment|statefulset|pvc)'\n categories: [destructive, infrastructure_change]\n severity: high\n # Same flag-tolerance treatment for terraform's own `-chdir=DIR`\n # global flag, which sits between the tool name and the\n # subcommand (`terraform -chdir=infra destroy`).\n - pattern: 'terraform(?:\\s+-\\S+(?:\\s+(?!destroy\\b)(?!-)\\S+)?)*\\s+destroy'\n categories: [destructive, infrastructure_change]\n severity: critical\n\nenvironments:\n resolvers:\n - name: production-signals\n environment: production\n signals:\n branch_patterns: [main, \"release/*\"]\n env_var_patterns:\n - var: DATABASE_URL\n patterns: [prod, production]\n kube_context_patterns: [\".*prod.*\"]\n kube_namespace_patterns: [prod, production]\n";
2
+ export declare const FULL_TEMPLATE: string;
3
3
  export type TemplateName = "minimal" | "full" | "solo" | "team";
4
4
  export declare function getTemplate(name: TemplateName): string;
5
5
  export declare function shippedOperatorOnlyPolicyNames(): readonly string[];
@@ -1,3 +1,13 @@
1
+ // D-004 (task 8f637efd, docs/decisions/2026-08-27-ug-auto-mode-approval.md,
2
+ // "Amendment: install default"): the shipped `auto_approve` block, read
3
+ // from the one canonical renderer so `harness init`, `harness pack
4
+ // upgrade understanding-before-execution`, and `harness doctor`'s
5
+ // missing-auto_approve finding cannot drift on the snippet's shape or
6
+ // wording. See auto-approve-default.ts for the rationale.
7
+ import { renderAutoApproveSnippet } from "../../policy-packs/builtin/understanding-before-execution-runtime.js";
8
+ // Every template below nests `auto_approve:` at 6 spaces, a sibling of
9
+ // `mode:` / `approval_lifecycle:` under the pack's `config:` key.
10
+ const AUTO_APPROVE_SNIPPET = renderAutoApproveSnippet(6);
1
11
  export const MINIMAL_TEMPLATE = `# ~/.harness/harness.yaml (legacy: ~/.claude/harness.yaml)
2
12
  #
3
13
  # Bootstrapped by \`harness init --template minimal\`.
@@ -912,6 +922,7 @@ policy_packs:
912
922
  - '^gh pr (merge|close)\\b'
913
923
  - '^git push origin (master|main)\\b'
914
924
  max_age: 4h
925
+ ${AUTO_APPROVE_SNIPPET}
915
926
 
916
927
  # branch-protection (agent-tasks/2fdc5bbe, default-enabled since v0.17.2):
917
928
  # blocks Write/Edit (claude-code) or apply_patch (codex) on protected
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/cli/init/templates.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqB/B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;GAYG;AACH,IAAI,+BAA8E,CAAC;AACnF,MAAM,UAAU,0BAA0B;IACxC,IAAI,+BAA+B,KAAK,SAAS,EAAE,CAAC;QAClD,MAAM,QAAQ,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;QACzD,MAAM,OAAO,GAA6B,EAAE,CAAC;QAC7C,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,UAAU;gBAAE,SAAS;YAC/B,MAAM,QAAQ,GAAG,wBAAwB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3D,IAAI,QAAQ,KAAK,SAAS;gBAAE,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACzF,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;YAC5C,IAAI,CAAC,SAAS;gBAAE,SAAS;YACzB,MAAM,QAAQ,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC;YACrD,IAAI,QAAQ,KAAK,SAAS;gBAAE,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,+BAA+B,GAAG,OAAO,CAAC;IAC5C,CAAC;IACD,OAAO,+BAA+B,CAAC;AACzC,CAAC"}
@@ -41,7 +41,7 @@ import * as path from "node:path";
41
41
  import { readRegularFileRejectingSymlink } from "../../io/read-regular-file.js";
42
42
  import { queryLedgerByTag, } from "../../policies/index.js";
43
43
  import { renderProducers } from "../../policies/producers.js";
44
- import { CLAUDE_CODE_HARNESS, checkOperatorApprovalMarkers, checkPersistedReport, defaultReportsDir, delegationMarkerPathFor, harnessAllowed, listPersistedReports, matchLedgerEntries, parseAutoApprove, readActiveClaim, selectNewestStrictSessionReport, verifyDelegation, } from "../../policy-packs/builtin/understanding-before-execution-runtime.js";
44
+ import { ADOPTION_LEDGER_DIRNAME, CLAUDE_CODE_HARNESS, checkOperatorApprovalMarkers, checkPersistedReport, defaultReportsDir, delegationMarkerPathFor, harnessAllowed, listPersistedReports, matchLedgerEntries, parseAutoApprove, readActiveClaim, recordPermissionModeObservation, selectNewestStrictSessionReport, verifyDelegation, } from "../../policy-packs/builtin/understanding-before-execution-runtime.js";
45
45
  import { resolveMode, toPackageMode, } from "../../policy-packs/builtin/understanding-before-execution.js";
46
46
  import { signingKeyExists } from "../../runtime/approval-signing.js";
47
47
  import { findLatestParseError, renderMalformedSectionsNotice } from "../approve/understanding.js";
@@ -76,26 +76,14 @@ export const DELEGATION_REPORT_RETRY_INSTRUCTION = "Emit or re-emit your Underst
76
76
  function findGroundingMcp(manifest) {
77
77
  return manifest.tools.mcp.find((m) => m.name === "grounding-mcp") ?? null;
78
78
  }
79
- /**
80
- * Directory holding the per-child ADOPTED-ENTRY ledgers, a SIBLING of
81
- * `.delegations/` itself rather than a subdirectory of it:
82
- * `<generatedDir>/.delegation-adoptions/<sid>`.
83
- *
84
- * Never inside `.delegations/`, and never in `.approvals/`: these files
85
- * record what was SPENT, they are not approvals and must never land where
86
- * a marker scan or the doctor's `approvedBy` listing would read them as
87
- * one. Kept OUT of `.delegations/` for two reasons: `harness doctor`'s
88
- * delegations metric counts every regular file directly under
89
- * `.delegations/` (a ledger file nested in there, flat or not, would be
90
- * reported as an extra, unreadable delegation), and no reserved
91
- * subdirectory NAME sits under `.delegations/` for a child session id to
92
- * collide with, since the ledger lives at its own sibling path instead of
93
- * inside `.delegations/` at all.
94
- *
95
- * One id per line. Ids come from the scan (`entryId`), which guarantees
96
- * they carry no line break.
97
- */
98
- const ADOPTION_LEDGER_DIRNAME = ".delegation-adoptions";
79
+ // `ADOPTION_LEDGER_DIRNAME` (the once-per-session ADOPTED-ENTRY ledger
80
+ // dirname, `.delegation-adoptions/`, a SIBLING of `.delegations/`, never
81
+ // inside it or `.approvals/`) now lives in delegation-markers.ts, next to
82
+ // `DELEGATION_MARKER_DIRNAME`: `harness gc`'s delegation sweep
83
+ // (task 3ece079d) needs the same constant to find orphaned ledgers, and a
84
+ // reader that never writes one has no business importing this CLI verb
85
+ // module for it. One id per line; ids come from the scan (`entryId`),
86
+ // which guarantees they carry no line break.
99
87
  function adoptedEntriesPathFor(generatedDir, childSessionId) {
100
88
  return path.join(generatedDir, ADOPTION_LEDGER_DIRNAME, childSessionId);
101
89
  }
@@ -871,6 +859,17 @@ export async function runPackHookPreToolUseCli(opts = {}) {
871
859
  }
872
860
  }
873
861
  }
862
+ // Task 8f637efd: best-effort observation of this call's
863
+ // `permission_mode`, independent of whether `auto_approve` is even
864
+ // configured: this call site is deliberately the SAME one
865
+ // `attemptAutoApproval` runs at just below (see
866
+ // permission-mode-observations.ts's module header for why every call
867
+ // that reaches this point already needed approval, and for the
868
+ // coverage gap this accepts). Feeds `harness doctor`'s
869
+ // missing-`auto_approve` finding; never a gate input.
870
+ if (generatedDir !== undefined) {
871
+ recordPermissionModeObservation(generatedDir, sessionId, event.permission_mode, stderr);
872
+ }
874
873
  const resolveAutoLedger = () => {
875
874
  if (opts.writeLedger)
876
875
  return { write: opts.writeLedger };
@@ -1 +1 @@
1
- {"version":3,"file":"hook-pre-tool-use.js","sourceRoot":"","sources":["../../../src/cli/pack/hook-pre-tool-use.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,yDAAyD;AACzD,wEAAwE;AACxE,yEAAyE;AACzE,yEAAyE;AACzE,8DAA8D;AAC9D,sEAAsE;AACtE,EAAE;AACF,kEAAkE;AAClE,sEAAsE;AACtE,mEAAmE;AACnE,qEAAqE;AACrE,oEAAoE;AACpE,2EAA2E;AAC3E,EAAE;AACF,iEAAiE;AACjE,wE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AC"}
1
+ {"version":3,"file":"hook-pre-tool-use.js","sourceRoot":"","sources":["../../../src/cli/pack/hook-pre-tool-use.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,yDAAyD;AACzD,wEAAwE;AACxE,yEAAyE;AACzE,yEAAyE;AACzE,8DAA8D;AAC9D,sEAAsE;AACtE,EAAE;AACF,kEAAkE;AAClE,sEAAsE;AACtE,mEAAmE;AACnE,qEAAqE;AACrE,oEAAoE;AACpE,2EAA2E;AAC3E,EAAE;AACF,iEAAiE;AACjE,wEAAwE;AACxE,qEAAqE;AACrE,oEAAoE;AACpE,qEAAqE;AACrE,iEAAiE;AACjE,EAAE;AACF,yEAAyE;AACzE,yEAAyE;AACzE,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,wCAAwC;AACxC,yEAAyE;AACzE,qEAAqE;AACrE,2EAA2E;AAC3E,uEAAuE;AACvE,2CAA2C;AAC3C,uEAAuE;AACvE,yEAAyE;AACzE,0EAA0E;AAC1E,uEAAuE;AAEvE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EACL,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,+BAA+B,EAC/B,+BAA+B,EAC/B,gBAAgB,GAEjB,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EACL,WAAW,EACX,aAAa,GACd,MAAM,8DAA8D,CAAC;AACtE,OAAO,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E,gEAAgE;IAChE,+DAA+D;IAC/D,mEAAmE;IACnE,uCAAuC;IACvC,MAAM,gBAAgB,GACpB,MAAM,CAAC,MAAM,KAAK,IAAI;QACpB,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,EAAE,SAAS,CAAC;QACtF,CAAC,CAAC,IAAI,CAAC;IACX,MAAM,CAAC,KAAK,CACV,GAAG,SAAS,CACV,QAAQ,EACR,mDAAmD,EACnD,eAAe,EACf,QAAQ,EACR,SAAS,EACT,UAAU,EACV,gBAAgB,EAAE,iBAAiB,EACnC,kBAAkB,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,IAAI,CAChE,IAAI,CACN,CAAC;IACF,OAAO;QACL,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;QAClE,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -2,4 +2,5 @@ export { packAdd, type PackAddOptions, type PackAddResult } from "./add.js";
2
2
  export { packRemove, type PackRemoveOptions, type PackRemoveResult } from "./remove.js";
3
3
  export { packList, type PackListOptions, type PackListResult } from "./list.js";
4
4
  export { packReseed, type PackReseedField, type PackReseedOptions, type PackReseedResult, } from "./reseed.js";
5
+ export { packUpgrade, applyAutoApproveUpgrade, type PackUpgradeName, type PackUpgradeOptions, type PackUpgradeResult, type ApplyAutoApproveUpgradeResult, } from "./upgrade.js";
5
6
  export { applyPackAdd, applyPackRemove, applyPackReseedUx, planPackRemove, type PackAddEntry, type PackReseedFields, type PackRemovePlan, } from "./mutate.js";
@@ -2,5 +2,6 @@ export { packAdd } from "./add.js";
2
2
  export { packRemove } from "./remove.js";
3
3
  export { packList } from "./list.js";
4
4
  export { packReseed, } from "./reseed.js";
5
+ export { packUpgrade, applyAutoApproveUpgrade, } from "./upgrade.js";
5
6
  export { applyPackAdd, applyPackRemove, applyPackReseedUx, planPackRemove, } from "./mutate.js";
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/pack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA2C,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAiD,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,QAAQ,EAA6C,MAAM,WAAW,CAAC;AAChF,OAAO,EACL,UAAU,GAIX,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,cAAc,GAIf,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/pack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA2C,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAiD,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,QAAQ,EAA6C,MAAM,WAAW,CAAC;AAChF,OAAO,EACL,UAAU,GAIX,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,uBAAuB,GAKxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,cAAc,GAIf,MAAM,aAAa,CAAC"}
@@ -0,0 +1,32 @@
1
+ /** Pack names this verb knows how to upgrade. Grows as more upgrades ship. */
2
+ export type PackUpgradeName = "understanding-before-execution";
3
+ export interface PackUpgradeOptions {
4
+ configPath?: string;
5
+ homeDir?: string;
6
+ dryRun?: boolean;
7
+ }
8
+ export interface PackUpgradeResult {
9
+ path: string;
10
+ name: string;
11
+ diff: string;
12
+ /** True when the manifest was actually written. */
13
+ applied: boolean;
14
+ /** True when the block was already present: a byte-identical no-op. */
15
+ alreadyPresent: boolean;
16
+ }
17
+ export type ApplyAutoApproveUpgradeResult = {
18
+ ok: true;
19
+ text: string;
20
+ changed: boolean;
21
+ } | {
22
+ ok: false;
23
+ error: string;
24
+ };
25
+ export declare function applyAutoApproveUpgrade(original: string): ApplyAutoApproveUpgradeResult;
26
+ /**
27
+ * `harness pack upgrade <name>` implementation. `name` is validated
28
+ * against the (currently one-entry) set of known upgrades before any
29
+ * file I/O; an unknown name refuses with `EX_FAIL` rather than silently
30
+ * doing nothing.
31
+ */
32
+ export declare function packUpgrade(name: string, opts?: PackUpgradeOptions): Promise<PackUpgradeResult>;