115 Commits (feac14640301f9a53d5f03ac57aa6a6f002e195f)
 

Author SHA1 Message Date
Elijah Voigt 3c17918a47 feat(nbd): implement nbd init and nbd ready commands [4d2359, e1968f]
- `nbd init` creates `.nbd/tickets/` in cwd (idempotent, no find_nbd_root)
- `nbd ready` lists actionable tickets: not done with all deps completed
- Both commands support `--json` for machine-readable output
- 6 new integration tests covering init and ready behaviour

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
Elijah Voigt 283712770f feat(nbd): implement partial ID matching [c9d551]
Add `resolve_id` to `store.rs` that resolves a full ticket ID from an
exact match or a unique prefix (like git short-SHA resolution). Use it
in `cmd_read`, `cmd_update`, and `validate_deps` so all three accept
short prefixes. Ambiguous prefixes produce an error listing all matches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
Elijah Voigt df71fc9e09 feat(nbd): implement nbd migrate command [0f51af]
Adds `nbd migrate` to bring ticket files on disk into conformance with
the current serde schema. Re-serialises every *.json file through the
current Ticket model — removing stale fields (e.g. old \"id\" key),
adding new fields with their defaults, and normalising formatting.

- store: MigrateReport struct and migrate_tickets() function
- display: format/print_migrate_report and _json variants
- main: Migrate command with --dry-run flag and cmd_migrate handler
- 6 unit tests (rewrites old format, already-current, dry-run, invalid JSON, empty store, no tickets dir)
- 4 integration tests (rewrite, dry-run, parse error tolerance, --json output)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
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
Elijah Voigt 7ada8ef951 docs(nbd): add README, PLANNING, ARCHITECTURE, and complete Phase 6
Write the three required documentation files for the nbd crate:
- README.md: usage guide, field reference, dev workflow, dual-license
  footer, and Claude Code disclaimer
- docs/PLANNING.md: development phase log and post-MVP roadmap
- docs/ARCHITECTURE.md: module responsibilities, data flow diagram,
  storage layout, and testing strategy

Run and verify cargo fmt, check, clippy, and test (34 tests pass).
Mark all Phase 6 items as complete in PLAN.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
Elijah Voigt 78874df7a6 feat(nbd): implement CLI commands and integration tests (Phase 5)
Wire up clap subcommands to storage and display layers:
- Cli struct with global --json flag and Create/Read/List/Update subcommands
- cmd_create: generates ID, validates priority and deps, writes and prints ticket
- cmd_read: looks up ticket by ID and prints it
- cmd_list: lists all tickets sorted by priority
- cmd_update: reads existing ticket, merges only provided flags, writes and prints
- parse_status, parse_ticket_type, parse_deps, validate_deps helpers
- 8 integration tests using process::Command against a tempdir
- Fix clippy: map_or(false, …) → is_some_and(…) in store.rs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
Elijah Voigt e9b6e97116 feat(nbd): implement display layer (Phase 4)
Add output formatting for tickets via display.rs:
- print_ticket / format_ticket: key-value table view
- print_ticket_json / format_ticket_json: pretty JSON
- print_list / format_list: compact summary table with header
- print_list_json / format_list_json: JSON array output

format_* variants return String for testability. Unit tests added
covering field presence, dependency joining, header row, and JSON
validity. All 26 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
Elijah Voigt 8d7ee96b99 feat(nbd): implement storage layer (Phase 3)
Add async-std file I/O and directory traversal in store.rs:
- find_nbd_root / find_nbd_root_from: walk up from cwd to locate .nbd/
- tickets_dir, ticket_path: pure path helpers
- ensure_tickets_dir: create .nbd/tickets/ on first use
- write_ticket / read_ticket: JSON serialisation round-trip
- list_tickets: read all *.json files, sort by priority descending

Add 8 unit tests covering write/read round-trip, missing-ticket
error, priority-sorted list, empty directory, grandparent traversal,
traversal failure, and path helpers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
Elijah Voigt 142a1898e2 feat(nbd): implement ticket data model (Phase 2)
Define Status and TicketType enums with serde snake_case/lowercase
serialization, Ticket struct with all fields, Ticket::new constructor,
validate_priority, and generate_id using RandomState entropy. Add 9
unit tests covering roundtrips, enum serialization, priority validation,
and ID format/uniqueness.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
Elijah Voigt 2698c6ea84 Scaffolding for nbd cli 3 months ago
Elijah Voigt a7adc1659c feat(nbd): scaffold crate with module stubs and dependencies
Creates Cargo.toml with clap, async-std, serde/serde_json and tempfile
dev-dep. Adds placeholder src/{main,ticket,store,display,tests}.rs and
tests/integration.rs with rustdoc module comments. Phase 1 complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
Elijah Voigt 3e703a1659 Initial commit 3 months ago
Elijah Voigt e9e8d33856 Add beads package 4 months ago
Elijah Voigt 6996b4807b docs: update wasm target note and add common Cargo.lock
Reflect that wasm32-unknown-unknown is provided by the Nix dev shell
via rust-overlay rather than requiring a manual rustup install. Include
the Cargo.lock generated by building the common crate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 months ago
Elijah Voigt b980ef8ee6 chore: initial repo scaffolding
Set up mono-repo foundation with CLAUDE.md conventions, base Nix flake
(Rust + wasm32 target, Trunk, OpenTofu, wrangler, SQLx, Turso), shared
common library crate, dual Apache-2.0/MIT licenses, .gitignore, and
repo-level README.

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