Repository navigation
Description
Context
CI (.github/workflows/ci.yml) runs changes, plan, ci-scripts, deps, hermetic, pg-adapter, contract and mutants, and then gate, the only required check. gate's needs list is at ci.yml:211; when Rust changed, every job it needs must report exactly success (.github/scripts/assert-gate.sh:12-14,39-40). docs/src/architecture/cicd.md:79 lists cargo fmt, cargo clippy and any licence or dependency audit as "Not in CI", and the repo has no deny.toml, clippy.toml, rustfmt.toml or [workspace.lints]. scripts/check-deps.sh:13 forbids 17 crates, including sqlx and lapin, but it checks them only in thrust-contracts, thrust-ports, thrust-core and thrust-api (line 14) and in thrust-adapters-memory (lines 30-37).
Problem
- Clippy deny list. ADR-0006's panic policy says "clippy denies
unwrap_used,expect_used,panicandindexing_slicingin core, ports and adapters (not yet enforced: a P0 task)" (ADR-0006:99). Withpanic=aborton the Worker, a panic fails its own request and can fail other requests on the same isolate: 1 in 328 on the real platform (ADR-0006:130). The adapters callunwrapandexpecttoday, for example the memory adapter's lock unwraps andPgTx::client(crates/thrust-adapters-postgres/src/lib.rs:383). - ORM crates. Through Hyperdrive, named prepared statements work only as
pgandpostgres.jsimplement them, andsqlx, SeaORM and diesel-async rely on them (research/0004§10.4 F1). ADR-0044 (round 29, line 36) accepts hand SQL ontokio-postgresand makescheck-deps.shforbidsqlx,sea-ormanddiesel, yet nothing stopssea-ormordieseltoday.sqlxis also not checked inthrust-adapters-postgresor the roots, which is where it would land. - Supply-chain gate. ADR-0101 (accepted, line 37) and ADR-0100 (line 80) require a Rust supply-chain gate (
cargo-deny,cargo-vetorcargo audit). None runs.
Proposal
check-deps.sh: add a loop over the whole workspace on both targets (cargo tree --workspace -e normal --target all -i <crate>) forsqlx,sea-orm,dieselanddiesel-async, and exit non-zero on any hit.- Clippy:
- Set
[lints.clippy]unwrap_used,expect_used,panicandindexing_slicingtodenyinthrust-core,thrust-portsand the four adapter crates. - Add a
clippy.tomlthat setsallow-unwrap-in-tests,allow-expect-in-tests,allow-panic-in-testsandallow-indexing-slicing-in-teststo true. - Add a
lintjob that runscargo clippy --workspace --all-targets -- -D warningsnatively andcargo clippy -p thrust-worker --no-default-features --target wasm32-unknown-unknown -- -D warnings. - Fix each existing call, or keep it with an
#[allow]that states the reason.
- Set
- fmt: run
cargo fmt --all --checkin the same job. - cargo-deny:
- Add a
deny.tomlwith[licenses](an allow-list compatible withAGPL-3.0-only,Cargo.toml:22),[advisories],[bans](denysqlx,sea-ormanddieselagain, as a second guard) and[sources](crates.io only). - Install the tool through
taiki-e/install-action, pinned by SHA like the other actions. - Ignore RUSTSEC-2023-0071 explicitly (the
rsacrate, the "Marvin Attack", CVE-2023-49092: its private-key operations are not
constant-time, so timing observable over the network can leak a private key; no patched version exists, andrsa0.9.10, the version
inCargo.lock, and 0.10.0-rc.18 were both still affected on the advisory's 2026-09-12 note). Put theignoreindeny.toml's
[advisories], with its reason written beside it, and keep it the only ignore. Why it does not apply to us:rsaenters through
openidconnect4.0.1, which should use it only to verify RS256 ID-token signatures with the issuer's public key (confirm that against
the crate's source when writing the ignore), so there is no private key on our side to leak; and throughthrust-contract-tests,
whose mock IdP signs with a throwaway key on127.0.0.1inside the test
process. Add a note to re-check it wheneverrsaoropenidconnectis updated and when the advisory gains a patched version, to
remove the ignore once one is adopted, and to revisit it if any code path ever signs or decrypts with anrsaprivate key where
an attacker can time it. Do not avoid RS256 to get rid of the finding (owner decision, 2026-10-24): Zitadel signs with it.
- Add a
- Gate and docs: add the new job or jobs to
gate'sneeds(ci.yml:211). Updatedocs/src/architecture/cicd.md:79anddocs/src/testing/techniques/architecture-gates.md.
Acceptance criteria
-
grep -n "sea-orm" scripts/check-deps.shmatches. Addingsea-ormtocrates/thrust-adapters-postgres/Cargo.tomlmakesscripts/check-deps.shexit non-zero (the control; record it inarchitecture-gates.mdnext to the existingworkercontrol). - A deliberate
.unwrap()in non-test code inthrust-corefails the clippy step, and a mis-formatted file failscargo fmt --all --check. Show both failing once, on a throwaway branch. -
cargo deny checkpasses onmain, and fails when a dependency with a disallowed licence or a banned crate is added (the control). -
deny.tomlignores RUSTSEC-2023-0071 and nothing else, with the justification and the re-check note beside the entry. Deleting the entry
makescargo deny check advisoriesfail and name that advisory (the control: it shows the ignore is what makesmainpass, and that the
advisory is really in the graph). -
gatelists the new job inneedsand stays green onmain, and.github/scripts/tests/test-ci-scripts.shstill passes. - The "Not in CI" list in
docs/src/architecture/cicd.mdno longer names clippy, fmt or the dependency audit.
References
- Review: .agents/plans/contrail/reviews/2026-10-19-fable-architecture-review.md (FR-07; roadmap M0 "clippy deny list in CI")
scripts/check-deps.sh:13-14,30-37;.github/workflows/ci.yml:211;.github/scripts/assert-gate.sh:12-14;docs/src/architecture/cicd.md:79;docs/src/testing/techniques/architecture-gates.md:27-30- ADR-0006 panic policy (
.agents/plans/contrail/adrs/architecture/0006-runtime-language-and-framework.md:99,130); ADR-0044 (adrs/data/layer/0044-query-layer-orm.md:36); ADR-0101 (adrs/ci/0101-ci-supply-chain.md:37); ADR-0100:80; ADR-0002 - Q-0006.4 (
QUESTIONS.md:357), Q-0044 (QUESTIONS.md:80);research/0004§10.4 F1;docs/src/contributing/crates.md
Finding: FR-07, ADR-0006 panic policy
Amended 2026-10-24 with the owner after PR #76 (the auth slice) brought rsa into the dependency graph through openidconnect: the RUSTSEC-2023-0071 ignore in the cargo-deny proposal and its acceptance criterion.
Activity
feat(auth): version the API key hash and switch CSRF enforcement; rec…
style: format the workspace with rustfmt (max_width 120) (#86)
chore(ci): enforce the clippy deny list, rustfmt and cargo-deny; forb…
docs: point the [verified] tags of #87 at its squash commit (#89)
test: name every pinned regression regression_, so one filterset find…