test(code-index): no-call graph rebuild seals zero edges - #1572
Draft
ScriptedAlchemy wants to merge 3 commits into
Draft
ScriptedAlchemy wants to merge 3 commits into
ScriptedAlchemy wants to merge 3 commits into
Conversation
The graph-rebuild refresh fixture emits file Contains edges that abstain and primitive u32 refs that never bind. Census edge_count 0 is that shape, not a stalled projector. Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
edge_count0 withsymbol_count98305 is the sealed relation census of the no-call refresh fixture, not a stalled graph projector.Observedafter the graph store is installed, which happens after the full snapshot. The projector had finished.RECEIPT_TIMEOUT, in fix(code-index): seat text through retryable graph activation #1562. This follow-up only records the fixture shape.Citations below are from PR #1562 tip
b80dd58unless the path is unchanged onmaster(the seat commit does not touch emission).registry.rsandmount.rsline numbers are the seat tip.Verdict
Expected. Not a stalled projector. Incremental edge emission would not move this receipt.
The status field is
graph_statistics.edge_count, which isCodeIndexGenerationStatisticsV1.edge_count: the count ofCanonicalRelationEdgeV1rows sealed with the generation (crates/tracedecay-code-index/src/production/mod.rs:2172-2176,generation_statistics.rs:44-61). It is not a live graph-db relation counter and it does not includeCodeFileContainsSymbolprojector rows (crates/tracedecay-code-index/src/graph_projection.rs:59).98305 = 768 files × 128 functions + before_reopen. That is one symbol per function (chunks.rstest now locks the one-function shape). A partial emit would not land on that exact total while still claiming zero call edges and a finished clone/text phase. The number is the sealed generation, not a counter stuck mid-projection.Why this fixture seals zero relation edges
The batch is:
(
crates/tracedecay/tests/transport_acceptance_suite/graph_rebuild_status_test.rs:232-237). No calls, no imports, no impls, no modules.crates/tracedecay-code-extraction/src/rust_extractor.rs:166-168) and emitsContainsfrom that parent to each function (280-287).crates/tracedecay-code-index/src/chunks.rs:773-786).canonical_relation_edgesabstains those edges asMissingSymbolEndpoint(2497-2502). The existing comment at4250-4251states this: the file node is not a symbol row, so itsContainsedges always abstain.u32become unresolvedTypeOf/Returnsrefs (rust_extractor.rs:296-315,2034-2042). Same-file resolution finds no symbol namedu32. Cross-file resolution returns immediately for a bare name with no import and no glob (crates/tracedecay-code-index/src/production/helpers.rs:560-568). Those refs never become edges.collect_edge_evidenceonly concatenates per-file edges plus cross-file resolutions (helpers.rs:358-371). Both are empty.edges.len()is the census.A same-file call still seals a
Callsedge. The emitter is live. The proof ischunks::tests::no_call_refresh_probe_seals_zero_relation_edges(chunks.rs:4282). Ran:cargo test -p tracedecay-code-index --lib chunks::tests::no_call_refresh_probe_seals_zero_relation_edges -- --exact1 passed, 0 failed.
Projector gate, and why it is not this timeout
Graph activation does wait on a full structural backfill before
Ready, even when relation edges are empty.publish_verified_snapshotbuilds the whole manifest before any head exists (crates/tracedecay-store-runtime/src/session_registry/code_graph.rs:1233, manifest at1329-1346).build_projectionallocates every file entity, every symbol entity, and everyCodeFileContainsSymbolrelation, then returns (crates/tracedecay-code-index/src/graph_projection/builder.rs:286-384). Symbol hashing is windowed (332-340,workers × 512) but the function does not publish a prefix.activate_persistent_graphcallsinstall_graph_servingonly after that snapshot returns (crates/tracedecay-code-index-runtime/src/code_index_scheduler/graph_activation.rs:734-774).Readyis that install (serving.rs:3508-3512). Catalog warm is already background and is not theReadygate (graph_activation.rs:756-758).For this fixture the rows are about 769 file entities, 98,305 symbol entities, and 98,305 file-contains-symbol relations. The call-edge loop (
builder.rs:375-384) is empty. Those containment rows are invisible toedge_count.The census reader only reports statistics after
interactive_graph_store()succeeds (crates/tracedecay-code-index-runtime/src/project_reads.rs:102-119and159-174). That store exists only inCodeGraphActivationStateV1::Ready(serving.rs:1993-2011,2062-2074). AnObservedcensus withsymbol_count98305 means the full snapshot was already installed.edge_count0 is the sealed answer sitting on a finished projector, not a counter waiting for edges that will never arrive.progress.phase = readyis the text artifact phase, published when lexical owners install (serving.rs:3206-3211). A clone successor can still start after that. Clone pages2305/2305are that successor's source-page observation, not relation emission. Neither input isedge_count.Ranked proposals
Do not land an emission change in fix(code-index): seat text through retryable graph activation #1562. Do not raise
RECEIPT_TIMEOUT. Zero relation edges is the fixture. Changing the projector or fabricating containment edges into the census would lie about the source. The proof test belongs in this follow-up, not in the seat-swap PR.Do not stream relation edges to save this receipt. Follow-up only if a different journey measures
code_index.seal.collect.emit. There are no relation edges to stream. Streaming the 98k symbol / file-symbol windows would still leave freshness non-current until the last window, becausedashboard_terminal_statusrequirescode_graph_serving == Ready(registry.rs:1205-1231onb80dd58) andReadyis the full snapshot. Estimated speedup on this 90s receipt: none. The dump already showed the finished census. LooseningReadyto the first 512-row window would report a partial graph as terminal; that is not a valid cut.Optional, low, not this timeout: status copy says "graph counts are not authoritative" while warming (
crates/tracedecay-mcp/src/handlers/info/status.rs:482-487). That sentence invites readingedge_count0 as unfinished work. A separate wire field forCodeFileContainsSymbolwould stop the misread, but it is a contract change and does not makewait_for_current_generationreturn. Skip unless an operator surface is actually wrong.What the receipt is still waiting on
Not this lane, so the next pass does not re-litigate edges.
wait_for_current_generation(graph_rebuild_status_test.rs:153-169) needs freshness statuscurrent. That is coveragecompleteand stalenessfresh(status.rs:451-456). The ladder (crates/tracedecay-contracts/src/code_index_freshness.rs:426-466) does not readedge_count. After the seat matches and the graph isReady, the remaining inputs arereconcile_in_progress,source_verified != Some(false), andhook_hint_count == Some(0), plussource_reference/source_revision.On
b80dd58the public pass guard is dropped before native graph activation (mount.rs:1159-1173), so a long snapshot does not itself holdrebuild_in_flight. The Mac dump already had seat match, search hits, retrievalserving, age ≈ 89s, clone pages complete, and text phase ready. The next field to read off that same status object isstaleness_state,coverage,rebuild_in_flight, andhook_hint_count— not the projector.Test plan
cargo test -p tracedecay-code-index --lib chunks::tests::no_call_refresh_probe_seals_zero_relation_edges -- --exact— 1 passedbackground_refresh_and_reopen_report_only_servable_generations(the receipt under diagnosis; this change does not alter it)Checklist