@lannguyensi/harness 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +82 -208
- package/dist/cli/doctor/format.js +20 -2
- package/dist/cli/doctor/format.js.map +1 -1
- package/dist/cli/doctor/index.d.ts +8 -0
- package/dist/cli/doctor/index.js +27 -1
- package/dist/cli/doctor/index.js.map +1 -1
- package/dist/cli/doctor/npm-bin-path.d.ts +23 -0
- package/dist/cli/doctor/npm-bin-path.js +82 -0
- package/dist/cli/doctor/npm-bin-path.js.map +1 -0
- package/dist/cli/doctor/types.d.ts +20 -4
- package/dist/cli/doctor/types.js.map +1 -1
- package/dist/cli/init/agent-tasks-auth.d.ts +32 -0
- package/dist/cli/init/agent-tasks-auth.js +75 -0
- package/dist/cli/init/agent-tasks-auth.js.map +1 -0
- package/dist/cli/init/interactive.d.ts +5 -0
- package/dist/cli/init/interactive.js +162 -4
- package/dist/cli/init/interactive.js.map +1 -1
- package/dist/cli/init/profiles.d.ts +2 -2
- package/dist/cli/init/profiles.js +23 -15
- package/dist/cli/init/profiles.js.map +1 -1
- package/dist/cli/init/templates.d.ts +1 -1
- package/dist/cli/init/templates.js +23 -9
- package/dist/cli/init/templates.js.map +1 -1
- package/dist/cli/pack/hook-post-tool-use.js +45 -8
- package/dist/cli/pack/hook-post-tool-use.js.map +1 -1
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.d.ts +2 -0
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js +20 -1
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.19.0] - 2026-05-17
|
|
11
|
+
|
|
12
|
+
**Headline: setup UX gap closed for non-agent-tasks operators.** Through v0.18.x several pieces of the harness experience silently degraded for operators picking Solo (or Team without an agent-tasks account): the new per-task understanding-gate marker expiry never fired because the configured boundary list was agent-tasks MCP names, `harness init --interactive` left the bridge wired but unauthenticated, `harness doctor` flagged the deliberately operator-driven `dogfood-before-release` policy as a missing-producer false positive, and an nvm-drift class of bug went undiagnosed. This release closes those four gaps: profile-aware reset defaults plus a new `expire_on_bash_match` regex list for gh-CLI workflows, a post-install auth probe with login / skip / abort dialog, doctor respect for the policy's own `producers:` array, and a doctor warning that catches when `npm prefix -g`'s bin dir is not on PATH. Doc cleanup made the external-account assumptions of each profile explicit up-front.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **understanding-gate: `approval_lifecycle.expire_on_bash_match`** (harness/f54e0ecb). New optional schema field on the `understanding-before-execution` pack config: a string array of regex patterns matched against the `Bash` tool's `tool_input.command`. When a Bash command matches, the per-session approval marker is deleted on PostToolUse, same semantics as the existing `expire_on_tool_match` does for MCP tool names. Enables gh-CLI / pure-Bash workflows to declare task boundaries (e.g. `^gh pr (merge|close)\b`, `^git push origin (master|main)\b`) so the gate's per-task re-prompt works for them too. Profile defaults updated: Solo drops the agent-tasks tool list (dead weight there) and ships only the Bash list with `max_age: 1h`; Team and Full keep the tool list and add the Bash list for hybrid coverage. Patterns are pre-compiled at parse time, invalid regexes dropped with stderr warnings. Round-trip regression tests in `tests/cli/init-full-template-pins.test.ts` parse each template through `yaml.parse + new RegExp + .test()` to pin the escape-pipeline correctness, since the unit-level tests bypass that surface.
|
|
17
|
+
|
|
18
|
+
- **`harness doctor`: warn when `npm prefix -g`'s bin dir is not on PATH** (harness/4ddd78ed). Surfaces the nvm-drift footgun where `harness init --interactive` runs `npm i -g` against the active Node's prefix but the operator's shell PATH points at a different one, so installed binaries are silently invisible to subsequent doctor probes. Doctor now resolves the bin dir via `npm prefix -g` (the modern replacement for the removed `npm bin -g`) and renders an `Environment` section with the actionable PATH-patch suggestion when the bin dir is not in `process.env.PATH`. The section stays absent on ok and on the unknown branch (npm missing); skipped under `--shallow` so the 100ms timing budget stays intact.
|
|
19
|
+
|
|
20
|
+
- **`harness init --interactive`: post-install auth probe for the agent-tasks bridge** (harness/3f775180). After a successful `npm i -g @agent-tasks/mcp-bridge`, the wizard runs `agent-tasks-mcp-bridge status` to detect whether a token is configured. Three branches:
|
|
21
|
+
- **ok**: prints `✓ agent-tasks token validated against the backend.` and continues.
|
|
22
|
+
- **token present but validation fails** (backend unreachable, expired token, wrong base URL): prints an informational warning naming the bridge's reason and continues. The wizard does not block on this because the recovery is not actionable from inside it.
|
|
23
|
+
- **no token stored**: opens a three-option dialog: (a) run `agent-tasks-mcp-bridge login` interactively now via stdio pass-through, (b) skip with a reminder, (c) abort the wizard with a pointer to the signup URL and the re-run command. After a successful login the wizard re-probes to confirm.
|
|
24
|
+
|
|
25
|
+
Closes the silent footgun where a fresh operator could finish the wizard with `harness doctor` reporting all-green but every `mcp__agent-tasks__*` call returning an auth error.
|
|
26
|
+
|
|
27
|
+
- **FULL_TEMPLATE `git-preflight` hook pin: `min_version: "0.1.1"` + `version_command: ["preflight", "--version"]`** (agent-preflight/cb5a1770). Same pattern as the existing pins for `agent-tasks-mcp-bridge`, `grounding-mcp`, `memory-router-user-prompt-submit`. Floor at agent-preflight 0.1.1, the release that distinguishes "tool not installed" (e.g. an npm script invoking eslint that is not in devDependencies) from real lint/test/typecheck failures. Stale 0.1.0 installs silently emit false-positive blockers that keep the `preflight-before-*` policies closed forever; with the floor wired, `harness doctor` now warns operators to upgrade.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- **`harness doctor`: producer-gap warning now respects the policy's own `producers:` array** (harness/f97e152f). A `block` policy with a `within:` window used to be flagged with `⚠ ... no manifest hook produces it` whenever no automatic SessionStart hook wrote the required tag, even when the policy itself declared a `producers:` entry pointing the agent at the manual recovery (`mcp__agent-grounding__ledger_add`). For `dogfood-before-release` in the Full template that was a false positive: the gate is deliberately operator-driven (an automatic SessionStart producer would defeat its purpose), and the `producers:` array IS the schema-blessed manual recovery path the agent sees in the deny envelope. Doctor now treats a non-empty `producers:` array as a documented producer and suppresses the warning. The warning still fires when both kinds are absent. Visible effect on the Full template: one fewer false-positive warning (dogfood-before-release flips from `⚠` to `✓`); the two preflight policies were already satisfied by the `git-preflight` SessionStart hook and stay green.
|
|
32
|
+
|
|
33
|
+
- **Profile dependency clarity in README + wizard** (harness/75de11c4). README, `docs/init-interactive.md`, `docs/for-humans.md`, the wizard's profile-choice descriptions, and the Team-profile confirm prompt now state the external-account assumptions of each profile up-front: Solo is standalone, Team requires an agent-tasks account, Full additionally requires `@lannguyensi/agent-preflight` and `gh` on PATH. The wizard also prints a post-init reminder for Team/Full operators naming `agent-tasks-mcp-bridge login` as the auth recovery path and `--template solo` as the fallback for non-agent-tasks workflows.
|
|
34
|
+
|
|
10
35
|
## [0.18.0] - 2026-05-17
|
|
11
36
|
|
|
12
37
|
**Headline: per-task understanding-gate marker expiry.** Through v0.17.x the approval marker had no lifetime: one `harness approve understanding` covered every subsequent Edit / Write / Bash for the whole session. That contract was correct when the gate was about "agent starts a session, picks ONE interpretation, runs", but no longer matches multi-task sessions, where a stale interpretation can silently drive the next task's edits. Live failure mode from the v0.17.4 dogfood: three sequential tasks in one session, marker stayed valid across all three, the third task started implementing the wrong fix surface before the operator caught the misdiagnose. v0.18 expires the marker on configurable task-boundary tools and (optionally) on a TTL safety net, so a fresh task gets a fresh Understanding Report. Backing task: agent-tasks/d8ee60ca.
|
package/README.md
CHANGED
|
@@ -11,18 +11,13 @@ applies, audits, and *enforces*.
|
|
|
11
11
|
> exact context, and why.
|
|
12
12
|
|
|
13
13
|
A coding agent like Claude Code is configured across half a dozen
|
|
14
|
-
files
|
|
15
|
-
hook scripts, per-project overrides
|
|
16
|
-
this agent do right now, and why is it set up that way?"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`harness` puts all of that in one YAML file you can read, validate,
|
|
22
|
-
and diff. From that file it generates the config the agent actually
|
|
23
|
-
loads, and at runtime it enforces the rules you declared: it blocks a
|
|
24
|
-
tool call that violates one, and records every decision so you can
|
|
25
|
-
see what fired and why.
|
|
14
|
+
files (`settings.json`, `CLAUDE.md`, memory notes, MCP registrations,
|
|
15
|
+
hook scripts, per-project overrides), and no single file answers
|
|
16
|
+
*"what can this agent do right now, and why is it set up that way?"*.
|
|
17
|
+
`harness` puts all of it in one YAML you read, validate, and diff;
|
|
18
|
+
generates the config the agent loads from it; and at runtime blocks
|
|
19
|
+
tool calls that violate the declared rules while recording every
|
|
20
|
+
decision.
|
|
26
21
|
|
|
27
22
|
## See it work
|
|
28
23
|
|
|
@@ -40,12 +35,10 @@ $ harness policy intercept # Claude Code runs this before each tool call
|
|
|
40
35
|
{"decision":"block","reason":"review-before-merge: no matching ledger entry for tag `review:42`","hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"review-before-merge: no matching ledger entry for tag `review:42`"}}
|
|
41
36
|
```
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
[What the agent sees vs what the engine records](#what-the-agent-sees-vs-what-the-engine-records)
|
|
48
|
-
below). The engine-vocabulary text stays in the audit ledger.
|
|
38
|
+
Built-in block-enforcement policies ship a `ux:` block since v0.17.0,
|
|
39
|
+
so the agent sees a plain-language three-section form
|
|
40
|
+
([`docs/for-agents.md`](docs/for-agents.md#agent-facing-block-messages-ux-block));
|
|
41
|
+
the engine-vocabulary text above stays in the audit ledger.
|
|
49
42
|
|
|
50
43
|
Blocked. `harness explain` says exactly why:
|
|
51
44
|
|
|
@@ -87,54 +80,6 @@ timestamp policy outcome reason
|
|
|
87
80
|
Declare the rule once; every session is held to it, with a paper
|
|
88
81
|
trail of every decision.
|
|
89
82
|
|
|
90
|
-
## What the agent sees vs what the engine records
|
|
91
|
-
|
|
92
|
-
A policy has two readers: the audit ledger (which wants every internal
|
|
93
|
-
detail) and the agent (which only needs to know what is blocked, what
|
|
94
|
-
condition is missing, and which command satisfies it). Declaring a
|
|
95
|
-
policy's `ux:` block splits those readers cleanly.
|
|
96
|
-
|
|
97
|
-
Engine-internal model (unchanged): session IDs, ledger entries,
|
|
98
|
-
attestations, provenance chains, policy DAGs. All of it still feeds
|
|
99
|
-
`audit`, `explain --trace`, and the evidence-ledger writes that
|
|
100
|
-
`session-export` replays.
|
|
101
|
-
|
|
102
|
-
Agent-facing model (new, opt-in per policy): `cannot` (what is
|
|
103
|
-
blocked), `required` (the missing precondition, in plain words), and
|
|
104
|
-
`run` (the exact command to satisfy it). When `ux:` is declared, the
|
|
105
|
-
agent sees only this shape, with `${VAR}` references substituted
|
|
106
|
-
against the same context the `ledger_tag` resolved against.
|
|
107
|
-
|
|
108
|
-
```yaml
|
|
109
|
-
policies:
|
|
110
|
-
- name: preflight-before-investigation
|
|
111
|
-
requires: { ledger_tag: "preflight:${REPO}", within: "1h" }
|
|
112
|
-
enforcement: block
|
|
113
|
-
ux:
|
|
114
|
-
cannot: "You cannot investigate this repository yet."
|
|
115
|
-
required: ["verified repository preflight"]
|
|
116
|
-
run: ["harness preflight"]
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
On block, the agent sees:
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
You cannot investigate this repository yet.
|
|
123
|
-
|
|
124
|
-
Required:
|
|
125
|
-
- verified repository preflight
|
|
126
|
-
|
|
127
|
-
Run:
|
|
128
|
-
harness preflight
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Not `no matching ledger entry for tag preflight:harness`. The
|
|
132
|
-
internal failure (tag, hint, matched count) is still written to the
|
|
133
|
-
ledger for `audit` and `explain --trace`. Policies without `ux:` keep
|
|
134
|
-
the legacy deny envelope unchanged, so existing 0.16.x manifests need
|
|
135
|
-
no changes; the canonical form for agents writing new policies lives
|
|
136
|
-
in [`docs/for-agents.md`](docs/for-agents.md#agent-facing-block-messages-ux-block).
|
|
137
|
-
|
|
138
83
|
## Concepts in six lines
|
|
139
84
|
|
|
140
85
|
| Term | What it is |
|
|
@@ -163,25 +108,16 @@ flowchart LR
|
|
|
163
108
|
observe -. refine .-> declare
|
|
164
109
|
```
|
|
165
110
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
surfaces (`audit`, `explain --trace`, `session-export`) replay those
|
|
171
|
-
rows so you can see what fired, why, and across which session.
|
|
172
|
-
Whatever you learn from observing flows back into the manifest. That
|
|
173
|
-
loop is the whole product.
|
|
111
|
+
Observe → refine → declare is the whole loop. The read-side surfaces
|
|
112
|
+
(`audit`, `explain --trace`, `session-export`) replay rows the runtime
|
|
113
|
+
already recorded, so what flows back into the manifest is grounded in
|
|
114
|
+
what actually happened.
|
|
174
115
|
|
|
175
116
|
## Pick your audience
|
|
176
117
|
|
|
177
|
-
- **Operator?**
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- **Agent (or onboarding one)?** Read
|
|
181
|
-
[`docs/for-agents.md`](docs/for-agents.md). It defines the
|
|
182
|
-
workflow lifecycle, the policy / ledger sequence, the CLI cheat
|
|
183
|
-
sheet split by side-effect class, and the audit triumvirate
|
|
184
|
-
(`audit` vs `explain --trace` vs `session-export`).
|
|
118
|
+
- **Operator?** [`docs/for-humans.md`](docs/for-humans.md): install through first `apply`, first real policy, diagnostics cheat sheet.
|
|
119
|
+
- **Agent (or onboarding one)?** [`docs/for-agents.md`](docs/for-agents.md): workflow lifecycle, policy / ledger sequence, CLI cheat sheet by side-effect class, the audit triumvirate.
|
|
120
|
+
- **Writing your own policy?** [`docs/writing-custom-policies.md`](docs/writing-custom-policies.md): three tripwires, four worked recipes (each validated in CI), author loop, field reference.
|
|
185
121
|
|
|
186
122
|
## Install
|
|
187
123
|
|
|
@@ -200,11 +136,21 @@ command path, install to wired-in, no prose.
|
|
|
200
136
|
harness init --interactive
|
|
201
137
|
```
|
|
202
138
|
|
|
203
|
-
Guided wizard
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
139
|
+
Guided wizard. Detects `~/.claude/` and `~/.codex/`, MCP servers
|
|
140
|
+
already wired in `settings.json`, harness binary version. Picks a
|
|
141
|
+
profile (`solo` / `team` / `custom`) and writes a starting
|
|
142
|
+
`harness.yaml`. Ctrl-C aborts cleanly. Walkthrough +
|
|
143
|
+
limitations: [`docs/init-interactive.md`](docs/init-interactive.md).
|
|
144
|
+
|
|
145
|
+
### Profiles at a glance
|
|
146
|
+
|
|
147
|
+
| Profile | External accounts / tools required | Best for |
|
|
148
|
+
|---------|------------------------------------|----------|
|
|
149
|
+
| `solo` | None. `npm` + Claude Code is enough. | Single operators who want the Understanding Gate without committing to a tasking system. |
|
|
150
|
+
| `team` | An **agent-tasks** account ([hosted](https://agent-tasks.opentriologue.ai) or [self-hosted](https://github.com/LanNguyenSi/agent-tasks)). | Teams that already use `agent-tasks` for PR review tracking. The merge gate (`review:<pr-number>` ledger tag) wires against the agent-tasks MCP. |
|
|
151
|
+
| `full` | Same as `team` plus `@lannguyensi/agent-preflight` and `gh` on PATH. | Operators who want every reference policy enforced (dogfood gate, preflight gates, review-subagent gate, merge gate). |
|
|
152
|
+
|
|
153
|
+
**Not using agent-tasks?** Pick `solo`. The `team` and `full` review gates currently match only the agent-tasks MCP tool names, so a `gh pr create` workflow stays unprotected by them today. Tool-agnostic gates that also match `gh pr` are tracked in the backlog.
|
|
208
154
|
|
|
209
155
|
If you prefer non-interactive (CI, fresh-VM provisioning), pick a
|
|
210
156
|
template directly:
|
|
@@ -215,17 +161,14 @@ harness init --template team # solo + agent-tasks MCP + review-before-merge po
|
|
|
215
161
|
harness init --template full # everything from the Appendix A reference manifest
|
|
216
162
|
```
|
|
217
163
|
|
|
218
|
-
|
|
164
|
+
Use `harness init --probe` for a JSON snapshot of detected runtimes
|
|
165
|
+
and MCPs without writing anything.
|
|
219
166
|
|
|
220
|
-
|
|
221
|
-
harness init --probe # JSON snapshot of detected runtimes + MCPs + manifest
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
## Try it yourself
|
|
167
|
+
## Try it without installing
|
|
225
168
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
169
|
+
`harness dry-run` reports which hooks fire and which policies match
|
|
170
|
+
for a given tool call, against the reference manifest, before any
|
|
171
|
+
ledger I/O:
|
|
229
172
|
|
|
230
173
|
```bash
|
|
231
174
|
git clone https://github.com/LanNguyenSi/harness && cd harness
|
|
@@ -236,44 +179,23 @@ node dist/cli/main.js dry-run "merge PR 42" \
|
|
|
236
179
|
--config docs/examples/full-manifest.yaml
|
|
237
180
|
```
|
|
238
181
|
|
|
239
|
-
`
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
The reference manifest is a schema-coverage example, not a runnable
|
|
245
|
-
config. `harness validate --config docs/examples/full-manifest.yaml`
|
|
246
|
-
will report errors for install-specific hook script paths it
|
|
247
|
-
references (and warnings for binaries like `git-batch` that only exist
|
|
248
|
-
in a real install). That is expected; the file header spells out the
|
|
249
|
-
contract. Use `harness init --template full` to get a manifest
|
|
250
|
-
tailored to your machine.
|
|
251
|
-
|
|
252
|
-
Convinced? Install globally and set up your own:
|
|
253
|
-
`npm i -g @lannguyensi/harness && harness init --interactive`.
|
|
182
|
+
`docs/examples/full-manifest.yaml` is a schema-coverage example, not a
|
|
183
|
+
runnable config (the file header spells out the contract). For a
|
|
184
|
+
manifest tailored to your machine, install globally and run
|
|
185
|
+
`harness init --interactive`.
|
|
254
186
|
|
|
255
187
|
## Uninstall
|
|
256
188
|
|
|
257
189
|
`harness uninstall` is the single-command teardown: dry-run by default,
|
|
258
|
-
`--apply` to mutate
|
|
259
|
-
|
|
260
|
-
groups and `mcpServers` entries in `settings.json`, any leftover
|
|
261
|
-
`settings.json.pre-harness-<TS>` backups), then removes them after
|
|
262
|
-
writing a reversible backup + JSON snapshot next to `settings.json`.
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
harness uninstall # list, exit 0
|
|
266
|
-
harness uninstall --apply # tear down
|
|
267
|
-
harness uninstall --restore-from <pre-harness-backup> # atomic restore
|
|
268
|
-
npm uninstall -g @lannguyensi/harness # drop the CLI itself
|
|
269
|
-
```
|
|
190
|
+
`--apply` to mutate, `--restore-from <backup>` to roll back. Full
|
|
191
|
+
inventory + recommended order in [`docs/uninstall.md`](docs/uninstall.md).
|
|
270
192
|
|
|
271
193
|
## Status
|
|
272
194
|
|
|
273
195
|
harness ships in phases. Phases 1 through 6 are released: read-only
|
|
274
196
|
inventory → managed edits → declarative truth → policy layer → polish
|
|
275
197
|
and dogfood lessons → the Understanding Gate Policy Pack. Phase 7, the
|
|
276
|
-
Risk Gate, is next. The current release is `v0.
|
|
198
|
+
Risk Gate, is next. The current release is `v0.19.0`.
|
|
277
199
|
|
|
278
200
|
The phase-by-phase plan with acceptance criteria lives in
|
|
279
201
|
[`docs/ROADMAP.md`](docs/ROADMAP.md); what shipped in each version is
|
|
@@ -281,109 +203,61 @@ in [`CHANGELOG.md`](CHANGELOG.md).
|
|
|
281
203
|
|
|
282
204
|
## Policy Packs
|
|
283
205
|
|
|
284
|
-
A *Policy Pack* is a reusable bundle of
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
`understanding-before-execution` (shipped in `v0.9.0`), forces agents
|
|
288
|
-
to expose and confirm their task interpretation before any
|
|
289
|
-
write-capable tool fires.
|
|
206
|
+
A *Policy Pack* is a reusable bundle of hooks, policies, instruction
|
|
207
|
+
template, and permission profiles shipped under one name and enabled
|
|
208
|
+
from `harness.yaml` with a single key:
|
|
290
209
|
|
|
291
210
|
```yaml
|
|
292
211
|
policy_packs:
|
|
293
212
|
- name: understanding-before-execution
|
|
294
213
|
config:
|
|
295
|
-
mode: grill_me
|
|
296
|
-
permission_profile: safe-start
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
Manage packs with `harness pack add / remove / list`. Apply against
|
|
300
|
-
either runtime:
|
|
301
|
-
|
|
302
|
-
```sh
|
|
303
|
-
harness apply --runtime claude-code # default; writes harness.generated/settings.json
|
|
304
|
-
harness apply --runtime codex # writes harness.generated/codex/config.toml
|
|
214
|
+
mode: grill_me # fast_confirm | grill_me | strict
|
|
215
|
+
permission_profile: safe-start # safe-start | implementation-after-approval | high-risk-grill-me
|
|
305
216
|
```
|
|
306
217
|
|
|
307
|
-
|
|
308
|
-
`
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
block / allow / capture / approve round-trip without a real Codex
|
|
316
|
-
binary.
|
|
218
|
+
Manage packs with `harness pack add / remove / list`. Two packs ship
|
|
219
|
+
today: [`understanding-before-execution`](docs/policy-packs/understanding-before-execution.md)
|
|
220
|
+
(forces an Understanding Report before any write-capable tool fires)
|
|
221
|
+
and [`branch-protection`](docs/policy-packs/branch-protection.md)
|
|
222
|
+
(blocks source mutations on protected branches without an explicit
|
|
223
|
+
override). Custom packs from `path:`, `npm:`, or `git:` sources are
|
|
224
|
+
out of scope for v1 (see the pack docs for the future-vocabulary
|
|
225
|
+
contract).
|
|
317
226
|
|
|
318
227
|
## What's next
|
|
319
228
|
|
|
320
|
-
**Phase 7, Risk Gate.** Today's policy model
|
|
321
|
-
matching trigger
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
`risk
|
|
328
|
-
decision space extends to `allow / warn / require_approval / deny`.
|
|
329
|
-
Motivating use case: prevent `DROP TABLE users`, `kubectl delete
|
|
330
|
-
namespace prod`, `terraform destroy` against an unverified production
|
|
331
|
-
target, even if the model would have happily run them.
|
|
332
|
-
|
|
333
|
-
Phase 7 builds on Phase 4's `policy intercept` runtime backbone and
|
|
334
|
-
Phase 6's Policy Pack distribution surface; neither is replaced.
|
|
229
|
+
**Phase 7, Risk Gate.** Today's policy model returns a binary
|
|
230
|
+
block/allow per matching trigger. Phase 7 lets harness reason about
|
|
231
|
+
the action itself (Action Envelope → Context Resolver → Risk
|
|
232
|
+
Classifier) and extends the decision space to `allow / warn /
|
|
233
|
+
require_approval / deny`. Motivating use case: block `DROP TABLE
|
|
234
|
+
users`, `kubectl delete namespace prod`, `terraform destroy` against
|
|
235
|
+
unverified production targets. Full plan in
|
|
236
|
+
[`docs/ROADMAP.md#phase-7--risk-gate`](docs/ROADMAP.md#phase-7--risk-gate).
|
|
335
237
|
|
|
336
238
|
> Bring your favorite agent harness. Add governance.
|
|
337
239
|
|
|
338
240
|
## Why this exists
|
|
339
241
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
with frontmatter, `~/.claude/keybindings.json`, MCP server
|
|
344
|
-
registrations in `~/.claude.json`, skill directories, per-project
|
|
345
|
-
overrides, and external CLIs that behave differently per project.
|
|
346
|
-
|
|
347
|
-
There is no single place that answers *"what can this agent do right
|
|
348
|
-
now, and why is that configured that way?"*. Drift between sessions
|
|
349
|
-
is invisible until it breaks something. Humans editing one surface
|
|
350
|
-
do not know which other surfaces they need to touch. A fresh agent
|
|
351
|
-
instance has no way to audit its own setup.
|
|
352
|
-
|
|
353
|
-
Our entry point into this problem: on 2026-04-23, an
|
|
354
|
-
`agent-grounding` checkout that was 16 commits behind origin led two
|
|
355
|
-
tasks to be incorrectly called "stale". The check that would have
|
|
356
|
-
caught it already exists,
|
|
242
|
+
On 2026-04-23, an `agent-grounding` checkout that was 16 commits
|
|
243
|
+
behind origin led two tasks to be incorrectly called "stale". The
|
|
244
|
+
check that would have caught it already existed:
|
|
357
245
|
[`agent-preflight`](https://github.com/LanNguyenSi/agent-preflight)
|
|
358
|
-
runs `git fetch` + `git status`
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
conversation is the origin of this repo.
|
|
246
|
+
runs `git fetch` + `git status` and emits a structured `ready` +
|
|
247
|
+
confidence-score result. The missing piece was not the check, it was
|
|
248
|
+
the deterministic *trigger*: a `SessionStart` hook that invokes
|
|
249
|
+
`preflight run` and a policy that gates further work on the result.
|
|
250
|
+
Building that wiring needs an agreed-upon place for harness config to
|
|
251
|
+
live first. That conversation is the origin of this repo.
|
|
365
252
|
|
|
366
253
|
## Related
|
|
367
254
|
|
|
368
|
-
- [`agent-grounding`](https://github.com/LanNguyenSi/agent-grounding):
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
- [`
|
|
373
|
-
|
|
374
|
-
- [`agent-tasks`](https://github.com/LanNguyenSi/agent-tasks): the
|
|
375
|
-
MCP-registered task platform whose registration + health appear in
|
|
376
|
-
`harness describe`.
|
|
377
|
-
- [`agent-preflight`](https://github.com/LanNguyenSi/agent-preflight):
|
|
378
|
-
local preflight validator; the canonical implementation of
|
|
379
|
-
preflight-hook content harness wires.
|
|
380
|
-
- [`codebase-oracle`](https://github.com/LanNguyenSi/codebase-oracle):
|
|
381
|
-
an opt-in MCP surface for multi-repo RAG search. Not in the Full
|
|
382
|
-
default; operators wire it via `harness add mcp codebase-oracle
|
|
383
|
-
--command codebase-oracle,mcp`.
|
|
384
|
-
- [`agent-dx`](https://github.com/LanNguyenSi/agent-dx): ships
|
|
385
|
-
`git-batch-cli`, a day-to-day tool whose inventory appears in
|
|
386
|
-
`harness describe`.
|
|
255
|
+
- [`agent-grounding`](https://github.com/LanNguyenSi/agent-grounding): evidence-ledger, claim-gate, review-claim-gate; `grounding-mcp` is the canonical client surface harness queries through `queryLedgerByTag`.
|
|
256
|
+
- [`agent-memory`](https://github.com/LanNguyenSi/agent-memory): the memory surfaces the control plane inventories.
|
|
257
|
+
- [`agent-tasks`](https://github.com/LanNguyenSi/agent-tasks): MCP-registered task platform whose registration + health appear in `harness describe`.
|
|
258
|
+
- [`agent-preflight`](https://github.com/LanNguyenSi/agent-preflight): local preflight validator; the canonical implementation of preflight-hook content harness wires.
|
|
259
|
+
- [`codebase-oracle`](https://github.com/LanNguyenSi/codebase-oracle): opt-in MCP for multi-repo RAG search; not in Full, wire via `harness add mcp codebase-oracle --command codebase-oracle,mcp`.
|
|
260
|
+
- [`agent-dx`](https://github.com/LanNguyenSi/agent-dx): ships `git-batch-cli`, a day-to-day tool whose inventory appears in `harness describe`.
|
|
387
261
|
|
|
388
262
|
## License
|
|
389
263
|
|
|
@@ -45,6 +45,23 @@ function formatManifestSection(report) {
|
|
|
45
45
|
}
|
|
46
46
|
return out;
|
|
47
47
|
}
|
|
48
|
+
// Environment section: render only when there is something worth
|
|
49
|
+
// reporting. `ok` stays silent (no point in a ✓ line for a check that
|
|
50
|
+
// hits zero issues), `warn` is the actionable case we want loud, and
|
|
51
|
+
// `unknown` stays silent because if npm is missing the other dep
|
|
52
|
+
// checks already failed loudly.
|
|
53
|
+
function formatEnvironmentSection(report) {
|
|
54
|
+
const bin = report.npmGlobalBin;
|
|
55
|
+
if (!bin || bin.status !== "warn")
|
|
56
|
+
return [];
|
|
57
|
+
return [
|
|
58
|
+
"",
|
|
59
|
+
"Environment",
|
|
60
|
+
` ⚠ npm global bin (${bin.binDir}) is not on PATH`,
|
|
61
|
+
` harness install commands wrote binaries here but your shell will not find them.`,
|
|
62
|
+
` Add to your shell rc (e.g. ~/.bashrc, ~/.zshrc): ${bin.pathPatchSuggestion}`,
|
|
63
|
+
];
|
|
64
|
+
}
|
|
48
65
|
function formatToolsSection(report) {
|
|
49
66
|
const out = ["", "Tools"];
|
|
50
67
|
out.push(` MCP servers (${report.tools.mcp.length} declared)`);
|
|
@@ -133,8 +150,8 @@ function formatPoliciesSection(report) {
|
|
|
133
150
|
const out = ["", "Policies"];
|
|
134
151
|
for (const p of report.policies) {
|
|
135
152
|
if (p.producerGap) {
|
|
136
|
-
out.push(` ⚠ ${p.name} requires fresh \`${p.producerGap.ledgerTag}\` (within ${p.producerGap.within}) but no manifest hook produces it`);
|
|
137
|
-
out.push(` the gate will block its trigger until the tag is supplied out-of-band; add a producer hook (e.g. a SessionStart runner)`);
|
|
153
|
+
out.push(` ⚠ ${p.name} requires fresh \`${p.producerGap.ledgerTag}\` (within ${p.producerGap.within}) but no manifest hook produces it AND the policy declares no \`producers:\` array`);
|
|
154
|
+
out.push(` the gate will block its trigger until the tag is supplied out-of-band; add a producer hook (e.g. a SessionStart runner) OR document the manual recovery path in the policy's \`producers:\` array`);
|
|
138
155
|
}
|
|
139
156
|
else {
|
|
140
157
|
out.push(` ✓ ${p.name} ${p.caveat}`);
|
|
@@ -204,6 +221,7 @@ function formatSummary(report) {
|
|
|
204
221
|
export function format(report) {
|
|
205
222
|
const lines = [formatHeader(report)];
|
|
206
223
|
lines.push(...formatManifestSection(report));
|
|
224
|
+
lines.push(...formatEnvironmentSection(report));
|
|
207
225
|
lines.push(...formatToolsSection(report));
|
|
208
226
|
lines.push(...formatMemorySection(report));
|
|
209
227
|
lines.push(...formatHooksSection(report));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/cli/doctor/format.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,SAAS,OAAO,CAAC,CAAiB,EAAE,OAAgB;IAClD,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,SAAS;YACZ,OAAO,OAAO;gBACZ,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,iCAAiC;gBAClD,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC;QAC7D,KAAK,OAAO;YACV,OAAO,SAAS,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACzD,KAAK,aAAa,CAAC,CAAC,CAAC;YACnB,kEAAkE;YAClE,8DAA8D;YAC9D,wDAAwD;YACxD,MAAM,KAAK,GACT,CAAC,CAAC,OAAO,CAAC,KAAK,KAAK,YAAY;gBAC9B,CAAC,CAAC,YAAY;gBACd,CAA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CAAC,CAAC;IAC1C,KAAK,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,KAAK,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,KAAK,CAAC,IAAI,CAAC,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,KAAK,CAAC,IAAI,CAAC,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,CAAC,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,KAAK,CAAC,IAAI,CAAC,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,KAAK,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IACrC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type McpProbe } from "../../probes/mcp.js";
|
|
2
2
|
import { type LoaderOptions } from "../loader.js";
|
|
3
3
|
import { type RunCodexCheckOptions } from "./codex.js";
|
|
4
|
+
import { type NpmExec } from "./npm-bin-path.js";
|
|
4
5
|
import { type RogueLedgerScanOptions } from "./rogue-ledger.js";
|
|
5
6
|
import { isDoctorTarget, KNOWN_DOCTOR_TARGETS, type DoctorReport, type DoctorTarget } from "./types.js";
|
|
6
7
|
export interface DoctorOptions extends LoaderOptions {
|
|
@@ -26,6 +27,13 @@ export interface DoctorOptions extends LoaderOptions {
|
|
|
26
27
|
* usually override both plus `fsInterface`.
|
|
27
28
|
*/
|
|
28
29
|
rogueLedgerScanOptions?: Partial<RogueLedgerScanOptions>;
|
|
30
|
+
/**
|
|
31
|
+
* Test-injection knob for the npm global-bin PATH check (task
|
|
32
|
+
* 4ddd78ed). Tests fake the `npm prefix -g` invocation by passing a
|
|
33
|
+
* stub that returns specific stdout / exit codes; production omits
|
|
34
|
+
* this and the real `npm` is spawned.
|
|
35
|
+
*/
|
|
36
|
+
npmBinExec?: NpmExec;
|
|
29
37
|
}
|
|
30
38
|
export { isDoctorTarget, KNOWN_DOCTOR_TARGETS };
|
|
31
39
|
export declare function doctor(opts?: DoctorOptions): Promise<DoctorReport>;
|
package/dist/cli/doctor/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { inspectMemory } from "../../probes/memory.js";
|
|
|
6
6
|
import { RealMcpProbe, probeAll, } from "../../probes/mcp.js";
|
|
7
7
|
import { loadManifest } from "../loader.js";
|
|
8
8
|
import { countCodexDiagnostics, runCodexTargetChecks, } from "./codex.js";
|
|
9
|
+
import { checkNpmBinPath } from "./npm-bin-path.js";
|
|
9
10
|
import { scanForRogueLedgers } from "./rogue-ledger.js";
|
|
10
11
|
import { isDoctorTarget, KNOWN_DOCTOR_TARGETS, } from "./types.js";
|
|
11
12
|
export { isDoctorTarget, KNOWN_DOCTOR_TARGETS };
|
|
@@ -296,7 +297,20 @@ function buildPolicies(manifest) {
|
|
|
296
297
|
// Policies without `within` only need the tag to exist once, which
|
|
297
298
|
// the normal review / PR workflow supplies, so they are not
|
|
298
299
|
// flagged.
|
|
299
|
-
|
|
300
|
+
//
|
|
301
|
+
// Refinement (task f97e152f): a non-empty `producers:` array on
|
|
302
|
+
// the policy itself is the schema's way of declaring the recovery
|
|
303
|
+
// path. For example `dogfood-before-release` deliberately wants
|
|
304
|
+
// the operator to record a manual smoke summary; an automatic
|
|
305
|
+
// SessionStart producer would defeat the gate's purpose. When that
|
|
306
|
+
// documented producer exists the warning would be a false positive
|
|
307
|
+
// and is suppressed. The check still fires when both kinds are
|
|
308
|
+
// absent. The `length === 0` clause is defensive: the schema
|
|
309
|
+
// already enforces `producers: .min(1).optional()`, so a defined
|
|
310
|
+
// array is guaranteed non-empty for any manifest that loaded.
|
|
311
|
+
if (p.enforcement === "block" &&
|
|
312
|
+
p.requires.within !== undefined &&
|
|
313
|
+
(p.producers === undefined || p.producers.length === 0)) {
|
|
300
314
|
const prefix = ledgerTagPrefix(p.requires.ledger_tag);
|
|
301
315
|
if (!hasProducerHook(manifest, p, prefix)) {
|
|
302
316
|
report.producerGap = {
|
|
@@ -385,6 +399,8 @@ function countDiagnostics(report) {
|
|
|
385
399
|
if (p.producerGap)
|
|
386
400
|
warningCount++;
|
|
387
401
|
}
|
|
402
|
+
if (report.npmGlobalBin?.status === "warn")
|
|
403
|
+
warningCount++;
|
|
388
404
|
if (report.memory.routerExecutable && !report.memory.routerExecutable.exists)
|
|
389
405
|
errorCount++;
|
|
390
406
|
if (!report.memory.routerExecutable)
|
|
@@ -453,6 +469,15 @@ export async function doctor(opts = {}) {
|
|
|
453
469
|
? { fsInterface: opts.rogueLedgerScanOptions.fsInterface }
|
|
454
470
|
: {}),
|
|
455
471
|
});
|
|
472
|
+
// Shallow mode skips real spawns: the npm-bin probe shells out to
|
|
473
|
+
// `npm prefix -g` which costs ~30ms and breaks the shallow timing
|
|
474
|
+
// budget. Mirrors how MCP probes degrade above.
|
|
475
|
+
const npmGlobalBin = opts.shallow
|
|
476
|
+
? undefined
|
|
477
|
+
: await checkNpmBinPath({
|
|
478
|
+
...(opts.npmBinExec !== undefined ? { exec: opts.npmBinExec } : {}),
|
|
479
|
+
...(opts.pathEnv !== undefined ? { pathEnv: opts.pathEnv } : {}),
|
|
480
|
+
});
|
|
456
481
|
const partial = {
|
|
457
482
|
manifestPath: resolved.base,
|
|
458
483
|
manifestVersion: manifest.version,
|
|
@@ -465,6 +490,7 @@ export async function doctor(opts = {}) {
|
|
|
465
490
|
policies,
|
|
466
491
|
workflows,
|
|
467
492
|
rogueLedgerDbs,
|
|
493
|
+
...(npmGlobalBin !== undefined ? { npmGlobalBin } : {}),
|
|
468
494
|
};
|
|
469
495
|
if (opts.target === "codex") {
|
|
470
496
|
const manifestDir = path.dirname(resolved.base);
|