harness-everything 0.53.0 → 0.54.1
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +3 -1
- package/CHANGELOG.md +26 -0
- package/bin/cli.js +1 -0
- package/ci/action-gate.test.js +1 -1
- package/ci/invariant-routing.test.js +22 -3
- package/ci/mechanism-2al-codex-hooks-compat.test.js +56 -2
- package/ci/mechanism-2at-fable-execution-phases.test.js +38 -0
- package/ci/mechanism-349-ci-change-scope.test.js +78 -57
- package/ci/mechanism-397-cycle-import.test.js +18 -3
- package/ci/mechanism-check-packet-write-set.test.js +232 -0
- package/ci/mechanism-codex-hook-results.test.js +145 -0
- package/ci/mechanism-codex-prompt-pass-through.test.js +8 -4
- package/ci/mechanism-error-handling-map.test.js +219 -0
- package/ci/mechanism-report-writer.test.js +335 -0
- package/ci/openai-plugin-runtime.test.js +2 -1
- package/ci/prompt-contract-regressions.test.js +6 -2
- package/ci/router-workflow-plan.test.js +50 -7
- package/docs/architecture.md +4 -3
- package/docs/error-handling/README.md +250 -0
- package/docs/error-handling/actions/c1-action-map.md +89 -0
- package/docs/error-handling/actions/c2-action-map.md +22 -0
- package/docs/error-handling/actions/c3-action-map.md +26 -0
- package/docs/error-handling/actions/c5-action-map.md +31 -0
- package/docs/error-handling/actions/c6-action-map.md +37 -0
- package/docs/error-handling/actions/c7-action-map.md +18 -0
- package/docs/error-handling/actions/e0002-action-map.md +101 -0
- package/docs/error-handling/activity.puml +84 -0
- package/docs/error-handling/details/c1-authority-conformance.md +93 -0
- package/docs/error-handling/details/c2-test-root-containment.md +35 -0
- package/docs/error-handling/details/c3-mode-ownership.md +50 -0
- package/docs/error-handling/details/c5-host-replay-contract.md +40 -0
- package/docs/error-handling/details/c6-packet-briefing.md +65 -0
- package/docs/error-handling/details/c7-write-set-check.md +54 -0
- package/docs/error-handling/details/e0002-capture-evidence.md +93 -0
- package/docs/error-handling/details/e0002-report-writer.md +116 -0
- package/docs/error-handling/nodes.yaml +44 -0
- package/docs/error-handling/registry.md +59 -0
- package/docs/error-handling/templates/packet-briefing.md +45 -0
- package/docs/platform-capabilities.md +20 -1
- package/fable-mode/SKILL.md +5 -5
- package/fable-mode/execution-guardrails/SKILL.md +1 -1
- package/fable-mode/fable-haiku/SKILL.md +1 -1
- package/fable-mode/fable-opus/SKILL.md +1 -1
- package/fable-mode/fable-sonnet/SKILL.md +1 -1
- package/fable-mode/references/execution-phases.md +26 -4
- package/hooks/scripts/action-gate.js +5 -0
- package/hooks/scripts/codex-action-gate-post.js +3 -12
- package/hooks/scripts/codex-user-prompt.js +2 -3
- package/hooks/scripts/contract-test.js +17 -7
- package/hooks/scripts/lib/codex-tool-outcome.js +28 -0
- package/hooks/scripts/rule-of-3-tracker.js +11 -4
- package/hooks/scripts/state-persist.js +15 -9
- package/hooks/scripts/subagent-scope-guard.js +32 -25
- package/hooks/scripts/subagent-start.js +1 -1
- package/hooks/scripts/subagent-stop.js +14 -3
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +2 -1
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/hooks.json +6 -6
- package/plugins/harness-everything/hooks/scripts/action-gate.js +5 -0
- package/plugins/harness-everything/hooks/scripts/codex-action-gate-post.js +3 -12
- package/plugins/harness-everything/hooks/scripts/codex-user-prompt.js +2 -3
- package/plugins/harness-everything/hooks/scripts/contract-test.js +17 -7
- package/plugins/harness-everything/hooks/scripts/lib/codex-tool-outcome.js +28 -0
- package/plugins/harness-everything/hooks/scripts/rule-of-3-tracker.js +11 -4
- package/plugins/harness-everything/hooks/scripts/state-persist.js +15 -9
- package/plugins/harness-everything/hooks/scripts/subagent-scope-guard.js +32 -25
- package/plugins/harness-everything/hooks/scripts/subagent-start.js +1 -1
- package/plugins/harness-everything/hooks/scripts/subagent-stop.js +14 -3
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/skills/fable-mode/SKILL.md +5 -5
- package/plugins/harness-everything/skills/fable-mode/execution-guardrails/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-haiku/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-opus/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-sonnet/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/references/execution-phases.md +26 -4
- package/sbom.cdx.json +7 -7
- package/scripts/check-packet-write-set.js +155 -0
- package/scripts/codex-hooks-compat.js +46 -5
- package/scripts/error-handling-map.js +288 -0
- package/scripts/report-writer.js +261 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@startuml error-handling-overview
|
|
2
|
+
' Issue #437 / #402: discussion-only view of one Error Occurrence.
|
|
3
|
+
' ASSESS / RESPOND correspond to Views 1 and 2.
|
|
4
|
+
' Decide disposition is expanded by View 3, not a hyperlink.
|
|
5
|
+
' Recurrence is a NEW occurrence entering at Capture, never a G feedback loop.
|
|
6
|
+
title Error Handling — one occurrence (UML Activity draft)
|
|
7
|
+
|
|
8
|
+
start
|
|
9
|
+
:New Error Occurrence;
|
|
10
|
+
partition "ASSESS" {
|
|
11
|
+
:Capture;
|
|
12
|
+
:Triage;
|
|
13
|
+
if (Already-approved tolerate class?) then (yes)
|
|
14
|
+
:Retry this operation (at most 3);
|
|
15
|
+
if (Recovered?) then (yes)
|
|
16
|
+
:Resume interrupted work;
|
|
17
|
+
else (no)
|
|
18
|
+
:Mark step UNVERIFIED;
|
|
19
|
+
:Report; continue independent work only;
|
|
20
|
+
endif
|
|
21
|
+
stop
|
|
22
|
+
else (no)
|
|
23
|
+
if (Real problem, according to reviewer?) then (yes)
|
|
24
|
+
:Identify;
|
|
25
|
+
if (Identification complete?) then (yes)
|
|
26
|
+
if (Blocking main path?) then (no)
|
|
27
|
+
:Record / defer treatment;
|
|
28
|
+
stop
|
|
29
|
+
endif
|
|
30
|
+
else (no / owner decision pending)
|
|
31
|
+
:Hold pending identification decision;
|
|
32
|
+
stop
|
|
33
|
+
endif
|
|
34
|
+
else (no / unclear)
|
|
35
|
+
if (Reviewer cannot tell?) then (yes)
|
|
36
|
+
:Request owner decision; hold item;
|
|
37
|
+
else (no)
|
|
38
|
+
:Dismiss with reason;
|
|
39
|
+
endif
|
|
40
|
+
stop
|
|
41
|
+
endif
|
|
42
|
+
endif
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
partition "RESPOND" {
|
|
46
|
+
:Decide disposition
|
|
47
|
+
<b>expanded in View 3</b>;
|
|
48
|
+
if (Mechanical prevention feasible within budget?) then (yes)
|
|
49
|
+
if (Same class still yields new instances in bounded review?) then (yes)
|
|
50
|
+
:Consider Avoid / Tolerate;
|
|
51
|
+
else (no)
|
|
52
|
+
:Converge;
|
|
53
|
+
endif
|
|
54
|
+
else (no)
|
|
55
|
+
:Consider Avoid / Tolerate;
|
|
56
|
+
endif
|
|
57
|
+
if (Avoid or Tolerate under consideration?) then (yes)
|
|
58
|
+
if (Can drop or restrict action?) then (yes)
|
|
59
|
+
:Avoid;
|
|
60
|
+
else (no)
|
|
61
|
+
if (Owner approves Tolerate?) then (yes)
|
|
62
|
+
:Tolerate;
|
|
63
|
+
else (no / pending)
|
|
64
|
+
:Keep unresolved; do not bypass required checks;
|
|
65
|
+
stop
|
|
66
|
+
endif
|
|
67
|
+
endif
|
|
68
|
+
endif
|
|
69
|
+
:Treat (define acceptance first);
|
|
70
|
+
:Deliver relevant context;
|
|
71
|
+
:Accept and retire;
|
|
72
|
+
if (Converge / Avoid: acceptance met?) then (yes)
|
|
73
|
+
:Accept; retire unneeded lesson;
|
|
74
|
+
else (no)
|
|
75
|
+
if (Tolerate: cap and escalation recorded?) then (yes)
|
|
76
|
+
:Keep tolerate class active;
|
|
77
|
+
else (no)
|
|
78
|
+
:Keep open; report outstanding evidence;
|
|
79
|
+
endif
|
|
80
|
+
endif
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
stop
|
|
84
|
+
@enduml
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# C1 — Level 3 conformance-test design (one authority per named split decision)
|
|
2
|
+
|
|
3
|
+
> **Proposed design / Level 3 supporting contract, NOT promoted to a test, NOT an implemented mechanism.** Companion to the [C1 Level 2 authority/consumer inventory](../actions/c1-action-map.md) and [Level 1](../README.md) in [#437](https://github.com/dyphn1/Harness-everything/issues/437) / [#402](https://github.com/dyphn1/Harness-everything/issues/402). This specifies **what a conformance test must check once a target is pinned**; it does not change production code, hooks, report rules or ledger state. Docs-only write-set. [source-traced: C1.md:L6-7; advisor-answer-4.md:L7,L21; class-common.md:L3]
|
|
4
|
+
|
|
5
|
+
**Claim convention:** every factual statement below is **source-traced** and tagged `[source-traced: <file>:<line>]`, using the same source keys as the [Level 2 map](../actions/c1-action-map.md). No claim here comes from an executed conformance run in this batch.
|
|
6
|
+
|
|
7
|
+
## Problem to prevent
|
|
8
|
+
|
|
9
|
+
A split decision — the same decision answered independently at several sites — survives point fixes: each review closes one site and the next review finds another deciding differently. [source-traced: E-0001:L143,L147; E-0007:L108-110] The treatment is to name **one authority**, inventory **every consumer** (including unchanged ones), then gate promotion to a test on three named items. [source-traced: C1.md:L4; advisor-answer-4.md:L7]
|
|
10
|
+
|
|
11
|
+
**Promotion gate (verbatim authority):** promote to a test **only after** naming (1) a shipped authority, (2) every relevant consumer and (3) a current divergence witness. [source-traced: advisor-answer-4.md:L7] In this batch no in-scope product target is pinned — E-0001's stage-option work stays #445 and C1 owns docs only — so none of the three worked examples below is promoted; an unpinned mechanism stays a follow-up. [source-traced: C1.md:L4; advisor-answer-4.md:L7,L21; E-0001:L89-91,L162]
|
|
12
|
+
|
|
13
|
+
## Level 3 · conformance design (supporting the Level 2 block)
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
flowchart TD
|
|
17
|
+
IN["Authority + complete consumer list<br/>+ divergence witness (from Level 2)"] --> GATE{"All three named<br/>and a target pinned?"}
|
|
18
|
+
GATE -->|No| FOL["Follow-up only; no test promoted;<br/>no shipped authority claimed"]
|
|
19
|
+
GATE -->|Yes| NORMAL["Feed normal input to every consumer<br/>including unchanged consumers"]
|
|
20
|
+
NORMAL --> STALE["Feed the stale-input witness<br/>to the same consumers"]
|
|
21
|
+
STALE --> CMP["Compare each consumer's decision<br/>with the one authority"]
|
|
22
|
+
CMP --> AGREE{"Every consumer agrees with authority<br/>on normal AND stale input?"}
|
|
23
|
+
AGREE -->|No| RED["Divergence found: fail the conformance test<br/>and keep the decision open"]
|
|
24
|
+
AGREE -->|Yes| SECOND{"Any consumer making the same decision<br/>via a second authority?"}
|
|
25
|
+
SECOND -->|Yes| RED
|
|
26
|
+
SECOND -->|No| GREEN["Conformance test passes for this decision"]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Reading rule:** the test's unit is the *decision across all consumers*, not one site. A consumer that is untouched by the fix but still derives the decision on its own is a valid failure. [source-traced: E-0001:L147,L164-166; E-0007:L114,L116]
|
|
30
|
+
|
|
31
|
+
## Normal vs stale-input outcome comparison (including unchanged consumers)
|
|
32
|
+
|
|
33
|
+
The gate requires comparing **normal** and **stale-input** outcomes **including unchanged consumers**. [source-traced: C1.md:L9; advisor-answer-4.md:L30] Rows below are designed expectations traced to the worked episodes; none is executed in this batch.
|
|
34
|
+
|
|
35
|
+
### Example A — trusted doc-check identity
|
|
36
|
+
|
|
37
|
+
| Consumer | Normal input outcome | Stale-input outcome | Evidence |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| doc-check identity resolver (authority) | one decision via invariant I1 | same decision; stale candidate is rejected by the resolver | [source-traced: E-0001:L39,L45] |
|
|
40
|
+
| `doc-reconciliation-pilot.js` / `doc-reconciliation-provider.js` | agree with I1 | must not fall back to a parser/filter-local identity | [source-traced: E-0001:L7-L8,L143] |
|
|
41
|
+
| `ci/mechanism-397-cycle-import.test.js` (**unchanged consumer**) | agrees with I1 | must still agree though owned by another packet; its omission produced a P2 | [source-traced: E-0001:L18,L100-108,L164-166] |
|
|
42
|
+
|
|
43
|
+
Stale witnesses that must diverge from the authority: a self-authored checker printing passing JSON, and a case-variant invocation dropped from capture while the parser and candidate filter decided differently. [source-traced: E-0001:L33,L37]
|
|
44
|
+
|
|
45
|
+
### Example B — stage-option / version-manifest identity
|
|
46
|
+
|
|
47
|
+
| Consumer | Normal input outcome | Stale-input outcome | Evidence |
|
|
48
|
+
| --- | --- | --- | --- |
|
|
49
|
+
| trained catalog + `manifest.js` (authority) | serves the one stage-option set | same source; no local re-derivation | [source-traced: E-0001:L85-87,L151; E-0007:L97-101] |
|
|
50
|
+
| `package.js` / `install.js` / `provider.js` | read the one source | installer must not reject a producer change (the F4 failure) | [source-traced: E-0001:L79,L151] |
|
|
51
|
+
| `score.py` (**unchanged consumer**) | reads the one source | must not cache a different option set | [source-traced: E-0001:L12,L151] |
|
|
52
|
+
| `system-one-curves.js` | reads the one source | the site F6 missed and R1 found — primary stale divergence witness | [source-traced: E-0001:L83,L151; E-0007:L93-95] |
|
|
53
|
+
|
|
54
|
+
Stale witnesses that must be caught: producer changed while installer expected the old identity (F4); three sites unified while one kept deciding on its own (F6/R1); P2-1 served text differing from trained text. [source-traced: E-0001:L79,L83,L89-91; E-0007:L116]
|
|
55
|
+
|
|
56
|
+
### Example C — pinned target acceptance
|
|
57
|
+
|
|
58
|
+
| Consumer | Normal input outcome | Stale-input outcome | Evidence |
|
|
59
|
+
| --- | --- | --- | --- |
|
|
60
|
+
| exact-spelling recognizer `22dc944a` (authority) | accepts only the exact pinned spelling | rejects symlink and `./`/`..` aliases | [source-traced: E-0007:L73] |
|
|
61
|
+
| capture / all writer surfaces | agree with the recognizer | must not credit the aliases that survived round 1 | [source-traced: E-0007:L67,L71] |
|
|
62
|
+
| `agentResultSurface()` callers (**unchanged consumers**) | all callers use the shared helper | a caller patched outside the inventory is the third-seam failure | [source-traced: E-0007:L80-88] |
|
|
63
|
+
|
|
64
|
+
## Proposed conformance test cases (design only)
|
|
65
|
+
|
|
66
|
+
| Test case | Expected observable result | Evidence / status |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| Normal input, complete consumer list | every consumer's decision equals the authority's | design goal [source-traced: E-0001:L45,L147] |
|
|
69
|
+
| Stale-input witness, unchanged consumers included | every consumer still equals the authority; no local re-derivation | design goal [source-traced: E-0001:L164-166; E-0007:L114] |
|
|
70
|
+
| Second-authority probe | fail if any consumer makes the same decision via a different source | [source-traced: advisor-answer-4.md:L30; E-0007:L116] |
|
|
71
|
+
| Known divergence witness (e.g. `system-one-curves.js`, `./`/`..` alias) | test goes RED on the witness; passes only when the class is fixed at the source | [source-traced: E-0001:L83,L151; E-0007:L71] |
|
|
72
|
+
| Omitted-consumer probe (file owned by another packet / outside the write-set) | consumer is present in the inventory regardless of ownership | [source-traced: E-0001:L100-108,L164-166] |
|
|
73
|
+
| No pinned target / no current witness | no test promoted; result recorded as follow-up | [source-traced: advisor-answer-4.md:L7,L30] |
|
|
74
|
+
|
|
75
|
+
**What is measured after promotion (future, not this batch):** whether every consumer agrees with the authority on normal and stale inputs, whether a second authority is absent, and whether a known divergence witness turns the test RED. A green run proves only this decision's conformance, not substantive correctness of the product path. [source-traced: E-0001:L45; E-0007:L116]
|
|
76
|
+
|
|
77
|
+
## Review blockers (independent review of this design)
|
|
78
|
+
|
|
79
|
+
| Blocker | Rule | Evidence |
|
|
80
|
+
| --- | --- | --- |
|
|
81
|
+
| Omitted consumer | every site making the decision is listed, including unchanged consumers and files owned by other packets | [source-traced: E-0001:L147,L164-166; E-0007:L114] |
|
|
82
|
+
| Multiple authorities | exactly one authority for the named decision; no second source decides the same thing | [source-traced: advisor-answer-4.md:L30; E-0001:L151; E-0007:L116] |
|
|
83
|
+
| Incorrect authority claim | only a pinned, shipped authority may be claimed; no product authority is claimed in this batch | [source-traced: advisor-answer-4.md:L7,L30; E-0001:L162] |
|
|
84
|
+
| Missing known consumer | a named consumer from the worked episodes cannot be absent from the inventory | [source-traced: E-0001:L7-L18; E-0007:L7-L12] |
|
|
85
|
+
| Unpinned mechanism | stays a follow-up, not a promoted test | [source-traced: advisor-answer-4.md:L30] |
|
|
86
|
+
|
|
87
|
+
## E-ids applied and scope
|
|
88
|
+
|
|
89
|
+
- **E-0001** (identity split decision): applied its lesson to inventory every deciding site including unchanged consumers, to trace each to one source of truth, and to keep the #445 stage-option class out of this batch. [source-traced: E-0001:L147,L151,L162]
|
|
90
|
+
- **E-0007** (guard fix by instance): applied its lesson to fix the predicate class rather than one spelling and to require a pre/post caller inventory of any shared helper. [source-traced: E-0007:L108-110,L114,L116]
|
|
91
|
+
- Out-of-slice follow-ups (listed, not fixed): the #445 class fix and its owner go, a concrete in-scope product target with a current divergence witness, and promotion of any design case into an executable conformance test. [source-traced: E-0001:L89-91,L162; advisor-answer-4.md:L7,L21]
|
|
92
|
+
|
|
93
|
+
**Status of this design:** three named worked authorities, complete consumer inventories and divergence witnesses are source-traced here; no test is promoted because no in-scope target is pinned. [source-traced: advisor-answer-4.md:L7,L30; class-common.md:L3]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# C2 — Level 3 test-root containment contract
|
|
2
|
+
|
|
3
|
+
## Decision
|
|
4
|
+
|
|
5
|
+
The cycle-import test's `isOutside(root, candidate, pathApi)` computes `relative = pathApi.relative(root, candidate)`. A candidate is outside when the relative result is absolute, is exactly `..`, or starts with `..` followed by that path API's separator. This recognizes parent escapes without mistaking an in-root name such as `..cache` for a parent segment.
|
|
6
|
+
|
|
7
|
+
On Windows, paths on different drives make `path.win32.relative` return an absolute path. A prefix-only `relative.startsWith('..')` check therefore accepts the cross-drive path as inside. A string-prefix check on the candidate also accepts a sibling such as `D:\repo-other` as inside `D:\repo`.
|
|
8
|
+
|
|
9
|
+
## Deterministic boundary matrix
|
|
10
|
+
|
|
11
|
+
The test uses a GitHub runner-style root; the table abbreviates it to `D:\repo`.
|
|
12
|
+
|
|
13
|
+
| Root | Candidate | Expected `isOutside` | Boundary exercised |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| `D:\repo` | `D:\repo\ci` | `false` | Ordinary root child stays inside. |
|
|
16
|
+
| `D:\repo` | `D:\repo\..cache` | `false` | A child name beginning with two dots is not a parent segment. |
|
|
17
|
+
| `D:\repo` | `D:\repo-other` | `true` | Similar-prefix sibling stays outside; `candidate.startsWith(root)` is insufficient. |
|
|
18
|
+
| `D:\repo` | `D:\` | `true` | Parent escape stays outside. |
|
|
19
|
+
| `D:\repo` | `C:\Users\runner\AppData\Local\Temp\fixture` | `true` | Cross-drive result is absolute; the old prefix-only check misses it. |
|
|
20
|
+
|
|
21
|
+
These Windows cases use `path.win32`, so their semantics are exercised on non-Windows hosts too. The cycle-import fixture continues to check its real temporary directory with the host's default `path` API.
|
|
22
|
+
|
|
23
|
+
## Verification
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
node --test ci/mechanism-397-cycle-import.test.js
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
A passing local test is deterministic mechanism evidence. The test does not establish a hosted Windows run; the repository's Windows CI lane provides that host evidence.
|
|
30
|
+
|
|
31
|
+
## Provenance
|
|
32
|
+
|
|
33
|
+
- [E-0019: Windows cross-drive relative paths](../../../.agents/harness-everything/errors/E-0019-windows-cross-drive-relative-path.md)
|
|
34
|
+
- [C2 action map](../actions/c2-action-map.md)
|
|
35
|
+
- [Cycle-import mechanism test](../../../ci/mechanism-397-cycle-import.test.js)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# C3 Treat — Level 3 mode-ownership contract
|
|
2
|
+
|
|
3
|
+
> C3’s Level 3 detail for #449. Each routing test file owns the System One mode passed to every child process it spawns.
|
|
4
|
+
|
|
5
|
+
## Failure shape
|
|
6
|
+
|
|
7
|
+
`HARNESS_SYSTEM_ONE_MODE=live` inherited from a developer shell reached three direct `kernel-router.js` children in `ci/router-workflow-plan.test.js`: `kernelUnknown`, `kernelIterative`, and `initialRetainedRoute`. They bypassed `runTier`, so the live classifier reference block could change deterministic routing assertions. E-0018 records the inherited-live failure class.
|
|
8
|
+
|
|
9
|
+
## Fixture contract
|
|
10
|
+
|
|
11
|
+
Both files wrap Node’s `spawnSync` at file scope. The wrapper merges the parent environment and any per-child environment, then sets `HARNESS_SYSTEM_ONE_MODE` to `off`. A child opts into live mode only through the wrapper’s separate `systemOneMode: 'live'` option. Adding another `spawnSync` call in either file therefore inherits the same deterministic default.
|
|
12
|
+
|
|
13
|
+
```mermaid
|
|
14
|
+
flowchart LR
|
|
15
|
+
CALL["Any spawnSync call"] --> ENV["File-level environment wrapper"]
|
|
16
|
+
ENV --> DEFAULT["HARNESS_SYSTEM_ONE_MODE=off"]
|
|
17
|
+
ENV -->|"explicit systemOneMode: live"| LIVE["HARNESS_SYSTEM_ONE_MODE=live"]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Child-process inventory
|
|
21
|
+
|
|
22
|
+
Each row names a `spawnSync` source site. `execFileSync` is not used in either file.
|
|
23
|
+
|
|
24
|
+
| File / child | Environment supplied at the call site | Effective System One mode |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| `ci/router-workflow-plan.test.js` — `runTier` | Parent env, optional `options.env`, and `HARNESS_ROUTER_CONTRACT_PATH` | `off`, except the explicit-live control passes `systemOneMode: 'live'` |
|
|
27
|
+
| `ci/router-workflow-plan.test.js` — `kernelUnknown` | No child env supplied; inherits parent env | `off` |
|
|
28
|
+
| `ci/router-workflow-plan.test.js` — `kernelNotificationPersistFailure` | Parent env plus `HARNESS_STATE_HOME` and `HARNESS_WORKSPACE_ROOT` | `off` |
|
|
29
|
+
| `ci/router-workflow-plan.test.js` — `kernelIterative` | No child env supplied; inherits parent env | `off` |
|
|
30
|
+
| `ci/router-workflow-plan.test.js` — `initialRetainedRoute` | `retainedEnv` (parent env plus `HARNESS_STATE_HOME` and `HARNESS_WORKSPACE_ROOT`; regression captures it while parent mode is `live`) | `off` |
|
|
31
|
+
| `ci/router-workflow-plan.test.js` — `sessionPathResult` | `retainedEnv` plus `TEST_SESSION_ID` | `off` |
|
|
32
|
+
| `ci/router-workflow-plan.test.js` — `planCommand` | `retainedEnv` | `off` |
|
|
33
|
+
| `ci/router-workflow-plan.test.js` — `startCommand` | `retainedEnv` | `off` |
|
|
34
|
+
| `ci/router-workflow-plan.test.js` — `reviewCommand` | `retainedEnv` | `off` |
|
|
35
|
+
| `ci/router-workflow-plan.test.js` — `hostNotification` | `retainedEnv` | `off` |
|
|
36
|
+
| `ci/invariant-routing.test.js` — `runKernel` | Parent env | `off`, except the explicit-live control passes `systemOneMode: 'live'` |
|
|
37
|
+
|
|
38
|
+
The invariant-routing file has one `spawnSync` source site, inside `runKernel`; the router-workflow file has ten, including the `runTier` helper. Every child uses the same file-level wrapper.
|
|
39
|
+
|
|
40
|
+
## Regression and controls
|
|
41
|
+
|
|
42
|
+
| Input | Expected result |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| Parent mode is `live`; call `runTier` or default `runKernel` | No `SYSTEM ONE REFERENCE CONFIDENCE` block |
|
|
45
|
+
| Parent mode is `live`; spawn `kernelUnknown`, `kernelIterative`, or `initialRetainedRoute` | No `SYSTEM ONE REFERENCE CONFIDENCE` block |
|
|
46
|
+
| Explicit `systemOneMode: 'live'` control | The child emits the confidence block |
|
|
47
|
+
| `env HARNESS_SYSTEM_ONE_MODE=live npm run test:routing:invariants` | All routing assertions pass, including inherited-live checks |
|
|
48
|
+
| `env -u HARNESS_SYSTEM_ONE_MODE npm run test:routing:invariants` | The same assertions pass without ambient mode |
|
|
49
|
+
|
|
50
|
+
The block check is exercised against a live-mode child before the wrapper fix. A positive explicit-live control ensures the test still reaches live behavior when requested. Package/mechanism evidence is not a live-host result.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# C5 Treat — Level 3 host replay contract
|
|
2
|
+
|
|
3
|
+
> **Level 3 supporting contract for C5** (companion to [actions/c5-action-map.md](../actions/c5-action-map.md) and [Level 1](../README.md) in [#402](https://github.com/dyphn1/Harness-everything/issues/402)). Specifies what the agent should do next time and documents the evidence boundary. This document changes no production code, hooks, tests or ledger state. Per the packet gate: "With evidence missing, document the exact unavailable field or artifact."
|
|
4
|
+
|
|
5
|
+
## Problem to prevent
|
|
6
|
+
|
|
7
|
+
**E-0006** (`live-kit-host-protocol-mismatch`): live-run kits repeatedly mismatched the real host and provider protocol. The #397 episode (2026-11-15) found three host-shape findings — router runtime under Bun, the V2 turn-end event, and the V2 message shape — and its lesson (memory) is: "record one live trace of the real shapes before a fix packet (#397: `session.execution.succeeded`, id at `data.sessionID`, `type`/`content[]`)." That trace was never retained in the packet sources, so the episode stays open (`closed: false`).
|
|
8
|
+
|
|
9
|
+
## Retained payloads in the repo today
|
|
10
|
+
|
|
11
|
+
Searched the three packet-named locations: `benchmarks/results/live-host/`, `ci/*opencode*`, `opencode-plugin/`.
|
|
12
|
+
|
|
13
|
+
| Retained artifact | Provenance | Host / version / date | V2 host payload present? | Missing artifact |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `benchmarks/results/live-host/opencode-2026-09-16/` (`probe-control.md`, `run-commands.md`; under `state/sessions/ses_f5520f1d9ffeB8KLTIUKgA5ng8/`: `circuit-breaker.json`, `edit-state.json`, `compliance.json`, `zoom-out-report.md`) | Retained live-host evidence for the OpenCode enforcement plugin (README: limited mechanism/live-host evidence, post-reset snapshot, no raw transcript) | opencode 1.18.31 / macOS / 2026-09-16 / plugin rev `dc3ea80` (0.5.2) | **No.** V1-era `session.idle`-based evidence; no `session.execution.succeeded`, no `data.sessionID`, no V2 `type`/`content[]` messages. | The E-0006 V2 host payload (`session.execution.succeeded`, id at `data.sessionID`, `type`/`content[]`). |
|
|
16
|
+
| `benchmarks/results/live-host/opencode-2026-11-15-workspace/` (`live-workspace-trace-2026-11-15.jsonl`, `live-workspace-probe.js`, `README.md`) | Workspace-field attribution probe (`setup`/`prompt` events: `sessionID`, `messageID`, `prompt`, `metadata`, `delivery`; `ctx.session.get({sessionID})`) | OpenCode 2.1.4 / macOS / 2026-11-15 | **No.** Same date as #397, but it traces workspace fields, not the V2 turn-end/message shapes. Its README: "It is not a live reproduction of the workspace attribution defect or verification of the fix." | The E-0006 V2 host payload; expected translation; fixture owner. |
|
|
17
|
+
| `ci/mechanism-397-opencode-observations.test.js` (consumer test suite) | #397 mechanism test (fix/397-opencode-router-node); E-0006 O3 input `f7addfc0` resolves the session id from `data.sessionID` | OpenCode V2 consumer | **Partially — synthetic only.** Builds V2 fixtures inline via `v2Event(type, sessionID, data)` = `{id, created, type, durable: true, data: {sessionID, ...data}}` and pushes `session.execution.succeeded` as turn end. These are self-authored deterministic fixtures, not a retained live payload, with no pinned expected-translation fixture and no named fixture owner. | Retained live payload; pinned expected translation; fixture owner. |
|
|
18
|
+
| `opencode-plugin/index.mjs` (V2 default export `setup(ctx)`) | #397 consumer fix: OpenCode 2.x flat events with session id at `data.sessionID`; turn end on `session.idle` or `session.execution.succeeded`; event loop at `raw.sessionID` / `raw.data.sessionID` | OpenCode V2 host contract | **Source only, no payload.** The boundary itself, not evidence of it. | Retained live payload; expected translation; fixture owner. |
|
|
19
|
+
|
|
20
|
+
## Exact consumer test that would host a replay
|
|
21
|
+
|
|
22
|
+
`ci/mechanism-397-opencode-observations.test.js` — the existing OpenCode V2 observation suite. Its `v2Event` helper and `session.execution.succeeded` pushes are the deterministic replay shape: flat `{id, created, type, durable, data}` events with the session id at `data.sessionID`. A replay would feed a retained real payload through this suite's assertions (e.g., the V2 completion and context-message tests around `session.execution.succeeded` / `type`/`content[]`).
|
|
23
|
+
|
|
24
|
+
## Exact missing field or artifact (gate: evidence missing)
|
|
25
|
+
|
|
26
|
+
All three C5 replay prerequisites are unavailable in this repo snapshot:
|
|
27
|
+
|
|
28
|
+
1. **Retained E-0006 host payload:** no retained live trace contains a real V2 `session.execution.succeeded` event with the id at `data.sessionID` and V2 context messages using `type`/`content[]`. E-0006 episode 2 (2026-11-15, #397): "That trace is not a closing review and the packet sources do not re-record it, so the episode stays closed false."
|
|
29
|
+
2. **Expected translation:** no pinned fixture maps a retained V2 payload to the consumer's expected record/assertion fields.
|
|
30
|
+
3. **Fixture owner:** no named owner for a replay fixture; the consumer test exists but no replay harness is wired to it.
|
|
31
|
+
|
|
32
|
+
Review probe areas named by the packet: version/event shape differences (opencode 1.18.31 `session.idle` vs OpenCode 2.1.4 `session.execution.succeeded`), stale session binding (a `data.sessionID` bound to a stale/dropped session), and fake evidence (a synthetic fixture passed off as a retained live trace — a fixture pass proves mechanism behavior only).
|
|
33
|
+
|
|
34
|
+
## Replay contract (preconditions before dispatch)
|
|
35
|
+
|
|
36
|
+
1. A retained payload file under `benchmarks/results/live-host/` (provenance: host, version, date, source revision) containing real V2 events including `session.execution.succeeded` with the id at `data.sessionID`.
|
|
37
|
+
2. A pinned expected translation: assertions mapping those payload fields to the consumer's record format, owned by a named fixture owner (the consumer test's maintainer).
|
|
38
|
+
3. Dispatch: run `ci/mechanism-397-opencode-observations.test.js` against the payload. A deliberately mistranslated event or session ID fails; the correct path passes. A fixture pass proves mechanism behavior only.
|
|
39
|
+
|
|
40
|
+
Until 1–3 exist, this Level 2 map and this contract are the shipped treatment; nothing in `opencode-plugin/`, `ci/`, hooks or the ledger is changed by this slice.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# C6 packet briefing — Level 3 field contract, walkthroughs and review cases
|
|
2
|
+
|
|
3
|
+
> Supporting contract for [C6 — Level 2 Action Map](../actions/c6-action-map.md) and the [C6 briefing template](../templates/packet-briefing.md) ([#402](https://github.com/dyphn1/Harness-everything/issues/402), advisor answer 4 class C6). Concrete inputs, outputs, gates and test cases only; it changes no runtime behavior.
|
|
4
|
+
|
|
5
|
+
## Problem to prevent
|
|
6
|
+
|
|
7
|
+
- **E-0022** (`wrong-episode-rule-briefed`): a coordinator briefing gives a worker an episode/round rule that differs from the errors README, or shared briefing text drifts (stale input SHA, wrong report path; #448 W3 followed the shared common-gates file). Each packet's own input SHA is authoritative over the shared file.
|
|
8
|
+
- **E-0010** (`runtime-provenance-packet-local-reference`): a pin cited only inside a working packet cannot be followed by installed or public consumers; pins cite a durable public reference instead.
|
|
9
|
+
|
|
10
|
+
## Template field contract
|
|
11
|
+
|
|
12
|
+
| Field | Source requirement | Value rule |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| Runner / model / effort | Packet's own execution context | Filled with the runner's own values |
|
|
15
|
+
| Worktree + input SHA | The packet's own worktree at its pinned input SHA | Filled; the shared common-gates SHA is never authoritative |
|
|
16
|
+
| Scope anchor | Verbatim quote with source (issue/PR/comment/owner decision) | Copied verbatim, never paraphrased |
|
|
17
|
+
| Write-set | Paths this packet may touch | Enumerated; "Nothing else" |
|
|
18
|
+
| Gate (dependsOn) | The invocation this gate binds, verbatim | The exact command the worker runs |
|
|
19
|
+
| Verification commands | Commands with expected exit codes | Runnable in this worktree |
|
|
20
|
+
| Error-ledger instruction | Read errors README and every E-*.md first | Name applied E-ids in the report |
|
|
21
|
+
| Report path + report-writer invocation | `write --body-file … --output … --status DONE\|BLOCKED --reason …`, then `check --file …` | The packet's own report path, never another packet's |
|
|
22
|
+
| Terminal STATUS rule | Last line column-zero `STATUS: DONE` / `STATUS: BLOCKED: <reason>`, nothing after | Enforced by report-writer `check` |
|
|
23
|
+
| Real dispatch cite | Added by the coordinator on the next dispatch | `N/A: real dispatch cite added by the coordinator on the next dispatch` until retained |
|
|
24
|
+
|
|
25
|
+
## Walkthrough: one stale shared default through the template
|
|
26
|
+
|
|
27
|
+
**Starting state:** class-common.md pins this slice at input SHA `e1a8f1ca` (branch `feat/402-eh-map`). The shared common-gates background carries a stale SHA (`fbdbf98b`, the W1 writer packet) and a stale report path (`.402-work/W1-report.md`).
|
|
28
|
+
|
|
29
|
+
**Input:** a packet draft that copies the shared file's SHA and report path into its own fields.
|
|
30
|
+
|
|
31
|
+
**Expected:** the packet's own fields win; the stale shared-gates SHA and inherited W1 output path are rejected; ambiguous instruction blocked.
|
|
32
|
+
|
|
33
|
+
**Actual (template applied):** input SHA field = `e1a8f1ca` (packet's own), report path = `.402-work/C6-report.md` (packet's own), gate invocation = this packet's gate commands. The conflicting common-gates SHA and the output path inherited from W1 do not reach the worker.
|
|
34
|
+
|
|
35
|
+
**Review rule applied:** a conflicting common-gates SHA or an output path inherited from a different packet blocks dispatch; a valid packet requiring invented values blocks dispatch.
|
|
36
|
+
|
|
37
|
+
## Walkthrough: one complete packet through the template
|
|
38
|
+
|
|
39
|
+
**Packet:** this C6 packet (`.402-work/C6.md`), worktree `.worktrees/402-c6`, input SHA `e1a8f1ca`.
|
|
40
|
+
|
|
41
|
+
**Gate commands (local slice gates):** `npm run test:consistency`, `npm run test:references`, `npm run test:portability`, plus the walkthroughs above as the slice's focused activity.
|
|
42
|
+
|
|
43
|
+
**Report:** body `.402-work/C6-body.md`; `npm run report -- write --body-file .402-work/C6-body.md --output .402-work/C6-report.md --status DONE`; then `… check --file .402-work/C6-report.md`. Report-bearing packets require the #462 report writer. Pin a runnable `write` and `check` invocation and the packet-owned paths at dispatch. Use `npm run report` where installed, or name the available direct script and its base. If no writer is available, resolve a usable invocation before dispatch or record the report as unresolved at acceptance; never hand-write the terminal STATUS.
|
|
44
|
+
|
|
45
|
+
**Terminal STATUS:** report's last line is exactly one column-zero `STATUS: DONE` (or `STATUS: BLOCKED: <reason>`), nothing after it.
|
|
46
|
+
|
|
47
|
+
**Real dispatch cite:** pending — retained by the coordinator on the next dispatch (`N/A: real dispatch cite added by the coordinator on the next dispatch`).
|
|
48
|
+
|
|
49
|
+
## Review cases (advisor gate, verbatim)
|
|
50
|
+
|
|
51
|
+
| Case | Input | Expected | Verdict rule |
|
|
52
|
+
| --- | --- | --- | --- |
|
|
53
|
+
| Conflicting common-gates SHA | Packet field filled from shared file instead of its own pinned SHA | Block dispatch | Blocks ambiguous instructions reaching dispatch |
|
|
54
|
+
| Output path inherited from another packet | `.402-work/W1-report.md` in a C6 packet | Block dispatch | Blocks a valid packet requiring invented values |
|
|
55
|
+
| Complete packet | All fields filled or `N/A: <reason>`, exact SHA/path/command | Gate passes | Packet briefing accepted |
|
|
56
|
+
|
|
57
|
+
## Evidence applied
|
|
58
|
+
|
|
59
|
+
- E-0010: packet-local provenance references are not durable; cite public issue/PR/comment URLs or repository-relative paths.
|
|
60
|
+
- E-0022: the errors README "Episodes vs rounds" section is the authority; each packet's own input SHA is authoritative over the shared common-gates file; a gate clause binds the exact invocation and verb.
|
|
61
|
+
- Memory witness #448: W3 was misled by packet template drift (common-gates SHA, wrong report path).
|
|
62
|
+
|
|
63
|
+
## Status of this detail
|
|
64
|
+
|
|
65
|
+
Structural contract only; no code, hooks, ledger schema, promotion or training-budget change. Effectiveness requires real dispatch evidence, which the coordinator retains on the next dispatch.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# C7 — Path-level packet write-set check
|
|
2
|
+
|
|
3
|
+
This detail implements the C7 action in [the action map](../actions/c7-action-map.md). It checks whether a candidate slice stayed inside a packet's approved path set, including generated files and uncommitted output.
|
|
4
|
+
|
|
5
|
+
The checker selects the target repository with `git rev-parse --show-toplevel` from its current working directory. Its own file may live in another checkout; reported paths are relative to the selected repository.
|
|
6
|
+
|
|
7
|
+
## Command
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
node scripts/check-packet-write-set.js --base BASE_SHA [--head HEAD_REV] --allow PATH_OR_GLOB... [--allow-file FILE]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
| Option | Contract |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `--base` | Required pinned commit for the candidate comparison. |
|
|
16
|
+
| `--head` | Optional commit or ref; defaults to the selected repository's `HEAD`. |
|
|
17
|
+
| `--allow` | Repeatable repository-relative path or glob. |
|
|
18
|
+
| `--allow-file` | Optional newline-delimited path/glob list, relative to the invocation directory; empty lines are ignored and CRLF is accepted. |
|
|
19
|
+
|
|
20
|
+
At least one `--allow` or a non-empty `--allow-file` is required. Allow-file lines are patterns as written; `#` is not a comment marker. Use `/` between path segments on every platform.
|
|
21
|
+
|
|
22
|
+
Quote glob patterns in shell invocations so the shell passes them to the checker unchanged.
|
|
23
|
+
|
|
24
|
+
## Paths examined
|
|
25
|
+
|
|
26
|
+
```mermaid
|
|
27
|
+
flowchart LR
|
|
28
|
+
TREE["Base-to-head tree diff"] --> UNION["Deduplicate repository-relative paths"]
|
|
29
|
+
MODE{"--head omitted<br/>or resolves to HEAD?"} -->|yes| STAGED["Staged changes against HEAD"]
|
|
30
|
+
MODE -->|yes| UNSTAGED["Unstaged changes"]
|
|
31
|
+
MODE -->|yes| NEW["Non-ignored untracked paths"]
|
|
32
|
+
MODE -->|no| UNION
|
|
33
|
+
STAGED --> UNION
|
|
34
|
+
UNSTAGED --> UNION
|
|
35
|
+
NEW --> UNION
|
|
36
|
+
UNION --> MATCH["Match each path against every allow pattern"]
|
|
37
|
+
MATCH --> OUT["Print one JSON-quoted ALLOWED or OUT_OF_SET line per path"]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
When `--head` is omitted or resolves to the selected repository's current `HEAD`, the checker includes staged, unstaged and non-ignored untracked paths. When `--head` resolves to another commit, it compares only the base-to-head commits, excludes all working-tree changes, and prints `Comparison: commits only (--head is not the current HEAD).`
|
|
41
|
+
|
|
42
|
+
The tree comparisons use `git diff --no-renames`; a move therefore contributes both its old and new path. The staged check also disables rename detection. Ignored untracked files are excluded according to Git's ignore rules. Paths are deduplicated and sorted before output, and JSON quoting keeps spaces, tabs and newlines on one output line.
|
|
43
|
+
|
|
44
|
+
Patterns match the entire Git-style path (slash separators): `*` matches any characters except `/`, `?` matches one character except `/`, and `**` matches across path segments. `**/` also matches zero directory segments. For example, `docs/**` matches `docs/guide.md` but not `docs-extra/guide.md`.
|
|
45
|
+
|
|
46
|
+
## Results and limits
|
|
47
|
+
|
|
48
|
+
| Exit | Meaning |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `0` | Every observed path matched an allow pattern. |
|
|
51
|
+
| `1` | At least one `OUT_OF_SET` path needs disposition. |
|
|
52
|
+
| `2` | Usage, allow-file, revision or Git error; no scope result was established. |
|
|
53
|
+
|
|
54
|
+
The checker reads Git state with optional Git locks disabled; it does not stage, reset, clean, checkout or write repository files. A valid but incorrect base/head can still produce a misleading comparison, so the coordinator supplies the approved pinned revisions. Exit 0 says nothing about changes inside an allowed file: same-file content loss and omissions from an approved outline remain review obligations.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# E-0002 Capture — Level 3 evidence and provenance reference
|
|
2
|
+
|
|
3
|
+
> **Discussion-only / proposed; Level 3 reference.** Child of the [E-0002 Action Map](../actions/e0002-action-map.md) and [Level 1 overview](../README.md) for [#437](https://github.com/dyphn1/Harness-everything/issues/437) / [#402](https://github.com/dyphn1/Harness-everything/issues/402). No change to runtime, hooks, CLI, ledger schema, acceptance policy, or the Level 1 flow.
|
|
4
|
+
>
|
|
5
|
+
> **Action identity:** Capture is the existing A Action from [nodes.yaml](../nodes.yaml); A is a *diagram-local alias*, not a stable identifier. **E-0002 is a worked example, not the identity or mandatory type of this Action.**
|
|
6
|
+
|
|
7
|
+
**Level 3 scope:** This reference explains the evidence/provenance detail for the [E-0002 Level 2 Action Map](../actions/e0002-action-map.md). Capture alone does not solve the error; the actual prevention proposal and CLI contract are in [E · Treat — report writer](./e0002-report-writer.md).
|
|
8
|
+
|
|
9
|
+
## Purpose and boundaries
|
|
10
|
+
|
|
11
|
+
Capture opens **one new Error Occurrence** and records *what was actually observed* with enough provenance for **B · Triage** to examine it. Capture may adapt its evidence-collection steps to the producer, artifact, or a known example such as E-0002. It **does not** decide whether the finding is real, approve a tolerate class, identify the canonical Error Class/signature, choose a disposition, repair an artifact, or declare a check passed.
|
|
12
|
+
|
|
13
|
+
A later recurrence starts a **new** Capture execution. Continuation of a pending occurrence is **not** a new one. The existing Error Ledger ([#359](https://github.com/dyphn1/Harness-everything/issues/359)) remains the system of record for class/episode association *after* Identify; this draft does not create a parallel ledger or allocate persistent IDs.
|
|
14
|
+
|
|
15
|
+
## Level 3 · Capture evidence-detail diagram (supporting the Level 2 Action Map)
|
|
16
|
+
|
|
17
|
+
```mermaid
|
|
18
|
+
flowchart TD
|
|
19
|
+
START((New Error Occurrence)) --> A0["Capture incoming observation<br/>producer / time if known / execution step / artifact reference"]
|
|
20
|
+
A0 --> SRC{"What is the observation source?"}
|
|
21
|
+
|
|
22
|
+
SRC -->|Agent report| AG["Retain report/command reference,<br/>reported failure and observable output"]
|
|
23
|
+
SRC -->|Reviewer finding| RV["Retain review finding,<br/>cited target and reviewer evidence"]
|
|
24
|
+
SRC -->|Later discovery| LT["Retain discovery context,<br/>original artifact and revision if available"]
|
|
25
|
+
|
|
26
|
+
AG --> C1["Gather available original evidence<br/>without editing the source"]
|
|
27
|
+
RV --> C1
|
|
28
|
+
LT --> C1
|
|
29
|
+
C1 --> AV{"Can original evidence be read?"}
|
|
30
|
+
|
|
31
|
+
AV -->|No| MISSING["Record missing/unavailable evidence<br/>and attempted source; do not assume PASS"]
|
|
32
|
+
AV -->|Yes| KIND{"Evidence relates to a report<br/>or final turn output?"}
|
|
33
|
+
KIND -->|No| GENERAL["Preserve relevant raw output and context"]
|
|
34
|
+
KIND -->|Yes| E2["E-0002-style evidence capture:<br/>report file vs final turn vs same artifact;<br/>raw terminal lines and material following STATUS"]
|
|
35
|
+
E2 --> E3["Retain the applicable rule reference,<br/>producer/host, -o usage if known,<br/>and any trailing harness-label observation"]
|
|
36
|
+
E3 --> REC["Describe observed facts only<br/>not an E-0002 classification"]
|
|
37
|
+
GENERAL --> REC
|
|
38
|
+
MISSING --> REC
|
|
39
|
+
|
|
40
|
+
REC --> OUT["Produce occurrence-local observation<br/>facts + evidence refs + unknowns"]
|
|
41
|
+
OUT --> B["Handoff to B · Triage"]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Reading rule:** The E-0002 box is a *conditional example of evidence capture*, not a branch that declares E-0002. Report-related evidence can enter via any of the three source types. Capture records an unreadable artifact as **unknown/unavailable**, never as a compliant report.
|
|
45
|
+
|
|
46
|
+
## E-0002 · Artifact boundary (two outputs are not always the same)
|
|
47
|
+
|
|
48
|
+
The [existing E-0002 ledger record](../../../.agents/harness-everything/errors/E-0002-report-missing-terminal-status.md) describes a report protocol failure: a report must end with a plain column-zero `STATUS: DONE` or `STATUS: BLOCKED: <reason>` line. Some later observations involve a hidden harness-label *after* that line, especially in `codex exec -o` outputs. [ROUTE-001](../../adr/ROUTE-001-error-lesson-delivery.md) distinguishes report-file and turn-message obligations; its proposed report-turn exception is **not yet implemented**.
|
|
49
|
+
|
|
50
|
+
```mermaid
|
|
51
|
+
flowchart TD
|
|
52
|
+
EXEC["Packet / review execution"] --> FILE["Report artifact<br/>file, e.g. -o output"]
|
|
53
|
+
EXEC --> TURN["Turn final message"]
|
|
54
|
+
FILE --> SAME{"Are they the same artifact?"}
|
|
55
|
+
TURN --> SAME
|
|
56
|
+
SAME -->|No| TWO["Capture two separate raw endings:<br/>report file terminal STATUS;<br/>turn message terminal harness-label"]
|
|
57
|
+
SAME -->|Yes| ONE["Capture the single shared ending<br/>and note the report-turn rule conflict<br/>or applicable exception as evidence"]
|
|
58
|
+
TWO --> OBS["Observed bytes / last non-empty line<br/>and rule provenance"]
|
|
59
|
+
ONE --> OBS
|
|
60
|
+
OBS --> TRIAGE["B · Triage examines the finding"]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### E-0002 evidence checklist (example, not a new schema)
|
|
64
|
+
|
|
65
|
+
| Field to observe | Why it matters |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| Observation source, producer, execution/PR/step and time **if known** | Keep actor and provenance; do not invent missing time |
|
|
68
|
+
| Report artifact location/revision and whether its full content was readable | Permit independent review of the original |
|
|
69
|
+
| Report file vs turn message vs shared artifact; host and `-o` use **if known** | Avoid comparing the wrong output against the wrong rule |
|
|
70
|
+
| Exact raw final lines, column-zero STATUS candidate, and any following line/label | Preserve whether a STATUS line was truly terminal; no normalization or silent repair |
|
|
71
|
+
| Applicable packet/report and harness-label rule reference **if known** | Make a possible rule conflict observable without deciding its validity |
|
|
72
|
+
| What is unavailable or ambiguous | Carry uncertainty into Triage instead of promoting it to PASS |
|
|
73
|
+
|
|
74
|
+
**No fields above imply a production schema, a new CLI verb or persistent storage.** An observation may be represented by existing review/task evidence until an owner-approved mechanism exists.
|
|
75
|
+
|
|
76
|
+
## Worked observation cases
|
|
77
|
+
|
|
78
|
+
| Input case | Capture result (facts only) | What Capture must **not** infer |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| Agent report ends with ordinary prose after `STATUS: DONE` | Preserve report tail, report path and producer | Do not auto-classify as E-0002 or edit the file |
|
|
81
|
+
| Reviewer finds `STATUS: DONE` followed by a harness-label in a `-o` file | Capture both raw lines, file/turn identity, review source and relevant rule references | Do not decide whether the reviewer is right or mark verification PASS |
|
|
82
|
+
| Report file ends at STATUS; a **separate** final turn ends with harness-label | Capture each artifact and its distinct ending | Do not assume a violation merely because the turn has a label |
|
|
83
|
+
| Report is also the final turn | Capture one artifact and the applicable/conflicting rule references | Do not assert that the proposed exception was shipped |
|
|
84
|
+
| Report content cannot be read | Record evidence as unavailable and cite the attempted source | Do not fabricate a valid terminal STATUS |
|
|
85
|
+
| A similar failure is discovered in a later PR | Start a new occurrence with its own evidence | Do not jump from G to D or reuse an occurrence implicitly |
|
|
86
|
+
|
|
87
|
+
## Handoff and discussion acceptance
|
|
88
|
+
|
|
89
|
+
**Output:** one occurrence-local observation of what happened, with source/provenance, accessible raw evidence, unavailable evidence, and the active execution context needed by **B · Triage**. The source facts are not a verdict. **Next:** B decides approved-tolerate handling and whether a finding is real; **C · Identify** later maps the observation to an existing class/signature or proposes a new class.
|
|
90
|
+
|
|
91
|
+
A useful first-level review asks: (1) can a reviewer distinguish *report file* from *turn message*? (2) can the finding be independently checked without modifying evidence? (3) does a later recurrence start at Capture? (4) are missing facts left explicit? (5) can B make a decision without Capture pre-classifying E-0002?
|
|
92
|
+
|
|
93
|
+
**Out of scope for this draft:** code changes; E-0002 repair; automatic status inspection or enforcement; new CLI/state transitions; defining all specialized Capture paths; editing the historical blind-evaluation stimuli.
|