harness-everything 0.19.0 → 0.19.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.
Files changed (64) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/AGENTS.md +3 -2
  4. package/CHANGELOG.md +2 -0
  5. package/README.md +14 -14
  6. package/ci/invariant-routing.test.js +42 -19
  7. package/ci/mechanism-2af-worktree-isolation.test.js +3 -3
  8. package/ci/mechanism-2ag-router-worktree-contract.test.js +1 -0
  9. package/ci/mechanism-2an-workflow-obligations.test.js +1 -0
  10. package/ci/mechanism-33-issues-205-207.test.js +2 -2
  11. package/ci/openai-plugin-package.test.js +6 -6
  12. package/ci/router-workflow-plan.test.js +12 -9
  13. package/ci/workflow-execution-contract.test.js +2 -2
  14. package/docs/architecture.md +15 -15
  15. package/docs/enforcement-locks.md +17 -15
  16. package/docs/philosophy.md +43 -8
  17. package/docs/routing.md +23 -16
  18. package/docs/workflow-runtime.md +20 -19
  19. package/environment-detection/SKILL.md +3 -1
  20. package/evals/harness-everything/tasks/positive-tier1.yaml +1 -1
  21. package/evals/harness-everything/tasks/positive-tier2.yaml +1 -1
  22. package/evals/harness-everything/tasks/positive-tier3.yaml +1 -1
  23. package/evals/using-git-worktrees/tasks/positive-trigger.yaml +1 -1
  24. package/find-skills/SKILL.md +20 -29
  25. package/git-commit/SKILL.md +4 -4
  26. package/harness-everything/SKILL.md +16 -17
  27. package/harness-everything/references/triage-and-tiers.md +17 -16
  28. package/harness-everything/scripts/kernel-router-core.js +26 -24
  29. package/harness-everything/scripts/kernel-router.js +8 -8
  30. package/harness-everything/scripts/router-contract-core.js +7 -7
  31. package/harness-everything/scripts/router-contract.js +1 -1
  32. package/hooks/scripts/atomic-commit-check.js +1 -1
  33. package/hooks/scripts/boundary-guard.js +2 -2
  34. package/hooks/scripts/depth-guard.js +5 -6
  35. package/hooks/scripts/subagent-scope-guard.js +2 -2
  36. package/hooks/scripts/workflow-gate.js +1 -1
  37. package/install-cognitive-os/SKILL.md +3 -3
  38. package/opencode-plugin/plugin.json +1 -1
  39. package/package.json +1 -1
  40. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  41. package/plugins/harness-everything/hooks/scripts/atomic-commit-check.js +1 -1
  42. package/plugins/harness-everything/hooks/scripts/boundary-guard.js +2 -2
  43. package/plugins/harness-everything/hooks/scripts/depth-guard.js +5 -6
  44. package/plugins/harness-everything/hooks/scripts/subagent-scope-guard.js +2 -2
  45. package/plugins/harness-everything/hooks/scripts/workflow-gate.js +1 -1
  46. package/plugins/harness-everything/plugin.json +1 -1
  47. package/plugins/harness-everything/scripts/lib/advisory-text.js +19 -17
  48. package/plugins/harness-everything/skills/environment-detection/SKILL.md +3 -1
  49. package/plugins/harness-everything/skills/find-skills/SKILL.md +20 -29
  50. package/plugins/harness-everything/skills/git-commit/SKILL.md +4 -4
  51. package/plugins/harness-everything/skills/harness-everything/SKILL.md +16 -17
  52. package/plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md +17 -16
  53. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router-core.js +26 -24
  54. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +8 -8
  55. package/plugins/harness-everything/skills/harness-everything/scripts/router-contract-core.js +7 -7
  56. package/plugins/harness-everything/skills/harness-everything/scripts/router-contract.js +1 -1
  57. package/plugins/harness-everything/skills/install-cognitive-os/SKILL.md +3 -3
  58. package/plugins/harness-everything/skills/rewrite-commits/SKILL.md +2 -2
  59. package/plugins/harness-everything/skills/to-tickets/SKILL.md +2 -2
  60. package/plugins/harness-everything/skills/using-git-worktrees/SKILL.md +6 -6
  61. package/rewrite-commits/SKILL.md +2 -2
  62. package/scripts/lib/advisory-text.js +19 -17
  63. package/to-tickets/SKILL.md +2 -2
  64. package/using-git-worktrees/SKILL.md +6 -6
@@ -10,7 +10,7 @@
10
10
  "name": "harness-everything",
11
11
  "source": "./",
12
12
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
13
- "version": "0.19.0",
13
+ "version": "0.19.1",
14
14
  "author": {
15
15
  "name": "Miya Daniel"
16
16
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "harness-everything",
3
3
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
4
- "version": "0.19.0",
4
+ "version": "0.19.1",
5
5
  "author": {
6
6
  "name": "Miya Daniel"
7
7
  },
package/AGENTS.md CHANGED
@@ -40,9 +40,10 @@ The retained [OpenCode evidence](benchmarks/results/live-host/opencode-2026-09-1
40
40
  7. **Runtime/workflow claims are generated facts.** `package.json`, `.nvmrc`, Dockerfile, and active workflows feed `scripts/repository-contract.js`; run `npm run docs:sync` after relevant changes.
41
41
  8. **CHANGELOG.md keeps pending human-authored notes under `[Unreleased]`.** Semantic-release owns stable headings/tags/release notes.
42
42
  9. **Conventional Commit type is release input.** Breaking→major; `feat`→minor; `fix`/`perf`/`refactor`/`build`/`revert`→patch; docs/test/ci/style/chore do not release by themselves.
43
- 10. **Selected workflow is planning guidance; reasoning and execution stay flexible.** Before omitting a suggested skill, read/evaluate its complete `SKILL.md` flow. Do not turn routing into a universal TODO/TDD/Fable sequence. Missing workflow evidence should produce a reminder, not a persistent Harness lock.
43
+ 10. **Selected workflow is a semantic contract; tactics remain flexible.** Suggested skills MUST be read/evaluated before omission; applicable skill core contracts MUST be followed, while not-applicable requires a flow-grounded reason. Selected-topology required obligations MUST resolve. Missing host evidence may produce reminders, not a persistent Harness lock.
44
44
  11. **User-visible Harness Status is mandatory for non-trivial work.** Render one readable Markdown block headed `### 🚦 Harness Status`, with bullet-aligned bold `Current`, `Read / Evidence`, `Next`, plus optional `Risk / Blocked`; use nested evidence bullets when useful. Emit it before substantive execution, after major phases, on direction changes, during long work at meaningful boundaries, and before final completion. The routing checkpoint is internal source state, not a second user-facing block. This semantic MUST does not create a hard lock.
45
- 12. **Prefer Git worktree isolation for major mutation.** Read-only discovery may stay in the bound repository. Tier 3 / Fable source and artifact changes should use a verified linked worktree when practical; failure to create one is a prominent risk reminder, not a Harness-owned deadlock. See [workflow-runtime.md](docs/workflow-runtime.md).
45
+ 12. **Tier-3/Fable isolation disposition is mandatory before broad mutation.** Use/reuse a verified linked Git worktree, or record an explicit degraded fallback when isolation is unavailable or the user explicitly chooses to stay in place. Ordinary isolation SHOULD be used when it materially reduces collision/risk. Failure to isolate is a visible semantic gap, not a Harness-owned deadlock. See [workflow-runtime.md](docs/workflow-runtime.md).
46
+ 13. **Use contract strength deliberately.** MUST = required semantic obligation; SHOULD = expected default with an evidence-based exception; MAY = optional optimization. Do not use recommend/prefer/advisory/guidance to weaken a MUST. See [philosophy.md](docs/philosophy.md#contract-strength-must--should--may).
46
47
 
47
48
  ## Verification Before You Claim Done
48
49
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.19.1](https://github.com/dyphn1/Harness-everything/compare/v0.19.0...v0.19.1) (2026-09-21)
6
+
5
7
  ## [0.19.0](https://github.com/dyphn1/Harness-everything/compare/v0.18.1...v0.19.0) (2026-09-21)
6
8
 
7
9
  ### Features
package/README.md CHANGED
@@ -19,7 +19,7 @@ AI coding agents are highly capable, but they struggle with self-regulation, env
19
19
 
20
20
  Harness acts as an automated system supervisor. It remains completely silent and out of the way, intervening only when execution boundaries are violated or failures are detected.
21
21
 
22
- Harness deliberately follows a **minimal rails, maximum freedom** design: the runtime establishes routing context, observes verification evidence, and emits lightweight reminders. It does not hard-stop work on iteration/revision/replan/worker counts. The one cognitive hard boundary is Rule of 3: three matching failures pause mutation for a zoom-out reflection. When routing emits skill suggestions, it adds one conditional rail: **evaluate before skip**. The agent must read each suggested skill's `SKILL.md` entry/basic flow before omitting it, but remains free to choose, combine, reorder, or skip execution after that evaluation.
22
+ Harness deliberately follows a **minimal rails, maximum freedom** design: semantic obligations are explicit, while runtime observation remains lightweight and mostly fail-open. It does not hard-stop work on iteration/revision/replan/worker counts. The one cognitive hard boundary is Rule of 3: three matching failures pause mutation for a zoom-out reflection. Router suggestions are conditional by applicability, not optional by default: the agent MUST read/evaluate each suggested skill; if applicable, its core contract MUST be followed, and if not applicable a flow-grounded reason MUST be retained. Implementation tactics remain flexible inside those obligations.
23
23
 
24
24
  ### Comparison: Prompt vs. Skill vs. Harness
25
25
 
@@ -48,7 +48,7 @@ The exact "Harness" behavior depends on the installation surface. Claude Code ha
48
48
 
49
49
  Harness integrates directly into your workspace. There is no heavy daemon, no paid external APIs, and zero configuration required.
50
50
 
51
- **Runtime:** Harness supports **Node.js 22+**. Node.js **24** is the primary/recommended development and CI runtime (`.nvmrc`). The generated current-state runtime/workflow summary is [docs/repository-contract.md](docs/repository-contract.md).
51
+ **Runtime:** Harness supports **Node.js 22+**. Node.js **24** is the primary development and CI runtime (`.nvmrc`). The generated current-state runtime/workflow summary is [docs/repository-contract.md](docs/repository-contract.md).
52
52
 
53
53
  ```bash
54
54
  # Option A: Claude Code plugin (marketplace manifest included)
@@ -73,7 +73,7 @@ npx github:dyphn1/Harness-everything install
73
73
  1. **Use the selected surface's real mechanism:** Claude Code hooks, the local OpenAI plugin lifecycle hooks, OpenCode's plugin API, or advisory instructions depending on what you installed.
74
74
  2. **Preflight / session context where packaged:** Hook-capable surfaces can inject environment/session context automatically; advisory-only surfaces must not be described as if they do.
75
75
  3. **Verification boundary:** Completion claims require objective evidence; whether that boundary is mechanically invoked or explicitly called depends on the host surface.
76
- 4. **Mandatory applicable workflow:** Evaluate each suggested skill's complete `SKILL.md` before omission, then resolve the selected topology with objective evidence. Reasoning and implementation remain flexible; escape applies only to a declared uncovered stage with evidence. Tier 3 / Fable mutation requires a verified Git worktree. See the [workflow runtime contract](docs/workflow-runtime.md) for entry, completion, and host limits. Harness does not impose one universal TODO/TDD/Fable sequence.
76
+ 4. **Mandatory applicable workflow:** MUST evaluate each suggested skill's complete `SKILL.md`; applicable core contracts MUST be followed, while not-applicable needs a flow-grounded reason. Selected-topology required obligations MUST resolve with objective evidence. Reasoning and implementation remain flexible; escape applies only to declared uncovered scope with evidence. Tier-3/Fable broad mutation MUST resolve isolation: verified linked worktree or explicit degraded fallback. See the [workflow runtime contract](docs/workflow-runtime.md). Harness does not impose one universal TODO/TDD/Fable sequence.
77
77
  5. **Unified user-visible status:** For non-trivial software/project work, the agent MUST render one scannable Markdown `### 🚦 Harness Status` block with bold bullet labels for `Current`, `Read / Evidence`, `Next`, plus optional `Risk / Blocked`; multiple evidence items may use nested bullets. Use it at major phase/direction boundaries and before final completion. The routing checkpoint remains internal source state. This is a communication contract, not a hard runtime lock.
78
78
 
79
79
  ### What Gets Installed (and How to Remove It)
@@ -127,7 +127,7 @@ flowchart TD
127
127
  ```mermaid
128
128
  flowchart TD
129
129
  U([User Request]) --> K[Harness Kernel<br/>classify scope + establish invariants]
130
- K --> T{Tier recommendation}
130
+ K --> T{Tier classification}
131
131
  T --> S{Suggested skills?}
132
132
  S -->|Yes| R[Read each suggested SKILL.md<br/>evaluate flow + applicability]
133
133
  S -->|No| A[Agent chooses smallest useful tactic / skill set]
@@ -147,7 +147,7 @@ flowchart TD
147
147
  style Gate fill:#ffcdd2,stroke:#c62828,stroke-width:1px,color:#000000
148
148
  ```
149
149
 
150
- The Tier changes the **recommendations**, not the required order. Tier 2 may suggest `tdd`, `todo-driven-workflow`, or `verification-loop`; Tier 3 may suggest Fable or multi-agent capabilities. Suggestions are **mandatory to evaluate and advisory to execute**: read each suggested skill's `SKILL.md` flow before omission, then let the model decide what actually helps.
150
+ The Tier changes task shape and the set of **suggested skills**, not a universal required order. Tier 2 may suggest `tdd`, `todo-driven-workflow`, or `verification-loop`; Tier 3 may select Fable or multi-agent topologies. Every suggestion is **MUST-evaluate**: if its real flow is applicable, the core contract becomes **MUST-follow**; otherwise retain a flow-grounded not-applicable reason. Tactics inside the resulting contract remain model-controlled.
151
151
 
152
152
  ---
153
153
 
@@ -155,7 +155,7 @@ The Tier changes the **recommendations**, not the required order. Tier 2 may sug
155
155
 
156
156
  Harness operates through six core cognitive concepts:
157
157
 
158
- 1. **Kernel Router (`kernel-router.js` + `tier-router.js`):** `tier-router.js` remains the classifier, dynamic-skill detector, and knowledge-guide matcher. `kernel-router.js` is the public runtime boundary: it preserves the classifier result, removes legacy fixed-pipeline instructions, injects the baseline invariants, and adds `evaluate-suggestions-before-skip` whenever domain skills are suggested. Suggestions are mandatory to evaluate by reading their `SKILL.md` entry/basic flow, but advisory to execute after evaluation. This prevents host peer-skill selection or superficial routing summaries from bypassing Harness while preserving agent autonomy. If nothing matches at all — including nothing already kept from the open skills ecosystem — `find-skills` checks `npx skills list` live and, if still nothing, searches `skills.sh`/`npx skills` with explicit approval before installation.
158
+ 1. **Kernel Router (`kernel-router.js` + `tier-router.js`):** `tier-router.js` remains the classifier, dynamic-skill detector, and knowledge-guide matcher. `kernel-router.js` is the public runtime boundary: it preserves the classifier result, injects baseline MUST invariants, and adds `evaluate-suggestions-before-skip` whenever domain skills are suggested. Suggestions MUST be evaluated from their real `SKILL.md` flow; an applicable skill's core contract MUST be followed, while not-applicable needs evidence. Selected-topology obligations are also semantic MUSTs, but the runtime generally observes/reminds rather than hard-blocking. This preserves agent autonomy over tactics without allowing confidence to erase the lifecycle. If nothing matches at all — including nothing already kept from the open skills ecosystem — `find-skills` checks `npx skills list` live and, if still nothing, searches `skills.sh`/`npx skills` with explicit approval before installation.
159
159
  2. **Guard (`rule-of-3.js`):** The fail-safe circuit breaker. Tracks failure signatures across terminal runs on integration surfaces that package the required lifecycle hooks. If a test or command fails 3 times with the same signature, it locks mutating tools and forces a `zoom-out` reflection: re-verify every assumption with read-only tools, write a fact-checked report, then resume on a fresh diagnosis. A companion `Stop` hook (`stop-gate.js`) emits a non-blocking reminder when edits were never followed by successful verification on hosts where that hook is installed.
160
160
  3. **Memory (`state-persist.js`):** Session transaction logging for stateful hook/plugin integrations. Static skills/instructions alone do not create WAL state.
161
161
  4. **Reflection (`self-evolve`):** Long-term workspace immunization. Upon task completion, the agent reflects on the root cause of resolved issues, then judges whether the lesson is a simple rule or a reusable, complex pattern: simple rules are appended to local workspace rules (`RULES.md`); genuinely reusable patterns are instead packaged as a dynamic skill (via `skill-creator`'s Dynamic Skill Generation Contract) and registered in `manifest.json` so the Router picks it up in future sessions. Either path is validated by a hermetic self-regression suite before it's persisted.
@@ -172,10 +172,10 @@ The authoritative current matrix is [docs/platform-capabilities.md](docs/platfor
172
172
 
173
173
  | AI Agent Tool / Surface | Integration Method | Local Target Location | Enforcement claim |
174
174
  |---|---|---|---|
175
- | **Claude Code** | Native lifecycle hooks (`PreToolUse`, `PostToolUse`, `SessionStart`, `UserPromptSubmit`, `Stop`) | `.claude/settings.json`, `.claude/skills/`, `.claude/agents/` | Workflow/productivity guidance is reminder-oriented; Rule-of-3 reflection and explicit permission boundaries may block |
175
+ | **Claude Code** | Native lifecycle hooks (`PreToolUse`, `PostToolUse`, `SessionStart`, `UserPromptSubmit`, `Stop`) | `.claude/settings.json`, `.claude/skills/`, `.claude/agents/` | Semantic workflow contracts are reminder-observed; Rule-of-3 reflection and explicit permission boundaries may block |
176
176
  | **OpenCode** | Native plugin module ([`opencode-plugin/index.mjs`](opencode-plugin/index.mjs), install as `harness-enforcement.js`) | `.opencode/plugins/` | **Partial live-host evidence** — project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS); current workflow/verification behavior is reminder-oriented, with only the third-failure reflection boundary blocking edits |
177
- | **Codex — general installer path** | Skills + `AGENTS.md` guidance | `AGENTS.md` + repo-scoped `.agents/skills/` | **Advisory/instruction-oriented** where the host only consumes instructions |
178
- | **Codex / local OpenAI plugin** | `.codex-plugin` package with session, prompt, supported-tool, subagent, and stop hooks plus 26 canonical skills | `.agents/plugins/marketplace.json` → `plugins/harness-everything/` | **Mechanism-tested local guidance plus explicit permission/Rule-of-3 boundaries** for the packaged mappings; live host loading remains unverified |
177
+ | **Codex — general installer path** | Skills + `AGENTS.md` instructions | `AGENTS.md` + repo-scoped `.agents/skills/` | **Instruction/advisory delivery only**; semantic MUST/SHOULD/MAY still applies, without a hard-enforcement claim |
178
+ | **Codex / local OpenAI plugin** | `.codex-plugin` package with session, prompt, supported-tool, subagent, and stop hooks plus 26 canonical skills | `.agents/plugins/marketplace.json` → `plugins/harness-everything/` | **Mechanism-tested local contract observation plus explicit permission/Rule-of-3 boundaries** for the packaged mappings; live host loading remains unverified |
179
179
  | **Public OpenAI Skills-only plugin** | Public Skills-only bundle | Generated submission ZIP from `plugins/harness-everything/skills/` | **Skill/workflow behavior only**; no local `.codex-plugin` lifecycle hooks in the public artifact |
180
180
  | **Cursor** | Native Project Rules + project skills | `.cursorrules` + `.cursor/skills/` | Advisory only |
181
181
  | **GitHub Copilot agent surfaces** | Agent Skills + repository custom instructions | `.github/copilot-instructions.md` + `.github/skills/` | Agent Skills path is documented; no live Harness session or plugin install is verified |
@@ -246,9 +246,9 @@ This repo uses a flat layout (waza/agentskills.io convention). The table below m
246
246
  | `skill-creator` | **Meta** | Create new skills from patterns |
247
247
  | `skill-style` | **Meta** | Skill authoring style guide |
248
248
  | `tdd` | **Skill (Tier 2)** | Test-driven development when executable behavior benefits from it |
249
- | `to-spec` | **Advisory (Tier 2/3)** | Publish specs from settled conversations |
250
- | `to-tickets` | **Advisory (Tier 2/3)** | Decompose settled specs into tracked tickets |
251
- | `todo-driven-workflow` | **Advisory Foundation** | Progress tracking when explicit multi-step state helps |
249
+ | `to-spec` | **Optional (MAY, Tier 2/3)** | Publish specs from settled conversations |
250
+ | `to-tickets` | **Optional (MAY, Tier 2/3)** | Decompose settled specs into tracked tickets |
251
+ | `todo-driven-workflow` | **Optional Foundation (MAY)** | Progress tracking when explicit multi-step state helps |
252
252
  | `using-git-worktrees` | **Skill (Tier 2)** | Git worktree concurrency patterns |
253
253
  | `verification-loop` | **Skill (Tier 2)** | Select systematic verification evidence; kernel still requires evidence before completion |
254
254
  | `verify-before-claim` | **Always-on discipline** | Fact-audit before asserting claims |
@@ -263,7 +263,7 @@ For a deep dive into individual modules and the underlying philosophy, explore o
263
263
 
264
264
  * [Harness Philosophy](docs/philosophy.md): The core behavior-first, intervention-only design.
265
265
  * [Harness Architecture](docs/architecture.md): Lifecycle hooks, security model, and data locality.
266
- * [Guidance and Safety Boundary Diagnostic Flows](docs/enforcement-locks.md): Distinguish reminders from the two intentional blocking boundaries and understand recovery.
266
+ * [Semantic Contracts and Safety Boundary Diagnostic Flows](docs/enforcement-locks.md): Distinguish MUST/SHOULD/MAY obligations from reminder mechanics and the two intentional blocking boundaries.
267
267
  * [Platform Capability Matrix](docs/platform-capabilities.md): Canonical current enforcement/install/evidence boundary per surface.
268
268
  * [Repository Runtime & Workflow Contract](docs/repository-contract.md): Generated Node/action/workflow/gate state used by consistency CI.
269
269
  * [OpenAI / ChatGPT Plugin Packaging](docs/openai-plugin.md): Local Codex/OpenAI plugin packaging plus public Skills-only submission boundary.
@@ -273,7 +273,7 @@ For a deep dive into individual modules and the underlying philosophy, explore o
273
273
 
274
274
  Fable model selection is documented in [fable-mode/references/model-matrix.md](fable-mode/references/model-matrix.md); the explicit entrypoints are `fable-haiku`, `fable-sonnet`, and `fable-opus`.
275
275
 
276
- Maintainers should follow [RELEASING.md](RELEASING.md) for tag-driven npm releases and record observations in [docs/release-evidence.md](docs/release-evidence.md). Issue #20 is closed (2026-09-10); its coordination history lives in git.
276
+ Maintainers **MUST** follow [RELEASING.md](RELEASING.md) for tag-driven npm releases and record observations in [docs/release-evidence.md](docs/release-evidence.md). Issue #20 is closed (2026-09-10); its coordination history lives in git.
277
277
 
278
278
  ---
279
279
 
@@ -4,18 +4,18 @@ const fs=require('fs'),path=require('path'),{spawnSync}=require('child_process')
4
4
  const ROOT=path.resolve(__dirname,'..');let failed=0;
5
5
  function check(c,m){if(c)console.log(' PASS '+m);else{console.error(' FAIL '+m);failed++;}}
6
6
  function read(p){return fs.readFileSync(path.join(ROOT,p),'utf8');}
7
- console.log('=== Guidance-First Routing Contract ===');
7
+ console.log('=== Semantic Contract-Strength Routing Contract ===');
8
8
  const kernel=path.join(ROOT,'harness-everything/scripts/kernel-router.js');
9
9
  const tier2=spawnSync(process.execPath,[kernel,'add a login endpoint with tests and update the implementation'],{cwd:ROOT,encoding:'utf8'});
10
10
  check(tier2.status===0,'kernel router exits successfully');
11
11
  check(/RECOMMENDED TIER:\s*Tier 2/i.test(tier2.stdout),'classifier result is preserved');
12
- check(tier2.stdout.includes('"strategy":"iterative-single"'),'Tier 2 selects iterative-single guidance');
12
+ check(tier2.stdout.includes('"strategy":"iterative-single"'),'Tier 2 selects iterative-single workflow');
13
13
  check(tier2.stdout.includes('loop-awareness:'),'iterative work exposes loop-awareness instead of a hard budget');
14
- check(tier2.stdout.includes('SELECTED WORKFLOW IS GUIDANCE'),'suggested workflow is explicitly guidance');
15
- check(tier2.stdout.includes('ORCHESTRATION POLICY: Selected topology is planning guidance'),'orchestration policy is guidance-first');
16
- check(tier2.stdout.includes('WORKFLOW GUIDANCE (ADVISORY WHEN SELECTED)'),'kernel emits advisory workflow guidance');
17
- check(tier2.stdout.includes('missing isolation is a strong reminder, not a Harness lock'),'worktree guidance is non-blocking');
18
- check(!tier2.stdout.includes('WORKFLOW EXECUTION CONTRACT (MANDATORY'),'old mandatory execution contract is absent');
14
+ check(tier2.stdout.includes('WORKFLOW SKILLS (APPLICABILITY MUST BE RESOLVED)'),'skill applicability is explicitly mandatory');
15
+ check(tier2.stdout.includes('ORCHESTRATION POLICY: Selected-topology required obligations and applicable skill core contracts are semantic MUSTs'),'orchestration policy preserves semantic MUST obligations');
16
+ check(tier2.stdout.includes('WORKFLOW SEMANTIC CONTRACT (NON-BLOCKING OBSERVATION)'),'kernel separates semantic contract from non-blocking observation');
17
+ check(tier2.stdout.includes('Tier 3 / Fable broad mutation MUST resolve isolation'),'worktree isolation disposition is a semantic MUST');
18
+ check(!tier2.stdout.includes('SELECTED WORKFLOW IS GUIDANCE'),'old planning-guidance label is absent');
19
19
  check(!tier2.stdout.includes('unavailable isolation means BLOCKED'),'old worktree hard-block wording is absent');
20
20
  check(tier2.stdout.includes('evaluate-suggestions-before-skip'),'skill suggestions still require evaluation before omission');
21
21
  check(tier2.stdout.includes('visible-status-updates'),'workflow plan carries mandatory user-visible status invariant');
@@ -31,46 +31,69 @@ check(tier2.stdout.includes('semantic communication MUST, not a hard execution l
31
31
  const tier3=spawnSync(process.execPath,[kernel,'audit the entire repository architecture and coordinate multiple modules'],{cwd:ROOT,encoding:'utf8'});
32
32
  check(tier3.status===0,'Tier 3 routing exits successfully');
33
33
  check(/RECOMMENDED TIER:\s*Tier 3/i.test(tier3.stdout),'macro task remains Tier 3');
34
- check(tier3.stdout.includes('using-git-worktrees'),'Tier 3 still recommends worktree guidance');
35
- check(tier3.stdout.includes('WORKFLOW GUIDANCE (ADVISORY WHEN SELECTED)'),'Tier 3 workflow remains advisory');
34
+ check(tier3.stdout.includes('using-git-worktrees'),'Tier 3 still routes the worktree skill');
35
+ check(tier3.stdout.includes('Tier 3 / Fable broad mutation MUST resolve isolation'),'Tier 3 requires an isolation disposition without a hard lock');
36
36
 
37
37
  const hs=read('harness-everything/SKILL.md');
38
- check(/workflow state and numeric limits guide; they do not hard-stop execution/i.test(hs),'Harness skill states non-blocking workflow contract');
38
+ check(/required obligations are MUST; tactics MAY adapt/i.test(hs),'Harness skill separates required obligations from adaptable tactics');
39
39
  check(/only Rule-of-3 reflection and explicit user\/host permission boundaries may block/i.test(hs),'Harness skill names the only intentional blocking boundaries');
40
- check(/Surface status.*MUST render.*Harness Status/i.test(hs)&&/bold bullets/i.test(hs)&&/Read \/ Evidence/i.test(hs),'Harness skill requires the readable unified user-visible status');
40
+ check(/Surface status \(MUST\).*Harness Status/i.test(hs)&&/Read \/ Evidence/i.test(hs),'Harness skill requires the readable unified user-visible status');
41
41
  check(read('plugins/harness-everything/skills/harness-everything/SKILL.md')===hs,'Harness skill mirror matches');
42
42
 
43
43
  const wt=read('using-git-worktrees/SKILL.md');
44
- check(/safer in a linked worktree/i.test(wt),'worktree skill strongly recommends isolation');
44
+ check(/Tier 3 \/ Fable \(MUST resolve\)/i.test(wt)&&/explicit degraded fallback/i.test(wt),'worktree skill requires isolation disposition but permits degraded fallback');
45
45
  check(!/Creation\/entry failure => `BLOCKED`/i.test(wt),'worktree creation failure is not a cognitive blocked state');
46
46
  check(read('plugins/harness-everything/skills/using-git-worktrees/SKILL.md')===wt,'worktree skill mirror matches');
47
47
 
48
48
  const triage=read('harness-everything/references/triage-and-tiers.md');
49
- check(/Guidance-first workflow/i.test(triage),'triage reference uses guidance-first policy');
49
+ check(/Contract-first lifecycle/i.test(triage),'triage reference uses contract-first policy');
50
50
  check(/User-visible status contract/i.test(triage)&&/Harness Status/i.test(triage)&&/MUST/i.test(triage),'triage defines the mandatory unified status contract');
51
51
  check(read('plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md')===triage,'triage mirror matches');
52
52
 
53
- for(const p of ['docs/routing.md','docs/architecture.md','docs/philosophy.md','docs/mechanism-first-skill-mesh.md']){
54
- const t=read(p); check(/guidance/i.test(t),'current doc '+p+' describes guidance');
53
+ for(const p of ['docs/routing.md','docs/architecture.md','docs/philosophy.md']){
54
+ const t=read(p); check(/MUST/i.test(t)&&/MAY/i.test(t),'current doc '+p+' preserves explicit semantic strength');
55
55
  }
56
56
  for(const p of ['docs/routing.md','docs/architecture.md','docs/workflow-runtime.md']){
57
57
  const t=read(p); check(/Harness Status/i.test(t)&&/MUST/i.test(t),'current doc '+p+' defines mandatory user-visible status');
58
58
  }
59
+ const philosophy=read('docs/philosophy.md');
60
+ check(/Contract Strength: MUST \/ SHOULD \/ MAY/i.test(philosophy),'philosophy defines canonical MUST/SHOULD/MAY strength');
61
+ for(const phrase of [
62
+ 'Route before software/project execution',
63
+ 'Read/evaluate every suggested skill before omission',
64
+ 'Resolve selected-topology invariants/stages/checks/synthesis/verification',
65
+ 'Discover relevant environment/host facts',
66
+ 'Resolve Tier-3/Fable isolation before broad mutation',
67
+ 'Numeric iteration/revision/replan/worker values',
68
+ 'Durable memory writes'
69
+ ]){
70
+ check(philosophy.includes(phrase),'contract-strength audit classifies '+phrase);
71
+ }
72
+ check(!/Applicable workflow is guidance:/i.test(philosophy),'old ambiguous philosophy wording is removed');
73
+
59
74
  const advisory=read('scripts/lib/advisory-text.js');
60
- check(/selected workflow topology.*planning guidance/i.test(advisory),'installer advisory text keeps workflow non-blocking');
75
+ check(/Selected-topology required obligations are MUSTs/i.test(advisory)&&/numeric.*MAY guide planning/i.test(advisory),'instruction-only installer preserves MUST/MAY semantics');
61
76
  check(/USER-VISIBLE STATUS \(MUST\)/i.test(advisory)&&/### 🚦 Harness Status/i.test(advisory)&&/\*\*Read \/ Evidence:\*\*/i.test(advisory),'instruction-only installers carry the readable mandatory status contract');
62
77
  check(/Rule of 3/i.test(advisory)&&/Permission boundaries are separate/i.test(advisory),'installer text preserves Rule-of-3 and permission boundaries');
63
78
  check(read('plugins/harness-everything/scripts/lib/advisory-text.js')===advisory,'OpenAI advisory mirror matches');
64
79
 
65
80
  const agents=read('AGENTS.md');
66
- check(/Selected workflow is planning guidance/i.test(agents),'repository agent contract is guidance-first');
81
+ check(/Selected workflow is a semantic contract/i.test(agents),'repository agent contract is contract-first');
67
82
  check(/User-visible Harness Status is mandatory/i.test(agents)&&/### 🚦 Harness Status/i.test(agents)&&/nested evidence bullets/i.test(agents),'repository agent contract requires readable unified user-visible status');
68
- check(/Prefer Git worktree isolation/i.test(agents),'repository worktree rule is a recommendation');
83
+ check(/Tier-3\/Fable isolation disposition is mandatory/i.test(agents)&&/degraded fallback/i.test(agents),'repository worktree rule requires disposition without hard lock');
84
+
85
+ const envSkill=read('environment-detection/SKILL.md');
86
+ check(/semantic \*\*MUST\*\*/i.test(envSkill)&&/environment-sensitive/i.test(envSkill),'environment discovery is a conditional semantic MUST');
87
+ check(read('plugins/harness-everything/skills/environment-detection/SKILL.md')===envSkill,'environment skill mirror matches');
88
+
89
+ const commitSkill=read('git-commit/SKILL.md');
90
+ check(/MUST.*git diff --cached/i.test(commitSkill)&&/SHOULD.*split/i.test(commitSkill),'commit skill separates staged-diff MUST from split SHOULD');
91
+ check(read('plugins/harness-everything/skills/git-commit/SKILL.md')===commitSkill,'git-commit skill mirror matches');
69
92
 
70
93
  const hooks=JSON.parse(read('hooks/hooks.json'));
71
94
  check((hooks.hooks.PreToolUse||[]).some(e=>e.id==='harness:pre:workflow-gate'),'Claude packages workflow reminder hook');
72
95
  check((hooks.hooks.PreToolUse||[]).some(e=>e.id==='harness:pre:rule-of-3'),'Claude preserves Rule-of-3 boundary');
73
96
  check((hooks.hooks.PreToolUse||[]).some(e=>e.id==='harness:pre:action-gate'),'Claude preserves action permission gate');
74
97
 
75
- console.log('\n'+(failed===0?'PASS':'FAIL')+': guidance-first routing contract ('+failed+' failures)');
98
+ console.log('\n'+(failed===0?'PASS':'FAIL')+': semantic contract-strength routing contract ('+failed+' failures)');
76
99
  process.exit(failed===0?0:1);
@@ -16,10 +16,10 @@ try{
16
16
  fs.writeFileSync(path.join(dir,'workflow-run.json'),JSON.stringify({schemaVersion:1,sessionId:'worktree-guidance',tier:'tier3',strategy:'iterative-single',state:'active'}));
17
17
  const primary=runGate('Write',repo,{file_path:path.join(repo,'src.js'),content:'x'});
18
18
  check(primary.status===0,'Tier-3 primary-tree mutation is not hard-blocked',primary.stderr);
19
- check(/worktree/i.test(primary.stderr),'Tier-3 primary-tree mutation emits worktree guidance',primary.stderr);
19
+ check(/semantic MUST/i.test(primary.stderr)&&/worktree/i.test(primary.stderr),'Tier-3 primary-tree mutation emits mandatory isolation disposition without blocking',primary.stderr);
20
20
  const mutator=runGate('Bash',repo,{command:'git status --short && rm -rf src'});
21
21
  check(mutator.status===0,'mutation-shaped shell command remains available',mutator.stderr);
22
- check(/worktree/i.test(mutator.stderr),'mutation-shaped shell command receives worktree guidance',mutator.stderr);
22
+ check(/semantic MUST/i.test(mutator.stderr)&&/worktree/i.test(mutator.stderr),'mutation-shaped shell command receives the same isolation contract',mutator.stderr);
23
23
  const readOnly=runGate('Bash',repo,{command:'git status --short'});
24
24
  check(readOnly.status===0,'read-only discovery remains available');
25
25
  const create=git(repo,['worktree','add',linked,'-b','guidance-test']);check(create.status===0,'linked worktree fixture creates',create.stderr);
@@ -37,4 +37,4 @@ try{
37
37
  check(corrupt.status===0,'corrupt workflow state fails open',corrupt.stderr);
38
38
  }finally{fs.rmSync(temp,{recursive:true,force:true});}
39
39
  if(failed)process.exit(1);
40
- console.log('PASS: worktree isolation is guidance, not a cognitive lock');
40
+ console.log('PASS: worktree isolation is a semantic MUST disposition, not a cognitive lock');
@@ -18,6 +18,7 @@ assert.strictEqual(tier3.strategy, 'fable-staged');
18
18
  assert.ok(tier3.requiredInvariants.includes('isolated-worktree-before-mutation'), 'Tier 3 plan must carry mutation isolation invariant');
19
19
  assert.ok(tier3.suggestedSkills.includes('using-git-worktrees'), 'Tier 3 plan must surface the worktree workflow');
20
20
  assert.strictEqual(tier3.workspace.required, false, 'Git worktree isolation must remain distinct from durable multi-agent workspace state');
21
+ assert.strictEqual(tier3.mutationIsolation.onUnavailable, 'degraded', 'unavailable isolation records an explicit degraded fallback instead of a cognitive hard block');
21
22
 
22
23
  const tier2 = router.buildRouterContract({
23
24
  routingStatus: 'ok',
@@ -47,6 +47,7 @@ let workflow = readJson(workflowFile);
47
47
  let obligations = readJson(obligationFile);
48
48
  check(workflow.tier === 'tier2' && workflow.strategy === 'iterative-single', 'Tier 2 receives a preliminary iterative-single route');
49
49
  check(workflow.state === 'pending', 'selected Tier 2 workflow begins pending');
50
+ check(workflow.guidance?.mode === 'semantic-contract', 'persisted workflow records semantic-contract mode rather than advisory-workflow');
50
51
  check(obligations.phase === 'planning', 'Tier 2 immediately materializes a planning contract');
51
52
  check(obligations.obligations.map(item => item.id).join(',') === 'decompose,compose', 'planning starts with decompose then compose');
52
53
  check(obligations.requirements.length === 0, 'requirements begin empty instead of being invented by the router');
@@ -28,8 +28,8 @@ check((dockerVerify.match(/\$STATE_DIR\//g) || []).length >= 10,
28
28
  '#205 docker verifier routes all state checks through STATE_DIR');
29
29
 
30
30
  const architecture = fs.readFileSync(path.join(ROOT, 'docs/architecture.md'), 'utf8');
31
- check(architecture.includes('advisory loop-awareness reminders'),
32
- '#206 architecture names loop-awareness as advisory');
31
+ check(architecture.includes('MAY-level loop-awareness planning hints'),
32
+ '#206 architecture keeps loop-awareness numeric guidance explicitly non-mandatory');
33
33
  check(!/\bloop budgets\b/.test(architecture),
34
34
  '#206 architecture does not describe retired loop budgets as enforcement');
35
35
 
@@ -162,7 +162,7 @@ assert.ok(hooks.hooks.Stop?.length, 'Stop hook missing');
162
162
  const hookText = JSON.stringify(hooks);
163
163
  assert.match(hookText, /PLUGIN_ROOT/, 'plugin hooks must resolve from PLUGIN_ROOT');
164
164
  assert.match(hookText, /commandWindows/, 'plugin hooks need a Windows command override');
165
- assert.match(hookText, /workflow-gate\.js/, 'plugin hooks must package workflow guidance');
165
+ assert.match(hookText, /workflow-gate\.js/, 'plugin hooks must package workflow contract observation');
166
166
  assert.match(hookText, /workflow-stop-gate\.js/, 'plugin hooks must package workflow completion reminders');
167
167
 
168
168
  const session = spawnSync(process.execPath, [path.join(PLUGIN, 'hooks', 'session-start.js')], { encoding: 'utf8' });
@@ -190,14 +190,14 @@ assert.strictEqual(second.status, 0, second.stderr);
190
190
  assert.strictEqual(first.stdout, second.stdout, 'identical routing input must produce identical output');
191
191
  assert.match(first.stdout, /RECOMMENDED TIER:\s*Tier 2/i);
192
192
  assert.match(first.stdout, /REQUIRED HARNESS INVARIANTS/);
193
- assert.match(first.stdout, /WORKFLOW SKILLS \(EVALUATE APPLICABILITY .*SELECTED WORKFLOW IS GUIDANCE\)/);
193
+ assert.match(first.stdout, /WORKFLOW SKILLS \(APPLICABILITY MUST BE RESOLVED\)/);
194
194
  assert.match(first.stdout, /evaluate-suggestions-before-skip/);
195
195
  assert.match(first.stdout, /read its complete SKILL\.md entry/);
196
196
  assert.doesNotMatch(first.stdout, /BASE EXECUTION LOOP/);
197
- assert.match(first.stdout, /ORCHESTRATION POLICY: Selected topology is planning guidance/);
198
- assert.match(first.stdout, /WORKFLOW GUIDANCE \(ADVISORY WHEN SELECTED\)/);
197
+ assert.match(first.stdout, /ORCHESTRATION POLICY: Selected-topology required obligations and applicable skill core contracts are semantic MUSTs/);
198
+ assert.match(first.stdout, /WORKFLOW SEMANTIC CONTRACT \(NON-BLOCKING OBSERVATION\)/);
199
199
  assert.match(first.stdout, /Selected workflow: iterative-single/);
200
- assert.match(first.stdout, /Before claiming completion, review unresolved workflow evidence and objective verification/);
200
+ assert.match(first.stdout, /Before claiming completion, MUST resolve required workflow evidence and objective verification/);
201
201
  assert.doesNotMatch(first.stdout, /budget-exhausted|reset-budget/);
202
202
 
203
203
  const trivial = route('Update one README typo');
@@ -213,4 +213,4 @@ assert.match(unmatched.stdout, /RECOMMENDED TIER:\s*Unclassified/i);
213
213
  assert.match(unmatched.stdout, /"tier":"unclassified"/i);
214
214
  assert.doesNotMatch(unmatched.stdout, /RECOMMENDED TIER:\s*Tier 1/i);
215
215
 
216
- console.log(`OpenAI plugin package verified: ${skillNames.length} skills, publication metadata, hooks, marketplace, deterministic guidance-first routing.`);
216
+ console.log(`OpenAI plugin package verified: ${skillNames.length} skills, publication metadata, hooks, marketplace, deterministic semantic-contract routing.`);
@@ -67,6 +67,7 @@ if (validContract(direct, 'direct-single')) {
67
67
  check(plan.strategy === 'direct-single', 'one-file trivial task selects direct-single');
68
68
  check(plan.strategySelection === 'selected', 'direct-single is a selected strategy');
69
69
  check(plan.requiredInvariants.includes('visible-status-updates'), 'every selected workflow carries the user-visible status invariant');
70
+ check(plan.requiredInvariants.includes('environment-alignment'), 'every selected workflow carries conditional environment-alignment MUST');
70
71
  check(plan.workspace.required === false, 'direct-single does not require a workspace');
71
72
  check(plan.parallelism.allowed === false, 'direct-single does not parallelize');
72
73
  }
@@ -76,15 +77,15 @@ if (validContract(iterative, 'iterative-single')) {
76
77
  const plan = iterative.contract.workflowPlan;
77
78
  check(plan.tier === 'tier2', 'ordinary test-first bug fix is tier2');
78
79
  check(plan.strategy === 'iterative-single', 'ordinary bug fix selects iterative-single');
79
- check(plan.limits.maxIterations === ITERATIVE_MAX_ITERATIONS, 'iterative-single retains an advisory iteration guidance value');
80
- check(plan.limits.maxRevisionRounds === WORKFLOW_MAX_REVISION_ROUNDS, 'workflow exposes an advisory revision guidance value');
81
- check(plan.limits.maxReplans === FABLE_MAX_REPLANS, 'workflow exposes an advisory replan guidance value');
82
- check(plan.limits.maxWorkers === FABLE_MAX_WORKERS, 'workflow exposes an advisory worker guidance value');
80
+ check(plan.limits.maxIterations === ITERATIVE_MAX_ITERATIONS, 'iterative-single retains a MAY iteration planning value');
81
+ check(plan.limits.maxRevisionRounds === WORKFLOW_MAX_REVISION_ROUNDS, 'workflow exposes a MAY revision planning value');
82
+ check(plan.limits.maxReplans === FABLE_MAX_REPLANS, 'workflow exposes a MAY replan planning value');
83
+ check(plan.limits.maxWorkers === FABLE_MAX_WORKERS, 'workflow exposes a MAY worker planning value');
83
84
  check(plan.requiredInvariants.includes('objective-verification'), 'iterative-single carries objective verification invariant');
84
- check(plan.requiredInvariants.includes('loop-awareness'), 'iterative-single carries loop-awareness guidance');
85
- check(plan.suggestedSkills.includes('tdd'), 'TDD stays advisory rather than an invariant');
85
+ check(plan.requiredInvariants.includes('loop-awareness'), 'iterative-single carries semantic loop-awareness obligation while numeric counts remain MAY');
86
+ check(plan.suggestedSkills.includes('tdd'), 'TDD remains applicability-conditional rather than a universal invariant');
86
87
  check(plan.memory.write === 'none', 'ordinary iterative work cannot write durable memory');
87
- check(!plan.requiredInvariants.includes('tdd'), 'suggested skills are separated from mandatory invariants');
88
+ check(!plan.requiredInvariants.includes('tdd'), 'suggested skill names remain separate from plan invariants until applicability is resolved');
88
89
  }
89
90
 
90
91
  const memoryPersist = runTier('Persist this lesson as memory after resolving the checkout regression.');
@@ -110,6 +111,8 @@ if (validContract(staged, 'fable-staged')) {
110
111
  check(plan.strategy === 'fable-staged', 'dependent multi-stage work selects fable-staged');
111
112
  check(plan.parallelism.allowed === false, 'dependent stages remain sequential');
112
113
  check(plan.verification.mode === 'cold-verifier', 'fable-staged requires cold verification');
114
+ check(plan.requiredInvariants.includes('isolated-worktree-before-mutation'), 'fable-staged carries mandatory isolation disposition');
115
+ check(plan.suggestedSkills.includes('using-git-worktrees'), 'fable-staged surfaces worktree resolution skill');
113
116
  }
114
117
 
115
118
  const parallelPrompt = 'Audit the entire repository with independent read-only security, architecture, and documentation workstreams.';
@@ -287,10 +290,10 @@ const kernelIterative = spawnSync(process.execPath, [kernelRouter, 'Fix this che
287
290
  encoding: 'utf8',
288
291
  });
289
292
  check(kernelIterative.stdout.includes('"strategy":"iterative-single"'), 'kernel consumes strategy from structured plan');
290
- check(kernelIterative.stdout.includes('loop-awareness:'), 'kernel prints dynamic plan guidance');
293
+ check(kernelIterative.stdout.includes('loop-awareness:'), 'kernel prints dynamic semantic plan obligations');
291
294
  check(kernelIterative.stdout.includes('visible-status-updates:'), 'kernel prints the user-visible status invariant');
292
295
  check(kernelIterative.stdout.includes('USER-VISIBLE HARNESS STATUS CONTRACT (MUST)'), 'kernel prints the canonical mandatory user-visible status contract');
293
- check(kernelIterative.stdout.includes(' - tdd'), 'kernel prints advisory skills separately');
296
+ check(kernelIterative.stdout.includes(' - tdd'), 'kernel prints suggested skills separately from required invariants');
294
297
 
295
298
  for (const schemaPath of [
296
299
  'harness-everything/schemas/router-task-shape.schema.json',
@@ -9,7 +9,7 @@ function runNode(args){return spawnSync(process.execPath,args,{cwd:ROOT,encoding
9
9
  console.log('=== Workflow Guidance Contract ===');
10
10
  for(const rel of ['harness-everything/scripts/kernel-router.js','hooks/scripts/workflow-gate.js','hooks/scripts/workflow-stop-gate.js','hooks/scripts/workflow-disposition.js','hooks/scripts/state-persist.js','hooks/scripts/rule-of-3.js','hooks/scripts/rule-of-3-tracker.js'])check(runNode(['--check',path.join(ROOT,rel)]).status===0,rel+' parses as valid JavaScript');
11
11
  const ctx={workflow:{workflowPlan:{limits:{maxIterations:8,maxRevisionRounds:2,maxReplans:2,maxWorkers:4}}}};
12
- for(const type of ['iteration','revision','replan','worker-acquire'])check(runtime.recordBudgetEvent(ctx,type,{evidence:'fixture'}).advisory===true,type+' is advisory rather than blocking');
12
+ for(const type of ['iteration','revision','replan','worker-acquire'])check(runtime.recordBudgetEvent(ctx,type,{evidence:'fixture'}).advisory===true,type+' remains a MAY planning hint rather than blocking');
13
13
  check(runtime.mutationProbeReservations(ctx)===0,'mutation probes reserve no capacity');
14
14
  check(runtime.registerMutationProbe(ctx,'x','y')===null,'mutation probe registration is a no-op');
15
15
  check(runtime.resetWorkflowBudget(ctx,'legacy').retired===true,'reset-budget API is retired compatibility only');
@@ -51,5 +51,5 @@ try{
51
51
  check(stale.includes('independent-verifier-missing'),'Fable independent verifier is invalidated by newer handoff shell-edit evidence');
52
52
  }finally{fs.rmSync(freshnessRoot,{recursive:true,force:true});}
53
53
 
54
- console.log('\n'+(failed===0?'PASS':'FAIL')+': workflow guidance contract ('+failed+' failures)');
54
+ console.log('\n'+(failed===0?'PASS':'FAIL')+': workflow semantic contract mechanics ('+failed+' failures)');
55
55
  process.exit(failed===0?0:1);
@@ -9,16 +9,16 @@ Harness is a **behavior and workflow observer/router**, not a universal fixed wo
9
9
  The minimal kernel establishes:
10
10
 
11
11
  - scope/tier before mutation,
12
- - a selected workflow topology as planning guidance when task evidence supports one,
12
+ - a selected workflow topology as a semantic execution contract when task evidence supports one,
13
13
  - applicability evaluation for every suggested skill before omission,
14
14
  - objective evidence before completion,
15
15
  - bounded re-plan/recovery after repeated failure,
16
16
  - explicit warnings/degraded/escape evidence instead of silent workflow deletion;
17
17
  - one mandatory user-visible Harness Status protocol for non-trivial work, independent of execution topology.
18
18
 
19
- > **Guidance-first workflow; flexible reasoning/implementation and execution.**
19
+ > **Contract-first lifecycle; flexible reasoning/implementation and execution.**
20
20
  >
21
- > Suggested skills and topology are evaluated from their real flows. Missing or skipped cognitive workflow steps produce evidence/reminders rather than persistent Harness locks.
21
+ > Suggested skills MUST be evaluated from their real flows. Applicable skill core contracts and selected-topology obligations are semantic MUSTs; missing evidence produces reminders rather than persistent Harness locks.
22
22
 
23
23
  This avoids both extremes: no universal Tier-2/Tier-3 pipeline and no maze of self-deadlocking cognitive gates.
24
24
 
@@ -50,8 +50,8 @@ flowchart TD
50
50
  - selected/deferred execution strategy,
51
51
  - required invariants,
52
52
  - suggested skills that require applicability evaluation,
53
- - the visible routing checkpoint,
54
- - a workflow guidance.
53
+ - the internal routing checkpoint,
54
+ - the semantic workflow contract.
55
55
 
56
56
  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.
57
57
 
@@ -78,7 +78,7 @@ This is a semantic contract, not another cognitive lock. Hook-capable hosts may
78
78
 
79
79
  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.
80
80
 
81
- The selected topology is a structured planning aid; it does not become a persistent execution lock.
81
+ The selected topology is a semantic lifecycle contract, not a persistent execution lock. Required obligations MUST resolve; implementation tactics MAY adapt.
82
82
 
83
83
  ### Runtime workflow state
84
84
 
@@ -91,13 +91,13 @@ For selected Fable topologies on Claude:
91
91
  - `workflow-stop-gate.js` reports unresolved stage/verification evidence without rejecting Stop;
92
92
  - `workflow-disposition.js` records explicit lifecycle/audit decisions; numeric budgets are no longer authoritative control state.
93
93
 
94
- Other topologies use their own applicable mechanisms: advisory loop-awareness reminders, regular verification stop-gates, action gates, and task-specific skills. Mechanism coverage is not assumed identical across hosts.
94
+ Other topologies use their own applicable mechanisms: MAY-level loop-awareness planning hints, regular verification stop-gates, action gates, and task-specific skills. Mechanism coverage is not assumed identical across hosts.
95
95
 
96
96
  ### Scoped runtime advisories and capabilities
97
97
 
98
98
  Two kernel mechanisms annotate plans without creating hard workflow enforcement:
99
99
 
100
- - **Ensemble policy (`harness-everything/scripts/ensemble-policy.js`):** an advisory plan annotation, not a separate topology. It is selected only when uncertainty is high (or stakes are high) **and** the task asks for comparable outputs or preserves explicit disagreement **and** the selected strategy is already `fable-*`. Creative generation, mechanical bulk work, an explicit user prohibition, unavailable subagents, or a blocked base plan force exclusion. When selected, the plan caps at 3 candidates with `preserve-disagreement` synthesis, an independent verifier, and `parallel-self-consistency` pattern invariants. Covered by deterministic mechanism tests; no live-host effectiveness claim follows from the annotation alone.
100
+ - **Ensemble policy (`harness-everything/scripts/ensemble-policy.js`):** optional selection is a **MAY** capability, not a separate topology. It is selected only when uncertainty is high (or stakes are high) **and** the task asks for comparable outputs or preserves explicit disagreement **and** the selected strategy is already `fable-*`. Creative generation, mechanical bulk work, an explicit user prohibition, unavailable subagents, or a blocked base plan force exclusion. Once selected, preserving disagreement, using an independent verifier, and honoring the plan's ensemble invariants are **MUST** obligations. Covered by deterministic mechanism tests; no live-host effectiveness claim follows from the annotation alone.
101
101
  - **Single-use memory capability (`kernel-router.js#issueMemoryCapability`):** when the selected plan permits memory writes, the router issues one capability token bound to `sessionId`/`workflowId` with a stored SHA-256 hash (`memoryAuthorization`, coordinator-only writer role, `usedAt` tracking). Plans with `memory.write === 'none'` receive no capability. This binds a memory write to the workflow that authorized it; it is not a general credential and proves nothing about a live host honoring the binding.
102
102
 
103
103
  ### PreToolUse guard trio and denied-mutation probes
@@ -105,7 +105,7 @@ Two kernel mechanisms annotate plans without creating hard workflow enforcement:
105
105
  On the Claude hook path, three narrowly scoped `PreToolUse` guards sit alongside the workflow/action gates:
106
106
 
107
107
  - `boundary-guard.js` (Grep/Glob/Read): warns about very large reads and noisy search roots; it fails open.
108
- - `depth-guard.js` (Write): blocks overwriting an existing file that was never Read earlier in the session transcript. New files are unaffected. Fails open on parse/lookup errors.
108
+ - `depth-guard.js` (Write): reminds when an existing file would be overwritten without prior inspection. The semantic obligation to establish current target state before destructive overwrite is a **MUST**; the hook itself stays fail-open. New files are unaffected.
109
109
  - `context-compact.js`: estimates working-tree context pressure from `git status`/`git diff --numstat` so later stages can compact or halt before lost-in-the-middle degradation.
110
110
 
111
111
  Shell mutation observation is best-effort evidence for reminders. The old mutation-probe reservation/lock subsystem was retired by #190.
@@ -118,23 +118,23 @@ Harness aligns to each host's actual lifecycle/tool APIs. Shared skill text defi
118
118
 
119
119
  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.
120
120
 
121
- ### Claude Code — hook guidance plus explicit safety boundaries
121
+ ### Claude Code — hook observation plus explicit safety boundaries
122
122
 
123
123
  The installer configures native lifecycle hooks and project skills.
124
124
 
125
125
  - `SessionStart`: bootstrap/restoration.
126
- - `UserPromptSubmit`: kernel routing + workflow guidance.
126
+ - `UserPromptSubmit`: kernel routing + semantic workflow contract.
127
127
  - `PreToolUse`: workflow/boundary/depth/scope reminders, plus separate action permission and Rule-of-3 boundaries.
128
128
  - `PostToolUse`: outcomes, state, repeated-failure evidence, stage checks.
129
129
  - `Stop`: action-gate audit plus non-blocking workflow/verification reminders.
130
130
 
131
- These hooks make reminders observable; they do not promote cognitive workflow guidance into hard enforcement.
131
+ These hooks make semantic obligations observable; they do not promote cognitive workflow contracts into hard enforcement.
132
132
 
133
133
  ### OpenCode — plugin enforcement, scoped live verification
134
134
 
135
135
  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.
136
136
 
137
- This evidence predates #190 and does not establish behavioral effectiveness of the current guidance-first lifecycle.
137
+ This evidence predates #190 and does not establish behavioral effectiveness of the current contract-first lifecycle.
138
138
 
139
139
  ### Cursor — skills plus advisory rules
140
140
 
@@ -148,7 +148,7 @@ Copilot receives Agent Skills/repository instructions. No Harness-specific live
148
148
 
149
149
  Codex has multiple distinct Harness surfaces:
150
150
 
151
- - The general `--codex` installer writes repo-scoped `.agents/skills/` plus `AGENTS.md`; when consumed only as instructions, workflow enforcement is advisory/instruction-governed.
151
+ - The general `--codex` installer writes repo-scoped `.agents/skills/` plus `AGENTS.md`; when consumed only as instructions, the same semantic contract is instruction-delivered without a hard-enforcement claim.
152
152
  - 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.
153
153
  - The public OpenAI **Skills-only** artifact excludes local `.codex-plugin` lifecycle hooks; it carries reusable workflow knowledge, not local hard gates.
154
154
 
@@ -204,7 +204,7 @@ A domain skill may define RED/GREEN/REFACTOR or another local lifecycle. The sel
204
204
 
205
205
  1. **No Harness telemetry service:** project code/state is not uploaded by Harness runtime scripts.
206
206
  2. **Credential protection:** credentials remain human/host controlled.
207
- 3. **Small mechanism surface:** hooks should remain fast and auditable.
207
+ 3. **Small mechanism surface:** hooks **SHOULD** remain fast and auditable.
208
208
  4. **Explicit enforcement labels:** instruction, mechanism, and live evidence are distinct.
209
209
  5. **Deterministic regression:** workflow/routing/hook contracts are executable CI gates.
210
210
  6. **No silent widening:** workflow escape cannot widen authorization, permissions, or external side effects.