Repository navigation
[CTX-1185] feat(dynapi): grant-revocation renewal semantics for provided APIs (#2005) - #2048
Conversation
|
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 36 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. Comment |
Xuepoo
left a comment
There was a problem hiding this comment.
Independent review verdict (guard cron / separate agent reviewer)
Commit reviewed: db558a8fd (branch carryctx/ctx-1185-dynapi-gating, PR #2048)
Verdict: REQUEST_CHANGES
Checks run (read-only, against the PR checkout):
git log --oneline -1 && git show --stat HEADgit show HEAD -- crates/bitty-runtime/src/plugin_runtime/services.rsgit show HEAD -- crates/bitty-runtime/src/plugin_runtime/mod.rsrg -n 'std::net|std::process|TcpStream|UdpSocket|Command|std::fs' crates/bitty-runtime/src/plugin_runtime/services.rsrg -n 'E_SERVICE_RESOLUTION|E_SERVICE_GONE|revocation|narrowed|generation' crates/bitty-runtime/src/plugin_runtime/services.rs
Findings:
- The diff is documentation + test only (
services.rs+52,mod.rs+19, 0 deletions) — no runtime behavior changed. The renewal/revocation enforcement the PR says it finishes is pre-existing code this commit neither modifies nor newly verifies. - The new test
grant_narrowing_on_renewed_snapshot_fails_closed_without_restart(services.rs~5451) models "a renewed generation" by directly callinghost.set_granted_capabilities(Vec::new()); it never exercisesreload/re-activation or store-backed re-resolve, so the PR's central claim (renewal through the package source narrows the snapshot) is named in the test title but not actually tested. - The new doc on
set_granted_capabilities(services.rs~2231-2240) and onreload(mod.rs~1843-1861) assert specific reload/revocation semantics with no test and no code change in this commit (store-backed re-resolve vs dev-root LocalPath reusing the discovered manifest; live generations never observe revocation retroactively);reload's new doc also duplicates the pre-existing doc block on the same function. - Good, and not contradicted: "no new ambient authority" holds — no
std::net/std::process/TcpStream/UdpSocketon the resolve/call path (Command*hits areCommandRecord/CommandDirectory/CommandBlock, notstd::process::Command); the only fs reference is the pre-existingstd::fs::File::openatservices.rs:366, off the resolve/call path.
Do not merge until the renewal path is actually exercised (reload / store-backed) or the claims are narrowed to what the test proves.
Xuepoo
left a comment
There was a problem hiding this comment.
Independent review verdict (guard cron / separate agent reviewer) — re-review
Commit reviewed: 0d4c245b443775f7ca2e40e03db0c4f4038b78ee (branch carryctx/ctx-1185-dynapi-gating, PR #2048)
Supersedes the REQUEST_CHANGES at db558a8fd.
Verdict: APPROVE — prior REQUEST_CHANGES resolved.
Verification of the fix delta (git diff db558a8f..HEAD):
- Doc/test only.
git show --stat HEAD= 2 files, +15/-43; the only non-comment lines touched are the test fn name and itsexpect()strings. No runtime statement added or removed (services.rs:2235-2240,5443-5482). - Duplicated reload doc removed. The
mod.rshunk is pure deletion (19 removed, 0 added) of exactly the previously-added reload doc block, restoring the docstring to its pre-db558a8fstate (mod.rs:1843); the pre-existing# Errorsdoc is preserved. - No unproven claim remains. The new doc at
set_granted_capabilities(services.rs:2231-2233) claims only that narrowing a live generation's snapshot closesservice_resolve/service_callon the next lookup/call — exactly what the test exercises. The store-backed re-resolve /LocalPath/ "immutable until renewal" prose is gone. - Test rename faithful.
narrowing_grant_snapshot_to_empty_fails_closed_without_restart(services.rs:5446); comments/expect()strings narrowed to the proven invariant (narrowed-to-empty snapshot fails closed for required resolve, optional nil, call-as-gone; re-widening serves again); assertions unchanged (E_SERVICE_RESOLUTION,E_SERVICE_GONE).
Fix author evidence: cargo check -p bitty-runtime --tests --offline exit 0; cargo test -p bitty-runtime --offline narrowing_grant_snapshot_to_empty_fails_closed_without_restart exit 0 (1 passed). just ci-local not run (lane lock).
Residual non-blocking note: the new sentence sits under a pre-existing sentence inherited from before db558a8f, mildly redundant — not introduced by this commit, not a blocker.
Xuepoo
left a comment
There was a problem hiding this comment.
Commander pre-merge check: full CI green on post-update head, no CodeRabbit findings outstanding. Merging.
Finishes #2005 (dynapi 2/4) on top of #2037 backing-heads: #2037 already covers unbacked rejection, grant-cover resolve/call, confused-deputy and head-spoofing hostile tests (all re-verified green here). This PR closes the one open acceptance point: revocation timing.
rg evidence (crates/bitty-runtime/src/plugin_runtime/services.rs, resolve/call path): no std::net / std::process / tokio net-process / Command / TcpStream / UdpSocket / std::fs matches.
Gates: fmt clean, clippy -D warnings clean (workspace), runtime lib 269 passed, plugin_services 10 passed, plugin-host lib 404 passed, windows target check clean, verify_w147_small_core_graph 9/9. ci-local blocked by the same pre-existing sccache GHA-backend failure under act as PR #2047; scratch-paths fails pre-existing in untouched wsl.rs/component.rs.
Follow-ups (not this PR): qualified-form x gating interaction tests once #2047 merges; store-backed reload-revocation integration as future hardening.
Priority: P1 | Area: plugins | Labels: feat,P1,area:plugins | Milestone: v0.1.0 | Task: CTX-1185
Closes #2005