harness-everything 1.2.1 → 1.3.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/CHANGELOG.md +31 -0
- package/benchmarks/results/live-host/agy-2026-11-26-516-read-only/README.md +12 -0
- package/benchmarks/results/live-host/agy-2026-11-26-516-read-only/capture.sanitized.jsonl +5 -0
- package/benchmarks/results/live-host/codex-2026-11-26-488-post-tool-use/README.md +25 -0
- package/benchmarks/results/live-host/codex-2026-11-26-488-post-tool-use/capture.sanitized.jsonl +10 -0
- package/ci/fixtures/468-dispatch/agy-quota-PROVENANCE.md +19 -0
- package/ci/fixtures/468-dispatch/agy-quota-direct-individual.stderr +2 -0
- package/ci/fixtures/468-dispatch/agy-quota-direct-third-party.stderr +2 -0
- package/ci/fixtures/468-dispatch/agy-quota-exec-individual.log +3 -0
- package/ci/mechanism-2am-observations-session-import.test.js +1 -0
- package/ci/mechanism-2w-platform-compatibility.test.js +1 -2
- package/ci/mechanism-34-observations.test.js +37 -1
- package/ci/mechanism-397-opencode-observations.test.js +4 -3
- package/ci/mechanism-468-dispatch-cli.test.js +1496 -4
- package/ci/mechanism-516-windows-verify-and-shell.test.js +74 -19
- package/ci/mechanism-548-bigint-identity.test.js +531 -0
- package/ci/mechanism-error-ledger-oracle.test.js +786 -3
- package/ci/mechanism-error-ledger-scan.test.js +981 -0
- package/ci/mechanism-report-writer.test.js +47 -1
- package/ci/mechanism-system-one-cycle.test.js +47 -2
- package/ci/openai-plugin-submission.test.js +26 -8
- package/docs/error-handling/details/c8-dispatch-cli.md +109 -13
- package/docs/openai-plugin.md +6 -10
- package/docs/platform-capabilities.md +15 -0
- package/docs/routing.md +2 -0
- package/error-ledger-bootstrap/SKILL.md +1 -1
- package/error-ledger-bootstrap/references/workflow.md +42 -7
- package/error-ledger-bootstrap/scripts/promote.js +8 -6
- package/error-ledger-bootstrap/scripts/scan.js +525 -12
- package/harness-everything/SKILL.md +1 -1
- package/harness-everything/scripts/kernel-router.js +3 -2
- package/hooks/scripts/state-persist.js +6 -1
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/scripts/state-persist.js +6 -1
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/skills/error-ledger-bootstrap/SKILL.md +1 -1
- package/plugins/harness-everything/skills/error-ledger-bootstrap/references/workflow.md +42 -7
- package/plugins/harness-everything/skills/error-ledger-bootstrap/scripts/promote.js +8 -6
- package/plugins/harness-everything/skills/error-ledger-bootstrap/scripts/scan.js +525 -12
- package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +3 -2
- package/sbom.cdx.json +7 -7
- package/scripts/build-openai-submission.js +8 -4
- package/scripts/dispatch.js +499 -87
- package/scripts/error-ledger-oracle.js +521 -27
- package/scripts/errors-sync.js +4 -3
- package/scripts/report-writer.js +4 -3
- package/submission/openai/README.md +9 -14
- package/submission/openai/listing.json +1 -1
- package/submission/openai/test-cases.json +1 -1
|
@@ -155,9 +155,10 @@ 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('
|
|
158
|
+
console.log(' - Use JSON null for workflow when the strategy is deferred or none was selected. Otherwise use the strategy id actually used.');
|
|
159
|
+
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":null,"skills":["skills used"]} -->');
|
|
159
160
|
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.');
|
|
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.');
|
|
161
|
+
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 a null tier only when validity is invalid.');
|
|
161
162
|
console.log(' - It is invisible in rendered Markdown and records local training data; it never gates routing.');
|
|
162
163
|
}
|
|
163
164
|
|
|
@@ -150,6 +150,11 @@ function processState(payload) {
|
|
|
150
150
|
const command = (payload.tool_input && payload.tool_input.command) || '';
|
|
151
151
|
if (isShell) {
|
|
152
152
|
const commandClass = classifyShell(command);
|
|
153
|
+
// These narrow AGY probes affect handoff tracking only.
|
|
154
|
+
const agyReadOnlyProbe = agy && (
|
|
155
|
+
command === '$PSVersionTable.PSVersion; Get-Command pwsh -ErrorAction SilentlyContinue'
|
|
156
|
+
|| /^git grep (?:-n )?(?:"[\w][\w.-]*"|'[\w][\w.-]*'|[\w][\w.-]*)(?: --(?: [\w.][\w./-]*)+)?$/.test(command)
|
|
157
|
+
);
|
|
153
158
|
const pilotEnabled = process.env.HARNESS_DOC_RECONCILIATION_PILOT === '1';
|
|
154
159
|
const docCheck = pilotEnabled ? require('./lib/doc-reconciliation-provider') : null;
|
|
155
160
|
stateOnlyCandidate = Boolean(docCheck && typeof payload.cwd === 'string' && payload.cwd
|
|
@@ -171,7 +176,7 @@ function processState(payload) {
|
|
|
171
176
|
// On AGY hosts that omit shell error/exitCode, an unconfirmed verification-only command must not advance lastEditAt
|
|
172
177
|
// and defeat agy-stop.js's bounded continuation fingerprint.
|
|
173
178
|
const agyUnknownOutcomeVerify = agy && !verifiedSuccess && !isFailed && verifies;
|
|
174
|
-
if (!metadataStep && !agyUnknownOutcomeVerify && commandClass !== 'read-only' && commandClass !== 'worktree-setup') {
|
|
179
|
+
if (!metadataStep && !agyUnknownOutcomeVerify && !agyReadOnlyProbe && commandClass !== 'read-only' && commandClass !== 'worktree-setup') {
|
|
175
180
|
if (stateOnlyCandidate) editAfterCapture = true;
|
|
176
181
|
else state.lastEditAt = Date.now();
|
|
177
182
|
}
|
package/package.json
CHANGED
|
@@ -150,6 +150,11 @@ function processState(payload) {
|
|
|
150
150
|
const command = (payload.tool_input && payload.tool_input.command) || '';
|
|
151
151
|
if (isShell) {
|
|
152
152
|
const commandClass = classifyShell(command);
|
|
153
|
+
// These narrow AGY probes affect handoff tracking only.
|
|
154
|
+
const agyReadOnlyProbe = agy && (
|
|
155
|
+
command === '$PSVersionTable.PSVersion; Get-Command pwsh -ErrorAction SilentlyContinue'
|
|
156
|
+
|| /^git grep (?:-n )?(?:"[\w][\w.-]*"|'[\w][\w.-]*'|[\w][\w.-]*)(?: --(?: [\w.][\w./-]*)+)?$/.test(command)
|
|
157
|
+
);
|
|
153
158
|
const pilotEnabled = process.env.HARNESS_DOC_RECONCILIATION_PILOT === '1';
|
|
154
159
|
const docCheck = pilotEnabled ? require('./lib/doc-reconciliation-provider') : null;
|
|
155
160
|
stateOnlyCandidate = Boolean(docCheck && typeof payload.cwd === 'string' && payload.cwd
|
|
@@ -171,7 +176,7 @@ function processState(payload) {
|
|
|
171
176
|
// On AGY hosts that omit shell error/exitCode, an unconfirmed verification-only command must not advance lastEditAt
|
|
172
177
|
// and defeat agy-stop.js's bounded continuation fingerprint.
|
|
173
178
|
const agyUnknownOutcomeVerify = agy && !verifiedSuccess && !isFailed && verifies;
|
|
174
|
-
if (!metadataStep && !agyUnknownOutcomeVerify && commandClass !== 'read-only' && commandClass !== 'worktree-setup') {
|
|
179
|
+
if (!metadataStep && !agyUnknownOutcomeVerify && !agyReadOnlyProbe && commandClass !== 'read-only' && commandClass !== 'worktree-setup') {
|
|
175
180
|
if (stateOnlyCandidate) editAfterCapture = true;
|
|
176
181
|
else state.lastEditAt = Date.now();
|
|
177
182
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "harness-everything",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"description": "Invariant-first engineering harness for routing, verification, and failure recovery while preserving agent autonomy.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Miya Daniel",
|
|
@@ -14,13 +14,26 @@ Bug/regression/flake labels or `fix`/`bug` title prefixes qualify; reports keep
|
|
|
14
14
|
- `--hide-ledger` excludes existing error-ledger files from the scan.
|
|
15
15
|
- `--home <dir>` changes the local home used to resolve automatic memory.
|
|
16
16
|
|
|
17
|
+
- **Redaction scope:** the opaque-ref/no-excerpt rules below apply only to fields derived from local-store rows. Git, doc and tracker fields in the same report keep their own sanitization (repo-existing sites, issue reference only); local-store redaction does not rewrite them. The whole combined report still follows the privacy rules below and stays local.
|
|
18
|
+
|
|
17
19
|
## Optional local error store
|
|
18
20
|
|
|
19
|
-
Local observations are opt-in: `--source local-store --destination harness
|
|
21
|
+
Local observations are opt-in: `--source local-store --destination <harness-or-project>`. With no `--source` option, the scanner keeps the legacy report bytes and source set. `--destination` is required with this source and accepts exactly one of `harness` or `project` (the `harness|project` notation is not a literal value); it is the operator's declaration for the canonical Git `--root`, not a router to another repository.
|
|
22
|
+
|
|
23
|
+
The scanner derives the workspace key from that root, calls the supported reader as `listRecords({ workspaceRoot, workspaceKey })`, and accepts only returned rows carrying that key. A bound host workspace that disagrees fails closed. The report binds the resolved destination to an opaque `workspaceRef`; each record ref is `p-local-<sha256>` over the workspace key and validated stored provisional ID. Raw provisional IDs are never reported.
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
| Reader condition | Source status / reason | Recovery |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| Reader module missing (the packaged Skills-only copy has no `hooks/scripts/lib/local-errors.js`) | `unavailable` / `reader-unavailable` | Re-scan from a trusted full Harness checkout with the command below. |
|
|
28
|
+
| Reader module present but its contract/API is incomplete (for example a missing `DESTINATIONS` export) | `unavailable` / `reader-contract-incomplete` | Repair that checkout's reader, then re-scan. |
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
Both conditions yield zero local leads, keep the other sources, and fail closed; neither implies routing to another repository. Full-checkout recovery command (choose one destination value, not the literal `harness|project`):
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
node "<Harness checkout>/error-ledger-bootstrap/scripts/scan.js" --root "<target>" --no-memory --source local-store --destination harness --out "<private dir outside target>" --json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The `local-store` source status is `used`, `missing`, `unverified`, or `unavailable`. Missing local-store indexes use `index-missing`; unreadable or corrupt input uses a sanitized reason such as `store-unreadable`, `store-corrupt`, or `store-unsupported`. A missing destination ledger directory or `index.jsonl` reports `ledgerStatus: unverified` / `ledgerReason: ledger-missing`; unreadable or corrupt ledger uses `ledger-unreadable` / `ledger-corrupt`. An empty reader result is `unverified` (`empty-reader-result`) because the reader returns an empty array for both an empty workspace and several read failures. Invalid rows are skipped and counted as `malformed`; they are never quoted. The report separately counts valid rows assigned to another destination and rows whose destination is `unknown`.
|
|
24
37
|
|
|
25
38
|
Each valid destination-matched provisional lesson yields one neutral local lead. Occurrences are grouped by exact signature and suppressed when a selected lesson covers that signature. JSON and Markdown contain only opaque refs, validated destination/kind/command-class metadata, signatures, counts, and dedupe/evidence results. They never include excerpts, cues, lesson text, issue URLs, paths, session IDs, or tool-use IDs. Keep the reports local; the local store and destination ledger are read-only during scan.
|
|
26
39
|
|
|
@@ -38,9 +51,9 @@ Obtain explicit owner approval for each candidate. Bind the approval to the exac
|
|
|
38
51
|
|
|
39
52
|
The top-level approval JSON has `schemaVersion: 1`, a 20-character hexadecimal `candidateId`, a 64-character hexadecimal `reportSha256` of the exact report bytes, an absolute canonical `targetRoot` matching `--target`, a non-empty `approvedBy`, and a parseable `approvedAt` timestamp. Its `record` object has a kebab-case `signature`; non-empty `class`, `title`, `violates`, and `sourcesNote`; `scope` of `in`, `out`, or `unresolved`; `status` of `open`, `lesson`, or `mechanism`; and `sites`, an array of existing target-repository files named by relative paths without absolute paths or `.` or `..` components. Do not put absolute paths in `approvedBy`, `approvedAt`, or the record text fields. The approved candidate must occur exactly once in the report, and the selected and approved site files must exist in the target.
|
|
40
53
|
|
|
41
|
-
For a candidate with a `local-store` source, also include top-level `destination: harness` or `destination: project` in the approval
|
|
54
|
+
For a candidate with a `local-store` source, also include exactly one top-level `destination: harness` or `destination: project` in the approval, matching the report's `--destination`. Promotion requires one `used` workspace binding whose opaque ref resolves to canonical `--target` through the trusted Harness checkout's local-store reader; every candidate ref must still resolve to a row for that workspace and destination. The report's exact-dedupe result must be eligible, and the candidate must carry a verified Git or documentation commit source that exists in the target repository on that same candidate. Promotion rechecks exact signature and whole-rule dedupe against the current destination ledger while holding the promotion lock. Missing, unknown, mismatched, stale, or unreadable local bindings fail closed before ledger changes. Legacy reports without a local-store source keep their existing approval shape. A stored issue URL is only a local lead and never satisfies the durable-source requirement.
|
|
42
55
|
|
|
43
|
-
Use this
|
|
56
|
+
Use this example as the approval structure, replacing the sample candidate ID and digest with the exact report values, `targetRoot` with the target's absolute canonical path, and the approver, timestamp, and reviewed record content with the owner's approval. A local-store approval includes the top-level `destination` shown here; a legacy approval omits that field.
|
|
44
57
|
|
|
45
58
|
```json
|
|
46
59
|
{
|
|
@@ -48,6 +61,7 @@ Use this complete example as the approval file structure, replacing the sample c
|
|
|
48
61
|
"candidateId": "0123456789abcdef0123",
|
|
49
62
|
"reportSha256": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
50
63
|
"targetRoot": "/absolute/path/to/target",
|
|
64
|
+
"destination": "harness",
|
|
51
65
|
"approvedBy": "Owner Name",
|
|
52
66
|
"approvedAt": "2026-11-20T00:00:00.000Z",
|
|
53
67
|
"record": {
|
|
@@ -65,13 +79,34 @@ Use this complete example as the approval file structure, replacing the sample c
|
|
|
65
79
|
|
|
66
80
|
Do not promote an unapproved, changed, or stale candidate. Keep full candidate reports and private inputs out of E-records, PRs, shared logs, and uploads.
|
|
67
81
|
|
|
68
|
-
Promotion requires the target to already contain `.agents/harness-everything/errors
|
|
82
|
+
Promotion requires the target to already contain `.agents/harness-everything/errors/`; it refuses when the directory is absent. Create that directory once:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
mkdir -p "<target repo>/.agents/harness-everything/errors"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
| Candidate source | Index precondition before scan and approval |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| Legacy (no `local-store` source) | No index file needed beforehand; the first promotion creates it through the sync command below. |
|
|
91
|
+
| `local-store` | `index.jsonl` must already exist and be current in the target. Create/refresh it from the trusted checkout with `node "<Harness checkout>/scripts/errors-sync.js" --root "<target repo>"`. A missing index leaves scan dedupe `unverified` (`ledger-missing`). Scan does not detect a stale index; promotion rechecks it under lock and fails closed (`destination ledger index is stale or unavailable`). Never bypass either; refresh, rescan and reapprove. |
|
|
92
|
+
|
|
93
|
+
Copyable first-promotion sequence for a `local-store` lead:
|
|
69
94
|
|
|
70
95
|
```sh
|
|
96
|
+
# 1. Target ledger directory and index (an empty ledger is fine)
|
|
71
97
|
mkdir -p "<target repo>/.agents/harness-everything/errors"
|
|
98
|
+
node "<Harness checkout>/scripts/errors-sync.js" --root "<target repo>"
|
|
99
|
+
|
|
100
|
+
# 2. Scan from the trusted full checkout, not the packaged Skills-only copy
|
|
101
|
+
node "<Harness checkout>/error-ledger-bootstrap/scripts/scan.js" \
|
|
102
|
+
--root "<target repo>" --no-memory --source local-store --destination harness \
|
|
103
|
+
--out "<private dir outside target>" --json
|
|
104
|
+
|
|
105
|
+
# 3. Classify locally; obtain fresh per-item approval bound to the exact report bytes
|
|
106
|
+
# 4. Promote with the packaged script below
|
|
72
107
|
```
|
|
73
108
|
|
|
74
|
-
|
|
109
|
+
If the index was missing or stale, re-run step 1 **before** step 2, then rescan and reapprove the new `reportSha256`; an approval bound to earlier report bytes is stale.
|
|
75
110
|
|
|
76
111
|
Before promotion, resolve a trusted local Harness checkout containing `scripts/errors-sync.js` and verify its Node dependencies are installed. Local-store candidates also require `hooks/scripts/lib/local-errors.js` in that checkout. The current sync script requires `js-yaml`; a read-only preflight is:
|
|
77
112
|
|
|
@@ -515,10 +515,11 @@ function savedIndex(index) {
|
|
|
515
515
|
function indexState(index) {
|
|
516
516
|
let fd;
|
|
517
517
|
try {
|
|
518
|
-
|
|
518
|
+
// Keep 64-bit device/file IDs exact (Windows IDs can exceed Number's safe integer range).
|
|
519
|
+
const current = fs.lstatSync(index, { bigint: true });
|
|
519
520
|
if (current.isSymbolicLink() || !current.isFile()) throw new Error('index was replaced with a non-regular file');
|
|
520
521
|
fd = fs.openSync(index, fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW || 0));
|
|
521
|
-
const opened = fs.fstatSync(fd);
|
|
522
|
+
const opened = fs.fstatSync(fd, { bigint: true });
|
|
522
523
|
if (!opened.isFile() || opened.dev !== current.dev || opened.ino !== current.ino) {
|
|
523
524
|
throw new Error('index changed while it was being read');
|
|
524
525
|
}
|
|
@@ -544,13 +545,14 @@ function writePreviousIndex(index, saved, current, expected) {
|
|
|
544
545
|
}
|
|
545
546
|
|
|
546
547
|
const dir = path.dirname(index);
|
|
548
|
+
const mode = Number(saved.stat.mode) & 0o777;
|
|
547
549
|
let temporary;
|
|
548
550
|
let fd;
|
|
549
551
|
try {
|
|
550
552
|
for (let attempt = 0; attempt < 5; attempt++) {
|
|
551
553
|
temporary = path.join(dir, `.${INDEX}.${process.pid}.${crypto.randomBytes(8).toString('hex')}.tmp`);
|
|
552
554
|
try {
|
|
553
|
-
fd = fs.openSync(temporary, 'wx',
|
|
555
|
+
fd = fs.openSync(temporary, 'wx', mode);
|
|
554
556
|
break;
|
|
555
557
|
} catch (error) {
|
|
556
558
|
temporary = undefined;
|
|
@@ -558,7 +560,7 @@ function writePreviousIndex(index, saved, current, expected) {
|
|
|
558
560
|
}
|
|
559
561
|
}
|
|
560
562
|
if (fd === undefined) throw new Error('could not allocate a temporary rollback index');
|
|
561
|
-
fs.fchmodSync(fd,
|
|
563
|
+
fs.fchmodSync(fd, mode);
|
|
562
564
|
fs.writeFileSync(fd, saved.bytes);
|
|
563
565
|
const openFd = fd;
|
|
564
566
|
fd = undefined;
|
|
@@ -615,7 +617,7 @@ function rollback(context, saved, destination, identity, beforeNames) {
|
|
|
615
617
|
}
|
|
616
618
|
if (identity) {
|
|
617
619
|
try {
|
|
618
|
-
const current = fs.lstatSync(destination);
|
|
620
|
+
const current = fs.lstatSync(destination, { bigint: true });
|
|
619
621
|
if (current.dev !== identity.dev || current.ino !== identity.ino || current.isSymbolicLink()) {
|
|
620
622
|
problems.push('new record was replaced by another writer');
|
|
621
623
|
} else fs.unlinkSync(destination);
|
|
@@ -662,7 +664,7 @@ function promote(context) {
|
|
|
662
664
|
let recordFd;
|
|
663
665
|
try {
|
|
664
666
|
recordFd = fs.openSync(destination.destination, 'wx', 0o644);
|
|
665
|
-
identity = fs.fstatSync(recordFd);
|
|
667
|
+
identity = fs.fstatSync(recordFd, { bigint: true });
|
|
666
668
|
fs.writeFileSync(recordFd, text, 'utf8');
|
|
667
669
|
fs.closeSync(recordFd);
|
|
668
670
|
recordFd = undefined;
|