fix(#407): commensurable term-fidelity byte meta + retain per-attempt artifacts - #410
Conversation
…tempt artifacts Two harness debts from the term-fidelity program. (1) meta bytes/offset incommensurable (exact-2.0 artifact). `quiet.activity.bytes` (client-received UTF-8 bytes of broker:pty-chunk strings, from probe install) and `brokerOffset` (raw PTY bytes from worker start) were dropped into meta as a bare pair that read as an exact-2.0 "double delivery" signal in 5/5 codex bundles — proven NOT to be double delivery (headless probe: client/offset = 1.0000; one IPC send per worker_stream event). New dependency-free `byte-accounting.ts` derives a self-documenting `byteAccounting` block: each figure declares its baseline + unit, and `clientToBrokerByteRatio` is computed on a shared agent-start baseline (probe installs before spawn) so ~1.0 is the meaningful one-to-one value. An embedded `note` states a near-integer ratio is a derivation artifact, never a mechanism claim. Unit-tested (5 cases: 1.0, rounding, the 2.0 forensic case + note, null-on-no-offset, divide-by-zero guard). (2) retry-then-pass erased first-attempt artifacts. The failed first attempt is exactly the REAL divergence event we need. Divergence + telemetry bundles now write under `attempt-<retry>/` (threaded from test.info().retry) so a retry never overwrites prior-attempt data; playwright config adds `preserveOutput: 'always'` so Playwright's own error-context/trace for a failed attempt survive a later pass. README updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38f92d56ee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const ratio = | ||
| snapshotOffset !== null && snapshotOffset > 0 | ||
| ? round4(input.clientBytesReceived / snapshotOffset) |
There was a problem hiding this comment.
Normalize the counters before calling them commensurable
In the exact-2.0 scenario motivating this change, this still divides the unchanged quiet.activity.bytes by the unchanged full broker.offset; the parent harness already installed the activity probe before spawnRealAgent, so wrapping those values introduces no new shared-baseline adjustment. Moreover, re-encoded decoded-string bytes are not necessarily equal to raw PTY bytes. Consequently an existing 2.0 result remains 2.0 while the metadata marks it commensurable and describes it as an artifact, potentially obscuring an actual duplicate or missing-delivery signal. Record comparable offset/delta metadata from the received events or explicitly mark this ratio non-commensurable.
Useful? React with 👍 / 👎.
Closes #407. Two harness debts from the term-fidelity program.
(1) meta bytes/offset incommensurable — the exact-2.0 artifact
quiet.activity.bytesandbrokerOffsetread exactly 2.0 apart in 5/5 codex bundles. That was proven NOT to be double delivery (headless probe: client bytes / snapshot offset = 1.0000; BrokerManager does one IPC send perworker_streamevent). The 2.0 was a derivation artifact — the two meta fields measure different things on different baselines:quiet.activity.bytesbroker:pty-chunkstring bytesbrokerOffsetFix: new dependency-free
tests/term-fidelity/byte-accounting.tsderives a self-documentingbyteAccountingblock that replaces the bare pair. Each figure declares its baseline + unit, andclientToBrokerByteRatiois computed on a shared agent-start baseline (the probe is installed before spawn) so ~1.0 is the meaningful "one-to-one delivery" value. It carries an embeddednote:So the exact-2.0 can no longer be misread. Validated with the client-bytes-vs-snapshot-offset probe pattern (ratio derivation) and unit-tested.
(2) retry-then-pass erased first-attempt artifacts
Playwright retry-then-pass cleaned error-context/trace, and the harness wrote divergence bundles to a fixed
test-results/term-fidelity/<cli>/<workload>/path, so a retry overwrote the diverging first attempt (which twice was a REAL divergence event) — unexaminable afterward.Fix:
attempt-<retry>/(retry index threaded fromtest.info().retry→launchFidelityHarness→harness.attempt→oracle.ts), so a retry never overwrites a prior attempt.playwright.term-fidelity.config.ts:preserveOutput: 'always'+ documentedtrace: 'retain-on-failure'so Playwright's own error-context/trace for a failed attempt survive a later passing attempt.byteAccounting.Verification
npx vitest run tests/term-fidelity/byte-accounting.test.ts→ 5 passed (1.0 ratio, 4dp rounding, the 2.0 forensic case + note, null-on-no-offset, divide-by-zero guard).npx tsc --noEmit -p tests/term-fidelity/tsconfig.json→ clean.nodeproject via atests/term-fidelity/**/*.test.tsinclude; PlaywrighttestMatchis unchanged so it is not run as a browser test.Note: the full Electron matrix (
npm run test:fidelity/ real agents, token burn) was not run here — these are harness-instrumentation + config changes with no product-runtime surface; the pure derivation and typechecks cover them. Flag if you want me to burn a real matrix run for end-to-end confirmation.🤖 Generated with Claude Code