Skip to content

test(sources): Compare two finished-build routes over one sealed input - #5334

Merged
Sinity merged 3 commits into
masterfrom
fix/harness-workload-batch
Sep 21, 2026
Merged

Sinity merged 3 commits into
masterfrom
fix/harness-workload-batch

Conversation

@Sinity

@Sinity Sinity commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

Two beads in one PR. jytge gets a working two-arm finished-build equivalence
comparison; 1xc.14.1's pilot moves onto the declared artifact owner. Along the
way, a 30-second production stall was measured and attributed.

jytge — the comparator had zero consumers and was broken

tests/unit/sources/test_finished_build_equivalence.py runs two production
shapes of backfill_historical_revision_evidence over one sealed 8-raw input:
retained active-index (the RawObservationPublisher.publish shape) versus owned
inactive generation + sealed session shard (the cold-build shape). Both arms
reach canonical logical digest 36ce5814f06a.

The refutation that made this possible: that comparator had zero consumers
at head, and compared_table_census() refused outright because #5312 added
session_usage_rollup_bindings with no classification — so every
capture_finished_build_output call, including the sealed 516-raw benchmark, was
red between f6f899c and 75f5812. #5315 landed the identical classification an
hour later; theirs was kept on rebase.

FinishedBuildResourceProbe brackets route + terminal reads, and capture asserts
FTS readiness and zero open debt before any receipt value is produced.

Anti-vacuity executed in-test: one unresolved convergence_debt row makes
capture raise "convergence debt remains"; one deleted blocks row makes the
comparator raise "derived table blocks differs".

⚠ A 30-second production stall, attributed not corrected

The fresh-generation+shard arm spends 30.02 s of its 30.15 s in
spill_prefetch.decode_concurrent at 0.24 s CPU — one reparse burning a full
SQLite busy_timeout.

Probe, three runs: 7 raws AUTO 30.04 s; 8 raws AUTO 30.05 s; 8 raws with
pipeline_decode=False 0.10 s with byte-identical output.

This 30 s sits inside the sealed 516-raw benchmark's measured interval. The
fix belongs in sources/revision_backfill.py (prefetcher index connection versus
the EXCLUSIVE-locked bulk-build writer), outside this write scope. Filed
separately.

A receipt bug found by the same investigation is fixed here: stage_timings_s
mixed counters with durations, so spill_prefetch.reparse_hits=8.0 was reported
as the dominant "8-second phase". Counters are now excluded by name, and any key
exceeding the route total is refused.

1xc.14.1 — the pilot now consumes the declared owner

pilot_artifact acquires through build_integration_archive(), which had zero
consumers
while the GC reachability entry default/integration protected a key
nothing built. The private cache root and the in-fixture double build are deleted.

Measured from the executed mutation receipt: the pre-migration private-cache shape
cost construction_seconds=1.176649 and write_bytes=10,096,640 per module
acquisition and could never hit the published artifact.

A byte-generation gap is closed: generation previously ran inside a module fixture
before any guard was armed. One cold acquisition now runs inside
sqlite_work_counter with zero connections on any tier.

A dedup was considered and refuted: folding the pilot's lease/clone fixtures
into corpus_fixtures-owned factories would have made them function-scoped, and
every lease acquisition runs _validate_artifact_with_retry (re-SHA256 of every
file plus five quick_checks). That "dedup" would have added a full artifact
revalidation per test — exactly the duplicated work AC7 targets.

Verification

  • test_finished_build_equivalence.py — 4 passed in 91.10s
  • test_finished_build_measurement.py -k "not declared_scale" — 2 passed (the
    sealed benchmark still binds its capability boundary after helpers moved)
  • test_resource_pilot.py — 13 passed in 28.44s
  • test_integration_profile.py — 8 passed (the recipe owner the pilot now consumes)
  • Anti-vacuity executed: restoring the private cache root and opening one index
    tier during generation → 2 failed, as designed
  • devtools verify --quick — exit 0, no FAILED lines
  • devtools render all --check — exit 0, grep -ci 'out of sync' = 0
  • devtools schema closure — all five edited files out

Residuals

  • jytge stays open: this is preparable evidence, not final archive
    acceptance. The sealed 516-raw arm needs a dedicated host window — and should be
    re-measured after the prefetcher stall is fixed, or 30 s gets baked into the
    first committed baseline.
  • 1xc.14.1 AC5 (payload tails, ordering/revision relations, wider element kinds)
    and lab-AC4 (retiring other bespoke builders) are untouched.
  • Corrected write scopes: 1xc.14.1's declared globs are far wider than
    needed — actual is tests/infra/pilot_resources.py and
    tests/unit/scenarios/test_resource_pilot.py only. jytge's declared
    tests/unit/sources/test_live_batch.py does not exist at head.
  • The new equivalence file runs 36–91 s, dominated by that 30 s stall. It drops to
    a few seconds once fixed; no tolerance or timing assertion encodes the defect.

Advances polylogue-jytge and polylogue-1xc.14.1.

🤖 Generated with Claude Code

https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq

Sinity and others added 3 commits September 21, 2026 07:43
…c input

polylogue-jytge's finished-build harness landed with no comparison: the
sealed 516-raw measurement runs one selected arm and declares the rest
non-cells, so `assert_finished_builds_equivalent` had zero consumers and its
exhaustive index-table census had drifted -- index DDL v105 added
`session_usage_rollup_bindings`, which `compared_table_census()` refuses as
unclassified, making every `capture_finished_build_output` call red at head.

Classify that table as fully comparable (session_id, input_binding and
recipe_version are deterministic derived facts), lift the sealed-input,
arm-clone and work-identity helpers out of the benchmark into
tests/infra/reindex_differential.py, and add a synthetic-scale two-arm
comparison: the retained active-index replay that RawObservationPublisher
drives, against the owned inactive generation with the sealed session-shard
transport that a cold build drives, both through
`backfill_historical_revision_evidence` over one sealed 8-raw input.

Both arms reach an identical canonical logical digest. The receipt records
whole-operation elapsed, CPU, RSS, storage bytes and the dominant phase per
arm; the ledger's counters (spill_prefetch.reparse_hits et al.) are excluded
from that attribution by name, and any other key claiming more time than the
route's own total is refused rather than reported.

Verification: devtools test tests/unit/sources/test_finished_build_equivalence.py
-- 4 passed in 36.62s; devtools test tests/benchmarks/test_finished_build_measurement.py
-k "not declared_scale" -- 2 passed. Anti-vacuity executed in-test: an
unresolved convergence_debt row and one deleted blocks row each turn the
comparison red.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq
polylogue-1xc.14.1's substrate already existed; the residual was that the
pilot did not use it. `pilot_artifact` built into a per-module private cache
root, so every module run reconstructed the same recipe (measured at the
pre-migration shape: 1.18 s and 10.1 MB of write bytes per acquisition) and
could never hit the published artifact -- while `build_integration_archive`,
the declared owner of that recipe, had no consumer at all and the cache GC's
`default/integration` reachability entry protected a key nothing built.

Acquire through that owner instead, and move the reuse assertion out of the
fixture body into a test that states what reuse means: the pilot's key is the
declared `default/integration` reachability key, its artifact is published
under the shared cache's `artifacts/` root, and a second acquisition returns
the same root and manifest id.

Add the acquisition-side guard the pilot was missing: the parser-only
contract was asserted for the parse but not for byte generation, which ran
inside a module fixture before any guard was armed. `build_pilot_provider_packages`
is now callable directly, and one cold acquisition runs inside
`sqlite_work_counter` with zero connections on any tier.

Verification: devtools test tests/unit/scenarios/test_resource_pilot.py --
13 passed in 8.44s (27.43s on the run that had to publish the shared
artifact); devtools test tests/unit/infra/test_integration_profile.py -- 8
passed. Anti-vacuity executed: restoring the private cache root fails the
reuse test, and opening one index tier during generation fails the
acquisition test (2 failed, 11 deselected).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq
#5315 landed the measurement-receipt destination while this branch was in
flight. Emit the two-arm comparison through `emit_receipt` instead of
stdout, for the reason that PR gives: a printed receipt is evidence only for
whoever was watching the run.

Verification: devtools test tests/unit/sources/test_finished_build_equivalence.py
-- 4 passed in 91.10s; the emitted
.cache/measurements/finished-build-equivalence-synthetic.json records both
arms reaching canonical digest 36ce5814f06a.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ea78a0a3-f129-4a1e-ba3e-b3585442cd04

📥 Commits

Reviewing files that changed from the base of the PR and between aef6002 and 2f486e1.

📒 Files selected for processing (5)
  • tests/benchmarks/test_finished_build_measurement.py
  • tests/infra/pilot_resources.py
  • tests/infra/reindex_differential.py
  • tests/unit/scenarios/test_resource_pilot.py
  • tests/unit/sources/test_finished_build_equivalence.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-21T05:49:49.744164Z 2f486e1 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Sinity
Sinity enabled auto-merge (squash) September 21, 2026 05:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f486e1846

ℹ️ 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".

@Sinity
Sinity merged commit 17607c2 into master Sep 21, 2026
3 checks passed
@Sinity
Sinity deleted the fix/harness-workload-batch branch September 21, 2026 05:53
Sinity added a commit that referenced this pull request Sep 29, 2026
## Summary

Test-only salvage of Codex-debt worker 16 (`polylogue-1tyq5.122`). Eight
unit tests now fail on the regression each one names, instead of passing
on a weaker proxy. No production code changes.

## Problem

Hosted review findings on earlier PRs showed that these tests could not
catch the defects they claim to guard. For example, the antigravity
symlink test used a `.md` path that the conversation walker never
considers. The blob-store fsync test also passed with every staged-file
fsync removed. The worker's patch arrived truncated. Eight complete
test-file diffs were recoverable. The ninth
(`test_durable_change_train.py`) was cut off after its header and is not
included.

## Solution

| key | disposition | evidence | test |
|---|---|---|---|
| 122.01 #4037 test_migration_load_evidence.py:357 | fixed-kept
(reworked) | query continuations are opaque `q2.` tokens
(`server_support.py` `_budget_envelope`), so the worker's
`arguments["offset"]` read raised KeyError | decodes the token and
requires `request.offset == returned_items` |
| 122.02 #4037 test_migration_load_evidence.py:460 | fixed-kept | status
check rejected only markers | status must contain no seeded session ID
either |
| 122.08 #5470 test_resource_pilot.py:104 | fixed-kept | `perf_counter`
timing test had no `uses_real_clock` marker | marker added with its
reason |
| 122.09 #5470 test_resource_pilot.py:116 | fixed-kept | receipt went to
captured stdout | `emit_receipt("pilot-provider-build-cost")` plus
readback |
| 122.12 #4788 test_antigravity_source_acquisition.py:187 | fixed-kept |
`.md` symlink is never a conversation candidate | symlinked `.pb` next
to a regular `.pb`; only the regular one is admitted |
| 122.13 #5325 test_cold_build_generation.py:263 | fixed-kept |
preflight depended on the runner's free space | `_free_space` pins 512
MiB, and the receipt must record it |
| 122.14 #5334 test_finished_build_equivalence.py:183 | fixed-kept |
both arms call `backfill_historical_revision_evidence` directly | arms
are described as replay configurations; receipt names the executed
`callable_identity`; the unexercised `production_driver` labels are
removed |
| 122.17 #5340 test_tool_result_unknown_reason_contract.py:982 |
fixed-kept | a success-only route would demand an unknown declaration |
origins come only from routes that expect `UNKNOWN` |
| 122.20 #4152 test_blob_store.py:65 | fixed-kept | first `fsync` could
be the directory sync | events are classified by `fstat`; the file fsync
must precede `replace` |
| 122.21 #4976 test_bulk_build_lifecycle.py:615 | fixed-kept | protocol
committed per session; production replay passes
`manage_transaction=False` (`revision_governance.py:555`) | each arm
runs in one caller-owned transaction; a trace callback requires exactly
`BEGIN`, `COMMIT` |
| 122.22 #4976 test_bulk_build_lifecycle.py:699 | fixed-kept |
measurements were dropped after the assertions |
`emit_receipt("finished-build-protocol-synthetic")` plus readback |

Removed from the worker's patch as tautological: an `any(...)` assertion
over the same set it iterated, a test asserting its own marker, and a
check that a dict it had just built lacked a key.

## Verification

- `agentctl job start polylogue verify_quick --workspace
/realm/worktrees/salvage-w16 --wait` → job 2591: `verify: PASSED exit=0
... head=d35b8dc637d8`
- `agentctl job start polylogue pytest_focused --workspace
/realm/worktrees/salvage-w16 --wait -- <all 8 files>` → job 2498 (before
the 122.01 rework): 198 passed, 4 failed. After the rework, job 2560 on
d35b8dc (the five files whose tests had failed or changed since
2498): 138 passed, 2 failed.
- The remaining failures are in tests this PR does not touch, and they
fail the same way on clean master 1beb2e5 (job 2561, 3 failed):
`test_resource_pilot.py::test_parser_resource_needs_only_provider_bytes`
and `::test_parser_resource_acquisition_opens_no_archive_tier` (the
ChatGPT parser opens `sqlite3.connect(":memory:")` at
`chatgpt.py:3017`), and
`test_bulk_build_lifecycle.py::test_fresh_shard_build_finishes_equivalent_to_retained_indexes`.
- Mutation proof, job 2501: with `_walk_source_paths` following symlinks
and the staged fsync removed from `write_from_bytes`, both the new
antigravity test and the new blob-store test fail (`2 failed`).

## Self-review

- **Sibling sites.** Both status and continuation assertions in the MCP
file were reviewed. The three sibling fsync sites in `blob_store.py`
share the same event classification, and only `write_from_bytes` is
exercised here, as before.
- **Cancellation, shutdown, unbounded reads.** Not applicable; no loops
or readers were added.
- **Fail-open fallbacks and compatibility shims.** None. The retired
`_routed_origin_names` and `production_driver` have no remaining
references.
- **Production route.** Every changed test drives the production
callable. 122.14 narrows its claim instead of pretending to exercise
drivers it does not call.
- **Removed symbols.** `rg _routed_origin_names|production_driver tests`
finds no remaining uses.

## Derived-identity closure

No production files are touched, so the closure does not move.

## Residuals

- Worker 16's 22 claimed fixes for `.120` and `.121` never reached a
branch, because the publication connector returned 502. They remain
open.
- Findings 122.10, 122.11, 122.24 and 122.25 were not reached (122.24
and 122.25 were in the truncated diff), along with the other `.122` and
`.123` findings.
- The three failures that already occur on master (above) are not
addressed here.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant