Skip to content

build(regulations): run the editor's whole stack locally - #115

Draft
lorenzocorallo wants to merge 2 commits into
feat/regulations-routerfrom
feat/regulations-dev
Draft

lorenzocorallo wants to merge 2 commits into
feat/regulations-routerfrom
feat/regulations-dev

Conversation

@lorenzocorallo

Copy link
Copy Markdown
Member

Stacked on #114. A local stack for the regulations editor, for the admin thread and the orchestrator's end-to-end test.
See docs/regulations-dev.md.

  • docker/regulations-dev.compose.yaml: Postgres 18 and the latex-worker, built FROM legal's TeX Live image
    (TEXLIVE_IMAGE, a locally built :local until legal publishes it). The worker runs with the cluster's
    sandbox: uid 1000, read-only root, tmpfs, cap_drop: ALL, no-new-privileges, 1.5 GiB / 2 CPUs.
  • bun run regulations:dev: the dev IdP (4300), backend (3000, --watch) and collab (4100/4101) with one shared
    env.
  • scripts/regulations/dev-idp.ts: a development-only stand-in for PoliNetwork Auth. It serves what auth-kit
    reads (JWKS, token endpoint, access snapshot) and the account directory for dev-accounts.json, and mints
    at+jwt access tokens with name and email (CLI and GET /dev/token?sub=). It refuses
    NODE_ENV=production. Pointing a backend at the real IdP needs a dev client registration and the backend
    client's key, which only Lorenzo can provide.
  • bun run regulations:seed: through the real API, imports legal.json and the RRI and creates three drafts with
    assignments. A and B change the same comma (a merge conflict). It then waits for the first PDF.

Verified (this machine, against legal's RRI migration branch)

  • Seed: rri imported. The merge B → A reports exactly one conflict, on "Articolo 2.2.1 (Descrizione generale),
    comma 2". The first compile of A is ok.
  • End to end over HTTP and websocket, with tokens from the shim:
    • me.access and regulations.me.get for an account with only assignments (3 drafts, no permissions).
    • Tickets from regulations.collabTicket for editor, direttivo and commenter, three HocuspocusProviders on
      ws://localhost:4100: the editor's edit reaches the direttivo, and the commenter's edit is rejected.
    • Compile broadcasts queued → running → ok. compile.pdf returns a PDF containing both the live edit and the
      seeded change.
    • drafts.get capabilities for the editor: edit: true, assign: false, no transitions.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

docker compose for Postgres and the sandboxed LaTeX worker; a launcher for the
backend, the collab service and a development stand-in for PoliNetwork Auth
(JWKS, token endpoint, access snapshot, directory) that mints access tokens
for seeded accounts; and a seed that imports the RRI from a legal checkout and
creates drafts with a merge conflict, through the real API.
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