Skip to content

feat(lookups): typed category overview module (#137) - #139

Merged
Atrium0804 merged 2 commits into
feature/102-category-overview-v2from
issue-137-pure-lookup
Nov 17, 2026
Merged

Atrium0804 merged 2 commits into
feature/102-category-overview-v2from
issue-137-pure-lookup

Conversation

@Atrium0804

Copy link
Copy Markdown
Owner

Summary

+ recognize_turn(...) -> Ready | NeedsInformation | NotEligible
+ complete_with_intake(...) -> validate only request-grounded input
+ render_answer(ready, language_level) -> flat source-bearing answer

Adds the pure typed lookup module and focused tests, including paired-category semantics, safe follow-ups, grounded intake completion, and translation recognition. Chat/eval integration remains a later slice.

Evidence

  • Before: The integration branch had no independent typed lookup interface.
  • After: pytest app/tests tests → 517 passed, 7 skipped; Pyright → 0 errors.

Merge Danger

Door: Two-way

Blast Radius: Limited

The module is not wired into chat routing in this slice.

Closes #137

@Atrium0804
Atrium0804 merged commit c227204 into feature/102-category-overview-v2 Nov 17, 2026
9 of 10 checks passed
@Atrium0804
Atrium0804 deleted the issue-137-pure-lookup branch November 17, 2026 07:09
Atrium0804 added a commit that referenced this pull request Nov 18, 2026
) (#142)

* feat(categories): add gender-specific gearing data (#134)

Co-authored-by: Copilot <[email protected]>

* test(categories): reject unknown source gear values (#134)

Co-authored-by: Copilot <[email protected]>

* feat(lookups): typed category overview module (#137) (#139)

* feat(lookups): add typed category overview module (#137)

Co-authored-by: Copilot <[email protected]>

* fix(lookups): tighten category recognition and intake (#137)

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Ivo Stieltjes <[email protected]>
Co-authored-by: Copilot <[email protected]>

* feat(chat): integrate category overview lookups with safe state ordering (#136) (#140)

* feat(chat): integrate category overview lookups with safe state ordering (#136)

Chat, intake and eval now share recognize_turn, complete_with_intake and
render_answer. Each conversation keeps a revisioned lookup state, separate
from feedback history; a background intake job only publishes its state if
its revision is still current. Intake can complete only NeedsInformation,
never rescue rejected input. The legacy match_lookup/resolve_lookup_message
adapters are removed.

Co-authored-by: Copilot <[email protected]>

* refactor(chat): address review of lookup integration (#136)

Route becomes a tagged union with one shared route_reason for app and
eval; the accepted turn travels to the job as one LookupTurn. The eval
replay now completes an earlier incomplete beurt with the intake, like the
app. GLOSSARY no longer says the intake fills in discipline or works with
the regex lookup.

Co-authored-by: Copilot <[email protected]>

* test(chat): give every chat-test client one long-lived event loop (#136)

A bare TestClient runs each request in its own event loop, so a background
chat job could be stranded and time out (seen in CI on
test_chat_sends_language_level_context).

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Ivo Stieltjes <[email protected]>
Co-authored-by: Copilot <[email protected]>

* Category overview v2: final validation, docs and review fixes (#135) (#141)

* feat(lookups): name each source once and label the club source (#135)

The bypass source line listed ALGEMENE BEPALINGEN twice (age categories and licences). Each document now appears once; at B2 its articles are merged. The old-category mapping source is labelled as club source.

Co-authored-by: Copilot <[email protected]>

* docs(categories): reference, routing, ADR-0009 amendment and drift notes (#135)

Add docs/reference/categorieoverzicht.md, link it from the routing explanation, record the B1 source exception for every bypass answer as an ADR-0009 amendment, add Peiljaar to the glossary, document the stale_revision trace event and the approved-correction rule for document changes.

Co-authored-by: Copilot <[email protected]>

* feat(lookups): data-only lookup messages and closing question (#135)

Recognize messages that contain only lookup data, e.g. 'jongen uit 2015, U12, weg' (the #102/#125 example), as a first message and as a reply to a pending lookup; a bare year in such a message is a birth year. Routecontract rows added. Bypass answers now end with 'Moet ik de KNWU-documenten doorzoeken voor een gedetailleerder antwoord?'. Error messages in max_gear, complete_with_intake, render_answer and decide_route now state an action (CODING_PRINCIPLES).

Co-authored-by: Copilot <[email protected]>

* docs(categories): data-only input and closing question (#135)

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Ivo Stieltjes <[email protected]>
Co-authored-by: Copilot <[email protected]>

* fix((bypass): niet verwijzen naar clubsite
fix(bypass): geen bronregel in taalniveau B1

* fix(UI): liggende achtergrond t.b.v. bredere schermformaten

* chore(contributing): geen worktree aanmaken, werk altijd op een featurebranch

* chore: code-review lookups.py

* refactor(routing): beschrijvende namen voor de bypassbeslissing (#143)

Ready -> ReadyForBypass, NeedsInformation -> NeedsInputForBypass, NotEligible -> NotEligibleForBypass, LookupDecision -> BypassDecision, eligible -> eligible_for_bypass, revision -> accepted_turn_count. Trace-redenen en route_reden blijven ongewijzigd.

Co-authored-by: Copilot <[email protected]>

* test(routecontract): los gegeven na een inhoudelijke beurt (#143)

Tien regels falen bewust: een kaal jaartal, alleen gegevens of een fragment na een inhoudelijke beurt gaat nu naar de bypass in plaats van naar de agent. Twee regels bewaken bestaand gedrag (#102: los jaartal als eerste beurt; #91: zelfstandige lookupvraag midden in een gesprek).

Co-authored-by: Copilot <[email protected]>

* fix(routing): los gegeven is alleen in de eerste beurt een eigen lookup (#143)

Een kaal jaartal, alleen gegevens ("2014, meisje") of een losse oude categorie zonder open of voltooide lookup is een vervolgbericht op de vorige beurt. recognize_turn krijgt daarvoor is_first_turn, afgeleid van accepted_turn_count. Na een inhoudelijke beurt gaat zo'n bericht naar de agent; als eerste beurt en als vervolg op een lookup blijft de bypass (#102, #91/#136).

Glossary: Gesprek, Beurt, Agentgesprek en Vervolgbericht.

Co-authored-by: Copilot <[email protected]>

* test: verouderde verwachtingen na slotvraag en liggende achtergrond

B1-bypass eindigt op de slotvraag zonder Bron-regel (4cd5190); de achtergrond is sinds 2ad94d8 liggend.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Ivo Stieltjes <[email protected]>
Co-authored-by: Copilot <[email protected]>
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