harness-everything 0.52.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 +38 -0
- package/benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md +7 -0
- package/benchmarks/results/live-host/opencode-2026-11-15-workspace/live-workspace-probe.js +16 -0
- package/benchmarks/results/live-host/opencode-2026-11-15-workspace/live-workspace-trace-2026-11-15.jsonl +4 -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-2n-opencode-plugin.test.js +1 -1
- package/ci/mechanism-2p-opencode-v2-entrypoint.test.js +18 -3
- package/ci/mechanism-338-opencode-async.test.js +20 -3
- package/ci/mechanism-341-opencode-lane.test.js +7 -1
- package/ci/mechanism-349-ci-change-scope.test.js +78 -57
- package/ci/mechanism-397-cycle-import.test.js +414 -0
- package/ci/mechanism-397-host-acceptance.test.js +119 -0
- package/ci/mechanism-397-opencode-observations.test.js +1922 -0
- 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/mechanism-system-one-curves.test.js +17 -0
- package/ci/mechanism-system-one-cycle.test.js +621 -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 +16 -7
- package/docs/system-one-cycle.md +12 -3
- package/docs/system-one-observations.md +35 -4
- package/hooks/scripts/codex-user-prompt.js +2 -3
- package/hooks/scripts/lib/observations.js +5 -3
- package/opencode-plugin/README.md +22 -8
- package/opencode-plugin/index.mjs +424 -44
- 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/hooks/scripts/lib/observations.js +5 -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
- package/scripts/system-one-curves.js +154 -14
- package/scripts/system-one-cycle/collect.js +20 -3
- package/scripts/system-one-cycle/common.js +39 -1
- package/scripts/system-one-cycle/evaluate.js +8 -5
- package/scripts/system-one-cycle.js +7 -2
- package/scripts/system-one-observations-export.js +29 -0
- package/scripts/system-one-observations-import-store.js +128 -0
|
@@ -3,7 +3,19 @@ const assert = require('assert');
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const os = require('os');
|
|
5
5
|
const path = require('path');
|
|
6
|
-
const { spawnSync } = require('child_process');
|
|
6
|
+
const { spawnSync: spawnNodeSync } = require('child_process');
|
|
7
|
+
|
|
8
|
+
function spawnSync(command, args, options = {}) {
|
|
9
|
+
const { systemOneMode = 'off', ...spawnOptions } = options;
|
|
10
|
+
return spawnNodeSync(command, args, {
|
|
11
|
+
...spawnOptions,
|
|
12
|
+
env: {
|
|
13
|
+
...process.env,
|
|
14
|
+
...(spawnOptions.env || {}),
|
|
15
|
+
HARNESS_SYSTEM_ONE_MODE: systemOneMode,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
7
19
|
|
|
8
20
|
const ROOT = path.resolve(__dirname, '..');
|
|
9
21
|
const tierRouter = path.join(ROOT, 'harness-everything', 'scripts', 'tier-router.js');
|
|
@@ -27,6 +39,17 @@ function check(condition, message) {
|
|
|
27
39
|
}
|
|
28
40
|
}
|
|
29
41
|
|
|
42
|
+
function withInheritedSystemOneLive(run) {
|
|
43
|
+
const priorMode = process.env.HARNESS_SYSTEM_ONE_MODE;
|
|
44
|
+
try {
|
|
45
|
+
process.env.HARNESS_SYSTEM_ONE_MODE = 'live';
|
|
46
|
+
return run();
|
|
47
|
+
} finally {
|
|
48
|
+
if (priorMode === undefined) delete process.env.HARNESS_SYSTEM_ONE_MODE;
|
|
49
|
+
else process.env.HARNESS_SYSTEM_ONE_MODE = priorMode;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
30
53
|
function reviewBindingIds(run) {
|
|
31
54
|
const text = `${run.result.stdout || ''}\n${run.result.stderr || ''}`;
|
|
32
55
|
const line = text.match(/Candidate step binding ids: ([^\r\n]+)/);
|
|
@@ -46,6 +69,7 @@ function runTier(prompt, options = {}) {
|
|
|
46
69
|
...(options.env || {}),
|
|
47
70
|
HARNESS_ROUTER_CONTRACT_PATH: contractPath,
|
|
48
71
|
},
|
|
72
|
+
systemOneMode: options.systemOneMode,
|
|
49
73
|
});
|
|
50
74
|
|
|
51
75
|
let contract = null;
|
|
@@ -56,6 +80,22 @@ function runTier(prompt, options = {}) {
|
|
|
56
80
|
return { result, contract };
|
|
57
81
|
}
|
|
58
82
|
|
|
83
|
+
const priorSystemOneMode = process.env.HARNESS_SYSTEM_ONE_MODE;
|
|
84
|
+
let inheritedLive;
|
|
85
|
+
try {
|
|
86
|
+
process.env.HARNESS_SYSTEM_ONE_MODE = 'live';
|
|
87
|
+
inheritedLive = runTier('Create a new feature');
|
|
88
|
+
} finally {
|
|
89
|
+
if (priorSystemOneMode === undefined) delete process.env.HARNESS_SYSTEM_ONE_MODE;
|
|
90
|
+
else process.env.HARNESS_SYSTEM_ONE_MODE = priorSystemOneMode;
|
|
91
|
+
}
|
|
92
|
+
check(inheritedLive.result.status === 0 && !inheritedLive.result.stdout.includes('SYSTEM ONE REFERENCE CONFIDENCE'),
|
|
93
|
+
'routing fixtures ignore inherited live mode unless explicitly selected');
|
|
94
|
+
|
|
95
|
+
const explicitLive = runTier('Create a new feature', { systemOneMode: 'live' });
|
|
96
|
+
check(explicitLive.result.status === 0 && explicitLive.result.stdout.includes('SYSTEM ONE REFERENCE CONFIDENCE'),
|
|
97
|
+
'routing fixtures retain an explicit live-mode control');
|
|
98
|
+
|
|
59
99
|
function validContract(run, label) {
|
|
60
100
|
check(run.result.status === 0, `${label}: tier router exits successfully`);
|
|
61
101
|
check(Boolean(run.contract), `${label}: structured contract exists`);
|
|
@@ -426,10 +466,11 @@ if (validContract(degraded, 'degraded routing')) {
|
|
|
426
466
|
check(degraded.contract.workflowPlan.reasonCodes.includes('routing-degraded-strategy-deferred'), 'degraded strategy deferral is explicit');
|
|
427
467
|
}
|
|
428
468
|
|
|
429
|
-
const kernelUnknown = spawnSync(process.execPath, [kernelRouter, 'frobnicate the quux'], {
|
|
469
|
+
const kernelUnknown = withInheritedSystemOneLive(() => spawnSync(process.execPath, [kernelRouter, 'frobnicate the quux'], {
|
|
430
470
|
cwd: ROOT,
|
|
431
471
|
encoding: 'utf8',
|
|
432
|
-
});
|
|
472
|
+
}));
|
|
473
|
+
check(!kernelUnknown.stdout.includes('SYSTEM ONE REFERENCE CONFIDENCE'), 'kernel unknown route ignores inherited live mode');
|
|
433
474
|
check(kernelUnknown.status === 0, 'kernel consumes selected/deferred structured contract successfully');
|
|
434
475
|
check(kernelUnknown.stdout.includes('ROUTER WORKFLOW PLAN (JSON)'), 'kernel emits the Phase 2 workflow-plan checkpoint');
|
|
435
476
|
check(kernelUnknown.stdout.includes('"strategySelection":"deferred"'), 'kernel exposes deferred unclassified selection');
|
|
@@ -454,10 +495,11 @@ check(kernelNotificationPersistFailure.stdout.includes('Host notification: no ac
|
|
|
454
495
|
check(kernelNotificationPersistFailure.stderr.includes('routing state was not persisted'), 'host notification persistence failure remains visible as a reminder');
|
|
455
496
|
fs.rmSync(notificationStateHome, { recursive: true, force: true });
|
|
456
497
|
|
|
457
|
-
const kernelIterative = spawnSync(process.execPath, [kernelRouter, 'Fix this checkout bug and add a regression test.'], {
|
|
498
|
+
const kernelIterative = withInheritedSystemOneLive(() => spawnSync(process.execPath, [kernelRouter, 'Fix this checkout bug and add a regression test.'], {
|
|
458
499
|
cwd: ROOT,
|
|
459
500
|
encoding: 'utf8',
|
|
460
|
-
});
|
|
501
|
+
}));
|
|
502
|
+
check(!kernelIterative.stdout.includes('SYSTEM ONE REFERENCE CONFIDENCE'), 'kernel iterative route ignores inherited live mode');
|
|
461
503
|
check(kernelIterative.stdout.includes('"strategy":"iterative-single"'), 'kernel consumes strategy from structured plan');
|
|
462
504
|
check(kernelIterative.stdout.includes('loop-awareness:'), 'kernel prints dynamic semantic plan obligations');
|
|
463
505
|
check(kernelIterative.stdout.includes('visible-status-updates:'), 'kernel prints the user-visible status invariant');
|
|
@@ -468,11 +510,11 @@ check(!kernelIterative.stdout.includes('evaluate-suggestions-before-skip'), 'leg
|
|
|
468
510
|
|
|
469
511
|
const retainedStateHome = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-router-retained-step-'));
|
|
470
512
|
const retainedSession = 'issue297-retained-step';
|
|
471
|
-
const retainedEnv = {
|
|
513
|
+
const retainedEnv = withInheritedSystemOneLive(() => ({
|
|
472
514
|
...process.env,
|
|
473
515
|
HARNESS_STATE_HOME: retainedStateHome,
|
|
474
516
|
HARNESS_WORKSPACE_ROOT: ROOT,
|
|
475
|
-
};
|
|
517
|
+
}));
|
|
476
518
|
const retainedInput = prompt => JSON.stringify({ session_id: retainedSession, cwd: ROOT, hook_event_name: 'UserPromptSubmit', prompt });
|
|
477
519
|
const initialRetainedRoute = spawnSync(process.execPath, [kernelRouter], {
|
|
478
520
|
cwd: ROOT,
|
|
@@ -481,6 +523,7 @@ const initialRetainedRoute = spawnSync(process.execPath, [kernelRouter], {
|
|
|
481
523
|
env: retainedEnv,
|
|
482
524
|
});
|
|
483
525
|
check(initialRetainedRoute.status === 0, 'retained workflow fixture routes successfully');
|
|
526
|
+
check(!initialRetainedRoute.stdout.includes('SYSTEM ONE REFERENCE CONFIDENCE'), 'retained kernel route ignores inherited live mode');
|
|
484
527
|
check(initialRetainedRoute.stdout.includes('PLANNING STEP: decompose → compose'), 'new selected workflow exposes its planning step');
|
|
485
528
|
|
|
486
529
|
const sessionPathResult = spawnSync(process.execPath, ['-e', "const s=require('./hooks/scripts/lib/harness-state');process.stdout.write(s.getSessionDir(process.env.HARNESS_WORKSPACE_ROOT, process.env.TEST_SESSION_ID, {session_id:process.env.TEST_SESSION_ID,cwd:process.env.HARNESS_WORKSPACE_ROOT}))"], {
|
package/docs/architecture.md
CHANGED
|
@@ -36,9 +36,10 @@ flowchart TD
|
|
|
36
36
|
P --> A{Strategy selected?}
|
|
37
37
|
A -- No / deferred --> D[Preserve invariants<br/>choose smallest justified workflow]
|
|
38
38
|
A -- Yes --> C[ACTIVE workflow contract]
|
|
39
|
-
C -->
|
|
40
|
-
D -->
|
|
41
|
-
|
|
39
|
+
C --> Reqs[Decompose ordered requirements]
|
|
40
|
+
D --> Reqs
|
|
41
|
+
Reqs --> Bind[Bind skills/references per step]
|
|
42
|
+
Bind --> X[Execute active step/stage]
|
|
42
43
|
X --> V{Required stage/check resolved?}
|
|
43
44
|
V -- Yes --> Done[Evidence-backed completion]
|
|
44
45
|
V -- No --> R[Diagnose / bounded re-plan]
|
|
@@ -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.
|