1 Commits (ba0efeb6229186bc789f8d43132a022683cec9f4)

Author SHA1 Message Date
Elijah Voigt f1715d18eb feat(nbd): remove id from ticket JSON body; inject from filename [d1634a]
The ticket id is now stored only in the filename stem (.nbd/tickets/{id}.json).
`id` is annotated with `#[serde(skip)]` so it is never written to disk,
eliminating the consistency hazard of id-in-body vs. filename disagreement.

- ticket.rs: add `#[serde(skip)]` to `Ticket::id`
- store.rs: `read_ticket` and `list_tickets` inject id from filename stem
- display.rs: `ticket_to_json_value` re-inserts id for CLI `--json` output
- tests.rs: new unit tests for omission, injection, and old-format compat
- integration.rs: assert written files lack "id"; assert read --json has id

Backwards-compatible: old files with "id" in JSON body still parse correctly
(serde ignores the unknown field), so existing stores work without migration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago