harness-everything 0.16.0 → 0.16.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 (96) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/AGENTS.md +2 -2
  4. package/CHANGELOG.md +8 -0
  5. package/README.md +7 -7
  6. package/VERIFICATION.md +3 -3
  7. package/ci/invariant-routing.test.js +58 -158
  8. package/ci/mechanism-2a-rule-of-3.test.js +73 -138
  9. package/ci/mechanism-2ac-atomic-commit-check.test.js +2 -2
  10. package/ci/mechanism-2af-worktree-isolation.test.js +38 -196
  11. package/ci/mechanism-2ah-workflow-lifecycle.test.js +20 -831
  12. package/ci/mechanism-2ai-workspace-fingerprint-batch.test.js +3 -4
  13. package/ci/mechanism-2b-boundary-guard.test.js +6 -16
  14. package/ci/mechanism-2e-scope-guard.test.js +8 -24
  15. package/ci/mechanism-2f-stop-gate.test.js +21 -75
  16. package/ci/mechanism-2n-opencode-plugin.test.js +13 -28
  17. package/ci/openai-plugin-package.test.js +8 -8
  18. package/ci/openai-plugin-runtime.test.js +2 -2
  19. package/ci/router-workflow-plan.test.js +6 -6
  20. package/ci/self-evolve-loop.test.js +4 -1
  21. package/ci/workflow-execution-contract.test.js +51 -129
  22. package/ci/workflow-plan-consumers-edge.test.js +1 -1
  23. package/ci/workflow-plan-consumers.test.js +6 -6
  24. package/docs/architecture.md +21 -21
  25. package/docs/enforcement-locks.md +41 -102
  26. package/docs/mechanism-first-skill-mesh.md +2 -2
  27. package/docs/philosophy.md +2 -2
  28. package/docs/platform-capabilities.md +3 -3
  29. package/docs/routing.md +14 -14
  30. package/docs/workflow-runtime.md +80 -110
  31. package/evals/harness-everything/tasks/positive-tier1.yaml +1 -1
  32. package/evals/harness-everything/tasks/positive-tier2.yaml +1 -1
  33. package/evals/harness-everything/tasks/positive-tier3.yaml +1 -1
  34. package/evals/using-git-worktrees/tasks/positive-trigger.yaml +1 -1
  35. package/fable-mode/SKILL.md +1 -1
  36. package/fable-mode/execution-guardrails/SKILL.md +1 -1
  37. package/fable-mode/fable-haiku/SKILL.md +1 -1
  38. package/fable-mode/fable-opus/SKILL.md +1 -1
  39. package/fable-mode/fable-sonnet/SKILL.md +1 -1
  40. package/fable-mode/scripts/workflow-plan-consumer.js +4 -3
  41. package/harness-everything/SKILL.md +11 -11
  42. package/harness-everything/references/triage-and-tiers.md +11 -11
  43. package/harness-everything/scripts/kernel-router-core.js +5 -5
  44. package/harness-everything/scripts/kernel-router.js +15 -17
  45. package/harness-everything/scripts/router-contract-core.js +1 -1
  46. package/hooks/hooks.json +10 -23
  47. package/hooks/scripts/atomic-commit-check.js +1 -1
  48. package/hooks/scripts/boundary-guard.js +4 -4
  49. package/hooks/scripts/contract-test.js +8 -11
  50. package/hooks/scripts/depth-guard.js +2 -2
  51. package/hooks/scripts/lib/workflow-runtime.js +24 -402
  52. package/hooks/scripts/rule-of-3-tracker.js +28 -31
  53. package/hooks/scripts/rule-of-3.js +4 -28
  54. package/hooks/scripts/state-persist.js +36 -136
  55. package/hooks/scripts/stop-gate.js +15 -48
  56. package/hooks/scripts/subagent-scope-guard.js +8 -8
  57. package/hooks/scripts/workflow-disposition.js +2 -10
  58. package/hooks/scripts/workflow-gate.js +33 -84
  59. package/hooks/scripts/workflow-mutation-denied.js +3 -15
  60. package/hooks/scripts/workflow-stop-gate.js +23 -38
  61. package/opencode-plugin/README.md +9 -10
  62. package/opencode-plugin/index.mjs +14 -30
  63. package/opencode-plugin/plugin.json +1 -1
  64. package/package.json +1 -1
  65. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  66. package/plugins/harness-everything/hooks/hooks.json +3 -3
  67. package/plugins/harness-everything/hooks/scripts/atomic-commit-check.js +1 -1
  68. package/plugins/harness-everything/hooks/scripts/boundary-guard.js +4 -4
  69. package/plugins/harness-everything/hooks/scripts/contract-test.js +8 -11
  70. package/plugins/harness-everything/hooks/scripts/depth-guard.js +2 -2
  71. package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +24 -402
  72. package/plugins/harness-everything/hooks/scripts/rule-of-3-tracker.js +28 -31
  73. package/plugins/harness-everything/hooks/scripts/rule-of-3.js +4 -28
  74. package/plugins/harness-everything/hooks/scripts/state-persist.js +36 -136
  75. package/plugins/harness-everything/hooks/scripts/stop-gate.js +15 -48
  76. package/plugins/harness-everything/hooks/scripts/subagent-scope-guard.js +8 -8
  77. package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +2 -10
  78. package/plugins/harness-everything/hooks/scripts/workflow-gate.js +33 -84
  79. package/plugins/harness-everything/hooks/scripts/workflow-mutation-denied.js +3 -15
  80. package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +23 -38
  81. package/plugins/harness-everything/plugin.json +1 -1
  82. package/plugins/harness-everything/scripts/lib/advisory-text.js +16 -29
  83. package/plugins/harness-everything/skills/fable-mode/SKILL.md +1 -1
  84. package/plugins/harness-everything/skills/fable-mode/execution-guardrails/SKILL.md +1 -1
  85. package/plugins/harness-everything/skills/fable-mode/fable-haiku/SKILL.md +1 -1
  86. package/plugins/harness-everything/skills/fable-mode/fable-opus/SKILL.md +1 -1
  87. package/plugins/harness-everything/skills/fable-mode/fable-sonnet/SKILL.md +1 -1
  88. package/plugins/harness-everything/skills/fable-mode/scripts/workflow-plan-consumer.js +4 -3
  89. package/plugins/harness-everything/skills/harness-everything/SKILL.md +11 -11
  90. package/plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md +11 -11
  91. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router-core.js +5 -5
  92. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +15 -17
  93. package/plugins/harness-everything/skills/harness-everything/scripts/router-contract-core.js +1 -1
  94. package/plugins/harness-everything/skills/using-git-worktrees/SKILL.md +5 -5
  95. package/scripts/lib/advisory-text.js +16 -29
  96. package/using-git-worktrees/SKILL.md +5 -5
@@ -1,122 +1,92 @@
1
- # Selected workflow runtime
1
+ # Workflow Runtime
2
2
 
3
- The selected applicable topology is mandatory. This contract governs lifecycle
4
- obligations; agents still choose tools, reasoning, and implementation inside it.
5
- Skill suggestions require individual applicability evaluation, not one universal
6
- skill sequence. Git mutation isolation and durable multi-agent workspace state
7
- are separate concerns.
3
+ Harness uses workflow state to **observe, explain, and remind**. It is not a numeric-budget scheduler.
8
4
 
9
- ## State and entry
5
+ ## Product rule
10
6
 
11
- `UserPromptSubmit` records `workflow-run.json` in the bound workspace's global
12
- Harness session state. It includes a unique `workflowId`, complete plan, prompt
13
- hash (no prompt text), revision count, and scoped exceptions. Unresolved work
14
- survives follow-up/status prompts; a weaker route cannot erase it. A stronger
15
- route blocks mutation until an explicit replan. A new task after `satisfied`
16
- gets a new identity. Invalid recorded state fails closed with a diagnostic.
7
+ The runtime follows **minimal rails, maximum freedom**:
17
8
 
18
- ```text
19
- pending -> running -> satisfied
20
- | (only after required evidence)
21
- -> blocked -> start/replan (within budget)
22
- ```
9
+ - routing selects a useful topology and suggested skills;
10
+ - workflow state records useful evidence and unresolved obligations;
11
+ - verification hooks remind when evidence is missing;
12
+ - worktree/isolation checks warn when a safer execution shape is available;
13
+ - iteration, revision, replan, and worker counts are planning hints only.
23
14
 
24
- `blocked` is a reportable incomplete outcome, never successful completion.
25
- `deferred` means no topology has been selected. Legacy `active`/`escaped` records
26
- remain subject to isolation and cannot supply a correlated run implicitly.
15
+ None of those cognitive workflow conditions should trap a session or require a reset command.
27
16
 
28
- For Fable, write a stage array in the exact `workflow-stages.json` path displayed
29
- by the router. This one file is allowed as runtime bootstrap data before entry;
30
- the exception does not authorize changing workflow state or source artifacts.
31
- Use the [stage schema](../fable-mode/CONTRACT-FORMAT.md); each stage needs an
32
- objective `checkCommand` and `passCondition`. If the plan requires independent
33
- verification, declare a read-only `fable-verifier` stage depending on every
34
- other stage. Then run the displayed controller with the host session id:
17
+ The two intentionally separate hard boundaries are:
35
18
 
36
- ```text
37
- node "<hooks>/workflow-disposition.js" start --session-id "<session>"
38
- ```
19
+ 1. **Rule of 3** — the third matching failure pauses mutation until a zoom-out reflection is written;
20
+ 2. **user/host permission and dangerous-action approval** — authorization boundaries such as the action gate.
39
21
 
40
- The controller prepares the existing Fable consumer's run at the **bound** state
41
- root, even when tool execution has moved to a linked worktree. The run records
42
- both `workflowId` and `sessionId`; matching only strategy or creation time is
43
- insufficient. `start` creates contracts, not agents. Fable retains ownership of
44
- worker dispatch, dependency/write-set scheduling, and synthesis.
45
-
46
- ## Isolation boundary
47
-
48
- Before Tier 3 or Fable source/artifact mutation, the gate verifies a registered
49
- linked Git worktree with the same common Git directory as the bound repository.
50
- It checks the tool's execution directory and actual Edit/Write/apply_patch paths,
51
- including move destinations, relative traversal, and symlink/junction resolution.
52
- Unknown direct targets, Git metadata, and nested repositories are rejected.
53
- Read-only discovery and a literal `git worktree add` transition remain available
54
- before entry. Prefer an already-ignored path or sibling path for setup; never
55
- edit the primary tree's ignore file just to establish mandatory isolation.
56
-
57
- Shell recognition is conservative: redirects, substitutions, chained commands,
58
- and side-effect options are not accepted as read-only. Mutation-capable shell
59
- execution requires an isolated working-directory field, with explicit outside
60
- paths and directory changes rejected. **This is not a filesystem sandbox**:
61
- arbitrary scripts, aliases/configuration, indirect variable paths, and races can
62
- have effects a hook cannot infer. OS/host sandboxing is needed to contain them.
63
- Agent-writable state is also not tamper-proof. These mechanisms prevent tested
64
- bypasses; they do not establish durable containment against a malicious agent.
65
-
66
- ## Mutation probes
67
-
68
- Shell-effect accounting is keyed per tool call, not per command text. The gate
69
- registers a pending probe per shell tool-use identity (`workflow-isolation.js`),
70
- `state-persist.js` settles probes in a single ordered handler, and
71
- `workflow-mutation-denied.js` discards the probe when that shell execution is
72
- denied — a denial is never recorded as an observed mutation. Staging-insensitive
73
- fingerprinting keeps the comparison on visible content, so metadata-only Git
74
- operations do not register as workspace effects. These lifecycle semantics are
75
- covered by deterministic workflow mechanism tests (`ci/mechanism-2ah-*`); live
76
- host loading and behavioral improvement still require separately retained host
77
- traces and paired evaluations.
78
-
79
- ## Escape, replan, and completion
80
-
81
- Escape names one stage in the correlated run and records the uncovered scope,
82
- evidence, and `workflow-uncovered-scope` or `host-capability-unavailable` reason:
22
+ ## Runtime flow
83
23
 
84
24
  ```text
85
- node "<hooks>/workflow-disposition.js" escape --session-id "<session>" --stage-id "<stage>" --reason-code workflow-uncovered-scope --scope "<uncovered scope>" --evidence "<evidence>"
86
- node "<hooks>/workflow-disposition.js" block --session-id "<session>" --evidence "<blocker>"
25
+ route
26
+ -> selected workflow guidance
27
+ -> execute freely
28
+ -> observe edits / verification / stage evidence
29
+ -> emit reminders when evidence is weak
30
+ -> complete or continue
31
+
32
+ same failure signature x3
33
+ -> zoom-out reflection required
34
+ -> reflection accepted
35
+ -> normal execution resumes
87
36
  ```
88
37
 
89
- An escape never resolves the whole run, waives isolation, or removes independent
90
- verification. Covered stages remain mandatory. Unavailable required verification
91
- means blocked. The controller permits the initial run plus the plan's
92
- `maxRevisionRounds` replans; exhaustion stays blocked. Previous run evidence is
93
- retained, but cannot satisfy a replacement run.
94
-
95
- `contract-test.js` records exact check commands, observed worker/session identity,
96
- numeric exit code, and run/plan/stage evidence. A failed check can recover on a
97
- later observed pass. A dependent check cannot pass before its prerequisites.
98
- Stop enumerates the manifest's expected stages, so deleting a contract does not
99
- make the run complete. A `pass` label without matching exit-zero evidence fails.
100
- The independent verifier must have a distinct observed identity and evidence
101
- after the latest mutation/check. This proves attribution, not reasoning quality.
102
-
103
- Unresolved Stop exits 2. If the host marks a Stop retry, the contract becomes
104
- `blocked` with diagnostics instead of looping indefinitely or recording success.
105
- Direct/iterative routes use observed edit/verification milestones; iteration
106
- counting and semantic check quality remain executor obligations, not proven by
107
- these gates. Broad verification-command recognition is a heuristic.
108
-
109
- ## Host evidence
110
-
111
- Claude's manifest carries the shell/direct-mutation and Stop hooks. The local
112
- OpenAI package carries the same runtime for its declared `Bash|apply_patch`
113
- surface. Package tests exercise both layouts. Missing worker/exit metadata keeps
114
- Fable completion unresolved; it must be reported as degraded/blocked, not passed.
115
- Manual CLI routing without a session cannot persist lifecycle state.
116
-
117
- OpenCode and instruction-only/public Skills-only surfaces do not gain these
118
- runtime gates from this change. An absent/disabled hook or deleted state cannot
119
- be detected as an active contract by that same hook. No host compatibility status
120
- is upgraded: see [platform capabilities](platform-capabilities.md). Live hook
121
- loading, enforced host transitions, and behavioral improvement need separately
122
- retained host traces and paired evaluations.
38
+ There is no `budget-exhausted -> blocked -> reset-budget` lifecycle.
39
+
40
+ ## Numeric guidance
41
+
42
+ Router plans may still expose values such as:
43
+
44
+ - `maxIterations`
45
+ - `maxRevisionRounds`
46
+ - `maxReplans`
47
+ - `maxWorkers`
48
+
49
+ These are **advisory defaults**, useful for prompts, diagnostics, or planning. Runtime hooks do not maintain authoritative counters, reserve mutation capacity, or reject the Nth event.
50
+
51
+ A long loop should produce a message such as:
52
+
53
+ > Iterative work is getting long; verify assumptions or consider re-planning.
54
+
55
+ It should not create a lock.
56
+
57
+ ## Mutation observation
58
+
59
+ The previous mutation-probe subsystem and `.mutation-probes.lock` were removed by #190. Shell classification is now best-effort evidence for reminders. A false positive/negative must not deadlock work.
60
+
61
+ Direct edits can still update `lastMutationAt`. Shell outcomes can update handoff evidence heuristically. Missing or ambiguous evidence degrades reminder quality, not execution availability.
62
+
63
+ ## Completion
64
+
65
+ `workflow-stop-gate.js` and `stop-gate.js` are reminder surfaces. When verification or Fable stage evidence is incomplete they report the missing evidence and return success to the host.
66
+
67
+ A workflow may retain `blocked` as a descriptive status recorded by the controller or legacy state, but workflow hooks do not use that value as a persistent execution lock.
68
+
69
+ ## Fable and worktrees
70
+
71
+ Fable stage graphs, dependencies, write sets, and objective checks remain useful planning/evidence structures. `maxWorkers` no longer chunks ready stages as a hard concurrency cap.
72
+
73
+ For major work, a linked worktree remains strongly recommended. Missing isolation is surfaced prominently, but Harness-owned cognitive workflow hooks do not turn it into a self-deadlocking runtime state.
74
+
75
+ ## Legacy state
76
+
77
+ Existing sessions may contain `budget.state = "budget-exhausted"`, old counters, or mutation-probe files from earlier versions. Current runtime code treats the budget API as advisory compatibility only and creates no new mutation-probe state.
78
+
79
+ Starting a fresh session remains the cleanest way to discard old evidence, but it is no longer required to recover from numeric budget exhaustion.
80
+
81
+ ## Testing contract
82
+
83
+ Regression tests should prove:
84
+
85
+ - reminders fire when relevant;
86
+ - commands/Stop remain available;
87
+ - no mutation-probe lock or reservation state is created;
88
+ - `exec_command` verification can update `lastVerifyAt`;
89
+ - Rule of 3 trips exactly at three matching failures;
90
+ - a valid reflection resets the cycle;
91
+ - a later three-failure cycle requests another reflection rather than a permanent hard lock;
92
+ - permission/dangerous-action boundaries remain separate and intact.
@@ -1,6 +1,6 @@
1
1
  id: positive-trivial-tier1-001
2
2
  name: Trivial edit routes to Tier 1
3
- description: "Route software/project work through the Harness kernel: classify Tier 1/2/3, establish mandatory invariants, then let the agent choose tactics and domain skills. Use for software triage, routing, and re-routing; not general Q&A or non-software writing."
3
+ description: "Route software/project work through the Harness kernel: classify Tier 1/2/3, surface planning guidance and applicable skills, then let the agent choose tactics. Use for software triage, routing, and re-routing; not general Q&A or non-software writing."
4
4
  tags:
5
5
  - positive-trigger
6
6
  - tier-1
@@ -1,6 +1,6 @@
1
1
  id: positive-standard-tier2-001
2
2
  name: Standard bug fix routes to Tier 2
3
- description: "Route software/project work through the Harness kernel: classify Tier 1/2/3, establish mandatory invariants, then let the agent choose tactics and domain skills. Use for software triage, routing, and re-routing; not general Q&A or non-software writing."
3
+ description: "Route software/project work through the Harness kernel: classify Tier 1/2/3, surface planning guidance and applicable skills, then let the agent choose tactics. Use for software triage, routing, and re-routing; not general Q&A or non-software writing."
4
4
  tags:
5
5
  - positive-trigger
6
6
  - tier-2
@@ -1,6 +1,6 @@
1
1
  id: positive-macro-tier3-001
2
2
  name: Architectural task routes to Tier 3
3
- description: "Route software/project work through the Harness kernel: classify Tier 1/2/3, establish mandatory invariants, then let the agent choose tactics and domain skills. Use for software triage, routing, and re-routing; not general Q&A or non-software writing."
3
+ description: "Route software/project work through the Harness kernel: classify Tier 1/2/3, surface planning guidance and applicable skills, then let the agent choose tactics. Use for software triage, routing, and re-routing; not general Q&A or non-software writing."
4
4
  tags:
5
5
  - positive-trigger
6
6
  - tier-3
@@ -1,6 +1,6 @@
1
1
  id: positive-using-git-worktrees-001
2
2
  name: On-scope prompt triggers using-git-worktrees
3
- description: "Use when starting feature work needing isolation or before implementation plans - ensures an isolated workspace via native tools or git worktree fallback"
3
+ description: "Use when starting feature work needing isolation or before implementation plans - recommends an isolated workspace via native tools or git worktree fallback"
4
4
  tags:
5
5
  - positive-trigger
6
6
  inputs:
@@ -4,7 +4,7 @@ description: "Stage large, multi-source or multi-session tasks through a written
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 0.13.0
7
+ version: 0.16.1
8
8
  ---
9
9
 
10
10
  # Fable Mode (v3)
@@ -7,7 +7,7 @@ description: >-
7
7
  license: Apache-2.0
8
8
  metadata:
9
9
  author: Miya Daniel
10
- version: 0.13.0
10
+ version: 0.16.1
11
11
  ---
12
12
 
13
13
  # Execution Guardrails
@@ -4,7 +4,7 @@ description: "Run staged fable work on Haiku for bulk mechanical tasks with expl
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 0.13.0
7
+ version: 0.16.1
8
8
  ---
9
9
 
10
10
  # Fable Mode — Haiku
@@ -4,7 +4,7 @@ description: "Run staged fable orchestration on Opus for cross-stage synthesis,
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 0.13.0
7
+ version: 0.16.1
8
8
  ---
9
9
 
10
10
  # Fable Mode — Opus
@@ -4,7 +4,7 @@ description: "Run staged fable work on Sonnet for non-trivial implementation, re
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 0.13.0
7
+ version: 0.16.1
8
8
  ---
9
9
 
10
10
  # Fable Mode — Sonnet
@@ -180,8 +180,9 @@ function dependencyBatches(stages, validateWrites, maxBatchSize = Infinity) {
180
180
  return batches;
181
181
  }
182
182
 
183
- function topologicalBatches(stages, maxWorkers) {
184
- return dependencyBatches(stages, true, maxWorkers);
183
+ function topologicalBatches(stages, _maxWorkers) {
184
+ // maxWorkers is an advisory planning hint, not a runtime concurrency lock (#190).
185
+ return dependencyBatches(stages, true);
185
186
  }
186
187
 
187
188
  function sequentialBatches(stages) {
@@ -197,7 +198,7 @@ function validateRouterPlan(routerContract) {
197
198
  if (plan.strategySelection !== 'selected') throw new Error(`workflow strategy is not selected: ${plan.strategySelection}`);
198
199
  if (!FABLE_STRATEGIES.has(plan.strategy)) throw new Error(`workflow strategy is not a Fable consumer topology: ${plan.strategy}`);
199
200
  if (plan.fallback && plan.fallback.disposition === 'blocked') {
200
- throw new Error(`workflow plan is blocked: ${(plan.fallback.reasonCodes || []).join(', ') || 'unspecified reason'}`);
201
+ console.error(`[Fable Reminder] plan reports blocked/degraded capability: ${(plan.fallback.reasonCodes || []).join(', ') || 'unspecified reason'}`);
201
202
  }
202
203
  if (plan.strategy === 'fable-parallel' && (!plan.parallelism || plan.parallelism.allowed !== true)) {
203
204
  throw new Error('fable-parallel requires workflowPlan.parallelism.allowed=true');
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: harness-everything
3
- description: "Route software/project work through the Harness kernel: classify Tier 1/2/3, establish mandatory invariants, then let the agent choose tactics and domain skills. Use for software triage, routing, and re-routing; not general Q&A or non-software writing."
3
+ description: "Route software/project work through the Harness kernel: classify Tier 1/2/3, surface planning guidance and applicable skills, then let the agent choose tactics. Use for software triage, routing, and re-routing; not general Q&A or non-software writing."
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 0.13.0
7
+ version: 0.16.1
8
8
  ---
9
9
 
10
10
  # Harness Everything
@@ -19,20 +19,20 @@ Kernel routing entry.
19
19
  - General Q&A or non-software writing.
20
20
 
21
21
  ## Invariants
22
- 1. **Route before execution** — establish scope/tier and the smallest applicable workflow.
23
- 2. **Verify before claim** — require objective evidence.
24
- 3. **Re-plan on repetition** — after 3 same-signature failures, use `zoom-out`.
22
+ 1. **Route before execution** — establish scope/tier and useful workflow guidance.
23
+ 2. **Verify before claim** — seek objective evidence before saying work is done.
24
+ 3. **Zoom out on repetition** — after 3 same-signature failures, use `zoom-out`.
25
25
  4. **Evaluate before omission** — read each suggested skill's `SKILL.md` before deciding applicability.
26
- 5. **Resolve selected workflow** — model confidence is not an escape condition.
26
+ 5. **Keep agency** — workflow state and numeric limits guide; they do not hard-stop execution.
27
27
 
28
28
  ## Workflow
29
29
  1. Reuse kernel output, or run `node "<this-skill-dir>/scripts/kernel-router.js" "<prompt summary>"`.
30
30
  2. Surface the **Harness Routing Checkpoint**.
31
- 3. Read each suggested `SKILL.md`; evaluate `USE FOR`, `DO NOT USE FOR`, workflow/basic flow, and hard rules. "Simple", "routine", names, or summaries alone cannot justify omission.
32
- 4. Execute the selected workflow topology to resolution. Suggested skills are conditional on applicability; the selected topology is not advisory.
33
- 5. If the workflow genuinely cannot represent part of the task, use the explicit escape with uncovered scope + evidence. Covered obligations remain mandatory.
34
- 6. Complete only after applicable workflow obligations and objective verification resolve.
31
+ 3. Read each suggested `SKILL.md`; evaluate `USE FOR`, `DO NOT USE FOR`, workflow/basic flow, and hard rules.
32
+ 4. Use the selected topology as planning guidance. Choose, combine, reorder, or skip steps when evidence supports doing so.
33
+ 5. Prefer worktree isolation for broad/Tier-3 mutation and objective verification before completion.
34
+ 6. If guidance is not useful, explain the reason briefly and continue; no Harness reset is required.
35
35
 
36
- **Rule:** mandatory applicable workflow; flexible reasoning/implementation inside it; evidence-backed escape only for uncovered scope.
36
+ **Rule:** guidance may become louder when evidence is weak, but only Rule-of-3 reflection and explicit user/host permission boundaries may block.
37
37
 
38
38
  Deep dive: <this-skill-dir>/references/triage-and-tiers.md
@@ -2,7 +2,7 @@
2
2
 
3
3
  Harness uses tiers to estimate scope and select the smallest sufficient execution topology. A tier is **not** a fixed TODO/TDD/Fable pipeline. Once the router selects an applicable topology, however, that topology becomes the run's execution contract.
4
4
 
5
- > Architecture rule: **Mandatory applicable workflow; flexible reasoning/implementation inside it; evidence-backed escape only for workflow-uncovered scope.**
5
+ > Architecture rule: **Guidance-first workflow; flexible reasoning/implementation; only Rule-of-3 reflection and explicit permission boundaries may block.**
6
6
 
7
7
  ## 0. When Harness Routing Applies
8
8
 
@@ -43,7 +43,7 @@ The kernel protects lifecycle obligations without micromanaging model reasoning.
43
43
  2. **Verify before claim** — completion requires objective evidence appropriate to the change.
44
44
  3. **Re-plan on repetition** — after three same-signature failures, stop micro-retrying and use a fresh diagnosis / `zoom-out`.
45
45
  4. **Evaluate before omission** — when the router suggests a skill, read its complete `SKILL.md` entry/basic flow before deciding applicability.
46
- 5. **Resolve selected workflow** — once a topology is selected, execute it to a resolved state; "simple", "routine", "already clear", or model confidence are not escape conditions.
46
+ 5. **Review selected workflow** — use the topology as planning guidance and keep any skipped step evidence-based.
47
47
 
48
48
  The model remains free to choose tools, implementation technique, decomposition details, and reasoning inside the workflow.
49
49
 
@@ -54,7 +54,7 @@ The model remains free to choose tools, implementation technique, decomposition
54
54
  - Every router-suggested skill when its evaluated flow is objectively not applicable.
55
55
  - Every optional deep-dive/reference linked from a skill.
56
56
 
57
- A suggested skill may resolve as `use`, `not-applicable`, or `unresolved/unavailable`. `not-applicable` needs a flow-grounded reason; a metadata-only or confidence-only judgement is insufficient. The selected **topology** is different: it is mandatory after selection unless an explicit workflow escape records genuinely uncovered scope plus evidence.
57
+ A suggested skill may resolve as `use`, `not-applicable`, or `unresolved/unavailable`. `not-applicable` needs a flow-grounded reason; a metadata-only or confidence-only judgement is insufficient. The selected **topology** is planning guidance. Escape/replan metadata may still record why a suggested path was not followed, but it is not a lock.
58
58
 
59
59
  ## 2. Routing Mechanism
60
60
 
@@ -73,7 +73,7 @@ npx github:dyphn1/Harness-everything next "<brief prompt summary>"
73
73
  - compact **Harness Routing Checkpoint**,
74
74
  - required invariants,
75
75
  - suggested skills whose applicability must be evaluated,
76
- - **Workflow Execution Contract** for the selected topology.
76
+ - **Workflow Guidance** for the selected topology.
77
77
 
78
78
  If `UserPromptSubmit` already ran the kernel this turn, reuse that output. Do not infer a silent Tier 1/direct path from missing or degraded routing.
79
79
 
@@ -90,12 +90,12 @@ A name, description, router summary, tier label, or generic "routine/common task
90
90
 
91
91
  ### Workflow escape contract
92
92
 
93
- Escape is an exception path, not an alternative default. Use it only when the selected topology genuinely cannot represent part of the task. The permitted reason codes are:
93
+ Escape is audit metadata for a bounded guidance deviation. Use it only when the selected topology genuinely cannot represent part of the task. The permitted reason codes are:
94
94
 
95
95
  - `workflow-uncovered-scope` — the selected topology cannot represent a bounded part of the task;
96
96
  - `host-capability-unavailable` — the host lacks a capability required to execute the selected topology.
97
97
 
98
- Every escape must name a declared stage in the correlated run and record the reason code, uncovered scope, and evidence explaining the coverage/capability gap. The entire workflow never becomes escaped; isolation and independent verification cannot be waived. Covered workflow obligations remain mandatory. Host capability loss must be visible as degradation/blocked/escape evidence, never silently converted into optional execution.
98
+ Every escape must name a declared stage in the correlated run and record the reason code, uncovered scope, and evidence explaining the coverage/capability gap. Host capability loss and missing isolation should remain visible as warnings/evidence, without creating a persistent execution lock.
99
99
 
100
100
  ## 3. Tier Guidance
101
101
 
@@ -117,7 +117,7 @@ When an evaluated skill is applicable, follow its workflow rather than reading i
117
117
 
118
118
  Typical shape: repository-wide/architectural work, large ambiguous requirements, cross-source synthesis, or bounded delegation.
119
119
 
120
- The router may select `fable-staged`, `fable-parallel`, or `fable-multi-agent-workspace`. A selected Fable topology is not advisory: enter its stage-contract lifecycle, honor dependency/write-set constraints, run objective checks, synthesize, cold-verify where required, and use bounded re-planning on failure.
120
+ The router may select `fable-staged`, `fable-parallel`, or `fable-multi-agent-workspace`. A selected Fable topology is structured planning guidance: use its stages/dependencies/evidence when helpful, but do not convert missing lifecycle evidence into a persistent workflow lock.
121
121
 
122
122
  Tier 3 does **not** automatically mean multi-agent; the router still chooses the smallest sufficient topology.
123
123
 
@@ -140,11 +140,11 @@ This describes a reasoning policy. The workflow contract governs lifecycle oblig
140
140
 
141
141
  | Host mode | Expected behavior |
142
142
  |---|---|
143
- | Lifecycle hooks available | Kernel creates the selected workflow contract. Supported PreToolUse/Stop gates may mechanically prevent known bypasses. |
144
- | Advisory instructions only | Agent is instructed to establish and resolve the same contract, but the host cannot be described as mechanically enforcing it. |
143
+ | Lifecycle hooks available | Kernel records selected workflow guidance. PreToolUse/Stop hooks emit reminders; Rule-of-3 and permission gates are the intentional blocking exceptions. |
144
+ | Advisory instructions only | Agent receives the same routing/workflow guidance without lifecycle observations. |
145
145
  | Manual use | Invoke `harness-everything` / `harness next`, then execute the selected topology explicitly. |
146
146
 
147
- On Claude and the local OpenAI package, supported mutation hooks require Fable entry and Tier 3/Fable Git worktree isolation. Follow-up prompts preserve unresolved state. The router displays a session `workflow-stages.json` path and `workflow-disposition.js start` command; declare stages there before entry. Stop checks expected stage contracts plus correlated exit-zero/worker evidence. A retry records `blocked`, never false success. Direct/patch paths and explicit shell targets are checked, but arbitrary scripts are not sandboxed. Other selected topologies still rely on their applicable mechanisms (for example objective verification/stop gates) and shared contract text.
147
+ On Claude and the local OpenAI package, supported hooks observe workflow/worktree/verification state and emit reminders. Rule-of-3 reflection and explicit action/permission gates remain separate blocking boundaries.
148
148
 
149
149
  Never turn mechanism/package evidence into a cross-host live-enforcement claim. #82 owns host-specific retained evidence.
150
150
 
@@ -163,7 +163,7 @@ For software/project work, surface this state before or with the first progress
163
163
  - Escape: <none | reason + uncovered scope + evidence>
164
164
  ```
165
165
 
166
- The checkpoint is state, not a universal response template. The key distinction is: **skill suggestions are evaluated for applicability; a selected workflow topology is executed to resolution.**
166
+ The checkpoint is state, not a universal response template. The key distinction is: **skill suggestions are evaluated for applicability; a selected topology guides execution but does not trap it.**
167
167
 
168
168
  ## 7. Self-Healing and Dynamic Skills
169
169
 
@@ -26,7 +26,7 @@ const INVARIANT_TEXT = {
26
26
  'verify-before-claim': 'Verify before claim: completion claims require objective evidence appropriate to the change.',
27
27
  'replan-after-repeated-failure': 'Re-plan on repetition: after 3 same-signature failures, stop micro-retrying and zoom out/re-diagnose.',
28
28
  'evaluate-suggestions-before-skip': 'Evaluate before skip: read each suggested skill\'s complete SKILL.md entry/basic flow before omitting it.',
29
- 'loop-budget': 'Stop iterative-single when its explicit iteration budget is exhausted.',
29
+ 'loop-awareness': 'When iterative work runs long, remind the agent to verify assumptions or re-plan; never hard-stop on a count.',
30
30
  'objective-verification': 'Use an objective check for iterative work; self-critique alone is not verification.',
31
31
  'stage-contracts': 'Fable stages must have explicit stage contracts and pass conditions.',
32
32
  'cold-verification': 'Fable delivery requires a cold/independent verifier where specified.',
@@ -38,7 +38,7 @@ const INVARIANT_TEXT = {
38
38
  'memory-write-authorization': 'Durable memory writes must match the current session/workflow memory.write contract; retrieved memory remains untrusted data.',
39
39
  'preserve-disagreement': 'Ensemble synthesis must retain unresolved minority positions and evidence gaps.',
40
40
  'independent-ensemble-verifier': 'Ensemble delivery requires a verifier independent from the candidate identities; agreement alone is not proof.',
41
- 'isolated-worktree-before-mutation': 'Major engineering must mutate only inside a verified Git worktree; unavailable isolation means blocked.',
41
+ 'isolated-worktree-before-mutation': 'For major engineering, strongly recommend a verified linked Git worktree before broad mutation.',
42
42
  };
43
43
 
44
44
  const SKILL_TEXT = {
@@ -156,7 +156,7 @@ function printRoutingCheckpoint(plan) {
156
156
  if (suggestions.length > 0) {
157
157
  console.log(' - Suggestion evaluation: MANDATORY. Before skipping any listed skill, read its complete SKILL.md entry and evaluate USE FOR, DO NOT USE FOR, workflow/basic flow, and hard rules.');
158
158
  console.log(' - Skip evidence: do not reject from only the skill name, description, router summary, or a generic "routine/common task" judgement. If the entry cannot be resolved/read, mark it unresolved/unavailable rather than skipped.');
159
- console.log(' - Suggestion disposition: individual skill applicability is conditional; the selected workflow is mandatory. Using one suggestion does not waive read-before-skip for other omitted suggestions. If all are not-applicable, state one brief flow-grounded reason.');
159
+ console.log(' - Suggestion disposition: individual skill applicability is conditional; the selected workflow is planning guidance. Using one suggestion does not waive read-before-skip for other omitted suggestions. If all are not-applicable, state one brief flow-grounded reason.');
160
160
  }
161
161
  }
162
162
 
@@ -166,7 +166,7 @@ function printKernelContract(plan) {
166
166
  console.log(` - ${invariant}: ${INVARIANT_TEXT[invariant] || 'Required by the selected workflow plan.'}`);
167
167
  }
168
168
 
169
- console.log('\n=> WORKFLOW SKILLS (EVALUATE APPLICABILITY — SELECTED WORKFLOW IS MANDATORY):');
169
+ console.log('\n=> WORKFLOW SKILLS (EVALUATE APPLICABILITY — SELECTED WORKFLOW IS GUIDANCE):');
170
170
  if (Array.isArray(plan.suggestedSkills) && plan.suggestedSkills.length > 0) {
171
171
  const emitted = new Set();
172
172
  for (const skill of plan.suggestedSkills) {
@@ -204,7 +204,7 @@ function printKernelContract(plan) {
204
204
  console.log('\n=> ROUTING DEGRADATION: Structured routing is degraded. Keep the strategy deferred unless independent evidence supports a route; do not silently downgrade to Tier 1/direct execution.');
205
205
  }
206
206
 
207
- console.log('\n=> ORCHESTRATION POLICY: Mandatory applicable workflow. The selected topology is an execution contract; the model controls HOW to satisfy it. Escape requires explicit uncovered scope and evidence; covered obligations remain mandatory.');
207
+ console.log('\n=> ORCHESTRATION POLICY: Selected topology is planning guidance. Evaluate the suggested workflow and preserve objective evidence, but lifecycle hooks remind rather than hard-block. User/host permission boundaries and the Rule-of-3 zoom-out remain separate safety rails.');
208
208
  }
209
209
 
210
210
  function route(prompt, stdinPayload) {
@@ -58,9 +58,8 @@ function persistWorkflow(plan, payload, prompt) {
58
58
  // Steering/status prompts cannot drop an unresolved execution contract.
59
59
  // Stronger new work is retained as a pending route until explicit replan.
60
60
  if (runtime.isMajorWorkflow(plan) && !runtime.isMajorWorkflow(context.workflow)) {
61
- context.workflow.state = 'blocked';
62
61
  context.workflow.pendingPlan = plan;
63
- context.workflow.blockReason = 'stronger-route-requires-replan';
62
+ context.workflow.planningWarning = 'stronger-route-suggested';
64
63
  }
65
64
  context.workflow.lastPromptHash = crypto.createHash('sha256').update(prompt).digest('hex').slice(0, 24);
66
65
  const memoryCapability = issueMemoryCapability(context.workflow);
@@ -84,14 +83,15 @@ function persistWorkflow(plan, payload, prompt) {
84
83
  verification: plan.verification,
85
84
  mutationIsolation: plan.mutationIsolation || { required: false },
86
85
  workflowPlan: plan,
87
- state: plan.fallback?.disposition === 'blocked' ? 'blocked' : selected ? 'pending' : 'deferred',
86
+ state: selected ? 'pending' : 'deferred',
87
+ planningWarnings: plan.fallback?.disposition === 'none' ? [] : [...(plan.fallback?.reasonCodes || [])],
88
88
  runId: null,
89
89
  revision: 0,
90
90
  escapes: [],
91
- enforcement: {
92
- mode: 'mandatory-applicable-workflow',
93
- escapePolicy: 'scoped-evidence-only',
91
+ guidance: {
92
+ mode: 'advisory-workflow',
94
93
  reasoningPolicy: 'model-controls-how',
94
+ hardBoundaries: ['rule-of-3-reflection', 'user-host-permission'],
95
95
  },
96
96
  };
97
97
  const memoryCapability = issueMemoryCapability(context.workflow);
@@ -133,15 +133,15 @@ function run(raw) {
133
133
  core.printWorkflowPlan(plan);
134
134
  core.printRoutingCheckpoint(plan);
135
135
  core.printKernelContract(plan);
136
- console.log('\n=> WORKFLOW EXECUTION CONTRACT (MANDATORY WHEN SELECTED):');
136
+ console.log('\n=> WORKFLOW GUIDANCE (ADVISORY WHEN SELECTED):');
137
137
  console.log(' - State: ' + (persisted?.workflow.state || (plan.strategy ? 'unpersisted' : 'deferred')));
138
138
  console.log(' - Selected workflow: ' + (plan.strategy || 'deferred'));
139
139
  if (plan.strategySelection === 'selected') {
140
- console.log(' - Execute the selected workflow to resolution. Reasoning and implementation remain flexible inside it.');
141
- console.log(' - Completion requires the workflow obligations and objective verification to resolve.');
142
- console.log(' - Generic simple/routine/already-clear reasons cannot waive the selected workflow.');
143
- console.log(' - Tier 3 / Fable source and artifact mutations require Git worktree isolation; unavailable isolation means BLOCKED.');
144
- console.log(' - Escape is limited to workflow-uncovered-scope or host-capability-unavailable, with stage, scope and evidence; other obligations remain mandatory.');
140
+ console.log(' - Use the selected workflow as planning guidance; reasoning and implementation remain flexible.');
141
+ console.log(' - Before claiming completion, review unresolved workflow evidence and objective verification.');
142
+ console.log(' - If you skip a suggested step, keep the reason explicit and evidence-based.');
143
+ console.log(' - Tier 3 / Fable changes are safer in a linked Git worktree; missing isolation is a strong reminder, not a Harness lock.');
144
+ console.log(' - Escape/replan metadata remains useful for audit, but it does not create a persistent execution lock.');
145
145
  }
146
146
  if (persisted?.workflow) {
147
147
  const controller = path.join(persisted.hooksRoot, 'workflow-disposition.js');
@@ -152,12 +152,10 @@ function run(raw) {
152
152
  console.log(' - Enter/replan: node "' + controller + '" start --session-id "' + persisted.sessionId + '"');
153
153
  console.log(' - Escape one declared stage: node "' + controller + '" escape --session-id "' + persisted.sessionId + '" --stage-id "<id>" --reason-code workflow-uncovered-scope --scope "<uncovered scope>" --evidence "<evidence>"');
154
154
  } else {
155
- console.log(' - Runtime state was not persisted; host enforcement is unavailable/unknown, not proven hard enforcement.');
155
+ console.log(' - Runtime state was not persisted; reminders may be less precise, but execution remains available.');
156
156
  }
157
- if (failure) {
158
- console.error('[Workflow Router] ' + failure.message);
159
- process.exitCode = 2;
160
- } else if (result && result.status !== 0) process.exitCode = result.status || 1;
157
+ if (failure) console.error('[Workflow Reminder] routing state was not persisted: ' + failure.message);
158
+ if (result && result.status !== 0) console.error('[Workflow Reminder] router returned status ' + result.status + '; guidance is degraded, not blocking.');
161
159
  }
162
160
 
163
161
  if (typeof module !== 'undefined') module.exports = { isHostNotificationPrompt };
@@ -349,7 +349,7 @@ function planMetadataForStrategy(strategy) {
349
349
  return {
350
350
  ...base,
351
351
  patterns: ['router', 'react'],
352
- requiredInvariants: [...base.requiredInvariants, 'loop-budget', 'objective-verification'],
352
+ requiredInvariants: [...base.requiredInvariants, 'loop-awareness', 'objective-verification'],
353
353
  suggestedSkills: ['tdd', 'verification-loop'],
354
354
  maxIterations: ITERATIVE_MAX_ITERATIONS,
355
355
  parallelAllowed: false,