Repository navigation
Turn on coverage, CRAP and mutation in every crate - #56
Merged
Merged
Conversation
- turn coverage, CRAP and mutation on for the store crate, thresholds unchanged, and add the git crate its first instance - scope a document by the longest covering directory boundary, so a nested package that is not a member puts it out of scope - keep the coverage of the reads: one populated store read back through the resolver input, the rank and map rows, the detail and impact reads, the scorer reads and the edge neighbours - answer every read and writer over a store missing one table each, and name the dump escapes and dangling references - fail each row statement in turn through a test-only seam, and assert the call answers the store error a real fault makes - pass the raw profile path through the sandbox re-spawn, and give the test git identity explicit variables - split the manifest directory out of the package directory read
A lookup through use bindings is a pure function of the index, the module, the name and the depth, so its answer is kept under exactly that key for the life of the index. A name whose use bindings name it again now costs one walk per depth level instead of one per path, which was about k^8 walks for k such bindings. Every result is unchanged. The local-item check and the use-binding walk move out of lookup into two named helpers. New tests cover a use that names itself, two aliases that name each other, two modules that re-export from each other, and a cycle beside a real binding, each at counts that used to take minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lang crate gets its own tests for every store text and conversion of the resolve types. The extract crate gets tests for an unreadable source file, a repository whose HEAD cannot be read, a missing root, an unknown base and the error texts they give, for an unreadable directory in the walk, and for a target directory beside a nested manifest in a diff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The git helpers of the extract and analyze tests now set the author and committer name and email, and point XDG_CONFIG_HOME at the test home beside HOME and the cleared system and global config. Without an identity, git looks one up from the user and host databases, which on a box whose hostname is not in its hosts file costs a DNS lookup and so an inet socket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The temp dirs of the map, map_git, rank_store and fixture tests were named by process id and time alone, so two tests in one process, as libtest runs them, could share a path at the clock resolution and collide on one store. Each name now also carries a per-process count, so the tests pass under libtest, plain cargo llvm-cov included, as they do under nextest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under load a 32-shard run came near the CI test time limit, since a shard could hold several large random-byte inputs. With ten cases per shard the slowest takes under half the limit even with twice as many tests as cores. Every one of the 2000 cases still runs, and the smoke still asserts no panic only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lang, lang-rust, extract and analyze instances turn on their coverage, CRAP and mutation layers with every threshold unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whole items only: the two hand-built bucket cases move from the scorer test file into a module under its test directory, leaving a same-named test that calls each one. No logic, name or output changes; the scorer file is back under the line cap.
Both crates' rust-tops.yaml enable the coverage, crap and mutation layers, with every threshold unchanged, and RUST-TOPS.md at the root says how the gate runs and which figures govern. The MCP tool parsers read their arguments as one list and report the first bad one, as each read did before. The JSON-RPC handling, the line framing, the server loop, show and status are split into named steps. Every reply is byte-identical. New tests cover a data directory others can write, an open repos directory, a database that is not SQLite or has an older schema, an index path that is not a directory, a watch whose stdout is closed, a status with no stored root, an interrupted read, and the server loop's exits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
map refuses a budget outside 1 to 100000 as usage before any index is read. show keeps exactly 100 members untruncated and sets truncated at 101. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The synthetic repositories and the version test's rev-parse each run git with a fixed author and committer, no system or global config, and HOME and XDG_CONFIG_HOME in the test's temp dir. With no identity, git derives one from the host name, which costs a DNS lookup, so the suite opened inet sockets through its own git children. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…refused A message with a result or an error and no method is a client's response and gets no reply. One with no method and neither is refused with "method must be a string". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With any one page of graph.db zeroed, map either answers in full or fails with one error envelope, never a panic or a partial reply, and a page it reads past the store's own checks fails as the store's error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each read_line and answer call in their unit tests runs in a thread and must return within 10 s: every input ends in a line, the end of input, or an error. A read that loops forever now fails its test at once instead of running until it is stopped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second swap writes its replacement first and renames it over the lock, so the new file cannot land on the freed inode number; the unreadable-directory case probes the mode-000 directory after closing it and stands down with a printed reason where the process still reads it, which uid 0 does.
Each read is a reader that prepares, queries and passes every row through collect_rows, and a mapper that owns the row body. A column the struct does not carry, or the placement mark, is read by the reader and passed in. No logic or SQL change.
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.
Turns on coverage, CRAP and mutation in every crate's
rust-tops.yaml, keeping each crate's own thresholds, and lifts every crate to them. Product behavior does not move: every index row and every CLI and MCP reply is byte-identical to the base.What changes
coverage,crapandmutationare on in every crate.phantom-fractal-gitgets its firstrust-tops.yaml, as alibrary-corecrate. No threshold moves.#[cfg(test)]fault-injection seam so the real error paths are exercised. The seam does not exist in non-test builds.lookupis memoized on its full input key, which removes an exponential re-entry on self-referentialusebindings. Results are identical by construction, and a differential run over the fixtures and fuzz cases is byte-identical.RUST-TOPS.md. A new root file pointing to the rust-tops protocol. It records the class and thresholds of each crate, how to run the gate, the CRAP baseline rule, and known deviations.Checks
fmt, clippy (
--workspace --all-targets --all-features --locked -D warnings),cargo deny checkand nextest all pass. No new package, no new crate, no.githubchange.🤖 Generated with Claude Code