feat: refine chat — adjust a saved trip by message #18

Merged
charles merged 1 commit from feat/refine-chat into main 2026-06-17 15:00:15 +00:00
Owner

The original vision's "continue the discussion with the agent" (FR-AGT-21/22), deterministic first.

Changes

  • ports: TripBuilder::refine takes the Trip (service loads it); TripStore::update (mem + pg, owner-scoped).
  • service: refine_trip loads the owned trip → quota → refine → persist (refund on failure).
  • builder: deterministic intents — plus court/shorter drops last stop+leg; moins cher/cheaper selects the cheapest option per list; totals recomputed from selected proposals.
  • api: chat box on the saved-trip page → POST /trips/:id/refine.

Verification

  • just qa green (builder 4 tests incl refine). Live: 500€/2 stops → "rends-le plus court" → 200€/1 stop, recomputed + persisted.

LLM-driven refine (free-text intents via the agent) layers on later. Traces: FR-AGT-21/22, FR-PRES-7/18.

The original vision's "continue the discussion with the agent" (FR-AGT-21/22), deterministic first. ## Changes - **ports**: `TripBuilder::refine` takes the `Trip` (service loads it); `TripStore::update` (mem + pg, owner-scoped). - **service**: `refine_trip` loads the owned trip → quota → refine → persist (refund on failure). - **builder**: deterministic intents — *plus court/shorter* drops last stop+leg; *moins cher/cheaper* selects the cheapest option per list; totals recomputed from selected proposals. - **api**: chat box on the saved-trip page → `POST /trips/:id/refine`. ## Verification - `just qa` green (builder 4 tests incl refine). **Live**: 500€/2 stops → "rends-le plus court" → **200€/1 stop**, recomputed + persisted. LLM-driven refine (free-text intents via the agent) layers on later. Traces: FR-AGT-21/22, FR-PRES-7/18.
feat: refine chat — adjust a saved trip by message (FR-AGT-21/22)
All checks were successful
qa / qa-1 (push) Successful in 27s
qa / qa (push) Successful in 0s
qa / qa-1 (pull_request) Successful in 3m43s
qa / qa (pull_request) Successful in 0s
c21880d701
- ports: TripBuilder::refine now takes the Trip (service loads it); TripStore
  gains update(owner,id,trip) (mem + pg, owner-scoped).
- service: refine_trip loads the owned trip, quota-consumes, refines, persists
  the result (refund on failure).
- builder: deterministic refine intents — "plus court/shorter" drops the last
  stop + leg; "moins cher/cheaper" selects the cheapest option per list; totals
  recomputed from selected proposals (shared recompute()).
- api: chat box on the saved-trip page → POST /trips/:id/refine → re-render.

Verified live: 500€/2 stops → "rends-le plus court" → 200€/1 stop, recomputed +
persisted. just qa green (builder 4 tests incl refine). LLM-driven refine later.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
charles/geneatrip!18
No description provided.