Skip to content

docs(backend): the design doc still described the Python server it outlived - #588

Merged
athvin merged 1 commit into
mainfrom
docs/unstale-backend-design
Nov 5, 2026
Merged

athvin merged 1 commit into
mainfrom
docs/unstale-backend-design

Conversation

@athvin

@athvin athvin commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Found by reviewing the previous docs pass. I fixed the two trackers and missed the
design doc, which was the worst offender
— backend-design.md opens by calling
itself a design for "a FastAPI backend", and its implementation note cites four paths
that no longer exist. That note is the first thing a reader sees.

The dead paths

git ls-files server returns nothing, and src/ has no tracked files either.
Verified gone: server/README.md, src/er/service.py, src/er/lake/env.py,
server/src/erserver/k8s.py, plus the eight src/er/*.py paths in §2's asset table.

Corrected, each against the code

Where Was Now
Header note the Python server as the implementation er-server: SKIP-LOCKED queue, claim-run-mark dispatcher, 4 roles, publish tiers, schedules, signed webhooks, 88 /v1 routes; launcher is er-k8s
§2 asset table 8 × src/er/*.py the Rust crates that own the work; exit codes as the ExitCode variants that still encode 0/1/2/3/10
§2 "Missing" HTTP API, job system, scheduler, read layer, connectors, writeback four of six shipped — struck through; what remains is the Salesforce connector and any writeback
§3 "there's no edit API" for match config there is: .../config/versions + .../publish, with a gate that advises rather than refuses
§15 roadmap no status Status column; 1–3 done except the Salesforce connector, 4–5 open and now board cards
connectors.md server/src/erserver/api.py, webhooks.py their Rust handlers — and the imports route is dataset-scoped now, not org-scoped

What I deliberately did not fix

Every remaining src/er/*.py path in backend-design.md is left in place, and the
header now says so: the inline citations in §5, §8, §9, §12 and the whole appendix
table. Translating them means guessing which Rust module inherited each
responsibility — the relation registry, the ducklake session/snapshot machinery, the
config schema — and a confidently wrong path is worse than an obviously dated one.
The header directs the reader to the generated crate map for current owners. Tracked
as its own card.

This is the same discipline that caught my own errors earlier: I had already shipped
two claims sourced from a sloppy grep rather than from the code.

Verification

  • make skills-check green; make check run locally (docs changes don't skip the
    Rust gate — entities verifies docs/erd.md).
  • Every path substitution asserted to match exactly once before applying, rather
    than regexing the file. 4 of 4 in connectors.md, 5 of 5 roadmap rows.
  • All relative links in both edited files re-checked: 0 broken.
  • Roadmap table column integrity asserted: 7 rows, zero pipe-count mismatches.

Related

Same review also corrected four board artifacts: #550 claimed no runner
ServiceAccount existed when er-runner and er-dev-runner-pod do (the per-tenant gap
stands, the evidence line was false and understated what is built — the exact bias
this work exists to correct); and #511/#514/#517/#520/#523/#525/#540 gained the
connectors.md design references and overlap notes I described in chat but never
wrote into the issues.

🤖 Generated with Claude Code

…tlived

A review of the previous docs pass found the file I should have started with.
backend-design.md opens by calling itself a design for "a FastAPI backend"
and its implementation note points at server/README.md, src/er/service.py,
src/er/lake/env.py and server/src/erserver/k8s.py. All four are gone --
`git ls-files server` returns nothing. That note is the first thing a reader
sees, so it was the most load-bearing stale text in docs/.

Corrected, each against the code:

- The header. Phases 1-3 are still delivered, but in `er-server`: a Postgres
  SKIP-LOCKED queue, a claim-run-mark dispatcher, four server-enforced roles,
  config publish tiers, cron schedules, the snapshot-pinned read path, signed
  webhooks -- across 88 /v1 routes. The k8s Job launcher is `er-k8s`.
- §2's asset table. Eight dead `src/er/*.py` paths replaced by the Rust
  crates that own the work, with the exit-code taxonomy spelled as the
  `ExitCode` variants that still encode 0/1/2/3/10.
- §2's "Missing" list was four-sixths wrong: HTTP API, job system, scheduler
  and read layer all shipped. Struck through, with what remains -- the
  Salesforce connector and any writeback -- stated plainly.
- §3 claimed "there's no edit API" for match config. There is:
  config/versions and .../publish, with a gate that advises rather than
  refuses.
- §15's roadmap gains a Status column. Phases 1-3 done except the one thing
  phase 3 shares with phase 4, the Salesforce connector; 4 and 5 open and now
  tracked as board cards.
- connectors.md cited `server/src/erserver/api.py` and `webhooks.py` for the
  two seams it is about. Both replaced by their Rust handlers, and the
  imports route corrected -- it is dataset-scoped now, not org-scoped.

What is deliberately NOT fixed, and said so in the file: the inline citations
in §5, §8, §9, §12 and the whole appendix table. Translating those means
guessing which Rust module inherited each responsibility, and a confidently
wrong path is worse than an obviously dated one. The header now tells the
reader to treat them as what the design was built against and to find the
current owner in the generated crate map. Tracked as its own card.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin merged commit 6545c34 into main Nov 5, 2026
39 checks passed
athvin added a commit that referenced this pull request Nov 5, 2026
)

Closes the residual I deferred in #588 and filed as #589. Every Python path
in backend-design.md is now either paired with its current owner or framed
as history; none of them is presented as a location.

The appendix gains an `Owner now` column. Six seams were a lookup. Two were
not, and those are the reason this was worth doing properly rather than
find-and-replace:

- The CLI orchestration sequence was to be extracted as `er/service.py`.
  It became `er-dag`'s compiled DAG instead -- a task is a stage, a DAG is a
  job kind, and cycles or arity errors fail at `cargo build`. Calling that a
  service facade would misdescribe it.
- The per-tenant advisory writer lock became a declared PARTIAL UNIQUE INDEX,
  `jobs_one_active_per_dataset` on `dataset_id WHERE state IN
  ('dispatching','running','canceling')` in entities/job/entity.yaml. Postgres
  enforces it, nothing holds a connection, and it is per-DATASET now because
  the lake is the thing being written and each dataset is its own lake.

That second one also corrects two places where *I* wrote "advisory lock" in
#588 before knowing better: §2's tenancy-seam row and the "two constraints"
paragraph. The crash-safety argument in §5 still holds but by a different
route -- a dead pod's job is reaped to a terminal state, which lifts the
constraint, rather than a dropped connection releasing a lock.

§12's workstream gains a note that all six items landed and several landed
differently: item 1 as the DAG, item 2 as four ER_LAKE_* variables read by
er-env, item 4 as the read routes, the score-only extension as
`.../match-preview`. The plan text is kept for its reasoning.

The "Residual" paragraph added in #588 is removed, because it is no longer
true.

Verified: every substitution asserted to match exactly once before applying;
appendix table 11 rows with zero pipe-count mismatches; all relative links
resolve; 12 remaining `src/er/` mentions each checked to sit inside an
explicit historical frame.

Closes #589

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants