harness-everything 0.53.0 → 0.54.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +3 -1
- package/CHANGELOG.md +18 -0
- package/bin/cli.js +1 -0
- package/ci/invariant-routing.test.js +22 -3
- package/ci/mechanism-2al-codex-hooks-compat.test.js +56 -2
- 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-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/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 +3 -1
- package/hooks/scripts/codex-user-prompt.js +2 -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/scripts/codex-user-prompt.js +2 -3
- package/plugins/harness-everything/plugin.json +1 -1
- 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,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.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# E-0002 Treat — Level 3 report-writer contract and test cases
|
|
2
|
+
|
|
3
|
+
> **Proposed design / Level 3 supporting contract, NOT an implemented CLI.** Companion to the [E-0002 Level 2 Action Map](../actions/e0002-action-map.md) and [Level 1](../README.md) in [#437](https://github.com/dyphn1/Harness-everything/issues/437) and the Error Handling subtree [#402](https://github.com/dyphn1/Harness-everything/issues/402). This specifies **what the agent should do next time** and **which mechanical operation should prevent a repeat**. The proposed commands below do not exist yet; this document does not change production hooks, report rules or ledger state.
|
|
4
|
+
|
|
5
|
+
## Problem to prevent
|
|
6
|
+
|
|
7
|
+
**E-0002** (`report-protocol`) recurs when a report lacks its required **raw, column-zero, terminal** `STATUS: DONE` or `STATUS: BLOCKED: <reason>` line, or when a harness-label appears after it. Some failures happen in `codex exec -o` outputs where the report is also the final turn text. Previous instructions and reminders were not enough: the next agent can make the same mistake again.
|
|
8
|
+
|
|
9
|
+
**Treatment direction (proposal):** stop using free-form report editing for the terminal protocol. The **agent supplies report content and an evidence-grounded status**, while one **scoped CLI/script writes and verifies the final report file**. Preserve free-form content authoring; restrict only the structured output operation. Do not add a global document governor, second Error Ledger, automatic report generation for unrelated tasks, or a count-driven lock.
|
|
10
|
+
|
|
11
|
+
**Action ownership:** A Capture records facts; B Triage and C Identify establish the case; D Decide chooses treatment. **E Treat defines/applies the mechanical report-writing method**; F Deliver gives the agent a concise instruction and the available CLI; G Accept checks its result. This is an **E-0002-specific Action detail**, not a second Level 1 flow or a claim that all classes have the same treatment.
|
|
12
|
+
|
|
13
|
+
## Level 3 · Script-mediated operation (supporting the Level 2 block)
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
flowchart TD
|
|
17
|
+
INPUT["D · Decide: valid selected disposition"] --> NEED{"Report-writing operation required?"}
|
|
18
|
+
NEED -->|No| OTHER["Perform only the selected applicable operation<br/>no automatic report requirement"]
|
|
19
|
+
NEED -->|Yes| AUTHOR["Agent supplies true task outcome and report body<br/>DONE / BLOCKED with reason"]
|
|
20
|
+
AUTHOR --> SOURCE{"Source of content?"}
|
|
21
|
+
SOURCE -->|"Ordinary body file"| STAGE["Provide body file to script"]
|
|
22
|
+
SOURCE -->|"codex exec -o"| RAW["Host -o writes raw output to staging input<br/>never finalized as the report directly"]
|
|
23
|
+
RAW --> EXTRACT["Script applies specified host-aware<br/>extraction/validation of raw output"]
|
|
24
|
+
EXTRACT --> STAGE
|
|
25
|
+
STAGE --> WRITE["Script writes terminal STATUS atomically<br/>then reads and checks finished artifact"]
|
|
26
|
+
WRITE --> RC{"Exit code 0?"}
|
|
27
|
+
RC -->|No| ERR["Return code + unmet condition;<br/>agent corrects inside Treat or records unresolved"]
|
|
28
|
+
ERR -->|"correctable"| AUTHOR
|
|
29
|
+
ERR -->|"not satisfied"| F
|
|
30
|
+
RC -->|Yes| F["F · Deliver actual result / usable guidance"]
|
|
31
|
+
OTHER --> F
|
|
32
|
+
F --> G["G · Accept against applicable contract<br/>and separate task evidence"]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The E-0002 report script is **proposed, not deployed**. The Agent determines outcome; a mechanical script owns report assembly, validation and useful errors. The response block may choose a fitting operation without creating a new Level 1 branch. A failed script result does **not** bypass F/G or count as a successful report; unresolved evidence is delivered and the occurrence remains open.
|
|
36
|
+
|
|
37
|
+
## Agent-facing procedure — proposed operational contract
|
|
38
|
+
|
|
39
|
+
For a step **explicitly required to produce a report**:
|
|
40
|
+
|
|
41
|
+
1. **Perform the work and collect evidence.** The agent must decide the true task/packet status based on observed results. `DONE` is not inferred by the CLI from a successful invocation; `BLOCKED` requires an actual reason. A completed RED experiment is not automatically product GREEN.
|
|
42
|
+
2. **Prepare only the free-form body** in a staging file. Do not add a terminal STATUS line or a harness-label to that body. If the host's `-o` captures the turn's final text, treat it as **script input / raw staging output**, not the finished report.
|
|
43
|
+
3. **Call the report writer** with the body path, final output path, and explicit status; the writer adds exactly one terminal STATUS line and writes the complete report atomically.
|
|
44
|
+
4. **Check the written file**, not merely the CLI stdout, and retain the result as evidence. Do not append to the finalized report; to revise, change the body and call the writer again.
|
|
45
|
+
5. **Return the report reference and verified result** to the caller. A separate final turn keeps its own applicable host label contract. For any shared raw `-o` output, the **script** must apply an explicit host-aware extraction contract before writing the final report; return nonzero with raw evidence if it cannot do so. Do not silently strip arbitrary metadata or declare a contract exception deployed.
|
|
46
|
+
|
|
47
|
+
### Proposed command interface — design examples, NOT currently executable
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Positive result: content is provided by the agent; STATUS is written by the tool
|
|
51
|
+
harness report write --body-file work/report-body.md --output reports/review.md --status DONE
|
|
52
|
+
harness report check --file reports/review.md
|
|
53
|
+
|
|
54
|
+
# Blocked result: same writer; explicit failure reason is required
|
|
55
|
+
harness report write --body-file work/report-body.md --output reports/review.md --status BLOCKED --reason "required verification unavailable"
|
|
56
|
+
harness report check --file reports/review.md
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
These are **candidate CLI verbs**, not a mandate to create a global `harness` binary. A small repository-local Node.js script with equivalent `write` / `check` operations is sufficient for the first vertical slice. The agent-facing instruction should reference the **actual installed command and version**, not copy these placeholders as if working already.
|
|
60
|
+
|
|
61
|
+
### Minimal writer and checker contract
|
|
62
|
+
|
|
63
|
+
| Responsibility | Expected behavior |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `write` input | Existing body file, designated report output path, explicit `DONE` / `BLOCKED`, mandatory non-empty reason for `BLOCKED` |
|
|
66
|
+
| `write` output | Preserve body content, add a single newline-separated terminal control line at **column zero**, write atomically, fail without corrupting the previous target |
|
|
67
|
+
| Structural validation | On the finished output, check exactly one terminal protocol line, nothing after it (including hidden label), and read-back matches what was written |
|
|
68
|
+
| Containing structured fields | Reject conflicting column-zero terminal STATUS lines and harness-label metadata in the submitted body; make the conflict explicit rather than silently discarding unknown content |
|
|
69
|
+
| Artifact roles | `codex exec -o` writes raw output as **script input**; the script converts and verifies the designated final report according to a host-aware contract. If ambiguous, return nonzero; no hidden manual rewrite |
|
|
70
|
+
| Failure outcome | Nonzero exit + actionable diagnostics; Agent may revise within Treat or deliver outstanding evidence via F/G; no automatic `DONE`, preserve prior target and raw source |
|
|
71
|
+
| Scope | Operate on explicitly designated report output only; do not rewrite unrelated files, judge semantic success, touch the Ledger, or automatically change permissions |
|
|
72
|
+
| Revision | Re-run `write` using the edited body + true status; never mutate the terminal report with ordinary append commands |
|
|
73
|
+
|
|
74
|
+
**Design constraint:** `-o` must be handled as script-mediated output. Parsing host metadata is a deterministic responsibility of the proposed script under a defined contract. If the script cannot distinguish required protocol from host-owned label safely, **return nonzero** with the original raw output and let the Agent handle that result; do not imply an unimplemented exception has shipped.
|
|
75
|
+
|
|
76
|
+
## Interaction with other Actions and existing facilities
|
|
77
|
+
|
|
78
|
+
```mermaid
|
|
79
|
+
flowchart LR
|
|
80
|
+
A["A–C · ASSESS<br/>observed/identified error"] --> D["D · Decide<br/>selected, validated disposition"]
|
|
81
|
+
D --> E["E · Treat<br/>agent uses script and return codes"]
|
|
82
|
+
E --> F["F · Deliver<br/>selected operation + result or failure"]
|
|
83
|
+
F --> G["G · Accept<br/>mechanical check + substantive evidence"]
|
|
84
|
+
F -. "reusable capability, not a flow edge" .-> HOOK["Later relevant Hook / Skill disclosure"]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The future Hook/Skill reference is **not** a G feedback/recurrence edge, nor does F make future tasks part of this same Error Occurrence. A new recurrence starts as a **new Capture**; a correction after nonzero exit remains within the current local Action block when permitted.
|
|
88
|
+
|
|
89
|
+
- **#359:** existing E-0002 Ledger remains class/history authority; do not create a second database.
|
|
90
|
+
- **#394 / ROUTE-001:** Hook provides the **available command only when relevant**; it does not enforce task success or select the disposition. A retired lesson reminder does not remove still-needed operational instructions.
|
|
91
|
+
- **#437:** scoped CLI/script is a proposed deterministic validator, **not** a mandatory global document controller. Validation failures are returned for Agent handling, not converted to hidden branching rules.
|
|
92
|
+
- **Decide/Accept:** when a machine-checkable condition or approval is not met, the script returns nonzero with the unmet requirement. The Agent can revise appropriately or preserve unresolved status. Owner authorization cannot be fabricated by a script, and a zero script exit code never proves substantive task correctness.
|
|
93
|
+
|
|
94
|
+
## Proposed acceptance before implementation
|
|
95
|
+
|
|
96
|
+
| Test case | Expected observable result |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| Valid body + DONE | Final file ends in exactly `STATUS: DONE`; CLI `check` passes |
|
|
99
|
+
| Valid body + BLOCKED + reason | Final file ends in `STATUS: BLOCKED: <reason>`; check passes |
|
|
100
|
+
| BLOCKED without reason | Write rejected; existing report left untouched |
|
|
101
|
+
| Body contains conflicting terminal STATUS or harness-label | Write rejected with useful explanation, no silent normalization |
|
|
102
|
+
| Agent revises body after earlier report | A new `write` replaces the report atomically; one terminal STATUS remains |
|
|
103
|
+
| `codex exec -o` emits trailing harness-label | Raw `-o` is routed **through the script** to produce/check the final report; script returns nonzero on unsafe/ambiguous transformation |
|
|
104
|
+
| Tool unavailable, bad path or read-back fails | Return nonzero with reason; Agent handles correction or delivers UNVERIFIED/unresolved result via F/G; raw evidence retained |
|
|
105
|
+
| Report not required | No invocation, no forced report |
|
|
106
|
+
| Writer produces compliant format but underlying result is wrong | Structural PASS only; review/behavior acceptance stays separate |
|
|
107
|
+
|
|
108
|
+
**What to measure:** E-0002 recurrence in later **real report-writing tasks**, whether the agent actually invoked the designated writer, structural violations after invocation, and elapsed/tool/review cost relative to hand-writing. Do not declare E-0002 rooted out merely because a diagram or a one-off check exists.
|
|
109
|
+
|
|
110
|
+
## Owner discussion items
|
|
111
|
+
|
|
112
|
+
1. Should the first implementation be a small Node.js `report write/check` script under the existing repository, rather than a new global CLI? **Recommended: yes.**
|
|
113
|
+
2. For `codex exec -o`, route raw output to a **script**, and let the script generate/check the final report. No manual coordinator rewrite or output-contract exception is assumed.
|
|
114
|
+
3. Define the **script's host-aware input/output and extraction contract** for shared `-o` artifacts; ambiguous input returns nonzero, not guessed normalization.
|
|
115
|
+
|
|
116
|
+
This design leaves A Capture focused on facts and E Treat on the executable operation: the next agent receives a repeatable action, **validated return codes**, and a way to handle a failed condition, not merely an explanation of the last mistake.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Canonical Action identity source for the Error Handling map (#437 concept, #402 implementation).
|
|
2
|
+
# A-G are drawing-local aliases, NOT identity or ordered numbering.
|
|
3
|
+
# IDs use creation category/date/UUIDv4 and never change. Names can change independently.
|
|
4
|
+
# status: proposed | accepted | retired.
|
|
5
|
+
# links: Action-to-Action control flow of View 1 in README.md, where the path between the two
|
|
6
|
+
# Actions passes only through non-Action nodes (decisions, outcomes). Checked against the diagram.
|
|
7
|
+
schema: concept-v0
|
|
8
|
+
scope: error-handling
|
|
9
|
+
actions:
|
|
10
|
+
A:
|
|
11
|
+
identifier: ERR-20261112-a82f647f-c0b1-4c6c-b90b-fb2221fe66bd
|
|
12
|
+
name: Capture
|
|
13
|
+
status: proposed
|
|
14
|
+
B:
|
|
15
|
+
identifier: ERR-20261112-da72e7fa-a37c-48ab-81b9-a678673a7324
|
|
16
|
+
name: Triage
|
|
17
|
+
status: proposed
|
|
18
|
+
C:
|
|
19
|
+
identifier: ERR-20261112-ffbb1b17-edb3-4adb-92ff-df76ad8f101c
|
|
20
|
+
name: Identify
|
|
21
|
+
status: proposed
|
|
22
|
+
D:
|
|
23
|
+
identifier: ERR-20261112-cd6a0fd5-d354-4bcb-8d34-71fcc985e5e4
|
|
24
|
+
name: Decide disposition
|
|
25
|
+
status: proposed
|
|
26
|
+
E:
|
|
27
|
+
identifier: ERR-20261112-5349acf0-f23f-43dc-9a7b-c0ae49dbcfc9
|
|
28
|
+
name: Treat
|
|
29
|
+
status: proposed
|
|
30
|
+
F:
|
|
31
|
+
identifier: ERR-20261112-a1617b0f-e5a7-4d3d-8926-40cda9953b6a
|
|
32
|
+
name: Deliver relevant context
|
|
33
|
+
status: proposed
|
|
34
|
+
G:
|
|
35
|
+
identifier: ERR-20261112-5f7496e6-5e1a-4628-b818-5292dd011580
|
|
36
|
+
name: Accept and retire
|
|
37
|
+
status: proposed
|
|
38
|
+
links:
|
|
39
|
+
- { from: A, to: B }
|
|
40
|
+
- { from: B, to: C }
|
|
41
|
+
- { from: C, to: D }
|
|
42
|
+
- { from: D, to: E }
|
|
43
|
+
- { from: E, to: F }
|
|
44
|
+
- { from: F, to: G }
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Error Handling — lightweight layer registry (discussion prototype)
|
|
2
|
+
|
|
3
|
+
> **P2-2 decision for #437:** use a small registry that maps existing nodes, documents, and layer references **table to table**. This is a document lookup, not a workflow engine or a second graph. No runtime loader, CLI, enforcement, schema migration, or generated document pipeline is introduced here.
|
|
4
|
+
>
|
|
5
|
+
> **P2-1 intentionally unchanged:** whether agents confuse View and Level is **not an established defect**. The owner will validate it experimentally. Do not preemptively relabel or rewrite the previously tested Level 1 diagrams to address an unproven issue.
|
|
6
|
+
|
|
7
|
+
## Identity source — reuse the existing Action table
|
|
8
|
+
|
|
9
|
+
The [Action identity registry](./nodes.yaml) is the only proposed source for the seven existing Action identities. Their UUIDs and names are **not copied into this file**, so edits to Action identity do not require changing two registries. A–G are drawing-local aliases, never global identifiers.
|
|
10
|
+
|
|
11
|
+
## Table A — document registry (where to look)
|
|
12
|
+
|
|
13
|
+
| Local reference | Layer / role | Document | Purpose |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| `EH-overview` | Level 1 · process / three Views | [README.md](./README.md) | The canonical error-occurrence lifecycle, branches, guards and Action relationships |
|
|
16
|
+
| `EH-activity-source` | Level 1 · diagram representation | [activity.puml](./activity.puml) | UML activity representation of the **same** Level 1 route; not an independent controller |
|
|
17
|
+
| `E0002-actions` | Level 2 · context-specific behavior blocks | [actions/e0002-action-map.md](./actions/e0002-action-map.md) | E-0002 lens over ASSESS / RESPOND; what the Agent should do |
|
|
18
|
+
| `E0002-capture` | Level 3 · evidence reference | [details/e0002-capture-evidence.md](./details/e0002-capture-evidence.md) | Source and artifact preservation details, read only if relevant |
|
|
19
|
+
| `E0002-writer` | Level 3 · Script/CLI reference | [details/e0002-report-writer.md](./details/e0002-report-writer.md) | `-o` handling, input/output, return codes and mechanical checks; shipped as `scripts/report-writer.js` (`npm run report`, #462) |
|
|
20
|
+
| `E0002-ledger` | Existing external source · error history | [E-0002 ledger](../../.agents/harness-everything/errors/E-0002-report-missing-terminal-status.md) | Existing class/signature and history, **not** a new Level 3 state store |
|
|
21
|
+
| `C1-actions` | Level 2 · C1 split decision | [actions/c1-action-map.md](./actions/c1-action-map.md) | One authority per named decision; consumer inventory |
|
|
22
|
+
| `C1-detail` | Level 3 · C1 conformance design | [details/c1-authority-conformance.md](./details/c1-authority-conformance.md) | Conformance-test design; mechanism stays a follow-up until a target is pinned |
|
|
23
|
+
| `C2-actions` | Level 2 · C2 test oracle | [actions/c2-action-map.md](./actions/c2-action-map.md) | Test-root containment on Unix and Windows |
|
|
24
|
+
| `C2-detail` | Level 3 · C2 path predicate | [details/c2-test-root-containment.md](./details/c2-test-root-containment.md) | Predicate and matrix in `ci/mechanism-397-cycle-import.test.js` |
|
|
25
|
+
| `C3-actions` | Level 2 · C3 machine state | [actions/c3-action-map.md](./actions/c3-action-map.md) | Routing tests own their System One mode |
|
|
26
|
+
| `C3-detail` | Level 3 · C3 mode ownership | [details/c3-mode-ownership.md](./details/c3-mode-ownership.md) | Env builder in the routing fixtures (#449) |
|
|
27
|
+
| `C5-actions` | Level 2 · C5 host protocol | [actions/c5-action-map.md](./actions/c5-action-map.md) | Pin one host protocol at its real boundary |
|
|
28
|
+
| `C5-detail` | Level 3 · C5 replay contract | [details/c5-host-replay-contract.md](./details/c5-host-replay-contract.md) | Replay contract and the missing retained payload |
|
|
29
|
+
| `C6-actions` | Level 2 · C6 briefing | [actions/c6-action-map.md](./actions/c6-action-map.md) | A packet carries its own authoritative values |
|
|
30
|
+
| `C6-detail` | Level 3 · C6 briefing walkthrough | [details/c6-packet-briefing.md](./details/c6-packet-briefing.md) | Walkthroughs and the report-writer dependency |
|
|
31
|
+
| `C6-template` | Template · packet briefing | [templates/packet-briefing.md](./templates/packet-briefing.md) | Copy per packet; every field filled or `N/A: <reason>` |
|
|
32
|
+
| `C7-actions` | Level 2 · C7 write-set | [actions/c7-action-map.md](./actions/c7-action-map.md) | Did the slice stay inside its write-set |
|
|
33
|
+
| `C7-detail` | Level 3 · C7 checker | [details/c7-write-set-check.md](./details/c7-write-set-check.md) | `scripts/check-packet-write-set.js`, run by the coordinator before accepting a slice |
|
|
34
|
+
|
|
35
|
+
`Local reference` values are **table-local lookup keys only**, not new stable Action IDs, graph node identities, persistent state, or workflow instructions.
|
|
36
|
+
|
|
37
|
+
## Table B — relationship registry (when to follow a reference)
|
|
38
|
+
|
|
39
|
+
| From | To | Relation / relevance | Expected reading behavior |
|
|
40
|
+
| --- | --- | --- | --- |
|
|
41
|
+
| `EH-overview` | `EH-activity-source` | Same Level 1 representation | Open when UML source/notation is needed; not a new Level |
|
|
42
|
+
| `EH-overview` | `E0002-actions` | Context-specific expansion: **E-0002** | Open when handling this Error Class/context, rather than loading all Action Maps |
|
|
43
|
+
| `E0002-actions` | `E0002-capture` | Detail supporting Capture / evidence | Read when raw evidence/provenance is required |
|
|
44
|
+
| `E0002-actions` | `E0002-writer` | Detail supporting Treat / Report CLI | Read when producing or validating a report through the proposed script |
|
|
45
|
+
| `E0002-actions` | `E0002-ledger` | Existing class evidence / history | Read for Identify/history relevance; do not copy or reclassify the ledger |
|
|
46
|
+
|
|
47
|
+
**Maintenance contract (lightweight):** when a document moves, update its **Table A path**; Table B continues to refer to the same local key. When a new Level 2 behavior block or Level 3 reference is added, add only the relevant row and reference. Removing an obsolete procedure removes its registry relationship without rewriting Level 1. **Do not re-encode Mermaid/PlantUML execution arrows as registry edges**: the source diagrams own flow semantics, while the tables own *navigation/lookup*.
|
|
48
|
+
|
|
49
|
+
## P2-3 — no mandatory input/output contract for every Action
|
|
50
|
+
|
|
51
|
+
**Action / behavior block:** expresses the relevant behavior and keeps the Agent free to select appropriate means; no universal form of `input`, `output`, `precondition`, `postcondition` or handoff schema is imposed. Required lifecycle gates already belong to Level 1.
|
|
52
|
+
|
|
53
|
+
**Concrete technical boundary (Script, CLI, API, structured output):** document machine-checkable inputs/outputs, return code, errors, and any necessary validation in **the relevant Level 3 contract**. For E-0002, [Report Writer](./details/e0002-report-writer.md) already serves this purpose. A script can reject invalid data; it cannot fabricate approvals or declare the whole task done.
|
|
54
|
+
|
|
55
|
+
## State of validation
|
|
56
|
+
|
|
57
|
+
- The owner will run **View vs Level comprehension tests**; P2-1 is **not** a presumed flaw or a reason to modify diagram text now.
|
|
58
|
+
- This registry is a **minimal design mapping** only. It has not been proven to improve Agent comprehension, navigation cost or runtime recurrence.
|
|
59
|
+
- Effectiveness and cost evaluation of Error Handling still requires complete Error Handling + Script + Hook/Skill integration, followed by real execution evidence.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# C6 packet briefing template (rev 1)
|
|
2
|
+
|
|
3
|
+
Copy this file per packet. **Every field is either filled with this packet's own authoritative value or `N/A: <reason>`.** Shared defaults (class-common.md, shared gates files) supply background only; they are never authoritative for this packet.
|
|
4
|
+
|
|
5
|
+
## Runner / model / effort
|
|
6
|
+
runner: <e.g. one-shot `codex exec` (model, effort), `-s workspace-write`>
|
|
7
|
+
model: <model>
|
|
8
|
+
effort: <reasoning effort>
|
|
9
|
+
|
|
10
|
+
## Worktree and input SHA
|
|
11
|
+
worktree: <cwd / path of this packet's own worktree>
|
|
12
|
+
input SHA: <pinned input SHA of this packet>
|
|
13
|
+
`N/A:` only if the packet performs no worktree-bound execution; state the reason.
|
|
14
|
+
|
|
15
|
+
## Scope anchor (verbatim with source)
|
|
16
|
+
- Owner <id> (date): "<verbatim quote>" — source: <issue / PR / comment / owner decision>
|
|
17
|
+
- <additional source>: "<verbatim quote>" — source: <…>
|
|
18
|
+
|
|
19
|
+
## Write-set
|
|
20
|
+
- <path> — <new / modify / read-only>
|
|
21
|
+
- …
|
|
22
|
+
Nothing else. Do not edit files outside the write-set.
|
|
23
|
+
|
|
24
|
+
## Gate (dependsOn)
|
|
25
|
+
<verbatim gate clause or command this packet binds>
|
|
26
|
+
Depends on: <previous packets / steps, or none>
|
|
27
|
+
|
|
28
|
+
## Verification commands
|
|
29
|
+
<commands to run, each with its expected exit code>
|
|
30
|
+
|
|
31
|
+
## Error ledger
|
|
32
|
+
Read `.agents/harness-everything/errors/README.md` and every `E-*.md` before starting. Name the applied E-ids in the report.
|
|
33
|
+
|
|
34
|
+
## Report path and report-writer invocation
|
|
35
|
+
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.
|
|
36
|
+
Body in `.402-work/<ID>-body.md`, then:
|
|
37
|
+
`npm run report -- write --body-file .402-work/<ID>-body.md --output .402-work/<ID>-report.md --status DONE` (or `--status BLOCKED --reason "<why>"`), then:
|
|
38
|
+
`npm run report -- check --file .402-work/<ID>-report.md`.
|
|
39
|
+
Sections: files changed; RED/walkthrough evidence; GREEN; gates with exit codes; E-ids; open questions / follow-ups (out-of-slice → listed, not fixed).
|
|
40
|
+
|
|
41
|
+
## Terminal STATUS rule
|
|
42
|
+
The report's last line is exactly one column-zero `STATUS: DONE` or `STATUS: BLOCKED: <reason>`; nothing after it.
|
|
43
|
+
|
|
44
|
+
## Real dispatch cite
|
|
45
|
+
`N/A: real dispatch cite added by the coordinator on the next dispatch.` — retained by the coordinator when this packet is dispatched for real.
|
|
@@ -142,7 +142,9 @@ Updates retain at most two fingerprinted runtimes: the current runtime and the i
|
|
|
142
142
|
|
|
143
143
|
Installs of a plugin source tracked by a linked Git worktree refuse before writing. For an ordinary checkout, only modified or untracked files inside the plugin source subtree cause refusal. The runtime is built from the subtree's Git-tracked files, so `.gitignore`-excluded files (for example `.DS_Store` or `__pycache__`) are neither copied nor fingerprinted and do not block installation. The operator can explicitly pass `--allow-unreleased-source`. Packaged copies whose plugin manifest is not tracked by an enclosing repository remain supported, including copies inside an unrelated dirty repository. The mechanism and self-regression runners give child processes temporary HOME/USERPROFILE and CODEX_HOME directories. Tests must pass temporary Codex homes or mock the hook installer; mocking host commands alone does not isolate filesystem writes.
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
By default, update and uninstall remove only exact entries recorded in the Harness compatibility manifest. If an installed Harness entry was edited after installation, restore it before retrying. These operations preserve other user hooks.
|
|
146
|
+
|
|
147
|
+
For #457, `harness codex-hooks status` lists candidate `legacyTierRouterHooks` in the Codex user hooks file, even before compatibility hooks are installed. After reviewing the list, run `harness codex-hooks install --remove-legacy-tier-router` to remove direct Node invocations of the npx-cached Harness `tier-router.js` from `UserPromptSubmit` and install or refresh the JSON adapter in the same operation. Other handlers in the same hook group are preserved. Ordinary installs and automatic plugin sync preserve these unmanaged entries. Review the resulting hook sources and trust in Codex with `/hooks`.
|
|
146
148
|
|
|
147
149
|
The compatibility path registers hook commands in Codex user configuration and covers the missing plugin-mount route where user hooks dispatch. It does not repair a Codex carrier that fails to dispatch `PreToolUse` at all; those host-level execution-path limitations remain a live compatibility boundary.
|
|
148
150
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
// Codex UserPromptSubmit adapter (docs/system-one-observations.md#hosts).
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// reaches the model. This runs the kernel router and wraps its output.
|
|
4
|
+
// Wrap router output in JSON hookSpecificOutput.additionalContext. Codex
|
|
5
|
+
// treats stdout beginning with "[" (including routing banners) as JSON-like.
|
|
7
6
|
|
|
8
7
|
const fs = require('fs');
|
|
9
8
|
const path = require('path');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harness-everything",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Harness OS: An Orchestrated Agent Operating System for AI-driven Development",
|
|
5
5
|
"main": "harness-everything/scripts/bootstrap.js",
|
|
6
6
|
"bin": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"repo:contract": "node scripts/repository-contract.js",
|
|
19
19
|
"docs:sync": "node scripts/sync-current-docs.js",
|
|
20
20
|
"errors:sync": "node scripts/errors-sync.js",
|
|
21
|
+
"report": "node scripts/report-writer.js",
|
|
21
22
|
"test:repo-contract": "node ci/repository-contract.test.js",
|
|
22
23
|
"test:consistency": "node ci/consistency-check.js && node ci/doc-capability-consistency.test.js && node ci/repository-contract.test.js && node ci/mechanism-2ao-plugin-sync.test.js && node ci/prompt-contract-regressions.test.js",
|
|
23
24
|
"test:docs:capabilities": "node ci/doc-capability-consistency.test.js",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
// Codex UserPromptSubmit adapter (docs/system-one-observations.md#hosts).
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// reaches the model. This runs the kernel router and wraps its output.
|
|
4
|
+
// Wrap router output in JSON hookSpecificOutput.additionalContext. Codex
|
|
5
|
+
// treats stdout beginning with "[" (including routing banners) as JSON-like.
|
|
7
6
|
|
|
8
7
|
const fs = require('fs');
|
|
9
8
|
const path = require('path');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "harness-everything",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.54.0",
|
|
5
5
|
"description": "Invariant-first engineering harness for routing, verification, and failure recovery while preserving agent autonomy.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Miya Daniel",
|
package/sbom.cdx.json
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
"$schema": "https://cyclonedx.org/schema/bom-1.7.schema.json",
|
|
3
3
|
"bomFormat": "CycloneDX",
|
|
4
4
|
"specVersion": "1.7",
|
|
5
|
-
"serialNumber": "urn:uuid:
|
|
5
|
+
"serialNumber": "urn:uuid:b02b30cc-bd77-5327-8115-742afb9149ff",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-11-
|
|
8
|
+
"timestamp": "2026-11-19T05:40:53.563Z",
|
|
9
9
|
"tools": [
|
|
10
10
|
{
|
|
11
11
|
"vendor": "Harness Everything",
|
|
12
12
|
"name": "generate-sbom.js",
|
|
13
|
-
"version": "0.
|
|
13
|
+
"version": "0.54.0"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "application",
|
|
18
|
-
"bom-ref": "pkg:npm/harness-everything@0.
|
|
18
|
+
"bom-ref": "pkg:npm/harness-everything@0.54.0",
|
|
19
19
|
"name": "harness-everything",
|
|
20
|
-
"version": "0.
|
|
21
|
-
"purl": "pkg:npm/harness-everything@0.
|
|
20
|
+
"version": "0.54.0",
|
|
21
|
+
"purl": "pkg:npm/harness-everything@0.54.0"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
@@ -2033,7 +2033,7 @@
|
|
|
2033
2033
|
]
|
|
2034
2034
|
},
|
|
2035
2035
|
{
|
|
2036
|
-
"ref": "pkg:npm/harness-everything@0.
|
|
2036
|
+
"ref": "pkg:npm/harness-everything@0.54.0",
|
|
2037
2037
|
"dependsOn": [
|
|
2038
2038
|
"pkg:npm/%40commitlint/cli@19.8.1",
|
|
2039
2039
|
"pkg:npm/%40commitlint/config-conventional@19.8.1",
|