Summary
scripts/perf-harness.js can emit apparently completed and scored reports even when its required validation and test phases failed. It also parses the current Node test output with an incompatible OK/WARN line heuristic, producing zero tests and zero throughput.
In the 12-node diagnostic exhibition fleet-12-node-preview-20260722T214739+0900, all 12 reports were structurally generated, but every report recorded:
- parsed test count:
0
- parsed validation pass/fail counts:
0/0
- continued scored-value generation despite the required phases failing early
The results were therefore quarantined from ranking and publication.
Current behavior
phaseValidation() runs node scripts/validate.js all-v2 2>&1 || true.
phaseTests() runs npm test 2>&1 || true.
runCommand() already returns exitCode, but both phase functions discard the true child status because the shell expression returns zero.
- Test counting only matches lines beginning with
OK or WARN, while the current node --test TAP summary uses fields such as # tests, # pass, and # fail.
raw_test_failed is hard-coded to 0.
- Scored values and report output are still generated with no explicit invalid/quarantined phase state.
Expected behavior
Required phase failure must be visible, machine-readable, and ranking-blocking. A failed or unparseable test phase must never look like a fast successful benchmark.
Implementation direction
- Remove shell-level
|| true from required validation/test phases and use runCommand().exitCode directly.
- Record a phase result contract containing status, exit code, duration, parsed counts, and a bounded redacted diagnostic.
- Parse a stable, explicitly selected test reporter (for example Node TAP summary fields), or consume a structured reporter if supported by the repository's Node floor.
- Treat output/exit-code disagreement as invalid, not successful.
- Mark the iteration/report invalid or quarantined when a required phase fails or cannot be parsed.
- Prevent invalid iterations from receiving normal efficiency/execution scores or entering
harness-to-packet/scoreboard publication as valid packets.
Acceptance criteria
Required tests
- Successful TAP/structured reporter fixture.
- Non-zero child exit fixture.
- Exit-zero but malformed/missing summary fixture.
- Validation import crash fixture.
- Multi-iteration mixed success/failure aggregation fixture.
- Packet bridge/publication rejection for an invalid performance report.
Verification
npm test
node scripts/perf-harness.js --iterations 3 --json --validate
node scripts/harness-to-packet.js results/ --agent-id perf-integrity-check
node scripts/score.js aggregate
The final two commands must not publish a failed-phase report as valid.
Safety boundary
Source-only local subprocesses and sanitized fixtures. No credentials, live providers, remote-node mutation, service restart, or leaderboard publication.
Summary
scripts/perf-harness.jscan emit apparently completed and scored reports even when its required validation and test phases failed. It also parses the current Node test output with an incompatibleOK/WARNline heuristic, producing zero tests and zero throughput.In the 12-node diagnostic exhibition
fleet-12-node-preview-20260722T214739+0900, all 12 reports were structurally generated, but every report recorded:00/0The results were therefore quarantined from ranking and publication.
Current behavior
phaseValidation()runsnode scripts/validate.js all-v2 2>&1 || true.phaseTests()runsnpm test 2>&1 || true.runCommand()already returnsexitCode, but both phase functions discard the true child status because the shell expression returns zero.OKorWARN, while the currentnode --testTAP summary uses fields such as# tests,# pass, and# fail.raw_test_failedis hard-coded to0.Expected behavior
Required phase failure must be visible, machine-readable, and ranking-blocking. A failed or unparseable test phase must never look like a fast successful benchmark.
Implementation direction
|| truefrom required validation/test phases and userunCommand().exitCodedirectly.harness-to-packet/scoreboard publication as valid packets.Acceptance criteria
raw_test_count, exact pass/fail counts, and exit code0.raw_failed_count: 0plus a normal valid score.harness-to-packetrefuses, quarantines, or marks non-publishable any report with failed required phases.Required tests
Verification
npm test node scripts/perf-harness.js --iterations 3 --json --validate node scripts/harness-to-packet.js results/ --agent-id perf-integrity-check node scripts/score.js aggregateThe final two commands must not publish a failed-phase report as valid.
Safety boundary
Source-only local subprocesses and sanitized fixtures. No credentials, live providers, remote-node mutation, service restart, or leaderboard publication.