Repository navigation
Skip a SCIP document that fails to decode or convert; its file keeps its rows, marked stale - #1704
KaloyanNaumov wants to merge 44 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
left a comment
There was a problem hiding this comment.
The full-run cleanup needs to distinguish a missing file from a document whose path could not be recovered. Queued uploads also need a rollout path that preserves skipped-file state when an older worker is still serving.
|
The format job fails on the adoption page with the same formatter output on clean |
|
Both points are addressed:
376a163 fixes the three unit failures CI found (a test stand-in without the |
…its rows, marked stale One document python-protobuf refuses (a string that is not UTF-8) or that fails to convert no longer fails the compiler-tier pass. The converter names it once on stderr, lists it in the delta's `skipped_files` and counts it; `run_harness` logs the warning for every tier. A full run does not retire a skipped file, and `apply_delta` marks it stale (`scip_stale:<path>` in `code_index_state`) until a delta applies or deletes it, which `scip_stale_paths` reads. `code_scip_stop_on_failed_document` fails the pass on such a document instead. An index that cannot be read to its end still fails. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
…ith the stop switch A tier's stale files are one `code_index_state` row, `scip_stale:<tier>`, rewritten in one insert by an apply that changes it, and left out of the whole-namespace state reads. A skipped path the entry's scope or denylist refuses is not marked. `run_module` in the Go harness sets `pipefail` and returns 1 on a failed conversion. `run_harness` logs the first five skipped documents and the count. A conversion failure carries the document's place in the index, and the server's warning prefix is pinned to the converter's. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
…the delta `apply_delta` takes the delta's tier from every caller (an upload's is the tier whose watermark its producer moves) and writes `scip_stale:<tier>:<path>` rows: each skipped file marked at the delta's commit, and each of that tier's marked files the delta applied or deleted emptied, in one insert. A tier reads and writes only its own marks, so tiers applying side by side keep each other's. `scip_stale_paths` reads the marks by prefix; the whole-namespace state reads leave them out. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
…ped files it converts `scip_stale_paths` looks up each asked path's mark under each tier instead of scanning every mark of the namespace. `skipped_files` holds only the failing documents among the files the delta converts, so a document outside a window is counted but not marked again. `tier` is a required keyword of `apply_delta`. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Split the harness README's spliced sentence about a skipped document in two, and add the window rule to the failure-table row. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
A run over every document lists each skipped document's path in `skipped_files`, and the TypeScript and Python workers retire the live files such a delta does not name. A document whose path could not be read was only counted, so its file landed in that deletion set. The converter now fails such a run before anything is applied; a window, which names its own files, still counts it and converts. A path that is not UTF-8 is one that cannot be read: it is no longer decoded with replacement characters into a name no file has. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
An upload is applied by whichever build leads the workers. Build N-1's `code_scip_apply` ignores `skipped_files`, so it would apply such a delta, move the watermark and write no stale mark, and N would then read the old rows as current. The converter now writes `delta_version` 2 when the delta lists a skipped file, and 1 otherwise; the version goes last, since a document that fails to convert is known only once the files are written. N's worker applies both versions. N-1's applies version 1 only, so it fails such a batch and leaves the watermark. The rolling-upgrade rules gain the entry. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The `apply_delta` stand-in of the tier-health test takes the `tier` keyword, and the batched-state test expects the `scip_stale:` prefix parameter that `all_state_many` binds to leave the marks out. Prettier realigns the operations guide's failure table after its widened row. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
376a163 to
8bc15ff
Compare
|
Rebased onto |
zlareb1
left a comment
There was a problem hiding this comment.
The full conversion now stops on an unreadable path, and version 2 keeps an older worker from applying a batch without stale marks. Applying an incomplete file can still retire its existing compiler rows.
zlareb1
left a comment
There was a problem hiding this comment.
The rename report integration test fails at the same assertion on this head and on clean main. The tagged fixture describes a naming claim, so the planner returns about_naming. The same test passes with the fixture repair. PR job · Main job · Repair #1719
Two documents can cover one path, one converting and one failing. The delta then names the path in `files`, holding only the converted document's symbols, and in `skipped_files`. The apply took it through the key diff, which tombstoned each symbol only the failed document defined, and then marked the file stale. `apply_delta` now leaves such a path out of the files it applies, as it does a path that only `skipped_files` names: its rows stay as they are and the file is marked stale until a delta converts it whole. Also fix a comment: `scip_stale_paths` reads the marks by key. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
|
The overlap case is fixed in 03041ef: a file that one document converted and another failed is no longer applied at all. Its rows stay as they are and the file is marked stale until a delta converts it whole. The integration failure in the rename report is the one you traced to main; nothing here touches it. |
zlareb1
left a comment
There was a problem hiding this comment.
The new guard keeps rows when a path appears in both files and skipped_files. An uploaded delta can still delete rows for a path it declares skipped.
A path listed in both `deleted_files` and `skipped_files` went to the writer as a deletion and was then marked stale. The apply now leaves a deleted path that the delta also skips out of the files it applies, as the full run's deletions already do, so its rows stay and the mark is written. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
zlareb1
left a comment
There was a problem hiding this comment.
The tunable-constant check reports the same duplicate coverage limit on this head and on clean main. The coverage repair moves the bound report to the store. The same check passes on main with both the coverage and docstring repairs applied. PR job · Main job · Coverage repair #1722 · Docstring repair #1706
|
A path in both |
zlareb1
left a comment
There was a problem hiding this comment.
The overlap test confirms that neither files nor deleted_files can retire a skipped path. Two remaining gaps affect complete graph answers and replay during an upgrade.
A full C++ conversion that skipped a document still listed `ctor_calls` in its features, so applying it set the namespace's coverage bit. If the skipped file was the only factory caller and had no prior edge, `code.callers` had no edge to check for staleness and read the empty answer as exact. The claim is now withheld when the delta lists a skipped file. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The streamed reader behind `scip-full --apply-delta` read a delta file without checking its `delta_version`, so a version this build does not apply was read as one it does. It now refuses it, as the worker does for an upload, and the list of applied versions lives in one place. Rule 68 says a kept version-2 file is applied with the CLI of the build that wrote it during a rollout or a rollback, since the previous build's CLI applies it without its skipped files. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
…s stale Withholding `ctor_calls` from a delta that skipped a document does not undo a claim an earlier clean full run already made: the coverage bit stays set. A later run that skips a new file with no prior edge left `code.callers` with an empty answer it still read as exact, since the staleness read looks at served edges and this file has none. The coverage probe now counts the compiler tier as not carrying constructor calls while any file it holds is marked stale, so the answer is a lower bound until a delta converts the file and clears its mark. Rule 68 now says what the previous build's CLI does with a kept version-2 file: a skipped file's partial entry replaces its rows and no stale mark is written. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The note names three marked files and adds ", ..." when more than three paths were collected, but the bounded read stopped at three, so a namespace with more marks read the same as one with exactly three. The read now returns up to four marks (STALE_SAMPLE, STALE_SHOWN + 1), the note still names three, and the ellipsis shows only when a fourth was read. The bounded-read tests assert the new cap and the note tests cover three and four files. Assisted-by: Claude Code:claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
…failure isolation branch
|
@zlareb1 every finding on this PR is answered at 82521da, including the bounded stale-mark read. Once CI is green on this head, could it go in? The two findings that came after the earlier round are tracked as follow-ups, so this PR does not need another round:
|
zlareb1
left a comment
There was a problem hiding this comment.
Incoming graph reads now fetch a capped sample of stale marks. The constructor coverage finding still applies. The full-run feature needs to depend on the constructor scan completing, including skips outside the emitted path list.
…ument A full C++ run claimed ctor_calls whenever none of its listed files was skipped. The harness passes --changed-files with --full, so a document the constructor scan could not read outside that list was never listed, and the run still claimed every factory constructor call of the namespace. tail now also requires the scan to have read every document of the index. Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
zlareb1
left a comment
There was a problem hiding this comment.
The new test covers a constructor scan that skips a document outside the full-run window. The rolling-upgrade finding still applies. An N-1 worker can successfully refresh a marked Go, Python or TypeScript file and advance its watermark. N can retain that stale mark indefinitely when the file never changes again. Add a recovery path that can verify the file’s publication and clear its mark.
The previous build writes no marks, so its refresh of a marked file left the mark counting until this build applied the file again. For Python, TypeScript and Go that wait had no bound when the file never changed. Every compiler-tier pass now runs retire_published_marks for each entry before its own work. A mark is emptied when the file holds a compiler-tier row written after the mark and the tier's watermark holds another blob of the file than the mark's commit. A Go tier that owes a module retry, and a mirror that cannot answer, keep their marks. Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The pass that retires a published mark runs only for an entry whose tier this build's worker owns and whose mirror holds the commits. A namespace fed by uploads alone, applied by code_scip_apply, has no mirror to prove the refresh with and keeps its mark until this build applies the file. Rule 69 and the docstrings of the pass, the mark reads and the integration test said otherwise. Say so, and drop the claim that a file that never changes again reads fresh in every namespace. Also name the two limits of the proof: a Go module that could not be fetched is passed without a retry, and a mirror that lacks one mark's commit keeps only that mark, while one that lacks the watermark's commit keeps all. Text only. Assisted-by: Claude Code:claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
|
The human speaking here. The last failure found by Bugbot is an edge case. This item saw a lot of work, and even if there are some edge cases left, it's passing a highly extended set of checks already. I think it's ready to go at this state. if the edge case failure can be reproduced by a test, it may get a dedicated issue ... or not ... it's a really edge case. |
zlareb1
left a comment
There was a problem hiding this comment.
The previous rolling-upgrade finding remains open. A valid N−1 apply can advance its watermark without rewriting any symbol or edge when only a function body changes. That file remains stale because recovery requires a newer graph row. The recovery can also clear a mark after an incomplete publication.
| """The marked paths `retire_published_marks` empties.""" | ||
| written = await repo.scip_marks_rewritten(org, ns, tier) | ||
| target = str(await repo.get_state(org, ns, watermark) or "") if written else "" | ||
| if not target or await repo.get_state(org, ns, f"{watermark}_retry"): |
There was a problem hiding this comment.
P1 — A Go apply can write symbols and fail before writing edges. If the next attempt skips that unavailable module, the tier can advance the watermark without placing the module in its retry state. Recovery then treats the partial symbol write and changed blob as a completed graph publication. Use positive evidence that the file was applied before clearing its mark.
| writes after the migration ran. `tests/unit/test_store_names_refused.py` checks N's | ||
| side, and the mixed-version gate does not check this rule. | ||
|
|
||
| 69. **A SCIP delta that lists skipped files** (`skipped_files`, written by |
There was a problem hiding this comment.
P3 — The combined list repeats item 69 after the workspace crawl entry. Prettier 3.9.9 fails on the CI merge and passes on its first parent. Format the combined file. The same merge also needs docs_reference.py to refresh the false-default setting count in docs/reference/status.md. Format job · Generator job
There was a problem hiding this comment.
Merged current main into the branch as fbf3c75, which renumbers this rule to item 70 after main's workspace crawl entry at 69 and formats the combined docs/architecture/rolling-upgrades.md with prettier 3.9.9. docs_reference.py was run on the merged tree, which refreshes the false-default count in docs/reference/status.md from 55 to 56, and the settings reference, schema, example, docs reference and reach census --check runs are clean.
Upstream's rolling-upgrade list now ends with item 69 (workspace crawl sources), so this branch's rule for a SCIP delta that lists skipped files takes the next number, 70, and the combined file is formatted with prettier 3.9.9. docs_reference.py refreshes the false-default setting count in docs/reference/status.md (55 to 56) for the merged settings catalog. No other in-repo text names the rule by number. Assisted-by: Claude Code:claude-sonnet-5-5 Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The recovery pass asked for a compiler-tier row of the marked file written after the mark. An apply of the previous build that changes a function body alone rewrites no row of the file, so its refresh kept the mark although the watermark had moved past the change. The Python, TypeScript and C++ workers move the watermark only after a whole apply of the window, so a watermark that holds another blob of the file than the mark's commit is enough on its own. An upload batch whose apply fails is recorded failed and leaves the watermark; a later batch moves it without applying the failed batch's files. The pass now keeps every mark older than the namespace's newest failed batch, so such a file stays stale until this build applies it. The Go worker passes a module it could not fetch without a retry, so a Go mark still needs a row of the file written after it. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com> Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…into wip/scip-skip-bad-document-r36
|
Both points are fixed in b914189 (head 3906e18, which also merges current main).
Tests, in
Rule 70 in @zlareb1, could you take another look? |
zlareb1
left a comment
There was a problem hiding this comment.
The Go recovery still treats an incomplete apply as publication when a later pass skips the unavailable module. The new failed-batch check also loses its protection when that record expires. Go publication thread
| ) | ||
| SELECT marks.path AS path, marks.mark_commit AS mark_commit | ||
| FROM marks LEFT JOIN written ON written.path = marks.path | ||
| WHERE marks.marked > (SELECT at FROM failed) |
There was a problem hiding this comment.
P1 — Failed SCIP batch records expire after 30 days. Stale marks have no TTL. In test_a_failed_upload_keeps_the_mark_past_a_later_batch_that_moves_the_watermark, let the failed second batch expire and run recovery again. The third commit still has a different blob and max(version) returns zero, so recovery clears the mark even though the failed edge insert never landed. Require durable evidence that the file's publication completed before clearing its mark.
zlareb1
left a comment
There was a problem hiding this comment.
GitHub reports conflicts with main in the SCIP converter, compiler tier, index store and TypeScript worker test. Please reconcile those files so CI can test the combined tree.
Brings the branch up to main (24950d9) so CI can test the combined tree. No behaviour change beyond the conflicts below; the Go-publication and TTL findings are a separate decision and are not in this merge. Resolutions, by the main commit that moved each file: - scripts/scip_harness/scip_to_delta.py (57ca94f, the record reader): the length prefix is read with word32 and bounds-checked in span, so the branch's varint cut and its own overrun check are dropped; both raise ValueError for a record that runs past the end. _document_path keeps the branch's strict decode on main's last-value reader: a path that is not UTF-8 reads as "", which _Skips refuses in a run over every document. Main's "replace" decode would name a file the index does not hold. - server/code/app/index/compiler_tier.py (2434443, 611ce2f): the branch's skipped-document logging runs on main's three-value return, which also carries the job's output as printed. - server/code/app/index/gitrepo.py (24950d9): main's blob_ids_at and commit_ids land whole, and blob_paths_at delegates to blob_ids_at, which raises on a reply short of the request. The branch's strict flag chose between that and an empty set, so it has nothing left to choose: the parameter and its one argument are removed. The branch's blob_ids stays for the delta's own blob reads. - server/code/app/symbol/gate.py (24950d9): both causes are kept, the stale mark and the cut at the commit. - server/code/store/index/base.py (1b55e34, 7aeede8): set_states stays one insert for several keys and takes main's floor per key: next_version on ClickHouse's clock, asked for each key, instead of one version_now for the batch. set_state still delegates to it. - tests/unit/test_code_scip_ts_delta_worker.py (2434443): both tests kept, the stale-mark run and the harness env passthrough. - tests/unit/test_code_scip_skipped_documents.py: the harness test asserts the new three-value return. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
|
Merged main, merge only. Six files, seven hunks: the SCIP converter takes main's One composition worth naming: for a non-UTF-8 document path the converter keeps this branch's skip ( 939 passed across the SCIP, converter, tier and gate suites. The stale-mark integration tests skip here — they need a ClickHouse target. |
…y path and a deletion retires its rows `_document_path` decodes with `replace` again. Its only job is a key: ordering and pairing documents (`_stream_documents`) and naming a skip. Returning "" for every undecodable path collapsed a bad byte under `src/` and the same byte under `lib/` onto one key, where U+FFFD keeps them distinct, and it is the one string the store keys a document by. `git_paths` emits git's `-z` output, raw and NUL-separated, and no longer drops a path git still C-quotes (a name holding a tab, newline, quote or backslash). The second list is a `--diff-filter=D` list: a dropped path never reached `deleted.txt`, never became `deleted_files`, and the server — which reads a file the delta does not name as gone — never retired the rows of a file that vanished. `_path_list` (scip_to_delta) and `_read_lines` (scip_ts_projects) split on NUL only, decode with `replace`, and strip nothing, so a deletion names exactly the key the store holds. `scip_ts_projects` matches its member directories through the same `_key`, and prints the argv path back unchanged. The C++ and Go runners' shell consumers read the lists with `grep -z`, `sort -zu`, `read -d ''` and `path_count`, so no list is converted to newlines. Pinned by tests/unit/test_scip_path_encoding.py on a real git fixture: one file's path bytes go from UTF-8 to invalid and back across two commits; the old path is the delta's `deleted_files`, the new one is the `replace` key, and every path git reported is in a list. A full run now names an undecodable path by its replace key instead of failing; it still fails for a failed document with no path at all, which cannot be named.
zlareb1
left a comment
There was a problem hiding this comment.
The merge restores the combined tree. The Go publication finding and the failed-batch expiry finding still apply. Both cases can clear a stale mark without evidence that the file’s edges were published.
…watermark `retire_published_marks` read two absences as proof. A mark was retirable when no `code_scip_batches` row of the namespace was `failed` and newer than it, so a partial apply that published a file's symbols and raised on its edge insert still cleared the mark once a later batch moved the watermark past the file, and `code_scip_batches` expires a record 30 days after it is created, after which every mark in a namespace was retirable. A mark now retires on positive evidence only: a compiler-tier symbol or edge row of the file stamped (`indexed_commit`) with the tier's watermark commit, which is an apply's own record that it wrote the file there, plus another blob of the file than the mark's. Every apply stamps its rows that way — this build's and the previous build's, an upload's and a worker's alike — and a partial apply cannot produce the stamp at the commit the watermark moves to: it stamps the commit it failed at, writes no watermark, and what follows leaves the file's rows there. A skipped file, a Go module its worker could not fetch, and a file whose apply rewrote no row carry no row at the watermark's commit, so their marks stay until this build applies the file. The pass reads `code_scip_batches` for nothing. The Go tier also retires no mark while `tier_health:go` notes a dependency this host cannot fetch (state `unavailable`), the module its worker passes without a retry. Rule 70 of `docs/architecture/rolling-upgrades.md` states the evidence, that it does not expire, and that a mark without it stays until the file is applied again. The tests read the tables' own definitions through clickhouse-local: a mark whose apply failed its edge insert, a mark whose namespace holds no batch row, and a Go mark under an unfetchable-dependency note survive, and the same file applied with its edges empties its mark. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
…termark `scip_marks_retirable` retired on a row of either table stamped with the tier's watermark commit, so a symbol row alone satisfied it. An apply whose edge insert raised leaves the file's symbols stamped at the commit it was applying, and a same-commit part or retry — a second batch that moves the watermark onto that commit — made that symbol row the watermark's, so the mark went with nothing showing the file's edges were published. The evidence is now both of an apply's inserts: a symbol row of the file stamped with the watermark commit and, when the store holds any compiler-tier edge row of the file, an edge row stamped with that same commit. Whether a file has edges is read from the rows it holds, so a file the tier writes no edge of still retires on its symbol row alone. The blob difference and the Go `rewritten` gate stand. Rule 70 said a partial apply cannot carry the evidence, which held for the batch that failed and not for the commit it failed at once a later batch moved the watermark there; it now states both inserts, that same-commit path, and the Go freeze the note imposes — every Go mark of the entry, because the record names no faithful set of modules to scope it by. The integration test that gave the old reason for a state its sibling retires now states what empties a mark. Two of that file's harness stubs still returned the pre-masking two-tuple and failed at the parent commit; they return the printed output too. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
…ules The pass read a count of the file's rows: a symbol row stamped at the watermark's commit and, where the store held any edge row of the file, an edge row stamped with it. An apply that rewrites a symbol row and leaves the edge set unchanged writes no edge row at all, so `held > 0, stamped = 0` — a finished apply — is the shape a failed edge insert leaves, which is the one state the mark exists to catch; `held` was a count with no FINAL and no tombstone filter, so a file whose edges were legitimately removed was held for good; and neither aggregation took FINAL, so a superseded version could answer for the live one. Now each round writes one state row per marked file it carried — `scip_applied:<tier>:<path>` holding the commit — last of the round's writes, after its symbol insert and its edge insert and in the same coroutine, so the row exists only for a round that raised neither. It is written for a file the round rewrote no row of too, which is what a function body alone does. `retire_published_marks` reads that row and nothing else: FINAL, non-empty, the watermark's commit, and newer than the mark. A mark and the record that answers it are written and emptied in one insert, so no retirement joins a record to a mark it was not written for. The Go worker writes the modules it could not fetch to `scip_unavailable:go` before it moves the watermark, and the pass gates those modules' files and a retried module's own: one unbuilt module no longer holds every Go mark of the entry, and the masked health note is not read for it. A build that writes no record — the previous release — no longer retires a mark: its refresh of a marked file leaves the mark counting, and the mark ends when this build applies the file. tests/unit/test_code_scip_mark_retirement.py applies every case on clickhouse-local, and tests/integration/test_code_scip_stale_mark.py against a server. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The construction was accepted; what guarded it was not. Four gaps, closed by tests that fail when the thing they name is flipped, and one duplicate that let the record's paths be chosen in two places. The Go gate (`scip_unavailable:go`) had no test: nothing named the key, so the wrong dirs or a fetched module keeping its gate would have passed. Three tests now drive real passes: a pass over three modules with two unfetched writes both dirs and not the built one, and the next pass, which attempts one of them, rebases the gate as `previous - attempted`; a module fetched again leaves the gate empty; and the row the pass writes is read back by `_unbuilt_modules`, so the unfetched module's files are held and a file outside every dir the gate names is not. Mutating the gate to name `attempted` fails all three (`assert ['lib', 'mod_a', 'mod_b'] == ['mod_a', 'mod_b']`). `applied_at > marked` was asserted only with the record newer than the mark. The same two rows with the versions swapped — a mark written after an apply of the same commit — are now parametrized: the mark-newer case is kept, the record-newer case retires. Flipping `>` to `<` fails both. `_record_applied` chose nothing before: `_apply_round` filtered `paths` through `marked` and `_apply_file`'s `sink is None` fallback wrote its own conditional. Both pass their paths and the marked set to one helper, which picks the record's files; the fallback needs no difference, so it has none. The test that asserted `["code_symbols", "code_edges", "scip_applied"]` read a call order. It now reads the row back: live under FINAL, holding the apply's commit, newer than the mark, and the mark it retires on the next pass. The order stays pinned by the keep-guard, which fails when the record is written before the inserts: the edge insert raises and a record of a round that never landed is left (`assert 'dddd…' == ''`). The operations table still promised that "the next delta that converts the file clears the mark". An N-1 delta neither reads nor empties a mark, so it now says the delta that carries the file without skipping it empties the mark and N-1 neither reads nor empties one (rule 70). Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
|
Both findings are closed, and the fix is not in the predicate — it is in the apply. b5ff7ba What was wrong. Retirement inferred that a file had been published from rows the apply writes for other purposes, and no arrangement of those rows can answer it: a symbol row stamped at the watermark says the symbol insert returned, not the edge insert — and when the edge set is unchanged the apply writes no edge row at all ( What it does now. Each round ends by writing one state row per file it carried — That last sentence is a narrowing of the promise rule 70 used to make, and it is deliberate: N-1's rows are exactly what cannot distinguish a finished apply from a failed insert, and a mark kept a pass too long reads stale, where a mark retired on a partial apply hides the failure the mark exists for. Rule 70 and the recovery column in the operations guide now say this. On the expiry half. And on the encoding column of this PR — correcting what I said earlier: the branch no longer overrides #1962's policy. The Go tier's gate is now per module ( Tests, each shown to fail against what it guards and pass after: a doc-only apply retires, an unchanged edge set retires, tombstoned edges do not hold a mark, a superseded version answers nothing, a record older than the mark does not answer it, the Go gate writes the unfetched dirs and rebases, a fetched module loses its gate, and an edge insert that raised leaves no record. 117 passed across the retirement and Go-worker files, 121 and 158 in the neighbouring scip sets, 14 in |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit b5ff7ba. Configure here.
Upstream now carries the TypeScript held-edge delta (ClickHouse#2003): a delta that indexed one member lists a reference to a term the index holds no definition of in the file's `held_edges`, and the apply moves one into `edges` when the stored compiler-tier row of its target is a function. Conflicts, both resolved by keeping upstream's rule and this branch's threading: - docs/architecture/rolling-upgrades.md: rule 70 is upstream's held-edge rule, and the skipped-files rule moves to 71. The operations guide's recovery column that names the skipped-files rule now says 71. - scripts/scip_harness/scip_to_delta.py: upstream's `_ts_definition_unseen` and `_held_edges` with this branch's `skips` threading, so `_ts_prepass` takes a `_Skips` and still reads every document of the index. The merge left the converter reading only NUL-separated `--changed-files` lists, so a newline list (what `git diff --name-only` without `-z` writes, and what the held-edge tests write) was one name with a trailing newline: the delta matched no document and carried neither `edges` nor `held_edges`. A list that holds a NUL is still split on NUL only, so a name holding a newline survives; a list with no NUL is split on its lines. The held-edge test now passes this branch's required `tier` to `apply_delta`, and its store double answers `scip_stale_marks`. Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
|
Merged upstream main ( The merge collided with #2003, which landed upstream while this branch was open: both claimed rule 70 of One compatibility fix the merge needed, and it is worth naming because it is a contract change on our side rather than a defect upstream: this branch's 454 passed across the seven files this touches, with a ClickHouse on the path for the real-SQL ones; 293 in the kind-prepass and doc-link pair. |

Closes: #1701
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
A compiler-tier pass no longer fails on one SCIP document that cannot be decoded or converted, such as one with a string that is not UTF-8: the document is skipped and logged, the rest of the index is applied, and the file keeps its compiler rows, marked stale.
LOOM_CODE_SCIP_STOP_ON_FAILED_DOCUMENT=truefails the pass on such a document instead.Why
_stream_documentsparses each document withParseFromString, and nothing caught a failure, so one bad document ended the run. The tier wrote no delta and kept its watermark, and the next pass indexed the same tree and hit the same document. scip-typescript can write a string field that is not UTF-8, which python-protobuf refuses (DecodeError: String field had bad UTF-8). One file that cannot be processed should not fail the whole repository's pass.Every tier converts through
convert_deltainlib.shand runs its harness throughcompiler_tier.run_harness, so each change below covers C++ and its full run, Python, TypeScript and Go alike._stream_documents;_ctor_overloadsnow does too, instead of parsing records itself. The skipped documents are kept per run (_Skips, created by eachDeltaStream), not in module state.stats.skipped_failedand the summary line, and lists inskipped_filesthose among the files it converts (the window's, or every file in a full run). A failing document outside the window is warned about and counted, but not listed, so no later delta marks it again. A document whose path cannot be read (a path that is not UTF-8 among them) is counted by its place in the index, so two of them are two. In a run over every document (the TypeScript and Python full runs, which name no files), such a document fails the run before anything is applied: the worker retires the live files a full delta does not name, and this one's file would be among them.gone_documentsleaves the skipped paths out, so a full TypeScript or Python run keeps their rows, as a window does.apply_delta(an upload's is the tier whose watermark its producer moves). The apply writes onecode_index_staterow per skipped file,scip_stale:<tier>:<path>holding the delta's commit, and empties the row of each file of that tier this delta applied or deleted. All of these go in one insert per apply. The mark is filed under the applying tier, so a path no tier's suffixes name (a.cufile in a C++ index) is marked under the tier that skipped it. A tier reads and writes only its own marks, so two tiers applying side by side keep both. A file both converted and skipped (two documents of one path, one of them failing) is not applied: its rows stay as they are, marked stale, since the converted document alone would drop what the failed one defined. A path indeleted_filesthat is also skipped is not deleted either, as in the full run. A skipped path the entry's scope or path denylist refuses is never marked, since no delta would clear it.scip_stale_paths, which already decidesscip_stale_filesforcode.callersandcode.callees, reads the marks of the asked paths by key (each path under each tier) and treats a marked file as stale. Before, a moved watermark made those rows read as current. The whole-namespace state reads (all_state,all_state_many, behind the as-of block,code.index_statusandcode.repos) leave these rows out. A mark counts on every read while it is set (_marks_in_force, whichscip_stale_pathsandscip_stale_marksshare). This build empties it when it applies the file, after every round of that apply has landed, or, for an entry whose tier this build's worker runs, when a pass of that worker finds a later apply of the file published (retire_published_marks): the tier's watermark holds another blob of the file than the mark's commit in the entry's mirror. A Python, TypeScript or C++ worker moves its watermark only after a whole apply of the window, and the previous build fails a run on a document it cannot read, so that watermark is a completed apply whichever build wrote it, whether or not the apply rewrote a row of the file (a change to a function body alone rewrites none). An upload batch whose apply fails leaves the watermark to a later batch that does not apply its files, so the pass keeps every mark older than the namespace's newest failedcode_scip_applybatch (scip_marks_retirable); batch records expire after 30 days. The Go worker passes a module it could not fetch without a retry, so a Go mark also needs a compiler-tier row of the file written after it. A namespace fed by uploads alone, applied bycode_scip_apply, has no mirror to check and keeps the mark until this build applies the file.run_harnesslogs the first five warning lines and the count. Before, only the exit code was read on success, so no tier logged them.code_scip_stop_on_failed_document(default false).run_harnesspasses it to the harness asSCIP_STOP_ON_FAILED_DOCUMENT, andconvert_deltaadds--stop-on-failed-document, which re-raises the first failure, asmaindoes._top_level_recordsraises when a record's length runs past the end of the data. Before, the slice came back short and the parse of that last document failed, so a truncated index failed by accident; with per-document skipping it would have converted._document_pathreturns""for a payload it cannot read, and for a path that is not UTF-8, which it no longer decodes with replacement characters into a name no file has.xargsjob, whoseconvert_delta … | tail -1tooktail's status, so a failed conversion dropped the module and the watermark moved.run_modulesetspipefailand returns 1 on a failed conversion. With the switch on, the Go run now fails like the others. With it off, a conversion that fails as a whole (a truncated index, a crash outside the per-document skip, a killed converter) now fails the Go pass and keeps the watermark, where before it dropped the module.delta_version2; one that lists none stays 1. The converter writes the version last, since a document that fails to convert is known only once the files are written.code_scip_applyapplies both. A build without this change applies version 1 only and ignoresskipped_files, so it refuses such an upload instead of applying it without the marks.ctor_callsclaim (DeltaStream.tailneeds_Run.ctors_completeas well as an emptyskipped_files, which holds the window's files only; the harness's--fullrun always passes a window): the skipped file may hold the only factory call, and with the claim set and no edge for it,code.callerswould read the empty answer as exact. A claim an earlier clean full run already made is withdrawn on read: while any compiler-tier file is marked stale,_ctor_edge_coveragecounts the compiler tier as not carrying constructor calls, so an empty constructor answer fromcode.callers,code.calleesorcode.verifystays alower_boundwithctor_edges_absent. That lifts once this build converts the file; the claim itself comes back with the next full run that skips none. The probe caches thescip_ctor_callsbit an hour per namespace, but reads the marks on every call while the bit is set, so a new mark or its retirement shows on the next answer. That read is one query per empty constructor answer, over the tier'sscip_stale:keys incode_index_stateonly._ctor_overloads) reads every document, the window's and the rest. When it skips one, that document may declare a type's only constructor, or one more overload of a type the scan found, so a factory call converted without it would lose its edge and the apply would retire the edge the file had. A document with a factory call is then skipped as well (_OverloadsIncomplete): it is listed inskipped_fileswhen the delta converts it, so it keeps its rows and is marked stale. Documents without a factory call convert as before.code.callersandcode.calleesread staleness for the paths of the edges they return and for the seed's own path when the compiler tier covers it. A seed in a skipped file with no edge, such as a function whose first call, or its first caller in the same file, came in the skipped revision, is alower_boundwithscip_stale_files, notexact. An incoming answer also reads the namespace's marks once per query (_marked_stale): a marked file may hold the seed's first caller although it is neither a seed path nor the path of a returned edge. The read is bounded, since a full pass can mark a whole source tree:scip_stale_samplestops at a LIMIT of three paths, enough to say that a mark exists and to name files in the note, and the PR pack's line and the constructor probe, which need only a boolean, ask for one. A cleared mark, an empty row, is not in the sample either. While any mark is set,code.callers,code.impact, the grep neighbours' callers, the PR pack's callers line and thecode.symboluses block are alower_boundwithscip_stale_files, andcode.test_gatelists the cause beside its other graph causes. The callers note names up to three marked files. A failed read of the marks counts as a mark.scip-full --apply-deltais read byopen_delta, which now refuses adelta_versionthe build does not apply (DELTA_VERSIONS, inscip_delta.py, whichcode_scip_applyreads too), as the worker does for an upload. The previous build's CLI applies a retained version-2 file as version 1: a skipped file's partial entry replaces its rows and no stale mark is written. Rule 70 says to apply a kept file with the CLI of the build that wrote it during a rollout or a rollback.Scope and risk
The converter,
lib.sh, the Go harness,compiler_tier.py(_attempt),delta_file.py,scip_delta.py(retire_published_marks),gitrepo.py(a strict read ofblob_paths_at, andblob_ids), thecode_scip_applyversion check,scip_stale_paths,scip_stale_marks,scip_stale_sampleandscip_marks_retirablein the store, the constructor-coverage probe and the stale read of the seed paths incoverage.pyandgraph.py, the namespace's marks read by every incoming answer (impact.py,gate.py,neighbours.py,packs.py,symbol_uses.py), one setting, docs and tests. A run without--changed-files(a TypeScript or Python full run, Go--full, a direct upload) fails, and keeps its watermark, on a failed document whose path cannot be read, until the indexer writes a readable one; a window does not. A skipped document is never repaired: its parser-tier rows are unaffected, its compiler rows stay as the last successful conversion left them and read as stale until a delta converts the file again. The stale marks arecode_index_staterows, one per skipped file, so no migration is needed. A cleared mark stays as an empty row, which no read returns. A refresh that fails between its symbol and edge inserts leaves the mark counting until an apply of the file by this build completes; no watermark write retires it, whether from a completed apply that does not name the file, a window with nothing to apply, or the delta after a failed weekly C++ full run. The previous build never empties a mark, so a file it refreshes, during a rollout or after a rollback, stays stale and keeps constructor answers alower_bounduntil, for an entry this build's tier worker runs, its next pass finds the refresh published, or until it applies the file itself. A failed upload batch newer than a mark keeps it until this build applies the file, and a Go refresh that rewrites no row of the file keeps it too. A namespace fed by uploads alone keeps the mark until this build applies the file. A Go tier keeps its marks while it owes a module retry, a mirror that lacks the watermark's commit or cannot answer keeps them all, and one that lacks a mark's commit keeps that mark. A marked file that the previous build deletes is never applied by this build again, so each apply of the tier also empties the marks of paths that have no blob at the delta's commit in the entry's mirror (_gone_at, onegit cat-file --batch-checkwhen marks are set); a mirror that cannot be read, or lacks the commit, keeps the mark. Namespace removal and the purge drop them with the namespace's other state. An index that cannot be read to its end now fails the Go tier too. An index that cannot be read to its end still fails the run, with or without the switch. A converter bug that broke most documents would skip them all and mark them stale rather than fail; an operator who wants such a run to fail sets the switch. While one document of a C++ index fails to decode, every changed file with a factory call is skipped and marked stale too, until the indexer writes that document again. A seed in a file the fast tier rewrote after the compiler tier's last run now reads stale in both directions, as its edges already did. While one file of a namespace stays marked, no incoming answer in that namespace isexact: the price of not knowing which seed the skipped document calls.code.impactandcode.test_gateread the marks only: as onmain, neither compares its seed paths with the fast tier's rows.Compatibility, rollout and rollback
skipped_filesandstats.skipped_failed, and one that lists a skipped file isdelta_version2. An older server ignores the two fields and refuses version 2.unsupported delta_version 2) and leaves the tier's watermark, so no old rows read as current;loom code scip-retry <batch_id>applies it once this build runs them. A delta with no skipped file stays version 1, which both apply. When the previous build applies one that converts a file this build marked, it leaves the mark and moves the watermark past the refresh; its rows cannot show that both inserts landed, so this build reads the file stale until, for an entry this build's tier worker runs, its next pass finds the refresh published (the watermark holds another blob of the file than the mark's commit, and no upload batch of the namespace has failed since the mark), or until it applies the file itself. A namespace fed by uploads alone keeps the mark until this build applies the file. The in-server tiers apply the deltas their own build's harness writes. A kept delta file read by the previous build'sscip-full --apply-deltais applied without its skipped files, so it is applied with the CLI of the build that wrote it. The rolling-upgrade rules gain this as rule 70.LOOM_CODE_SCIP_STOP_ON_FAILED_DOCUMENT=truerestores the old failure.scip_stale:row, emptied ones included, comes back in its whole-namespace state reads: the as-of block, coverage,code.repos, the tier-health sweep andcode.index_status. Before or after the revert, remove them with a lightweight delete; no request waits on it:DELETE FROM loom.code_index_state WHERE startsWith(state_key, 'scip_stale:').Tests
tests/unit/test_scip_to_delta_skip.py:test_a_document_with_a_string_that_is_not_utf8_is_skipped_and_listedruns the command line on a two-document index whose second document carries invalid UTF-8: exit 0, only the good document infiles,skipped_files == ["src/bad.cpp"], the count in the stats and the summary line, one warning,delta_version2. Onmainit exits 1 on theDecodeError.test_the_switch_stops_the_run_on_a_failed_document: with--stop-on-failed-documentthe run exits non-zero on theDecodeErrorand writes no delta.test_the_harness_passes_the_switch_to_the_converterrunsconvert_deltafromlib.shwithSCIP_STOP_ON_FAILED_DOCUMENTat 1 and 0: it fails and writes nothing, or succeeds and writes the delta. The 0 case fails onmain.test_a_document_that_fails_to_convert_is_skipped_and_listedmakes_convert_documentraise for one document: the other converts and the warning names the path and the error; a module prefix applies toskipped_files; a secondDeltaStreamleaves the first one's record as it was. OnmaintheKeyErrorescapes.test_a_window_lists_only_its_own_failed_documents: a window that does not hold the bad document counts it but lists nothing, and its delta is version 1.test_a_run_over_every_document_fails_on_one_whose_path_cannot_be_read: the bad document's path is not UTF-8. A full run exits non-zero, names the document and writes no delta; a window counts it and converts. Before, the run exited 0 and listed the path with a replacement character.test_the_server_logs_the_converters_warning_linepins the server's prefix to the converter's.test_a_factory_caller_keeps_its_rows_when_the_overload_scan_misses_a_document:Foo's only constructor is declared insrc/foo.h, which fails to decode, outside a window of the factory callersrc/a.cppandsrc/ok.cpp. The caller is listed inskipped_filesand onlysrc/ok.cppconverts; a full run lists both failed files. With a readable header the caller has itsDB::Foo::Fooedge. On the head before it, the caller converted without the edge and nothing was listed.tests/unit/test_scip_harness_windows.py::test_with_the_stop_switch_a_failed_document_fails_the_run, for the Python, TypeScript and Go harnesses over a real git window: with the switch on, a document that does not parse fails the run and writes no delta. Withoutpipefailinrun_modulethe Go case exits 0 with no delta.tests/unit/test_code_scip_ts_delta_worker.py::test_a_full_run_keeps_a_skipped_documents_rows_and_marks_the_file_stale: a full run whose delta skippedweb/bad.tsretires onlyweb/gone.tsand writesscip_stale:typescript:web/bad.ts. Onmainit retiresweb/bad.tstoo.tests/unit/test_code_scip_skipped_documents.py:run_harnesslogs the first five warning lines and the count (onmainit logs none) and passes the switch..pyfile, applied beside a Python delta that skips another, leaves both Python marks; the store fake lets both reads land before either write.test_a_skipped_path_that_files_or_deleted_files_name_keeps_its_rows_and_is_marked: a delta whosefilesordeleted_filesandskipped_filesboth name one path hands the writer only its other files, and marks the path and clears the mark of the applied ones. On the head before this test, the path went through the key diff or was deleted.test_a_full_run_that_skipped_a_document_does_not_claim_constructor_calls(intests/unit/test_scip_to_delta_skip.py): a full C++ conversion with source whose only factory caller fails to convert lists it inskipped_files, has no factory edge and carries nofeatures. On the head before it, it carriedctor_calls.test_a_full_run_whose_constructor_scan_skipped_a_document_outside_its_files_makes_no_claim(same file): a--fullrun with a window ofsrc/ok.cppwhilesrc/foo.hfails to decode lists nothing inskipped_filesand carries nofeatures; with a readable header it carriesctor_calls. On the head before it, it carriedctor_calls.test_a_skipped_file_withdraws_the_claim_a_clean_full_run_made(intests/unit/test_code_ctor_call_edges.py): withscip_ctor_callsset and one compiler-tier file marked stale,code.callerson a constructor with no edges is alower_boundwithctor_edges_absent. Before, it wasexact.test_a_mark_written_after_the_probe_is_cached_withdraws_exact(same file): threecode.callerscalls on a constructor with no edges in one process, with no cache clear:exactafter a clean full run, alower_boundwithctor_edges_absentonce a later delta marks a file stale, andexactagain once the mark clears, all through one state read. On the head before it, the second call wasexact.test_a_delta_version_the_build_does_not_apply_is_refused(intests/unit/test_code_delta_stream.py):open_deltareads versions 1 and 2 and refuses 0 and 3 withunsupported delta_version. Before, it read any.test_an_upload_that_skipped_a_document_waits_for_a_worker_that_marks_itstages a converted delta that skipped a document as an upload. Under a worker that applies version 1 only, as the build before does, the batch fails withunsupported delta_version 2and no mark or watermark is written; under this build's it applies, marks the file and moves the watermark.tests/integration/test_code_scip_stale_mark.py, against ClickHouse: a file whose document a delta skipped reads stale inscip_stale_pathsafter the watermark moved, and fresh again once a delta applies it;all_stateandall_state_manyleave the marks out. Onmainit reads fresh.test_a_refresh_by_the_previous_build_keeps_the_mark_until_this_build_applies_the_file(same file): this build applies a delta that skippedsrc/bad.cpp, then a clean delta for it goes through the apply without_mark_stale, which is what the previous build runs, and the watermark moves. The file still reads stale,scip_stale_marksnames it and_ctor_edge_coverageclaims no constructor calls. This build's apply of the file then retires the mark, and a mark written after that counts again.test_a_pass_of_this_build_retires_a_mark_the_previous_build_published(same file): with a two-commit mirror, the previous build refreshessrc/bad.pyand movesscip_commit_py, and an apply whose edge insert fails writessrc/other.py, which is unchanged. One pass of the Python worker with nothing to index empties the first mark and keeps the second. On the head before it both marks stayed.test_a_pass_retires_a_mark_the_previous_build_published_without_rewriting_a_row(same file): the previous build applies a body-only change ofsrc/bad.py, which rewrites no symbol or edge row, and movesscip_commit_py; one pass of the Python worker empties the mark. On the head before it the mark stayed.test_a_failed_upload_keeps_the_mark_past_a_later_batch_that_moves_the_watermark(same file): throughcode_scip_apply, an upload markssrc/bad.py, the next batch changes it and fails on its edge insert, and a later batch forsrc/other.pymoves the watermark; the pass keeps the mark. On the head before it the mark was emptied.test_a_watermark_write_by_the_previous_build_keeps_the_mark_over_a_failed_apply(same file): after a skip and a moved watermark, a retry forsrc/bad.cpplands its symbol insert and fails its edge insert; then the previous build's step for a window with no C++ change, the watermark write alone. The file still reads stale with coverage incomplete, and this build's later apply of the file retires the mark. On the head before it, the reads after that watermark write were fresh and complete.test_a_failed_apply_keeps_the_mark(same file): the same failed retry with the watermark unmoved keeps the file stale, and so does the previous build's retry that then lands both inserts and moves the watermark.test_an_apply_of_another_file_keeps_the_mark_over_a_failed_apply: after the failed retry, a completed apply ofsrc/a.cppand a moved watermark;src/bad.cppstill reads stale, and a completed apply of the file retires it.test_a_failed_full_run_then_a_delta_without_the_file_keeps_the_mark:full_indexwith the harness stubbed converts both files and fails the edge insert, soscip_full_atmoves and the watermark stays; a delta that applies onlysrc/a.cppthen moves the watermark, andsrc/bad.cppstill reads stale.test_a_window_with_nothing_to_apply_keeps_the_mark: after the failed retry, the C++ delta worker's_run_repomeets a window whose harness writes no delta and moves the watermark; the file still reads stale.test_a_mark_for_a_file_the_previous_build_deleted_is_emptied_by_the_next_apply: over a two-commit git mirror, this build markssrc/bad.cpp, the previous build deletes it, and this build's apply of another file at a commit the mirror lacks, or at one that still holds the file, keeps the mark; its apply at the commit without the file empties it and constructor coverage is complete again. Before, the mark stayed and coverage stayed incomplete for the whole namespace.test_a_seed_in_a_skipped_file_with_no_edges_is_not_exact:src/bad.cppholdscallerandcalleewith no edges,exactboth ways; a delta skips the revision that addscaller's first call tocallee.code.calleesoncallerandcode.callersoncalleeare then alower_boundwithscip_stale_filesnaming the file. On the head before it, both stayedexact.test_a_first_caller_in_another_skipped_file_is_not_exact:calleeinsrc/a.cppandcallerinsrc/bad.cppare covered and nothing callscallee; a delta skipssrc/bad.cppfor the revision that adds the call.src/a.cppdoes not read stale and no edge comes back, yetcode.callersandcode.impactoncalleeare alower_boundwithscip_stale_files, andexactagain once a delta appliessrc/bad.cpp. On the head before it, both stayedexact.tests/unit/test_code_stale_marks_bounded.py: a store fake holds 5000 marks, as a full pass can leave.test_a_namespace_marked_whole_is_read_with_a_limitreads them through_marked_staleand expects every query to carryLIMIT {limit:UInt32}with a limit of at most four, and a sample of exactly four (the note names three);test_the_pack_line_stays_a_lower_bound_over_a_bounded_readexpects the same bound and the linelower_bound (scip_stale_files);test_a_failed_read_still_counts_as_a_markexpects the unread placeholder;test_stale_note_marks_that_there_are_more_files_only_when_a_fourth_is_sampledexpects no ellipsis for three files and one for four. The first two failed on the head before it (the query had no LIMIT). Intests/integration/test_code_scip_stale_mark.py,test_the_bounded_mark_read_stops_at_its_limit_and_skips_a_cleared_marksets six marks and gets four from the sample and one when asked for one, then clears them one by one: the sample never returns a cleared mark and is empty after the last.test_a_file_marked_stale_anywhere_makes_the_callers_a_lower_bound), thecode.symboluses block (test_exact_only_when_every_seed_file_is_compiler_indexed) and adds the cause tocode.test_gate(test_a_cut_coverage_read_is_a_cause_and_a_test_only_change_has_none); each failed on the head before it. The two constructor tests above now also listscip_stale_files, and the store stand-ins of the incoming-answer test files take ascip_stale_sample, and the callers note no longer counts files, since a sample cannot.tests/unit/test_code_stale_marks_note.pydrives the PR pack's callers line (exact with no mark, a lower bound with one, absent when the read fails) and the callers note when the marks cannot be read.tieris a required keyword ofapply_delta: every test call passes one, theapply_deltastand-ins of four worker test files and the tier-health test take it, the batched-state test expects thescip_stale:filter ofall_state_many, the store stand-ins of four test files takescip_stale_sample, and the converter stubs of two test files follow its new signatures.mainate89cc858f, every extra installed: the skipped-document, delta-stream, constructor-call, constructor-remainder, apply-round, entry-lock, the four compiler-tier worker, converter-skip, harness-window, callers-candidate, epistemic-envelope, structural-verdict, pre-merge-input, batched-state, tier-health, any-namespace and scope-enforcement tests, 502 passed and 1 skipped, and the tunable-constant, public-copy and doc-link tests, 292 passed, on the commit before the last; on the final head the touched unit files give 493 passed. On the final head (mainat67fdb366bmerges without conflict and is not merged in), the nine stale-mark integration tests pass against ClickHouse 26.12, and the converter, constructor-call, envelope, delta-stream and Python and TypeScript converter unit files give 225 passed; a wider set of eighteen unit files gave 653 passed before the last converter edit, which limits the completeness count to the C++ constructor scan.ruff check,ruff format --check, the function-length gate, the mypy gate (no errors:main's Streamed SCIP headers use their model field annotations #1915 fixed thedelta_file.pyheader adapter), the secrets check and the analyzer corpus (no change) pass; this round changes no setting, and the settings, docs-reference and reach-census generators'--checkruns passed on the earlier head; the SDK generators were not run here (CI runs them), and the change touches no wire shape. On the head that mergesmainat583acb7b7, the ten stale-mark integration tests pass against ClickHouse 26.12, the Go worker file gives 90 passed, and 168 unit files around the graph answers, the envelope, the converter, the stale marks, the delta workers and the rolling-upgrade tests give 3056 passed and 43 skipped.ruff check,ruff format --check, the function-length and mypy gates, the secrets check and the settings, docs-reference and reach-census--checkruns pass. On20ccead39, the two new tests and the eight converter, delta-stream, entry-lock and constructor-call unit files around them give 229 passed, the ten stale-mark integration tests pass again against ClickHouse 26.12, and the lint, format, function-length, mypy and secrets gates, the tunable-constant, public-copy and doc-link tests pass. Ona0f86605e, the three bounded-read unit tests and the eleven stale-mark integration tests pass against ClickHouse 26.12, 379 tests across sixteen unit files around the graph answers, the stale marks, the delta workers and the constructor calls pass, and the lint, format, function-length, mypy and secrets gates pass. On60417d589, the converter-skip, converter, constructor-call, constructor-header, constructor-remainder and tunable-constant unit files give 122 passed, and the lint, format, function-length and mypy gates pass. Onc3ae72247, the twelve stale-mark integration tests pass against ClickHouse 26.12, eighteen unit files around the compiler-tier workers, tier health, skipped documents, the entry lock, apply rounds and the stale marks give 621 passed and 1 skipped, and the lint, format, function-length, mypy and secrets gates pass. Onb792baa8b, which changes text only, the doc-link, docs-reference and skipped-document unit tests give 308 passed. The full unit suite was not run here; CI runs it.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code wrote the diff and the tests. Checked: I reviewed the whole diff and its tests; the runs listed under Tests are the agent's, the last on
3906e188f.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.main; no migration is added.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version: no plugin file changed.npm --prefix frontend run build) and its tests pass, iffrontend/changed: it did not.docs/describe the system as it now is, and this description names any operator steps and wire changes: the failure model indocs/operations/code-index-operations.mdandscripts/scip_harness/README.md, and rule 70 indocs/architecture/rolling-upgrades.md.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.Note
High Risk
Changes core compiler-tier apply, versioned delta wire format, and cross-build mark retirement that affect code intelligence accuracy during rollouts and rollbacks.
Overview
Compiler-tier indexing no longer fails an entire pass when one SCIP document cannot be parsed or converted: the harness converter skips it (optional
LOOM_CODE_SCIP_STOP_ON_FAILED_DOCUMENTto fail fast), lists paths inskipped_files, bumps deltas todelta_version2 when any file is skipped, and the server keeps existing compiler rows while writingscip_stale:<tier>:<path>marks. Apply logic gainsscip_appliedrecords,retire_published_markson tier passes, and stricter handling so skipped paths are not tombstoned or partially overwritten.Rolling upgrades document rule 71 (N vs N-1 on v2 deltas and mark retirement). Harness scripts switch git file lists to NUL-separated paths for odd pathnames; factory/constructor edges are withheld when the constructor scan skipped documents, and
ctor_callsnamespace claims drop while stale marks exist.Read-side epistemic answers (
code.callers, impact, test gate, symbol uses, packs) treat namespace stale marks asscip_stale_files/lower_bound, with bounded mark sampling and updated ops/docs/schema for the new setting.Reviewed by Cursor Bugbot for commit aff3758. Bugbot is set up for automated code reviews on this repo. Configure here.