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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +8 -0
- package/README.md +7 -7
- package/VERIFICATION.md +3 -3
- package/ci/invariant-routing.test.js +58 -158
- package/ci/mechanism-2a-rule-of-3.test.js +73 -138
- package/ci/mechanism-2ac-atomic-commit-check.test.js +2 -2
- package/ci/mechanism-2af-worktree-isolation.test.js +38 -196
- package/ci/mechanism-2ah-workflow-lifecycle.test.js +20 -831
- package/ci/mechanism-2ai-workspace-fingerprint-batch.test.js +3 -4
- package/ci/mechanism-2b-boundary-guard.test.js +6 -16
- package/ci/mechanism-2e-scope-guard.test.js +8 -24
- package/ci/mechanism-2f-stop-gate.test.js +21 -75
- package/ci/mechanism-2n-opencode-plugin.test.js +13 -28
- package/ci/openai-plugin-package.test.js +8 -8
- package/ci/openai-plugin-runtime.test.js +2 -2
- package/ci/router-workflow-plan.test.js +6 -6
- package/ci/self-evolve-loop.test.js +4 -1
- package/ci/workflow-execution-contract.test.js +51 -129
- package/ci/workflow-plan-consumers-edge.test.js +1 -1
- package/ci/workflow-plan-consumers.test.js +6 -6
- package/docs/architecture.md +21 -21
- package/docs/enforcement-locks.md +41 -102
- package/docs/mechanism-first-skill-mesh.md +2 -2
- package/docs/philosophy.md +2 -2
- package/docs/platform-capabilities.md +3 -3
- package/docs/routing.md +14 -14
- package/docs/workflow-runtime.md +80 -110
- package/evals/harness-everything/tasks/positive-tier1.yaml +1 -1
- package/evals/harness-everything/tasks/positive-tier2.yaml +1 -1
- package/evals/harness-everything/tasks/positive-tier3.yaml +1 -1
- package/evals/using-git-worktrees/tasks/positive-trigger.yaml +1 -1
- package/fable-mode/SKILL.md +1 -1
- package/fable-mode/execution-guardrails/SKILL.md +1 -1
- package/fable-mode/fable-haiku/SKILL.md +1 -1
- package/fable-mode/fable-opus/SKILL.md +1 -1
- package/fable-mode/fable-sonnet/SKILL.md +1 -1
- package/fable-mode/scripts/workflow-plan-consumer.js +4 -3
- package/harness-everything/SKILL.md +11 -11
- package/harness-everything/references/triage-and-tiers.md +11 -11
- package/harness-everything/scripts/kernel-router-core.js +5 -5
- package/harness-everything/scripts/kernel-router.js +15 -17
- package/harness-everything/scripts/router-contract-core.js +1 -1
- package/hooks/hooks.json +10 -23
- package/hooks/scripts/atomic-commit-check.js +1 -1
- package/hooks/scripts/boundary-guard.js +4 -4
- package/hooks/scripts/contract-test.js +8 -11
- package/hooks/scripts/depth-guard.js +2 -2
- package/hooks/scripts/lib/workflow-runtime.js +24 -402
- package/hooks/scripts/rule-of-3-tracker.js +28 -31
- package/hooks/scripts/rule-of-3.js +4 -28
- package/hooks/scripts/state-persist.js +36 -136
- package/hooks/scripts/stop-gate.js +15 -48
- package/hooks/scripts/subagent-scope-guard.js +8 -8
- package/hooks/scripts/workflow-disposition.js +2 -10
- package/hooks/scripts/workflow-gate.js +33 -84
- package/hooks/scripts/workflow-mutation-denied.js +3 -15
- package/hooks/scripts/workflow-stop-gate.js +23 -38
- package/opencode-plugin/README.md +9 -10
- package/opencode-plugin/index.mjs +14 -30
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/hooks.json +3 -3
- package/plugins/harness-everything/hooks/scripts/atomic-commit-check.js +1 -1
- package/plugins/harness-everything/hooks/scripts/boundary-guard.js +4 -4
- package/plugins/harness-everything/hooks/scripts/contract-test.js +8 -11
- package/plugins/harness-everything/hooks/scripts/depth-guard.js +2 -2
- package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +24 -402
- package/plugins/harness-everything/hooks/scripts/rule-of-3-tracker.js +28 -31
- package/plugins/harness-everything/hooks/scripts/rule-of-3.js +4 -28
- package/plugins/harness-everything/hooks/scripts/state-persist.js +36 -136
- package/plugins/harness-everything/hooks/scripts/stop-gate.js +15 -48
- package/plugins/harness-everything/hooks/scripts/subagent-scope-guard.js +8 -8
- package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +2 -10
- package/plugins/harness-everything/hooks/scripts/workflow-gate.js +33 -84
- package/plugins/harness-everything/hooks/scripts/workflow-mutation-denied.js +3 -15
- package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +23 -38
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/scripts/lib/advisory-text.js +16 -29
- package/plugins/harness-everything/skills/fable-mode/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/execution-guardrails/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-haiku/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-opus/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-sonnet/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/scripts/workflow-plan-consumer.js +4 -3
- package/plugins/harness-everything/skills/harness-everything/SKILL.md +11 -11
- package/plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md +11 -11
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router-core.js +5 -5
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +15 -17
- package/plugins/harness-everything/skills/harness-everything/scripts/router-contract-core.js +1 -1
- package/plugins/harness-everything/skills/using-git-worktrees/SKILL.md +5 -5
- package/scripts/lib/advisory-text.js +16 -29
- package/using-git-worktrees/SKILL.md +5 -5
|
@@ -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.16.
|
|
13
|
+
"version": "0.16.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.16.
|
|
4
|
+
"version": "0.16.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Miya Daniel"
|
|
7
7
|
},
|
package/AGENTS.md
CHANGED
|
@@ -40,8 +40,8 @@ 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
|
|
44
|
-
11. **
|
|
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.
|
|
44
|
+
11. **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
45
|
|
|
46
46
|
## Verification Before You Claim Done
|
|
47
47
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.16.1](https://github.com/dyphn1/Harness-everything/compare/v0.16.0...v0.16.1) (2026-09-20)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **runtime:** decouple recovery learning from rule reset ([7260e03](https://github.com/dyphn1/Harness-everything/commit/7260e031873eef03b895ffef76c490c8da18201b))
|
|
10
|
+
* **runtime:** fail open advisory workflow hooks ([b0f8bec](https://github.com/dyphn1/Harness-everything/commit/b0f8bec15baaf1fa64a960f2a4890fd89fb22653))
|
|
11
|
+
* **runtime:** preserve rule-of-3 failure evidence ([ce9fc6c](https://github.com/dyphn1/Harness-everything/commit/ce9fc6c97a231cae4fada49645506db54a56ecc8))
|
|
12
|
+
|
|
5
13
|
## [0.16.0](https://github.com/dyphn1/Harness-everything/compare/v0.15.0...v0.16.0) (2026-09-20)
|
|
6
14
|
|
|
7
15
|
### 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
|
|
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.
|
|
23
23
|
|
|
24
24
|
### Comparison: Prompt vs. Skill vs. Harness
|
|
25
25
|
|
|
@@ -148,7 +148,7 @@ The Tier changes the **recommendations**, not the required order. Tier 2 may sug
|
|
|
148
148
|
Harness operates through six core cognitive concepts:
|
|
149
149
|
|
|
150
150
|
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.
|
|
151
|
-
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`
|
|
151
|
+
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.
|
|
152
152
|
3. **Memory (`state-persist.js`):** Session transaction logging for stateful hook/plugin integrations. Static skills/instructions alone do not create WAL state.
|
|
153
153
|
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.
|
|
154
154
|
5. **Subagent Scope Guard (`subagent-scope-guard.js`):** Diffs the whole repo's `git status` before and after every supported subagent (`Task`) burst, not just the files it was briefed to touch. Catches a subagent that was told to only read/verify but edited files anyway — where that host/integration actually invokes the guard.
|
|
@@ -160,14 +160,14 @@ Harness operates through six core cognitive concepts:
|
|
|
160
160
|
|
|
161
161
|
The authoritative current matrix is [docs/platform-capabilities.md](docs/platform-capabilities.md). The important distinction is that **one host can have multiple Harness installation surfaces**.
|
|
162
162
|
|
|
163
|
-
[`opencode-plugin/`](opencode-plugin/) (`index.mjs`) implements
|
|
163
|
+
[`opencode-plugin/`](opencode-plugin/) (`index.mjs`) implements verification observation/reminders and a Rule of 3 breaker against OpenCode's real, source-verified plugin API (`tool.execute.before`/`.after`, the `session.idle` event). `ci/mechanism-2n-opencode-plugin.test.js` drives the exported hooks directly against a mock context matching that API. Retained evidence supports project-scope `.js` plugin loading and edit/verification state on OpenCode 1.18.31 (macOS): [live-host evidence](benchmarks/results/live-host/opencode-2026-09-16/README.md). The retained snapshot predates #190's simplification and is historical evidence only: its final snapshot was post-reset; the old hard-lock was only an interactive observation, with no retained blocked-tool trace. Current OpenCode behavior keeps the third-failure reflection boundary but no permanent post-reflection hard lock. Reflection was operator-seeded, then agent-rewritten, not unaided; no behavioral-effectiveness claim is made. Install with a **`.js`** destination name: this host silently ignores `.mjs` (issue #127, guarded by `test:opencode:loadability`). Global scope, npm-package installation, and other host versions remain unverified.
|
|
164
164
|
|
|
165
165
|
| AI Agent Tool / Surface | Integration Method | Local Target Location | Enforcement claim |
|
|
166
166
|
|---|---|---|---|
|
|
167
|
-
| **Claude Code** | Native lifecycle hooks (`PreToolUse`, `PostToolUse`, `SessionStart`, `UserPromptSubmit`, `Stop`) | `.claude/settings.json`, `.claude/skills/`, `.claude/agents/` |
|
|
168
|
-
| **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);
|
|
167
|
+
| **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 |
|
|
168
|
+
| **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 |
|
|
169
169
|
| **Codex — general installer path** | Skills + `AGENTS.md` guidance | `AGENTS.md` + repo-scoped `.agents/skills/` | **Advisory/instruction-oriented** where the host only consumes instructions |
|
|
170
|
-
| **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
|
|
170
|
+
| **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 |
|
|
171
171
|
| **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 |
|
|
172
172
|
| **Cursor** | Native Project Rules + project skills | `.cursorrules` + `.cursor/skills/` | Advisory only |
|
|
173
173
|
| **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 |
|
|
@@ -255,7 +255,7 @@ For a deep dive into individual modules and the underlying philosophy, explore o
|
|
|
255
255
|
|
|
256
256
|
* [Harness Philosophy](docs/philosophy.md): The core behavior-first, intervention-only design.
|
|
257
257
|
* [Harness Architecture](docs/architecture.md): Lifecycle hooks, security model, and data locality.
|
|
258
|
-
* [
|
|
258
|
+
* [Guidance and Safety Boundary Diagnostic Flows](docs/enforcement-locks.md): Distinguish reminders from the two intentional blocking boundaries and understand recovery.
|
|
259
259
|
* [Platform Capability Matrix](docs/platform-capabilities.md): Canonical current enforcement/install/evidence boundary per surface.
|
|
260
260
|
* [Repository Runtime & Workflow Contract](docs/repository-contract.md): Generated Node/action/workflow/gate state used by consistency CI.
|
|
261
261
|
* [OpenAI / ChatGPT Plugin Packaging](docs/openai-plugin.md): Local Codex/OpenAI plugin packaging plus public Skills-only submission boundary.
|
package/VERIFICATION.md
CHANGED
|
@@ -129,7 +129,7 @@ npm run test:mechanism
|
|
|
129
129
|
|
|
130
130
|
and inspect the OpenCode-specific mechanism suites (`ci/mechanism-2n-opencode-plugin.test.js` for hook behavior, `ci/mechanism-30-opencode-plugin-loadability.test.js` for install-filename loadability).
|
|
131
131
|
|
|
132
|
-
**Current evidence boundary:** deterministic mechanism coverage plus partial live-host evidence for project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS). See [retained evidence](benchmarks/results/live-host/opencode-2026-09-16/README.md). The
|
|
132
|
+
**Current evidence boundary:** deterministic mechanism coverage plus partial live-host evidence for project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS). See [retained evidence](benchmarks/results/live-host/opencode-2026-09-16/README.md). The retained snapshot predates #190's simplification and is historical evidence, not the current state machine: its final snapshot was post-reset; the old hard-lock was only an interactive observation, with no retained blocked-tool trace. Current OpenCode keeps the third-failure reflection boundary but removes the permanent post-reflection hard lock. Reflection was operator-seeded, then agent-rewritten; no behavioral-effectiveness claim is inferred. `.mjs` auto-discovery is broken on this host version (issue #127). Global scope, npm-package installation, and other host versions remain unverified.
|
|
133
133
|
|
|
134
134
|
---
|
|
135
135
|
|
|
@@ -205,7 +205,7 @@ If the agent chooses multi-agent execution, specialist scopes and merge/verifica
|
|
|
205
205
|
|
|
206
206
|
The current architecture follows one rule:
|
|
207
207
|
|
|
208
|
-
> **Do not enforce workflow order.
|
|
208
|
+
> **Do not hard-enforce workflow order or numeric budgets. Observe, remind, and preserve evidence; only Rule of 3 and explicit permission boundaries may block.**
|
|
209
209
|
|
|
210
210
|
Therefore conformance testing must not require a universal chain such as `TODO → TDD → verification-loop`, nor assert that every TDD task must auto-load a fixed set of companion skills.
|
|
211
211
|
|
|
@@ -213,7 +213,7 @@ For a task run, check these instead:
|
|
|
213
213
|
|
|
214
214
|
1. **Route before execution** — software/project work receives a reasonable scope/tier classification before mutation.
|
|
215
215
|
2. **Verify before claim** — completion claims are backed by objective evidence appropriate to the change.
|
|
216
|
-
3. **Re-plan after repeated same-signature failure** — where the host surface has the mechanism,
|
|
216
|
+
3. **Re-plan after repeated same-signature failure** — where the host surface has the mechanism, the Rule-of-3 guard may require a zoom-out at the third matching failure; other workflow guidance remains advisory.
|
|
217
217
|
4. **Skill-local workflow conformance** — when a skill is actually selected, follow that skill's documented local lifecycle (for example RED/GREEN/REFACTOR inside `tdd`).
|
|
218
218
|
5. **No false mechanism parity** — do not grade an advisory surface as mechanically broken simply because it lacks a hook that was never packaged there.
|
|
219
219
|
|
|
@@ -1,160 +1,60 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const path
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
'use strict';
|
|
3
|
+
const fs=require('fs'),path=require('path'),{spawnSync}=require('child_process');
|
|
4
|
+
const ROOT=path.resolve(__dirname,'..');let failed=0;
|
|
5
|
+
function check(c,m){if(c)console.log(' PASS '+m);else{console.error(' FAIL '+m);failed++;}}
|
|
6
|
+
function read(p){return fs.readFileSync(path.join(ROOT,p),'utf8');}
|
|
7
|
+
console.log('=== Guidance-First Routing Contract ===');
|
|
8
|
+
const kernel=path.join(ROOT,'harness-everything/scripts/kernel-router.js');
|
|
9
|
+
const tier2=spawnSync(process.execPath,[kernel,'add a login endpoint with tests and update the implementation'],{cwd:ROOT,encoding:'utf8'});
|
|
10
|
+
check(tier2.status===0,'kernel router exits successfully');
|
|
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');
|
|
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');
|
|
19
|
+
check(!tier2.stdout.includes('unavailable isolation means BLOCKED'),'old worktree hard-block wording is absent');
|
|
20
|
+
check(tier2.stdout.includes('evaluate-suggestions-before-skip'),'skill suggestions still require evaluation before omission');
|
|
21
|
+
|
|
22
|
+
const tier3=spawnSync(process.execPath,[kernel,'audit the entire repository architecture and coordinate multiple modules'],{cwd:ROOT,encoding:'utf8'});
|
|
23
|
+
check(tier3.status===0,'Tier 3 routing exits successfully');
|
|
24
|
+
check(/RECOMMENDED TIER:\s*Tier 3/i.test(tier3.stdout),'macro task remains Tier 3');
|
|
25
|
+
check(tier3.stdout.includes('using-git-worktrees'),'Tier 3 still recommends worktree guidance');
|
|
26
|
+
check(tier3.stdout.includes('WORKFLOW GUIDANCE (ADVISORY WHEN SELECTED)'),'Tier 3 workflow remains advisory');
|
|
27
|
+
|
|
28
|
+
const hs=read('harness-everything/SKILL.md');
|
|
29
|
+
check(/workflow state and numeric limits guide; they do not hard-stop execution/i.test(hs),'Harness skill states non-blocking workflow contract');
|
|
30
|
+
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');
|
|
31
|
+
check(read('plugins/harness-everything/skills/harness-everything/SKILL.md')===hs,'Harness skill mirror matches');
|
|
32
|
+
|
|
33
|
+
const wt=read('using-git-worktrees/SKILL.md');
|
|
34
|
+
check(/safer in a linked worktree/i.test(wt),'worktree skill strongly recommends isolation');
|
|
35
|
+
check(!/Creation\/entry failure => `BLOCKED`/i.test(wt),'worktree creation failure is not a cognitive blocked state');
|
|
36
|
+
check(read('plugins/harness-everything/skills/using-git-worktrees/SKILL.md')===wt,'worktree skill mirror matches');
|
|
37
|
+
|
|
38
|
+
const triage=read('harness-everything/references/triage-and-tiers.md');
|
|
39
|
+
check(/Guidance-first workflow/i.test(triage),'triage reference uses guidance-first policy');
|
|
40
|
+
check(read('plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md')===triage,'triage mirror matches');
|
|
41
|
+
|
|
42
|
+
for(const p of ['docs/routing.md','docs/architecture.md','docs/philosophy.md','docs/mechanism-first-skill-mesh.md']){
|
|
43
|
+
const t=read(p); check(/guidance/i.test(t),'current doc '+p+' describes guidance');
|
|
16
44
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
check(
|
|
28
|
-
check(
|
|
29
|
-
check(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
check(tier2.stdout.includes('loop-budget:'), 'iterative-single loop budget invariant is present');
|
|
34
|
-
check(tier2.stdout.includes('evaluate-suggestions-before-skip'), 'non-empty suggestions inject evaluate-before-skip invariant');
|
|
35
|
-
check(tier2.stdout.includes('WORKFLOW SKILLS (EVALUATE APPLICABILITY'), 'domain suggestions remain applicability inputs');
|
|
36
|
-
check(tier2.stdout.includes('SELECTED WORKFLOW IS MANDATORY'), 'selected workflow execution is mandatory');
|
|
37
|
-
check(tier2.stdout.includes('tdd:'), 'Tier 2 can still recommend TDD');
|
|
38
|
-
check(!tier2.stdout.includes('BASE EXECUTION LOOP'), 'legacy fixed base-execution-loop output is suppressed');
|
|
39
|
-
check(tier2.stdout.includes('Mandatory applicable workflow'), 'orchestration policy requires selected applicable workflow');
|
|
40
|
-
check(tier2.stdout.includes('model controls HOW to satisfy it'), 'reasoning/implementation freedom remains inside workflow');
|
|
41
|
-
check(tier2.stdout.includes('WORKFLOW EXECUTION CONTRACT (MANDATORY WHEN SELECTED)'), 'kernel emits workflow execution contract');
|
|
42
|
-
check(tier2.stdout.includes('- State: unpersisted'), 'manual route without host session does not claim persisted lifecycle');
|
|
43
|
-
check(tier2.stdout.includes('Generic simple/routine/already-clear reasons cannot waive'), 'model confidence cannot bypass workflow');
|
|
44
|
-
check(tier2.stdout.includes('Escape is limited to workflow-uncovered-scope or host-capability-unavailable'), 'workflow escape is exception-only');
|
|
45
|
-
check(!tier2.stdout.includes('execution remains advisory after evaluation'), 'old advisory execution wording is absent');
|
|
46
|
-
check(!tier2.stdout.includes('isolated-worktree-before-mutation'), 'Tier 2 does not inherit the major-workflow worktree invariant');
|
|
47
|
-
|
|
48
|
-
const tier2Checkpoints = tier2.stdout.match(/HARNESS ROUTING CHECKPOINT \(REQUIRED VISIBLE STATE\)/g) || [];
|
|
49
|
-
check(tier2Checkpoints.length === 1, 'Tier 2 emits exactly one routing checkpoint');
|
|
50
|
-
check(tier2.stdout.includes('- Tier: Tier 2'), 'checkpoint exposes Tier 2');
|
|
51
|
-
check(tier2.stdout.includes('- Strategy: iterative-single'), 'checkpoint exposes selected strategy');
|
|
52
|
-
check(/- Required invariants: .*verify-before-claim/.test(tier2.stdout), 'checkpoint exposes required invariants');
|
|
53
|
-
check(/- Suggested skills: .*tdd/.test(tier2.stdout), 'checkpoint exposes suggestions');
|
|
54
|
-
check(tier2.stdout.includes('Suggestion evaluation: MANDATORY'), 'checkpoint requires suggestion evaluation');
|
|
55
|
-
check(tier2.stdout.includes('read its complete SKILL.md entry'), 'checkpoint requires reading skill entry');
|
|
56
|
-
check(tier2.stdout.includes('name, description, router summary'), 'checkpoint rejects metadata-only omission');
|
|
57
|
-
check(tier2.stdout.includes('routine/common task'), 'checkpoint rejects routine-task omission shortcut');
|
|
58
|
-
check(tier2.stdout.includes('selected workflow is mandatory'), 'checkpoint distinguishes skill applicability from topology obligation');
|
|
59
|
-
|
|
60
|
-
const tier3 = spawnSync(process.execPath, [kernel, 'audit the entire repository architecture and coordinate multiple modules'], {
|
|
61
|
-
cwd: ROOT,
|
|
62
|
-
encoding: 'utf8',
|
|
63
|
-
});
|
|
64
|
-
check(tier3.status === 0, 'Tier 3 kernel routing exits successfully');
|
|
65
|
-
check(/RECOMMENDED TIER:\s*Tier 3/i.test(tier3.stdout), 'macro task remains Tier 3');
|
|
66
|
-
check(tier3.stdout.includes('"strategy":"fable-staged"'), 'Tier 3 task selects fable-staged');
|
|
67
|
-
check(tier3.stdout.includes('fable-mode / fable-discipline'), 'Tier 3 plan exposes Fable capabilities');
|
|
68
|
-
check(tier3.stdout.includes('selected Fable topology must be entered and resolved before completion'), 'selected Fable topology is mandatory');
|
|
69
|
-
check(tier3.stdout.includes('WORKFLOW EXECUTION CONTRACT (MANDATORY WHEN SELECTED)'), 'Tier 3 emits execution contract');
|
|
70
|
-
check(tier3.stdout.includes('isolated-worktree-before-mutation'), 'Tier 3 structured plan carries the worktree isolation invariant');
|
|
71
|
-
check(tier3.stdout.includes('using-git-worktrees'), 'Tier 3 structured plan surfaces the worktree workflow skill');
|
|
72
|
-
check(tier3.stdout.includes('mutations require Git worktree isolation'), 'Tier 3 execution contract requires worktree isolation before mutation');
|
|
73
|
-
check(tier3.stdout.includes('unavailable isolation means BLOCKED'), 'Tier 3 worktree failure blocks instead of falling back in place');
|
|
74
|
-
|
|
75
|
-
const harnessSkill = read('harness-everything/SKILL.md');
|
|
76
|
-
check(/Work that names or matches another skill/i.test(harnessSkill), 'named domain skills still pass through Harness routing');
|
|
77
|
-
check(/selected topology is not advisory/i.test(harnessSkill), 'skill contract makes selected topology mandatory');
|
|
78
|
-
check(/"Simple", "routine".*cannot justify omission/i.test(harnessSkill), 'skill contract rejects confidence/routine omission shortcuts');
|
|
79
|
-
check(/explicit escape with uncovered scope \+ evidence/i.test(harnessSkill), 'skill contract defines evidence-backed escape');
|
|
80
|
-
check(/Complete only after applicable workflow obligations and objective verification resolve/i.test(harnessSkill), 'skill contract gates completion on workflow resolution');
|
|
81
|
-
check(/mandatory applicable workflow; flexible reasoning\/implementation/i.test(harnessSkill), 'skill entry states core policy');
|
|
82
|
-
|
|
83
|
-
const pluginHarnessSkill = read('plugins/harness-everything/skills/harness-everything/SKILL.md');
|
|
84
|
-
check(pluginHarnessSkill === harnessSkill, 'canonical/plugin Harness SKILL.md copies remain identical');
|
|
85
|
-
check(read('plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js') === read('harness-everything/scripts/kernel-router.js'), 'canonical/plugin kernel-router copies remain identical');
|
|
86
|
-
check(read('plugins/harness-everything/skills/harness-everything/scripts/kernel-router-core.js') === read('harness-everything/scripts/kernel-router-core.js'), 'canonical/plugin kernel-router core copies remain identical');
|
|
87
|
-
check(read('plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md') === read('harness-everything/references/triage-and-tiers.md'), 'canonical/plugin triage references remain identical');
|
|
88
|
-
|
|
89
|
-
const worktreeSkill = read('using-git-worktrees/SKILL.md');
|
|
90
|
-
check(/Major workflow mode/i.test(worktreeSkill), 'worktree skill defines mandatory major-workflow mode');
|
|
91
|
-
check(/never fall back to the primary working tree/i.test(worktreeSkill), 'worktree skill blocks unsafe in-place fallback for major work');
|
|
92
|
-
check(/Creation\/entry failure => `BLOCKED`/i.test(worktreeSkill), 'worktree skill makes isolation failure a blocked state');
|
|
93
|
-
check(read('plugins/harness-everything/skills/using-git-worktrees/SKILL.md') === worktreeSkill, 'canonical/plugin worktree skill copies remain identical');
|
|
94
|
-
|
|
95
|
-
const cognitiveSkill = read('install-cognitive-os/SKILL.md');
|
|
96
|
-
check(/policy, not a required peer-skill selection/i.test(cognitiveSkill), 'Cognitive OS remains reasoning policy rather than peer dependency');
|
|
97
|
-
|
|
98
|
-
const hooks = JSON.parse(read('hooks/hooks.json'));
|
|
99
|
-
const promptHooks = hooks.hooks && hooks.hooks.UserPromptSubmit;
|
|
100
|
-
const command = promptHooks && promptHooks[0] && promptHooks[0].hooks && promptHooks[0].hooks[0] && promptHooks[0].hooks[0].command;
|
|
101
|
-
check(command === 'node "${CLAUDE_PLUGIN_ROOT}/harness-everything/scripts/kernel-router.js"', 'UserPromptSubmit anchors kernel to Claude plugin root');
|
|
102
|
-
const preHooks = hooks.hooks && hooks.hooks.PreToolUse || [];
|
|
103
|
-
const workflowHook = preHooks.find(entry => entry.id === 'harness:pre:workflow-gate');
|
|
104
|
-
check(Boolean(workflowHook), 'Claude PreToolUse includes workflow gate');
|
|
105
|
-
check(workflowHook && /Bash/.test(workflowHook.matcher) && /PowerShell/.test(workflowHook.matcher) && /Edit/.test(workflowHook.matcher) && /Write/.test(workflowHook.matcher), 'Claude workflow gate covers shell and artifact mutation');
|
|
106
|
-
const stopHooks = hooks.hooks && hooks.hooks.Stop || [];
|
|
107
|
-
check(stopHooks.some(entry => entry.id === 'harness:stop:workflow-completion-gate'), 'Claude Stop includes Fable workflow completion gate');
|
|
108
|
-
|
|
109
|
-
const openaiHooks = JSON.parse(read('plugins/harness-everything/hooks/hooks.json'));
|
|
110
|
-
const openaiWorkflowHook = (openaiHooks.hooks && openaiHooks.hooks.PreToolUse || []).find(entry =>
|
|
111
|
-
(entry.hooks || []).some(hook => String(hook.command || '').includes('workflow-gate.js'))
|
|
112
|
-
);
|
|
113
|
-
check(openaiWorkflowHook && /Bash/.test(openaiWorkflowHook.matcher) && /apply_patch/.test(openaiWorkflowHook.matcher), 'Codex/OpenAI packaged workflow gate covers Bash and apply_patch');
|
|
114
|
-
|
|
115
|
-
const triageDoc = read('harness-everything/references/triage-and-tiers.md');
|
|
116
|
-
check(/Mandatory applicable workflow/i.test(triageDoc), 'triage reference documents mandatory applicable workflow');
|
|
117
|
-
check(/topology becomes the run's execution contract/i.test(triageDoc), 'triage reference makes topology a contract');
|
|
118
|
-
check(/workflow-uncovered-scope/i.test(triageDoc), 'triage reference documents narrow escape policy');
|
|
119
|
-
check(/A tier is \*\*not\*\* a fixed TODO\/TDD\/Fable pipeline/i.test(triageDoc), 'triage reference rejects universal tier pipeline');
|
|
120
|
-
check(/```mermaid/.test(triageDoc), 'triage reference retains executable flowchart documentation');
|
|
121
|
-
check(/cross-host live-enforcement claim/i.test(triageDoc), 'triage reference preserves host evidence boundary');
|
|
122
|
-
|
|
123
|
-
const routingDoc = read('docs/routing.md');
|
|
124
|
-
check(/Mandatory applicable workflow/i.test(routingDoc), 'routing docs use mandatory workflow policy');
|
|
125
|
-
check(/workflow-gate\.js/.test(routingDoc), 'routing docs describe PreToolUse workflow gate');
|
|
126
|
-
check(/workflow-stop-gate\.js/.test(routingDoc), 'routing docs describe completion gate');
|
|
127
|
-
check(/workflow-disposition\.js/.test(routingDoc), 'routing docs describe explicit escape mechanism');
|
|
128
|
-
check(!/mandatory to evaluate and advisory to execute/i.test(routingDoc), 'routing docs remove old advisory execution contract');
|
|
129
|
-
|
|
130
|
-
const architectureDoc = read('docs/architecture.md');
|
|
131
|
-
check(/topology becomes a lifecycle contract/i.test(architectureDoc), 'architecture makes selected topology lifecycle contract');
|
|
132
|
-
check(/workflow-gate\.js/.test(architectureDoc), 'architecture includes workflow bypass gate');
|
|
133
|
-
check(!/Mandatory evaluation, advisory execution/i.test(architectureDoc), 'architecture removes old advisory execution policy');
|
|
134
|
-
|
|
135
|
-
const philosophyDoc = read('docs/philosophy.md');
|
|
136
|
-
check(/Constrain Lifecycle, Not Reasoning/i.test(philosophyDoc), 'philosophy separates lifecycle constraint from reasoning freedom');
|
|
137
|
-
check(/Applicable workflow is mandatory/i.test(philosophyDoc), 'philosophy states applicable workflow requirement');
|
|
138
|
-
check(!/Mandatory Evaluation, Advisory Execution/i.test(philosophyDoc), 'philosophy removes old advisory execution policy');
|
|
139
|
-
|
|
140
|
-
const meshDoc = read('docs/mechanism-first-skill-mesh.md');
|
|
141
|
-
check(/mandatory applicable workflow \+ local skill autonomy/i.test(meshDoc), 'skill mesh documents mandatory outer workflow and local skill autonomy');
|
|
142
|
-
check(/selected topology is mandatory for the run/i.test(meshDoc), 'skill mesh distinguishes selected topology from skill suggestions');
|
|
143
|
-
|
|
144
|
-
const capabilitiesDoc = read('docs/platform-capabilities.md');
|
|
145
|
-
check(capabilitiesDoc.includes('repository/agent contract'), 'platform docs distinguish contract from host enforcement evidence');
|
|
146
|
-
check(capabilitiesDoc.includes('does not upgrade `platform-compatibility.json` live-host status values'), 'routing change does not inflate compatibility status');
|
|
147
|
-
|
|
148
|
-
const advisory = read('scripts/lib/advisory-text.js');
|
|
149
|
-
check(/For EVERY suggested skill/i.test(advisory), 'generated advisory instructions require per-suggestion applicability evaluation');
|
|
150
|
-
check(/selected workflow topology is mandatory once applicable/i.test(advisory), 'advisory surfaces carry mandatory workflow semantics');
|
|
151
|
-
check(/No universal skill pipeline/i.test(advisory), 'advisory surfaces reject universal skill pipeline');
|
|
152
|
-
check(/workflow genuinely cannot cover part of the task/i.test(advisory), 'advisory surfaces constrain workflow escape');
|
|
153
|
-
check(read('plugins/harness-everything/scripts/lib/advisory-text.js') === advisory, 'OpenAI plugin advisory mirror matches canonical source');
|
|
154
|
-
|
|
155
|
-
const agents = read('AGENTS.md');
|
|
156
|
-
check(/Selected workflow is mandatory; reasoning inside it stays flexible/i.test(agents), 'repository agent contract matches mandatory workflow policy');
|
|
157
|
-
check(!/Router suggestions are mandatory to evaluate, advisory to execute/i.test(agents), 'repository agent contract removes old advisory execution rule');
|
|
158
|
-
|
|
159
|
-
console.log(`\n${failed === 0 ? 'PASS' : 'FAIL'}: invariant routing contract (${failed} failure${failed === 1 ? '' : 's'})`);
|
|
160
|
-
process.exit(failed === 0 ? 0 : 1);
|
|
45
|
+
const advisory=read('scripts/lib/advisory-text.js');
|
|
46
|
+
check(/selected workflow topology.*planning guidance/i.test(advisory),'installer advisory text keeps workflow non-blocking');
|
|
47
|
+
check(/Rule of 3/i.test(advisory)&&/Permission boundaries are separate/i.test(advisory),'installer text preserves Rule-of-3 and permission boundaries');
|
|
48
|
+
check(read('plugins/harness-everything/scripts/lib/advisory-text.js')===advisory,'OpenAI advisory mirror matches');
|
|
49
|
+
|
|
50
|
+
const agents=read('AGENTS.md');
|
|
51
|
+
check(/Selected workflow is planning guidance/i.test(agents),'repository agent contract is guidance-first');
|
|
52
|
+
check(/Prefer Git worktree isolation/i.test(agents),'repository worktree rule is a recommendation');
|
|
53
|
+
|
|
54
|
+
const hooks=JSON.parse(read('hooks/hooks.json'));
|
|
55
|
+
check((hooks.hooks.PreToolUse||[]).some(e=>e.id==='harness:pre:workflow-gate'),'Claude packages workflow reminder hook');
|
|
56
|
+
check((hooks.hooks.PreToolUse||[]).some(e=>e.id==='harness:pre:rule-of-3'),'Claude preserves Rule-of-3 boundary');
|
|
57
|
+
check((hooks.hooks.PreToolUse||[]).some(e=>e.id==='harness:pre:action-gate'),'Claude preserves action permission gate');
|
|
58
|
+
|
|
59
|
+
console.log('\n'+(failed===0?'PASS':'FAIL')+': guidance-first routing contract ('+failed+' failures)');
|
|
60
|
+
process.exit(failed===0?0:1);
|