# POC testing guide — full stack boot + scenario matrix

Machine-readable reference for running every verification this POC supports, in order, with
exact commands, exact test data, and exact expected results. Companion to
[`testing-guide.html`](testing-guide.html) (same content, visual/interactive — built for a
human, not for an LLM). This file is optimized for being read by a tool or another LLM: fixed
field order per scenario, minimal prose, every command in a fenced block, every expected result
stated literally (not "should work").

Source of truth for every fact below: [`../contracts.md`](../contracts.md) (wire format +
scenario matrix §7, lines ~421-439), [`../architecture.md`](../architecture.md) §12.0 (machine
topology), [`script.md`](script.md) (demo run sheet), `../pds/TESTING.md`,
`../platform/stub/TESTING.md`, `../platform/spa/TESTING.md`, `../outil-local/MANUAL-TESTING.md`,
`../step-6-checklist.md`, `pds/src/test/.../mcp/MandateDpopFilterTest.java`,
`platform/stub/test/stub.test.ts`. Not re-derived from memory — re-read from those files on
2026-10-09.

## 0. Topology assumed

Per `architecture.md` §12.0 (the current primary plan, revised 2026-09-25):

| Component | Runs on | Address (from both sides) |
|---|---|---|
| `pds-keycloak` (container) | WSL2, via `podman compose` | `localhost:8080` |
| `web-platform-stub` (container) | WSL2, via `podman compose` | `localhost:3000` |
| `pds` (container) | WSL2, via `podman compose` | `localhost:8081` |
| Angular SPA | WSL2, `ng serve` (dev tool, not containerized) | `localhost:4200` |
| Outil Local (`init`/`setup`/runtime) | **Windows**, native Node, separate checkout of `poc-code/outil-local/` | n/a (stdio to Claude Desktop) |
| Claude Desktop | Windows | n/a |

WSL2 forwards `localhost` to Windows, so a Windows browser or the Windows-native Outil Local
process reaches every container/SPA port directly at `localhost:<port>`. Fallback (if the
native-Windows Outil Local path hits an unexpected issue): launch Outil Local via `wsl.exe`
instead — see `outil-local/spec.md` §4.5. This guide gives WSL2-native commands as `[WSL2]` and
Windows-native commands as `[WIN]`.

## 1. One-time machine setup

Full detail: `architecture.md` §12.0. Summary:

| Tool | Version | Where |
|---|---|---|
| JDK | 21 LTS, Temurin | WSL2 |
| Maven | 3.9.x (or use the committed `./mvnw`) | WSL2 |
| Podman | ≥ 4.4, with `podman compose` | WSL2 |
| Node | 20 LTS+ | WSL2 (one install) **and** Windows (a second, separate install) |
| Claude Desktop | current | Windows |

Keep the repo on WSL2's Linux filesystem (`/home/...` or `/workspace/...`), never `/mnt/c/...`.
WSL2: enable systemd (`/etc/wsl.conf` → `[boot]\nsystemd=true`, then `wsl --shutdown`); raise
memory in `C:\Users\<you>\.wslconfig` (`[wsl2]\nmemory=8GB`).

## 2. Tab 0 — Boot everything + happy path (= scenario S1)

Every step below is `[WSL2]` unless marked `[WIN]`. Run in order; later tabs assume this tab
succeeded.

**Steps 2.1–2.5 are automated**: `./run-boot.sh` (same directory) runs and checks all five in
order — real commands, real retry/health polling (container health via `podman inspect`, not
`podman compose ps`'s text table, whose STATUS column formatting differs across compose
backends — e.g. the docker-compose plugin some Rancher Desktop setups delegate `podman compose`
to never prints `(healthy)` there at all, even for a service with a real healthcheck), stops at
the first real failure, backgrounds the SPA dev server (step 2.5) and prints how to stop it. Use
it instead of running 2.1–2.5 by hand; steps 2.6 onward are still manual/browser-driven.

### 2.1 Generate the platform signing key (once per checkout)

```bash
cd poc-code/platform/stub && npm install
cd ../../deploy && ./gen-keys.sh
```
Expected: `poc-code/deploy/keys/platform-signing.jwk.json` created (RSA-2048, `kid
platform-poc-1`), or `already exists — leaving it` if run before. Idempotent.

### 2.2 Build every module (once per checkout, or after a code change)

```bash
cd poc-code/platform/stub && npm install && npm run build
cd ../spa && npm install --legacy-peer-deps && npm run build
cd ../../pds && ./mvnw -DskipTests package
cd ../outil-local && npm install && npm run build   # WSL2 copy — build/test only
```
Expected: all four succeed with no errors. The WSL2 `outil-local` build is for running its own
test matrix (`MANUAL-TESTING.md`) — the copy that actually drives Claude Desktop at demo time is
a **separate, Windows-native checkout** (see 2.8).

### 2.3 Start the containerized stack

```bash
cd poc-code/deploy
podman compose up -d --build
podman compose ps
```
Expected: `pds-keycloak`, `web-platform-stub`, `pds` all show healthy/running.
`pds` has `depends_on: pds-keycloak (service_healthy)`, so it waits.

**Always pass `--build`.** Without it, compose reuses whatever image is already cached locally —
even after you've rebuilt the jar/`dist/` in 2.2 — so a plain `up -d` can boot a container that
silently predates the code you just changed (no error, no warning). This bit a real test on
2026-10-14: a `tool_constraints` enforcement change was present in the PDS/stub source and passed
unit tests, but the running container was a stale pre-change image, so the behavior never showed
up live until `podman compose build <service> && podman compose up -d` was run by hand. `podman
compose images <service>`'s `CREATED` column is **not** reliable evidence either way here —
reproducible-build layers get a frozen near-epoch timestamp regardless of actual build time.

### 2.4 Health checks

```bash
curl -s http://localhost:3000/jwks.json          # one RSA key, kid: platform-poc-1
curl -s http://localhost:8081/pds-jwks.json       # one Ed25519 key, kid: bqt-assertion-1
curl -s -o /dev/null -w '%{http_code}\n' -X POST http://localhost:8081/mcp \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"preflight","version":"0.0.1"}}}'
```
Expected: JWKS bodies as noted; last command prints `200`. **Do not** use
`@modelcontextprotocol/inspector --cli` for this check — its Streamable HTTP client opens a
`GET /mcp` SSE stream that the PDS's discovery exemption does not cover (POST-body-only
exemption), so it fails even though the route is fine (`pds/TESTING.md` §7).

### 2.5 Start the SPA

```bash
cd poc-code/platform/spa
npm start
```
Expected: `http://localhost:4200` loads the landing page.

### 2.6 Register the PDS as a provider

**Browser path** (matches `script.md` beat 2 — also exercises **S11**):
1. `http://localhost:4200/admin/login` → `admin@bqt.example` / `demo`.
2. `/admin/register` step 1 (any values) → Continuer.
3. Step 2: MCP endpoint `http://pds:8081/mcp` (the field's default) → **Découvrir**. Must be
   the compose-network address, not `localhost:8081` — this handshake runs server-side, *inside*
   the `web-platform-stub` container, which can't reach the PDS via `localhost` (found live
   2026-10-09; see `contracts.md` §6 for the full host-vs-compose address matrix). `curl -s -X
   POST ... -d '{"error":"discovery_failed","detail":"...ECONNREFUSED 127.0.0.1:8081..."}'` is
   the symptom if you typed `localhost` here instead.
4. Expected: review screen, exactly one tool `get_balance`, **read-only** badge, **no**
   amount/ceiling field (= S11 pass). Click **J'accepte**.
5. Expected: screen shows `provider_id` (fixed demo value
   `9b7c1e40-2f6a-4c11-9e2a-000000000bqt`) + a `/mandate/new?provider=<uuid>` link. Copy it.

**Terminal-only equivalent** (scriptable, same end state — `/providers` only *stores*
`mcp_endpoint`, it doesn't live-fetch it, so either value technically works here, but use the
same compose-network value for consistency with the browser path above):
```bash
curl -s http://localhost:3000/providers -XPOST -H 'content-type: application/json' -d '{
  "mcp_endpoint":"http://pds:8081/mcp",
  "confirmed_tools":[{"name":"get_balance","annotations":{"readOnlyHint":true}}]}'
```
Expected: `200 {provider_id, mandate_link, schema_sha256, confirmed_at}`.

### 2.7 Link the customer's account

**Browser path**: open the mandate link from 2.6 → `/pds-space` → pick **Sofie Maes** → click
**Configurer un agent IA** → lands on `/itsme` → pick **Sofie Maes** again.

**Terminal-only equivalent**:
```bash
B=http://localhost:3000
LS=$(curl -s $B/account-link/initiate -XPOST -H 'content-type: application/json' -d '{
  "provider_id":"9b7c1e40-2f6a-4c11-9e2a-000000000bqt",
  "pds_customer_id":"cust-002"}' | grep -o '"link_session_id":"[^"]*"' | cut -d'"' -f4)
echo "$LS"
```
Expected: 200, `link_session_id` + `provider_account_ref: "pacr_bqt_2c8d40"` + `expires_at`
(now + 600s). `cust-002` = Sofie Maes (see §4 seed table).

### 2.8 Mint the mandate

**Browser path**: `/mandate/new` is now a 2-step wizard. Step 1 "Installer l'outil local" shows
the install/init command directly on screen — execute it (Windows-native checkout), then paste
the printed public key → **Continuer**. Step 2 "Créer le mandat" — label defaults to
`banque-test-sofie`; purpose `consultation de solde`; expiry 1h; tick `get_balance` → click
**Valider**. Expected: success screen with a one-line `setup` command (copy button) and the raw
config block.

**Terminal-only equivalent** (use the real JWK from running `outil-local init` on the
Windows-native checkout, not a test vector):
```bash
RESP=$(curl -s $B/mandates -XPOST -H 'content-type: application/json' -d '{
  "provider_id":"9b7c1e40-2f6a-4c11-9e2a-000000000bqt",
  "link_session_id":"'"$LS"'",
  "itsme_sub":"itsme:be:sofie.maes",
  "agent_jwk":{"kty":"OKP","crv":"Ed25519","x":"<x FROM running outil-local init>"},
  "agent_label":"banque-test-sofie","purpose":"consultation de solde",
  "allowed_tools":["get_balance"],"ttl_seconds":3600}')
JTI=$(echo "$RESP"   | grep -o '"jti":"[^"]*"'              | cut -d'"' -f4)
REDEEM_URL=$(echo "$RESP" | grep -o '"setup_redeem_url":"[^"]*"' | cut -d'"' -f4)
echo "jti=$JTI"
echo "redeem_url=$REDEEM_URL"
```
Expected: 200, response includes `jti`, `delegation_token`, `setup_redeem_url` (10-minute TTL,
single-use), `provider_api_endpoint`. **Keep `$JTI` and the raw `delegation_token`** — needed by
S2, S4, S8, §2.12.

### 2.9 `[WIN]` Configure the agent

If you minted via the browser (2.8), the success screen shows `npx @veritia/mcp-server
setup <url>` — **don't type that literally**: `@veritia/mcp-server` is `private: true`
and genuinely not on the npm registry (confirmed live 2026-10-09 — `npm view` → `404`), so it's
aspirational copy showing the eventual published product, not a runnable command today. Copy
only the URL and run the real equivalent:
```powershell
node dist\index.js setup "<REDEEM_URL from 2.8>"
```
Expected: writes `C:\Users\<you>\.veritia\banque-test-sofie\config.json` (mode
restricted, contains `AGENT_DELEGATION_TOKEN` + `PROVIDER_API_ENDPOINT`); stdout confirms
`NP_MANDATE=banque-test-sofie`. Running the same redeem URL twice fails on purpose
(single-use).

### 2.10 `[WIN]` Wire Claude Desktop

Edit `claude_desktop_config.json`:
```json
{ "mcpServers": { "banque-test": {
  "command": "node",
  "args": ["C:\\Users\\<you>\\outil-local\\dist\\index.js"],
  "env": { "NP_MANDATE": "banque-test-sofie" }
}}}
```
Restart Claude Desktop. Expected: it lists a `banque-test` server with tools `get_balance` and
`list_transactions` (discovered live from the real PDS).

### 2.11 Ask the balance

In Claude Desktop: *"What's my Banque Test balance?"*
Expected: answer ≈ **€ 12 802,50** (Sofie Maes → `pacr_bqt_2c8d40` → `cust-002`, see §4).

### 2.12 `[WSL2]` Confirm both audit trails

**Browser (recommended, matches `script.md` beat 8)**: `/dashboard` as Sofie → click the
mandate row → expands to **two panels side by side** — Trace Plateforme (platform) and Trace
Prestataire (PDS). The second panel was added 2026-10-09 (step 9b, `contracts.md` §8.6): before
this, `mcp_call_audit` had no log line and no endpoint — the only way to see it was a direct H2
query. Now the PDS's `GET /mcp-audit/:jti` is fetched directly by the browser (not through the
stub) and rendered right there.

**Terminal equivalent, either trail**:
```bash
curl -s http://localhost:3000/audit/$JTI       # Trace Plateforme (append | jq if installed)
curl -s http://localhost:8081/mcp-audit/$JTI   # Trace Prestataire
```
Expected: platform trace shows `MANDATE_ISSUED → ACCOUNT_LINK_VERIFIED → SETUP_CODE_REDEEMED →
INTROSPECT_CALLED`; provider trace shows `{"decision":"ALLOW","tool_name":"get_balance",
"provider_account_ref":"pacr_bqt_2c8d40",...}`. Neither the PDS nor the stub ever print this to
`podman compose logs` — that was `demo/script.md`'s original (wrong) assumption, corrected the
same day this endpoint was added.

**Tab 0 complete = S1 (happy path) verified, every component confirmed talking to every other
component.**

### Reset (used between later scenarios)

```bash
cd poc-code/deploy
podman compose restart web-platform-stub   # wipes in-memory mandates/providers/audit; H2 (PDS) persists
```
Re-run §2.6–§2.8 (and §2.9 if Outil Local needs a new mandate) after this. Full wipe:
`podman compose down -v && rm -rf ../deploy/data` then `up -d` + `./gen-keys.sh` if
`deploy/keys/` was removed too.

---

## 3. Scenario tabs — S2 through S17

Template per scenario: `id`, `name`, `reproducible` (`live` = real stack, real keys, no
forging; `automated-only` = needs hand-forged invalid material, only exercised by a committed
test class), `precondition`, `where`, `command`, `expected`, `reference`. State mutation
warnings are called out where relevant — some scenarios dirty the in-memory stub state (see
Reset above).

### S2 — stolen token, no matching key
- reproducible: live
- precondition: Tab 0 complete; a valid `AGENT_DELEGATION_TOKEN` on hand (from `config.json` in
  §2.9, or decode it from `$RESP` in §2.8)
- where: `[WSL2]`
- command:
```bash
cd poc-code/demo
MCP_URL=http://localhost:8081/mcp ./replay-no-key.sh "<AGENT_DELEGATION_TOKEN>"
```
  (`npm install` runs automatically on first use.) This forges a syntactically valid DPoP proof
  signed with a throwaway attacker Ed25519 key — not just a missing header — so the request
  fails specifically at the PoP thumbprint-match step, not an earlier, easier check.
- expected: `403 pop_key_mismatch` (fallback: `401 bad_dpop` if the proof itself is malformed)
- reference: `contracts.md` §2.7–2.8; `script.md` beat 6; `replay-no-key.sh`/`.mjs`;
  `../explanations/stolen-token-gap.md`

### S3 — expired mandate
- reproducible: live
- precondition: Tab 0's provider + account-link already exist (reuse `$LS`... actually a link
  session is single-use — open a **fresh** one: repeat §2.7 first)
- where: `[WSL2]` for minting, `[WIN]` for setup, Claude Desktop for the call
- command:
```bash
# fresh link session (§2.7 is single-use, consumed by the previous mandate)
LS2=$(curl -s $B/account-link/initiate -XPOST -H 'content-type: application/json' -d '{
  "provider_id":"9b7c1e40-2f6a-4c11-9e2a-000000000bqt","pds_customer_id":"cust-002"}' \
  | grep -o '"link_session_id":"[^"]*"' | cut -d'"' -f4)
RESP2=$(curl -s $B/mandates -XPOST -H 'content-type: application/json' -d '{
  "provider_id":"9b7c1e40-2f6a-4c11-9e2a-000000000bqt","link_session_id":"'"$LS2"'",
  "itsme_sub":"itsme:be:sofie.maes",
  "agent_jwk":{"kty":"OKP","crv":"Ed25519","x":"<x FROM running outil-local init>"},
  "agent_label":"banque-test-sofie-expiring","purpose":"test expiry",
  "allowed_tools":["get_balance"],"ttl_seconds":15}')
echo "$RESP2" | grep -o '"setup_redeem_url":"[^"]*"'
```
  `[WIN]`: `node dist\index.js setup "<that redeem_url>"`; edit Claude Desktop's config
  `NP_MANDATE` to `banque-test-sofie-expiring`, restart Claude Desktop, **wait 20+ seconds**,
  then ask the balance.
- expected: Claude Desktop surfaces a tool error naming `token_expired` (outil-local maps the
  provider's 401 to `provider rejected the call: token_expired (HTTP 401)`, does not crash)
- automated alternative (faster, no Windows/Claude Desktop round-trip):
```bash
cd poc-code/pds
./mvnw test -Dtest="MandateDpopFilterTest#s3_expiredMandate_returnsTokenExpired"
```
  expected: `BUILD SUCCESS`, 1 test run.
- reference: `contracts.md` §2.3; `MandateDpopFilterTest.java` S3 block

### S4 — revoked mandate
- reproducible: live
- precondition: Tab 0's `banque-test-sofie` mandate still active
- where: browser (`/dashboard`) or `[WSL2]` curl, then Claude Desktop
- command (browser): `/dashboard` as Sofie → the mandate row → **Revoke**. Then ask Claude
  Desktop the balance again.
- command (curl equivalent):
```bash
curl -s $B/mandates/$JTI/revoke -XPOST
```
- expected: `200 {"status":"REVOKED","revoked_at":...}`; next Claude Desktop call surfaces
  `revoked_or_unknown`; stub audit (`GET /audit/$JTI`) shows `MANDATE_REVOKED` then
  `INTROSPECT_CALLED reason=revoked`
- reference: `contracts.md` §7 row S4; `script.md` beat 7
- note: this mandate is now dead — Tab 0's §2.8–§2.11 must be redone before relying on
  `banque-test-sofie` again in a later scenario

### S5 — wrong provider (`aud` mismatch)
- reproducible: automated-only (the public `/mandates` API has no field to set a different
  `aud` — it's always the stub's own configured `PDS_MCP_URI`)
- where: `[WSL2]`
- command:
```bash
cd poc-code/pds
./mvnw test -Dtest="MandateDpopFilterTest#s5_wrongAudience_returnsAudMismatch"
```
- expected: `BUILD SUCCESS`; the filter returns `403 aud_mismatch` even though the signature is
  valid
- reference: `contracts.md` §2.4; `MandateDpopFilterTest.java` S5 block

### S6 — replay of a valid signed request
- reproducible: automated-only (live repro needs capturing a real request's exact bytes
  in-flight and resending them — no committed tool in this repo does that; Outil Local
  deliberately mints a fresh `jti`/`iat` per call, so it can never replay itself)
- where: `[WSL2]`
- command:
```bash
cd poc-code/pds
./mvnw test -Dtest="MandateDpopFilterTest#s6_replayedProof_secondCallReturnsDpopReplay"
```
- expected: `BUILD SUCCESS`; first call reaches the filter chain, identical second call →
  `403 dpop_replay`
- reference: `contracts.md` §2.12; `MandateDpopFilterTest.java` S6 block

### S7 — tampered body
- reproducible: automated-only (same reason as S6 — needs modifying a real request in flight)
- where: `[WSL2]`
- command:
```bash
cd poc-code/pds
./mvnw test -Dtest="MandateDpopFilterTest#s7_bodyChangedAfterSigning_returnsBodyHashMismatch"
```
- expected: `BUILD SUCCESS`; `403 body_hash_mismatch`
- reference: `contracts.md` §2.11; `MandateDpopFilterTest.java` S7 block

### S8 — introspection down (fail-closed)
- reproducible: live
- precondition: Tab 0's mandate still valid and unrevoked
- where: `[WSL2]`, then Claude Desktop
- command:
```bash
cd poc-code/deploy
podman compose stop web-platform-stub
```
  Then ask Claude Desktop the balance (same mandate).
- expected: tool error naming `introspection_unreachable` (fail-closed — denied, not allowed
  through, even though the mandate itself was never revoked)
- cleanup — **this wipes the stub's in-memory state** (stopping the container kills its process,
  same effect as `restart`):
```bash
podman compose start web-platform-stub
```
  Redo §2.6–§2.8 before the next scenario that needs a mandate.
- automated alternative:
```bash
cd poc-code/pds
./mvnw test -Dtest="MandateDpopFilterTest#s8_introspectionUnreachable_failsClosed"
```
- reference: `contracts.md` §2.5; `MandateDpopFilterTest.java` S8 block

### S9 — tool not in mandate
- reproducible: live
- precondition: Tab 0's mandate, `allowed_tools: ["get_balance"]` only (as minted in §2.8)
- where: Claude Desktop
- command: ask *"List my recent Banque Test transactions."* (calls `list_transactions`, a
  real, discovered tool — just not one this mandate permits)
- expected: tool error naming `tool_not_allowed`
- automated alternative:
```bash
cd poc-code/pds
./mvnw test -Dtest="MandateDpopFilterTest#s9_toolNotInAllowedList_returnsToolNotAllowed"
```
- reference: `contracts.md` §2.13; `MandateDpopFilterTest.java` S9 block

### S10 — unknown account link
- reproducible: automated-only (the real flow can never mint a token whose
  `provider_account_ref` has no matching `account_link` row — the PDS itself validates
  `pds_customer_id` before issuing an assertion)
- where: `[WSL2]`
- command:
```bash
cd poc-code/pds
./mvnw test -Dtest="GetBalanceToolTest#call_withUnknownProviderAccountRef_returnsUnknownAccountAndDeniesAudit"
```
- expected: `BUILD SUCCESS`; MCP tool result `code: "unknown_account"`, `mcp_call_audit` row
  `decision=DENY reason=unknown_account`
- reference: `contracts.md` §8; `GetBalanceToolTest.java`

### S11 — read-only provider registration
- reproducible: live — already exercised in Tab 0 §2.6 (browser path)
- where: browser
- command: see §2.6 steps 1–4
- expected: review screen shows exactly one tool `get_balance`, a **read-only** badge, and
  **no** amount/ceiling field (deterministic parse, no governance ceiling needed for a
  read-only tool)
- reference: `contracts.md` §7 row S11; `platform/spec.md` Part B; `platform/spa/TESTING.md`

### S12 — discovery failure
- reproducible: live
- precondition: nothing need be running at the target port
- where: browser or `[WSL2]` curl
- command (browser): `/admin/register` step 2, endpoint `http://localhost:9/mcp` (nothing
  listens there) → **Découvrir**
- command (curl equivalent):
```bash
curl -s -XPOST http://localhost:3000/discover -H 'content-type: application/json' \
  -d '{"mcp_endpoint":"http://localhost:9/mcp"}'
```
- expected: browser shows a red `discovery_failed` banner; curl → `502
  {"error":"discovery_failed","detail":"...ECONNREFUSED..."}`; **no** `provider_id` is issued
- reference: `contracts.md` §7 row S12; `platform/stub/TESTING.md` endpoint 3

### S13 — stub restart mid-demo
- reproducible: live
- precondition: Tab 0's mandate exists and its `$JTI` is known
- where: `[WSL2]`, then Claude Desktop
- command:
```bash
cd poc-code/deploy
podman compose restart web-platform-stub
```
  Then ask Claude Desktop the balance again (same mandate as before the restart).
- expected: the stub no longer recognizes `$JTI` (`GET /introspect/$JTI` → `404
  unknown_jti`); the PDS fail-closes the same way as a revoked mandate → tool error naming
  `revoked_or_unknown`
- cleanup: redo §2.6–§2.8 (and §2.9) before the next scenario — same state-wipe note as S8
- reference: `contracts.md` §7 row S13; `script.md` Fallbacks table; `MandateDpopFilter.java`
  (introspection 404 → `403 revoked_or_unknown`)

### S14 — tampered account-link assertion
- reproducible: automated-only (the PDS assertion is embedded inside the delegation JWT's own
  signed payload — editing it after the fact breaks the **outer** JWT's signature too, which
  fails earlier in the chain than S14 is meant to test; only a test that constructs the forged
  material from scratch can isolate this specific check)
- where: `[WSL2]`
- command:
```bash
cd poc-code/pds
./mvnw test -Dtest="MandateDpopFilterTest#s14_tamperedAssertionSignature_returnsAssertionInvalid"
```
- expected: `BUILD SUCCESS`; `403 account_ref_assertion_invalid`, `mcp_call_audit DENY` row with
  that reason
- reference: `contracts.md` §9 steps 14–15; `MandateDpopFilterTest.java` S14 block

### S15 — assertion / value mismatch
- reproducible: automated-only (same reason as S14 — needs a deliberately-inconsistent token
  built from scratch, not an edit of a real signed one)
- where: `[WSL2]`
- command:
```bash
cd poc-code/pds
./mvnw test -Dtest="MandateDpopFilterTest#s15_accountRefValueDoesNotMatchAssertionSubject_returnsValueMismatch"
```
- expected: `BUILD SUCCESS`; `403 account_ref_value_mismatch`
- reference: `contracts.md` §9 step 16; `MandateDpopFilterTest.java` S15 block

### S16 — replayed link assertion at issuance
- reproducible: automated-only (the live `POST /account-link/initiate` endpoint always fetches
  a **fresh** assertion — a fresh `jti` every time — from the PDS itself; there is no public API
  path to feed it the same previously-used raw assertion twice, only the stub's own test suite
  constructs that exact input)
- where: `[WSL2]`
- command:
```bash
cd poc-code/platform/stub
npm test
```
  (full suite; to isolate just this case, if your Node supports it:
  `npx tsx --test --test-name-pattern="jti_replay" test/stub.test.ts`)
- expected: all green, including `POST /account-link/initiate — replayed assertion jti -> 422
  jti_replay (S16)`; second call with the same `jti` → `422 {"error":"assertion_invalid",
  "detail":"jti_replay"}`
- reference: `contracts.md` §7 row S16; `platform/stub/src/assertion.ts`;
  `platform/stub/test/stub.test.ts` line ~384

### S17 — cross-provider link session
- reproducible: automated-only (requires two registered providers plus a hand-built mismatched
  request — the stub's own test suite covers this exact combination already)
- where: `[WSL2]`
- command:
```bash
cd poc-code/platform/stub
npm test
```
- expected: all green, including `POST /mandates — unknown / expired / cross-provider link
  session (A-2, S17)`; a link session opened for provider A, presented to `/mandates` with
  `provider_id` = provider B → `400 {"error":"link_session_provider_mismatch"}`
- reference: `contracts.md` §7 row S17; `platform/stub/src/app.ts` (`/mandates` handler);
  `platform/stub/test/stub.test.ts` line ~507

---

## 4. Seed data (fixed across every scenario)

| `pds_customer_id` | Name | `provider_account_ref` | IBAN | Balance | itsme `sub` |
|---|---|---|---|---|---|
| `cust-001` | Pieter Janssens | `pacr_bqt_7f3a91` | BE68 5390 0754 7034 | € 4 231,17 | `itsme:be:pieter.janssens` |
| `cust-002` | Sofie Maes | `pacr_bqt_2c8d40` | BE71 0961 2345 6769 | € 12 802,50 | `itsme:be:sofie.maes` |
| `cust-003` | Noah Dubois | `pacr_bqt_9b1e05` | BE62 5100 0754 7061 | € 318,04 | `itsme:be:noah.dubois` |

Password for all three (via the PDS's own Keycloak, `/accounts/me` only, unrelated to the
mandate flow): `demo`. Fixed demo `provider_id`: `9b7c1e40-2f6a-4c11-9e2a-000000000bqt`.
`list_transactions` is seeded from `V3__transactions.sql` — 22/28/34 rows for
`cust-001`/`cust-002`/`cust-003` respectively (2026-10-14 addendum on top of the original
10/customer), spanning 2026-06-18 to 2026-10-14. Period filtering counts back from each
customer's own most recent row, not wall-clock "now". For Sofie Maes (`cust-002`, the one used
in §2.11/§2.12 and most of this guide): `7j` → 3 rows, `30j` → 13 rows, no `period` (default
`max_results=20`) → the 20 most recent. If you add/remove rows again, recompute from the file
instead of trusting this paragraph — see `ListTransactionsToolTest` for the values the
automated suite actually asserts.

## 5. Full-suite automated regression (run anytime, no containers needed)

```bash
cd poc-code/pds && ./mvnw test                 # expect 51/51 green
cd poc-code/platform/stub && npm test          # expect 35/35 green
cd poc-code/outil-local && npm run build       # tsc clean; no automated suite, see MANUAL-TESTING.md
```
This alone re-verifies S2, S3, S5–S10, S14, S15, S16, S17 (everything marked
`automated-only` above) plus the happy path and revocation baseline, in under a minute, with no
compose stack running.
