andreagrandi / andreagrandi/draftomen
Coordinate narration through the shared live session
- Langage dominant
- Python
- Étoiles
- 0
- Forks
- 0
- Merge moyen
- 1 h 23 min
- PR mergées (30 j)
- 181
Description
## Problem
Independent inference results can arrive after a new pick or lifecycle transition and contaminate the currently displayed recommendation.
## Proposed change
Extend the immutable session state/command boundary with model-management intentions and narration state. Publish normal recommendations before scheduling inference. Use request generations plus recommendation identity to admit every chunk/completion/error; cancel obsolete work where possible and always reject stale work. Coordinate disable/remove, account/draft/pack/recommendation changes, rescoring, stop and shutdown. Preserve deterministic fallback and bounded failure reporting/backoff according to the chosen policy. Keep event-loop scheduling and marshalling in adapters and engine facts in shared Python.
## Acceptance Criteria
- [ ] AC1: Session replay with a deliberately slow worker publishes the normal recommendation before narration begins and leaves its card, score/order and audit identity unchanged.
- [ ] AC2: Overlap/ABA tests reject every stale chunk, completion and error after a recommendation changes, even when a later recommendation has the same visible card name.
- [ ] AC3: Lifecycle tests clear obsolete narration and reject late output after account/draft changes, disable/remove, stop and shutdown.
- [ ] AC4: Failure/repeated-failure tests retain deterministic recommendations, expose diagnosable bounded errors, and avoid continuous disruptive UI retries.
- [ ] AC5: A session contract check exposes immutable model/narration state and explicit intentions without introducing frontend types or allowing a narrator to modify scoring.
- [ ] AC6: A shared-session smoke check exercises install/enable/request/disable/remove through the command boundary with the real services.
## Implementation classification
- **Estimated size:** M
- **Orchestration risk:** High
- **Reason:** Asynchronous request identity and lifecycle transitions protect against stale user-visible content.
## Dependencies
Direct prerequisites: #458, #459. Consumers: Expose local model controls in desktop Settings, Display progressive recommendation dialogue on desktop, Expose local narration and model controls in the TUI, Support explicit local narration in plain watch.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.