Skip to content

web: give API domains focused contract owners - #194

Merged
fieldmouseworks-steward[bot] merged 1 commit into
mainfrom
issue-59-web-owners
Nov 8, 2026
Merged

fieldmouseworks-steward[bot] merged 1 commit into
mainfrom
issue-59-web-owners

Conversation

@fieldmouseworks-workers

@fieldmouseworks-workers fieldmouseworks-workers Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Refs #59

The legacy API client concentrated unrelated contracts in a 1,299-line module. Move its contracts and calls into focused domain owners under web/src/lib/api/; leave api.ts as a compatible re-export entrypoint. The development map now routes to those owners.

Move / new owner / impact / proof plan:

  • Authentication and notices → session.ts; setup/backup status → installation.ts; user administration → users.ts.
  • Program configuration → programs.ts; enrollment lifecycle/assignments and own-enrollment reads → enrollments.ts; training periods → sessions.ts.
  • Draft editing/review contracts → drafts.ts; finalized envelopes, acknowledgments and amendments → records.ts; summary linking → summaries.ts.
  • Signoff recording/matrix joins retained-history reads in signoffs.ts, using one SignoffKind; archive downloads → exports.ts.
  • Shared JSON/archive refusal parsing → transport requireOk. Domain dependencies are direct type imports, never imports through the barrel.

Public exports, HTTP paths/payloads, session semantics, typed refusals, role/capability decisions and persisted behavior are preserved. No server/schema change, route change, UI rewrite, or autosave ownership change. This is the API slice; the two large workflow pages remain under #59, and #34/#49 behavior is unaffected. Rung 1: one owning module per contract and one refusal parser, with compatibility exports rather than duplicate implementations.

Authorization: owner-authored #59 as relayed to this job; no owner-set effort budget. Integrator performed implementation and self-review; hosted review remains pending. Focused proof is the web type/Svelte check and build; the intended full proof is CONTRIBUTING.md's gates and all browser scenarios.

Local validation on a8628d7:

  • npm ci passed (initial shell used Node 22 and warned about the Node >=24 floor).
  • Initial npm run check: zero errors/warnings.
  • nix develop --command bash -c 'cd web && npm run check && npm run build' passed under Node 24.22.1, with zero check errors/warnings.
  • Guidance guard and git diff --check passed.
  • Static extraction audit found all 159 original public declarations and all original endpoint strings retained.
  • Full proof launch was blocked before any gate: heavy: cannot open /run/burrow-heavy/slot1: No such file or directory (os error 2). No full local receipt or browser pass is claimed. Hosted checks/review must complete before landing.

@fieldmouseworks-steward fieldmouseworks-steward Bot added the waiting: review Its reviewers, or a Claude job judging it, are looking at this head label Nov 8, 2026

@fieldmouseworks-steward fieldmouseworks-steward Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex review of a8628d7: nothing found.

Reviewed every changed file and relevant callers and tests; found no merge-blocking defects.

@fieldmouseworks-steward fieldmouseworks-steward Bot added waiting: CI Reviewed clean; waits for its CI to finish waiting: review Its reviewers, or a Claude job judging it, are looking at this head and removed waiting: review Its reviewers, or a Claude job judging it, are looking at this head waiting: CI Reviewed clean; waits for its CI to finish labels Nov 8, 2026
@fieldmouseworks-workers

Copy link
Copy Markdown
Contributor Author

Judgment on a8628d7, checked against AGENTS.md as it is on main (it's the only AGENTS.md in the tree).

What I checked:

  • The move is verbatim. I compared the lines of main's web/src/lib/api.ts plus main's api/signoffs.ts with the lines of the 11 new or changed domain modules, ignoring blank lines, comments and imports. Every declaration line made it across. Only three things differ: (1) the barrel's own re-export lines; (2) the duplicate SignoffKind that api.ts used to declare, which is now the single one in signoffs.ts, with the same union; (3) downloadExport's inline refusal parsing, which is now await requireOk(response). requireOk in transport.ts is the same code request used to run inline, in the same order (204 first, then !ok → ApiError, with the same unreachable fallback). HTTP paths, payloads and methods are unchanged.
  • No runtime import cycles. Cross-domain imports (drafts → programs/records/summaries, enrollments → programs, records → programs) are all import type, so they're erased at build time. Nothing imports through the barrel.
  • Scope. No server, migration, route or UI component changes. api.ts re-exports everything it used to. It now also re-exports signoffs.ts's history-read names, which only adds exports. The description's "public exports preserved" still holds.
  • Rules on main. The house size rule is met: a 1,299-line module is split, and every new module is under 230 lines. There's no new non-Rust code that needs a reason: these are existing TypeScript contracts moved within the static SvelteKit UI that the architecture prescribes, and house/rust-first passed. No durable behavior change, so no ADR is needed. No authorization, retention or record-integrity logic moved into the UI, because the client only carries the server's decisions. The development map in docs/development.md names the new owners in one place.
  • CI on this head. pr-gate fmt-clippy-test (run 42526656152) passed web install, check and build, cargo test --workspace, and the browser-test binary build, and Browser tests reported "70 passed". check / check, house checks, builds (x86_64, aarch64) and CodeQL are green. I didn't run anything locally. The description says its own full local proof was blocked by heavy, and I'm relying on the hosted run here, not on that claim.
  • Description. It matches the code. Its statements that review was "pending" and that hosted checks "must complete" were true when it was written, and both are now done.

Decision: land. It's a pure client-side refactor that a revert undoes completely, with no data, secret or owner-reserved decision involved.

@fieldmouseworks-steward fieldmouseworks-steward Bot added waiting: merge Settled and green: being merged by the steward, GitHub or its dependency bot and removed waiting: review Its reviewers, or a Claude job judging it, are looking at this head labels Nov 8, 2026
@fieldmouseworks-steward
fieldmouseworks-steward Bot merged commit 825b85a into main Nov 8, 2026
24 checks passed
@fieldmouseworks-steward
fieldmouseworks-steward Bot deleted the issue-59-web-owners branch November 8, 2026 21:58
@fieldmouseworks-steward fieldmouseworks-steward Bot removed the waiting: merge Settled and green: being merged by the steward, GitHub or its dependency bot label Nov 8, 2026
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.

1 participant