Repository navigation
fix(id): repair 5 failing lib tests blocking the NixOS system build - #3211
Conversation
…w lock The guard asserted the raw Cargo.lock names no SQLite-family crate. #2276 dev-depends on rusqlite (bundled) for the bridge PoC's hosted store, and the lock resolves dev-dependencies too, so the text scan false-fires even though the shipped store is still redb and nothing that ships links SQLite. The test now parses the lock into the resolved package graph: a SQLite-family package may appear only when every package depending on it is SQLite-family itself or this package, and this package's manifest is checked section by section so SQLite names may be declared only under dev-dependencies. A shipped dependency pulling SQLite in, or the manifest moving rusqlite out of dev-dependencies, still fails the guard, as do a missing p2panda-sync or the vendored p2panda-store line losing default-features = false. Refs #3160
…ration #565 migrated roc-counter from a bare text view to rendering through pf.Screen, a boxed 20x3 structured screen. Rendering the screen costs more wasmtime fuel than returning a string: View now measures 260,269 and Layout 323,425 against the stale 100,000 budgets (pre-migration baselines were 1,327 and 1,337). Regenerated with the shipped print_fuel_baseline generator under the table's own rule (baseline +25%, rounded up to the next 100,000): View 400,000, Layout 500,000. Both measurements match the failing nix build log exactly; no other row's budget changes. The `id world measure` test carries its own bound (worst call < 1% of the 10,000,000 fuel limit) — the same pre-Screen assumption. Update it consistently with the re-baselined envelope: the worst call is Layout at 3.23%, and the largest per-call budget the table allows this module is 500,000 = 5% of the limit, so the bound is now < 5 percent with the tie to FUEL_BUDGETS spelled out in a comment. Refs #3160
Compile test: roc-counter's main.roc imports pf.Screen and pf.RocText, and the compile gate admits only capabilities the world has granted. The test world granted nothing, so the gate correctly refused the compile. Grant both through world.update_caps, the same admin path as `id world caps --grant`; the ceiling check itself is untouched. Upload test: the module's view now returns a pf.Screen frame, so the snapshot/event data assertions expecting bare "count=0"/"count=1" text now parse the screen JSON, assert kind == "screen", and assert a row shows the expected count. Both tests share a small assert_screen_data helper. Refs #3160
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Fixes #3160
What
Five
pkgs/idlib tests failing on main, which also fail theidpackage's nix check phase and therefore block every NixOS system build (id→unit-id-primary.service→system-units→etc→ toplevel). Three unrelated drifts, three commits:store_traits.rs)sandbox.rs,commands/world.rs)web/world_ws.rs)Diagnosis and rationale
1. The guard read the raw lockfile; the lock is not the shipped graph
The store is redb. The 2026-10-12 guard asserted the raw
Cargo.locknames no SQLite-family crate, keeping SQLite out of the shipped build while p2panda-sync is vendored withp2panda-store's sqlx/SQLite backend disabled (vendor/README.md). #2276 then addedrusqlite(bundled) as a dev-dependency for the bridge PoC's DO-shaped hosted store. Dev-only — it never ships — but the lock resolves dev-dependencies too, so the text scan false-fires.The test now parses the lock into the resolved package graph (name/version/dependency edges, exactly as cargo records them) and asserts what the guard always meant:
dev-dependencies(if it stopped declaring them at all, the guard would lose track of the family's dependents and fail loudly instead);p2panda-syncmust be wired in the lock, and the vendoredp2panda-storemust keepdefault-features = false.The PoC and its dev-dependency are untouched, and the shipped graph still contains no SQLite: the only family members in the lock are rusqlite 0.32.1 and libsqlite3-sys 0.30.1, reachable solely from the root package's dev edge.
2. roc-counter outgrew its fuel budgets when it learned to render a screen
#565 migrated roc-counter from a bare text view to rendering through
pf.Screen(a boxed 20×3 structured screen). Fuel is wasmtime's per-call execution budget, and the FUEL_BUDGETS table is the regression guardrail for it (baseline +25%, rounded up to the next 100,000). Rendering the screen genuinely costs more: View measures 260,269 and Layout 323,425 against the stale 100,000 budgets (pre-migration baselines were 1,327 / 1,337). The new numbers are the same order as roc-screen's honest baselines for the same Screen rendering (123,675 / 378,384), and they reproduce exactly in the failing nix build log and locally. Regenerated with the shippedprint_fuel_baselinegenerator: View 400,000, Layout 500,000; no other row's budget changes.The
id world measuretest does not read FUEL_BUDGETS — it carries its own bound: the module's worst call must stay under 1% of the 10,000,000 default fuel limit. That 1% was the same stale pre-Screen assumption (the worst call is Layout at 3.23% now). The bound is updated consistently with the re-baselined envelope — largest per-call budget the table allows this module is 500,000 = 5% of the limit — with the tie to FUEL_BUDGETS spelled out in a comment so the two move together next time.3. The world_ws tests predated the capability grant model and the screen frame
main.rocimportspf.Screenandpf.RocText. The compile gate admits only capabilities the world has granted (the server ceiling inWorldLimits::default()already covers the full catalog), and the test world had granted nothing — so the gate correctly refused. The test now grants both viaworld.update_caps, the same admin path asid world caps --grant. The ceiling/grant check itself is not weakened.pf.Screenframe instead of bare text, so the snapshot/event payload is the screen JSON. The expectations now parse that JSON, assertkind == "screen", and assert a row showscount=0/count=1(the row text itself is exactly what the screen renders, padding included), via a small shared helper used at all four assertion sites.Verification
--release --lib --features webbuild; the fuel-budget test passes with the re-baselined table.nix build .#id-webfrom the repo root (the package the NixOSid-mailmodule consumes) — check phase green: lib suite 1976 passed, 0 failed, 6 ignored, all five fixed testsok, output at/nix/store/h5jp2vrmfz9hl38jzlhqxw6ljjaq7am4-id-0.1.0. A first attempt's check phase failed only on the twolog_synctests in the note below; the retry passed everything.rustfmt --checkclean on all four touched files. No tests deleted, excluded, or ignored; no production behaviour changes.Note: pre-existing
log_synctiming flake (not this change)log_sync::tests::test_batch_collection_coalesces_paced_arrivalsandtest_batch_collection_refused_stream_ends_at_the_total_caprace a 2 ms test pacing thread against the production 5 msBATCH_GRACEwall-clock idle window; under heavy machine load (parallel builds running) they intermittently split or end the batch early (observed: batch lengths 2-of-3 and 1-of-256). They are untouched by this diff, passed in the original failing system build, and pass when the machine is not saturated — 26/26 solo re-runs at moderate load, and both green in the successful nix run above. Filed separately as #3199 with the full evidence and a suggested seam. Separately, one local-only failure (web::tests::test_load_asset_urls_from_manifest) was an artifact of the placeholderweb/distin the local worktree; it passes in the nix build, which compiles the real hashed assets.Need help on this PR? Tag
@codesmith-botwith what you need.