harness-everything 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +15 -0
  4. package/benchmarks/results/live-host/agy-2026-11-26-516-read-only/README.md +12 -0
  5. package/benchmarks/results/live-host/agy-2026-11-26-516-read-only/capture.sanitized.jsonl +5 -0
  6. package/benchmarks/results/live-host/codex-2026-11-26-488-post-tool-use/README.md +25 -0
  7. package/benchmarks/results/live-host/codex-2026-11-26-488-post-tool-use/capture.sanitized.jsonl +10 -0
  8. package/ci/mechanism-2am-observations-session-import.test.js +1 -0
  9. package/ci/mechanism-2w-platform-compatibility.test.js +1 -2
  10. package/ci/mechanism-34-observations.test.js +37 -1
  11. package/ci/mechanism-397-opencode-observations.test.js +4 -3
  12. package/ci/mechanism-496-local-error-store.test.js +188 -5
  13. package/ci/mechanism-498-local-store-scan.test.js +13 -1
  14. package/ci/mechanism-516-windows-verify-and-shell.test.js +74 -19
  15. package/ci/mechanism-report-writer.test.js +2 -1
  16. package/ci/mechanism-system-one-cycle.test.js +47 -2
  17. package/ci/openai-plugin-submission.test.js +26 -8
  18. package/docs/openai-plugin.md +6 -10
  19. package/docs/platform-capabilities.md +15 -0
  20. package/docs/routing.md +2 -0
  21. package/harness-everything/SKILL.md +1 -1
  22. package/harness-everything/scripts/kernel-router.js +3 -2
  23. package/hooks/scripts/lib/local-errors.js +24 -7
  24. package/hooks/scripts/state-persist.js +6 -1
  25. package/opencode-plugin/plugin.json +1 -1
  26. package/package.json +1 -1
  27. package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
  28. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  29. package/plugins/harness-everything/hooks/scripts/lib/local-errors.js +24 -7
  30. package/plugins/harness-everything/hooks/scripts/state-persist.js +6 -1
  31. package/plugins/harness-everything/plugin.json +1 -1
  32. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  33. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +3 -2
  34. package/sbom.cdx.json +7 -7
  35. package/scripts/build-openai-submission.js +8 -4
  36. package/submission/openai/README.md +9 -14
  37. package/submission/openai/listing.json +1 -1
  38. package/submission/openai/test-cases.json +1 -1
@@ -155,13 +155,15 @@ function environment446(fixture, quality = 0.9) {
155
155
  return env;
156
156
  }
157
157
 
158
- function run446Cycle(fixture, version, { history, quality = 0.9, all = false } = {}) {
158
+ function run446Cycle(fixture, version, { history, quality = 0.9, all = false, preload } = {}) {
159
159
  const args = [cycleCli, all ? 'all' : 'evaluate'];
160
160
  if (all) args.push('--until', 'evaluate');
161
161
  args.push('--data-dir', fixture.dataDir, '--holdout', fixture.holdout, '--version', version);
162
162
  if (history === true) args.push('--history');
163
163
  else if (history !== undefined) args.push('--history', history);
164
- return spawnSync(process.execPath, args, { cwd: root, encoding: 'utf8', env: environment446(fixture, quality) });
164
+ const env = environment446(fixture, quality);
165
+ if (preload) env.NODE_OPTIONS = `--require ${JSON.stringify(preload.replaceAll('\\', '/'))}`;
166
+ return spawnSync(process.execPath, args, { cwd: root, encoding: 'utf8', env });
165
167
  }
166
168
 
167
169
  function rows446(history) {
@@ -1026,6 +1028,49 @@ test('446 cross-cycle: default history remains local and explicit history valida
1026
1028
  assert.equal(fs.existsSync(path.join(appendFailure.dataDir, 'cycle-state.json')), false);
1027
1029
  });
1028
1030
 
1031
+ test('443 R6: resumes after an interrupted history append exactly once', t => {
1032
+ const tmp = private446Root(t);
1033
+ const history = path.join(tmp, 'history.jsonl');
1034
+ const version = 'v1';
1035
+ const fixture = setup446Cycle(t, path.join(tmp, 'cycle'), [
1036
+ { version: 'v0', quality: 0.9 }, { version, quality: 0.9 },
1037
+ ]);
1038
+ assert.equal(run446Cycle(fixture, 'v0', { history }).status, 0);
1039
+ const prefix = fs.readFileSync(history, 'utf8');
1040
+ const preload = path.join(tmp, 'fail-history-append.cjs');
1041
+ fs.writeFileSync(preload, `
1042
+ const fs = require('node:fs');
1043
+ const append = fs.appendFileSync;
1044
+ fs.appendFileSync = (file, ...args) => {
1045
+ if (file === ${JSON.stringify(fs.realpathSync.native(history))}) throw new Error('injected history append failure');
1046
+ return append(file, ...args);
1047
+ };
1048
+ `);
1049
+
1050
+ const interrupted = run446Cycle(fixture, version, { history, preload });
1051
+ assert.notEqual(interrupted.status, 0);
1052
+ const candidate = path.join(fixture.dataDir, 'training', 'candidates', version);
1053
+ const manifest = path.join(candidate, 'manifest.json');
1054
+ const evaluationFiles = snapshot446(['curves.json', 'trend.json'].map(file =>
1055
+ path.join(candidate, 'evaluation', file)));
1056
+ assert.equal(fs.readFileSync(history, 'utf8'), prefix);
1057
+ assert.equal(JSON.parse(fs.readFileSync(manifest, 'utf8')).evaluation, null);
1058
+ const callsAfterFailure = fs.readFileSync(fixture.callLog, 'utf8');
1059
+
1060
+ const resumed = run446Cycle(fixture, version, { history });
1061
+ assert.equal(resumed.status, 0, resumed.stderr || resumed.stdout);
1062
+ assert.equal(JSON.parse(resumed.stdout).steps[0].resumed, true);
1063
+ assert.equal(JSON.parse(fs.readFileSync(manifest, 'utf8')).evaluation, 'evaluation/curves.json');
1064
+ const restored = fs.readFileSync(history, 'utf8');
1065
+ assert.equal(restored, prefix + JSON.stringify(evaluation446(fixture.dataDir, version).curves) + '\n');
1066
+
1067
+ const repeated = run446Cycle(fixture, version, { history });
1068
+ assert.equal(repeated.status, 0, repeated.stderr || repeated.stdout);
1069
+ assert.equal(fs.readFileSync(history, 'utf8'), restored);
1070
+ assert.equal(fs.readFileSync(fixture.callLog, 'utf8'), callsAfterFailure);
1071
+ assertSnapshot446(evaluationFiles);
1072
+ });
1073
+
1029
1074
  test('446 H2: rejects changed same-id baseline before append, including an existing identical candidate', t => {
1030
1075
  const tmp = private446Root(t);
1031
1076
  const originalHistory = path.join(tmp, 'original-history.jsonl');
@@ -48,8 +48,8 @@ assert.ok(listing.manual_requirements?.developer_identity, 'developer identity r
48
48
  assert.ok(listing.manual_requirements?.logo, 'logo upload reminder missing');
49
49
  assert.ok(listing.manual_requirements?.apps_management_write_access, 'Apps Management access reminder missing');
50
50
 
51
- assert.strictEqual(tests.positive.length, 5, 'OpenAI submission requires five positive test cases');
52
- assert.strictEqual(tests.negative.length, 3, 'OpenAI submission requires three negative test cases');
51
+ assert.strictEqual(tests.positive.length, 5, 'maintain five positive smoke cases');
52
+ assert.strictEqual(tests.negative.length, 3, 'maintain three negative smoke cases');
53
53
  const ids = new Set();
54
54
  for (const test of tests.positive) {
55
55
  assert.ok(test.id && !ids.has(test.id), `duplicate/missing test id: ${test.id}`);
@@ -82,20 +82,38 @@ try {
82
82
  assert.strictEqual(sha256(first), sha256(second), 'submission bundle must be deterministic');
83
83
 
84
84
  const manifest = JSON.parse(fs.readFileSync(first.replace(/\.zip$/, '.manifest.json'), 'utf8'));
85
- const expectedFiles = filesUnder(path.join(PLUGIN, 'skills')).map(file => `skills/${file}`);
85
+ const expectedFiles = ['plugin.json', ...filesUnder(path.join(PLUGIN, 'skills')).map(file => `skills/${file}`)];
86
86
  assert.strictEqual(manifest.source, 'plugins/harness-everything/skills');
87
- assert.ok(manifest.files.every(file => file.path.startsWith('skills/')), 'public bundle must contain only skills/ paths');
88
87
  assert.ok(manifest.files.every(file => !/(^|\/)(hooks|\.codex-plugin)(\/|$)/.test(file.path)), 'public bundle must exclude local hook package paths');
89
- assert.ok(manifest.files.every(file => path.basename(file.path) !== 'plugin.json'), 'public bundle must exclude plugin manifests');
90
- assert.deepStrictEqual(manifest.files.map(file => file.path), expectedFiles, 'bundle manifest must contain exactly packaged skill files');
88
+ assert.deepStrictEqual(manifest.files.map(file => file.path), expectedFiles, 'bundle must contain the root manifest and packaged skill files');
91
89
  assert.strictEqual(manifest.file_count, expectedFiles.length);
92
90
  assert.strictEqual(manifest.bundle_sha256, sha256(first));
93
91
 
94
92
  const zip = fs.readFileSync(first);
95
- assert.strictEqual(zip.readUInt32LE(0), 0x04034b50, 'bundle must start with ZIP local-file signature');
93
+ let offset = 0;
94
+ for (const file of manifest.files) {
95
+ assert.strictEqual(zip.readUInt32LE(offset), 0x04034b50, file.path);
96
+ const size = zip.readUInt32LE(offset + 18);
97
+ const nameStart = offset + 30;
98
+ const nameEnd = nameStart + zip.readUInt16LE(offset + 26);
99
+ const dataStart = nameEnd + zip.readUInt16LE(offset + 28);
100
+ const data = zip.subarray(dataStart, dataStart + size);
101
+ assert.strictEqual(zip.toString('utf8', nameStart, nameEnd), file.path);
102
+ assert.strictEqual(size, file.bytes);
103
+ assert.strictEqual(crypto.createHash('sha256').update(data).digest('hex'), file.sha256);
104
+ if (file.path === 'plugin.json') {
105
+ const { extensions, ...identity } = portablePlugin;
106
+ assert.deepStrictEqual(JSON.parse(data), {
107
+ ...identity,
108
+ extensions: { 'com.openai': { interface: extensions['com.openai'].interface } },
109
+ });
110
+ }
111
+ offset = dataStart + size;
112
+ }
113
+ assert.strictEqual(zip.readUInt32LE(offset), 0x02014b50, 'no extra file entries before the central directory');
96
114
  assert.strictEqual(zip.readUInt32LE(zip.length - 22), 0x06054b50, 'bundle must end with ZIP EOCD signature');
97
115
  } finally {
98
116
  fs.rmSync(tmp, { recursive: true, force: true });
99
117
  }
100
118
 
101
- console.log('OpenAI public submission verified: listing metadata, 5+3 review cases, and deterministic skills bundle.');
119
+ console.log('OpenAI public submission verified: portable manifest, listing metadata, smoke cases, and deterministic skills bundle.');
@@ -61,7 +61,7 @@ npm run test:plugin:submission
61
61
 
62
62
  OpenAI documents GitHub marketplace import for workspace administrators. The repository provides both `.agents/plugins/marketplace.json` and `.claude-plugin/marketplace.json`; the source entry resolves to `plugins/harness-everything/`.
63
63
 
64
- Use the repository URL as the source, leave Path empty so the marketplace is read from the repository root, and select the intended branch (normally `main`). In ChatGPT, use **Workspace settings > Plugins > Add > Import marketplace**, review the import results, and set the workspace installation policy. OpenAI documents automatic daily synchronization and a **Sync now** action for later refreshes.
64
+ Use the repository URL as the source, leave Path empty so the marketplace is read from the repository root, and select the intended branch (normally `main`). In the OpenAI Admin Console, select the workspace and use **Plugins > Add > Import marketplace**. Save the import report with the source/ref and client version, set the installation policy, then install and invoke a representative skill from a fresh eligible member session. Use **Marketplaces > Sync now** after a branch update and retain the sync report and the updated skill result. OpenAI also documents automatic daily sync.
65
65
 
66
66
  This repository contains the marketplace/package artifacts and deterministic import-shape checks. It does not contain a managed-workspace import report or a fresh host smoke-test artifact, so those operations remain `Unknown` in the compatibility matrix.
67
67
 
@@ -74,7 +74,7 @@ The local package path is distinct from the general `--codex` installer. The gen
74
74
  The package tests prove the following repository-side contract:
75
75
 
76
76
  - the portable root manifest and `.codex-plugin` compatibility manifest agree on identity, version, interface, and hook entry point;
77
- - the root `skills/` tree contains exactly the 27 canonical skills;
77
+ - the root `skills/` tree contains the canonical skills;
78
78
  - Windows and POSIX hook commands resolve through `PLUGIN_ROOT`;
79
79
  - session start emits the compact policy and prompt submission invokes invariant-first routing;
80
80
  - supported local `Bash` and `apply_patch` calls receive the packaged guards and state tracking;
@@ -93,13 +93,9 @@ Build the final upload from the synchronized package:
93
93
  npm run plugin:submission:build
94
94
  ```
95
95
 
96
- The generated ZIP contains only `skills/<name>/...` files from `plugins/harness-everything/skills/`. It does **not** include the local `.codex-plugin` lifecycle hooks, MCP definitions, or a fake app wrapper. The generated manifest records every path, byte count, file hash, and final bundle hash; repeated builds from the same revision must match.
96
+ The generated ZIP has a portable root `plugin.json` and the synchronized `skills/<name>/...` tree. It does **not** include the local `.codex-plugin` lifecycle hooks, MCP definitions, or app wrappers. The generated checksum manifest records each file and the ZIP SHA-256. OpenAI documents a supported plugin manifest as an upload requirement. [Submission error reference](https://developers.openai.com/plugins/deploy/submission-errors#plugin-manifest-errors)
97
97
 
98
- The submission source files in [`../submission/openai/`](../submission/openai/) model the official review inputs: listing metadata, starter prompts, release notes, exactly five positive cases, and exactly three negative cases. Positive cases specify the prompt, expected skill/workflow behavior, expected result shape, and fixture/account data. Negative cases specify the prompt/scenario, expected refusal/clarification/safe fallback, and why completion is not appropriate.
99
-
100
- The official portal flow is: **Create plugin → Skills only → upload the final skill bundle → provide review cases and listing metadata → complete identity, availability, policy, and access requirements → submit for review → publish after approval**. The repository cannot complete verified identity, logo upload, availability selection, Apps Management write access, review, approval, or public-directory publication.
101
-
102
- Official documentation: [Submit a plugin](https://developers.openai.com/plugins/deploy/submission) and [Build plugins](https://developers.openai.com/plugins/build/plugins).
98
+ The [public submission runbook](../submission/openai/README.md) covers the developer identity, ZIP upload, automated scans, and publication. It also links to the project smoke cases for a fresh session. Use the [OpenAI submission guide](https://developers.openai.com/plugins/deploy/submission) to confirm the portal requirements.
103
99
 
104
100
  ## Evidence boundary
105
101
 
@@ -109,10 +105,10 @@ The local plugin and public Skills-only artifact must not be conflated:
109
105
  | --- | --- | --- |
110
106
  | Portable/root plugin package | Manifest, tree, hook, and routing mechanism tests | Package shape and local mechanism are verified |
111
107
  | Managed workspace marketplace | Marketplace JSON and source-path checks | Import-ready repository artifact; live import remains unverified |
112
- | Public Skills-only ZIP | Deterministic builder and 5+3 review-input checks | Reproducible skills bundle; approval and live public behavior remain unverified |
108
+ | Public Skills-only ZIP | Deterministic builder, portable manifest, and smoke-case inputs | Reproducible skills bundle; approval and live public behavior remain unverified |
113
109
 
114
110
  See the [platform capability matrix](platform-capabilities.md) for the complete ten-dimension status table and official source URLs.
115
111
 
116
112
  ## Publication smoke checklist
117
113
 
118
- Before public submission, run `plugin:sync`, both OpenAI package checks, and the platform compatibility check. Confirm all 26 skills are content-identical to canonical sources after EOL normalization, the ZIP is reproducible, public links are current, the publisher identity and Apps Management access are ready, and final reviewer-facing cases run against the exact submitted skills tree.
114
+ Before public submission, run `plugin:sync`, both OpenAI package checks, and the platform compatibility check. Check that the packaged skills match canonical sources after EOL normalization and that the ZIP is reproducible. Confirm the publisher identity and portal permissions, and run the project smoke cases against the exact bundle being submitted.
@@ -30,6 +30,13 @@ recovery state intact and is audited as `unknown` for observed gated actions.
30
30
  Edits are still tracked when the outcome is unknown because side effects may
31
31
  already have occurred.
32
32
 
33
+ [Windows CLI 0.172.0 evidence](../benchmarks/results/live-host/codex-2026-11-26-488-post-tool-use/README.md)
34
+ shows that UnifiedExec with PowerShell and Git Bash delivers only a string in
35
+ `PostToolUse.tool_response`. A command that yielded and then completed through
36
+ `write_stdin` delivered an empty string response on both shells. Structured exit
37
+ status appears in the separate CLI event stream. Automatic verification credit
38
+ through the hook depends on Codex exposing structured status in the hook payload.
39
+
33
40
  Codex `SubagentStop` uses the documented JSON `systemMessage` field for a UI-only
34
41
  warning when the scope audit detects a new violation. Each audit advances the
35
42
  Git status baseline and replaces `subagent-scope-last.json`. A later silent stop
@@ -38,6 +45,14 @@ can therefore coexist with unresolved changes. The coordinator owns
38
45
  even when the hook is silent. The source and package fixtures cover these
39
46
  behaviors. Windows host delivery remains to be verified.
40
47
 
48
+ ### Antigravity Windows shell handoff
49
+
50
+ [AGY CLI 1.5.17 evidence](../benchmarks/results/live-host/agy-2026-11-26-516-read-only/README.md)
51
+ records live delivery of two read-only Windows shell probes to the packaged
52
+ AGY hooks. Both probes left edit and verification timestamps unset, and the
53
+ patched Stop hook allowed termination. These payloads omitted structured exit
54
+ status, so they could not grant automatic verification credit.
55
+
41
56
  ### Routing contract vs. host evidence
42
57
 
43
58
  The workflow plan controller rejects present non-array required/optional binding declarations before recording a requirement plan. This input-validation contract is covered by deterministic mechanism tests and does not change live-host evidence status.
package/docs/routing.md CHANGED
@@ -75,6 +75,8 @@ End the final message of **every** turn with one line that rendered Markdown hid
75
75
 
76
76
  It states the agent's own judgement after the work, not a copy of the router's suggestion. `invalid` means the prompt cannot be understood from its own text and needs conversation context; agent-written dispatches and worker instructions are ordinary prompts. The remaining keys record `tier` under tier rules v2, up to three `intents`, the `workflow` strategy and the `skills` actually used. The observation collector stores it as training data ([system-one-observations.md](system-one-observations.md)). A missing or malformed line is recorded with a reason code; it never blocks a turn or changes routing.
77
77
 
78
+ Use JSON `null` for `workflow` when the strategy is deferred or no strategy was selected. Otherwise use the strategy id actually used.
79
+
78
80
  Tier values:
79
81
 
80
82
  | Tier | Meaning |
@@ -4,7 +4,7 @@ description: "Route software/project work through Harness: classify tier/topolog
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 0.55.4
7
+ version: 1.2.2
8
8
  ---
9
9
 
10
10
  # Harness Everything
@@ -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(' <!-- 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"]} -->');
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
 
@@ -153,7 +153,10 @@ function normalizeSignature(input, options = {}) {
153
153
  // Order-independent composite for ambiguous multi-family output (E-0027).
154
154
  suffix = `multi-${observations.sha(families.join(','), 8)}`;
155
155
  } else {
156
- const normalized = normalizeFallbackText(redacted);
156
+ const fallbackOutput = options.host === 'claude'
157
+ ? redacted.replace(/^Exit code [0-9]+\r?\n/, '')
158
+ : redacted;
159
+ const normalized = normalizeFallbackText(fallbackOutput);
157
160
  suffix = normalized ? `generic-${observations.sha(normalized, 12)}` : 'unknown';
158
161
  }
159
162
 
@@ -403,7 +406,7 @@ function appendOccurrence(input, options = {}) {
403
406
  const outputExcerpt = observations.tailBytes(redactedOutput, limits.maxExcerptBytes);
404
407
  const signature = typeof input.signature === 'string' && validIdentifier(input.signature)
405
408
  ? input.signature
406
- : normalizeSignature({ commandClass, output: redactedOutput }, { env });
409
+ : normalizeSignature({ commandClass, output: redactedOutput }, { env, host });
407
410
  const exitCode = Number.isInteger(input.exitCode) ? input.exitCode : null;
408
411
  const matchedLedgerIds = normalizeMatchedLedgerIds(input.matchedLedgerIds);
409
412
  const destination = normalizeDestination(input.destination, false);
@@ -435,6 +438,7 @@ function appendOccurrence(input, options = {}) {
435
438
  ? options.lockTimeoutMs : limits.defaultLockTimeoutMs;
436
439
 
437
440
  let outcome = null;
441
+ let failureReason = null;
438
442
  let saved = record;
439
443
  const locked = observations.withLock(root, () => {
440
444
  const index = loadIndex(file);
@@ -452,6 +456,13 @@ function appendOccurrence(input, options = {}) {
452
456
  return;
453
457
  }
454
458
  }
459
+ const collision = index.records.some(r => r && r.kind !== 'occurrence' &&
460
+ r.workspaceKey === workspaceKey && r.provisionalId === provisionalId);
461
+ if (collision) {
462
+ outcome = 'invalid';
463
+ failureReason = 'provisional-id-in-use';
464
+ return;
465
+ }
455
466
  index.records.push(record);
456
467
  enforceBounds(index, workspaceKey, limits, now);
457
468
  observations.writeJsonAtomic(file, index);
@@ -459,6 +470,7 @@ function appendOccurrence(input, options = {}) {
459
470
  }, { timeoutMs: lockTimeoutMs });
460
471
 
461
472
  if (!locked) return { status: 'lock-timeout', record: null };
473
+ if (failureReason) return { status: 'invalid', record: null, error: failureReason };
462
474
  return { status: outcome || 'appended', record: saved };
463
475
  } catch (error) {
464
476
  return { status: 'error', record: null, error: error && error.message ? error.message : String(error) };
@@ -528,6 +540,9 @@ function addProvisionalLesson(input, options = {}) {
528
540
  saved = existing;
529
541
  return;
530
542
  }
543
+ const collision = index.records.some(r => r && r.kind !== 'provisional-lesson' &&
544
+ r.workspaceKey === workspaceKey && r.provisionalId === provisionalId);
545
+ if (collision) throw new Error('invalid provisionalId: already in use in this workspace');
531
546
  index.records.push(record);
532
547
  enforceBounds(index, workspaceKey, limits, now);
533
548
  observations.writeJsonAtomic(file, index);
@@ -544,12 +559,12 @@ function listRecords(options = {}) {
544
559
  const limits = effectiveLimits(options.limits);
545
560
  const now = Number.isFinite(options.now) ? options.now : Date.now();
546
561
  const { file } = getStorePath({ root: options.root, env });
547
- const index = loadIndex(file);
548
562
  let targetWorkspace = null;
549
- const hasWorkspaceContext = Boolean(extractWorkspacePath(options));
563
+ const scopeOptions = { ...options, root: undefined };
564
+ const workspaceRoot = extractWorkspacePath(scopeOptions);
550
565
  const hasSuppliedKey = options.workspaceKey !== undefined && options.workspaceKey !== null && options.workspaceKey !== '';
551
- if (hasWorkspaceContext) {
552
- const canonicalKey = resolveCanonicalWorkspaceKey(options, { env });
566
+ if (workspaceRoot) {
567
+ const canonicalKey = resolveCanonicalWorkspaceKey({ workspaceRoot }, { env });
553
568
  if (!canonicalKey) return [];
554
569
  if (hasSuppliedKey) {
555
570
  if (!isBoundedWorkspaceKey(options.workspaceKey) || options.workspaceKey.trim() !== canonicalKey) {
@@ -561,10 +576,12 @@ function listRecords(options = {}) {
561
576
  if (!isBoundedWorkspaceKey(options.workspaceKey)) return [];
562
577
  targetWorkspace = options.workspaceKey.trim();
563
578
  }
579
+ if (!targetWorkspace) return [];
580
+ const index = loadIndex(file);
564
581
  let records = index.records.filter(record => {
565
582
  if (!isObject(record)) return false;
566
583
  if (!withinRetention(record, now, limits.retentionMs)) return false;
567
- if (targetWorkspace && record.workspaceKey !== targetWorkspace) return false;
584
+ if (record.workspaceKey !== targetWorkspace) return false;
568
585
  if (options.kind && record.kind !== options.kind) return false;
569
586
  if (options.destination && record.destination !== options.destination) return false;
570
587
  if (options.signature && record.signature !== options.signature) return false;
@@ -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
  "name": "harness-enforcement",
3
3
  "description": "Repository inventory for the opencode enforcement plugin and its standalone helper",
4
- "version": "1.2.0",
4
+ "version": "1.2.2",
5
5
  "runtime": "index.mjs",
6
6
  "hooks": {
7
7
  "verify": "hooks/verify.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harness-everything",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Harness OS: An Orchestrated Agent Operating System for AI-driven Development",
5
5
  "main": "harness-everything/scripts/bootstrap.js",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harness-everything",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Invariant-first engineering harness for routing, verification, and failure recovery while preserving agent autonomy.",
5
5
  "author": {
6
6
  "name": "Miya Daniel",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harness-everything",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Invariant-first engineering harness for routing, verification, and failure recovery while preserving agent autonomy.",
5
5
  "author": {
6
6
  "name": "Miya Daniel",
@@ -153,7 +153,10 @@ function normalizeSignature(input, options = {}) {
153
153
  // Order-independent composite for ambiguous multi-family output (E-0027).
154
154
  suffix = `multi-${observations.sha(families.join(','), 8)}`;
155
155
  } else {
156
- const normalized = normalizeFallbackText(redacted);
156
+ const fallbackOutput = options.host === 'claude'
157
+ ? redacted.replace(/^Exit code [0-9]+\r?\n/, '')
158
+ : redacted;
159
+ const normalized = normalizeFallbackText(fallbackOutput);
157
160
  suffix = normalized ? `generic-${observations.sha(normalized, 12)}` : 'unknown';
158
161
  }
159
162
 
@@ -403,7 +406,7 @@ function appendOccurrence(input, options = {}) {
403
406
  const outputExcerpt = observations.tailBytes(redactedOutput, limits.maxExcerptBytes);
404
407
  const signature = typeof input.signature === 'string' && validIdentifier(input.signature)
405
408
  ? input.signature
406
- : normalizeSignature({ commandClass, output: redactedOutput }, { env });
409
+ : normalizeSignature({ commandClass, output: redactedOutput }, { env, host });
407
410
  const exitCode = Number.isInteger(input.exitCode) ? input.exitCode : null;
408
411
  const matchedLedgerIds = normalizeMatchedLedgerIds(input.matchedLedgerIds);
409
412
  const destination = normalizeDestination(input.destination, false);
@@ -435,6 +438,7 @@ function appendOccurrence(input, options = {}) {
435
438
  ? options.lockTimeoutMs : limits.defaultLockTimeoutMs;
436
439
 
437
440
  let outcome = null;
441
+ let failureReason = null;
438
442
  let saved = record;
439
443
  const locked = observations.withLock(root, () => {
440
444
  const index = loadIndex(file);
@@ -452,6 +456,13 @@ function appendOccurrence(input, options = {}) {
452
456
  return;
453
457
  }
454
458
  }
459
+ const collision = index.records.some(r => r && r.kind !== 'occurrence' &&
460
+ r.workspaceKey === workspaceKey && r.provisionalId === provisionalId);
461
+ if (collision) {
462
+ outcome = 'invalid';
463
+ failureReason = 'provisional-id-in-use';
464
+ return;
465
+ }
455
466
  index.records.push(record);
456
467
  enforceBounds(index, workspaceKey, limits, now);
457
468
  observations.writeJsonAtomic(file, index);
@@ -459,6 +470,7 @@ function appendOccurrence(input, options = {}) {
459
470
  }, { timeoutMs: lockTimeoutMs });
460
471
 
461
472
  if (!locked) return { status: 'lock-timeout', record: null };
473
+ if (failureReason) return { status: 'invalid', record: null, error: failureReason };
462
474
  return { status: outcome || 'appended', record: saved };
463
475
  } catch (error) {
464
476
  return { status: 'error', record: null, error: error && error.message ? error.message : String(error) };
@@ -528,6 +540,9 @@ function addProvisionalLesson(input, options = {}) {
528
540
  saved = existing;
529
541
  return;
530
542
  }
543
+ const collision = index.records.some(r => r && r.kind !== 'provisional-lesson' &&
544
+ r.workspaceKey === workspaceKey && r.provisionalId === provisionalId);
545
+ if (collision) throw new Error('invalid provisionalId: already in use in this workspace');
531
546
  index.records.push(record);
532
547
  enforceBounds(index, workspaceKey, limits, now);
533
548
  observations.writeJsonAtomic(file, index);
@@ -544,12 +559,12 @@ function listRecords(options = {}) {
544
559
  const limits = effectiveLimits(options.limits);
545
560
  const now = Number.isFinite(options.now) ? options.now : Date.now();
546
561
  const { file } = getStorePath({ root: options.root, env });
547
- const index = loadIndex(file);
548
562
  let targetWorkspace = null;
549
- const hasWorkspaceContext = Boolean(extractWorkspacePath(options));
563
+ const scopeOptions = { ...options, root: undefined };
564
+ const workspaceRoot = extractWorkspacePath(scopeOptions);
550
565
  const hasSuppliedKey = options.workspaceKey !== undefined && options.workspaceKey !== null && options.workspaceKey !== '';
551
- if (hasWorkspaceContext) {
552
- const canonicalKey = resolveCanonicalWorkspaceKey(options, { env });
566
+ if (workspaceRoot) {
567
+ const canonicalKey = resolveCanonicalWorkspaceKey({ workspaceRoot }, { env });
553
568
  if (!canonicalKey) return [];
554
569
  if (hasSuppliedKey) {
555
570
  if (!isBoundedWorkspaceKey(options.workspaceKey) || options.workspaceKey.trim() !== canonicalKey) {
@@ -561,10 +576,12 @@ function listRecords(options = {}) {
561
576
  if (!isBoundedWorkspaceKey(options.workspaceKey)) return [];
562
577
  targetWorkspace = options.workspaceKey.trim();
563
578
  }
579
+ if (!targetWorkspace) return [];
580
+ const index = loadIndex(file);
564
581
  let records = index.records.filter(record => {
565
582
  if (!isObject(record)) return false;
566
583
  if (!withinRetention(record, now, limits.retentionMs)) return false;
567
- if (targetWorkspace && record.workspaceKey !== targetWorkspace) return false;
584
+ if (record.workspaceKey !== targetWorkspace) return false;
568
585
  if (options.kind && record.kind !== options.kind) return false;
569
586
  if (options.destination && record.destination !== options.destination) return false;
570
587
  if (options.signature && record.signature !== options.signature) return false;
@@ -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.2.0",
4
+ "version": "1.2.2",
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",
@@ -4,7 +4,7 @@ description: "Route software/project work through Harness: classify tier/topolog
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 0.55.4
7
+ version: 1.2.2
8
8
  ---
9
9
 
10
10
  # Harness Everything
@@ -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(' <!-- 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"]} -->');
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
 
package/sbom.cdx.json CHANGED
@@ -2,23 +2,23 @@
2
2
  "$schema": "https://cyclonedx.org/schema/bom-1.7.schema.json",
3
3
  "bomFormat": "CycloneDX",
4
4
  "specVersion": "1.7",
5
- "serialNumber": "urn:uuid:4b2bff41-e728-5f24-8be0-6732fd8a906b",
5
+ "serialNumber": "urn:uuid:bc58b946-e71f-5258-a016-063d58fa204d",
6
6
  "version": 1,
7
7
  "metadata": {
8
- "timestamp": "2026-11-25T19:38:34.670Z",
8
+ "timestamp": "2026-11-26T05:36:03.836Z",
9
9
  "tools": [
10
10
  {
11
11
  "vendor": "Harness Everything",
12
12
  "name": "generate-sbom.js",
13
- "version": "1.2.0"
13
+ "version": "1.2.2"
14
14
  }
15
15
  ],
16
16
  "component": {
17
17
  "type": "application",
18
- "bom-ref": "pkg:npm/harness-everything@1.2.0",
18
+ "bom-ref": "pkg:npm/harness-everything@1.2.2",
19
19
  "name": "harness-everything",
20
- "version": "1.2.0",
21
- "purl": "pkg:npm/harness-everything@1.2.0"
20
+ "version": "1.2.2",
21
+ "purl": "pkg:npm/harness-everything@1.2.2"
22
22
  }
23
23
  },
24
24
  "components": [
@@ -2033,7 +2033,7 @@
2033
2033
  ]
2034
2034
  },
2035
2035
  {
2036
- "ref": "pkg:npm/harness-everything@1.2.0",
2036
+ "ref": "pkg:npm/harness-everything@1.2.2",
2037
2037
  "dependsOn": [
2038
2038
  "pkg:npm/%40commitlint/cli@19.8.1",
2039
2039
  "pkg:npm/%40commitlint/config-conventional@19.8.1",
@@ -7,7 +7,8 @@ const path = require('path');
7
7
  const { isPackagingNoise } = require('./lib/packaging-noise');
8
8
 
9
9
  const ROOT = path.resolve(__dirname, '..');
10
- const SKILLS_ROOT = path.join(ROOT, 'plugins', 'harness-everything', 'skills');
10
+ const PLUGIN_ROOT = path.join(ROOT, 'plugins', 'harness-everything');
11
+ const SKILLS_ROOT = path.join(PLUGIN_ROOT, 'skills');
11
12
  const DEFAULT_OUTPUT = path.join(ROOT, 'dist', 'openai-submission', 'harness-everything-skills.zip');
12
13
 
13
14
  function parseArgs(argv) {
@@ -119,10 +120,13 @@ function build(output) {
119
120
  const relativeFiles = filesUnder(SKILLS_ROOT);
120
121
  if (relativeFiles.length === 0) throw new Error('no packaged skill files found');
121
122
 
122
- const entries = relativeFiles.map(relative => {
123
+ const { extensions, ...identity } = JSON.parse(fs.readFileSync(path.join(PLUGIN_ROOT, 'plugin.json'), 'utf8'));
124
+ const publicManifest = { ...identity, extensions: { 'com.openai': { interface: extensions['com.openai'].interface } } };
125
+ const entries = [{ name: 'plugin.json', data: Buffer.from(`${JSON.stringify(publicManifest, null, 2)}\n`) }];
126
+ for (const relative of relativeFiles) {
123
127
  const data = fs.readFileSync(path.join(SKILLS_ROOT, relative));
124
- return { name: `skills/${relative}`, data };
125
- });
128
+ entries.push({ name: `skills/${relative}`, data });
129
+ }
126
130
  const zip = zipStored(entries);
127
131
  fs.mkdirSync(path.dirname(output), { recursive: true });
128
132
  fs.writeFileSync(output, zip);