Skip to content

Pin the coverage gate to rustc 1.99.1 and cover the files it flagged - #174

Merged
M3gA-Mind merged 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/coverage-toolchain-pin
Nov 12, 2026
Merged

M3gA-Mind merged 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/coverage-toolchain-pin

Conversation

@M3gA-Mind

Copy link
Copy Markdown
Collaborator

Summary

The coverage job on main has failed since GitHub's stable toolchain moved from rustc 1.99.1 to 1.100.0. The code and tests didn't change, but the per-file line counts did.

The gate's line accounting depends on the compiler, so this PR pins the gate to one toolchain and raises the seven files with tests.

  • scripts/check-coverage.sh installs rustc 1.99.1 with llvm-tools and runs the gate with RUSTUP_TOOLCHAIN=1.99.1. The pin covers only the coverage gate. The other jobs keep tracking stable, and no rust-toolchain.toml is added. A comment explains that the pin is bumped on purpose, together with whatever the new numbers need.
    • The coverage job comes from the shared module workflow, which has no toolchain input, so the pin lives in this repository's coverage script.
  • New tests cover error paths that weren't reached, so the next toolchain bump starts with margin rather than at 90%.
  • Repo::update had an unreachable tail. The last conflicting attempt already returned its own error, so the "retry budget exhausted" error after the loop could never be produced. The budget now sits in the conflict arm's guard, and the dead tail is gone.

Related issue

None. The coverage job is red on main and blocks #141.

API or behavior changes

None. Repo::update returns exactly what it returned before: the last attempt's conflict once the budget is spent.

Validation

Run on our Linux CI runner at b315b64, against main f923a4a, with rustc 1.99.1:

  • cargo fmt --all -- --check: clean.
  • cargo clippy --all-targets --all-features -- -D warnings: 0 errors.
  • cargo build --all-targets --all-features --locked, and RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features: ok.
  • bash scripts/check-coverage.sh twice, each from a clean build: 1677 passed, 0 failed and 4 ignored in each run, with nothing skipped. The per-file numbers are identical across the two runs. The only file below 90% is the one explained below.

The runner has no pasta, so crates/tinybox-jail/src/bwrap/pasta.rs is below 90% there, on main as well (118/154). On GitHub's runner it is at 97%.

Per-file line coverage for the seven files, main vs this branch (covered/coverable), from both runs:

File main, 1.99.1 this branch, run 1 run 2
crates/tinybox-drivers/src/blocking.rs 68/74 (91.89%) 68/74 (91.89%) 68/74 (91.89%)
crates/tinybox-drivers/src/index_store.rs 80/86 (93.02%) 80/86 (93.02%) 80/86 (93.02%)
crates/tinybox-drivers/src/repo.rs 110/121 (90.91%) 115/117 (98.29%) 115/117 (98.29%)
crates/tinybox-drivers/src/template_store.rs 106/115 (92.17%) 110/115 (95.65%) 110/115 (95.65%)
crates/tinybox-host/src/files.rs 118/128 (92.19%) 124/128 (96.88%) 124/128 (96.88%)
crates/tinybox-module/src/tinybus_module/resources.rs 1470/1614 (91.08%) 1496/1614 (92.69%) 1496/1614 (92.69%)
crates/tinybox-sync/src/fingerprint/walk.rs 41/44 (93.18%) 41/44 (93.18%) 41/44 (93.18%)

For reference, main under 1.100.0 on GitHub: blocking.rs 86.96%, index_store.rs 86.67%, repo.rs 89.92%, template_store.rs 89.72%, files.rs 89.84%, resources.rs 89.08%, walk.rs 88.64%.

Tests

  • tinybox-drivers repo::tests (new file):
    • the debug form names the collection but not the backend;
    • a write that fails with anything but a conflict is returned without a retry;
    • an update that always conflicts makes one try per attempt, then returns the last conflict.
  • tinybox-drivers template_store::tests: an import reports a failed insert, and it reports a conflict whose row has disappeared.
  • tinybox-host files::tests:
    • a write past the largest offset is refused before anything is written;
    • a failed flush or sync never publishes the staged file.
  • tinybox-module resources::mapping_tests (new file):
    • an allowlist policy reaches the box spec;
    • file errors keep their stable names;
    • agent37 executes on every platform.
  • tinybox-module resources::tests:
    • a provider that reads more than was asked, or acknowledges a wrong offset, is a backend error, and the bad acknowledgement is not taken as progress;
    • a finished write replays for its own path and refuses another.
  • Deliberately not covered:
    • The remaining blocking.rs, index_store.rs and walk.rs misses are already hit in the merged per-line view. The summary still counts them against a second compiled copy of the crate, the library that other crates' tests link, where they never run.
    • The .map_err closures for read, seek and file-type failures can't be made to fail deterministically.

Documentation

  • scripts/check-coverage.sh: why the gate is pinned and how the pin is bumped.

Checklist

  • The change is focused on one logical change
  • No new #[allow(...)], #[ignore], or relaxed lints
  • No secrets, tokens, or .env contents in the diff or the description

The per-file gate's line accounting depends on the compiler: under 1.100.0
the same tests over the same code count different lines as coverable and
as covered, which turned main's coverage job red when the runner's stable
moved. The gate now installs and uses one pinned toolchain, bumped on
purpose together with whatever the new numbers need.
The last conflicting attempt already returned its own error, so the
"retry budget exhausted" error after the loop could never be reached.
Fold the budget into the conflict arm's guard and drop the dead tail.
Cover the debug form, a failed write, and an exhausted budget directly.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0307053c-eb27-4053-ae85-b57b7727df7e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@tinysweeper

tinysweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: b315b64e1732eb02d956405f21bddc77ab839405

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 8 of 8 files.
Pull request purpose (title): Pin the coverage gat…

Diagnostics and supporting details

Full summary

Pull request purpose (title): Pin the coverage gate to rustc 1.99.1 and cover the files it flagged. Tiny Sweeper completed its review; deterministic results follow.

Review snapshot

Change surface Files Review signal Count
Production 3 Active findings 0
Tests 5 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: Test coverage is assessed from changed tests and lane evidence; execution is not claimed without trusted check data.

Features

  • Internal refactor — Repo::update retry loop ends by returning the last conflict: The per-attempt budget moves into the conflict arm's guard and the dead post-loop "retry budget exhausted" error is removed; the caller still receives the final conflict once attempts are exhausted, and non-conflict errors still return without retry. (crates/tinybox-drivers/src/repo.rs impl<T: Serialize + DeserializeOwned + Send + Sync> Repo<T> {, crates/tinybox-drivers/src/repo.rs fn decode<T: DeserializeOwned>(found: Versioned<serde_json::Value>) -> Result<Ve)

Tests

  • unit — An update whose write fails with anything but a conflict returns that error after a single closure call, and the stored document is unchanged; an update that always conflicts makes one try per attempt (three) and returns the last conflict, identified by its injected-conflict message.: Added in a new repo test module and wired via `#[cfg(test)] mod tests`; the tests lane reviewed the attempt arithmetic as correct and reported no defects. (crates/tinybox-drivers/src/repo.rs impl<T: Serialize + DeserializeOwned + Send + Sync> Repo<T> {)
  • unit — A failed template import insert is reported as an import store error, and a conflict with no stored row is reported as disappeared and leaves the template unknown.: New test extending the template store tests, per the description's Tests section. (crates/tinybox-drivers/src/template_store_tests.rs async fn template_port_failures_keep_the_operation_context() -> TestResult {)
  • unit — A write past the largest offset is refused before any bytes are written, and an injected flush or sync failure prevents the staged file from being published.: New host file-transfer tests using an injected-failure staged file wrapper. (crates/tinybox-host/src/files_tests.rs async fn concurrent_symlink_rename_cannot_redirect_a_staged_write_outside() -> R)
  • unit — Allowlist policies reach the box spec host-for-host and port-for-port, file errors keep their stable names, and agent37 supports execution on every platform while other backends only on supported ones.: New mapping test module registered from the resources module; tests lane found no issues. (crates/tinybox-module/src/tinybus_module/resources.rs fn validate_id(id: &ResourceId) -> Result<()> {)
  • integration — A provider that returns more than the requested bytes or acknowledges a wrong offset surfaces as a backend error, the bad acknowledgement is not treated as progress, a finished write replays for its own path and refuses another.: Added to the resources integration tests; description claims these paths were previously unreached. (crates/tinybox-module/src/tinybus_module/resources_tests.rs async fn agent37_exec_is_admitted_through_the_module_guard() -> Result<()> {)

Findings

No active actionable findings.

Before merge

None.

How this fits together

flowchart LR
  n0["..._port_failures_keep_the_operation_context<br/>changed"]:::changed
  n1["...me_cannot_redirect_a_staged_write_outside<br/>changed"]:::changed
  n2["validate_id<br/>changed"]:::changed
  n3["...exec_is_admitted_through_the_module_guard<br/>changed"]:::changed
  n4["clone"]:::impacted
  n5["storage"]:::impacted
  n6["...annot_publish_unacknowledged_staged_bytes"]:::impacted
  n7["failure"]:::impacted
  n8["io"]:::impacted
  n9["..._bounded_binary_ranges_from_the_workspace"]:::impacted
  n0 -->|calls| n4
  n0 -->|tests| n4
  n0 -->|calls| n5
  n0 -->|tests| n5
  n1 -->|calls| n4
  n1 -->|tests| n4
  n1 -->|calls| n8
  n1 -->|uses| n8
  n1 -->|tests| n8
  n2 -->|calls| n7
  n3 -->|calls| n4
  n3 -->|tests| n4
  n6 -->|calls| n4
  n6 -->|tests| n4
  n6 -->|calls| n8
  n6 -->|tests| n8
  n9 -->|calls| n8
  n9 -->|tests| n8
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 8 files; 2 findings.

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 8 files; 0 findings.

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Tests lane confirmed the retry loop's attempt arithmetic (three attempts give three tries and the last conflict back) and noted new tests assert on real error kinds and messages rather than mocks.
  • Lane summary: The change tightens `Repo::update` so the final conflict is returned verbatim instead of a synthesized "retry budget exhausted" error, and adds tests that pin both that ending and each intermediate attempt count, plus tests for coverage of previously untested file-transfer and import failure branches. The retry loop's attempt arithmetic is correct (three attempts give three tries and the last conflict back), the new tests assert on real error kinds and messages rather than mocks, and the coverage script pin is a deliberate toolchain change with no testable Rust behaviour to cover. No reportable defects found.

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Commits lane answered; no sensitive content in committed files.
  • Lane summary: No sensitive content in committed files.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Description lane confirmed the retry count and returned error are unchanged and that the description's claims match the diff.
  • Lane summary: The change pins the coverage gate to rustc 1.99.1, adds tests for error paths in the drivers, host and module crates, and rewrites `Repo::update`'s retry loop so the per-attempt budget lives in the conflict guard instead of a post-loop error. The retry count and the returned error are unchanged, and the description's claims match the diff. Nothing reportable found.
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.007158
  • Tokens: 787304 input · 10305 output · 246528 cached · 760 embedding
  • Updated: 2026-11-12T19:27:00Z
Head State Pass summary
b315b64e1732 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-12T19:27:00Z)

tinysweeper 0.1.2

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0072

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Nov 12, 2026
@M3gA-Mind
M3gA-Mind merged commit 9f4860b into tinyhumansai:main Nov 12, 2026
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant