Maintainability audit (Nov 2026) #916

Open
opened 2026-11-04 08:31:23 +00:00 by kayg · 1 comment
Owner

Request (kayg 11-04): "How maintainable is our code? v0 grew to a large single-file codebase that we want to avoid. Please look up great engineering practices and use them to make our code scalable, resilient and maintainable."

Basis: origin/dev @ 41f2efa3. Standards: ADR 0070 (PR below). UI-primitive duplication is #912 and is not repeated here. Measured with throwaway scripts (not committed): production lines exclude the inline #[cfg(test)] module; vendor/ excluded.

Verdict

Not v0-bad, but heading there in two places. There are no crate cycles and no wrong-way crate dependencies (24 crates, flat crates/*, ADR 0010 holds). The risk is god modules inside notes and a few big files elsewhere, plus thin guards: nothing in CI stopped any of this growing.

Measure Rust (317 files) Web (475 files, incl. apps/mockup)
Source lines 85,137 (9,089 are inline tests) 59,132
Production files > 500 lines 33 18
> 1000 lines 7 0
Test files (separate) 340 across both; 5 Rust test files > 1000 (largest notes/src/tests/event_visibility.rs 2305)
Functions > 150 lines 22 3 of the 9 over 100
Functions > 100 / > 60 66 / 168 9 / n/a
Import cycles 0 crate cycles 4 (3 in apps/web/src/lib, 1 in packages/editor/src/vim)
unwrap/expect/panic! in production Rust 624 (notes 426, calternal 143, contacts 14) n/a
thiserror users core, auth only n/a

notes is 31,191 production lines in 148 files (37% of all Rust); next is auth at 6,444. The notes crate has 47 top-level modules and ~349 pub fn.

Note on the 143 in calternal: part of it is isolation.rs (a test gate in src/), so the true production figure is lower. The count ignores #[cfg(test)] modules and test paths.

What CI enforces now (PR)

ci/check-size-budgets.mjs (Rust 600, Rust test 1000, web 500; 40 files on a shrinking allow-list), ci/check-crate-layers.mjs (dependency table + cycles), ci/check-web-cycles.mjs (4 listed). All pass on dev and run in the web job in under a second.

Ranked refactor list (worst first)

Each refactor PR changes no behaviour, removes its allow-list entry, and posts perf-VM numbers equal to dev. None of these is a hot loop to rewrite: a split moves code between files, so release builds (fat LTO, one codegen unit) are unaffected unless a function stops being inlined across a module boundary. Within one crate that cannot happen under LTO, but still measure.

# File Why Proposed split Risk Perf
1 crates/notes/src/meta.rs (1736 prod) Two jobs in one file: MetaDb (219–751: SQLite list index, connection, schema, filters, cursors) and impl Home (1122–1537, 1665–): Home-level list/paging API; plus candidate_page (182 lines at :567). meta/db.rs (schema, open), meta/filters.rs (where/tag/cursor, 913–1050), meta/describe.rs, meta/home_api.rs. Low: private helpers are already in mod restart/mod revalidate style. Same crate, same LTO unit; run notes list/page bench.
2 crates/notes/src/history.rs (1287 prod) + history/companions.rs (972) History (225–830) mixes the writer thread (writer, commit, transact, queue accounting), migrations (MIGRATIONS 1071–1185), memory budget and read paths. history/writer.rs, history/migrate.rs, history/budget.rs, keep History as the facade. Split companions.rs by companion kind. Medium: durability code, has crash tests (keep them green, add none). High: executor and history writes are fsync bound (#898). Gate with the executor perf matrix on perf-01/02 (ABAB).
3 crates/calternal/src/isolation.rs (1556) One test-gate file with a World, 7 helpers and a 1348-line scenario body; it lives in src/ and ships in the binary crate. Move under crates/calternal/tests/ or a calternal-isolation test crate; split World/Alices fixtures from scenarios (it already has mod people;). Low. It is the #409 merge gate: it must run exactly as before. None (not on the hot path). Also removes ~140 unwraps from the production count.
4 crates/auth/src/sharing.rs (803 prod, 558 inline tests) Plugin registration, row mapping, never-shared bookkeeping, sequence/journal events and the NoteSharing impl in one file; grant is 141 lines. sharing/plugin.rs, sharing/store.rs (rows, events), sharing/access.rs (access_in, NoteSharing); move the 558 test lines to sharing/tests.rs. Medium: security code (#829/#835/#909 are open on it, so land after #909). The owner fast path is hot; run auth latency bench.
5 crates/notes/src/trash.rs (1052 prod), bulk/mod.rs (1076), home.rs (988), lib.rs (850) trash::restore is 206 lines, put 141; bulk/mod.rs has drive_inner 193 lines plus a crash module; home.rs holds Home + options + list work; lib.rs is 850 lines of Notes impl. trash: put.rs, restore.rs, retained.rs; bulk: move crash to its own file and drive_inner into steps; Notes impl split by concern (open, rooms, reads). Medium (#887 and #877 touch notes/bulk; land after). Bulk and trash benches.
6 crates/imap-uid/src/lib.rs (1052) A whole crate in one file: identity, UID allocation, writer fence, restore marker, error type with hand-written Display. Not yet used by any crate (IMAP PRs #874–#882 are open). identity.rs, alloc.rs, fence.rs, restore.rs, error.rs (thiserror). Low now, higher once wired, so split before the IMAP server lands. None.
7 crates/search/src/read.rs (1014) Query parsing (match_expr, fts_query), candidate selection, ranking (ranked, frecent), title matching and read_cands together. read/query.rs, read/candidates.rs, read/rank.rs, read/titles.rs. Medium: search ships only after the typo/prefix corpus and perf gate (feedback: search gate). High: run the search gate before and after.
8 crates/contacts/src/note_io.rs (949) + note_io/fields.rs (733) + body.rs fields::views is 267 lines, body::parse 255, read_note 232, retain_note_except 148. Long functions with many branches. Extract per-field parsers and a small table-driven dispatch; keep golden vCard fixtures as the safety net. Medium (format code: keep the round-trip tests, add a property test). Contacts import bench.
9 crates/markdown-view/src/lines.rs extract_with_limits is 424 lines, the longest function in the repo. Split by block kind (lists, tables, code, quotes) behind the existing limits struct. Medium: shared by tasks; has contracts/markdown-extraction vectors. Tasks extraction bench.
10 Long registration functions: notes/actions/jobs.rs:44 actions (209), tasks/lib.rs:99 actions (207), notes/actions.rs:24 actions (187), calternal/src/main.rs:30 main (210) One function lists every action/route; fine to read but impossible to review in a diff. One fn per action group, registered from a short list. Low. None (startup only).
11 notes/write_executor/home.rs (642), room/save/review.rs (685), watch.rs (710), props.rs (704), index.rs (663), tasks/lists.rs (710) Each 600–710 lines, just over the limit; lists::list 186 lines. Cut one coherent half out of each. Do these last. Low–medium. Per area.

Web

# File Why Proposed split Risk Perf
W1 apps/web/src/components/Editor.svelte (525) 445 lines of script, 45 of markup: it is a controller disguised as a component. Move logic into lib/editor-*.svelte.ts modules; the component only binds. Medium (editing is the #1 hot path). High: typing latency + frame gates on perf/Mac VMs.
W2 lib/editing.svelte.ts (755), packages/editor/src/sync/client.ts (683), note.ts (508) One store/client per file but each holds several jobs (state, transport, retry, queues). Split transport vs state vs retry in sync/client.ts; editing by feature. Medium (sync durability tests exist). High: reuse sync perf gates.
W3 Settings.svelte (877: 215 script, 473 CSS, 189 markup), Backdrop.svelte (764: 271 / 413 CSS / 80), NoteList, TopPills, Shell, Sidebar Mostly style and many sections in one file. One component per Settings section (56 section/heading hits); shared styles to the glass/pill tokens (links to #912). Low (visual regression via existing screenshots). First-paint budget: lazy-load sections.
W4 Import cycles: lib/notes.svelte.ts ↔ notes-cache.ts ↔ notes-index.ts; auth.svelte.ts ↔ install-hint ↔ pwa ↔ wipe; links/card.svelte.ts ↔ follow.ts; editor/vim/commands.ts ↔ tags.ts Hidden load-order coupling. Pull shared types/constants into a leaf file; remove the entry from ci/cycle-allowlist.json. Low. None.

Good news in the web code: no .svelte file calls fetch/WebSocket directly; packages/ui, packages/editor import only @calternal/text.

Cross-crate duplication (move to core or fsio once)

  • now_ms() has 8 definitions: attachments/place.rs:189, auth/db.rs:388, memory/lib.rs:37, notes/history.rs:1280, notes/unload.rs:50, notes/trash.rs:73, search/lib.rs:227, store/lib.rs:259 (with i64 and u64 variants).
  • valid_id in 4 crates (backdrops, core, migrate-v0, notes); utf16_len in 3 (daily, notes, search); SQLite tune/migrate in notes, search, store (and auth); sql_error conversions.
  • Several parse, walk, split names are just common words, not duplicates.
    Risk: low; do it as one PR per helper with the compiler as the test.

Gaps and judgment calls

  • Errors: only core and auth use thiserror; imap-uid hand-writes Display/From. Typed errors per library crate are the standard; plan: convert the crate when it is next split (not a mass change).
  • unwrap/expect/panic in notes (426): most are probably on invariants (locks, known-good inputs), but 426 is too many to review by eye. Ratchet per crate first (B4), then burn down while splitting.
  • Resilience: 73 production files mention timeouts or durations and 72 retry/backoff, and there are only 2 unbounded channels. I did not audit each for jitter, a retry budget, or one-layer retry. That is a follow-up audit (executor, sync client, IMAP, DAV). Crash tests exist in notes (storage_crash.rs, write_executor), fsio and auth.
  • Failure-path test gaps: counting test functions whose names say fail/crash/error/corrupt/torn/denied/timeout/recover is crude (names lie), but it points at where to look: fsio (52 tests, 0 named so), migrate-v0 (37, 0), backdrops (24, 0), daily (14, 0), imap-uid (13, 0), search (29, 1), engine (15, 1), store (8, 1). fsio and store are the durability base, so these deserve explicit crash and error tests first.
  • Deterministic simulation: notes has seeded fuzz-style tests (e.g. review_fuzz_old_new_bytes_history_versions_and_restarts), good. Sync between client and server has none yet; worth a seeded fault-injection harness (drop, duplicate, reorder, restart) before native clients arrive.
  • Not measured: cyclomatic complexity (no tool run on the control host; B1/B2 will give it on the VMs), test coverage, compile time per crate.

Research (sources)

  • Architecture map: matklad, ARCHITECTURE.md (short, codemap, invariants as absences, revisit twice a year); Large Rust Workspaces (flat crates/* is right up to ~100 crates); rust-analyzer architecture (API boundaries, syntax independent of the rest).
  • Module depth over line count: Ousterhout, A Philosophy of Software Design ("depth matters more than length", "classitis"): the reason ADR 0070 limits files by job and uses ratchets rather than tiny functions.
  • Lints: clippy too_many_lines (default 100, key too-many-lines-threshold), cognitive_complexity (restriction group, default 25), too_many_arguments (7), allow-unwrap-in-tests (Clippy lint configuration).
  • Errors: thiserror for libraries, anyhow for binaries (Comprehensive Rust).
  • Dependencies: cargo machete (fast, text based) and cargo udeps (compiler, nightly); cargo deny covers advisories/licences/bans, not unused deps (Rust Project Primer).
  • TypeScript: dependency-cruiser no-circular and layer forbidden rules; eslint-plugin-boundaries for layer direction in the editor (rules reference).
  • Resilience: Brooker, Timeouts, retries and backoff with jitter (capped backoff, jitter, retry at one layer: 5 layers × 3 attempts = 243× load); Nygard stability patterns (always timeouts; bulkheads; circuit breaker) slides; Candea and Fox, Crash-Only Software.
  • Testing: TigerBeetle VOPR (deterministic, seed + commit reproduces any failure; FoundationDB-style).
  • API stability: Hyrum's law (Software Engineering at Google).
  • Not retrieved (so not cited): Google's "Small CLs" guide and the SRE book's overload chapters; the PR-size advice in ADR 0070 C11 is our own rule.
Request (kayg 11-04): "How maintainable is our code? v0 grew to a large single-file codebase that we want to avoid. Please look up great engineering practices and use them to make our code scalable, resilient and maintainable." Basis: `origin/dev` @ `41f2efa3`. Standards: ADR 0070 (PR below). UI-primitive duplication is #912 and is not repeated here. Measured with throwaway scripts (not committed): production lines exclude the inline `#[cfg(test)]` module; `vendor/` excluded. ## Verdict Not v0-bad, but heading there in two places. There are no crate cycles and no wrong-way crate dependencies (24 crates, flat `crates/*`, ADR 0010 holds). The risk is **god modules inside `notes` and a few big files elsewhere**, plus thin guards: nothing in CI stopped any of this growing. | Measure | Rust (317 files) | Web (475 files, incl. `apps/mockup`) | |---|---|---| | Source lines | 85,137 (9,089 are inline tests) | 59,132 | | Production files > 500 lines | 33 | 18 | | > 1000 lines | 7 | 0 | | Test files (separate) | 340 across both; 5 Rust test files > 1000 (largest `notes/src/tests/event_visibility.rs` 2305) | | | Functions > 150 lines | 22 | 3 of the 9 over 100 | | Functions > 100 / > 60 | 66 / 168 | 9 / n/a | | Import cycles | 0 crate cycles | 4 (3 in `apps/web/src/lib`, 1 in `packages/editor/src/vim`) | | `unwrap/expect/panic!` in production Rust | 624 (`notes` 426, `calternal` 143, `contacts` 14) | n/a | | `thiserror` users | `core`, `auth` only | n/a | `notes` is 31,191 production lines in 148 files (37% of all Rust); next is `auth` at 6,444. The `notes` crate has 47 top-level modules and ~349 `pub fn`. Note on the 143 in `calternal`: part of it is `isolation.rs` (a test gate in `src/`), so the true production figure is lower. The count ignores `#[cfg(test)]` modules and test paths. ## What CI enforces now (PR) `ci/check-size-budgets.mjs` (Rust 600, Rust test 1000, web 500; 40 files on a shrinking allow-list), `ci/check-crate-layers.mjs` (dependency table + cycles), `ci/check-web-cycles.mjs` (4 listed). All pass on dev and run in the web job in under a second. ## Ranked refactor list (worst first) Each refactor PR changes no behaviour, removes its allow-list entry, and posts perf-VM numbers equal to dev. None of these is a hot loop to rewrite: a split moves code between files, so release builds (fat LTO, one codegen unit) are unaffected unless a function stops being inlined across a module boundary. Within one crate that cannot happen under LTO, but still measure. | # | File | Why | Proposed split | Risk | Perf | |---|---|---|---|---|---| | 1 | `crates/notes/src/meta.rs` (1736 prod) | Two jobs in one file: `MetaDb` (219–751: SQLite list index, connection, schema, filters, cursors) and `impl Home` (1122–1537, 1665–): Home-level list/paging API; plus `candidate_page` (182 lines at :567). | `meta/db.rs` (schema, open), `meta/filters.rs` (where/tag/cursor, 913–1050), `meta/describe.rs`, `meta/home_api.rs`. | Low: private helpers are already in `mod restart`/`mod revalidate` style. | Same crate, same LTO unit; run notes list/page bench. | | 2 | `crates/notes/src/history.rs` (1287 prod) + `history/companions.rs` (972) | `History` (225–830) mixes the writer thread (`writer`, `commit`, `transact`, queue accounting), migrations (`MIGRATIONS` 1071–1185), memory budget and read paths. | `history/writer.rs`, `history/migrate.rs`, `history/budget.rs`, keep `History` as the facade. Split `companions.rs` by companion kind. | Medium: durability code, has crash tests (keep them green, add none). | **High**: executor and history writes are fsync bound (#898). Gate with the executor perf matrix on perf-01/02 (ABAB). | | 3 | `crates/calternal/src/isolation.rs` (1556) | One test-gate file with a `World`, 7 helpers and a 1348-line scenario body; it lives in `src/` and ships in the binary crate. | Move under `crates/calternal/tests/` or a `calternal-isolation` test crate; split `World`/`Alices` fixtures from scenarios (it already has `mod people;`). | Low. It is the #409 merge gate: it must run exactly as before. | None (not on the hot path). Also removes ~140 `unwrap`s from the production count. | | 4 | `crates/auth/src/sharing.rs` (803 prod, 558 inline tests) | Plugin registration, row mapping, never-shared bookkeeping, sequence/journal events and the `NoteSharing` impl in one file; `grant` is 141 lines. | `sharing/plugin.rs`, `sharing/store.rs` (rows, events), `sharing/access.rs` (`access_in`, `NoteSharing`); move the 558 test lines to `sharing/tests.rs`. | Medium: security code (#829/#835/#909 are open on it, so land after #909). | The owner fast path is hot; run auth latency bench. | | 5 | `crates/notes/src/trash.rs` (1052 prod), `bulk/mod.rs` (1076), `home.rs` (988), `lib.rs` (850) | `trash::restore` is 206 lines, `put` 141; `bulk/mod.rs` has `drive_inner` 193 lines plus a `crash` module; `home.rs` holds `Home` + options + list work; `lib.rs` is 850 lines of `Notes` impl. | trash: `put.rs`, `restore.rs`, `retained.rs`; bulk: move `crash` to its own file and `drive_inner` into `steps`; `Notes` impl split by concern (open, rooms, reads). | Medium (#887 and #877 touch notes/bulk; land after). | Bulk and trash benches. | | 6 | `crates/imap-uid/src/lib.rs` (1052) | A whole crate in one file: identity, UID allocation, writer fence, restore marker, error type with hand-written `Display`. Not yet used by any crate (IMAP PRs #874–#882 are open). | `identity.rs`, `alloc.rs`, `fence.rs`, `restore.rs`, `error.rs` (`thiserror`). | Low now, higher once wired, so split **before** the IMAP server lands. | None. | | 7 | `crates/search/src/read.rs` (1014) | Query parsing (`match_expr`, `fts_query`), candidate selection, ranking (`ranked`, `frecent`), title matching and `read_cands` together. | `read/query.rs`, `read/candidates.rs`, `read/rank.rs`, `read/titles.rs`. | Medium: search ships only after the typo/prefix corpus and perf gate (feedback: search gate). | **High**: run the search gate before and after. | | 8 | `crates/contacts/src/note_io.rs` (949) + `note_io/fields.rs` (733) + `body.rs` | `fields::views` is 267 lines, `body::parse` 255, `read_note` 232, `retain_note_except` 148. Long functions with many branches. | Extract per-field parsers and a small table-driven dispatch; keep golden vCard fixtures as the safety net. | Medium (format code: keep the round-trip tests, add a property test). | Contacts import bench. | | 9 | `crates/markdown-view/src/lines.rs` | `extract_with_limits` is **424 lines**, the longest function in the repo. | Split by block kind (lists, tables, code, quotes) behind the existing limits struct. | Medium: shared by tasks; has `contracts/markdown-extraction` vectors. | Tasks extraction bench. | | 10 | Long registration functions: `notes/actions/jobs.rs:44 actions` (209), `tasks/lib.rs:99 actions` (207), `notes/actions.rs:24 actions` (187), `calternal/src/main.rs:30 main` (210) | One function lists every action/route; fine to read but impossible to review in a diff. | One `fn` per action group, registered from a short list. | Low. | None (startup only). | | 11 | `notes/write_executor/home.rs` (642), `room/save/review.rs` (685), `watch.rs` (710), `props.rs` (704), `index.rs` (663), `tasks/lists.rs` (710) | Each 600–710 lines, just over the limit; `lists::list` 186 lines. | Cut one coherent half out of each. Do these last. | Low–medium. | Per area. | ### Web | # | File | Why | Proposed split | Risk | Perf | |---|---|---|---|---|---| | W1 | `apps/web/src/components/Editor.svelte` (525) | 445 lines of script, 45 of markup: it is a controller disguised as a component. | Move logic into `lib/editor-*.svelte.ts` modules; the component only binds. | Medium (editing is the #1 hot path). | **High**: typing latency + frame gates on perf/Mac VMs. | | W2 | `lib/editing.svelte.ts` (755), `packages/editor/src/sync/client.ts` (683), `note.ts` (508) | One store/client per file but each holds several jobs (state, transport, retry, queues). | Split transport vs state vs retry in `sync/client.ts`; editing by feature. | Medium (sync durability tests exist). | High: reuse sync perf gates. | | W3 | `Settings.svelte` (877: 215 script, **473 CSS**, 189 markup), `Backdrop.svelte` (764: 271 / **413 CSS** / 80), `NoteList`, `TopPills`, `Shell`, `Sidebar` | Mostly style and many sections in one file. | One component per Settings section (56 section/heading hits); shared styles to the glass/pill tokens (links to #912). | Low (visual regression via existing screenshots). | First-paint budget: lazy-load sections. | | W4 | Import cycles: `lib/notes.svelte.ts` ↔ `notes-cache.ts` ↔ `notes-index.ts`; `auth.svelte.ts` ↔ `install-hint` ↔ `pwa` ↔ `wipe`; `links/card.svelte.ts` ↔ `follow.ts`; `editor/vim/commands.ts` ↔ `tags.ts` | Hidden load-order coupling. | Pull shared types/constants into a leaf file; remove the entry from `ci/cycle-allowlist.json`. | Low. | None. | Good news in the web code: no `.svelte` file calls `fetch`/WebSocket directly; `packages/ui`, `packages/editor` import only `@calternal/text`. ## Cross-crate duplication (move to `core` or `fsio` once) - `now_ms()` has 8 definitions: `attachments/place.rs:189`, `auth/db.rs:388`, `memory/lib.rs:37`, `notes/history.rs:1280`, `notes/unload.rs:50`, `notes/trash.rs:73`, `search/lib.rs:227`, `store/lib.rs:259` (with i64 and u64 variants). - `valid_id` in 4 crates (`backdrops`, `core`, `migrate-v0`, `notes`); `utf16_len` in 3 (`daily`, `notes`, `search`); SQLite `tune`/`migrate` in `notes`, `search`, `store` (and `auth`); `sql_error` conversions. - Several `parse`, `walk`, `split` names are just common words, not duplicates. Risk: low; do it as one PR per helper with the compiler as the test. ## Gaps and judgment calls - **Errors:** only `core` and `auth` use `thiserror`; `imap-uid` hand-writes `Display`/`From`. Typed errors per library crate are the standard; plan: convert the crate when it is next split (not a mass change). - **`unwrap/expect/panic` in `notes` (426):** most are probably on invariants (locks, known-good inputs), but 426 is too many to review by eye. Ratchet per crate first (B4), then burn down while splitting. - **Resilience:** 73 production files mention timeouts or durations and 72 retry/backoff, and there are only 2 unbounded channels. I did not audit each for jitter, a retry budget, or one-layer retry. That is a follow-up audit (executor, sync client, IMAP, DAV). Crash tests exist in `notes` (`storage_crash.rs`, `write_executor`), `fsio` and `auth`. - **Failure-path test gaps:** counting test functions whose names say fail/crash/error/corrupt/torn/denied/timeout/recover is crude (names lie), but it points at where to look: `fsio` (52 tests, 0 named so), `migrate-v0` (37, 0), `backdrops` (24, 0), `daily` (14, 0), `imap-uid` (13, 0), `search` (29, 1), `engine` (15, 1), `store` (8, 1). `fsio` and `store` are the durability base, so these deserve explicit crash and error tests first. - **Deterministic simulation:** `notes` has seeded fuzz-style tests (e.g. `review_fuzz_old_new_bytes_history_versions_and_restarts`), good. Sync between client and server has none yet; worth a seeded fault-injection harness (drop, duplicate, reorder, restart) before native clients arrive. - **Not measured:** cyclomatic complexity (no tool run on the control host; B1/B2 will give it on the VMs), test coverage, compile time per crate. ## Research (sources) - Architecture map: matklad, [ARCHITECTURE.md](https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html) (short, codemap, invariants as absences, revisit twice a year); [Large Rust Workspaces](https://matklad.github.io/2021/08/22/large-rust-workspaces.html) (flat `crates/*` is right up to ~100 crates); rust-analyzer [architecture](https://rust-analyzer.github.io/book/contributing/architecture.html) (API boundaries, `syntax` independent of the rest). - Module depth over line count: Ousterhout, *A Philosophy of Software Design* ("depth matters more than length", "classitis"): the reason ADR 0070 limits files by job and uses ratchets rather than tiny functions. - Lints: clippy `too_many_lines` (default 100, key `too-many-lines-threshold`), `cognitive_complexity` (restriction group, default 25), `too_many_arguments` (7), `allow-unwrap-in-tests` ([Clippy lint configuration](https://doc.rust-lang.org/clippy/lint_configuration.html)). - Errors: thiserror for libraries, anyhow for binaries ([Comprehensive Rust](https://google.github.io/comprehensive-rust/error-handling/thiserror-and-anyhow.html)). - Dependencies: `cargo machete` (fast, text based) and `cargo udeps` (compiler, nightly); `cargo deny` covers advisories/licences/bans, not unused deps ([Rust Project Primer](https://rustprojectprimer.com/checks/unused.html)). - TypeScript: dependency-cruiser `no-circular` and layer `forbidden` rules; eslint-plugin-boundaries for layer direction in the editor ([rules reference](https://github.com/sverweij/dependency-cruiser/blob/main/doc/rules-reference.md)). - Resilience: Brooker, [Timeouts, retries and backoff with jitter](https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/) (capped backoff, jitter, retry at one layer: 5 layers × 3 attempts = 243× load); Nygard stability patterns (always timeouts; bulkheads; circuit breaker) [slides](https://cdn.oreillystatic.com/en/assets/1/event/79/Stability%20Patterns%20Presentation.pdf); Candea and Fox, [Crash-Only Software](https://www.usenix.org/legacy/events/hotos03/tech/full_papers/candea/candea_html/). - Testing: TigerBeetle [VOPR](https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/internals/vopr.md) (deterministic, seed + commit reproduces any failure; FoundationDB-style). - API stability: Hyrum's law (Software Engineering at Google). - Not retrieved (so not cited): Google's "Small CLs" guide and the SRE book's overload chapters; the PR-size advice in ADR 0070 C11 is our own rule.
Author
Owner

Standards and guards: PR #917.

Standards and guards: PR #917.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#916
No description provided.