harness-everything 0.50.0 → 0.51.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.
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ // Regression guard for packet 415: CHANGELOG.md must contain exactly one
4
+ // `## [Unreleased]` heading. Stray duplicate blocks reopen release-note
5
+ // ambiguity; this gate fails the release chain if one reappears.
6
+
7
+ const assert = require('assert');
8
+ const fs = require('fs');
9
+
10
+ function countUnreleasedHeadings(text) {
11
+ return text.split('\n').filter((line) => /^## \[Unreleased\]\s*$/.test(line)).length;
12
+ }
13
+
14
+ const changelog = fs.readFileSync(require('path').join(__dirname, '..', 'CHANGELOG.md'), 'utf8');
15
+ assert.strictEqual(countUnreleasedHeadings(changelog), 1);
16
+
17
+ // Negative control over the same counting function: two headings must report 2.
18
+ assert.strictEqual(
19
+ countUnreleasedHeadings('## [Unreleased]\n\n* entry\n\n## [1.0.0] (2026-01-01)\n\n## [Unreleased]\n'),
20
+ 2
21
+ );
22
+ assert.strictEqual(countUnreleasedHeadings('## [1.0.0] (2026-01-01)\n'), 0);
23
+
24
+ console.log('PASS changelog-unreleased');
@@ -1240,21 +1240,26 @@ Status: **implemented behind the existing pilot switch; mechanism and package ch
1240
1240
 
1241
1241
  ```mermaid
1242
1242
  flowchart LR
1243
- B["Original baseline B<br/>task and config pinned"] --> O["Proposed outline O<br/>new target absent at B"]
1244
- I["Coordinator-pinned inventory"] --> R["Independent review<br/>exact O + cited row"]
1245
- O --> R
1246
- R --> H["Immutable handoff +<br/>exclusive writer lease"]
1247
- H --> P["Task/Agent PreToolUse<br/>exact prompt marker"]
1248
- P --> S["Synchronous seam<br/>clean worker root at O<br/>one-use token consumed"]
1249
- S --> W["Correlated worker start/result"]
1250
- W --> D["Final candidate D<br/>strict descendant of O"]
1251
- D --> A["Outline result and<br/>aggregate B→D MUSTs"]
1243
+ B["Original baseline B<br/>task and config pinned"] --> PL["Plan + start<br/>W6 state operations"]
1244
+ PL --> INV["Pinned inventory<br/>W6 producer"]
1245
+ INV --> O
1246
+ INV --> REV["Independent review<br/>exact O + cited row"]
1247
+ O --> REV
1248
+ REV --> HAND["Seal handoff +<br/>exclusive writer lease<br/>W3/W6"]
1249
+ HAND --> DISP["Task/Agent PreToolUse<br/>exact prompt marker"]
1250
+ DISP --> SEAM["Synchronous seam<br/>clean worker root at O<br/>one-use token consumed"]
1251
+ SEAM --> WORK["Correlated worker start/result"]
1252
+ WORK --> D["Final candidate D<br/>strict descendant of O"]
1253
+ D --> C["Completed worker result<br/>and Stop"]
1254
+ C --> F["Independent final review"]
1255
+ F --> Q["Ordered dispositions<br/>W6 state operations"]
1256
+ Q --> A["Outline result and<br/>aggregate B→D MUSTs"]
1252
1257
  ```
1253
1258
 
1254
1259
  | Evidence | Required binding |
1255
1260
  |---|---|
1256
1261
  | B and task | Keep the workflow-start B commit/root/tree and ordered requirement IDs for every attempt. Config scope must still match B. An attempt cannot reset B to O. |
1257
- | Inventory | The coordinator supplies exact bytes and `inventory-pin.json` outside the candidate tree. The pinned source is `report-inv.md`, SHA-256 `2741bd4514d2cd68f57d93a2b3ce94cbe597ca62d30e26f0ca58e882df5b03c6`, run `e1-inv-1`, input SHA `0ef0541c6cae550e8269ba712e03797e0e987dfb`, approval `#325` comment `6436207729`, decision 1. The trusted pin also records the owner-approved `VERI`→`EVID` mapping for rows 15–18 by reference to `../e1-feasibility-2026-10-28/owner-decision-veri-evid.md`; inventory bytes and digest stay unchanged. The provider rehashes the bytes and compares every pin field before resolving one row and domain. Missing, stale, duplicate, ambiguous, wrong-target or unavailable evidence is unresolved with no fallback. Synthetic test pins prove parser/mechanism binding only. |
1262
+ | Inventory | The coordinator supplies exact bytes and `inventory-pin.json` outside the candidate tree. The pinned source is `report-inv.md`, SHA-256 `2741bd4514d2cd68f57d93a2b3ce94cbe597ca62d30e26f0ca58e882df5b03c6`, run `e1-inv-1`, input SHA `0ef0541c6cae550e8269ba712e03797e0e987dfb`, approval `#325` comment `6436207729`, decision 1. The trusted pin records the owner-approved `VERI`→`EVID` mapping for rows 15–18, approved at [#325 comment 6706805112](https://github.com/dyphn1/Harness-everything/issues/325#issuecomment-6706805112); inventory bytes and digest stay unchanged. The provider rehashes the bytes and compares every pin field before resolving one row and domain. Missing, stale, duplicate, ambiguous, wrong-target or unavailable evidence is unresolved with no fallback. Synthetic test pins prove parser/mechanism binding only. |
1258
1263
  | O and review | O is bound to its commit, tree, target blobs and stored-byte digests. Its `proposed` ADR frontmatter cites one `Inventory row: <id>`, target and domain, with `id` equal to the target basename, and contains no completed Decision text. A host-captured `SubagentStop` review must approve those exact O bytes and the pinned inventory, with a distinct host `agent_id` and correlated Agent/Task result. |
1259
1264
  | Handoff and dispatch | One immutable attempt handoff binds B, O, scope, inventory, accepted review, coordinator principal, lease and one-use token. Agent/Task dispatch accepts exactly one `HARNESS_OUTLINE_DISPATCH_V1` block in `tool_input.prompt`, whose token must equal the handoff token; it does not search free-form text or use another field or cwd as a fallback. The outline anchor also requires explicit `run_in_background === false` and absence of any `isolation` key, including null or empty values. Before worker start, PreToolUse verifies the handoff, review, pin, exclusive lease, canonical root, HEAD/tree at O and clean index/worktree including untracked files; it creates a write-once handoff-digest seal, stores validation digests/reasons, then consumes the token by exclusive creation. Every predecessor seal, seam and token remains bound to the original handoff bytes, so an overwritten predecessor invalidates the chain. |
1260
1265
  | Worker and D | The dispatch key is `(session_id, tool_use_id)`. Exactly one matching Task/Agent result must carry `tool_response.status === 'completed'`; its observed `tool_response.agentId` must map to exactly one `SubagentStart` and one `SubagentStop` with the same `session_id` and `agent_id`. Require PreToolUse < SubagentStart < SubagentStop in journal order, but do not order the completed result against Stop. Both worker events need exact canonical `cwd === workerRoot`. `prompt_id` and `parent_tool_use_id` are not correlation keys; `interrupted` is not completion proof. Async launches, failures, cancellation, missing/duplicate events, replayed IDs, worktree isolation and root mismatch stay unresolved. D is checked against the current candidate separately from O. O must be a strict ancestor of D. A squash may retain the cycle only when a coordinator correspondence record proves identical target blobs between retained pre-merge D and the merged tree; changed bytes need fresh final quality review. |
@@ -1269,24 +1274,29 @@ Each captured writer record is decided by principal × phase × operation × tar
1269
1274
  ```mermaid
1270
1275
  flowchart LR
1271
1276
  R["captured writer record"] --> P{"journal phase"}
1272
- P -->|"before reviewer launch"| B["B→O: coordinator writes or git add/commit of the pinned target"]
1277
+ P -->|"before reviewer launch"| B["B→O target writes, plus W6 plan/start/inventory"]
1273
1278
  P -->|"reviewer launch to its Stop"| V["review: no writer"]
1274
- P -->|"review Stop to dispatch"| H["review→dispatch: no writer (W3 unverifiable)"]
1279
+ P -->|"review Stop to dispatch"| H["review→dispatch: W3 seal only"]
1275
1280
  P -->|"dispatch to worker Stop"| D["draft: correlated worker in its root"]
1276
- P -->|"after worker Stop"| A["after D: no writer"]
1281
+ P -->|"after final review"| A["three ordered W6 dispositions only"]
1277
1282
  B --> S["O commit must change exactly the pinned target(s) against B"]
1278
1283
  ```
1279
1284
 
1280
1285
  | Phase | Principal | Operation and target | Result |
1281
1286
  |---|---|---|---|
1287
+ | Before O | Coordinator: no `agent_id`, author `session_id` | Installed `workflow-disposition.js plan` for the row-17 `adr-evid` / `verify-row17` requirements and `iterative-single` topology | Allowed only for the existing planning transitions at clean B |
1288
+ | Before O | Coordinator: no `agent_id`, author `session_id` | Installed `workflow-disposition.js start` for the same pending plan | Allowed only for the existing pending-to-running transition at clean B |
1289
+ | Before O | Coordinator: no `agent_id`, author `session_id` | Installed `w6-state-operations.js inventory` | Allowed only for the unchanged inventory bytes, exact pin, and two pinned inventory destinations |
1282
1290
  | Before reviewer launch | Coordinator: no `agent_id`, author `session_id` | `Write`, `Edit` or `apply_patch` whose every path is a pinned target | Allowed |
1283
1291
  | Before reviewer launch | Coordinator | `git add [--] <literal pinned file>...` or `git commit -m <message>`; R11-1 (b): record before review, validate at dispatch; uncaptured/pre-B index effects are UNCHECKED | Allowed only under this grammar; unbound or unverified index effects receive no credit |
1284
1292
  | Before reviewer launch | Any | Any other write, chained or unknown shell command, or a path that is not the target | `outline-writer-activity-ambiguous` |
1285
1293
  | Review | Reviewer or any other agent | Any writer | Ambiguous |
1286
- | Review to dispatch | Coordinator | Any write, including handoff, lease, pin and merge-correspondence files | Ambiguous |
1294
+ | Review to dispatch | Coordinator: no `agent_id`, author `session_id` | One installed `w6-state-operations.js seal` after the approved O review and before dispatch | Allowed only for this attempt's validated lease and handoff |
1295
+ | Review to dispatch | Coordinator | Any other write, including a caller-selected destination, pin change or merge-correspondence file | `outline-writer-activity-ambiguous` |
1287
1296
  | Dispatch to worker Stop | Correlated worker, `cwd` equal to the worker root | Any writer | Allowed |
1288
1297
  | Dispatch to worker Stop | Other agent or coordinator | Any writer | Ambiguous; an overlapping same-root start is `outline-competing-writer-start` |
1289
- | After worker Stop | Any | Any writer | Ambiguous |
1298
+ | After worker Stop and completed independent final review | Coordinator: no `agent_id`, author `session_id` | `step adr-evid pass`, then `binding verify-row17 verification-loop loaded`, then `step verify-row17 pass` | Allowed only in this order and with current evidence |
1299
+ | After worker Stop | Any | Any other writer or disposition | Ambiguous |
1290
1300
 
1291
1301
  - The reviewer launch is the first journal record that is the reviewer's own, or the launch result sharing its `tool_use_id`. The review ends at the reviewer's `SubagentStop`.
1292
1302
  - Write-family records carry `writeTargets` (the `file_path`, or the `apply_patch` headers). A record without a target is ambiguous.
@@ -1304,7 +1314,10 @@ flowchart LR
1304
1314
  ```
1305
1315
 
1306
1316
  - Suggested contract wording (owner, #341 comment 6708822276): "Exact task and target-path binding, captured writer operations, and immutable Outline O Git commit/tree/artifact identity validated before independent review and revalidated at dispatch."
1307
- - **W3 stays rejected.** Handoff, lease, pin and merge-correspondence files are written outside capture and their content is not bound at capture time, so no coordinator state write is verifiable from evidence yet. The dispatch seam still validates those bytes; the writes themselves are rejected.
1317
+ - **W3/W6 are bounded state operations, not a coordinator exemption.** Every admitted operation has a correlated `tool_use_id`, session, canonical task root, workflow/revision, principal, phase, schema, and exact state destinations observed by the real Pre/Post hooks. Each capture carries `harness.w6-state-operation.v1` evidence with before/after session-state snapshots and Git identity. The shared provider validates the state transition and destination set; extra changed paths, symlink escapes, stale or failed results, missing correlation, replay, compound shell and unsupported commands withhold credit. State-only calls do not change `lastEditAt` or create a verification timestamp.
1318
+ - Before O, `plan` accepts only the row-17 `adr-evid` and `verify-row17` requirement set on `iterative-single`; `start` only materializes that plan. The installed `inventory` operation copies the unchanged pinned inventory bytes and pin after checking SHA-256 `2741bd4514d2cd68f57d93a2b3ce94cbe597ca62d30e26f0ca58e882df5b03c6`, row 17's `VERI`→`EVID` mapping, and durable approval [#325 comment 6706805112](https://github.com/dyphn1/Harness-everything/issues/325#issuecomment-6706805112). These transitions write only `workflow-run.json`, `workflow-obligations.json`, or the two pinned inventory files beneath the session state root.
1319
+ - After the approved O review and before dispatch, the installed `seal` operation derives the current task/attempt from the captured reviewer lifecycle and clean O, reuses the existing pin/review validators, and creates only `writer-lease.json` and `handoff.json` for that attempt. No caller-selected path, old-attempt rewrite, review substitution, or task-tree/Git write is accepted.
1320
+ - After the worker's completed result and unique Stop, and after an independent final review, only the ordered ADR pass, verification-loop binding, and verification pass are admitted. The verification `step` calls `pilot.assess()` synchronously before its own PostToolUse event; that internal report is marked pending with no retained credit. Final credit requires the completed host result and is recomputed by ordinary Stop reconciliation.
1308
1321
  - **W4 is unchanged.** Outline credit still needs a host-captured `SubagentStop` review and a correlated Task/Agent result from an agent distinct from the coordinator and worker. Only the Claude Code host is captured for outline credit; OpenCode and other reviewer providers are not.
1309
1322
  - Negative controls: the mechanism file injects each rejected case through the real hook, provider and `pilot.assess()` (`writer-policy negative controls`, `pre-review writer positive controls`).
1310
1323
 
@@ -224,6 +224,8 @@ Credited reconciliation for F4 (Claude Code only, pilot ON) is **implemented, wi
224
224
 
225
225
  PR-B adds a dedicated `outline-confirmation` evidence lane for Claude captures with separate B/O/D checks, a coordinator-sealed pre-dispatch handoff, pinned-inventory row binding, and an independent exact-O review. A separate sanitized capture now qualifies the **observed Claude Code 2.1.312 run8 profile**, recorded at main baseline `1bd0f805031c5577a6e7f72a9bc5b41618b71fc1`. This is retained field-mapping evidence, not runtime version enforcement or an E1 qualifying cycle. OpenCode, Codex and other Claude Code versions receive no outline qualification. Missing or ambiguous capture stays unresolved and host tools remain fail-open. The outline result does not replace the aggregate B→D MUST result or the existing exact-D `quality-review` contract.
226
226
 
227
+ W3/W6 adds only the closed workflow-state operations named in [the reconciliation contract](doc-workflow-reconciliation.md#writer-policy-phase-aware): plan/start and inventory before O, one seal after the approved O review, then three ordered dispositions after worker closure and final review. The installed producer exposes only `inventory` and `seal`; the real Pre/Post hook journal and provider validate invocation identity, phase, exact destinations, schema and transition. `state-persist` uses that same decision so verified state-only calls do not appear as task edits or verification evidence. The outline mechanism suite exercises source and packaged paths; this is deterministic mechanism/package evidence only. No live W6 host cycle or E1 qualification is claimed.
228
+
227
229
  ### Own-repository governance guard (PR #376)
228
230
 
229
231
  On `pull_request`, a standalone `doc-governance` job extracts `scripts/doc-governance-guard.js` from the event base commit and runs those bytes against the exact event base/head SHAs. Its nonzero result fails that job; `self-regression` and the other CI jobs run independently. The ordinary test suite may still run on GitHub's PR checkout SHA, which can be a synthetic merge commit; it is reported separately. The guard never falls back to the candidate copy. PR #376's reviewed base lacked the verifier; that historical bootstrap reported BOOTSTRAP_UNCHECKED without executing candidate bytes. Bases containing the guard (including main at 0ef0541c) execute the base-owned verifier. If a selected PR base lacks the guard, the wrapper retains the warning/step-summary-only bootstrap path with exit 0; this is unverified governance, not PASS. Every nonzero exit from an extracted verifier, including FAIL and BOOTSTRAP_UNCHECKED, fails the governance job. Other CI jobs run independently.
@@ -197,6 +197,7 @@ function creditChain(context, set, dependencies = {}) {
197
197
  principals,
198
198
  baseline,
199
199
  captures,
200
+ allowInFlightW6ToolUseId: dependencies.allowInFlightW6ToolUseId || null,
200
201
  };
201
202
  const originProvider = dependencies.originProvider || createOriginProvider(providerInput);
202
203
  const produced = produceDocSnapshot({
@@ -457,6 +458,17 @@ function assess(context, set, dependencies = {}) {
457
458
  report.unsatisfied.push({ obligationId: 'doc-change:scope', state: 'unavailable', reasonCode: reason });
458
459
  }
459
460
  }
461
+ if (!withhold && dependencies.allowInFlightW6ToolUseId) {
462
+ report.pilotCredit = false;
463
+ report.pilotStatus = 'pending';
464
+ report.creditedCapabilities = [];
465
+ report.acceptedRefs = [];
466
+ report.outlineEvidence = { status: 'pending', outcome: 'none', observation: 'pending',
467
+ acceptedRefs: [], recordRefs: [], diagnostics: [{ code: 'state-operation-in-flight',
468
+ message: 'the verification state operation has not completed its host result', obligationId: null }] };
469
+ report.diagnostics.push({ code: 'state-operation-in-flight',
470
+ message: 'the verification state operation has not completed its host result', obligationId: null });
471
+ }
460
472
  report.diagnostics = report.diagnostics.map(diagnosticOf);
461
473
  try { atomicWriteJson(path.join(context.sessionDir, 'doc-reconciliation-pilot.json'), report); }
462
474
  catch {