P2: plugins harness.test row 65 is red on refactor: first-output.mjs and runner.mjs name a harness in core #1855

Open
opened 2026-11-06 22:51:26 +00:00 by jason.woltje · 0 comments
Owner

Summary

packages/plugins/tests/harness.test.mjs "row 65 no core source outside packages/plugins names a harness, apart from the listed exceptions" fails on origin/refactor. Two core harness lines name a harness, and neither is in the test's exception list. The test has been red since these lines landed.

Found while gating the #1852 fix row. It is not part of that row: the failure is identical on base 3598839e6 and on 03072cc08.

The two lines (read at 3598839e6)

  • packages/harness/src/first-output.mjs:42: if (harness !== 'pi') throw new Error('unknown model event stream'); Added in c7ddc7d31 (fix(harness): mark first streamed model output, #797).
  • packages/harness/src/runner.mjs:406: if (!session.proxyFirstTurn || !['pi', 'claude-code'].includes(session.harness) || /[^\n]/.test(s)) markOutput(s); Added in 478df1cac (fix(harness): preserve adapter text output bytes, #797). At 03072cc08 the same line is runner.mjs:412.

Evidence

  • Base 3598839e6: node --test packages/plugins/tests/harness.test.mjs, 8 pass, 1 fail (row 65). Log: /mnt/storage/scratch/tmp/PKGwA7/base-plugins-harness.log
  • Candidate 542dbe030 (same code as 03072cc08) and 3e03e123f: the same single failure, with the same two lines in actual. Logs: /mnt/storage/scratch/tmp/PKGwA7/gate-readers.log and af-readers.log
  • Node v26.12.1.

Effect

The row 65 rule keeps harness-specific behaviour in packages/plugins so core code doesn't branch on a harness name. These two branches put harness knowledge in core: a new harness gets no first-output stream (first-output throws) and gets different output marking in the runner, unless core is edited again. The red test also hides any later violation in the same file set.

Fix direction

Either move the decision into the harness plugin interface (for example, the plugin exports whether it streams model events, and which first-output reader to use), or, if the owner rules that these two are acceptable, add them to the test's listed exceptions with the reason. The test should pass on refactor after the fix.

## Summary `packages/plugins/tests/harness.test.mjs` "row 65 no core source outside packages/plugins names a harness, apart from the listed exceptions" fails on origin/refactor. Two core harness lines name a harness, and neither is in the test's exception list. The test has been red since these lines landed. Found while gating the #1852 fix row. It is not part of that row: the failure is identical on base 3598839e6 and on 03072cc08. ## The two lines (read at 3598839e6) - `packages/harness/src/first-output.mjs:42`: `if (harness !== 'pi') throw new Error('unknown model event stream');` Added in c7ddc7d31 (fix(harness): mark first streamed model output, #797). - `packages/harness/src/runner.mjs:406`: `if (!session.proxyFirstTurn || !['pi', 'claude-code'].includes(session.harness) || /[^\n]/.test(s)) markOutput(s);` Added in 478df1cac (fix(harness): preserve adapter text output bytes, #797). At 03072cc08 the same line is runner.mjs:412. ## Evidence - Base 3598839e6: `node --test packages/plugins/tests/harness.test.mjs`, 8 pass, 1 fail (row 65). Log: /mnt/storage/scratch/tmp/PKGwA7/base-plugins-harness.log - Candidate 542dbe030 (same code as 03072cc08) and 3e03e123f: the same single failure, with the same two lines in `actual`. Logs: /mnt/storage/scratch/tmp/PKGwA7/gate-readers.log and af-readers.log - Node v26.12.1. ## Effect The row 65 rule keeps harness-specific behaviour in packages/plugins so core code doesn't branch on a harness name. These two branches put harness knowledge in core: a new harness gets no first-output stream (first-output throws) and gets different output marking in the runner, unless core is edited again. The red test also hides any later violation in the same file set. ## Fix direction Either move the decision into the harness plugin interface (for example, the plugin exports whether it streams model events, and which first-output reader to use), or, if the owner rules that these two are acceptable, add them to the test's listed exceptions with the reason. The test should pass on refactor after the fix.
jason.woltje added the bug label 2026-11-06 22:51:26 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1855