Repository navigation
feat(bench): measure fresh builds end to end through the daemon route - #5678
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94d3fdfc45
ℹ️ 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".
e43cfeb to
9a9f91f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a9f91f2b0
ℹ️ 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".
## Summary The revision replay admits a worker's prepared rows against the session's parse-bound digest. The writer then copies rows it used to rebuild, and a prepared session stores the same `sessions.content_hash` as the inline route. ## Problem (evidence) Numbers come from `devtools bench fresh-build` (#5678). Each run cold-builds a sealed 144-file (276 MiB) private sample of Claude Code, Codex and Gemini sources through `polylogued run --cold-build-index` on a shared host (load 18-35). Only aggregate numbers are quoted. Wall times move with host load; writer holds, stage timers and CPU seconds move less. The writer's prepared-row dispositions recorded `content_hash_mismatch` for 126 of 148 sessions. A worker lowers a prepared session's sink in place (derived tool outcomes, active-path normalization). The inline route applies the same lowering only while building rows. Both bind the digest of the parsed content, but `apply_raw_revision_replay` re-hashed the lowered sink. Every session with a tool call therefore disagreed with its shard. The writer rebuilt rows and identities itself and stored a digest the inline route never produces. Probe over 12 Codex and 12 Claude Code files from the sample, same bytes through both routes: | route | prepared rows used | `content_hash` equal to inline | | --- | --- | --- | | master, prepared | 1/12 Codex, 3/13 Claude | 1/12, 2/13 | | this PR, prepared | 12/12, 13/13 | 12/12, 13/13 | ## Solution `_carried_session_content_hash` resolves the replay's aggregate digest, and the ungoverned already-applied check, through `bound_session_content_hash` when one is carried. The projection and the other replay entry already do this. ## Verification - `devtools test tests/unit/sources/test_prepared_jsonl.py tests/unit/sources/test_live_watcher_parse_stage_equivalence.py tests/unit/storage/test_prepared_row_dispositions.py tests/unit/storage/test_session_shards.py`: PASSED. - New test `test_prepared_session_with_lowered_sink_keeps_identity_and_rows`: a Codex tool call ingested inline and through the parse stage. On master it is red: the writer copies 0 shard sessions, and `sessions.content_hash` differs. - Benchmark output fingerprint against the previous candidate: every table is identical except `sessions`, `raw_revision_heads`, `session_profiles` and `session_usage_rollup_bindings`. Those four carry the session digest. In `sessions`, 126 rows differ in `content_hash`, and the code fingerprints differ as expected. Index plus materialize stage time fell from 71.6 s to 41.1 s. ## Residuals - `revision_governance.py` is IN the derived schema-identity closure. Stored digests for prepared multi-tool sessions change to the inline-route value, so the change must land before the fresh build starts. - Streamed multi-chunk merges (`prepared_merge`) hash the merged session built from already-lowered chunk sinks, so they may still differ from the inline route. The sample did not exercise that path, and it is not verified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4 Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b4f950b93
ℹ️ 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".
…5693) ## Summary A published live group's cursor writes now share one writer admission and one ops transaction. A batch's session and message events share one ledger transaction. ## Problem (evidence) Numbers come from `devtools bench fresh-build` (#5678). Each run cold-builds a sealed 144-file (276 MiB) private sample of Claude Code, Codex and Gemini sources through `polylogued run --cold-build-index` on a shared host (load 18-35). Only aggregate numbers are quoted. Wall times move with host load; writer holds, stage timers and CPU seconds move less. The writer's hold ledger showed 144 `cursor_full` admissions totalling 44 s. Each file took its own writer round trip and ops commit. The daemon's event ledger committed once per session event, about 0.6 s per batch. The cursor upsert also committed inside its own `_connect_ops` block, so a batch could not have been one transaction. ## Solution - `CursorStore.ops_batch()` defers commits inside an `ops_write_scope` to the end of the block and rolls back as a unit. `_record_full_cursors` records a group's cursors in one admission inside it. - The cursor upsert runs with `manage_transaction=False`, so `_connect_ops` (or the enclosing batch) owns its commit. Cursor read-modify-writes (failure reset, mark failed, rebase) take `BEGIN IMMEDIATE` only when no transaction is open, so they run inside a batch the first upsert has already opened. - `emit_daemon_events` writes several `DaemonEventRecord`s on one connection and commit. The live batch builds its session and message events with the new builders. The advertised-topic test now counts record constructions as production emit sites. ## Verification - `devtools test tests/unit/sources/test_cursor_ops_write_scope.py "tests/unit/daemon/test_daemon_events_endpoint.py::TestAdvertisedTopicContracts"`: passed. Anti-vacuity: with a per-write commit, the first cursor is visible before the batch ends and survives a rollback. With an unconditional `BEGIN IMMEDIATE`, `test_ops_batch_holds_read_modify_writes_after_an_upsert` raises "cannot start a transaction within a transaction". A benchmark run of an intermediate head hit exactly that failure, and it is fixed here. - `tests/unit/sources/test_cursor_lifecycle.py` and `tests/unit/sources/test_live_cursor_persistence.py`: three tests fail identically on master (`test_sigkill_mid_transaction_leaves_no_torn_cursor_write` and the two lock-retry tests), so they are inherited, not caused here. - Benchmark: on the combined branch, `cursor_full` took 23 admissions totalling 2.07 s, down from 144 totalling 44 s. ## Residuals batch.py and cursor.py are IN the derived schema-identity closure. `attempt_progress` ops writes (115 holds, 3.3 s) remain per-update. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4 --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
## Summary Convergence-debt and raw-retention backlogs now drain by work, not by tick. A subject-independent stage runs once per backlog instead of once per row. Debt left by a cold build waits for promotion and is then released immediately. ## Problem (evidence) Numbers come from `devtools bench fresh-build` (#5678). Each run cold-builds a sealed 144-file (276 MiB) private sample of Claude Code, Codex and Gemini sources through `polylogued run --cold-build-index` on a shared host (load 18-35). Only aggregate numbers are quoted. Wall times move with host load; writer holds, stage timers and CPU seconds move less. After intake finished, derived convergence never became terminal on master. The generic drain retried at most 100 debt rows per 60 s tick, and raw retention retried 25 rows per pass. Stages whose verdict ignores the subject (`delegation_work_evidence`, `raw_authority_verdict_cache`, `fts_readiness_binding`) ran once for every one of the 1,008 debt rows. The drain also ran during the cold build against the empty active generation, pushing rows into backoff before promotion. ## Solution - `_drain_convergence_debt_backlog` loops pages within a 45 s budget. Rows owned by other loops are excluded from the page query. - `ConvergenceStage.subject_independent`: the drain runs one representative, and on success clears the stage's rows recorded up to that point. - `raw_authority_verdict_cache` loops its batches while they make progress (10 s pass). Raw-retention retry loops until the backlog stops shrinking (30 s budget, 64 backlog paths per writer admission). - The drain skips while a cold-build generation is active. `settle_cold_build` releases deferred debt backoff after promotion. - An inherited failure is fixed forward: `test_convergence_debt_summary_rejects_unknown_status` wrote its corrupt row through the writer, which now validates statuses, so the test corrupts the row with `UPDATE` instead. ## Verification - `devtools test tests/unit/daemon/test_convergence_debt_drain.py tests/unit/daemon/test_convergence_debt.py tests/unit/daemon/test_convergence_stages.py tests/unit/daemon/test_convergence_debt_alert.py` plus three `test_live_batch_support.py` raw-retention ids: all passed except the inherited status test. After the fix, that test's rerun passed. - Benchmark: debt went from 1,008 at promotion to 0 at 907 s on the first run with this change. On the combined branch it reached 0 and the build became terminal and qualified at 436 s, with the derived phase taking 322 s after promotion. ## Residuals - batch.py, cursor.py and watcher.py are IN the derived schema-identity closure. The change must land before the fresh build starts. - Per-session derivations (`session_profile`, `session_usage_rollup`) still publish in bursts of about 64 per pass. They now dominate the time from promotion to terminal. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4 --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed15b3260a
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 267e58ef8c
ℹ️ 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".
…#5697) ## Summary After a cold build promotes, the session derivation audit (summary, usage rollup, profile) now runs bounded passes back to back within a 45 s budget per periodic tick. Before, it ran one pass per tick. ## Problem (evidence) I ran a fresh-build benchmark: a 144-file private sample, cold-built through `polylogued run --cold-build-index`, measured with `devtools bench fresh-build` (#5678). The session derivations published in bursts of at most 64 keys a minute. Each audit pass is bounded at 128 discovered and 64 published keys per domain, and `_periodic_convergence_check` ran one pass per 60 s tick. Profiles for 148 sessions finished 312 s after promotion, while the writer sat idle between bursts. At full-archive scale that is one minute per 64 sessions per domain. ## Solution `ComposedSessionProfiles.converge_backlog(budget_s)` repeats the bounded pass while the audit still has domains to sweep, within the budget. The periodic convergence check calls it with 45 s. Every pass keeps its page and publication bounds, so no writer hold grows. The ordinary `callback(None)` is still one bounded pass. ## Verification - `devtools test tests/unit/daemon/test_session_profile_composition.py "tests/unit/daemon/test_daemon_cli.py::test_daemon_startup_catch_up_and_restart_repair_session_profiles"`: PASSED. - New test `test_backlog_call_sweeps_every_domain_in_bounded_passes`: one backlog call publishes a profile for every session (more than 129) over several passes of at most 64 each. Anti-vacuity: a single pass leaves the audit pending with fewer profiles than sessions. - Benchmark, same corpus: the last session-profile publication came 312 s after promotion before this change and 59 s after with it. The usage rollup went from 89 s to 29 s. ## Residuals `cli.py` and `session_profile_composition.py` are outside the derived schema-identity closure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4 --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ced6c4d65
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97b0c99091
ℹ️ 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".
Wall time on a loaded host moves with load; the writer thread's own CPU is the single-writer ceiling that does not. Sample per-thread CPU always (cheap: no frame capture) and report the writer total, each writer actor and the other threads; stacks stay behind --profile. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Review findings on the fresh-build benchmark: - re-hash every corpus file and re-list the tree on verify (runs and components), so a same-size edit or an added file is refused; - explicit corpora admit only transcripts the watcher cursors and seal as kind files; an empty sample still seals; - compare exits non-zero for different corpora or run configurations, and for unqualified runs unless --allow-unqualified; - --env cannot override driver-owned variables; component scratch must lie outside the checkout; - a candidate whose commit or cleanliness changes during the run fails the candidate_unchanged check; - refresh recomputes throughput, budgets and qualification from one helper shared with the build; - event timestamps parse as UTC; - per-source timings come from a structured live.ingest.source_group event with unrounded duration instead of a rounded log sentence; - index the benchmark document in the docs map. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…ation Second review round on the fresh-build benchmark: - event milestones, observations and process samples are all measured from the driver's launch; - process CPU and I/O keep the counters of exited parse workers; - per-origin intake rates stop at promotion, like the intake window; - qualification requires a clean daemon shutdown, and the candidate identity includes a digest of tracked edits; - readiness transitions count as build progress for stall detection; - the config digest covers the profile interval, and compare refuses receipts from different interpreters; - a missing event log reduces to an empty stream; - the stratum boundary is one stochastic draw; - claude-ai export timings map into the projection. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…timeline After promotion the build's remaining work is derived debt and readiness; the timeline carried only the debt total, so a slow stage could not be named from the receipt. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Third review round on the fresh-build benchmark: - checks for a lossless event log (sink delivery counters captured at daemon exit) and a corpus re-verified after the run; - candidate identity covers untracked, unignored files; - manifest aggregates are recomputed and compared on verify; - the RSS budget uses the daemon's VmHWM or the 4 Hz tree peak; - thread CPU is reported as a lower bound with the unattributed remainder of the process total; - duplicate --env keys, empty corpora and non-empty component scratch are refused; sampling refuses sources that grew mid-copy; - corpora are created owner-only. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…rides Fourth review round on the fresh-build benchmark: - the output fingerprint adds a deterministic MATCH probe over messages_fts, so different postings with equal counts differ; - qualification requires the structured promotion milestone; - --env refuses source, path and log settings; - sampling re-counts the whole population census before sealing; - a projection with an unmeasured populated origin is marked incomplete instead of pricing it at zero; - an ops.db without its ledger reduces to zero batches; - component benchmarks include the export origins. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b6c278af1
ℹ️ 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".
#5691) ## Summary This PR also fixes polylogue-slc55: preparation is never abandoned at a wall-clock deadline, and cold-build cursor corroboration reads the candidate index. Live intake now prepares the next files while the writer publishes the current group. It also caps the default process parse pool and decodes each sealed prepared session once instead of once per pass. ### polylogue-slc55: never abandon progressing preparation A 419 MB Codex file never finished a cold build. Its preparation outlived the 60 s warm deadline, so the writer deferred the file and re-acquired it on the next pass, eight times. When one pass finally succeeded, cursor corroboration checked the still-empty *active* index rather than the candidate generation being built, demoted the new cursor and re-ingested the file. The run wrote 117 GiB and never promoted. - `warm_paths`, the in-memory `warm`, `CensusParseStage.warm` and retained raw preparation no longer have deadlines. They wait for their workers. - Forward progress (attempt-directory growth, or completions) decides only when a stall is reported: `live.parse_prefetch.preparation_stalled`, `daemon.parse_prefetch.preparation_stalled` and `storage.raw_observation.preparation_stalled`. A report never defers, terminates or discards work. - Cursor corroboration resolves `_published_index_path`, which is the candidate generation during a cold build. - Tests that asserted the retired deadline behaviour are rewritten to the new contract or removed where the pending state they covered no longer exists. Deferral on worker failure keeps its tests. ## Problem (evidence) Numbers come from `devtools bench fresh-build` (#5678). Each run cold-builds a sealed 144-file (276 MiB) private sample of Claude Code, Codex and Gemini sources through `polylogued run --cold-build-index` on a shared host (load 18-35). Only aggregate numbers are quoted. Wall times move with host load; writer holds, stage timers and CPU seconds move less. On master plus #5674, intake ran at 0.45 MiB/s with a mean of 0.34 cores. A stack profile of the daemon (the benchmark's in-process sampler, because py-spy cannot attach to 3.14t) showed three causes: - At most 2 parse paths ran in parallel. `_max_path_pending` was 1 per worker slot, and nothing was submitted until the writer asked for a path. - The unconfigured process pool took every core (23 workers here). Peak RSS for the daemon tree reached 3.7 GB. - The writer re-validated each sealed session's messages with pydantic on every pass over it, about 20 passes per session. This was 45% of writer CPU. ## Solution - `LiveParseStage.prefetch_paths` starts preparing the next page's cursorless paths while the current page publishes. Read-ahead has a bounded lifecycle: - The parent only stats a path and reads its cursor. Candidate sampling and preparation run in the stage's executor (`live_lookahead_path_worker`), so a stalled source read never blocks a parent thread. - Read-ahead is charged to the slot and byte budget from submission until it ends. It never takes the last worker. - A warm whose required path does not fit preempts running unclaimed read-ahead. After a short grace the read-ahead is reaped: the process pool is terminated and restarted, and the warm resubmits its own collateral work. Unclaimed read-ahead that outlives eight stage calls is reaped the same way. - Finished read-ahead releases its charge at once and pays its full artifact digest only when a warm claims it. - Publication order is enforced in one place, reconciliation. A warm reconciles its paths in intake order, admits one path per canonical session, and returns later same-session paths as held. The batch publishes held paths in the next progress group, after a fresh warm. A reconciliation is valid only for the warm that made it. - The path-pending bound is one per worker. The default process pool is capped at 8 unless configured (`_DEFAULT_PROCESS_WORKER_CAP`). - `SqliteMessageSink` keeps a bounded LRU of decoded sessions (64 MiB; a session larger than half the budget is not retained). The key is the sealed file's path, ordinal, and dev/ino/mtime/ctime/size, so a changed file never serves a stale decode. `PreparedJsonl.discard` drops the entries. ## Verification - `devtools test tests/unit/sources/test_prepared_jsonl.py tests/unit/sources/test_live_watcher_parse_stage_equivalence.py tests/unit/daemon/test_fair_resumable_intake.py`: `223 passed`. The run includes new tests for decode-once, discard or oversize re-decode, a sealed-digest-bound cache key, prefetch without waiting, and the pool cap. - Benchmark: with the 23-worker pool, intake reached 1.44 MiB/s at 3.7 GB RSS. With the cap it runs at 1.9 GB RSS. The combined branch (this PR plus the drains, ops and digest PRs) promoted in 114.6 s (intake alone took 623 s before), reached terminal and qualified, and its per-origin intake projection for the sampled population fell from 37.8 h to 6.2 h. - Lookahead rework: `devtools test` over the parse-stage equivalence, live watcher, fair intake, parse prefetch, cursor locking, schema preflight, watcher locking, batch support and read-amplification files: `530 passed, 4 failed`. Two of the four failures (`test_watcher_queues_behind_daemon_maintenance_writer`, `test_live_full_ingest_offloads_sync_work_to_keep_loop_responsive`) also fail on origin/master cf6d12d. The third, `test_source_only_full_ingest_streams_admitted_zip_members_without_decoding`, patches a `batch._detect_provider_from_raw_bytes` attribute that does not exist on master. The fourth, `test_path_stage_shutdown_terminates_stalled_process`, hit its 5 s spawn wait under load and passes when run alone. Each of the three new P1 regression tests (wedge, reap of a worker stuck on a FIFO read, same-session order) fails when its fix is disabled. `devtools verify --quick`: PASSED. ## Residuals - These files are in the derived schema-identity closure (`devtools schema closure`: batch.py, parse_prefetch.py, watcher.py, prepared_jsonl.py and prepared_message_sink.py are IN). The change must land before the fresh build starts. - The individual contribution of prefetch versus the decode cache is not separated. Both runs share the other changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4 --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…ence, keep receipts on old candidates Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccfa04dd15
ℹ️ 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".
…diness in the stall window Transient corpus additions and restored candidate edits change the run's stamps, so the receipt no longer claims an unchanged input. Readiness is re-read within half the stall window, a cancellation after the loop marks the receipt interrupted, the fingerprint records tables an older candidate lacks, refreshing keeps one refresh identity, and sampling follows linked source directories as production discovery does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e5adb6840
ℹ️ 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".
…ate directories Shutdown waits while the daemon's process tree keeps moving and is killed only on a stall or a new cancellation. A permanent observation error (a schema the driver cannot read) ends the run as observation_refused. Candidate directories are stamped, and bytecode goes to scratch so they stay still. A linked corpus root, a linked source file and an unreadable source subtree are refused or skipped as production's walk would. A named transcript brings its sidecar unit, and changed evidence and a stepped clock are non-waivable. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11bab92a40
ℹ️ 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".
…remental component consumption corpus files decides source-root membership and layout by the lexical path, so a transcript below a linked source directory is accepted, and it refuses a linked file. A SQLite progress handler interrupts the fingerprint's own sort and scan passes on cancellation. Component preparations are consumed as each file finishes. The sampler keeps every stack frame and counts its periodic dump as overhead. The per-origin whale cap is removed, so a full-fraction sample holds every unit. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea1a2f14be
ℹ️ 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".
…evidence, bounded preparations Shutdown progress reads I/O and the event log, not the CPU the injected sampler keeps moving. A full-fraction sample copies every unit, and a source rewritten after its copy refuses the sample. Sampling admits files by production's own predicate. The ops WAL is sealed with the evidence. Component preparations are bounded in flight, and clock steps are sampled every poll. An interrupted run skips the census. The identity covers the production reducers the package imports. Source timing coverage is required to qualify, and the interpreter is probed from the candidate. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
The source-timing check read a projection key that does not exist, so every receipt build raised. The reducer identity followed only absolute imports and missed modules reached by relative or submodule imports. Adds a receipt-level test that the census is skipped when interrupted. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
File stamps miss a same-size rewrite within one timestamp tick, so the copy check and the end-of-sample check compare content digests. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # devtools/daemon_finished_build.py # polylogue/sources/live/batch.py # tests/unit/devtools/test_daemon_finished_build.py
Master now acquires every origin only from its canonical location and refuses unread config keys, so a run config carrying `[sources] roots` for the corpus's export directories fails to load. Each run copies the sealed export files into the scratch archive's inbox before the daemon starts, the route `polylogue import` stages exports through, and the projection attributes the inbox's time to the sample's export origin only when there is exactly one. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
`polylogue import` stages an export as `inbox/<name>`, and the raw row's source path carries that name. A corpus now refuses two exports sharing a basename across origins, since the inbox holds every origin, and a run refuses one that slipped in. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Add
devtools bench fresh-build, which builds a fresh archive from a sealed source corpus through the ordinary daemon route and writes a comparable receipt. The receipt covers stage timings, writer share, queue depth, per-origin cost with a population projection, process-tree RSS and CPU, time to promotion and to terminal convergence, terminal checks, asserted budgets, and a per-table output fingerprint.comparediffs two receipts and says whether their stored output is identical.componentstimes one production stage over the same corpus. An in-daemon stack sampler stands in for py-spy, which cannot attach to 3.14t. The one-off whale qualification driver (devtools/daemon_finished_build.py) is retired: a single large source is now acorpus filescorpus run with--max-rss-mib. A declaredfresh_build_benchAgentCTL operation runs it in the bulk pool.Problem
Nothing measured the fresh build the operator will actually run. The existing finished-build measurements call
backfill_historical_revision_evidencedirectly and bypass intake, the cold-build generation, promotion and derived convergence.devtools/daemon_finished_build.pyran the real daemon, but only as a pass/fail qualification for one input file. It had no stage attribution, no comparison, and no corpus seal.Running the new benchmark on a private 0.5% stratified sample of the operator's sources (148 files, 290 MB, Claude Code/Codex/Gemini CLI) at the base commit showed where a full build stands:
polylogue-se08w), and derived stages that never converged kept the build from finishing.Solution
corpus sample|fileslays sources out under a stand-in$HOME, so the typed default sources resolve exactly as in production. The manifest seals every file's path, size and SHA-256 under one digest, and the sample is seeded and stratified by origin and size bucket.runisolatesHOME, XDG and the archive root in the work directory. It startspolylogued run --no-browser-capture --no-api --cold-build-indexwith JSON events, samples the process tree once a second, and polls the archive read-only. It stops on terminal convergence, a stall, a settle timeout or SIGTERM, and the receipt is written in every case. A cancelled job still leaves its evidence.qualifiedadditionally requires zero raw parse failures, exact FTS, and every asserted budget.exports/into the scratch archive's inbox before the daemon starts, which is wherepolylogue importstages them. Since refactor(sources): acquire every origin only from its canonical location #5684, sources are acquired only from canonical locations and the loader refuses[sources] roots.report --refreshrecomputes a receipt from its run directory, andprofilesummarises the sampler's wall/CPU stacks.docs/fresh-build-benchmark.mddocuments corpora, running, the receipt and how to read it.Verification
devtools test tests/unit/devtools/test_fresh_build_bench.py:8 passed(receipt.cache/verify/runs/20260927T202649Z-focused-test-2750767-52bc166f). The tests cover the event-log reduction (intake window and writer share scoped to promotion), leaf-only stage rollup, the population projection, fail-closed budgets, the terminal predicate's readiness and membership conditions, the corpus seal, and seeded session-unit sampling. Each names its anti-vacuity mutation.devtools gate generated-surfaces|doc-commands|patterns|layering|oracle-integrity|test-packages: passed.mypy devtools/fresh_build_bench/: no issues.Residual
corpus synthetic) arrive once the workload generator in feat(synthetic): generate distribution-faithful workloads from measured profiles #5670 lands. Committed receipts should use them.polylogue-58bwoare now runs of this benchmark. They have not been run here.Self-review
I reviewed the complete diff at the final head: 146 review threads over four rounds, re-read against the code rather than against the replies. The findings are grouped by the property a receipt promises.
A receipt is comparable only when its inputs are the same
_is_supported_source_path) plus the unit's sidecar directories.polyloguemodules it imports (absolute, relative and submodule imports).A receipt says what happened, even on failure
FingerprintCancelledError).events.jsonl,ops.dbandops.db-wal, soreport --refreshcan tell whether it re-reads the same evidence.Qualification cannot be satisfied vacuously
qualifiedfurther requires:originsinstead ofby_origin), so everybuild_receiptcall raised. The unit test had called the helper through the same wrong key. The new test drivesbuild_receiptend to end.Merge with #5684 (canonical-only acquisition)
[sources] roots. On master that key is refused at load, so every run would have failed before intake. Exports are now staged into<archive>/inbox/<name>as copies. A hard link would change the sealed file's ctime, which the manifest check reads as a corpus write.inboxwatch source. The projection gives inbox time to the sample's export origin only when there is exactly one; with several, those origins stay unmeasured and the projection says it is incomplete.daemon_finished_build.py(isolated home, canonical input directory) are dropped with that file. The benchmark already builds its environment from scratch, withHOME, every XDG root,POLYLOGUE_CONFIGandPOLYLOGUE_SITE_CONFIGpointed into the work tree.Resource bounds: component preparations keep at most 2×workers in flight. The stack sampler keeps full-depth stacks, and its dump overhead is reported.
Verification:
agentctl job start polylogue pytest_focused -- tests/unit/devtools/test_fresh_build_bench.py tests/unit/sources/test_live_batch_support.pyon head 47fec0f (job 2531):296 passed in 372.29s.test_daemon_finished_build.pyis retired with its driver.agentctl job start polylogue verify_quickon head 47fec0f: succeeded (job 2533).Residuals:
🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg