harness-everything 0.55.1 → 0.55.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.
@@ -10,7 +10,7 @@
10
10
  "name": "harness-everything",
11
11
  "source": "./",
12
12
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
13
- "version": "0.55.1",
13
+ "version": "0.55.2",
14
14
  "author": {
15
15
  "name": "Miya Daniel"
16
16
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "harness-everything",
3
3
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
4
- "version": "0.55.1",
4
+ "version": "0.55.2",
5
5
  "author": {
6
6
  "name": "Miya Daniel"
7
7
  },
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.55.2](https://github.com/dyphn1/Harness-everything/compare/v0.55.1...v0.55.2) (2026-11-20)
6
+
7
+ ### Bug Fixes
8
+
9
+ * align second-stage evaluation and report contracts ([#491](https://github.com/dyphn1/Harness-everything/issues/491)) ([aae6403](https://github.com/dyphn1/Harness-everything/commit/aae6403aaabd3588b2ff6e4343f07659f1d40be2))
10
+
5
11
  ## [0.55.1](https://github.com/dyphn1/Harness-everything/compare/v0.55.0...v0.55.1) (2026-11-20)
6
12
 
7
13
  ### Bug Fixes
@@ -9,6 +9,10 @@ const { test } = require('node:test');
9
9
 
10
10
  const ROOT = path.resolve(__dirname, '..');
11
11
  const CLI = path.join(ROOT, 'scripts', 'report-writer.js');
12
+ // Existing Codex acceptance example in ci/mechanism-397-host-acceptance.test.js.
13
+ const CODEX_LABEL = { v: 1, validity: 'actionable', tier: 'tier2', intents: ['fix'], workflow: 'iterative-single', skills: [] };
14
+ const labelLine = value => `<!-- harness-label ${JSON.stringify(value)} -->`;
15
+ const VALID_LABEL = labelLine(CODEX_LABEL);
12
16
 
13
17
  function tempDir(t) {
14
18
  const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-report-writer-'));
@@ -122,7 +126,7 @@ test('strips only one valid terminal host label and reports the extraction', t =
122
126
  const dir = tempDir(t);
123
127
  const raw = path.join(dir, 'raw.txt');
124
128
  const output = path.join(dir, 'report.md');
125
- const rawBytes = Buffer.from('Summary\nSTATUS: DONE\n<!-- harness-label {"v":1,"validity":"actionable"} -->\n');
129
+ const rawBytes = Buffer.from(`Summary\nSTATUS: DONE\n${VALID_LABEL}\n`);
126
130
  fs.writeFileSync(raw, rawBytes);
127
131
  const result = run(writeArgs(output, 'DONE', ['--from-codex-output', raw]));
128
132
  assertOk(result);
@@ -152,7 +156,7 @@ test('assembles BLOCKED from a raw body, blank line, and one EOF host label', t
152
156
  const dir = tempDir(t);
153
157
  const raw = path.join(dir, 'raw.txt');
154
158
  const output = path.join(dir, 'report.md');
155
- const rawBytes = Buffer.from('Summary\n\nEvidence\n\n<!-- harness-label {"v":1,"validity":"actionable","tier":"tier2","intents":["test"],"workflow":"iterative-single","skills":[]} -->');
159
+ const rawBytes = Buffer.from(`Summary\n\nEvidence\n\n${labelLine({ ...CODEX_LABEL, intents: ['fix', 'lookup'], contextDependent: false })}`);
156
160
  const body = rawBytes.subarray(0, rawBytes.lastIndexOf(Buffer.from('<!-- harness-label')));
157
161
  fs.writeFileSync(raw, rawBytes);
158
162
 
@@ -208,6 +212,37 @@ test('rejects missing, blank, multiline, or unused outcome reasons without chang
208
212
  }
209
213
  });
210
214
 
215
+ test('464 rejects unrecognized terminal label schemas before touching report or raw evidence', t => {
216
+ const dir = tempDir(t);
217
+ const raw = path.join(dir, 'raw.txt');
218
+ const output = path.join(dir, 'report.md');
219
+ const before = Buffer.from('Keep this report\nSTATUS: DONE\n');
220
+ fs.writeFileSync(output, before);
221
+ const invalid = [
222
+ {},
223
+ { note: 'unrelated' },
224
+ { v: 1 },
225
+ { validity: 'actionable' },
226
+ { ...CODEX_LABEL, v: 2 },
227
+ { ...CODEX_LABEL, validity: 'unknown' },
228
+ { ...CODEX_LABEL, tier: 'tier9' },
229
+ { ...CODEX_LABEL, workflow: 'unknown' },
230
+ { ...CODEX_LABEL, intents: 'fix' },
231
+ { ...CODEX_LABEL, skills: [42] },
232
+ [],
233
+ ];
234
+ for (const [label, reason] of [
235
+ ...invalid.map(value => [labelLine(value), /recognized.*harness-label/]),
236
+ ['<!-- harness-label {bad json} -->', /valid JSON/],
237
+ ]) {
238
+ const rawBytes = Buffer.from(`Summary\nSTATUS: DONE\n${label}\n`);
239
+ fs.writeFileSync(raw, rawBytes);
240
+ assertRejected(run(writeArgs(output, 'DONE', ['--from-codex-output', raw])), reason);
241
+ assert.deepEqual(fs.readFileSync(raw), rawBytes);
242
+ assert.deepEqual(fs.readFileSync(output), before);
243
+ }
244
+ });
245
+
211
246
  test('rejects mismatched, malformed, duplicate, or trailing Codex controls and preserves both files', t => {
212
247
  const dir = tempDir(t);
213
248
  const raw = path.join(dir, 'raw.txt');
@@ -222,13 +257,12 @@ test('rejects mismatched, malformed, duplicate, or trailing Codex controls and p
222
257
  ['Summary\nSTATUS: DONE\nSTATUS: DONE\n', 'DONE'],
223
258
  ['Summary\nSTATUS: DONE\n\n', 'DONE'],
224
259
  ['Summary\nSTATUS: DONE\ntext after status\n', 'DONE'],
225
- ['Summary\nSTATUS: DONE\n\n<!-- harness-label {"v":1} -->', 'DONE'],
226
- ['Summary\nSTATUS: DONE\ntext\n<!-- harness-label {"v":1} -->', 'DONE'],
227
- ['Summary\nSTATUS: DONE\n<!-- harness-label {bad json} -->\n', 'DONE'],
228
- ['Summary\nSTATUS: DONE\n<!-- harness-label [] -->\n', 'DONE'],
229
- ['Summary\nSTATUS: DONE\n<!-- harness-label {"v":1} -->\n<!-- harness-label {"v":1} -->\n', 'DONE'],
230
- ['Summary\nSTATUS: DONE\n<!-- harness-label {"v":1} -->\ntrailing text', 'DONE'],
231
- ['Summary <!-- harness-label {"v":1} -->\nSTATUS: DONE\n', 'DONE'],
260
+ [`Summary\nSTATUS: DONE\n\n${VALID_LABEL}`, 'DONE'],
261
+ [`Summary\nSTATUS: DONE\ntext\n${VALID_LABEL}`, 'DONE'],
262
+ [`Summary\nSTATUS: DONE\n${VALID_LABEL}\n${VALID_LABEL}\n`, 'DONE'],
263
+ [`Summary\nSTATUS: DONE\n${VALID_LABEL}\ntrailing text`, 'DONE'],
264
+ [`Summary ${VALID_LABEL}\nSTATUS: DONE\n`, 'DONE'],
265
+ ['Summary\nSTATUS: DONE\n<!-- unrelated metadata -->\n', 'DONE'],
232
266
  ];
233
267
  for (const [contents, status, ...extra] of invalidRaw) {
234
268
  const rawBytes = Buffer.from(contents);
@@ -14,7 +14,6 @@ function fixture(t, { stage = 'validity', options = ['invalid'], referenceOnly =
14
14
  const versionDir = path.join(dir, 'version');
15
15
  fs.mkdirSync(versionDir);
16
16
  const history = path.join(dir, 'history.jsonl');
17
- const out = path.join(dir, 'out');
18
17
  const writeVersion = version => {
19
18
  const catalogs = { validity: ['invalid'], intent: ['fix'], tier: ['tier1'] };
20
19
  catalogs[stage] = options;
@@ -36,15 +35,19 @@ function fixture(t, { stage = 'validity', options = ['invalid'], referenceOnly =
36
35
  fs.writeFileSync(path.join(versionDir, 'manifest.json'), JSON.stringify(manifest));
37
36
  return manifest;
38
37
  };
39
- function run({ version = 'v1', val, holdout, mutateManifest, expectFailure = false } = {}) {
38
+ function run({ version = 'v1', val, otherVal = {}, holdout, mutateManifest,
39
+ expectFailure = false, out = path.join(dir, 'out') } = {}) {
40
40
  const manifest = writeVersion(version);
41
41
  if (mutateManifest) {
42
42
  mutateManifest(manifest);
43
43
  fs.writeFileSync(path.join(versionDir, 'manifest.json'), JSON.stringify(manifest));
44
44
  }
45
- const valFile = path.join(dir, `${version}-val.jsonl`);
46
- fs.writeFileSync(valFile, val.map(row => JSON.stringify(row)).join('\n') + '\n');
47
- const args = [cli, '--version', version, '--version-dir', versionDir, '--val-scores', `${stage}=${valFile}`, '--history', history, '--out', out];
45
+ const args = [cli, '--version', version, '--version-dir', versionDir, '--history', history, '--out', out];
46
+ for (const [name, rows] of Object.entries({ [stage]: val, ...otherVal })) {
47
+ const file = path.join(dir, `${version}-${name}-val.jsonl`);
48
+ fs.writeFileSync(file, rows.map(row => JSON.stringify(row)).join('\n') + '\n');
49
+ args.push('--val-scores', `${name}=${file}`);
50
+ }
48
51
  if (holdout) {
49
52
  const holdoutFile = path.join(dir, `${version}-holdout.jsonl`);
50
53
  fs.writeFileSync(holdoutFile, holdout.map(row => JSON.stringify(row)).join('\n') + '\n');
@@ -52,7 +55,9 @@ function fixture(t, { stage = 'validity', options = ['invalid'], referenceOnly =
52
55
  }
53
56
  const child = spawnSync(process.execPath, args, { cwd: root, encoding: 'utf8', env: { ...process.env, HARNESS_SYSTEM_ONE_HOME: dir } });
54
57
  if (expectFailure) {
55
- assert.notEqual(child.status, 0, child.stdout);
58
+ assert.notEqual(child.status, 0, JSON.stringify({ stdout: child.stdout,
59
+ compared: fs.existsSync(path.join(out, 'trend.json'))
60
+ ? JSON.parse(fs.readFileSync(path.join(out, 'trend.json'), 'utf8')).compared : null }));
56
61
  return child;
57
62
  }
58
63
  assert.equal(child.status, 0, child.stderr || child.stdout);
@@ -122,6 +127,42 @@ test('one successful run appends exactly one history line', t => {
122
127
  assert.deepEqual(JSON.parse(lines[1]), second.curves);
123
128
  });
124
129
 
130
+ test('458 rejects a recorded version in a fresh cycle before writing artifacts', t => {
131
+ const f = fixture(t);
132
+ const original = path.join(f.dir, 'original-cycle');
133
+ const fresh = path.join(f.dir, 'fresh-cycle');
134
+ fs.mkdirSync(fresh);
135
+ const scores = {
136
+ val: validityRows([['invalid', 0.8], ['actionable', 0.2]]),
137
+ otherVal: {
138
+ intent: [{ id: 'i0', gold: ['fix'], scores: { fix: 0.8 } }],
139
+ tier: [{ id: 't0', gold: 'tier1', scores: { tier1: 0.8 } }],
140
+ },
141
+ };
142
+ f.run({ version: 'v0', ...scores, out: original });
143
+ assert.deepEqual(f.run({ version: 'v1', ...scores, out: original }).trend.compared, ['v0', 'v1']);
144
+ const saved = ['curves.json', 'trend.json'].map(name => fs.readFileSync(path.join(original, name)));
145
+ const history = fs.readFileSync(f.history);
146
+
147
+ const refusal = f.run({ version: 'v1', ...scores, out: fresh, expectFailure: true });
148
+ assert.equal(refusal.status, 1, refusal.stderr);
149
+ assert.match(refusal.stderr, /version already recorded/);
150
+ assert.deepEqual(fs.readdirSync(fresh), []);
151
+
152
+ const resumed = spawnSync(process.execPath, [cli, '--version', 'v1', '--version-dir', path.join(f.dir, 'version'),
153
+ '--history', f.history, '--out', original, '--resume-curves', path.join(original, 'curves.json')],
154
+ { cwd: root, encoding: 'utf8', env: { ...process.env, HARNESS_SYSTEM_ONE_HOME: f.dir } });
155
+ assert.equal(resumed.status, 0, resumed.stderr);
156
+ assert.deepEqual(JSON.parse(resumed.stdout), { resumed: true, version: 'v1' });
157
+ assert.deepEqual(fs.readFileSync(f.history), history);
158
+ assert.deepEqual(['curves.json', 'trend.json'].map(name => fs.readFileSync(path.join(original, name))), saved);
159
+
160
+ assert.deepEqual(f.run({ version: 'v2', ...scores, out: fresh }).trend.compared, ['v0', 'v1', 'v2']);
161
+ const after = fs.readFileSync(f.history);
162
+ assert.deepEqual(after.subarray(0, history.length), history);
163
+ assert.deepEqual(after.toString().trimEnd().split('\n').map(line => JSON.parse(line).version), ['v0', 'v1', 'v2']);
164
+ });
165
+
125
166
  test('446 H2: empty, LF, and CRLF histories append readable rows without rewriting prior bytes', t => {
126
167
  const f = fixture(t);
127
168
  const first = f.run({ version: 'v0', val: validityRows([['invalid', 0.8], ['actionable', 0.2]]) });
@@ -7,7 +7,8 @@ const path = require('node:path');
7
7
  const { createHash } = require('node:crypto');
8
8
  const { spawnSync } = require('node:child_process');
9
9
  const install = require('../harness-everything/scripts/system-one/install');
10
- const { PINNED_CUA_S1_REVISION } = require('../harness-everything/scripts/system-one/provider');
10
+ const { PINNED_CUA_S1_REVISION, readActive } = require('../harness-everything/scripts/system-one/provider');
11
+ const { validateVersionManifest } = require('../harness-everything/scripts/system-one/manifest');
11
12
  const script = path.join(__dirname, '../harness-everything/scripts/system-one/install.js');
12
13
  const sha = buf => createHash('sha256').update(buf).digest('hex');
13
14
  const stages = ['validity', 'intent', 'tier'];
@@ -17,17 +18,17 @@ function tempDir(prefix) {
17
18
  return fs.realpathSync.native(dir);
18
19
  }
19
20
 
20
- function makeRepo(root, version = 'v1') {
21
+ function makeRepo(root, version = 'v1', weightsExtension = '.weights') {
21
22
  const checkpoint = path.join(root, 'models', 'cua-s1', version);
22
23
  fs.mkdirSync(checkpoint, { recursive: true });
23
24
  const manifest = { schemaVersion: 1, version, createdAt: '2026-11-14T00:00:00.000Z', stages: {}, evaluation: 'evaluation.json' };
24
25
  for (const stage of stages) {
25
26
  const weights = Buffer.from(`${stage}-weights`);
26
27
  const config = Buffer.from(JSON.stringify({ stage, format: 'fixture' }));
27
- fs.writeFileSync(path.join(checkpoint, `${stage}.weights`), weights);
28
+ fs.writeFileSync(path.join(checkpoint, `${stage}${weightsExtension}`), weights);
28
29
  fs.writeFileSync(path.join(checkpoint, `${stage}.json`), config);
29
30
  manifest.stages[stage] = {
30
- weights: `${stage}.weights`, config: `${stage}.json`, sha256: sha(weights),
31
+ weights: `${stage}${weightsExtension}`, config: `${stage}.json`, sha256: sha(weights),
31
32
  options: [`${stage}-a`, `${stage}-b`], thresholds: { [`${stage}-a`]: 0.5, [`${stage}-b`]: 0.6 },
32
33
  };
33
34
  }
@@ -103,6 +104,41 @@ test('install accepts referenceOnly only when its option threshold is one', () =
103
104
  } finally { remove(root, home); }
104
105
  });
105
106
 
107
+ test('447 rejects nested live stage paths at install while flat stages and nested evaluation still work', t => {
108
+ const root = tempDir('harness-s1-repo-');
109
+ const home = tempDir('harness-s1-home-');
110
+ t.after(() => remove(root, home));
111
+ const source = makeRepo(root, 'v1', '.safetensors');
112
+ const manifestFile = path.join(source, 'manifest.json');
113
+ const manifest = JSON.parse(fs.readFileSync(manifestFile, 'utf8'));
114
+ const artifacts = path.join(source, 'artifacts');
115
+ fs.mkdirSync(artifacts);
116
+ fs.renameSync(path.join(source, manifest.evaluation), path.join(artifacts, manifest.evaluation));
117
+ manifest.evaluation = 'artifacts/evaluation.json';
118
+
119
+ for (const field of ['weights', 'config']) {
120
+ const name = manifest.stages.intent[field];
121
+ fs.copyFileSync(path.join(source, name), path.join(artifacts, name));
122
+ const nested = structuredClone(manifest);
123
+ nested.stages.intent[field] = `artifacts/${name}`;
124
+ fs.writeFileSync(manifestFile, JSON.stringify(nested));
125
+ assert.throws(() => validateVersionManifest(nested), /intent weights and config must be flat filenames/);
126
+ assert.throws(() => install.installVersion(root, 'v1', home), /intent weights and config must be flat filenames/);
127
+ assert.equal(fs.existsSync(path.join(home, 'versions')), false);
128
+ assert.equal(fs.existsSync(path.join(home, 'active.json')), false);
129
+ }
130
+
131
+ fs.writeFileSync(manifestFile, JSON.stringify(manifest));
132
+ assert.equal(validateVersionManifest(manifest), manifest);
133
+ const installed = install.installVersion(root, 'v1', home);
134
+ install.activate('v1', home);
135
+ const active = readActive({ HARNESS_SYSTEM_ONE_HOME: home });
136
+ assert.equal(active?.version, 'v1');
137
+ assert.equal(active.stages.intent.weightsPath, path.join(installed.dir, manifest.stages.intent.weights));
138
+ assert.equal(active.stages.intent.configPath, path.join(installed.dir, manifest.stages.intent.config));
139
+ assert.equal(fs.readFileSync(path.join(installed.dir, manifest.evaluation), 'utf8'), '{"samples":2}');
140
+ });
141
+
106
142
  test('S1-I03 activation and rollback round-trip through the previous pointer', () => {
107
143
  const root = tempDir('harness-s1-repo-'); const home = tempDir('harness-s1-home-');
108
144
  try {
@@ -77,7 +77,7 @@ The same subcommands and flags work with `node scripts/report-writer.js`.
77
77
  | Scope | Operate on explicitly designated report output only; do not rewrite unrelated files, judge semantic success, touch the Ledger, or automatically change permissions |
78
78
  | Revision | Re-run `write` using the edited body + true status; never mutate the terminal report with ordinary append commands |
79
79
 
80
- In `--from-codex-output` mode, the writer can remove one terminal harness-label comment containing a JSON object. If the raw input already includes a STATUS line, it must match the requested status and be terminal or immediately precede the label. Invalid input returns nonzero and preserves the raw file.
80
+ In `--from-codex-output` mode, the writer can remove one terminal comment that conforms to the [Observations v1 harness-label contract](../../system-one-observations.md#label-line). If the raw input already includes a STATUS line, it must match the requested status and be terminal or immediately precede the label. Invalid input returns nonzero and preserves the raw file.
81
81
 
82
82
  ## Interaction with other Actions and existing facilities
83
83
 
@@ -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.0
7
+ version: 0.55.2
8
8
  ---
9
9
 
10
10
  # Harness Everything
@@ -38,6 +38,7 @@ function validateVersionManifest(manifest, expectedVersion) {
38
38
  || Object.values(stage.thresholds).some(value => typeof value !== 'number' || !Number.isFinite(value) || value < 0 || value > 1)) {
39
39
  fail(`malformed ${name} stage`);
40
40
  }
41
+ if (stage.weights.includes('/') || stage.config.includes('/')) fail(`${name} weights and config must be flat filenames`);
41
42
  if (Object.hasOwn(stage, 'referenceOnly')
42
43
  && (!Array.isArray(stage.referenceOnly) || new Set(stage.referenceOnly).size !== stage.referenceOnly.length
43
44
  || stage.referenceOnly.some(id => !stage.options.includes(id) || stage.thresholds[id] !== 1))) {
@@ -692,7 +692,7 @@ function handle(payload, env = process.env) {
692
692
  }
693
693
 
694
694
  module.exports = {
695
- INTENTS, TIERS, STRATEGIES, RETENTION_MS, PREVIOUS_BYTES, enabled, storeRoot, redact, parseLabelLine, stripLabels, tailBytes, sha, normalizeSystemOne, classifyCommand, labelTier, contradictions,
695
+ INTENTS, TIERS, STRATEGIES, RETENTION_MS, PREVIOUS_BYTES, enabled, storeRoot, redact, validLabel, parseLabelLine, stripLabels, tailBytes, sha, normalizeSystemOne, classifyCommand, labelTier, contradictions,
696
696
  normalizeTerms, transcriptMessage, recordTool, emptyBehavior, mergeBehavior, toolFailed, handle, readJson, appendRecord, appendRecordDetailed, observationTurnMatch, findObservationTurnMatch, markSessionBackfillBehaviorUnobserved,
697
697
  expired, recordText, sweep,
698
698
  };
@@ -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": "0.55.1",
4
+ "version": "0.55.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": "0.55.1",
3
+ "version": "0.55.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": "0.55.1",
3
+ "version": "0.55.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",
@@ -692,7 +692,7 @@ function handle(payload, env = process.env) {
692
692
  }
693
693
 
694
694
  module.exports = {
695
- INTENTS, TIERS, STRATEGIES, RETENTION_MS, PREVIOUS_BYTES, enabled, storeRoot, redact, parseLabelLine, stripLabels, tailBytes, sha, normalizeSystemOne, classifyCommand, labelTier, contradictions,
695
+ INTENTS, TIERS, STRATEGIES, RETENTION_MS, PREVIOUS_BYTES, enabled, storeRoot, redact, validLabel, parseLabelLine, stripLabels, tailBytes, sha, normalizeSystemOne, classifyCommand, labelTier, contradictions,
696
696
  normalizeTerms, transcriptMessage, recordTool, emptyBehavior, mergeBehavior, toolFailed, handle, readJson, appendRecord, appendRecordDetailed, observationTurnMatch, findObservationTurnMatch, markSessionBackfillBehaviorUnobserved,
697
697
  expired, recordText, sweep,
698
698
  };
@@ -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": "0.55.1",
4
+ "version": "0.55.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.0
7
+ version: 0.55.2
8
8
  ---
9
9
 
10
10
  # Harness Everything
@@ -38,6 +38,7 @@ function validateVersionManifest(manifest, expectedVersion) {
38
38
  || Object.values(stage.thresholds).some(value => typeof value !== 'number' || !Number.isFinite(value) || value < 0 || value > 1)) {
39
39
  fail(`malformed ${name} stage`);
40
40
  }
41
+ if (stage.weights.includes('/') || stage.config.includes('/')) fail(`${name} weights and config must be flat filenames`);
41
42
  if (Object.hasOwn(stage, 'referenceOnly')
42
43
  && (!Array.isArray(stage.referenceOnly) || new Set(stage.referenceOnly).size !== stage.referenceOnly.length
43
44
  || stage.referenceOnly.some(id => !stage.options.includes(id) || stage.thresholds[id] !== 1))) {
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:dbc90d9f-0498-595b-b8b6-338a5bf5e7d8",
5
+ "serialNumber": "urn:uuid:36aef0a1-619e-58c5-a9d5-71ee3930e0c7",
6
6
  "version": 1,
7
7
  "metadata": {
8
- "timestamp": "2026-11-20T09:32:23.222Z",
8
+ "timestamp": "2026-11-20T12:08:56.300Z",
9
9
  "tools": [
10
10
  {
11
11
  "vendor": "Harness Everything",
12
12
  "name": "generate-sbom.js",
13
- "version": "0.55.1"
13
+ "version": "0.55.2"
14
14
  }
15
15
  ],
16
16
  "component": {
17
17
  "type": "application",
18
- "bom-ref": "pkg:npm/harness-everything@0.55.1",
18
+ "bom-ref": "pkg:npm/harness-everything@0.55.2",
19
19
  "name": "harness-everything",
20
- "version": "0.55.1",
21
- "purl": "pkg:npm/harness-everything@0.55.1"
20
+ "version": "0.55.2",
21
+ "purl": "pkg:npm/harness-everything@0.55.2"
22
22
  }
23
23
  },
24
24
  "components": [
@@ -2033,7 +2033,7 @@
2033
2033
  ]
2034
2034
  },
2035
2035
  {
2036
- "ref": "pkg:npm/harness-everything@0.55.1",
2036
+ "ref": "pkg:npm/harness-everything@0.55.2",
2037
2037
  "dependsOn": [
2038
2038
  "pkg:npm/%40commitlint/cli@19.8.1",
2039
2039
  "pkg:npm/%40commitlint/config-conventional@19.8.1",
@@ -4,6 +4,7 @@
4
4
  const crypto = require('node:crypto');
5
5
  const fs = require('node:fs');
6
6
  const path = require('node:path');
7
+ const { validLabel } = require('../hooks/scripts/lib/observations');
7
8
 
8
9
  const USAGE = 'usage: report-writer write --output <path> --status <DONE|BLOCKED|0|nonzero-int> (--body-file <path>|--context <text>|--from-codex-output <path>) [--reason <text>|--error <text>...] | report-writer check --file <path>';
9
10
  const WRITE_OPTIONS = new Set(['--output', '--status', '--reason', '--error', '--body-file', '--context', '--from-codex-output']);
@@ -109,7 +110,7 @@ function parseHostLabel(line) {
109
110
  } catch {
110
111
  error('terminal host label must contain valid JSON');
111
112
  }
112
- if (!value || typeof value !== 'object' || Array.isArray(value)) error('terminal host label JSON must be an object');
113
+ if (!validLabel(value)) error('terminal host label must use the recognized harness-label schema');
113
114
  }
114
115
 
115
116
  function extractCodexBody(raw, expectedStatus) {
@@ -10,6 +10,7 @@ const { assertPrivateHistoryFile, appendPrivateHistory } = require('./system-one
10
10
  const STAGE_SET = new Set(STAGES);
11
11
  const EPSILON = 1e-12;
12
12
  const LOG_EPSILON = Number.EPSILON;
13
+ const VERSION_ALREADY_RECORDED = 'version already recorded; resume with the original cycle artifacts or use a new version';
13
14
  const fail = () => { throw new TypeError('invalid-system-one-curves-input'); };
14
15
  const isObject = value => value !== null && typeof value === 'object' && !Array.isArray(value);
15
16
  const isText = value => typeof value === 'string' && value.trim().length > 0;
@@ -442,15 +443,15 @@ function run(argv) {
442
443
  }
443
444
  if (Object.keys(holdoutFiles).length && Object.keys(holdoutFiles).length !== Object.keys(valFiles).length) fail();
444
445
  const history = readHistory(args.history);
446
+ if (history.some(row => row.version === args.version)) throw new TypeError(VERSION_ALREADY_RECORDED);
445
447
  const floor = assessFloor(Object.keys(holdoutMetrics).length ? holdoutMetrics : null, history);
446
448
  const curves = { schemaVersion: 1, version: args.version, createdAt: new Date().toISOString(), stages, floor };
447
- const existing = assertVersionReusable(history, curves);
448
449
  validateBaselineReferences(curves, history);
449
450
  const trend = decideTrend(curves, history, floor);
450
451
  fs.mkdirSync(args.out, { recursive: true });
451
452
  fs.writeFileSync(path.join(args.out, 'curves.json'), `${JSON.stringify(curves, null, 2)}\n`);
452
453
  fs.writeFileSync(path.join(args.out, 'trend.json'), `${JSON.stringify(trend, null, 2)}\n`);
453
- if (!existing) appendHistoryRow(args.history, history, curves);
454
+ appendHistoryRow(args.history, history, curves);
454
455
  const summary = Object.fromEntries(Object.entries(stages).map(([stage, value]) => [stage, {
455
456
  rows: readJsonl(valFiles[stage]).length,
456
457
  logLoss: value.logLoss,
@@ -463,8 +464,10 @@ function run(argv) {
463
464
  }
464
465
 
465
466
  if (require.main === module) {
466
- try { run(process.argv.slice(2)); } catch (_) {
467
- console.error('system-one-curves: invalid arguments, manifest, history, or score input');
467
+ try { run(process.argv.slice(2)); } catch (error) {
468
+ const message = error?.message === VERSION_ALREADY_RECORDED ? VERSION_ALREADY_RECORDED
469
+ : 'invalid arguments, manifest, history, or score input';
470
+ console.error(`system-one-curves: ${message}`);
468
471
  process.exitCode = 1;
469
472
  }
470
473
  }