harness-everything 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.github/workflows/ci.yml +23 -0
- package/CHANGELOG.md +34 -0
- package/benchmarks/results/doc-evidence-e1/cycle-2026-11-11-a-evid-001.md +123 -0
- package/benchmarks/results/doc-evidence-e1/cycle-2026-11-11-b-route-001.md +130 -0
- package/ci/mechanism-2am-observations-session-import.test.js +4 -1
- package/ci/mechanism-34-observations.test.js +127 -23
- package/ci/mechanism-349-ci-change-scope.test.js +260 -0
- package/ci/mechanism-handoff-file.test.js +121 -0
- package/ci/mechanism-system-one-contract.test.js +9 -2
- package/ci/mechanism-system-one-curves.test.js +206 -0
- package/ci/mechanism-system-one-cycle.test.js +585 -0
- package/ci/mechanism-system-one-evaluation.test.js +32 -5
- package/ci/mechanism-system-one-handoff-input.test.js +208 -0
- package/ci/mechanism-system-one-install.test.js +202 -77
- package/ci/mechanism-system-one-live.test.js +361 -0
- package/ci/mechanism-system-one-relevance.test.js +11 -1
- package/ci/mechanism-system-one-train.test.js +136 -53
- package/ci/system-one-adapter-test.py +331 -0
- package/ci/system-one-train-test.py +116 -24
- package/docs/adr/EVID-001.md +123 -0
- package/docs/adr/ROUTE-001-error-lesson-delivery.md +305 -0
- package/docs/governed-index.md +2 -0
- package/docs/routing.md +2 -2
- package/docs/system-one-cycle.md +68 -0
- package/docs/system-one-observations.md +9 -8
- package/docs/system-one-routing.md +163 -115
- package/docs/system-one-suggestion-gates.md +6 -8
- package/docs/system-one-training.md +44 -7
- package/docs/workflow-runtime.md +19 -0
- package/harness-everything/SKILL.md +1 -1
- package/harness-everything/scripts/kernel-router.js +2 -1
- package/harness-everything/scripts/system-one/contract.js +19 -15
- package/harness-everything/scripts/system-one/cua_adapter.py +211 -17
- package/harness-everything/scripts/system-one/evaluate.js +4 -9
- package/harness-everything/scripts/system-one/handoff-input.js +76 -0
- package/harness-everything/scripts/system-one/install.js +281 -113
- package/harness-everything/scripts/system-one/manifest.js +58 -0
- package/harness-everything/scripts/system-one/provider.js +96 -2
- package/harness-everything/scripts/system-one/resident.js +47 -1
- package/harness-everything/scripts/system-one/router.js +80 -1
- package/harness-everything/scripts/tier-router.js +21 -6
- package/hooks/scripts/lib/observations.js +43 -4
- 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/scripts/lib/observations.js +43 -4
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/scripts/handoff-file.js +223 -0
- package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +2 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/system-one/contract.js +19 -15
- package/plugins/harness-everything/skills/harness-everything/scripts/system-one/cua_adapter.py +211 -17
- package/plugins/harness-everything/skills/harness-everything/scripts/system-one/evaluate.js +4 -9
- package/plugins/harness-everything/skills/harness-everything/scripts/system-one/handoff-input.js +76 -0
- package/plugins/harness-everything/skills/harness-everything/scripts/system-one/install.js +281 -113
- package/plugins/harness-everything/skills/harness-everything/scripts/system-one/manifest.js +58 -0
- package/plugins/harness-everything/skills/harness-everything/scripts/system-one/provider.js +96 -2
- package/plugins/harness-everything/skills/harness-everything/scripts/system-one/resident.js +47 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/system-one/router.js +80 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/tier-router.js +21 -6
- package/sbom.cdx.json +7 -7
- package/scripts/ci-change-scope.js +59 -0
- package/scripts/handoff-file.js +223 -0
- package/scripts/sync-openai-plugin.js +4 -0
- package/scripts/system-one-calibrate.js +108 -41
- package/scripts/system-one-curves.js +332 -0
- package/scripts/system-one-cycle/adjudication-input.js +65 -0
- package/scripts/system-one-cycle/build.js +165 -0
- package/scripts/system-one-cycle/collect.js +50 -0
- package/scripts/system-one-cycle/common.js +137 -0
- package/scripts/system-one-cycle/engines.js +62 -0
- package/scripts/system-one-cycle/evaluate.js +70 -0
- package/scripts/system-one-cycle/judge.js +106 -0
- package/scripts/system-one-cycle/label.js +59 -0
- package/scripts/system-one-cycle/package.js +173 -0
- package/scripts/system-one-cycle/score.py +111 -0
- package/scripts/system-one-cycle/train.js +136 -0
- package/scripts/system-one-cycle.js +131 -0
- package/scripts/system-one-observations-export.js +29 -6
- package/scripts/system-one-observations-review.js +4 -5
- package/scripts/system-one-train.py +117 -61
|
@@ -43,6 +43,7 @@ A turn runs from `UserPromptSubmit` to `Stop`. Its record:
|
|
|
43
43
|
| `prompt` | `UserPromptSubmit` | stored in the private text store only (see Storage) |
|
|
44
44
|
| `previous` | the last assistant message before the prompt | truncated to 2 KB; text store only |
|
|
45
45
|
| `router` | kernel-router output | lexical tier, strategy, normalized knowledge signals, active step/stage bindings; System One shadow scores when present |
|
|
46
|
+
| `router.systemOne` | `workflow-run.json` → `workflowPlan.systemOne` | bounded version, hash, mode, scores and decision; unknown keys are dropped, scores are clamped to 0..1, and malformed or missing input is stored as `null`. Scores remain in the private store only. |
|
|
46
47
|
| `behavior` | `PostToolUse`, `PostToolUseFailure` | counts and categories, never arguments: files written, distinct repositories written, files created, commands by class (git, gh, test, build, package, shell), skills loaded or read, subagents started. Failed attempts are counted separately (`toolFailures`, `failedWrites`, `failedSkillLoads`) and never count as a write or a load. `null` means the capture source did not observe tool events; it is not a zero count. |
|
|
47
48
|
| `workflow` | `workflow-run.json` / `workflow-disposition` | selected and confirmed strategy |
|
|
48
49
|
| `selfReport` | label line in the final message | see below; `null` if missing or invalid |
|
|
@@ -54,13 +55,12 @@ At the end of the final message of each turn the agent writes one line,
|
|
|
54
55
|
which is invisible in rendered Markdown:
|
|
55
56
|
|
|
56
57
|
```
|
|
57
|
-
<!-- harness-label {"v":1,"validity":"actionable","
|
|
58
|
+
<!-- harness-label {"v":1,"validity":"actionable","tier":"tier2","intents":["fix","test"],"workflow":"iterative-single","skills":["tdd"]} -->
|
|
58
59
|
```
|
|
59
60
|
|
|
60
61
|
| Key | Values |
|
|
61
62
|
| --- | --- |
|
|
62
|
-
| `validity` | `actionable` or `invalid
|
|
63
|
-
| `contextDependent` | `true` when the prompt text alone would not have been enough to know the task |
|
|
63
|
+
| `validity` | `actionable` or `invalid`; invalid means the prompt cannot be understood from its own text and needs conversation context. Agent-written dispatches and worker instructions are ordinary prompts. |
|
|
64
64
|
| `tier` | `tier1` (no file change), `tier2` (bounded file change: code, config or docs), `tier3` (feature, refactor, redefinition, cross-component) or `null` (only for `invalid`), under tier rules v2 |
|
|
65
65
|
| `intents` | up to 3 of the 12 intent ids, strongest first |
|
|
66
66
|
| `workflow` | a router strategy id or `null` |
|
|
@@ -76,13 +76,13 @@ accepted when it ends the message.
|
|
|
76
76
|
|
|
77
77
|
## Labels and how much to trust them
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
file-count threshold
|
|
79
|
+
Validity is judged from the prompt text alone, even when the agent saw the
|
|
80
|
+
whole conversation. The other keys are the host LLM's own judgement; no
|
|
81
|
+
fixed rule replaces tier (owner decision, 2026-09-27: no file-count threshold).
|
|
82
82
|
|
|
83
83
|
| Label | Source | Override |
|
|
84
84
|
| --- | --- | --- |
|
|
85
|
-
| validity
|
|
85
|
+
| validity | self-report, judged from prompt text alone | owner review |
|
|
86
86
|
| intents | self-report | — |
|
|
87
87
|
| tier | self-report (tier rules v2) | owner review |
|
|
88
88
|
| workflow | self-report, else the confirmed strategy | — |
|
|
@@ -201,7 +201,8 @@ The importer accepts only valid label lines, applies the same email/home-path re
|
|
|
201
201
|
repository:
|
|
202
202
|
|
|
203
203
|
- `prompts-observed.jsonl`: `{id, family, source: "observation", split, text}`
|
|
204
|
-
- `labels-observed.jsonl`: `{id, validity,
|
|
204
|
+
- `labels-observed.jsonl`: `{id, validity, tier, tierSource, intents, workflow, skills, behaviorEvidence, contradictions, systemOne}`. `systemOne` is `{version, sha256, mode, decision}` or `null`; score maps stay in the private observation store.
|
|
205
|
+
- `export-report.json`: `systemOne.versions[version]` counts exported rows for each version and reports tier agreement (`matches`, `comparisons`, `rate`) between the router decision and self-report. Comparisons include only rows where both tiers are known.
|
|
205
206
|
|
|
206
207
|
`family` groups near-duplicate prompts. The split is by time: the newest 15%
|
|
207
208
|
is validation. The existing holdouts stay frozen and separate. Observed data
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# System One routing migration
|
|
2
2
|
|
|
3
3
|
Status: experimental engineering; issue [#233](https://github.com/dyphn1/Harness-everything/issues/233).
|
|
4
|
-
The default
|
|
4
|
+
The default mode stays `off`. `live` is opt-in for machines with an activated private checkpoint; recorded gate values are baselines and do not block that opt-in.
|
|
5
5
|
Implement each phase in **documentation → failing tests → implementation** order.
|
|
6
6
|
|
|
7
7
|
## Phase 0: scorer contract
|
|
8
8
|
|
|
9
|
-
System One scores
|
|
9
|
+
For each stage, System One scores the complete, caller-owned candidate list in one pass. It cannot
|
|
10
10
|
generate a workflow, execute actions, authorize tools, or write memory. Policy and
|
|
11
11
|
contract assembly remain deterministic. This boundary does not add execution locks.
|
|
12
12
|
|
|
@@ -22,17 +22,18 @@ fingerprint grants permission or authenticates a model.
|
|
|
22
22
|
The provider response has exactly `schemaVersion`, `requestHash`, `catalogHash`,
|
|
23
23
|
`model`, and `scores`. Model has nonempty `id`, `revision`, and `domain` strings.
|
|
24
24
|
Scores have exactly `{id, probability}` in request order. All candidates occur
|
|
25
|
-
exactly once; probabilities are finite
|
|
26
|
-
1e-6. Unknown fields, stale request/catalog hashes, and version mismatches fail.
|
|
25
|
+
exactly once; probabilities are finite values in [0, 1], as a categorical simplex for legacy checkpoints or independent scores for staged checkpoints. Unknown fields, stale request/catalog hashes, and version mismatches fail.
|
|
27
26
|
|
|
28
27
|
`decide(request, response, policy)` returns exactly `status`, `reason`,
|
|
29
28
|
`selectedId`, `confidence`, `margin`, and `model`. Status is `accepted`, `abstain`,
|
|
30
29
|
or `invalid-output`; nonaccepted results always have `selectedId: null`.
|
|
31
30
|
Policy requires a domain (default `harness-routing-v1`), minimum confidence
|
|
32
31
|
(default 0.9) and minimum margin (default 0.2). Invalid policy is a caller error.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
The legacy `decide` path rejects domain mismatch, tied winners, low confidence
|
|
33
|
+
and low margin. Live stages use their own calibrated per-option thresholds.
|
|
34
|
+
Probabilities are reference confidence, not correctness guarantees. Invalid
|
|
35
|
+
output returns no raw response, exception, or prompt. Identical inputs give
|
|
36
|
+
identical decisions.
|
|
36
37
|
|
|
37
38
|
## Phase 1: local provider
|
|
38
39
|
|
|
@@ -70,33 +71,42 @@ VCS URL pinned to that commit (not an editable or local-directory install).
|
|
|
70
71
|
The status is `pinned` when it matches, `mismatch` otherwise, or `unavailable`
|
|
71
72
|
when no revision is recorded. Malformed probe output is `provider-json`.
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
`
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
74
|
+
Install a private checkpoint from a local data-repository checkout or its Git
|
|
75
|
+
SSH URL. The checkout must contain
|
|
76
|
+
`models/cua-s1/<id>/manifest.json` with validity, intent and tier stages:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
node harness-everything/scripts/system-one/install.js install \
|
|
80
|
+
--from /path/to/private-data-repo --version <id>
|
|
81
|
+
node harness-everything/scripts/system-one/install.js install \
|
|
82
|
+
--from git@host:private/data-repo.git --version <id>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The SSH path uses a shallow sparse clone of the requested checkpoint in a
|
|
86
|
+
temporary cache directory; SSH credentials must come from the local SSH
|
|
87
|
+
configuration, not the URL. The installer verifies each stage's `sha256`, then
|
|
88
|
+
copies the manifest, weights, configs and optional evaluation file to
|
|
89
|
+
`~/.agents/harness-everything/system-one/versions/<id>/`. It also creates the
|
|
90
|
+
dedicated Python 3.11–3.13 virtual environment, installs CPU-only torch and the
|
|
91
|
+
pinned `cua_s1` source. `--python` selects the interpreter, `--dir` selects an
|
|
92
|
+
absolute install directory, and `--dry-run` prints the plan without changes.
|
|
93
|
+
The default directory is `~/.agents/harness-everything/system-one`; set
|
|
94
|
+
`HARNESS_SYSTEM_ONE_HOME` to override it.
|
|
95
|
+
|
|
96
|
+
Installation does not activate a checkpoint. Run
|
|
97
|
+
`node harness-everything/scripts/system-one/install.js activate <id>` to switch
|
|
98
|
+
the atomic `active.json` pointer; it records the prior version for
|
|
99
|
+
`rollback`. `status` reports active and previous versions, verifies their
|
|
100
|
+
checkpoint hashes, and prints the `HARNESS_SYSTEM_ONE_MODE=live` opt-in hint.
|
|
101
|
+
The router remains off by default; set `HARNESS_SYSTEM_ONE_MODE=live` only on
|
|
102
|
+
machines where System One is opted in. The public plugin contains the installer
|
|
103
|
+
code but no private weights.
|
|
95
104
|
|
|
96
105
|
The adapter verifies both files before `load_checkpoint(..., 'cpu')`, sets one
|
|
97
106
|
torch thread and deterministic inference, calls the upstream collator/model,
|
|
98
|
-
and
|
|
99
|
-
that exceeds the loaded byte limits before collation (no silent
|
|
107
|
+
and applies a sigmoid independently to each option logit. It rejects context
|
|
108
|
+
or option text that exceeds the loaded byte limits before collation (no silent
|
|
109
|
+
truncation).
|
|
100
110
|
No prompts or model values are written to disk or echoed in error messages.
|
|
101
111
|
|
|
102
112
|
The Node transport has a hard timeout and a 1 MiB stdout/stderr bound; it kills
|
|
@@ -234,44 +244,88 @@ it started. Repository tests use a stub scorer behind the real server/protocol
|
|
|
234
244
|
code; they prove the mechanism, not host survival of detached processes or model
|
|
235
245
|
quality. Those require retained evidence.
|
|
236
246
|
|
|
237
|
-
## Phase 2:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
`
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
the
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
The
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
247
|
+
## Phase 2: compatibility modes and staged live routing
|
|
248
|
+
|
|
249
|
+
`HARNESS_SYSTEM_ONE_MODE=off` remains the default. Off starts no provider, emits
|
|
250
|
+
no System One text or workflow field, and preserves the lexical route byte for
|
|
251
|
+
byte. The older `shadow` and `prefer` single-tier modes remain for compatibility
|
|
252
|
+
and use an absolute `HARNESS_SYSTEM_ONE_CONFIG` manifest path. `live` reads the
|
|
253
|
+
active version pointer described below; it does not use that legacy manifest.
|
|
254
|
+
Set the mode back to `off` to roll back. Unknown modes keep the lexical result.
|
|
255
|
+
|
|
256
|
+
Live reads `~/.agents/harness-everything/system-one/active.json`; tests can point
|
|
257
|
+
`HARNESS_SYSTEM_ONE_HOME` at another System One home. The pointer has exactly
|
|
258
|
+
`schemaVersion`, `version`, `dir`, `previous`, and `activatedAt`. Its version
|
|
259
|
+
directory contains `manifest.json` with `schemaVersion`, `version`, `createdAt`,
|
|
260
|
+
`stages`, and `evaluation`. `stages` contains `validity`, `intent`, and `tier`;
|
|
261
|
+
each entry names sibling `weights` and `config` files, the weights `sha256`, its
|
|
262
|
+
ordered trainer-catalog `options`, and one per-option `threshold`. The intent
|
|
263
|
+
catalog includes `unclassified`; validity has only `invalid`, and tier has the
|
|
264
|
+
three tier IDs. Calibration, manifest options, and score rows keep the same
|
|
265
|
+
catalog IDs. An optional
|
|
266
|
+
`referenceOnly` list must be a subset of the stage options, and each listed
|
|
267
|
+
option must have threshold `1`. Its score remains visible in the reference
|
|
268
|
+
readout, but it is excluded from automatic decisions. The router verifies the weight
|
|
269
|
+
hash and the CUA-S1 adapter verifies the checkpoint/config pair before loading.
|
|
270
|
+
The workflow hash is the first 16 hex digits of the tier weights hash. A single
|
|
271
|
+
resident process loads all three checkpoints from that version. The public plugin
|
|
272
|
+
contains the loading and training method, not private weights.
|
|
273
|
+
|
|
274
|
+
Live scores the prompt text in order: validity, then intent and tier only when
|
|
275
|
+
validity is actionable. An invalid result stops later scoring. `p(invalid)` at
|
|
276
|
+
or above its threshold marks the prompt invalid. Each option keeps its own
|
|
277
|
+
sigmoid probability. Intent suggestions include options at or above their
|
|
278
|
+
thresholds, sorted by probability and capped at three. The highest-scoring tier
|
|
279
|
+
is returned only when it meets that tier's own threshold; otherwise the tier
|
|
280
|
+
stage abstains. A tie at the top also abstains.
|
|
281
|
+
|
|
282
|
+
Precedence is structural floor and explicit user/workflow choices, then System
|
|
283
|
+
One, then lexical tier when System One abstains, is invalid or unavailable, or
|
|
284
|
+
mode is off. The structural floor can only raise the route. Existing safety,
|
|
285
|
+
explicit prohibitions, memory ownership, and verification remain deterministic.
|
|
286
|
+
|
|
287
|
+
When a valid active version is available, `workflowPlan.systemOne` records the
|
|
288
|
+
fixed version, weight hash, mode, raw stage probabilities, and thresholded
|
|
289
|
+
decision. Unscored stages are `null`. When System One has no active version, the
|
|
290
|
+
field is omitted. User-visible routing text labels the highest stage options
|
|
291
|
+
with their probabilities as reference confidence, never as a verdict; it does
|
|
292
|
+
not print prompt text or artifact paths. Checkpoint activation is opt-in and the
|
|
293
|
+
default mode remains `off`.
|
|
294
|
+
|
|
295
|
+
H1b separately authorized the handoff count enrichment at
|
|
296
|
+
`inputEnrichment.handoffFiles`. F6 authorized `referenceOnly` as optional
|
|
297
|
+
per-stage manifest metadata; it did not explicitly approve a new top-level
|
|
298
|
+
`referenceOnly` output field. The current router includes both fields in
|
|
299
|
+
`workflowPlan.systemOne`, so the top-level `referenceOnly` field remains an
|
|
300
|
+
unresolved discrepancy against shared contract B. The seven-field contract
|
|
301
|
+
shape is:
|
|
302
|
+
|
|
303
|
+
```json
|
|
304
|
+
{
|
|
305
|
+
"version": "<active version id>",
|
|
306
|
+
"sha256": "<first 16 hex digits of tier weights hash>",
|
|
307
|
+
"mode": "live",
|
|
308
|
+
"validity": { "invalid": 0.12 },
|
|
309
|
+
"intents": {
|
|
310
|
+
"explain": 0.1, "discuss": 0.12, "git": 0.1, "fix": 0.81,
|
|
311
|
+
"edit": 0.2, "feature": 0.54, "refactor": 0.1, "review": 0.1,
|
|
312
|
+
"test": 0.1, "docs": 0.14, "plan": 0.1, "investigate": 0.1
|
|
313
|
+
},
|
|
314
|
+
"tier": { "tier1": 0.1, "tier2": 0.84, "tier3": 0.62 },
|
|
315
|
+
"decision": { "validity": "actionable", "intents": ["fix"], "tier": "tier2" }
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
`decision.validity` is `actionable`, `invalid`, or `abstain`. `decision.intents`
|
|
320
|
+
contains up to three above-threshold IDs in probability order. `decision.tier` is
|
|
321
|
+
the unique highest above-threshold tier or `null` when the tier stage abstains.
|
|
322
|
+
|
|
323
|
+
Kernel and packaged entry points inherit host environment variables. Prompts
|
|
267
324
|
and hook payload fields cannot set model configuration or launch executables.
|
|
268
325
|
Claude Code settings `env` is hot-reloaded and reaches hooks and every command
|
|
269
|
-
the agent runs; Codex hooks inherit the `codex` process environment
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
`harness-routing-v1` checkpoint passes the rollout gates.
|
|
273
|
-
Repository tests establish mechanism/package evidence only; actual host loading
|
|
274
|
-
and semantic quality remain unverified until retained sessions demonstrate them.
|
|
326
|
+
the agent runs; Codex hooks inherit the `codex` process environment. Repository
|
|
327
|
+
tests establish mechanism and package evidence only; live host loading and
|
|
328
|
+
behavioral quality require retained host evidence.
|
|
275
329
|
|
|
276
330
|
## Phase 3: corpus and paired evaluation
|
|
277
331
|
|
|
@@ -340,7 +394,7 @@ unversioned download during a prompt hook.
|
|
|
340
394
|
| --- | --- | --- |
|
|
341
395
|
| 0 | Versioned option-scoring boundary | Complete positive/negative contract tests |
|
|
342
396
|
| 1 | Local CUA-S1 adapter | Bounded subprocess, artifact validation, explicit failures |
|
|
343
|
-
| 2 | Router integration | Off/shadow/prefer,
|
|
397
|
+
| 2 | Router integration | Off/shadow/prefer/live, active pointer, precedence, rollback |
|
|
344
398
|
| 3 | Corpus and paired evaluator | Leakage checks, coverage/error metrics, repeatability |
|
|
345
399
|
| 4 | Harness training and rollout | Real checkpoint, reviewed holdout, measured host results |
|
|
346
400
|
|
|
@@ -349,50 +403,44 @@ Phase 4 training data, labeling, calibration and release are defined in
|
|
|
349
403
|
|
|
350
404
|
## Staged classification
|
|
351
405
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
hundreds) is not expected to reach 98%.
|
|
394
|
-
Policy invariants must remain intact in every case; repeat decisions twice with
|
|
395
|
-
100% agreement. Record checkpoint/source hashes, CPU, OS, runtime, thread count,
|
|
396
|
-
cold latency and warm p95 (target ≤100ms). Synthetic fixtures and mock providers
|
|
397
|
-
only validate mechanisms. They cannot satisfy these model/behavior gates.
|
|
398
|
-
Until measured evidence passes, retain the default, fallback and this open issue.
|
|
406
|
+
Live routing scores three fixed catalogs in order. Validity is `actionable` or
|
|
407
|
+
`invalid`; the intent catalog contains the twelve work intents plus
|
|
408
|
+
`unclassified`; and the tier catalog contains `tier1`, `tier2`, and `tier3`.
|
|
409
|
+
`unclassified` remains in intent score rows and manifest metadata, but is never
|
|
410
|
+
auto-selected or included in the output intent probability map.
|
|
411
|
+
|
|
412
|
+
Invalid prompts receive no intent or tier suggestion. For actionable prompts,
|
|
413
|
+
all intent options are scored independently and up to three above-threshold
|
|
414
|
+
suggestions are reported. Tier uses its own per-option thresholds and abstains
|
|
415
|
+
when no tier meets its threshold. The live tier readout is independent of intent
|
|
416
|
+
scores. System One does not choose workflow strategies or skill paths in this
|
|
417
|
+
contract; explicit workflow requests, action gates, memory ownership, the Rule
|
|
418
|
+
of 3 and the active-step binding contract remain deterministic.
|
|
419
|
+
|
|
420
|
+
In opt-in `live` mode, System One may also read up to three file paths written
|
|
421
|
+
in the prompt: absolute paths, or paths relative to the session working
|
|
422
|
+
directory that stay within it. It considers only existing regular files up to
|
|
423
|
+
1 MiB and reads at most the first 2 KiB with the shared
|
|
424
|
+
[`handoff-file.js`](../scripts/handoff-file.js) parser. A valid
|
|
425
|
+
`harness-handoff` header adds one `[handoff] kind=... title=... summary=...`
|
|
426
|
+
line per file to the System One scoring input; file bodies are never read.
|
|
427
|
+
The host prompt, lexical routing input and stored prompt observation remain
|
|
428
|
+
unchanged. `workflowPlan.systemOne.inputEnrichment.handoffFiles` records how
|
|
429
|
+
many headers were added. Invalid files and read errors are ignored, and mode
|
|
430
|
+
`off` keeps its existing byte-identical behavior.
|
|
431
|
+
|
|
432
|
+
## Rollout and evaluation
|
|
433
|
+
|
|
434
|
+
The measurement definitions in
|
|
435
|
+
[system-one-suggestion-gates.md](system-one-suggestion-gates.md) remain useful
|
|
436
|
+
for recording model behavior. For opt-in live routing, their numeric values are
|
|
437
|
+
stored as a baseline and do not block activation. Version comparison and
|
|
438
|
+
rollback follow the long-term optimization curve, not one threshold or metric.
|
|
439
|
+
The default mode stays `off`; private weights are used only by machines with an
|
|
440
|
+
active version pointer, and the public plugin ships the training method rather
|
|
441
|
+
than weights.
|
|
442
|
+
|
|
443
|
+
Evaluation records stage distributions, provenance, repeatability, CPU, OS,
|
|
444
|
+
runtime, thread count, cold latency and warm p95. System One provides reference
|
|
445
|
+
confidence, not absolute answers. Mechanism tests and mock providers establish
|
|
446
|
+
contract behavior only; they do not claim model quality or a live-host result.
|
|
@@ -122,14 +122,12 @@ on `actionable` prompts.
|
|
|
122
122
|
|
|
123
123
|
### Invalid prompts
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
conversation. Deterministic controls (action gates, scope and memory
|
|
132
|
-
ownership, the Rule of 3) apply unchanged. The noise-gate experiment (#265)
|
|
125
|
+
`invalid` means the prompt cannot be understood from its own text and needs
|
|
126
|
+
conversation context. Agent-written dispatch packets and worker instructions
|
|
127
|
+
are ordinary prompts; their audience does not make them invalid. The small
|
|
128
|
+
model judges the prompt text itself, without trying to recover missing
|
|
129
|
+
context. Deterministic controls (action gates, scope and memory ownership,
|
|
130
|
+
the Rule of 3) apply unchanged. The noise-gate experiment (#265)
|
|
133
131
|
showed that tier labels given to such prompts from session context were
|
|
134
132
|
what kept a text-only model unsure.
|
|
135
133
|
|
|
@@ -7,6 +7,8 @@ Gold labels follow [system-one-corpus.md](system-one-corpus.md). The owner-revie
|
|
|
7
7
|
holdout in that document is used only for evaluation. It is never used for training,
|
|
8
8
|
threshold selection or labeler tuning.
|
|
9
9
|
|
|
10
|
+
For the owner-started monthly collection-to-package workflow, see [System One monthly training cycle](system-one-cycle.md).
|
|
11
|
+
|
|
10
12
|
## Pipeline
|
|
11
13
|
|
|
12
14
|
1. **Collect**: copy the owner's own prompts from local assistant histories into a local
|
|
@@ -159,17 +161,25 @@ prompts written by an agent, not by the owner. VS Code terminal notifications
|
|
|
159
161
|
same logits, which ranks the intents in relevance order, so the contract's
|
|
160
162
|
probability vector and the calibration below stay as they are. Handing the absolute
|
|
161
163
|
relevance bands to the skills stage is a separate contract change.
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
- **CUA-S1 trainer**: `scripts/system-one-train.py` builds a new `cua_s1` `tinyx` scorer
|
|
165
|
+
with `make_system`. `--task {validity,intent,tier}` selects the head (default `tier`);
|
|
166
|
+
`--target {label,scores}` selects hard labels or scored intent labels (default `label`).
|
|
167
|
+
`--target scores` requires `--task intent` and reads `labels-intent-scores.jsonl`.
|
|
165
168
|
- Config: `width` 128, `rank` 128, `layers` 2, `heads` 4, `context_tokens` 1024 and
|
|
166
169
|
`option_tokens` 96.
|
|
167
170
|
- Weights are initialized fresh, not from the forms checkpoint, whose domain and
|
|
168
171
|
positional range differ.
|
|
169
|
-
- **
|
|
170
|
-
`null` maps to
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
- **Targets**: each option is an independent binary target. The validity head uses all
|
|
173
|
+
`labels.jsonl` rows and scores one `invalid` option: a `null` tier gold maps to 1, and a
|
|
174
|
+
tier gold maps to 0. The tier head uses valid `labels.jsonl` rows, the three options
|
|
175
|
+
`tier1`, `tier2` and `tier3`, and a one-hot target. The intent head uses valid
|
|
176
|
+
`labels-intent.jsonl` rows and the fixed intent catalog; its hard target is multi-hot for
|
|
177
|
+
`gold` plus `secondary`. With `--target scores`, each intent's value from
|
|
178
|
+
`labels-intent-scores.jsonl` is its soft target.
|
|
179
|
+
- **Optimization**: per-option binary cross-entropy with logits, AdamW, a fixed seed and CPU.
|
|
180
|
+
Validation applies sigmoid independently to each option; `val-scores.jsonl` stores rows as
|
|
181
|
+
`{id, gold, scores: {option: probability}}`; option probabilities are independent and do
|
|
182
|
+
not have to sum to one.
|
|
173
183
|
- The epoch with the lowest validation negative log-likelihood is kept.
|
|
174
184
|
- The checkpoint metadata records the dataset hashes, the config and the validation metrics.
|
|
175
185
|
- **Calibration**: `minConfidence` and `minMargin` are chosen on validation to maximize
|
|
@@ -191,3 +201,30 @@ prompts written by an agent, not by the owner. VS Code terminal notifications
|
|
|
191
201
|
- **Release**: the `.safetensors` and `.json` files are attached to a GitHub release. The
|
|
192
202
|
installer's pins gain the new model ID, revision, `domain: "harness-routing-v1"` and both
|
|
193
203
|
SHA-256 values. Until every rollout gate passes, the router default stays `off`.
|
|
204
|
+
|
|
205
|
+
## Evaluating a version over time
|
|
206
|
+
|
|
207
|
+
Run `scripts/system-one-curves.js` with a version directory, one or more validation score
|
|
208
|
+
files, an optional matching set of holdout score files, a history JSONL file and an output
|
|
209
|
+
directory. Each score row has `{id, gold, scores: {option: probability}}`. Options are
|
|
210
|
+
scored independently: log loss, Brier score and 10-bin ECE use every option-row pair, while
|
|
211
|
+
the confidence curve measures top-choice accuracy as its score threshold sweeps from 0 to 1.
|
|
212
|
+
The report also keeps reliability bins and five score quantiles per option.
|
|
213
|
+
|
|
214
|
+
```mermaid
|
|
215
|
+
flowchart LR
|
|
216
|
+
V[Validation scores] --> C[Compare AUC, log loss and ECE]
|
|
217
|
+
H[Old holdout scores] --> F{Checked floor has no regression?}
|
|
218
|
+
C --> P{Candidate no worse on all curves?}
|
|
219
|
+
F --> P
|
|
220
|
+
P -->|yes| Promote[Promote]
|
|
221
|
+
P -->|no, two consecutive declines| Rollback[Rollback]
|
|
222
|
+
P -->|otherwise| Hold[Hold]
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Promotion requires the candidate to tie or improve the previous version on coverage-accuracy
|
|
226
|
+
area, log loss and ECE, and a checked old-holdout floor with no regression. Missing holdout
|
|
227
|
+
scores leave the floor unknown and block promotion. A rollback requires two consecutive
|
|
228
|
+
history comparisons where the active trend is dominated across those same curves. The
|
|
229
|
+
verdict is based on the whole curve; System One scores remain reference confidence, not
|
|
230
|
+
absolute answers.
|
package/docs/workflow-runtime.md
CHANGED
|
@@ -101,6 +101,25 @@ Existing sessions may contain `budget.state = "budget-exhausted"`, old counters,
|
|
|
101
101
|
|
|
102
102
|
Starting a fresh session remains the cleanest way to discard old evidence, but it is no longer required to recover from numeric budget exhaustion.
|
|
103
103
|
|
|
104
|
+
## Agent hand-off files
|
|
105
|
+
|
|
106
|
+
When one agent hands another a work order, the file is generated by `scripts/handoff-file.js` so the format cannot drift, and its first bytes are a short YAML header that System One reads as its only input (#409 L0). The YAML subset is flat scalars and flat lists; the generator and parser are dependency-free. Keep the header within 2 KB.
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
---
|
|
110
|
+
harness-handoff: 1
|
|
111
|
+
kind: implement
|
|
112
|
+
title: Cache fix
|
|
113
|
+
summary: Keep the read cache warm across restarts
|
|
114
|
+
writes: [a.js, b.js]
|
|
115
|
+
gate: node --test passes
|
|
116
|
+
report: reports/R.md
|
|
117
|
+
---
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
- `new --kind <implement|test|review|design|question|answer> --title "<text>" --summary "<≤200 chars>" --out <file.md> [--writes a,b] [--gate "<text>"] [--report <path>]` writes the header plus empty `## Scope anchor`, `## Task`, `## Write-set`, `## Verification` and `## Report` sections and a trailing pending-status comment.
|
|
121
|
+
- `header <file.md>` prints the header as JSON; `check <file.md>` validates the kind enum, the ≤ 200-character summary, the ≤ 2 KB header and unknown keys. Both read at most the first 2 KB and fail clearly when the header is absent or invalid.
|
|
122
|
+
|
|
104
123
|
## Testing contract
|
|
105
124
|
|
|
106
125
|
Regression tests **MUST** prove:
|
|
@@ -155,7 +155,8 @@ function activeExecutionFor(persisted, plan) {
|
|
|
155
155
|
function printLabelContract() {
|
|
156
156
|
console.log('\n=> TURN LABEL LINE (MUST, EVERY TURN — short answers, lookups and trivial edits included):');
|
|
157
157
|
console.log(' - The last line of your final message MUST be one hidden label line with your own post-work judgement, not a copy of the router tier above:');
|
|
158
|
-
console.log(' <!-- harness-label {"v":1,"validity":"actionable|invalid","
|
|
158
|
+
console.log(' <!-- harness-label {"v":1,"validity":"actionable|invalid","tier":"tier1|tier2|tier3|null","intents":["up to 3 of explain,discuss,git,fix,edit,feature,refactor,review,test,docs,plan,investigate"],"workflow":"strategy id or null","skills":["skills used"]} -->');
|
|
159
|
+
console.log(' - invalid means the prompt cannot be understood from its own text and needs conversation context; agent-written dispatches and worker instructions are ordinary prompts.');
|
|
159
160
|
console.log(' - tier1: answer, lookup, status or git operation with no code change; tier2: bounded change; tier3: new feature, refactor, redefinition or cross-component work. Use null only when validity is invalid.');
|
|
160
161
|
console.log(' - It is invisible in rendered Markdown and records local training data; it never gates routing.');
|
|
161
162
|
}
|