@lannguyensi/harness 0.39.0 → 0.40.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.
@@ -1,4 +1,4 @@
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 - 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: 2000\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: 2000\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: 2000\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: 1000\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: 2000\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: 2000\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: 1000\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 budget_ms: 2000\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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"review:${PR_NUMBER} \u2014 <verdict + key findings + nits>\" }'\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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"review:${BRANCH} \u2014 <verdict + key findings + nits>\" }'\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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"dogfood:${SESSION_ID} \u2014 <end-to-end smoke summary>\" }'\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__agent-grounding__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__agent-grounding__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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"review-subagent:${TASK_ID} \u2014 <verdict + key findings + nits>\" }'\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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"review-subagent:${BRANCH} \u2014 <verdict + key findings + nits>\" }'\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__agent-grounding__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__agent-grounding__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 run the command yourself outside the agent.\"\n - \"Operator override (deliberate): run `harness approve risk --force <reason>` from your own shell (`! ` prefix in Claude Code, with --i-am-the-operator to acknowledge a non-TTY invocation).\"\n - \"Session-wide kill switch: run `harness pause --for <duration>` instead (every gate silences until the sentinel expires or `harness resume` runs).\"\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__agent-grounding__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# 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 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 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` (bare, no pipes, chaining, or redirection) and approve the prompt\"\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 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# 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 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 - pattern: 'kubectl\\s+delete\\s+(namespace|deployment|statefulset|pvc)'\n categories: [destructive, infrastructure_change]\n severity: high\n - pattern: 'terraform\\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 = "# ~/.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 - 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: 2000\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: 2000\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: 2000\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: 1000\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: 2000\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: 2000\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: 1000\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 budget_ms: 2000\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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"review:${PR_NUMBER} \u2014 <verdict + key findings + nits>\" }'\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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"review:${BRANCH} \u2014 <verdict + key findings + nits>\" }'\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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"dogfood:${SESSION_ID} \u2014 <end-to-end smoke summary>\" }'\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__agent-grounding__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__agent-grounding__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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"review-subagent:${TASK_ID} \u2014 <verdict + key findings + nits>\" }'\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__agent-grounding__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 - 'mcp__agent-grounding__ledger_add { sessionId: \"${SESSION_ID}\", type: \"fact\", content: \"review-subagent:${BRANCH} \u2014 <verdict + key findings + nits>\" }'\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__agent-grounding__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__agent-grounding__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 run the command yourself outside the agent.\"\n - \"Operator override (deliberate): run `harness approve risk --force <reason>` from your own shell (`! ` prefix in Claude Code, with --i-am-the-operator to acknowledge a non-TTY invocation).\"\n - \"Session-wide kill switch: run `harness pause --for <duration>` instead (every gate silences until the sentinel expires or `harness resume` runs).\"\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__agent-grounding__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# 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 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 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 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# 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 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 - pattern: 'kubectl\\s+delete\\s+(namespace|deployment|statefulset|pvc)'\n categories: [destructive, infrastructure_change]\n severity: high\n - pattern: 'terraform\\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";
3
3
  export type TemplateName = "minimal" | "full" | "solo" | "team";
4
4
  export declare function getTemplate(name: TemplateName): string;
@@ -243,6 +243,26 @@ hooks:
243
243
  blocking: hard
244
244
  budget_ms: 2000
245
245
 
246
+ # Optional: runtime-reality drift gate (NOT enabled by default).
247
+ # Blocks destructive runtime commands (compose down/restart, systemctl,
248
+ # kill/pkill, ./deploy-*) when the live process state has drifted from what
249
+ # your expectations file says should be running. Left COMMENTED on purpose:
250
+ # the hook is host-coupled and, without RUNTIME_REALITY_KEYWORD + an
251
+ # expectations file + RUNTIME_REALITY_PROBE_CMD, degrades silently to allow,
252
+ # a no-op that looks like protection. To arm it, uncomment the entry and
253
+ # fill in the three env values. The expectations-file format and how to
254
+ # install the probe are documented in docs/runtime-reality-hook.md.
255
+ #
256
+ # - name: runtime-reality
257
+ # event: PreToolUse
258
+ # command: >-
259
+ # RUNTIME_REALITY_KEYWORD=<your-stack>
260
+ # RUNTIME_REALITY_EXPECTATIONS_DIR=$HOME/.runtime-reality/expectations
261
+ # RUNTIME_REALITY_PROBE_CMD="node $HOME/.runtime-reality/probes/runtime-reality-docker-probe.mjs"
262
+ # harness pack hook runtime-reality
263
+ # blocking: hard
264
+ # description: Block destructive runtime commands on critical process drift
265
+
246
266
  policies:
247
267
  - name: review-before-merge
248
268
  description: Block PR merges unless a ledger entry tagged review:<pr-number> exists for this session.
@@ -558,7 +578,7 @@ policy_packs:
558
578
  - "an approved Understanding Report for this session"
559
579
  run:
560
580
  - "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)"
561
- - "Run \`harness approve understanding\` (bare, no pipes, chaining, or redirection) and approve the prompt"
581
+ - "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)"
562
582
  # approval_lifecycle (agent-tasks/d8ee60ca + harness/f54e0ecb,
563
583
  # v0.18.0+): expire the approval marker on task-completion
564
584
  # boundaries so a multi-task session re-prompts for an
@@ -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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgqB5B,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI7D,MAAM,UAAU,WAAW,CAAC,IAAkB;IAC5C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM;YACT,OAAO,aAAa,CAAC;QACvB,KAAK,MAAM;YACT,OAAO,aAAa,CAAC;QACvB,KAAK,MAAM;YACT,OAAO,aAAa,CAAC;QACvB,KAAK,SAAS;YACZ,OAAO,gBAAgB,CAAC;IAC5B,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ export interface ApproveReportHeredoc {
2
+ /** The executable command part (first line, heredoc intro stripped). */
3
+ command: string;
4
+ /** The heredoc delimiter word. */
5
+ delimiter: string;
6
+ /** The heredoc body — the Understanding Report markdown. */
7
+ body: string;
8
+ }
9
+ /**
10
+ * Parse the report-heredoc shape. Returns null unless the WHOLE command
11
+ * is exactly one clean `harness approve ...` line plus one single-quoted
12
+ * heredoc and nothing else.
13
+ */
14
+ export declare function parseApproveReportHeredoc(command: string): ApproveReportHeredoc | null;
15
+ /**
16
+ * The operator-approval command `harness approve ...`. See module
17
+ * header for the accepted shapes and the rationale for strictness.
18
+ */
19
+ export declare function isEscapeCommand(command: string): boolean;
@@ -0,0 +1,120 @@
1
+ // Escape-command matcher for the understanding-gate PreToolUse hook.
2
+ //
3
+ // The operator-approval command `harness approve ...` must not be
4
+ // hard-denied by the gate (denying the unblock surface makes the gate
5
+ // un-recoverable from inside the session), so the hook defers it to the
6
+ // interactive permission prompt instead. This module decides what
7
+ // qualifies. Deliberately strict: anything that could smuggle other work
8
+ // past the gate (chaining, substitution, redirection) is rejected.
9
+ //
10
+ // Two accepted shapes:
11
+ // 1. Single line: `harness approve ...` with no shell metacharacters.
12
+ // 2. Report heredoc (task 61fd36db): the same command with the
13
+ // Understanding Report attached as a quoted heredoc on stdin:
14
+ //
15
+ // harness approve understanding <<'UNDERSTANDING_REPORT'
16
+ // ## Understanding Report
17
+ // ...
18
+ // UNDERSTANDING_REPORT
19
+ //
20
+ // This is the report-capture channel: the Stop-hook producer fires
21
+ // only at END of turn (after approve already ran), and current
22
+ // Claude Code builds do not reliably persist mid-turn assistant
23
+ // text to the transcript JSONL, so the command itself is the only
24
+ // channel that reliably carries the report to `harness approve
25
+ // understanding`. As a bonus the operator reads the full report
26
+ // inside the permission prompt before approving.
27
+ //
28
+ // Heredoc safety: the delimiter must be single-quoted (no parameter or
29
+ // command substitution inside the body), the command part before `<<`
30
+ // must match a strict character WHITELIST (so no quoting/escaping trick
31
+ // can change how the shell tokenizes the line — see
32
+ // heredocCommandPartIsClean), the terminator is the FIRST line exactly
33
+ // equal to the delimiter (mirroring shell semantics for a plain `<<'X'`
34
+ // intro, which the whitelist guarantees is the only intro that can
35
+ // reach it), and nothing but whitespace may follow it. Any deviation —
36
+ // unquoted delimiter, second redirect, escaped/quote-obscured intro,
37
+ // trailing commands, unterminated body — fails closed to the ordinary
38
+ // gate block.
39
+ /** Metacharacters rejected in the executable (non-heredoc-body) part. */
40
+ const COMMAND_META_RE = /[;&|<>]/;
41
+ function commandPartIsClean(part) {
42
+ if (COMMAND_META_RE.test(part))
43
+ return false;
44
+ if (part.includes("`") || part.includes("$("))
45
+ return false;
46
+ return /^harness\s+approve\b/.test(part);
47
+ }
48
+ // The heredoc command part is held to a WHITELIST, not the blacklist
49
+ // above (review 2026-07-10, HIGH): a backslash-escaped redirect
50
+ // (`harness approve understanding \<<'UR'`) slipped the blacklist —
51
+ // the `<` characters were consumed by the heredoc-intro regex and `\`
52
+ // is not a rejected metachar — but bash reads `\<` as a literal `<`
53
+ // plus a file redirect, so no heredoc exists and the "body" lines
54
+ // execute as ordinary commands. A legitimate approve command part only
55
+ // ever contains the binary name, subcommand, flags, ids, and paths;
56
+ // everything else (backslashes, quotes, `$`, parens, globs) fails
57
+ // closed. The single-line shape keeps the blacklist for back-compat:
58
+ // it admits no `<` at all, so this divergence class cannot arise there.
59
+ const HEREDOC_COMMAND_PART_ALLOWED_RE = /^[A-Za-z0-9_\s,./=:@~-]*$/;
60
+ function heredocCommandPartIsClean(part) {
61
+ if (!HEREDOC_COMMAND_PART_ALLOWED_RE.test(part))
62
+ return false;
63
+ return commandPartIsClean(part);
64
+ }
65
+ /**
66
+ * Parse the report-heredoc shape. Returns null unless the WHOLE command
67
+ * is exactly one clean `harness approve ...` line plus one single-quoted
68
+ * heredoc and nothing else.
69
+ */
70
+ export function parseApproveReportHeredoc(command) {
71
+ const trimmed = command.trim();
72
+ const nl = trimmed.indexOf("\n");
73
+ if (nl === -1)
74
+ return null;
75
+ const head = trimmed.slice(0, nl);
76
+ // CR anywhere in the head means the line structure is not what the
77
+ // shell will see; fail closed. (Body CRs are inert data.)
78
+ if (head.includes("\r"))
79
+ return null;
80
+ // Lazy `.*?` + end-anchor: a second redirect after the heredoc intro
81
+ // forces the intro into the command part, where the metachar check
82
+ // rejects it.
83
+ const m = /^(.*?)<<\s*'([A-Z_][A-Z0-9_]*)'\s*$/.exec(head);
84
+ if (!m)
85
+ return null;
86
+ const commandPart = m[1].trimEnd();
87
+ const delimiter = m[2];
88
+ if (!heredocCommandPartIsClean(commandPart))
89
+ return null;
90
+ const rest = trimmed.slice(nl + 1).split("\n");
91
+ // First line EXACTLY equal to the delimiter terminates the body — the
92
+ // same rule the shell applies — so a delimiter line smuggled early in
93
+ // the body shifts the terminator up and the trailing content check
94
+ // below rejects the command as a whole.
95
+ const termIdx = rest.findIndex((line) => line === delimiter);
96
+ if (termIdx === -1)
97
+ return null;
98
+ const after = rest.slice(termIdx + 1);
99
+ if (!after.every((line) => line.trim() === ""))
100
+ return null;
101
+ return {
102
+ command: commandPart,
103
+ delimiter,
104
+ body: rest.slice(0, termIdx).join("\n"),
105
+ };
106
+ }
107
+ /**
108
+ * The operator-approval command `harness approve ...`. See module
109
+ * header for the accepted shapes and the rationale for strictness.
110
+ */
111
+ export function isEscapeCommand(command) {
112
+ const trimmed = command.trim();
113
+ if (!trimmed.includes("\n")) {
114
+ if (trimmed.includes("\r"))
115
+ return false;
116
+ return commandPartIsClean(trimmed);
117
+ }
118
+ return parseApproveReportHeredoc(trimmed) !== null;
119
+ }
120
+ //# sourceMappingURL=approve-escape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approve-escape.js","sourceRoot":"","sources":["../../../src/cli/pack/approve-escape.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,kEAAkE;AAClE,sEAAsE;AACtE,wEAAwE;AACxE,kEAAkE;AAClE,yEAAyE;AACzE,mEAAmE;AACnE,EAAE;AACF,uBAAuB;AACvB,wEAAwE;AACxE,iEAAiE;AACjE,mEAAmE;AACnE,EAAE;AACF,gEAAgE;AAChE,iCAAiC;AACjC,aAAa;AACb,8BAA8B;AAC9B,EAAE;AACF,wEAAwE;AACxE,oEAAoE;AACpE,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,qEAAqE;AACrE,sDAAsD;AACtD,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,wEAAwE;AACxE,oDAAoD;AACpD,uEAAuE;AACvE,wEAAwE;AACxE,mEAAmE;AACnE,uEAAuE;AACvE,qEAAqE;AACrE,sEAAsE;AACtE,cAAc;AAEd,yEAAyE;AACzE,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5D,OAAO,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,C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CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/C,sEAAsE;IACtE,sEAAsE;IACtE,mEAAmE;IACnE,wCAAwC;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IAC7D,IAAI,OAAO,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5D,OAAO;QACL,OAAO,EAAE,WAAW;QACpB,SAAS;QACT,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;KACxC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QACzC,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,yBAAyB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AACrD,CAAC"}
@@ -28,6 +28,7 @@ import { isReadOnlyBashPipeline } from "../../runtime/read-only-bash.js";
28
28
  import { ProducerSchema, } from "../../schema/index.js";
29
29
  import { renderAgentFacing } from "../../runtime/agent-facing.js";
30
30
  import { z } from "zod";
31
+ import { isEscapeCommand } from "./approve-escape.js";
31
32
  import { checkHookPause, loadManifestOrInjected, parseConfigUx, readStdin, } from "./hook-bootstrap.js";
32
33
  import { renderReportSchemaHint } from "./understanding-report-schema-hint.js";
33
34
  const PACK_NAME = "understanding-before-execution";
@@ -114,30 +115,16 @@ function blockJson(toolName, reason, producers, ux, sessionId, escapeHint) {
114
115
  },
115
116
  });
116
117
  }
117
- function isEscapeCommand(command) {
118
- // The operator-approval command `harness approve ...`. The Understanding
119
- // Gate must not hard-deny it: a `deny` gives no interactive prompt, so
120
- // denying the very command that records the operator's approval makes the
121
- // gate un-recoverable from inside the session. Deliberately strict: the
122
- // command must BE a `harness approve` invocation, with no shell chaining,
123
- // substitution, or redirection, so the allowlist cannot be used to smuggle
124
- // other work past the gate.
125
- const trimmed = command.trim();
126
- if (/[;&|\n<>]/.test(trimmed))
127
- return false;
128
- if (trimmed.includes("`") || trimmed.includes("$("))
129
- return false;
130
- return /^harness\s+approve\b/.test(trimmed);
131
- }
132
118
  // When a blocked Bash command clearly INTENDS to be the operator-approval
133
119
  // escape (`harness approve ...`) but trips the deliberately strict
134
120
  // isEscapeCommand matcher because it carries shell metacharacters (a pipe,
135
- // chaining, redirection, or substitution), it lands in the generic hard
136
- // block with no clue that the command itself was almost the way out. The
137
- // strictness is intentional (chaining could smuggle other work past the
138
- // gate), so the fix is discoverability, not relaxation: surface a targeted
139
- // hint telling the agent to re-run it bare. Returns null when the command
140
- // is not approve-like or already qualifies as a clean escape.
121
+ // chaining, redirection, or substitution) or a malformed report heredoc,
122
+ // it lands in the generic hard block with no clue that the command itself
123
+ // was almost the way out. The strictness is intentional (chaining could
124
+ // smuggle other work past the gate), so the fix is discoverability, not
125
+ // relaxation: surface a targeted hint naming the two accepted shapes.
126
+ // Returns null when the command is not approve-like or already qualifies
127
+ // as a clean escape.
141
128
  function approveEscapeHint(toolName, command) {
142
129
  if (toolName !== "Bash")
143
130
  return null;
@@ -147,9 +134,13 @@ function approveEscapeHint(toolName, command) {
147
134
  if (isEscapeCommand(trimmed))
148
135
  return null;
149
136
  return ("This looks like a `harness approve` command, but it was blocked because it carries shell " +
150
- "metacharacters (a pipe, `;`/`&&`/`||` chaining, `<`/`>` redirection, or command substitution). " +
151
- "The approval escape only fires for a bare invocation. Re-run it exactly as `harness approve understanding`, " +
152
- "with no pipes, chaining, redirection, or substitution, then approve the prompt.");
137
+ "metacharacters (a pipe, `;`/`&&`/`||` chaining, `<`/`>` redirection, or command substitution) " +
138
+ "in the executable part, or a malformed report heredoc. Two shapes are accepted: " +
139
+ "(1) bare: `harness approve understanding` with nothing else; " +
140
+ "(2) with the Understanding Report attached for capture: " +
141
+ "`harness approve understanding <<'UNDERSTANDING_REPORT'` followed by the report markdown and a " +
142
+ "final line containing exactly `UNDERSTANDING_REPORT`, with nothing after it. " +
143
+ "Re-run in one of those shapes, then approve the prompt.");
153
144
  }
154
145
  // The Claude Code PreToolUse "ask" envelope: surface the normal interactive
155
146
  // permission prompt. Per the hooks contract `permissionDecision: "ask"` is
@@ -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,qEAAqE;AACrE,kEAAkE;AAClE,yEAAyE;AACzE,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,sEAAsE;AACtE,oEAAoE;AACpE,sEAAsE;AACtE,sEAAsE;AACtE,sEAAsE;AACtE,EAAE;AACF,iEAAiE;AACjE,wEAAwE;AACxE,qEAAqE;AACrE,oEAAoE;AACpE,qEAAqE;AACrE,iEAAiE;AAEjE,OAAO,EACL,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EACL,mBAAmB,EACnB,oBA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
56
56
  const intro = "Report format (parsed by `@lannguyensi/understanding-gate`): markdown with these ten sections, any heading level (#, ##, ###), names case-insensitive. Missing any section produces a parse-error under `.understanding-gate/parse-errors/` and the audit trail is empty even though the gate-approval marker still gets written.";
57
57
  const bullets = UNDERSTANDING_REPORT_REQUIRED_SECTIONS.map((s) => ` - ${s}`).join("\n");
58
- return `${intro}\n${bullets}`;
58
+ // Submission recipe (task 61fd36db): the Stop-hook producer fires only
59
+ // at END of turn — after `harness approve understanding` already ran —
60
+ // so attaching the report to the approve command itself is the one
61
+ // path that reliably persists it. The gate's escape matcher accepts
62
+ // exactly this heredoc shape (see approve-escape.ts).
63
+ const submit = "To persist the report for audit, attach it to the approval command as a quoted heredoc " +
64
+ "(the only extra shape the gate allows — no other pipes, chaining, or redirection):\n" +
65
+ " harness approve understanding <<'UNDERSTANDING_REPORT'\n" +
66
+ " ## Understanding Report\n" +
67
+ " ...your report...\n" +
68
+ " UNDERSTANDING_REPORT";
69
+ return `${intro}\n${bullets}\n${submit}`;
59
70
  }
60
71
  //# sourceMappingURL=understanding-report-schema-hint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"understanding-report-schema-hint.js","sourceRoot":"","sources":["../../../src/cli/pack/understanding-report-schema-hint.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,EAAE;AACF,kEAAkE;AAClE,qEAAqE;AACrE,sEAAsE;AACtE,wEAAwE;AACxE,uEAAuE;AACvE,+CAA+C;AAC/C,EAAE;AACF,kEAAkE;AAClE,wDAAwD;AACxD,qEAAqE;AACrE,qEAAqE;AACrE,qEAAqE;AACrE,oEAAoE;AACpE,oEAAoE;AACpE,mEAAmE;AAEnE,MAAM,CAAC,MAAM,sCAAsC,GAAG;IACpD,mCAAmC;IACnC,8BAA8B;IAC9B,sBAAsB;IACtB,4BAA4B;IAC5B,oBAAoB;IACpB,uBAAuB;IACvB,qBAAqB;IACrB,cAAc;IACd,0BAA0B;IAC1B,qEAAqE;IACrE,yDAAyD;IACzD,kEAAkE;IAClE,kEAAkE;IAClE,qCAAqC;IACrC,kBAAkB;CACV,CAAC;AAEX;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB;IACpC,uEAAuE;IACvE,wEAAwE;IACxE,+DAA+D;IAC/D,yEAAyE;IACzE,oEAAoE;IACpE,wEAAwE;IACxE,sEAAsE;IACtE,qCAAqC;IACrC,MAAM,KAAK,GACT,mUAAmU,CAAC;IACtU,MAAM,OAAO,GAAG,sCAAsC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzF,OAAO,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC;AAChC,CAAC"}
1
+ {"version":3,"file":"understanding-report-schema-hint.js","sourceRoot":"","sources":["../../../src/cli/pack/understanding-report-schema-hint.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,EAAE;AACF,kEAAkE;AAClE,qEAAqE;AACrE,sEAAsE;AACtE,wEAAwE;AACxE,uEAAuE;AACvE,+CAA+C;AAC/C,EAAE;AACF,kEAAkE;AAClE,wDAAwD;AACxD,qEAAqE;AACrE,qEAAqE;AACrE,qEAAqE;AACrE,oEAAoE;AACpE,oEAAoE;AACpE,mEAAmE;AAEnE,MAAM,CAAC,MAAM,sCAAsC,GAAG;IACpD,mCAAmC;IACnC,8BAA8B;IAC9B,sBAAsB;IACtB,4BAA4B;IAC5B,oBAAoB;IACpB,uBAAuB;IACvB,qBAAqB;IACrB,cAAc;IACd,0BAA0B;IAC1B,qEAAqE;IACrE,yDAAyD;IACzD,kEAAkE;IAClE,kEAAkE;IAClE,qCAAqC;IACrC,kBAAkB;CACV,CAAC;AAEX;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB;IACpC,uEAAuE;IACvE,wEAAwE;IACxE,+DAA+D;IAC/D,yEAAyE;IACzE,oEAAoE;IACpE,wEAAwE;IACxE,sEAAsE;IACtE,qCAAqC;IACrC,MAAM,KAAK,GACT,mUAAmU,CAAC;IACtU,MAAM,OAAO,GAAG,sCAAsC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzF,uEAAuE;IACvE,uEAAuE;IACvE,mEAAmE;IACnE,oEAAoE;IACpE,sDAAsD;IACtD,MAAM,MAAM,GACV,yFAAyF;QACzF,sFAAsF;QACtF,4DAA4D;QAC5D,6BAA6B;QAC7B,uBAAuB;QACvB,wBAAwB,CAAC;IAC3B,OAAO,GAAG,KAAK,KAAK,OAAO,KAAK,MAAM,EAAE,CAAC;AAC3C,CAAC"}
@@ -114,7 +114,11 @@ export async function addLedgerFact(opts) {
114
114
  child.on("error", (err) => {
115
115
  settle({ ok: false, reason: `spawn failed: ${err.message}` });
116
116
  });
117
- child.on("exit", () => {
117
+ child.on("close", () => {
118
+ // Node fires `close` only after every stdio pipe has drained. Racing
119
+ // on `exit` would surface `(no stderr)` whenever the kernel buffer
120
+ // hadn't been flushed yet (mirrors the `close`-based fix in
121
+ // ledger-client.ts's `startSubprocess`).
118
122
  const tail = stderrBuf.trim().split("\n").pop()?.trim() || "(no stderr)";
119
123
  settle({ ok: false, reason: `grounding-mcp exited: ${tail}` });
120
124
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ledger-add.js","sourceRoot":"","sources":["../../src/runtime/ledger-add.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,kEAAkE;AAClE,kEAAkE;AAClE,EAAE;AACF,sEAAsE;AACtE,gDAAgD;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;A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,KAAK,CAAC,KAAM,CAAC,KAAK,CAChB,GAAG,IAAI,CAAC,SAAS,CAAC;gBAChB,OAAO,EAAE,KAAK;gBACd,EAAE,EAAE,CAAC;gBACL,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE;oBACN,eAAe,EAAE,YAAY;oBAC7B,YAAY,EAAE,EAAE;oBAChB,UAAU,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,EAAE;iBAC7D;aACF,CAAC,IAAI,CACP,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAuB,GAAa,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC9E,OAAO;QACT,CAAC;QAED,MAAM,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE;YACxB,MAAM,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,+BAA+B,SAAS,IAAI,EAAE,CAAC,CAAC;QAC9E,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,CAAC,CAAC,KAAK,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lannguyensi/harness",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "description": "Declarative control plane for agent harnesses — one YAML for grounding, tools, memory, and hooks.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/LanNguyenSi/harness",
@@ -47,6 +47,7 @@
47
47
  "dependencies": {
48
48
  "@inquirer/prompts": "^8.4.3",
49
49
  "@lannguyensi/runtime-reality-checker": "^0.2.0",
50
+ "@lannguyensi/understanding-gate": "^0.4.5",
50
51
  "chalk": "^5.3.0",
51
52
  "commander": "^12.1.0",
52
53
  "diff": "^9.0.0",