Course deliverables mapped to the repository¶
FeeCheck is the project of an AI software engineering course. Each course block asks for a set of deliverables. Most of the substance already exists in the code, the arc42 chapters and the ADRs; what has been missing is the mapping from the course checklist to that material. This page gathers that mapping for every block. It builds nothing: for each deliverable it says what covers it, how well, what is missing, and the smallest step that closes the gap. Which gaps get closed is the owner's decision.
Deliverables are numbered by block and point: 3.2 is block 3, point 2.
Blocks 1 and 2¶
Not mapped yet. Their deliverables are still to be collected from the course.
Block 3¶
Verdicts. Full — the deliverable can be handed in from what exists, with a pointer page at most. Partial — the core exists, one named element is missing. Missing — nothing in the repository answers it yet.
Summary¶
| # | Deliverable | Verdict | The gap in one line |
|---|---|---|---|
| 3.1 | Domain split with sketch and rationale | Full | The generated module diagram is not committed; the target cut is still open (OQ-11) |
| 3.2 | OpenAPI with error cases (+ idempotency, PII, SLO) | Partial | Idempotency of POST /api/cases is specified but not built; PII minimisation open (OQ-8); no measurable service objective |
| 3.3 | MCP tool with auth, least privilege, validation, audit, consent | Missing in most parts | Two read-only tools, no app-level auth, no audit, no write tool, no consent point |
| 3.4 | Async harness with duplicate delivery, bounded retry, DLQ | Full (queue) / partial (outbox) | The outbox resubmits without a cap |
| 3.5 | AI integration choice, RAG sketch, bounded tool agent | Partial | No cost cap in money in the product; human release not built |
| 3.6 | AI review note with diffs | Partial | 54 commits carry the template's section, more record it in prose; none collected, none with a diff |
| 3.7 | ≥ 5 versioned success, failure and attack cases with latency or cost | Partial to full | Cases and cost exist; no dataset version beyond git, two attack fixtures |
3.1 — Domain split into at least two modules or services, with a sketch and a 2–3 sentence rationale¶
What covers it.
- The code. Eight Spring Modulith modules under
backend/app/src/main/java/net/lauper/feecheck/:intake,extraction,cases,consumer,mcp,signin,webappand an empty sharedkernel(ADR-0007). Each carries the onion rings its role needs:intake,extractionandcaseshave all three (@DomainRing,@ApplicationRing,@InfrastructureRing),consumerhas application and infrastructure,mcp,signinandwebappare infrastructure only, andkernelis domain only. The types a module publishes are@NamedInterfaces: the domain and application packages ofintakeandextraction, and the domain package ofcases(#267). - The enforcement.
ModularityTestrunsApplicationModules.verify(), asserts the module set, and carries two planted-violation probes so a check that never fails would be caught.OnionArchitectureTestholds the ring and module-fence rules. Both run in./gradlew build. - The sketch. Mermaid diagram in 5.2.1 White Box Backend,
with an element table and the module-cut prose in 5.2.2. Its arrows match the imports in the code
exactly: consumer → cases, extraction, intake; cases → extraction, intake; extraction → intake;
mcp → extraction.
reconciliationis drawn as planned and has no package yet. - The rationale. 4.2 Modularization: one deployable
organised as a modulith, one business capability per module, and modules meet only through
published interfaces or events. The
cases/domainJavadoc says whycasesis a module of its own: a case port inside intake would close a cycle. ModularityTest.moduleDocsAreWrittenwrites PlantUML and module canvases tobackend/app/build/spring-modulith-docs(#487). That output is build-only and is not committed.
Verdict: full. One caveat to state openly: ADR-0001 and ADR-0003, which proposed a module cut,
are imported and outdated, and which cut is the target is open question OQ-11 in
open.md. And 4.2 itself says the queue's consumer module has no place
in the target design.
To document. Hand in the 5.2.1 diagram and three sentences drawn from 4.2: one capability per
module (intake converts, extraction reads values, cases owns the case and its state); modules meet
only through published types, verified by the build; and one deployable, because NFR-12 asks for a
proportional footprint of at most one backend deployable. Name ModularityTest as the proof that the sketch is the code.
Smallest step. None needed. Optional: copy the generated components.puml into the submission
as a second, machine-drawn view.
3.2 — OpenAPI with error cases; idempotency, PII boundary and a service objective for one central endpoint¶
What covers it.
- The contract.
api/openapi.yaml(OpenAPI 3.1.0), derived code-first by springdoc and committed (ADR-0010 points 4, 5, 7, 8; spec 261, #261). OpenApiSnapshotTest(OA-1, OA-2) fails the build when the YAML drifts from the code.ContractExchangesTestandContractQueuedExchangesTest(OA-3 to OA-11) validate real requests and responses against it, including a deliberate mismatch.- The error cases. Error cases are in the contract for every path.
POST /api/casesdeclares 201 / 202 / 401 / 403 / 413 / 415 / 422 / 503.POST /api/cases/{id}/extractiondeclares 201 / 202 / 401 / 403 / 404 / 409 / 502 / 503.- Errors use a shared
Problemschema (outcome,reason, and optional context fields). It is plainapplication/json, not RFC 9457application/problem+json. - The central endpoint is
POST /api/cases(the contract upload). - Idempotency. It is specified: spec 339 (
docs/specs/339-case-api.md) rule R-8 and criterion CA-14 say that the same bytes open no second case and answer 200 with the sameLocation(FR-1,contentHash). It is not built: there is no content-hash code insrc/main, no 200 branch inCaseController.submit, and no 200 response inapi/openapi.yaml. What is built is an idempotent consumer: a redelivered queue message is turned away by the case's claim and lease (CaseConsumer, JB-5, JB-6). - PII boundary. For logs and URLs it is specified and tested.
- The case ID is a random UUID and deliberately not a content hash, so it does not reveal
whether two people hold the same contract. It is the only identifier a URL
carries (spec 339). Log lines carry it and other internal IDs, such as the
extractionIdof thellm.callline, but no contract content. - No contract content goes into any log (CC-7, NFR-4).
CaseExtractionControllerTest(CA-15),ExtractionLogTestandGeminiLogTestcapture the logs and check that. - Beyond logs and URLs it is not minimised. The case stores the uploader's verified email and the file name and returns them to every signed-in person (spec 339). The PII minimisation procedure of G-2 is open question OQ-8.
- The case ID is a random UUID and deliberately not a content hash, so it does not reveal
whether two people hold the same contract. It is the only identifier a URL
carries (spec 339). Log lines carry it and other internal IDs, such as the
- Service objectives. They exist only as budgets for the whole system, in 10.1.8:
- the review screen answers in under 2 s at fewer than 50 sessions;
- extraction takes "minutes";
- availability is business hours.
None of them is tied to an endpoint or carries a percentile.
Verdict: partial. The OpenAPI with error cases is full. The PII boundary is full for logs and URLs; minimisation is open (OQ-8). Idempotency is specified but not built. The SLO is missing.
To document. Submit api/openapi.yaml with the 413 / 415 / 422 / 503 responses of POST /api/cases
highlighted, and name OA-1 and OA-3 as the proof that the YAML is the running code. Write one short
endpoint card for POST /api/cases with three lines:
- Idempotency: R-8 / CA-14, marked "specified, not built", or built first (see below).
- PII: the UUID rule and CC-7.
- SLO: for example "p95 under 2 s for a 10-page PDF with the queue on (202)". Say that its
measurement is still to be built: no request log is configured, and
llm.calltimes model calls, not the upload.
Smallest step. Two, independent:
- Write the SLO into chapter 10 as a per-endpoint objective (documentation only).
- Build R-8 / CA-14 as an issue of its own. That is code: a content-hash lookup in
CaseStore, a 200 response and a contract test.
The draft docs/specs/339-case-api.openapi.yaml is marked superseded by api/openapi.yaml for
everything that is built, and kept only for what is not, above all R-8's 200 (#632).
3.3 — MCP tool with authentication and authorization, least privilege, validation and audit; a consent point for a critical write tool (a stub is enough)¶
What covers it.
- The server. An MCP server (spec 255, ADR-0011,
docs/guides/mcp-server.md) behind themcpprofile, off by default, Streamable HTTP at/mcp. - The tools. Two tools in
mcp/infrastructure/FeeCheckTools.java, both read-only and answering from code alone:helloandextraction_fields. - Authentication. The app does not authenticate MCP calls.
McpConfigurationgives/mcp/**its own filter chain withpermitAll(). Protection is outside the app: the Cloud Run invoker check, or loopback binding locally. App-level authentication and Origin validation are deferred to #257 (open question inopen.md). The sign-in roles of ADR-0015 do not apply to/mcp. - Least privilege. By design only: the tools read no store and no document, and the module sees
only extraction's published types (
OnionArchitectureTest). ADR-0011's "Price" says this rests on what the tools are written to do, not on a process boundary. - Validation. None beyond the SDK's own.
hellostrips a blank name; there are no bounds. - Audit. None. Spec 255 CC-7 says the component logs nothing of its own. A
guardrail.mcp-deniedline is planned in guardrails, not built. - A write tool and a consent point. Neither exists.
A pattern worth reusing is in the internal agent tools, which are not MCP: find_passages and
read_page.
DocumentLookuprefuses a blank query or one over 200 characters, caps results at 10, and refuses a page outside the document. A refusal is a result the model reads; nothing is thrown.DocumentLookupToolslogs every call by metadata only: tool, argument length, result length, latency and outcome.
Verdict: missing in most parts. The server exists; auth, authorization, validation, audit and consent do not.
To document. Today, honestly: the threat model (ADR-0011, guardrails G-3) and the outside-the-app protection, with the gaps named.
Smallest step. This deliverable needs code, and the course allows a stub. The smallest version needs no new store and no screen:
- A stub write tool that changes nothing. Its consent point is inside the tool: without an explicit confirmation argument it answers "pending: needs a person's consent", and with one it still only reports what it would have done.
- Validation of its arguments, for example a case ID that must be a UUID.
- One content-free audit log line per call: caller, tool, outcome, correlation ID.
- A test for each: refused without consent, an invalid argument, the audit line.
How MCP callers are authenticated, and whether tools get scopes, is open question #257 and a change
to an authentication flow, so it is the owner's decision. The options to lay out there are a bearer
token checked in the /mcp filter chain with a scope per tool, or keeping the Cloud Run invoker
check as the only gate. A write tool also has to be squared with G-3 (minimal permissions, released
findings only) and ADR-0011's read-only placement. That is why the stub changes nothing.
3.4 — Async harness with duplicate delivery, bounded retry and a DLQ; the sync/async decision and choreography vs. orchestration¶
What covers it.
- The decision. ADR-0009 (
docs/adr/adr-0009-async-intake-pubsub-bucket-firestore.md) is accepted (#252): a Pub/Sub push queue, and a dead letter after 100 attempts with 10–600 s backoff. - Its Firestore and "no outbox" points were overtaken by ADR-0013 (PostgreSQL) and spec 458. The rework of its superseded points is #465.
- The sync/async decision. Written in ADR-0009 §1/§4, spec 263 (
docs/specs/263-intake-job.md) §1, 4.2 and 6.2.1, which draws both flows. - Conversion runs in the upload's call and answers 201 by default (
cases.queue=none). - With the queue on, it answers 202 and a consumer converts.
- Duplicate delivery.
CaseConsumerclaims the case under a lease (PostgresCaseStore.claim,select … for update). - Tests:
CaseConsumerTestJB-5, JB-6, CA-17, CA-24;CasePushControllerTestJB-5, JB-6;PostgresCaseStoreTestPG-3. CaseEmulatorTestGA-8 runs against the Pub/Sub emulator, inintegrationTest(Docker), not inbuild.- Bounded retry.
ScaleToZeroRetry, the converter's cold and warm phases:ScaleToZeroRetryTestRT-1 to RT-4, RT-6 and RT-9.ModelRetryPolicy.DEFAULT, two retries for the model call: RT-9 to RT-12, inModelRetryPolicyTest,ModelRetryAdvisorTest,MistralRetryTestandGeminiRetryTest.- Both use Spring Framework 7's
RetryTemplate(spec 210). - The DLQ.
- A dead-letter policy in
compose/init-emulators.shand the deploy guide. - A dead-letter push endpoint,
/api/intake/jobs/dead-letter, which fails the case (DEAD_LETTERED): JB-10, CA-18, CA-19. - GA-9 proves redelivery up to the cap and then the dead letter, with 5 attempts in the test.
- The event outbox. Spring Modulith's JDBC publication registry with a resubmission every minute under an advisory lock (spec 458, ER-1 to ER-4). No production code publishes an event yet, and resubmission has no attempt cap (spec 458 §6 says so).
- Orchestration. Described in 4.2 and 8.16 Modulith: a
Flowable CMMN case engine in
casesorchestrates the stages through request/reply events. All of it is planned; Flowable is not in the build. - Choreography vs. orchestration. 8.16.3 compares the two (#632). The case and its stage work are orchestrated, facts between modules are choreographed, and the reasons for orchestrating the case are 8.18.3's. What runs today is neither: the queue path is a single point-to-point hand-off.
Verdict: full for the queue path (duplicate delivery, bounded retry, DLQ, all tested). Partial for the outbox path.
To document. Hand in the 6.2.1 sequence diagrams with the GA-8 / GA-9 / JB-5 / JB-10 test names as evidence, plus the sync/async paragraph from spec 263 §1.
Smallest step. Code, optional: a cap on outbox resubmissions with a parking state, as spec 458 §6 already plans.
3.5 — Choice of AI integration, a RAG sketch with its limits, and a bounded tool agent¶
What covers it.
- The integration choice. ADR-0012 (
docs/adr/adr-0012-model-provider-and-extraction-shape.md) is accepted (31 October 2026). - Providers: hosted Mistral (EU) and Gemini on Vertex AI in
europe-west3(#382), both through Spring AI. A customer-operated model is the documented on-prem path. Claude and OpenAI-compatible endpoints were considered and not pursued. - Switching is configuration only (
extraction.provider, NFR-7). - Shape S3: an agent loop with two read-only tools, under the OWASP LLM06 guards.
- The bounded agent.
ExtractionLoopwithLoopLimits.DEFAULT = (5, 8, 12, 100_000), inextraction/infrastructure/LoopLimits.java: 5 calls per tool, 8 tool calls in total, 12 model turns, 100,000 tokens per case. - Every stop ends in the fallback
LOOP_BUDGET_SPENT, logged with its reason. - Exactly one re-ask after the citation check (#388).
- Tests:
ExtractionLoopTestAL-6 (tool caps), AL-7 (turns), AL-8 (tokens), AL-9 (one record per step), AL-14/AL-15 (re-ask);LoopLimitsTest. - The Javadoc calls the caps "working defaults, not measured".
- Approval.
- The tools are read-only, so no step needs approval.
- Any field not
GROUNDEDmakesextractionComplete=false, and the case shows as "needs review" (CaseSummary.needsReview()). - The reviewer and approver roles exist (ADR-0015). The human release of a contract value (G-4) is planned as the workflow's release task (spec 15, W-3, W-6, W-7) and is not built.
- Cost. In tokens in the product; in money only in the evaluation harness
(
backend/evaluation/.../budget/Budget.java,gate/prices.json). - RAG. None.
- Embeddings are switched off (
spring.ai.model.embedding=none). Thevectorextension is created byV1__pgvector.sqland used by no table. find_passagesis a substring search over the rendition, not vector retrieval.- The only RAG design is ADR-0002 (assistance, imported and outdated): permission-filtered retrieval over a pgvector knowledge base, mandatory citations, no decision authority.
- Spec 383 §8 lists "rendition into a vector store instead of the prompt" as an open point.
- The RAG sketch. The research page
docs/research/mini-rag.md(#628) is the sketch: three uses (application help, retrieval over the contract, case enquiry), the mini-RAG for the first, embedding and store options, a three-step veto, and a section of limits — top-k hides what it cuts, chunking breaks tables, retrieved text is untrusted, the language of the text, and embeddings counting as contract content. Which option is taken is the owner's, in four questions at the end of the page.
Verdict: partial. The integration choice, the step and token caps and the RAG sketch are full. A cost cap in money and the approval step are missing.
To document. Hand in ADR-0012's option table and decision, and the LoopLimits / AL-6 to AL-8
evidence. Describe the approval limit as it is: read-only tools, and no result counts as complete
without a person.
Smallest step. Documentation only: state the money cap as "tokens × the gate/prices.json
price, not enforced in the product", or open an issue to enforce it.
3.6 — AI review note (accepted / corrected / rejected) with diffs¶
What covers it.
- CLAUDE.md, "Ways of working", requires corrected or rejected AI suggestions to be recorded in the commit.
- The pull request template has the section "AI suggestions corrected or rejected", which the
squash merge carries into the commit body on
main. - 54 commits on
maincarry that section. Earlier commits record the same in prose ("Rejected:", "From /simplify:"). Good examples, some from before the template:
| Commit | What was corrected or rejected |
|---|---|
f7f7f5d3 feat(#383) |
Spring AI's ToolCallAdvisor rejected (deprecated for removal); @Tool methods rejected because their conversion failure logs the model's argument (NFR-4) |
27c33817 refactor(#383) |
a separate budget advisor, generated tool schemas, and removing a parser overload rejected, with reasons |
052add41 refactor(#388) |
/simplify suggestions taken in part; two rejected |
858bc09e feat(#582) |
three "Corrected:" items (address emptying, CSRF token source, Infinity arithmetic) and a rejected-as-out-of-scope list |
9d1f9371 feat(#605) |
per-item taken / rejected lists from /simplify and /code-review, plus scope corrected by the owner |
None of these carries a diff, and nothing collects them.
Verdict: partial. The records are real and numerous; the collected note and the diffs are missing.
To document. Documentation only: one review-note page with 3–5 entries taken from the table above. Each entry has:
- the AI suggestion;
- the verdict — accepted, corrected or rejected;
- the reason;
- the diff, either as a fenced
diffblock of the relevant hunk (git show <hash> -- <file>) or as a link to the pull request's "Files changed".
Smallest step. Write that page. The commits are on main, so the diffs can be produced from
them now. No code changes.
3.7 — At least 5 versioned success, failure and attack cases with a latency or cost indicator¶
What covers it.
- The gate evaluation (spec 361 (
docs/specs/361-gate-evaluation.md), plan 361,backend/evaluation). - Dataset: 76 labelled fixtures in
gate/dataset/labels.csv— contract, invoice and other — including one injection fixture (con-ima-injection). - Scenarios S1–S7; S6 is the attack scenario: does instruction text in a document move the label.
- Every result line records
latencyMs, tokens andcostUsd, with model, model version and prompt hash. - The committed summaries in
backend/evaluation/results/report cost: about USD 7.8 for the baseline of 30 October, and USD per 100 documents per model. Perresults/README.md, S6 moved no label on any model. - The extraction evidence cases, in
backend/app/src/test/resources/documents/. - Fixtures: normal (
ima-acme-corp), failure (-unnumbered), ambiguous (-ambiguous) and attack (-injection). - All run offline against the stub, and against Mistral in
MistralSmokeTest. - The recorded run in the extraction guide (
docs/guides/structured-llm-response.md) shows the model obeying the injection and reportingINJ-0001. The citation check marked itUNSUPPORTED, so the result stayed incomplete. Follow-up #92. - The Gemini runs record turns and tokens: about 6,000 tokens for the normal case in three turns, and, for the failure case, eight turns with about 7,300 tokens in the last turn alone. The total of that run is not recorded.
- Unit-level attack cases.
ExtractionPromptTest: instructions in the document are forbidden, the markers carry a nonce, and a faked end marker cannot close the block.DocumentLookupTestCC-6: a tool result cannot forge a page anchor.- Upload limits PL-4 to PL-6: over the page limit gives 422, a file that is not a PDF gives 415.
- Telemetry. One
llm.calllog line per model call, with latency and tokens; the gate's token usage is persisted per case (#604). - Versioning. By git history only: no dataset version field, no manifest. The only tag is
block1-structured-llm-response.
Verdict: partial to full. More than five cases, all three kinds, with cost, latency or both recorded. Missing are an explicit version and a single table that lists them together.
To document. One table, which can sit on the same page as deliverable 3.6. One row per case:
- ID and kind — success, failure or attack;
- the fixture and its git commit or tag, which is the version;
- expected and observed result;
- latency or cost, with its source.
Six rows already exist. Only the two gate rows have a committed number; the four extraction rows get theirs from the smoke run below:
| Case | Kind | Number |
|---|---|---|
Normal IMA contract → both fields GROUNDED |
success | not recorded yet: llm.call latency and tokens of a smoke run |
Unnumbered contract → NOT_FOUND, incomplete |
failure | not recorded yet: the same |
Three reference numbers → AMBIGUOUS |
failure | not recorded yet: the same |
Extraction injection fixture → INJ-0001 UNSUPPORTED, incomplete |
attack | not recorded yet: the same |
Gate injection fixture con-ima-injection (S6) → label stays "contract" |
attack | committed: the gate cost per document in results/ |
| Gate S1 contract vs. invoice vs. other | success | committed: results/ cost per model |
Smallest step.
- Tag the dataset state that is cited, for example
eval-v1. That is the version. - Run
./gradlew integrationTestonce with a key, and copy the latency and token figures of thellm.calllines into the table. - Optional: an oversized-PDF case. The 422 path is already unit-tested, so it can be added as a seventh row.
The gap list¶
What the owner can choose to close, smallest first. Items marked docs change no code.
- docs — Review note with diffs (3.6) and the case table with versions and numbers (3.7).
- docs — A per-endpoint SLO for
POST /api/casesin chapter 10 (3.2). - ~~docs — Choreography vs. orchestration in 8.16 (3.4).~~ Done in #632.
- ~~docs — The RAG sketch and its limits (3.5).~~ Done: the research page of #628.
- ~~docs — Mark
docs/specs/339-case-api.openapi.yamlas superseded byapi/openapi.yaml(3.2).~~ Done in #632. - git — A tag that versions the evaluation cases (3.7).
- code — Content-hash idempotency of
POST /api/cases, R-8 / CA-14 (3.2). - code — The MCP stub write tool with validation, audit and a consent point (3.3); how callers authenticate stays with #257.
- code, optional — An attempt cap and parking state for outbox resubmission (3.4, spec 458 §6).
- code, optional — A cost cap in money in the product (3.5, G-5).