harness-everything 0.7.0 → 0.8.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/.github/workflows/ci.yml +12 -2
- package/AGENTS.md +36 -33
- package/CHANGELOG.md +23 -0
- package/README.md +9 -8
- package/benchmarks/results/reviews/pr142-verification.json +95 -0
- package/ci/action-gate.test.js +1 -1
- package/ci/doc-capability-consistency.test.js +3 -0
- package/ci/invariant-routing.test.js +105 -34
- package/ci/mechanism-2af-worktree-isolation.test.js +152 -0
- package/ci/mechanism-2ag-router-worktree-contract.test.js +44 -0
- package/ci/mechanism-2ah-workflow-lifecycle.test.js +140 -0
- package/ci/openai-plugin-package.test.js +14 -7
- package/ci/workflow-execution-contract.test.js +60 -0
- package/docs/architecture.md +112 -106
- package/docs/mechanism-first-skill-mesh.md +93 -99
- package/docs/openai-plugin.md +1 -1
- package/docs/philosophy.md +40 -30
- package/docs/platform-capabilities.md +10 -2
- package/docs/reviews/pr-142-issue-131.md +89 -0
- package/docs/routing.md +68 -103
- package/docs/workflow-runtime.md +109 -0
- package/fable-mode/CONTRACT-FORMAT.md +3 -1
- package/fable-mode/SKILL.md +1 -1
- 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/scripts/workflow-plan-consumer.js +3 -1
- package/harness-everything/SKILL.md +17 -23
- package/harness-everything/references/triage-and-tiers.md +81 -98
- package/harness-everything/scripts/kernel-router-core.js +263 -0
- package/harness-everything/scripts/kernel-router.js +97 -212
- package/harness-everything/scripts/router-contract-core.js +612 -0
- package/harness-everything/scripts/router-contract.js +21 -581
- package/hooks/hooks.json +22 -1
- package/hooks/scripts/contract-test.js +24 -2
- package/hooks/scripts/lib/workflow-isolation.js +102 -0
- package/hooks/scripts/lib/workflow-runtime.js +102 -0
- package/hooks/scripts/state-persist.js +1 -0
- package/hooks/scripts/workflow-disposition.js +97 -0
- package/hooks/scripts/workflow-gate.js +53 -0
- package/hooks/scripts/workflow-stop-gate.js +44 -0
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +2 -2
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/hooks.json +20 -1
- package/plugins/harness-everything/hooks/scripts/contract-test.js +24 -2
- package/plugins/harness-everything/hooks/scripts/lib/workflow-isolation.js +102 -0
- package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +102 -0
- package/plugins/harness-everything/hooks/scripts/state-persist.js +1 -0
- package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +97 -0
- package/plugins/harness-everything/hooks/scripts/workflow-gate.js +53 -0
- package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +44 -0
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/scripts/lib/advisory-text.js +53 -54
- package/plugins/harness-everything/skills/fable-mode/CONTRACT-FORMAT.md +3 -1
- package/plugins/harness-everything/skills/fable-mode/SKILL.md +1 -1
- 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/scripts/workflow-plan-consumer.js +3 -1
- package/plugins/harness-everything/skills/harness-everything/SKILL.md +17 -23
- package/plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md +81 -98
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router-core.js +263 -0
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +97 -212
- package/plugins/harness-everything/skills/harness-everything/scripts/router-contract-core.js +612 -0
- package/plugins/harness-everything/skills/harness-everything/scripts/router-contract.js +21 -581
- package/plugins/harness-everything/skills/using-git-worktrees/SKILL.md +14 -16
- package/plugins/harness-everything/skills/using-git-worktrees/references/workflow-details.md +44 -85
- package/scripts/lib/advisory-text.js +53 -54
- package/using-git-worktrees/SKILL.md +14 -16
- package/using-git-worktrees/references/workflow-details.md +44 -85
package/docs/architecture.md
CHANGED
|
@@ -1,141 +1,154 @@
|
|
|
1
1
|
# Harness Architecture
|
|
2
2
|
|
|
3
|
-
This document describes
|
|
4
|
-
|
|
5
|
-
---
|
|
3
|
+
This document describes Harness runtime architecture and integration boundaries. Current host capability/evidence claims are centralized in [platform-capabilities.md](platform-capabilities.md); package wiring is not live-host proof.
|
|
6
4
|
|
|
7
5
|
## Architectural Overview
|
|
8
6
|
|
|
9
|
-
Harness is a **
|
|
7
|
+
Harness is a **behavior and workflow supervisor**, not one universal fixed workflow. The router chooses the smallest sufficient execution topology; once selected, that topology becomes a lifecycle contract. The model retains freedom over reasoning, tools, and implementation technique inside the contract.
|
|
10
8
|
|
|
11
|
-
The
|
|
9
|
+
The minimal kernel establishes:
|
|
12
10
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
11
|
+
- scope/tier before mutation,
|
|
12
|
+
- a selected workflow topology when task evidence supports one,
|
|
13
|
+
- applicability evaluation for every suggested skill before omission,
|
|
14
|
+
- objective evidence before completion,
|
|
15
|
+
- bounded re-plan/recovery after repeated failure,
|
|
16
|
+
- explicit blocked/degraded/escape state instead of silent workflow deletion.
|
|
17
17
|
|
|
18
|
-
> **
|
|
18
|
+
> **Mandatory applicable workflow; flexible reasoning/implementation inside it.**
|
|
19
|
+
>
|
|
20
|
+
> A suggested skill can be `not-applicable` after evaluating its real flow. A selected topology cannot be replaced with a direct path merely because the model is confident. Escape is only for genuinely uncovered workflow scope and requires evidence.
|
|
19
21
|
|
|
20
|
-
This
|
|
22
|
+
This avoids both extremes: the old universal Tier-2/Tier-3 pipeline and a purely advisory system where the model can rationalize away verification, staging, documentation, or other applicable obligations.
|
|
21
23
|
|
|
22
24
|
```mermaid
|
|
23
25
|
flowchart TD
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Evidence -- No --> Retry[Diagnose / iterate]
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
subgraph Defense [Runtime Boundaries]
|
|
44
|
-
Retry --> CB{Same-signature failure x3?}
|
|
45
|
-
CB -- No --> Tools
|
|
46
|
-
CB -- Yes --> ZO[zoom-out / fresh diagnosis]
|
|
47
|
-
ZO --> Tools
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
subgraph Learning [Optional Learning / State]
|
|
51
|
-
Done --> Record[Record / self-evolve when useful]
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
style Kernel fill:#eceff1,stroke:#37474f,stroke-width:2px,color:#000000
|
|
55
|
-
style Defense fill:#fff9c4,stroke:#fbc02d,stroke-width:2px,color:#000000
|
|
56
|
-
style Learning fill:#e3f2fd,stroke:#1e88e5,stroke-width:2px,color:#000000
|
|
26
|
+
U([User Request]) --> B[Session bootstrap / environment]
|
|
27
|
+
B --> K[kernel-router.js]
|
|
28
|
+
K --> T[tier-router.js<br/>classification + task shape]
|
|
29
|
+
T --> P[Structured workflow plan]
|
|
30
|
+
P --> A{Strategy selected?}
|
|
31
|
+
A -- No / deferred --> D[Preserve invariants<br/>choose smallest justified workflow]
|
|
32
|
+
A -- Yes --> C[ACTIVE workflow contract]
|
|
33
|
+
C --> S{Suggested skills?}
|
|
34
|
+
S -- Yes --> E[Read SKILL.md<br/>resolve applicability]
|
|
35
|
+
S -- No --> X[Execute topology]
|
|
36
|
+
E --> X
|
|
37
|
+
X --> V{Required stage/check resolved?}
|
|
38
|
+
V -- Yes --> Done[Evidence-backed completion]
|
|
39
|
+
V -- No --> R[Diagnose / bounded re-plan]
|
|
40
|
+
R --> X
|
|
41
|
+
R -- topology cannot cover scope --> Esc[Evidence-backed escape<br/>uncovered scope only]
|
|
57
42
|
```
|
|
58
43
|
|
|
59
44
|
### Router responsibilities
|
|
60
45
|
|
|
61
|
-
`kernel-router.js` is the public runtime entry
|
|
46
|
+
`kernel-router.js` is the public runtime entry. It consumes the structured classifier contract and exposes:
|
|
62
47
|
|
|
63
|
-
-
|
|
48
|
+
- tier + rationale,
|
|
49
|
+
- selected/deferred execution strategy,
|
|
64
50
|
- required invariants,
|
|
65
|
-
-
|
|
51
|
+
- suggested skills that require applicability evaluation,
|
|
52
|
+
- the visible routing checkpoint,
|
|
53
|
+
- a workflow execution contract.
|
|
66
54
|
|
|
67
|
-
The
|
|
55
|
+
The router does not tell the model *how* to solve each stage. It decides what lifecycle shape is required. `direct-single`, `iterative-single`, `fable-staged`, `fable-parallel`, and `fable-multi-agent-workspace` remain deliberately small, non-overlapping topology choices.
|
|
68
56
|
|
|
69
|
-
|
|
57
|
+
### Skill applicability vs. topology execution
|
|
70
58
|
|
|
71
|
-
|
|
59
|
+
Router suggestions remain useful domain/workflow knowledge, not a universal sequence. Before omission, the agent reads the complete `SKILL.md` entry and evaluates `USE FOR`, `DO NOT USE FOR`, workflow/basic flow, and hard rules. Name/description/router-summary or “routine task” is insufficient evidence.
|
|
72
60
|
|
|
73
|
-
|
|
61
|
+
The selected topology is stronger. Once selected, it must be entered and resolved unless the runtime records a permitted workflow escape with uncovered scope + evidence. Covered obligations survive the escape.
|
|
74
62
|
|
|
75
|
-
|
|
63
|
+
### Runtime workflow state
|
|
76
64
|
|
|
77
|
-
|
|
65
|
+
On host paths that can persist it, `kernel-router.js` records session-scoped `workflow-run.json` with the selected strategy and lifecycle state. Prompt text is not persisted; only a content hash is retained for correlation.
|
|
78
66
|
|
|
79
|
-
|
|
67
|
+
For selected Fable topologies on Claude:
|
|
80
68
|
|
|
81
|
-
|
|
69
|
+
- `workflow-gate.js` checks supported shell/direct mutation, actual direct/patch targets, and registered Git worktree isolation before major-workflow mutation; Fable also requires a run bound to the workflow/session identity;
|
|
70
|
+
- Fable owns stage contracts, `dependsOn`/`writeSet`, validated execution batches, objective per-stage checks, synthesis, cold verification, and bounded re-plans;
|
|
71
|
+
- `workflow-stop-gate.js` rejects completion while correlated stage contracts remain unresolved;
|
|
72
|
+
- `workflow-disposition.js` starts/replans within budget, records blockers, and permits only declared-stage evidence-backed escape (`workflow-uncovered-scope` or `host-capability-unavailable`). Covered obligations, isolation, and independent verification survive escape. See [runtime transitions and limitations](workflow-runtime.md).
|
|
82
73
|
|
|
83
|
-
|
|
74
|
+
Other topologies use their own applicable mechanisms: loop budgets, regular verification stop-gates, action gates, and task-specific skills. Mechanism coverage is not assumed identical across hosts.
|
|
75
|
+
|
|
76
|
+
## Integration Touchpoints
|
|
84
77
|
|
|
85
|
-
|
|
78
|
+
Harness aligns to each host's actual lifecycle/tool APIs. Shared skill text defines a contract; only supported host mechanisms can mechanically block or observe particular transitions.
|
|
86
79
|
|
|
87
|
-
|
|
80
|
+
### Runtime state vs. skill content
|
|
88
81
|
|
|
89
|
-
|
|
82
|
+
Runtime state includes hook metadata, workflow lifecycle, circuit-breaker counters, handoff/verification evidence, and WAL-style session state. Skill content is independently discoverable and remains useful on instruction-only surfaces.
|
|
90
83
|
|
|
91
|
-
###
|
|
84
|
+
### Claude Code — hook-enforced mechanisms
|
|
92
85
|
|
|
93
86
|
The installer configures native lifecycle hooks and project skills.
|
|
94
87
|
|
|
95
|
-
- `SessionStart`:
|
|
96
|
-
- `UserPromptSubmit`:
|
|
97
|
-
- `PreToolUse`:
|
|
98
|
-
- `PostToolUse`:
|
|
99
|
-
- `Stop`:
|
|
88
|
+
- `SessionStart`: bootstrap/restoration.
|
|
89
|
+
- `UserPromptSubmit`: kernel routing + active workflow contract.
|
|
90
|
+
- `PreToolUse`: workflow bypass gate, action gate, rule-of-3, boundary/depth/context guards, subagent scope guard.
|
|
91
|
+
- `PostToolUse`: outcomes, state, repeated-failure evidence, stage checks.
|
|
92
|
+
- `Stop`: action-gate audit, selected-Fable completion gate, and ordinary verify-before-claim stop gate.
|
|
93
|
+
|
|
94
|
+
These hooks make some lifecycle obligations mechanically enforceable. They still do not prove a real session loaded/fired them; live evidence remains separate.
|
|
95
|
+
|
|
96
|
+
### OpenCode — plugin enforcement, scoped live verification
|
|
100
97
|
|
|
101
|
-
The
|
|
98
|
+
The retained [OpenCode evidence](../benchmarks/results/live-host/opencode-2026-09-16/README.md) supports **project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS)**. The final snapshot is **post-reset**. Hard-lock is an **interactive observation** with **no retained blocked-tool trace**; reflection was **operator-seeded** and then agent-rewritten. Global scope, npm-package installation, and other OpenCode versions remain unverified.
|
|
102
99
|
|
|
103
|
-
|
|
100
|
+
This evidence does not establish the new mandatory-workflow lifecycle on OpenCode. That requires its own adapter/evidence before parity is claimed.
|
|
104
101
|
|
|
105
|
-
|
|
102
|
+
### Cursor — skills plus advisory rules
|
|
106
103
|
|
|
107
|
-
|
|
104
|
+
Cursor receives project skills and advisory rules. The semantic workflow contract can be stated, but unsupported lifecycle transitions are not mechanically enforced.
|
|
108
105
|
|
|
109
|
-
|
|
106
|
+
### GitHub Copilot agent surfaces — skills plus advisory instructions
|
|
110
107
|
|
|
111
|
-
|
|
108
|
+
Copilot receives Agent Skills/repository instructions. No Harness-specific live hook-enforcement claim is made from repository text alone.
|
|
112
109
|
|
|
113
|
-
|
|
110
|
+
### Codex / local OpenAI plugin
|
|
114
111
|
|
|
115
|
-
|
|
112
|
+
Codex has multiple distinct Harness surfaces:
|
|
116
113
|
|
|
117
|
-
|
|
114
|
+
- The general `--codex` installer writes repo-scoped `.agents/skills/` plus `AGENTS.md`; when consumed only as instructions, workflow enforcement is advisory/instruction-governed.
|
|
115
|
+
- The **Codex / local OpenAI plugin** under `plugins/harness-everything/` packages canonical skills plus session/prompt/supported-tool/subagent/stop hooks. The package includes workflow-gate adapters, but this is mechanism/package evidence until a live Codex session proves loading/firing.
|
|
116
|
+
- The public OpenAI **Skills-only** artifact excludes local `.codex-plugin` lifecycle hooks; it carries reusable workflow knowledge, not local hard gates.
|
|
118
117
|
|
|
119
|
-
|
|
120
|
-
- The packaged local OpenAI plugin under `plugins/harness-everything/` includes `.codex-plugin/plugin.json`, all 26 canonical skills, and lifecycle hooks for `SessionStart`, `UserPromptSubmit`, supported local `PreToolUse` / `PostToolUse`, `SubagentStart` / `SubagentStop`, and `Stop`. Those hooks inject the compact session policy, run the invariant-first kernel, track supported edits and verification, and surface subagent scope changes.
|
|
118
|
+
Do not infer Claude parity from package similarity.
|
|
121
119
|
|
|
122
|
-
|
|
120
|
+
### Continue.dev — rules documented, standalone discovery uncertain
|
|
123
121
|
|
|
124
|
-
|
|
122
|
+
Continue uses native rule files; standalone skill discovery remains separately bounded by the capability matrix.
|
|
125
123
|
|
|
126
|
-
###
|
|
124
|
+
### Hermes Agent — trusted skills plus advisory context
|
|
127
125
|
|
|
128
|
-
|
|
126
|
+
Hermes uses trusted project/global skill surfaces plus advisory context. Trust/loading and lifecycle enforcement remain host-specific.
|
|
129
127
|
|
|
130
|
-
|
|
128
|
+
## Fable Execution Architecture
|
|
131
129
|
|
|
132
|
-
|
|
130
|
+
Fable is the execution owner for selected `fable-*` topologies.
|
|
133
131
|
|
|
134
|
-
|
|
132
|
+
```mermaid
|
|
133
|
+
flowchart TD
|
|
134
|
+
P[Selected Fable plan] --> M[Stage map<br/>dependsOn + writeSet]
|
|
135
|
+
M --> B{Validated batch?}
|
|
136
|
+
B -- No --> Block[Blocked / re-plan]
|
|
137
|
+
B -- Yes --> W[Named workers]
|
|
138
|
+
W --> C[Objective stage checks]
|
|
139
|
+
C --> S[Synthesis barrier]
|
|
140
|
+
S --> V{Verification pass?}
|
|
141
|
+
V -- Yes --> D[Delivery evidence]
|
|
142
|
+
V -- No --> R{Re-plan budget remains?}
|
|
143
|
+
R -- Yes --> M
|
|
144
|
+
R -- No --> Block
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The orchestrator controls lifecycle and completion; workers do not create peer-to-peer meshes or widen their own write scope. The model remains creative inside each bounded stage, while stage existence/checks/termination are contract state.
|
|
135
148
|
|
|
136
149
|
## Cognitive OS and Skill Mesh
|
|
137
150
|
|
|
138
|
-
The Cognitive OS
|
|
151
|
+
The Cognitive OS remains a reasoning policy:
|
|
139
152
|
|
|
140
153
|
```mermaid
|
|
141
154
|
flowchart LR
|
|
@@ -148,32 +161,25 @@ flowchart LR
|
|
|
148
161
|
Z --> T
|
|
149
162
|
```
|
|
150
163
|
|
|
151
|
-
A domain skill may
|
|
152
|
-
|
|
153
|
-
This separation solves the peer-skill routing problem: a strong host may correctly decide that a task primarily needs `tdd` or `security-review`; that choice is allowed. What it cannot silently erase is the routing/evidence/retry contract established by the runtime.
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## Security Model & Data Locality
|
|
158
|
-
|
|
159
|
-
Harness runs with a local-first, zero-trust model:
|
|
164
|
+
A domain skill may define RED/GREEN/REFACTOR or another local lifecycle. The selected Harness topology supplies the outer execution contract; domain skills supply tactics/stages when applicable.
|
|
160
165
|
|
|
161
|
-
|
|
162
|
-
2. **Credential protection:** scripts do not require storing user secrets; interactive credentials remain human-controlled.
|
|
163
|
-
3. **Small hook surface:** hook scripts are local Node.js programs and should stay fast and auditable.
|
|
164
|
-
4. **Explicit enforcement labels:** unsupported/advisory behavior must not be documented as hard enforcement.
|
|
165
|
-
5. **Deterministic regression:** mechanism and routing behavior is tested with executable CI gates rather than inferred from documentation.
|
|
166
|
+
## Security and Data Locality
|
|
166
167
|
|
|
167
|
-
|
|
168
|
+
1. **No Harness telemetry service:** project code/state is not uploaded by Harness runtime scripts.
|
|
169
|
+
2. **Credential protection:** credentials remain human/host controlled.
|
|
170
|
+
3. **Small mechanism surface:** hooks should remain fast and auditable.
|
|
171
|
+
4. **Explicit enforcement labels:** instruction, mechanism, and live evidence are distinct.
|
|
172
|
+
5. **Deterministic regression:** workflow/routing/hook contracts are executable CI gates.
|
|
173
|
+
6. **No silent widening:** workflow escape cannot widen authorization, permissions, or external side effects.
|
|
168
174
|
|
|
169
175
|
## Validation Boundary
|
|
170
176
|
|
|
171
|
-
|
|
177
|
+
Validation is layered:
|
|
172
178
|
|
|
173
|
-
- syntax/reference/
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
179
|
+
- syntax/reference/package checks prove package integrity;
|
|
180
|
+
- routing tests prove plan and workflow-contract semantics;
|
|
181
|
+
- mechanism tests prove supported hook/plugin behavior;
|
|
182
|
+
- live-host evidence proves a specific host actually loaded/fired the mechanism;
|
|
183
|
+
- paired behavioral evaluation (#71) is required before claiming the new lifecycle improves outcomes.
|
|
178
184
|
|
|
179
|
-
The architecture
|
|
185
|
+
The architecture diagrams are part of the contract. A runtime orchestration change must update these docs and tests in the same change.
|
|
@@ -1,165 +1,159 @@
|
|
|
1
1
|
# Mechanism-First Skill Mesh
|
|
2
2
|
|
|
3
|
-
Harness
|
|
3
|
+
Harness coordinates independently useful skills through a small workflow runtime. It does **not** make every skill part of one universal DAG, but it also does not leave selected execution topology to model discretion.
|
|
4
4
|
|
|
5
|
-
The preferred shape is
|
|
5
|
+
The preferred shape is:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
> **mandatory applicable workflow + local skill autonomy + narrow runtime mechanisms**
|
|
8
|
+
|
|
9
|
+
Platform-specific enforcement claims remain bounded by [platform-capabilities.md](platform-capabilities.md).
|
|
8
10
|
|
|
9
11
|
## Design Intent
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Each skill remains understandable/executable on its own, while the kernel provides an outer lifecycle contract.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
A skill should answer:
|
|
14
16
|
|
|
15
|
-
1. **When should I activate?**
|
|
16
|
-
2. **What do I protect?** The
|
|
17
|
-
3. **What mechanism do I expose?**
|
|
18
|
-
4. **What
|
|
17
|
+
1. **When should I activate?** Clear `USE FOR` / `DO NOT USE FOR` applicability.
|
|
18
|
+
2. **What do I protect?** The failure mode or engineering discipline it addresses.
|
|
19
|
+
3. **What workflow/mechanism do I expose?** A local flow, verifier, script, gate, or stable result when useful.
|
|
20
|
+
4. **What evidence means I am done?** A check, artifact, or explicit blocked state.
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
The router may surface several skills. Those suggestions must be evaluated from their actual `SKILL.md` flows before omission. They are **not** automatically all executed. Separately, the router selects one smallest sufficient outer topology. **The selected topology is mandatory for the run.**
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
## Why Not One Global Skill Sequence?
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
A universal TODO/TDD/Fable sequence would:
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
- add prompt/runtime overhead to small tasks;
|
|
29
|
+
- confuse domain skills with orchestration topology;
|
|
30
|
+
- suppress useful model judgment inside stages;
|
|
31
|
+
- fail poorly on hosts that cannot enforce the same lifecycle APIs.
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
- It can turn skills into a centralized workflow runner instead of a federation of local engineering disciplines.
|
|
30
|
-
- It can make the model optimize for satisfying the template rather than making the best next engineering move.
|
|
31
|
-
- It adds prompt weight on platforms where the mechanism cannot actually enforce the block.
|
|
33
|
+
So Harness separates **topology** from **capabilities/domain skills**:
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
```text
|
|
36
|
+
tier / task shape
|
|
37
|
+
+
|
|
38
|
+
selected execution topology
|
|
39
|
+
+
|
|
40
|
+
applicable skills/capabilities
|
|
41
|
+
+
|
|
42
|
+
required invariants/gates
|
|
43
|
+
```
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
The topology is the lifecycle contract. Skills are resolved for applicability within/around that contract.
|
|
36
46
|
|
|
37
47
|
## Mechanisms Over Prose
|
|
38
48
|
|
|
39
|
-
|
|
49
|
+
Prefer short structured state, tool results, exit codes, and objective evidence over stronger prompt wording.
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- **Short:** the result should be easy for the model to keep in active attention.
|
|
44
|
-
- **Actionable:** the output should name the next constraint, gate, or recommended skill.
|
|
45
|
-
- **Non-authoritarian:** the mechanism should guide the model without stealing all judgment from it.
|
|
46
|
-
- **Portable:** hook-capable platforms can run the mechanism automatically; hook-less platforms can call the same script explicitly.
|
|
47
|
-
|
|
48
|
-
Example shape:
|
|
51
|
+
Example:
|
|
49
52
|
|
|
50
53
|
```text
|
|
51
54
|
HARNESS_DECISION
|
|
52
55
|
tier: 2
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
strategy: iterative-single
|
|
57
|
+
workflow_state: active
|
|
58
|
+
required: route-before-execution, objective-verification, loop-budget
|
|
59
|
+
suggest: tdd, verification-loop
|
|
60
|
+
suggestion_policy: evaluate-applicability
|
|
61
|
+
escape_policy: workflow-uncovered-scope-only
|
|
56
62
|
```
|
|
57
63
|
|
|
58
|
-
This
|
|
59
|
-
|
|
60
|
-
---
|
|
64
|
+
This says what must happen without prescribing private reasoning or exact implementation tactics.
|
|
61
65
|
|
|
62
|
-
|
|
66
|
+
Good mechanisms are:
|
|
63
67
|
|
|
64
|
-
|
|
68
|
+
- **short** enough to remain salient;
|
|
69
|
+
- **actionable** with an explicit next state;
|
|
70
|
+
- **failable** when a requirement is unmet;
|
|
71
|
+
- **bounded** by host capability/evidence;
|
|
72
|
+
- **non-prescriptive about HOW** unless a safety/contract requirement needs it.
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
## Skill Autonomy Contract
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
- **Local workflow:** the skill should contain enough guidance to execute without reading the whole Harness ecosystem.
|
|
70
|
-
- **Mechanism hook:** if a script can make the skill more reliable, expose it as an optional or required command.
|
|
71
|
-
- **Neighbor links:** when another skill is commonly needed, recommend it by name and explain why.
|
|
72
|
-
- **Exit discipline:** if the skill reaches a blocking state, it should say what evidence is missing or what human decision is needed.
|
|
76
|
+
Every skill should retain:
|
|
73
77
|
|
|
74
|
-
|
|
78
|
+
- an independent trigger;
|
|
79
|
+
- a local workflow;
|
|
80
|
+
- objective/failable checks where possible;
|
|
81
|
+
- explicit neighbor links rather than hidden dependencies;
|
|
82
|
+
- blocked/exit discipline.
|
|
75
83
|
|
|
76
|
-
|
|
84
|
+
Read-before-omission exists so the agent can inspect this local contract without loading the entire ecosystem. If the skill flow applies, follow it; reading a skill is not permission to discard an applicable discipline because the model believes it already knows the answer.
|
|
77
85
|
|
|
78
86
|
## Coordination Patterns
|
|
79
87
|
|
|
80
|
-
Harness should coordinate skills through small, composable patterns.
|
|
81
|
-
|
|
82
88
|
### Router Decision
|
|
83
89
|
|
|
84
|
-
`harness-everything/scripts/kernel-router.js`
|
|
90
|
+
`harness-everything/scripts/kernel-router.js` emits tier, strategy, invariants, skill suggestions, and an execution contract.
|
|
85
91
|
|
|
86
|
-
|
|
92
|
+
- Suggested skills: read and resolve applicability (`use`, `not-applicable`, `unresolved/unavailable`).
|
|
93
|
+
- Selected topology: execute to resolution (`active` → verified/satisfied, blocked, or explicit evidence-backed escape).
|
|
87
94
|
|
|
88
|
-
|
|
95
|
+
Names/descriptions/router summaries or “routine task” judgements cannot resolve applicability by themselves.
|
|
96
|
+
|
|
97
|
+
### Fable Stage Contracts
|
|
98
|
+
|
|
99
|
+
For `fable-*` strategies, Fable owns stage lifecycle: `dependsOn`, `writeSet`, validated batches, objective checks, synthesis, cold verification, and bounded re-planning. The parent cannot replace a selected Fable topology with direct editing on hook-capable paths that package the workflow gate.
|
|
89
100
|
|
|
90
101
|
### Verification Gate
|
|
91
102
|
|
|
92
|
-
`verification-loop
|
|
103
|
+
`verification-loop`, `verify-gate.js`, ordinary stop-gates, and Fable stage evidence provide objective completion signals. Verification is not an optional courtesy when selected/applicable workflow state requires it.
|
|
93
104
|
|
|
94
105
|
### Recovery Gate
|
|
95
106
|
|
|
96
|
-
|
|
107
|
+
Rule-of-3 stops repeated same-signature micro-retries and requires a new diagnosis. Fable verification failures return to bounded re-planning; budget exhaustion becomes blocked instead of endless iteration.
|
|
97
108
|
|
|
98
|
-
###
|
|
109
|
+
### Action Gate
|
|
99
110
|
|
|
100
|
-
|
|
111
|
+
Irreversible/external side effects are orthogonal to topology and require their pre-action gate where supported. Workflow escape never widens permissions or bypasses action approval.
|
|
101
112
|
|
|
102
|
-
|
|
113
|
+
### Self-Evolve
|
|
103
114
|
|
|
104
|
-
|
|
115
|
+
Learning should consume verified lifecycle evidence (escape, re-plan, recovery, recurrence), not operate as a side door around the active workflow.
|
|
105
116
|
|
|
106
|
-
|
|
117
|
+
## Platform Strategy
|
|
107
118
|
|
|
108
|
-
| Platform class |
|
|
119
|
+
| Platform class | Workflow contract | Mechanical enforcement |
|
|
109
120
|
| --- | --- | --- |
|
|
110
|
-
| Hook/plugin-capable
|
|
111
|
-
| CLI/tool-capable
|
|
112
|
-
| Prompt-only
|
|
113
|
-
|
|
114
|
-
One host may expose more than one surface. Codex is the important example: the general `--codex` installer path is instruction/advisory oriented, while the **local OpenAI plugin** packages session, prompt, supported-tool, subagent, and stop hooks for mechanism-tested runtime enforcement. The public OpenAI **Skills-only** submission does not include those local lifecycle hooks.
|
|
115
|
-
|
|
116
|
-
OpenCode is plugin-capable and has mechanism coverage, but live plugin loading remains unverified. Claude Code has the broadest currently verified Harness lifecycle-hook surface.
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## Guidance for Instruction-Only / Hook-Less Paths
|
|
121
|
-
|
|
122
|
-
Do not recreate hooks with a rigid universal handoff template. Instead, make mechanisms easy to call.
|
|
121
|
+
| Hook/plugin-capable | Same selected-workflow contract | Supported transitions can be blocked/observed by packaged mechanisms |
|
|
122
|
+
| CLI/tool-capable without lifecycle hooks | Same contract stated/called explicitly | Instruction/mechanism guided; no automatic blocking claim |
|
|
123
|
+
| Prompt-only | Same semantic obligations | Self-regulated only |
|
|
123
124
|
|
|
124
|
-
|
|
125
|
+
Contract semantics and enforcement evidence are separate. Claude currently packages the broadest Harness lifecycle surface. The local OpenAI/Codex plugin packages supported adapters but requires live-host evidence before parity claims. The public OpenAI Skills-only artifact carries skill/workflow knowledge without local lifecycle hooks. OpenCode has its own plugin path and evidence boundaries.
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
- `npx github:dyphn1/Harness-everything verify`: wraps `verify-gate.js`, running the target project's own lint/test scripts and exiting non-zero on failure. This is the explicit hook-less verification path; it is not equivalent to claiming that a host automatically runs a `Stop` hook.
|
|
127
|
+
## Hook-Less Paths
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
Two explicit commands provide high-signal state without pretending hooks exist:
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
These commands let instruction-only Codex installs, Cursor, Copilot, Continue, and Hermes receive high-signal mechanical feedback without forcing them into a single scripted conversation shape.
|
|
131
|
+
```bash
|
|
132
|
+
npx github:dyphn1/Harness-everything next "<prompt>"
|
|
133
|
+
npx github:dyphn1/Harness-everything verify
|
|
134
|
+
```
|
|
137
135
|
|
|
138
|
-
|
|
136
|
+
`next` emits the routing/workflow contract. `verify` runs the explicit verification path. Instruction-only hosts must treat these requirements as real even though the host cannot mechanically prevent skipping them.
|
|
139
137
|
|
|
140
138
|
## Anti-Goals
|
|
141
139
|
|
|
142
140
|
Harness should not become:
|
|
143
141
|
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
|
|
150
|
-
The mesh should remain local, legible, and cooperative.
|
|
151
|
-
|
|
152
|
-
---
|
|
142
|
+
- one global DAG containing every skill;
|
|
143
|
+
- a mandatory response-template system;
|
|
144
|
+
- a command-only framework whose skills are unreadable without runtime code;
|
|
145
|
+
- a hidden daemon with broad authority;
|
|
146
|
+
- a system that claims cross-host hard enforcement from package text;
|
|
147
|
+
- a recommendation system where selected workflows can be rationalized away.
|
|
153
148
|
|
|
154
149
|
## Practical Authoring Rules
|
|
155
150
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
6. Document neighboring skills as recommendations, not hidden dependencies, unless the dependency is required for safety.
|
|
151
|
+
1. Keep skills independently understandable/executable.
|
|
152
|
+
2. Put applicability/basic flow in `SKILL.md`; deep detail belongs in references.
|
|
153
|
+
3. Add mechanisms when they make behavior more reliable than prose.
|
|
154
|
+
4. Make checks failable and evidence-based.
|
|
155
|
+
5. Put gates at real transition boundaries: before mutation/side effects, after repeated failure, before completion, before persistence.
|
|
156
|
+
6. Let the model choose HOW inside the contract.
|
|
157
|
+
7. Treat workflow escape as a measured coverage gap, not convenience.
|
|
164
158
|
|
|
165
|
-
The result should feel like
|
|
159
|
+
The result should feel like a capable engineer operating inside explicit lifecycle obligations rather than either a scripted automaton or an unconstrained model that can skip its own process.
|
package/docs/openai-plugin.md
CHANGED
|
@@ -28,7 +28,7 @@ flowchart TD
|
|
|
28
28
|
X[Stop hook] --> V
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
The local OpenAI adapter enforces cross-cutting invariants through the lifecycle events that it packages.
|
|
31
|
+
The local OpenAI adapter enforces cross-cutting invariants through the lifecycle events that it packages. Suggested skills require applicability evaluation; the selected topology is mandatory with scoped, evidence-backed escape. The [workflow runtime](workflow-runtime.md) documents pending/running/satisfied/blocked state, Fable entry, worktree isolation, completion evidence, and degradation limits. Tool enforcement is limited to the host tool names declared in `hooks/hooks.json`.
|
|
32
32
|
|
|
33
33
|
## Package layout
|
|
34
34
|
|