feat: een burgerapp haalt via FSC voor Burgers de brongegevens en de casus op #39

Merged
tim.jager merged 2 commits from feat/fsc4b-gegevens into main 2026-11-24 16:24:46 +00:00
Owner

The executor (the RegelHet server) now gives a citizen app what it needs to predict a decision on the citizen's own device, through FSC voor Burgers. This is PR A of the citizen-environment design (burgeromgeving). PR B builds the browser app against this API.

What it adds

  • POST /fsc4b/burger/v1/gegevens, a citizen route encrypted under the session key like the others. The server hands out only the answers the case file names under uitgeven; each must be an answer of the executor's cell (answers in cel.yaml) that needs only the login field. It computes them for the BSN of the session. A BSN in the request is not read. The answer is { "ondertekend": "<JWS>", "gegevens": { … } }: a JWS under the organization's key from the Stelseldocument, with its payload beside it in plain form. The payload contains:
    • sub, iss, iat, peildatum, casus and cel;
    • bundel_hash: the hash of the bundle of GET /fsc4b/regelwerken, so the signature covers the case the app computes on. It is sha256: plus the hex SHA-256 over, per path in byte order, <bytes of path>:<path><bytes of text>:<text>;
    • antwoorden: per answer its value, the parameters it was asked with, and where it came from;
    • records: the citizen's dossier records up to today;
    • regelwerken: the versions the answers were computed under;
    • bij_aanvraag: the facts that only come after an application, such as the GGD's advice.
  • uitgeven in the case file. Without it nothing goes out and antwoorden is empty. A name that is no answer of the cell, or one that needs more than the login field, stops the server with a message naming it. The list is the case's and not the cell's: one cell's catalogue serves every case that runs it, and what goes out to a citizen is a choice of the procedure. The parking-card case lists two answers. The manifest repository gets the same list in regelrecht/wetsproces-parkeerkaart#1, which must merge only after this PR is deployed.
  • GET /fsc4b/regelwerken: the case as a bundle { "<path>": "<text>" }, without a session. The kern loads it as a source with bundel::uit_bron.
  • CORS for browser apps on another address. REGELHET_FSC4B_ORIGINS takes exact origins, comma-separated, and stable mode accepts only https ones (plus localhost). The headers apply to every answer under /fsc4b/, including preflights, errors and paths that are no route, and to nothing else. The chart value is fsc4b.origins.
  • Kern. Cell::answer_parameters and Cell::give_answer in packages/cel ask a cell for one of its own catalogue answers directly. They go through the same checks and recursion guard as a binding. kern::antwoord/Cell::consult refuse a reduction as their source (RFC-056), because a decision may take a reduction only through a binding; this path decides and records nothing. brongegevens in packages/poc-chronolexografie does the selection and the computation, so the app's WASM kern can run the same function and compare.
  • ROUTES, OpenAPI, the service profile page and the FSC voor Burgers page. The example client now fetches the source data and checks the signature.

For the parking card two answers remain: whether the municipality granted a card before (aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt), and whether a request to the GGD is open (verzoek_om_geneeskundig_onderzoek_staat_open). The advice answers also need the date of an application, so they drop out; the advice appears under bij_aanvraag. The provenance does not say how far the cell read its chronicle, because that chronicle holds everyone's records.

Example

# casussen/gehandicaptenparkeerkaart.yaml
uitgeven:
  - aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt
  - verzoek_om_geneeskundig_onderzoek_staat_open

The decrypted answer for a fictitious citizen who was granted a card earlier (shortened):

{
  "ondertekend": "eyJhbGciOiJFUzI1NiIs…",
  "gegevens": {
    "iss": "00000099000000000001",
    "sub": "999990032",
    "peildatum": "2026-10-20",
    "casus": "gehandicaptenparkeerkaart",
    "cel": "gemeente_wilgendaal",
    "antwoorden": {
      "aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt": {
        "waarde": true,
        "parameters": { "bsn_aanvrager": "999990032" },
        "herkomst": [{ "door": "gemeente_wilgendaal", "antwoord": "aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt", "reductie": "reductie_geldige_gehandicaptenparkeerkaart", "artikel": "aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt", "geldig_vanaf": "2026-01-01" }]
      },
      "verzoek_om_geneeskundig_onderzoek_staat_open": { "waarde": false, "parameters": { "bsn_aanvrager": "999990032" }, "herkomst": ["…"] }
    },
    "records": ["…"],
    "bij_aanvraag": [{ "feit": "beleid_gehandicaptenparkeerkaart_gemeente_wilgendaal#5#geneeskundig_advies_uitgebracht", "taak": "Geneeskundig advies uitbrengen" }]
  }
}

Not in this PR

  • No log of handouts and no migration. The docs say so under "What is not here".
  • The plugin does not yet pass the variables of a real Stelsel, and it does not set fsc4b.origins.

Tests

  • tests/fsc4b.rs:
    • only the answers on the BSN alone are returned, and they are signed;
    • the BSN comes from the session, also when the body names another one;
    • bij_aanvraag is listed and not returned;
    • after an advice and a grant, the source data hold the grant and its records, and another citizen sees none of it, no record id included;
    • the bundle loads as a source;
    • CORS on preflight, GET and a refused POST, and none for other origins or the browser routes.
  • service.rs: without uitgeven nothing goes out; with it only the listed answers go out; an answer that needs more than the login field stops the server.
  • case.rs: an unknown name under uitgeven stops the load.
  • fsc4b.rs: the bundle hash and its byte-level definition; the e2e test checks the signed bundel_hash against the served bundle, and CORS on a 404.
  • config.rs: origin parsing, and stable mode accepting only https.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XDZRnqjJJ2izeL3kP33bnv

The executor (the RegelHet server) now gives a citizen app what it needs to predict a decision on the citizen's own device, through FSC voor Burgers. This is PR A of the citizen-environment design (burgeromgeving). PR B builds the browser app against this API. ## What it adds - **`POST /fsc4b/burger/v1/gegevens`**, a citizen route encrypted under the session key like the others. The server hands out only the answers the case file names under `uitgeven`; each must be an answer of the executor's cell (`answers` in `cel.yaml`) that needs only the login field. It computes them for the BSN of the session. A BSN in the request is not read. The answer is `{ "ondertekend": "<JWS>", "gegevens": { … } }`: a JWS under the organization's key from the Stelseldocument, with its payload beside it in plain form. The payload contains: - `sub`, `iss`, `iat`, `peildatum`, `casus` and `cel`; - `bundel_hash`: the hash of the bundle of `GET /fsc4b/regelwerken`, so the signature covers the case the app computes on. It is `sha256:` plus the hex SHA-256 over, per path in byte order, `<bytes of path>:<path><bytes of text>:<text>`; - `antwoorden`: per answer its value, the parameters it was asked with, and where it came from; - `records`: the citizen's dossier records up to today; - `regelwerken`: the versions the answers were computed under; - `bij_aanvraag`: the facts that only come after an application, such as the GGD's advice. - **`uitgeven`** in the case file. Without it nothing goes out and `antwoorden` is empty. A name that is no answer of the cell, or one that needs more than the login field, stops the server with a message naming it. The list is the case's and not the cell's: one cell's catalogue serves every case that runs it, and what goes out to a citizen is a choice of the procedure. The parking-card case lists two answers. The manifest repository gets the same list in regelrecht/wetsproces-parkeerkaart#1, which must merge only after this PR is deployed. - **`GET /fsc4b/regelwerken`**: the case as a bundle `{ "<path>": "<text>" }`, without a session. The kern loads it as a source with `bundel::uit_bron`. - **CORS** for browser apps on another address. `REGELHET_FSC4B_ORIGINS` takes exact origins, comma-separated, and stable mode accepts only https ones (plus localhost). The headers apply to every answer under `/fsc4b/`, including preflights, errors and paths that are no route, and to nothing else. The chart value is `fsc4b.origins`. - **Kern.** `Cell::answer_parameters` and `Cell::give_answer` in `packages/cel` ask a cell for one of its own catalogue answers directly. They go through the same checks and recursion guard as a binding. `kern::antwoord`/`Cell::consult` refuse a reduction as their source (RFC-056), because a decision may take a reduction only through a binding; this path decides and records nothing. `brongegevens` in `packages/poc-chronolexografie` does the selection and the computation, so the app's WASM kern can run the same function and compare. - `ROUTES`, OpenAPI, the service profile page and the FSC voor Burgers page. The example client now fetches the source data and checks the signature. For the parking card two answers remain: whether the municipality granted a card before (`aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt`), and whether a request to the GGD is open (`verzoek_om_geneeskundig_onderzoek_staat_open`). The advice answers also need the date of an application, so they drop out; the advice appears under `bij_aanvraag`. The provenance does not say how far the cell read its chronicle, because that chronicle holds everyone's records. ## Example ```yaml # casussen/gehandicaptenparkeerkaart.yaml uitgeven: - aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt - verzoek_om_geneeskundig_onderzoek_staat_open ``` The decrypted answer for a fictitious citizen who was granted a card earlier (shortened): ```json { "ondertekend": "eyJhbGciOiJFUzI1NiIs…", "gegevens": { "iss": "00000099000000000001", "sub": "999990032", "peildatum": "2026-10-20", "casus": "gehandicaptenparkeerkaart", "cel": "gemeente_wilgendaal", "antwoorden": { "aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt": { "waarde": true, "parameters": { "bsn_aanvrager": "999990032" }, "herkomst": [{ "door": "gemeente_wilgendaal", "antwoord": "aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt", "reductie": "reductie_geldige_gehandicaptenparkeerkaart", "artikel": "aanvrager_eerder_gehandicaptenparkeerkaart_verstrekt", "geldig_vanaf": "2026-01-01" }] }, "verzoek_om_geneeskundig_onderzoek_staat_open": { "waarde": false, "parameters": { "bsn_aanvrager": "999990032" }, "herkomst": ["…"] } }, "records": ["…"], "bij_aanvraag": [{ "feit": "beleid_gehandicaptenparkeerkaart_gemeente_wilgendaal#5#geneeskundig_advies_uitgebracht", "taak": "Geneeskundig advies uitbrengen" }] } } ``` ## Not in this PR - No log of handouts and no migration. The docs say so under "What is not here". - The plugin does not yet pass the variables of a real Stelsel, and it does not set `fsc4b.origins`. ## Tests - `tests/fsc4b.rs`: - only the answers on the BSN alone are returned, and they are signed; - the BSN comes from the session, also when the body names another one; - `bij_aanvraag` is listed and not returned; - after an advice and a grant, the source data hold the grant and its records, and another citizen sees none of it, no record id included; - the bundle loads as a source; - CORS on preflight, GET and a refused POST, and none for other origins or the browser routes. - `service.rs`: without `uitgeven` nothing goes out; with it only the listed answers go out; an answer that needs more than the login field stops the server. - `case.rs`: an unknown name under `uitgeven` stops the load. - `fsc4b.rs`: the bundle hash and its byte-level definition; the e2e test checks the signed `bundel_hash` against the served bundle, and CORS on a 404. - `config.rs`: origin parsing, and stable mode accepting only https. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XDZRnqjJJ2izeL3kP33bnv
feat: een burgerapp haalt via FSC voor Burgers de brongegevens en de casus op
All checks were successful
CI / Helm chart (push) Successful in 9s
CI / Fundament plugin (push) Successful in 34s
CI / Rust format, lint and validate (push) Successful in 1m17s
CI / Frontend tests (push) Successful in 1m26s
CI / Rust tests (push) Successful in 2m11s
CI / Rust tests (database) (push) Successful in 3m36s
deb6a30243
POST /fsc4b/burger/v1/gegevens geeft de antwoorden van de cel van de
uitvoerder die alleen het inlogveld nodig hebben, uitgerekend voor het BSN
uit de sessie, met de dossierrecords en wat pas na een aanvraag komt,
ondertekend met de organisatiesleutel. GET /fsc4b/regelwerken geeft de
casus als bundel. REGELHET_FSC4B_ORIGINS zet CORS aan voor browserapps.

Claude-Session: https://claude.ai/code/session_01XDZRnqjJJ2izeL3kP33bnv
tim.jager force-pushed feat/fsc4b-gegevens from deb6a30243
All checks were successful
CI / Helm chart (push) Successful in 9s
CI / Fundament plugin (push) Successful in 34s
CI / Rust format, lint and validate (push) Successful in 1m17s
CI / Frontend tests (push) Successful in 1m26s
CI / Rust tests (push) Successful in 2m11s
CI / Rust tests (database) (push) Successful in 3m36s
to 781fe3fd83
Some checks failed
CI / Helm chart (push) Successful in 10s
CI / Fundament plugin (push) Successful in 38s
CI / Rust tests (push) Has been cancelled
CI / Rust format, lint and validate (push) Has been cancelled
CI / Frontend tests (push) Has been cancelled
CI / Rust tests (database) (push) Has been cancelled
2026-11-24 16:19:57 +00:00
Compare
tim.jager force-pushed feat/fsc4b-gegevens from 781fe3fd83
Some checks failed
CI / Helm chart (push) Successful in 10s
CI / Fundament plugin (push) Successful in 38s
CI / Rust tests (push) Has been cancelled
CI / Rust format, lint and validate (push) Has been cancelled
CI / Frontend tests (push) Has been cancelled
CI / Rust tests (database) (push) Has been cancelled
to 1823db8762
All checks were successful
CI / Helm chart (push) Successful in 10s
CI / Fundament plugin (push) Successful in 38s
CI / Rust format, lint and validate (push) Successful in 1m24s
CI / Frontend tests (push) Successful in 1m34s
CI / Rust tests (push) Successful in 2m3s
CI / Rust tests (database) (push) Successful in 3m14s
2026-11-24 16:20:59 +00:00
Compare
tim.jager deleted branch feat/fsc4b-gegevens 2026-11-24 16:24:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
regelrecht/fieldlab-2026!39
No description provided.