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,250 @@
|
|
|
1
|
+
# Error Handling — three-view overview
|
|
2
|
+
|
|
3
|
+
> **Canonical map** for [#437](https://github.com/dyphn1/Harness-everything/issues/437) (concept and decisions) and [#402](https://github.com/dyphn1/Harness-everything/issues/402) (implementation). Moved from `discussion/437-*` on 2026-11-18; concept decisions still change only through #437. Action identities live in [nodes.yaml](./nodes.yaml); its `links` must match View 1. Level 2/3 documents marked *proposed* describe designs, not shipped behaviour, unless they name the shipped script.
|
|
4
|
+
|
|
5
|
+
An Overview contains **three distinct views**. Their responsibilities must not be merged into a single linear picture:
|
|
6
|
+
|
|
7
|
+
| View | Purpose | What it must show |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| **1. Overall UML Activity Diagram** | Explain one Error Occurrence’s decision process | Actions, guards, early exits, branches and within-occurrence control flow |
|
|
10
|
+
| **2. System architecture / composition** | Explain how Actions, sub-activities and existing capabilities fit together | Process grouping, owner/reviewer authority, reuse of existing ledger and delivery |
|
|
11
|
+
| **3. Action Flowchart / Timeline** | Explain how one Action actually works | Inputs, decisions, outcomes, and handoff to the next Action |
|
|
12
|
+
|
|
13
|
+
**Cross-view convention:** **ASSESS** and **RESPOND** group the same Actions in Views 1 and 2; Action **D · Decide disposition** is expanded in View 3. Node IDs are local to each diagram, and A–G are drawing-local aliases, not persistent identifiers. The seven Action IDs in `nodes.yaml` remain the only proposed persistent identities.
|
|
14
|
+
|
|
15
|
+
## Final P2 decisions — preserve tested diagrams, use lightweight references
|
|
16
|
+
|
|
17
|
+
- **P2-1 · View vs Level:** no confirmed defect. The diagram text was previously tested, and separate layered documents are intended to be read on demand. **Owner will verify agent comprehension experimentally.** Do not change Level 1 View labels, definitions, or control flow solely based on a hypothetical misunderstanding.
|
|
18
|
+
- **P2-2 · Registry mapping:** use [the lightweight document/relationship registry](./registry.md) to relate Layer → Document → relevant detail while keeping the existing [Action identities](./nodes.yaml). Registry references are for **lookup/lazy loading**, not a second set of workflow arrows or Action IDs.
|
|
19
|
+
- **P2-3 · Action handoff:** do **not** impose mandatory input/output schemas on general Actions or behavior blocks. An Action guides what to do and keeps legitimate Agent discretion; concrete Script/CLI/API boundaries document inputs, outputs and return codes only when required (see the E-0002 [Level 3 report writer contract](./details/e0002-report-writer.md)).
|
|
20
|
+
|
|
21
|
+
This is a **discussion-only** mapping. No evidence yet establishes View/Level confusion; no new global validation gate, loader, governance process or runtime Script exists. Measure Error Handling effectiveness only after the full mechanism including Hook/Skill delivery is integrated.
|
|
22
|
+
|
|
23
|
+
## Level 2 — magnified behavior blocks (E-0002 example)
|
|
24
|
+
|
|
25
|
+
**Read [E-0002 — Level 2 behavior-block map](./actions/e0002-action-map.md) after Level 1.** Level 2 zooms into whichever **part of the Level 1 process** currently needs explanation: a single Action, a connected group of Actions, or a particular scenario. It is **not required** to reproduce each Level 1 Action as an independent mini-workflow or add a global rule for every local correction.
|
|
26
|
+
|
|
27
|
+
The E-0002 example expands two blocks: **ASSESS (A Capture, B Triage, C Identify)** and **RESPOND (D Decide, E Treat, F Deliver, G Accept)**. It retains Level 1's branching authority, including the distinction **unidentified → Hold** versus **identified/non-blocking → Defer**. Script/CLI return codes let Agent handle unmet constraints **inside the relevant block**; no extra Level 1 control loop is introduced. The Level 1 Action sequence and recurrence boundary remain authoritative.
|
|
28
|
+
|
|
29
|
+
**Action priority:** tell Agent what to do, not just how to document the last mistake. Here a proposed scoped writer/checker would take truthful content/status, consume `codex exec -o` **as script-mediated raw input**, write/check the final report, and return actionable failure codes. A failed treatment result still reaches the **Deliver and Accept** outcome for the current occurrence. Delivering a reusable command now and exposing it through Hook/Skill in a future relevant task are **different time contexts**, not contradictory Action ordering.
|
|
30
|
+
|
|
31
|
+
## Level 3 — optional procedure, CLI/Script contract and evidence
|
|
32
|
+
|
|
33
|
+
Read only the details required for the current Action/block:
|
|
34
|
+
- [Capture evidence and artifact provenance](./details/e0002-capture-evidence.md): raw report vs final turn, source and unknowns.
|
|
35
|
+
- [Treat report writer and `-o` script contract](./details/e0002-report-writer.md): candidate commands, deterministic validation, return codes, negative cases and host-boundary handling.
|
|
36
|
+
- [Existing E-0002 ledger](../../.agents/harness-everything/errors/E-0002-report-missing-terminal-status.md) and [ROUTE-001](../adr/ROUTE-001-error-lesson-delivery.md): existing evidence and delivery background, not duplicated as another store.
|
|
37
|
+
|
|
38
|
+
**Status:** this is a discussion draft. Level 1 activity / Action identity / Error Ledger / live Hooks are **unchanged**; the proposed CLI has **not** been implemented. A structural PASS from a script is not a substantive task PASS. The integrated Error Handling + Hook system must exist before measuring recurrence and total cost.
|
|
39
|
+
|
|
40
|
+
## Decision — Error occurrence and recurrence boundary
|
|
41
|
+
|
|
42
|
+
- **One activity execution handles one Error Occurrence.** A later recurrence, including one with the same root-cause class, is a **new Error Occurrence** starting at **Capture**, not a return from G to D or G to Capture.
|
|
43
|
+
- **Level 1 controls the overall route only.** The decision about blocking versus deferring stays at the overall activity boundary; repeated-class detection, reuse of class/signature, association to past occurrences, and reuse of treatment history belong inside the relevant Action details (for example Identify and Decide disposition).
|
|
44
|
+
- **Revisit is different from recurrence.** Resuming an unresolved or pending item is continuation of its original work, governed by the Action's own detail and status; it is not automatically a new Error Occurrence.
|
|
45
|
+
- **Retry** remains operation-local inside the relevant Action; it is not a cross-occurrence return path and never implies that an UNVERIFIED result passed.
|
|
46
|
+
- **No new graph edge taxonomy, persistent link, identifier, CLI action, or enforcement mechanism** is introduced by this decision.
|
|
47
|
+
|
|
48
|
+
These rules settle the conceptual recurrence question raised in [Round 1](https://github.com/dyphn1/Harness-everything/tree/discussion/437-error-handling-concept/docs/discussions/error-handling/evaluation/results/round-1) and [Round 2](https://github.com/dyphn1/Harness-everything/tree/discussion/437-error-handling-concept/docs/discussions/error-handling/evaluation/results/round-2). Those evaluation artifacts are **historical frozen stimuli/results** and are intentionally **not edited** to retroactively match this updated design.
|
|
49
|
+
|
|
50
|
+
## Final owner decisions — execution mode, Reviewer role and acceptance (2026-11-13)
|
|
51
|
+
|
|
52
|
+
**Q1 — Main execution mode determines the path.** When Main acts as **Coordinator** of other execution Agents, Main **must dispatch an independent Reviewer** for error investigation. When Main **executes alone** and no independent Agent is available, it may **self-correct** based on Host Hook cues and objective Evidence. An executing Worker in coordinated mode does not substitute its own assessment for the Coordinator's independent Reviewer requirement. The distinction is role/mode per execution, **not a new Level 1 Action**.
|
|
53
|
+
|
|
54
|
+
**Q2 — Reviewer is read-only by default.** It receives prior Action progress and observed Evidence, independently inspects/reproduces/checks as permitted, and returns a Finding and related Evidence. **Do not modify source or execute Treat by default.** Trivial/minor errors are not a standing permission exemption. A future class-scoped exception would need separate explicit owner authorization; no current Hook/Reviewer feature grants it.
|
|
55
|
+
|
|
56
|
+
**Q3 — Coordinated acceptance requires independent review.** After a fix/workaround, Main dispatches read-only Reviewer verification of the outcome and obligations before G Accept can conclude. Main remains responsible for work assignment, disposition and acceptance; the Reviewer supplies independent Evidence, not permissions. In **solo Main mode**, objective Script/CI/contract checks remain required and Main must disclose that independent review was unavailable, without inventing a reviewer PASS. Failure or missing proof remains UNVERIFIED/Unresolved.
|
|
57
|
+
|
|
58
|
+
```mermaid
|
|
59
|
+
flowchart TD
|
|
60
|
+
OBS["Issue observed during execution"] --> A["L1 A · Capture: original Evidence"]
|
|
61
|
+
A --> B["L1 B · Triage"]
|
|
62
|
+
B --> MODE{"Main Agent mode?"}
|
|
63
|
+
MODE -->|Coordinator| REVIEW["Main dispatches independent read-only Reviewer<br/>with existing A/B context"]
|
|
64
|
+
MODE -->|Solo Executor| SELF["Main self-checks objective Evidence<br/>and corrects if justified"]
|
|
65
|
+
REVIEW --> FIND{"Reviewer finding"}
|
|
66
|
+
FIND -->|Not confirmed| DIS["Dismiss with reason"]
|
|
67
|
+
FIND -->|Inconclusive| HOLD["Hold / Owner decision"]
|
|
68
|
+
FIND -->|Confirmed| T{"Already-approved Tolerate?"}
|
|
69
|
+
SELF --> T
|
|
70
|
+
T -->|Yes| FAST["Bounded local retry / UNVERIFIED if unresolved"]
|
|
71
|
+
T -->|No| C["L1 C · Identify"]
|
|
72
|
+
C --> D["D Decide → E Treat → F Deliver"]
|
|
73
|
+
D --> G["L1 G · Accept"]
|
|
74
|
+
G --> AMODE{"Execution mode?"}
|
|
75
|
+
AMODE -->|Coordinator| AR["Main dispatches read-only Reviewer<br/>independently verify fix/workaround"]
|
|
76
|
+
AMODE -->|Solo Executor| AS["Main checks objective CI/Script/contract<br/>no independent review claim"]
|
|
77
|
+
AR --> OUT{"Acceptance conditions met?"}
|
|
78
|
+
AS --> OUT
|
|
79
|
+
OUT -->|Yes| OK["Accept current Occurrence"]
|
|
80
|
+
OUT -->|No / no proof| UNR["Keep Unresolved / UNVERIFIED"]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This is a **role/acceptance overlay** on the same Level 1, not a second controller or replacement for View 1's exhaustive Hold/Defer/Converge/Avoid/Tolerate guards. For Reviewer handoff, preserve prior Action state, do not mechanically recreate accepted Capture Evidence; Reviewer re-checks independently as required.
|
|
84
|
+
|
|
85
|
+
## View 1 — Overall UML Activity Diagram
|
|
86
|
+
|
|
87
|
+
**This is the first, large diagram**, not just an A→G list. Its **ASSESS / RESPOND** groups contain the same Actions as the composition view (View 2); the D Action is visibly the point expanded in View 3. The Mermaid flowchart is a GitHub-renderable representation using normal UML Activity concepts (Action, Decision, Guard and control flow). The corresponding **PlantUML activity source** is [activity.puml](./activity.puml). Decisions are not additional persistent Actions.
|
|
88
|
+
|
|
89
|
+
```mermaid
|
|
90
|
+
flowchart TD
|
|
91
|
+
S((New Error Occurrence))
|
|
92
|
+
|
|
93
|
+
subgraph ASSESS["ASSESS"]
|
|
94
|
+
direction TB
|
|
95
|
+
A["A · Capture"] --> B["B · Triage"]
|
|
96
|
+
B --> MODE{"Main Agent execution mode?"}
|
|
97
|
+
MODE -->|Coordinator: delegated execution| DELEGATE["Main dispatches read-only Reviewer<br/>with A/B progress, original Evidence, suspected issue"]
|
|
98
|
+
MODE -->|Solo: Main executes work itself| SELF["Main examines available objective Evidence<br/>and self-corrects if justified; no Reviewer available"]
|
|
99
|
+
DELEGATE --> RREAL{"Reviewer finding?"}
|
|
100
|
+
RREAL -->|Not confirmed| DISMISS["Dismiss with reason"]
|
|
101
|
+
RREAL -->|Inconclusive| OWNER["Request owner decision; hold item"]
|
|
102
|
+
SELF --> SREAL{"Observed problem supported by Evidence?"}
|
|
103
|
+
SREAL -->|No| DISMISS
|
|
104
|
+
SREAL -->|Unclear| OWNER
|
|
105
|
+
RREAL -->|Confirmed| T{"Already-approved tolerate class?"}
|
|
106
|
+
SREAL -->|Yes| T
|
|
107
|
+
T -->|Yes| R["Retry this operation (max 3)"]
|
|
108
|
+
R --> REC{"Recovered?"}
|
|
109
|
+
REC -->|Yes| RESUME["Resume interrupted work"]
|
|
110
|
+
REC -->|No| UNV["Mark step UNVERIFIED; report; continue independent work only"]
|
|
111
|
+
T -->|No| C["C · Identify"]
|
|
112
|
+
C --> READY{"Identification complete?"}
|
|
113
|
+
READY -->|No / owner decision pending| HOLD["Hold pending identification decision"]
|
|
114
|
+
READY -->|Yes| NOW{"Blocking main path?"}
|
|
115
|
+
NOW -->|No| DEFER["Record / defer treatment"]
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
subgraph RESPOND["RESPOND"]
|
|
119
|
+
direction TB
|
|
120
|
+
D["D · Decide disposition<br/>«expanded in View 3»"] --> MECH{"Mechanical prevention feasible within budget?"}
|
|
121
|
+
MECH -->|Yes| RECHECK{"Same class still yields new instances in bounded review?"}
|
|
122
|
+
RECHECK -->|No| CONV["Converge"]
|
|
123
|
+
RECHECK -->|Yes| DROP{"Can action be dropped or restricted?"}
|
|
124
|
+
MECH -->|No| DROP
|
|
125
|
+
DROP -->|Yes| AVOID["Avoid"]
|
|
126
|
+
DROP -->|No| TOLAPP{"Owner approves Tolerate?"}
|
|
127
|
+
TOLAPP -->|No / pending| PENDING["Keep unresolved; do not bypass required checks"]
|
|
128
|
+
TOLAPP -->|Yes| TOL["Tolerate"]
|
|
129
|
+
CONV --> E["E · Treat (define acceptance first)"]
|
|
130
|
+
AVOID --> E
|
|
131
|
+
TOL --> E
|
|
132
|
+
E --> F["F · Deliver relevant context"]
|
|
133
|
+
F --> G["G · Accept and retire"]
|
|
134
|
+
G --> AMODE{"Who is responsible for acceptance?"}
|
|
135
|
+
AMODE -->|Coordinated work| A_REVIEW["Main dispatches read-only independent Reviewer<br/>to verify treatment Evidence and required conditions"]
|
|
136
|
+
AMODE -->|Solo Main execution| A_SELF["Main checks objective Script/CI/contract Evidence<br/>report limits; cannot claim independent review"]
|
|
137
|
+
A_REVIEW --> RESULT{"Acceptance evidence and disposition outcome"}
|
|
138
|
+
A_SELF --> RESULT
|
|
139
|
+
RESULT -->|Converge / Avoid: met| RETIRE["Accept; retire unneeded lesson"]
|
|
140
|
+
RESULT -->|Tolerate: owner-approved cap and escalation recorded| KEEP["Keep tolerate class active"]
|
|
141
|
+
RESULT -->|Not met / unverified| OPEN["Keep open; report outstanding evidence"]
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
S --> A
|
|
145
|
+
NOW -->|Yes| D
|
|
146
|
+
|
|
147
|
+
RESUME --> Z((End))
|
|
148
|
+
UNV --> Z
|
|
149
|
+
DISMISS --> Z
|
|
150
|
+
OWNER --> Z
|
|
151
|
+
HOLD --> Z
|
|
152
|
+
DEFER --> Z
|
|
153
|
+
PENDING --> Z
|
|
154
|
+
RETIRE --> Z
|
|
155
|
+
KEEP --> Z
|
|
156
|
+
OPEN --> Z
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
A–G are drawing-local aliases, not persistent identifiers; node ids are local to each diagram.
|
|
160
|
+
|
|
161
|
+
Reading notes:
|
|
162
|
+
|
|
163
|
+
- **Diagram-level traceability**: Views 1 and 2 group the same Actions under `ASSESS` and `RESPOND`; `D · Decide disposition` in both diagrams is expanded in View 3. These groupings are organizational and do not change control flow.
|
|
164
|
+
|
|
165
|
+
- The **primary blocking path** keeps exactly `Capture → Triage → Identify → Decide disposition → Treat → Deliver relevant context → Accept and retire`. A non-blocking item completes identification and is recorded/deferred, without opening an immediate fix cycle.
|
|
166
|
+
- **B / Triage, mode-dependent:** **Coordinator Main** always dispatches an independent **read-only Reviewer** for a newly observed suspected error, supplying prior A/B Evidence, even when the class already has an approved Tolerate treatment; the Reviewer may quickly validate the already-known signature. **Solo executing Main** can identify/correct its own evident error when no separate Reviewer is available, using objective Evidence without claiming independent review. Once an issue is recognized/confirmed, the already-approved Tolerate class retains bounded per-operation retry (up to three); failure leaves the step UNVERIFIED. A disputed/inconclusive finding goes to Hold/Owner. This is one L1 activity, not an extra gate or new Occurrence.
|
|
167
|
+
- **C / Identify**: Level 1 asks only whether identification is complete; unresolved cases are held for the required decision. Searching/reusing Error Class and recording a new occurrence are **Action-level responsibilities**, not extra Level 1 branches. Any new class still requires owner approval in the Identify detail.
|
|
168
|
+
- **D / Decide**: Converge / Avoid / Tolerate. Reusing prior disposition history belongs inside the Action detail, not the top-level activity. The existing #437 budget suggestion is one correction plus one review; there is no global recurrence counter or forced Zoom-out.
|
|
169
|
+
- **G / Accept, mode-dependent:** for coordinated work, **Main dispatches independent read-only Reviewer verification of the proposed outcome**; the execution owner provides Evidence and implements any subsequent correction. For solo Main, objective Script/CI/contract checks may support acceptance where permitted, but **independent review is not claimed** and missing mandatory evidence cannot become PASS. Converge/Avoid are accepted only when defined conditions are met; Tolerate stays active and is not claimed rooted out. G ends **this occurrence**, never a cross-occurrence return arrow.
|
|
170
|
+
|
|
171
|
+
## View 2 — System architecture / composition
|
|
172
|
+
|
|
173
|
+
This is deliberately a **structure/composition view, not a second executable flow specification**. Its two blocks have the **same names and action membership** as the regions in View 1. It shows the two process groupings and where existing components or authorities participate. Dotted lines to external actors or existing capabilities are explanatory associations, not a second execution path or a new edge type.
|
|
174
|
+
|
|
175
|
+
```mermaid
|
|
176
|
+
flowchart TB
|
|
177
|
+
INPUT["New Error Occurrence<br/>(agent / reviewer / later observation)"] --> A
|
|
178
|
+
subgraph EH["Error Handling — composed activity"]
|
|
179
|
+
direction TB
|
|
180
|
+
subgraph ASSESS["ASSESS"]
|
|
181
|
+
direction LR
|
|
182
|
+
A["A · Capture"] --> B["B · Triage"] --> C["C · Identify"]
|
|
183
|
+
end
|
|
184
|
+
subgraph RESPOND["RESPOND"]
|
|
185
|
+
direction LR
|
|
186
|
+
D["D · Decide disposition<br/>«expanded in View 3»"] --> E["E · Treat"] --> F["F · Deliver relevant context"] --> G["G · Accept and retire"]
|
|
187
|
+
end
|
|
188
|
+
C -->|"blocking only"| D
|
|
189
|
+
end
|
|
190
|
+
REVIEW["Independent Reviewer (Coordinator mode) / Owner<br/>read-only Findings and acceptance checks"] -. "conditional mode-based finding" .-> B
|
|
191
|
+
REVIEW -. "independent acceptance Evidence" .-> G
|
|
192
|
+
LEDGER[("Existing Error Ledger · #359")] -. "find / record" .-> C
|
|
193
|
+
LEDGER -. "mechanism / disposition" .-> E
|
|
194
|
+
HOOK["Existing bounded context delivery · #394"] -. "reuse" .-> F
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Early exits and decisions are omitted in this view; see View 1.
|
|
198
|
+
|
|
199
|
+
Each Action may later be detailed by its own Activity Diagram, Flowchart or Timeline. This Overview only shows which parts are composed together. Existing Error Ledger [#359](https://github.com/dyphn1/Harness-everything/issues/359) and bounded context delivery [#394](https://github.com/dyphn1/Harness-everything/issues/394) remain existing design/implementation context; this discussion does not add machinery. Every **new** error observation enters through Capture. The diagram does not draw a feedback edge from G because one completed occurrence does not resume another occurrence.
|
|
200
|
+
|
|
201
|
+
## View 3 — Action working example (D: Decide disposition)
|
|
202
|
+
|
|
203
|
+
This **Flowchart is an Action-detail example**, not a replacement for View 1. The `D · Decide disposition` block here **refines the D Action** inside View 1's `RESPOND` partition and View 2's corresponding block. A different Action may use a Timeline when timing / actor handoff is more important than decision branching.
|
|
204
|
+
|
|
205
|
+
```mermaid
|
|
206
|
+
flowchart TD
|
|
207
|
+
IN["C · Identify: class + evidence"] --> MECH
|
|
208
|
+
subgraph D_DETAIL["D · Decide disposition (expanded from Views 1–2)"]
|
|
209
|
+
direction TB
|
|
210
|
+
MECH{"Mechanical prevention feasible within budget?"}
|
|
211
|
+
MECH -->|Yes| RECHECK{"Bounded review still finds new instances?"}
|
|
212
|
+
RECHECK -->|No| CONV["Converge"]
|
|
213
|
+
RECHECK -->|Yes| DROP{"Can action be dropped / restricted?"}
|
|
214
|
+
MECH -->|No| DROP
|
|
215
|
+
DROP -->|Yes| AVOID["Avoid"]
|
|
216
|
+
DROP -->|No| TOLAPP{"Owner approves tolerate class?"}
|
|
217
|
+
TOLAPP -->|Yes| TOL["Tolerate"]
|
|
218
|
+
TOLAPP -->|No / pending| PENDING["Unresolved; do not silently waive checks"]
|
|
219
|
+
end
|
|
220
|
+
CONV --> OUT["E · Treat: define acceptance, then act"]
|
|
221
|
+
AVOID --> OUT
|
|
222
|
+
TOL --> OUT
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Inputs: an identified error class, evidence, current step, and budget. Output: the selected treatment direction (Converge / Avoid / owner-approved Tolerate) or unresolved decision. `Treat` owns the actual intervention and predeclared acceptance conditions; `Decide` does not silently implement fixes.
|
|
226
|
+
|
|
227
|
+
## Action identity prototype (unchanged)
|
|
228
|
+
|
|
229
|
+
See [nodes.yaml](./nodes.yaml) for the same seven identities as in the initial branch commit. **No existing identifier or name is regenerated by redrawing the diagrams.**
|
|
230
|
+
|
|
231
|
+
- `identifier`: `ERR-YYYYMMDD-UUIDv4` (category at creation / creation date / UUID). Immutable once accepted; GUID supplies collision resistance; date and category are descriptive, not each a uniqueness guarantee.
|
|
232
|
+
- `name`: separate human/agent-readable meaning; the diagrams show this instead of UUIDs.
|
|
233
|
+
- `status`: separate metadata (`proposed` in this draft), without yet locking a lifecycle transition specification.
|
|
234
|
+
- Drawing-local `A`–`G` labels are not persistent identifiers. Ordinary start/end, decision diamonds and arrows do not receive document identities.
|
|
235
|
+
|
|
236
|
+
## Existing boundaries and decisions
|
|
237
|
+
|
|
238
|
+
| Action | Responsibility |
|
|
239
|
+
| --- | --- |
|
|
240
|
+
| A Capture | Collect facts from agent failure, reviewer finding or later discovery |
|
|
241
|
+
| B Triage | Judge whether the observation is real or already covered by an approved tolerate path; route unclear cases for owner decision |
|
|
242
|
+
| C Identify | Establish the error classification and occurrence record; class lookup/reuse and approval are internal to this Action |
|
|
243
|
+
| D Decide disposition | Select Converge / Avoid / owner-approved Tolerate, informed by history as needed inside the Action |
|
|
244
|
+
| E Treat | Define completion conditions, apply bounded response |
|
|
245
|
+
| F Deliver relevant context | Deliver only relevant lessons that are not already mechanically prevented |
|
|
246
|
+
| G Accept and retire | Check the current occurrence outcome; retire lessons that are no longer required, without creating a cross-occurrence loop |
|
|
247
|
+
|
|
248
|
+
No extra UML relation or `viewRef` field is introduced to represent the three views: they describe **one action hierarchy**, with grouping and the Action's existing name/identifier used for correlation.
|
|
249
|
+
|
|
250
|
+
Open for discussion rather than implemented here: final UML notation/rendering choice, whether remaining decision branches/early exits are located correctly, what to expand next, and final ID/status lifecycle rules. Recurrence as a new occurrence and non-looping Level 1 execution are decided. Do not expand the CLI/schema/governance surface before these diagrams are accepted.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# C1 — Level 2 Action Map (one authority per named split decision)
|
|
2
|
+
|
|
3
|
+
> **Design draft; not implemented, not promoted to a test.** This is the C1 lens over the [Level 1 Error Handling process](../README.md) for [#437](https://github.com/dyphn1/Harness-everything/issues/437) / [#402](https://github.com/dyphn1/Harness-everything/issues/402). Level 1 remains the authority for the Action sequence, guards, exits and one-Error-Occurrence boundary. A–G are drawing-local aliases, not new identities.
|
|
4
|
+
>
|
|
5
|
+
> **Scope:** docs only. C1 owns this file and its [Level 3 detail](../details/c1-authority-conformance.md); it does **not** edit `README.md`, `registry.md`, `nodes.yaml` or another class's files. No product target is pinned in this batch — E-0001's System One stage-option work stays #445 — so every authority named below is a *worked, historical* example, not a claim about a shipped in-scope path. [source-traced: C1.md:L4-7; advisor-answer-4.md:L7,L21; class-common.md:L3-5]
|
|
6
|
+
|
|
7
|
+
**Claim convention:** every factual statement in this map is **source-traced** to a ledger or adjudication line, tagged `[source-traced: <file>:<line>]`. Source keys: `E-0001` / `E-0007` are `.agents/harness-everything/errors/E-0001-doc-check-identity-split-decision.md` / `E-0007-guard-fix-by-instance.md`; `advisor-answer-4.md`, `C1.md`, `class-common.md` are under `.402-work/`. Nothing here is an executed use in this batch.
|
|
8
|
+
|
|
9
|
+
## What C1 decides (Level 2)
|
|
10
|
+
|
|
11
|
+
A **split decision** is one decision answered independently at two or more sites, so a fix at one site leaves the others deciding differently. [source-traced: E-0001:L143,L151; E-0007:L108-110] The C1 treatment is to **converge on one authority** for a *named* split decision: name the decision, inventory every site that makes it (including unchanged consumers), then trace each consumer to a single authority. [source-traced: C1.md:L4; advisor-answer-4.md:L7]
|
|
12
|
+
|
|
13
|
+
```mermaid
|
|
14
|
+
flowchart TD
|
|
15
|
+
START(["Named split decision"]) --> INV["Inventory every site that makes<br/>the decision, including unchanged consumers"]
|
|
16
|
+
INV --> WIT{"Is there a divergence witness<br/>(normal and stale input)?"}
|
|
17
|
+
WIT -->|No| FOL["Unpinned decision: stay a follow-up;<br/>do not claim an authority"]
|
|
18
|
+
WIT -->|Yes| AUTH["Name ONE authority<br/>(single source of truth / resolver)"]
|
|
19
|
+
AUTH --> TRACE["Trace every consumer to that authority;<br/>assert no second authority"]
|
|
20
|
+
TRACE --> CHECK["Level 3 conformance design:<br/>normal vs stale outcomes per consumer"]
|
|
21
|
+
CHECK --> GATE{"Shipped authority + every consumer<br/>+ current witness all named?"}
|
|
22
|
+
GATE -->|No| FOL
|
|
23
|
+
GATE -->|Yes| PROMOTE(["Promote to a conformance test"])
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Reading rule:** the inventory is the unit of work, not one failing site. Point-fixing one site per review round is exactly the failure class C1 addresses. [source-traced: E-0001:L147; E-0007:L108-110,L114]
|
|
27
|
+
|
|
28
|
+
## Authority / consumer inventory (worked examples)
|
|
29
|
+
|
|
30
|
+
Each table traces **every named consumer** to **one proposed authority** and names a **divergence witness**. All three examples are historical; none is promoted in this batch. [source-traced: advisor-answer-4.md:L7,L21; class-common.md:L3]
|
|
31
|
+
|
|
32
|
+
### Example A — "Is this the trusted doc-check?"
|
|
33
|
+
|
|
34
|
+
- **Named decision:** whether a command is the trusted doc-check. [source-traced: E-0001:L5,L143]
|
|
35
|
+
- **Authority (shipped historically):** one identity resolver, invariant I1, commit `0308386`. [source-traced: E-0001:L39,L45]
|
|
36
|
+
- **Divergence witness:** a self-authored script printing passing doc-check JSON earned credit; a case-variant invocation was dropped from capture while the parser and candidate filter decided identity differently. [source-traced: E-0001:L33,L37]
|
|
37
|
+
|
|
38
|
+
| Consumer site (decides identity) | Traced to the one authority | Evidence |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| `hooks/scripts/lib/doc-reconciliation-pilot.js` | identity resolver I1 | [source-traced: E-0001:L7,L39] |
|
|
41
|
+
| `hooks/scripts/lib/doc-reconciliation-provider.js` | identity resolver I1 | [source-traced: E-0001:L8,L39] |
|
|
42
|
+
| `opencode-plugin/index.mjs` | identity resolver I1 | [source-traced: E-0001:L17,L39] |
|
|
43
|
+
| `ci/mechanism-397-cycle-import.test.js` | identity resolver I1 — **unchanged consumer that was omitted** from P1W's inventory because a parallel packet owned the file; omission produced a P2, fixed in `5a55a8f7` | [source-traced: E-0001:L18,L100-108,L164-166] |
|
|
44
|
+
|
|
45
|
+
### Example B — "Which stage options are authoritative?"
|
|
46
|
+
|
|
47
|
+
- **Named decision:** which stage-option set is served. [source-traced: E-0001:L71-95; E-0007:L89-101]
|
|
48
|
+
- **Authority (shipped historically):** the trained catalog and `manifest.js` as the single source, commit `1c0d8fcf`. [source-traced: E-0001:L85-87,L151; E-0007:L97-101]
|
|
49
|
+
- **Divergence witness:** F4 changed the producer and the installer rejected it; F6 unified three sites and missed `system-one-curves.js`, found only by independent review R1; P2-1 text mismatch was observed. [source-traced: E-0001:L79,L83,L89-91; E-0007:L93-95]
|
|
50
|
+
- **Boundary:** the class stays open in #445; owner decision is observe-first, no class fix without an owner go. C1 owns docs only until a separate in-scope target is pinned. [source-traced: E-0001:L89-91,L162; advisor-answer-4.md:L7,L21; class-common.md:L3]
|
|
51
|
+
|
|
52
|
+
| Consumer site (decides stage options) | Traced to the one authority | Evidence |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `scripts/system-one-cycle/package.js` | trained catalog + `manifest.js` | [source-traced: E-0001:L9,L151] |
|
|
55
|
+
| `harness-everything/scripts/system-one/install.js` | trained catalog + `manifest.js` | [source-traced: E-0001:L10,L151] |
|
|
56
|
+
| `harness-everything/scripts/system-one/provider.js` | trained catalog + `manifest.js` | [source-traced: E-0001:L11,L151] |
|
|
57
|
+
| `scripts/system-one-cycle/score.py` | trained catalog + `manifest.js` — unchanged consumer must still read the one source | [source-traced: E-0001:L12,L151] |
|
|
58
|
+
| `scripts/system-one-curves.js` | trained catalog + `manifest.js` — the site missed by F6 and found by R1 | [source-traced: E-0001:L13,L83,L151] |
|
|
59
|
+
|
|
60
|
+
### Example C — "Is a pinned target inside the root?"
|
|
61
|
+
|
|
62
|
+
- **Named decision:** whether a pinned target is accepted for Write / git add. [source-traced: E-0007:L59-75]
|
|
63
|
+
- **Authority (shipped historically):** one exact-spelling recognizer for capture and all writer surfaces, commit `22dc944a`, after an advisor-gated sweep of nine families × four surfaces. [source-traced: E-0007:L73]
|
|
64
|
+
- **Divergence witness:** a symlink outside the root was credited, then `./` and `..` aliases of the same target were still credited — the second consecutive round on the same decision. [source-traced: E-0007:L67,L71]
|
|
65
|
+
|
|
66
|
+
| Consumer surface (decides target acceptance) | Traced to the one authority | Evidence |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| capture | exact-spelling recognizer `22dc944a` | [source-traced: E-0007:L73] |
|
|
69
|
+
| all writer surfaces | exact-spelling recognizer `22dc944a` | [source-traced: E-0007:L73] |
|
|
70
|
+
| `agentResultSurface()` callers (shared helper) | caller inventory — two seams were patched first, the third caller `reviewRecordIndependent()` was found after; helper ended with 0 callers | [source-traced: E-0007:L76-88] |
|
|
71
|
+
|
|
72
|
+
## Level 2 instructions by behavior block
|
|
73
|
+
|
|
74
|
+
| Step | What the agent should do (Level 2) | Handoff / condition |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| Name the decision | State the single decision being decided independently; do not bundle several decisions. [source-traced: E-0001:L143,L149] | Give the next step one decision name. |
|
|
77
|
+
| Inventory sites | List **every** site making that decision, including unchanged consumers and files owned by other packets / outside the write-set. [source-traced: E-0001:L147,L164-166; E-0007:L114] | Complete inventory before naming an authority. |
|
|
78
|
+
| Find the witness | Show normal and stale-input outcomes and a current divergence witness. [source-traced: C1.md:L9; advisor-answer-4.md:L30] | No witness → keep it a follow-up. [source-traced: advisor-answer-4.md:L30] |
|
|
79
|
+
| Name one authority | Name a single shipped source of truth / resolver, and trace each consumer to it; reject a second authority for the same decision. [source-traced: E-0001:L151; E-0007:L116; advisor-answer-4.md:L30] | Only a *pinned* shipped authority may be claimed. [source-traced: advisor-answer-4.md:L7] |
|
|
80
|
+
| Hand to Level 3 | Pass the authority, the consumer list and the witness to the [conformance-test design](../details/c1-authority-conformance.md). | Promotion is a Level 3 decision. |
|
|
81
|
+
|
|
82
|
+
## Level 3 — detail consulted only when needed
|
|
83
|
+
|
|
84
|
+
- [C1 conformance-test design](../details/c1-authority-conformance.md) — normal vs stale outcomes, test design and the promotion gate.
|
|
85
|
+
- [E-0001 ledger](../../../.agents/harness-everything/errors/E-0001-doc-check-identity-split-decision.md) — identity split-decision class and history, not duplicated here.
|
|
86
|
+
- [E-0007 ledger](../../../.agents/harness-everything/errors/E-0007-guard-fix-by-instance.md) — fix-by-instance class and history, not duplicated here.
|
|
87
|
+
- [E-0002 Level 2 map](./e0002-action-map.md) — sibling example of the same Level 2/3 document shape.
|
|
88
|
+
|
|
89
|
+
**Acceptance of this draft:** source-traced inventory and authority/consumer tracing only. No conformance test is promoted and no in-scope product authority is claimed until a separate target is pinned and a current divergence witness is named. [source-traced: advisor-answer-4.md:L7,L21,L30; class-common.md:L3]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# C2 — Test-root containment (Level 2 Action Map)
|
|
2
|
+
|
|
3
|
+
> C2 specifies the path decision used by the cycle-import mechanism test to keep temporary fixture data outside the repository root. The existing `isOutside` helper remains the shared predicate for that test path.
|
|
4
|
+
|
|
5
|
+
```mermaid
|
|
6
|
+
flowchart TD
|
|
7
|
+
START["Root and candidate path"] --> REL["Compute relative path with the same path API"]
|
|
8
|
+
REL --> CHECK{"Relative is absolute, exactly '..', or starts with '..' plus a separator?"}
|
|
9
|
+
CHECK -->|Yes| OUT["Candidate is outside the root"]
|
|
10
|
+
CHECK -->|No| IN["Candidate is inside the root"]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
| Action | Agent behavior | Acceptance evidence |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| Capture | Keep the root, candidate and `path.relative` result together when diagnosing a containment verdict. | The values show the path style and drive involved. |
|
|
16
|
+
| Identify | Treat an absolute relative result, `..`, or a `..` parent segment as outside. Treat names such as `..cache` as ordinary child names. | The path segment boundary is explicit. |
|
|
17
|
+
| Treat | Reuse `isOutside` in `ci/mechanism-397-cycle-import.test.js`; use `path.win32` for deterministic Windows cases. | Root child, similar-prefix sibling, parent escape and cross-drive fixtures exercise both verdicts. |
|
|
18
|
+
| Accept | Run the focused cycle-import test and retain its result. | `node --test ci/mechanism-397-cycle-import.test.js` passes. |
|
|
19
|
+
|
|
20
|
+
The `path.win32` fixtures run on every host. The existing fixture assertion also exercises the host's native `path` implementation against its temporary directory.
|
|
21
|
+
|
|
22
|
+
See the [Level 3 C2 test-root containment contract](../details/c2-test-root-containment.md) and [E-0019](../../../.agents/harness-everything/errors/E-0019-windows-cross-drive-relative-path.md).
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# C3 — Level 2 Action Map
|
|
2
|
+
|
|
3
|
+
> C3 applies the E-0002 action-map shape to routing-test mode ownership. It records how to keep deterministic routing assertions isolated from an inherited System One mode; it does not change production routing.
|
|
4
|
+
|
|
5
|
+
```mermaid
|
|
6
|
+
flowchart TD
|
|
7
|
+
A["A · Capture<br/>Record the command and inherited mode"] --> B["B · Triage<br/>Compare live and unset runs"]
|
|
8
|
+
B --> C["C · Identify<br/>Trace routing-test child processes"]
|
|
9
|
+
C --> D["D · Decide<br/>Deterministic default or explicit live control"]
|
|
10
|
+
D --> E["E · Treat<br/>Set mode at the fixture boundary"]
|
|
11
|
+
E --> F["F · Deliver<br/>Report checked paths and exit codes"]
|
|
12
|
+
F --> G["G · Accept<br/>Require live, unset and explicit-control evidence"]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
| Scope | What the agent should do | Handoff / condition |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| **A Capture** | Keep the exact routing-test command and the inherited `HARNESS_SYSTEM_ONE_MODE` value with the failure evidence. | Record whether the mode was `live` or unset. |
|
|
18
|
+
| **B Triage → C Identify** | Reproduce under inherited `live`; trace every subprocess that makes routing assertions. Separate deterministic route fixtures from tests that intentionally exercise live mode. | An unset-only pass does not close an inherited-mode failure. |
|
|
19
|
+
| **D Decide** | Give deterministic fixtures an explicit `off` default. Use `live` only in a fixture that names live mode as its subject. | Preserve an explicit override for live-mode controls. |
|
|
20
|
+
| **E Treat** | Set mode in the shared fixture invocation after inherited environment values and before per-case overrides. Add an inherited-live regression and an explicit-live control. | Keep the correction in test setup; do not change the classifier to compensate for test state. |
|
|
21
|
+
| **F Deliver** | List every routing-invariant test file checked and report the focused and package-level results. | Identify any remaining leak as a follow-up rather than silently omitting it. |
|
|
22
|
+
| **G Accept** | Run the suite with inherited `live` and with the variable unset; confirm the explicit live control still enters the live path. | Accept only when all three conditions hold. |
|
|
23
|
+
|
|
24
|
+
The incident is tracked in [E-0018](../../../.agents/harness-everything/errors/E-0018-machine-state-leaks-into-tests.md). A passing test proves the fixture’s mode ownership at the deterministic mechanism layer; it is not live-host behavior evidence.
|
|
25
|
+
|
|
26
|
+
**Current packet disposition:** independent review found three direct `kernel-router.js` routing fixtures in `ci/router-workflow-plan.test.js` that still inherit `live`. The slice remains blocked until those calls own the mode and the live/unset gates are rerun.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# C5 — Level 2 Action Map (pin one host protocol at its real boundary)
|
|
2
|
+
|
|
3
|
+
> **Guidance-only Level 2 map for [#402](https://github.com/dyphn1/Harness-everything/issues/402) class C5.** Companion to the [Error Handling Level 1 overview](../README.md) and the [C5 host replay contract](../details/c5-host-replay-contract.md). This map describes what the agent should do; it does not implement a replay, change `opencode-plugin/`, `ci/`, hooks, or the Error Ledger, and it is not a shipped mechanism. The packet gate is verbatim: "With evidence missing, document the exact unavailable field or artifact."
|
|
4
|
+
|
|
5
|
+
**Lookup:** [Registry table](../registry.md) locates this Level 2 behavior block and its Level 3 reference. It maps documents, not control-flow arrows.
|
|
6
|
+
|
|
7
|
+
**Decision (binding, from advisor answer 4, C5):** pin one host protocol at its real boundary — the OpenCode V2 host protocol as consumed by `opencode-plugin/index.mjs` (flat events, session id at `data.sessionID`, turn end on `session.execution.succeeded`, V2 context messages using `type`/`content[]`). Use a retained E-0006 host payload and a deterministic replay in the existing consumer suite **if** the payload, expected translation and fixture owner are available. Otherwise ship Level 2 guidance and the replay contract, and do not dispatch any replay implementation.
|
|
8
|
+
|
|
9
|
+
## Block 1 — ASSESS: capture, triage and identify this occurrence
|
|
10
|
+
|
|
11
|
+
| Scope from Level 1 | What the agent should do (Level 2) | Handoff/condition |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| **A Capture** | Record the boundary observation: which host event shapes reach the consumer, where the session id lives (`data.sessionID` on V2 flat events), which event ends a turn (`session.execution.succeeded`, since V2 sends no `session.idle`), and which message shape the consumer reads (`type`/`content[]`). Capture the ledger class E-0006 (live-kit-host-protocol-mismatch) and its sites. | Give B the boundary sites and the ledger reference. |
|
|
14
|
+
| **B Triage** | Check the three packet-named locations for a retained E-0006 host payload: `benchmarks/results/live-host/`, `ci/*opencode*`, `opencode-plugin/`. Record each retained artifact's provenance. | Only a payload with expected translation and a named fixture owner proceeds to D; otherwise hold the replay. |
|
|
15
|
+
| **C Identify** | Classify as E-0006 class. Pin the boundary sites: `opencode-plugin/index.mjs` event loop (`raw.sessionID` / `raw.data.sessionID`, `turnEnded` on `session.idle` or `session.execution.succeeded`) and the existing consumer test `ci/mechanism-397-opencode-observations.test.js` (its `v2Event` helper and `session.execution.succeeded` pushes). | Identified but replay prerequisites missing → Defer the replay; keep the docs path. |
|
|
16
|
+
|
|
17
|
+
## Block 2 — RESPOND: decide, act, deliver and accept
|
|
18
|
+
|
|
19
|
+
| Scope from Level 1 | What the agent should do (Level 2) | Handoff/condition |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| **D Decide (response block)** | If retained payload + expected translation + fixture owner are all available: Converge — wire a deterministic replay into the named consumer test. Otherwise (this slice): Defer the replay and ship this Level 2 map plus the Level 3 replay contract documenting the exact missing field/artifact. Do not start E on a replay implementation. | No replay implementation without all three prerequisites. |
|
|
22
|
+
| **E Treat (response block)** | Write `docs/error-handling/actions/c5-action-map.md` and `docs/error-handling/details/c5-host-replay-contract.md`. Name exact fixture/test paths and pin provenance (host, version, date, source revision where known). Document the exact missing field/artifact when evidence is missing. No new scripts, hooks, ledger entries, or test changes. | The contract's missing-artifact section is the evidence layer for the next slice. |
|
|
23
|
+
| **F Deliver (response block)** | Hand off the two doc paths and the contract's replay preconditions to the coordinator. The replay stays undispatched until the retained payload, expected translation and fixture owner exist. | Do not present a replay harness as installed or runnable. |
|
|
24
|
+
| **G Accept (response block)** | Accept via objective local checks only: `npm run test:consistency`, `test:references`, `test:portability` and the report-writer `write`/`check` cycle for the C5 report. No independent review claim; no behavioral claim (docs only). Structural PASS ≠ replay PASS. | Missing prerequisites remain recorded as unresolved, not fabricated as done. |
|
|
25
|
+
|
|
26
|
+
## Level 3 — details consulted only when needed
|
|
27
|
+
|
|
28
|
+
- [C5 host replay contract: retained payload inventory, provenance, consumer test path, missing artifact, replay preconditions](../details/c5-host-replay-contract.md)
|
|
29
|
+
- [Existing E-0006 ledger](../../../.agents/harness-everything/errors/E-0006-live-kit-host-protocol.md): existing class/history, not duplicated here
|
|
30
|
+
|
|
31
|
+
**Acceptance of this draft:** Level 2 action guidance only. No end-to-end replay conclusion until the retained payload, expected translation and fixture owner are pinned and the consumer test is exercised end to end.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# C6 — Level 2 Action Map (dispatch packet briefing)
|
|
2
|
+
|
|
3
|
+
> Companion to [#402](https://github.com/dyphn1/Harness-everything/issues/402), advisor answer 4 class C6, and [Level 1 error handling](../README.md). C6 owns the C6 docs and the C6 briefing template only: this map, [details/c6-packet-briefing.md](../details/c6-packet-briefing.md) and [templates/packet-briefing.md](../templates/packet-briefing.md). Monitoring, CI cancellation and training budget retain their own consumers and issues.
|
|
4
|
+
|
|
5
|
+
**Problem to prevent:** a worker follows a stale shared default (wrong input SHA, wrong report path, gate from another packet) and either executes ambiguous instructions or a valid packet stalls because it must invent values (E-0022 witness; #448 W3 was misled by packet template drift: common-gates SHA, wrong report path). A runtime trust pin cited only inside a packet cannot be followed by installed or public consumers (E-0010 witness).
|
|
6
|
+
|
|
7
|
+
**Level 2 decision (author / coordinator):** when dispatching, the packet — not shared defaults — owns the pinned input SHA, the exact report path and the gate invocation. Every template field is either filled with the packet's own authoritative value or `N/A: <reason>`. Shared defaults (class-common.md, shared gates files) supply background only.
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
flowchart TD
|
|
11
|
+
NEED["Need to dispatch a packet"] --> AUTHOR["Author the packet from the C6 briefing template<br/>templates/packet-briefing.md"]
|
|
12
|
+
AUTHOR --> OWN["Every required field filled<br/>or `N/A: <reason>`?"]
|
|
13
|
+
OWN -->|No| FIX["Repair inside the packet; never invent<br/>a value for the worker"]
|
|
14
|
+
FIX --> AUTHOR
|
|
15
|
+
OWN -->|Yes| ISSUE["Issue the self-contained packet;<br/>worker cwd is its own worktree at the pinned SHA"]
|
|
16
|
+
ISSUE --> EXEC["Worker runs the packet's own gate invocation<br/>and verification commands"]
|
|
17
|
+
EXEC --> GATE["Gate confirms the exact input SHA,<br/>exact report path and exact gate command reach the worker"]
|
|
18
|
+
GATE --> OK["Gate OK?"]
|
|
19
|
+
OK -->|No| BLOCK["Block ambiguous instructions reaching dispatch,<br/>or a valid packet requiring invented values"]
|
|
20
|
+
OK -->|Yes| DONE["Packet briefing accepted; real dispatch cite<br/>retained by the coordinator on the next dispatch"]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**C6 instructions by packet stage**
|
|
24
|
+
|
|
25
|
+
| Stage | What the author does (Level 2) | Condition to proceed |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| Author | Fill every template field verbatim where required: runner/model/effort, worktree + input SHA, scope anchor verbatim with source, write-set, gate (dependsOn), verification commands, error-ledger instruction, report path + report-writer invocation, terminal STATUS rule. | All fields filled or `N/A: <reason>` |
|
|
28
|
+
| Issue | Hand over the self-contained packet; no out-of-band values in chat or separate files. | Packet carries its own authoritative values |
|
|
29
|
+
| Execute (worker) | Run the packet's own gate invocation and verification commands in its own worktree at the pinned input SHA. | Exact SHA, report path, gate command in the packet |
|
|
30
|
+
| Accept (gate) | Confirm exact input SHA, exact report path and exact gate command reached the worker; walkthroughs: one stale shared default and one complete packet through the template. | No conflicting shared-gates SHA; no inherited output path from another packet |
|
|
31
|
+
|
|
32
|
+
**Level 3**
|
|
33
|
+
|
|
34
|
+
- [C6 packet briefing — field contract, walkthroughs and review cases](../details/c6-packet-briefing.md)
|
|
35
|
+
- [C6 briefing template — required fields and `N/A` rule](../templates/packet-briefing.md)
|
|
36
|
+
|
|
37
|
+
**Acceptance of this map:** structural guidance only. The real dispatch cite is added by the coordinator on the next dispatch; until then it is pending (`N/A: real dispatch cite added by the coordinator on the next dispatch`). No hook delivery, ledger schema, promotion, training-budget or CI-cancellation change enters this class.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# C7 — Candidate write-set check
|
|
2
|
+
|
|
3
|
+
After a packet's local gates, the coordinator checks that the candidate slice stayed within its approved paths before accepting it. The checker reports path scope; the coordinator still reviews content and packet requirements.
|
|
4
|
+
|
|
5
|
+
```mermaid
|
|
6
|
+
flowchart TD
|
|
7
|
+
GATES["Packet local gates complete"] --> RUN["Run checker with pinned base, candidate head and allow-list"]
|
|
8
|
+
RUN --> EXIT{"Exit code"}
|
|
9
|
+
EXIT -->|0| PATHS["Every observed path is allowed"]
|
|
10
|
+
PATHS --> REVIEW["Review same-file content and outline completeness"]
|
|
11
|
+
REVIEW --> ACCEPT["Accept only when the packet's other evidence also passes"]
|
|
12
|
+
EXIT -->|1| INSPECT["Inspect each OUT_OF_SET path against the approved scope"]
|
|
13
|
+
INSPECT -->|Files or approved scope corrected| RUN
|
|
14
|
+
EXIT -->|2| REPAIR["Correct usage, revision or Git error; keep result unverified"]
|
|
15
|
+
REPAIR --> RUN
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Exit 0 is a path-scope result, not packet acceptance.** The checker cannot detect same-file content loss or an omitted approved outline row; the scoped review must compare those inputs directly (see [E-0014](../../../.agents/harness-everything/errors/E-0014-lossy-cleanup.md) and [E-0016](../../../.agents/harness-everything/errors/E-0016-adr-draft-omits-approved-outline-row.md)). Run it after local gates and before accepting the slice. It does not install a hook or change CI behavior.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# E-0002 — Level 2 Action Map (magnifying Level 1 behavior blocks)
|
|
2
|
+
|
|
3
|
+
> **Diagram-first design draft; not implemented.** This is the E-0002 lens over the [Level 1 Error Handling process](../README.md) for [#437](https://github.com/dyphn1/Harness-everything/issues/437) / [#402](https://github.com/dyphn1/Harness-everything/issues/402). Level 1 remains the authority for Action sequence, guards, exits, authority and one-Error-Occurrence boundary. A–G are drawing-local aliases, not new identities.
|
|
4
|
+
>
|
|
5
|
+
> **Level 2 describes WHAT THE AGENT SHOULD DO within the magnified behavior block.** It can expand one Action or a connected group of Actions; it need not reproduce each internal step as a new global rule. Level 3 holds HOW (scripts, return-code details, evidence and document format). Agent discretion over tactics stays intact if the Level 1 contract is met.
|
|
6
|
+
|
|
7
|
+
**Lookup:** [Registry table](../registry.md) locates this Level 2 behavior block and its Level 3 references. It maps *documents*, not control-flow arrows. The Level 1 Views are unchanged; whether their relationship to Levels confuses Agents will be tested by the owner rather than assumed.
|
|
8
|
+
|
|
9
|
+
**Action-contract scope:** this map defines what to do, **not** a mandatory per-Action I/O schema. Only a concrete machine interface (such as the proposed Report Script/CLI in Level 3) requires explicit parameters, outputs and return-code behavior. Agent-chosen tactics are valid when Level 1's necessary conditions are met.
|
|
10
|
+
|
|
11
|
+
## Block 1 — ASSESS: capture, triage and identify this occurrence
|
|
12
|
+
|
|
13
|
+
```mermaid
|
|
14
|
+
flowchart TD
|
|
15
|
+
START(["New occurrence from Level 1"]) --> A["A · Capture<br/>Retain observed report/turn evidence, source,<br/>raw ending and unknowns without editing it"]
|
|
16
|
+
A --> B["B · Triage<br/>Apply mode-dependent L1 path:<br/>Coordinator → Reviewer; Solo Main → evidence self-check"]
|
|
17
|
+
B --> BF{"Triage result?"}
|
|
18
|
+
BF -->|"Real finding"| C["C · Identify<br/>Compare evidence with existing E-0002<br/>signature/history for THIS new occurrence"]
|
|
19
|
+
BF -->|"Dismiss / hold / approved tolerate"| BEXIT["Follow matching Level 1 exit;<br/>UNVERIFIED never means PASS"]
|
|
20
|
+
C --> ID{"Identification complete?"}
|
|
21
|
+
ID -->|"No / approval pending"| HOLD["Hold: identification incomplete<br/>owner decision where required"]
|
|
22
|
+
ID -->|"Yes"| BLOCK{"Blocking main path?"}
|
|
23
|
+
BLOCK -->|"No"| DEFER["Record and defer treatment<br/>identified but non-blocking"]
|
|
24
|
+
BLOCK -->|"Yes"| NEXT(["Hand off to RESPOND block"])
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**P1-1 boundary:** *unidentified / pending class approval* leads to **Hold**, whereas *identified but non-blocking* leads to **Defer**. They are distinct Level 1 outcomes. Recognizing E-0002-like evidence at Capture does not automatically classify the case: formal classification and reusing history belong to Identify. A future recurrence is a new occurrence starting at Capture.
|
|
28
|
+
|
|
29
|
+
## Block 2 — RESPOND: decide, act, deliver and accept
|
|
30
|
+
|
|
31
|
+
```mermaid
|
|
32
|
+
flowchart TD
|
|
33
|
+
IN(["Blocking, identified E-0002<br/>from ASSESS"]) --> D["D · Decide<br/>Choose Converge / Avoid / Tolerate<br/>from evidence and available capability"]
|
|
34
|
+
D --> V["Validate selection using the relevant<br/>script/contract, including required approval"]
|
|
35
|
+
V --> VR{"Conditions satisfied?"}
|
|
36
|
+
VR -->|"nonzero / unmet"| DR["Return error and unmet condition to agent;<br/>revise within Decide, or keep unresolved"]
|
|
37
|
+
DR -->|"can revise within budget"| D
|
|
38
|
+
DR -->|"cannot satisfy"| DEXIT["Follow Level 1 unresolved exit;<br/>no Treat on invalid disposition"]
|
|
39
|
+
VR -->|"yes"| E["E · Treat<br/>Perform the selected bounded operation"]
|
|
40
|
+
E --> ET{"Selected treatment?"}
|
|
41
|
+
ET -->|"Converge"| WR["Agent prepares truthful content/status;<br/>feed codex -o raw output through script;<br/>script writes/checks final report"]
|
|
42
|
+
ET -->|"Avoid"| AV["Restrict or omit unnecessary action<br/>per validated disposition"]
|
|
43
|
+
ET -->|"Owner-approved Tolerate"| TO["Use approved bound / retry / escalation;<br/>no implied verification PASS"]
|
|
44
|
+
WR --> RC["Check return code and actual artifact"]
|
|
45
|
+
AV --> RC
|
|
46
|
+
TO --> RC
|
|
47
|
+
RC --> OK{"Treatment contract met?"}
|
|
48
|
+
OK -->|"nonzero / failed"| ERR["Agent handles return code,<br/>corrects within the same Treat block<br/>or preserves unresolved evidence"]
|
|
49
|
+
ERR -->|"correctable within budget"| E
|
|
50
|
+
ERR -->|"unresolved"| F
|
|
51
|
+
OK -->|"yes"| F["F · Deliver<br/>Hand off relevant operation/context<br/>and result (including failures)"]
|
|
52
|
+
F --> G["G · Accept<br/>Verify objective obligations and outcome"]
|
|
53
|
+
G --> MODE{"Main Agent mode?"}
|
|
54
|
+
MODE -->|"Coordinator"| GR["Main dispatches read-only independent Reviewer<br/>for outcome/evidence verification"]
|
|
55
|
+
MODE -->|"Solo executing Main"| GS["Objective Script/CI/contract checks<br/>no independent review claim"]
|
|
56
|
+
GR --> GOK{"Acceptance conditions met?"}
|
|
57
|
+
GS --> GOK
|
|
58
|
+
GOK -->|"yes"| DONE(["Accept current occurrence;<br/>retire unneeded lesson only"])
|
|
59
|
+
GOK -->|"nonzero / incomplete"| OPEN(["Keep occurrence open / unresolved;<br/>return failure context for follow-up"])
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Reading rules:** This is a magnification of the **RESPOND behavior block**, not a new global controller. G inherits the same execution-mode distinction as Level 1: coordinated Main **must dispatch read-only independent Reviewer outcome verification**, while Solo Main uses objective checks and explicitly does not claim independent review. Reviewer is investigative by default and does not edit artifacts or run Treat; minor/trivial errors are not an automatic exemption. In D, a script can reject unmet conditions using a nonzero return code; the agent can revise the decision locally rather than creating a new Level 1 approval/retry workflow. An Owner-required authorization still has to exist to pass validation; a script must never manufacture permission.
|
|
63
|
+
|
|
64
|
+
In E, scripts verify deterministic conditions and return actionable diagnostics; the agent chooses a suitable correction, constrained by the currently accepted disposition and budget. A failure that cannot be corrected still reaches **F (deliver result/evidence)** and **G (open/unresolved acceptance outcome)**, not an orphan endpoint. G's nonzero/incomplete outcome does **not** retire a needed instruction or silently claim success. Neither this path nor future recurrence creates a G → D or G → Capture loop.
|
|
65
|
+
|
|
66
|
+
## E-0002 instructions by behavior block
|
|
67
|
+
|
|
68
|
+
| Scope from Level 1 | What the agent should do (Level 2) | Handoff/condition |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| **A Capture** | Preserve original report/turn data, the exact terminal lines and whether `-o` is involved; do not modify evidence. | Give B evidence plus explicit unknowns. |
|
|
71
|
+
| **B Triage → C Identify** | Apply common Triage guards, then identify using actual evidence and the existing E-0002 class. **Unidentified → Hold; identified non-blocking → Defer.** | Only identified, blocking observations proceed to D. |
|
|
72
|
+
| **D Decide (response block)** | Choose an applicable disposition. Validate approval, feasibility and required conditions through the applicable script/contract; a rejected choice returns to Agent for correction or unresolved handling. | Do not start E with an invalid choice. |
|
|
73
|
+
| **E Treat (response block)** | Execute the accepted treatment, with agent-selected tactics. For **Converge**, Agent determines the truthful status and prepares content; script/CLI owns atomic report writing and structural validation. For **Avoid/Tolerate**, execute their distinct approved operations. | Nonzero return code returns control to Agent inside this block; if still unresolved, preserve result for F/G. |
|
|
74
|
+
| **F Deliver (response block)** | Hand off the chosen procedure/available command and current outcome. Later, at **relevant** workflow steps, the Hook/Skill mechanism may expose the appropriate command; that future contextual exposure is *not another occurrence transition*. | No unsupported CLI is presented as installed; deliver failure evidence when unresolved. |
|
|
75
|
+
| **G Accept (response block)** | Use deterministic checks for mechanical obligations and assess substantive Evidence. In Coordinator mode, Main dispatches independent read-only Reviewer for the treatment outcome before acceptance; in Solo Main mode use objective checks and disclose lack of independent review. If verification fails, return explicit unmet conditions and keep open; retire only obsolete lesson prose, not a command still needed for routine work. | Only accepted outcomes may be reported as accepted; Tolerate remains bounded, not “fixed.” |
|
|
76
|
+
|
|
77
|
+
## Mechanism and time boundary (the one-time response vs future use)
|
|
78
|
+
|
|
79
|
+
```mermaid
|
|
80
|
+
flowchart LR
|
|
81
|
+
RESPONSE["Current occurrence: D → E → F → G<br/>decide, apply, hand off, accept"] -. "established reusable capability" .-> AVAILABLE["Relevant Skill / Script reference"]
|
|
82
|
+
AVAILABLE -. "at a later relevant workflow step<br/>via scoped Hook disclosure" .-> OP["Agent performs script-mediated operation<br/>and uses return code"]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The dotted relations are **reuse/context**, not control-flow links between occurrences. Level 1 remains the only occurrence lifecycle. Future agents need to know **the action to perform at the current step**, not reload every past error report. Mechanism correctness and eventual recurrence reduction remain separate questions.
|
|
86
|
+
|
|
87
|
+
### Script-first contract (Level 2 only)
|
|
88
|
+
|
|
89
|
+
- The **agent** determines content, substantive truth and how to react to failures; the **script** performs bounded write/check and returns exit code + clear unmet condition. A zero exit code proves only the specific script contract.
|
|
90
|
+
- For `codex exec -o`, `-o` is a **script-mediated raw output/input artifact**, not a report finalized by manual editing. Route raw output through the report script, which must validate/extract only under a specified host-aware contract and then write/check the designated report. If the transformation cannot satisfy that contract, return nonzero and preserve raw evidence; do not silently strip metadata or fabricate success.
|
|
91
|
+
- **No extra Level 1 branches or hard-coded retry counter** are added to make the script work. Agent correction after a failure is local to the magnified block and subject to existing constraints.
|
|
92
|
+
- Script contracts and actual commands are **proposals** (not currently shipped). Missing scripts cannot satisfy a required mechanical check; keep that outcome open, rather than pretending a command exists.
|
|
93
|
+
|
|
94
|
+
## Level 3 — optional details consulted only when needed
|
|
95
|
+
|
|
96
|
+
- [Capture evidence and producer/artifact details](../details/e0002-capture-evidence.md)
|
|
97
|
+
- [Report writing / `-o` transformation / return-code contract](../details/e0002-report-writer.md)
|
|
98
|
+
- [Existing E-0002 Error Ledger](../../../.agents/harness-everything/errors/E-0002-report-missing-terminal-status.md): existing class/history, not duplicated here
|
|
99
|
+
- [ROUTE-001 delivery decision](../../adr/ROUTE-001-error-lesson-delivery.md): scoped delivery background, not proof of deployed writer
|
|
100
|
+
|
|
101
|
+
**Acceptance of this draft:** Level 1 alignment and Action guidance only. No end-to-end recurrence/cost conclusion until Error Handling, Script and Hook/Skill Delivery are actually integrated and exercised.
|