Skip to content

Exporting an unknown group prints an empty CSV (#195) - #197

Merged
Param-Harrison merged 2 commits into
mainfrom
factory/issue-195
Oct 27, 2026
Merged

Param-Harrison merged 2 commits into
mainfrom
factory/issue-195

Conversation

@Param-Harrison

Copy link
Copy Markdown
Contributor

Summary

splitbill export <unknown-group> now prints no such group: <id> (like balances does) and exits non-zero, instead of printing an empty CSV.

Closes #195

Plan

Plan comment (rev 1, plan-comment.md on the issue thread):

  • AC-1 run(["export", "no-such-group"], db) returns exactly no such group: no-such-group, verified by bun test tests/cli.test.ts -t "export reports an unknown group"
  • AC-2 the CLI entrypoint prints the message and exits non-zero, verified by bun test tests/cli.test.ts -t "export exits non-zero for an unknown group"
  • AC-3 existing groups (with or without expenses) still export the CSV and exit 0, verified by bun test tests/cli.test.ts
  • AC-4 full gate passes, verified by make check

Non-goals kept: no change to src/csv.ts or its output format, no change to src/routes/, no schema or protected-path edit, run(argv, db): string signature unchanged.

Side effect, called out in the plan: balances with an unknown group now also exits non-zero.

Gate evidence

FACTORY_GATES: status=GREEN passed=3 failed=0 skipped=1 failed_gates=audit

Verify verdict

Verdict comment (verdict-comment.md on the issue thread): pass, all four ACs. The test that bites, export reports an unknown group, fails on the base branch (Received "date,payer,description,amount") and passes here (7 pass, 0 fail).

Two optional could findings, not blocking: the exit code is derived from the output prefix, and the error goes to stdout rather than stderr.

Risk and rollback

low: only src/cli.ts and tests/cli.test.ts change, with no route, schema or protected path touched. Roll back by reverting this PR's single commit.

Factory run

Stage Agent Duration Tool calls Cost Outcome
triage claude 13s 4 $0.05 ok
plan claude 43s 6 $0.21 ok
build claude 3m 12s 14 $0.28 ok
verify claude 1m 26s 10 $0.27 pass
pr claude 20s 2 $0.07 ok

Proof: the new test fails without the change.

5 stage runs, 5m 54s, $0.87.

Went well

  • triage, plan, build, verify, pr passed on the first attempt
  • verify approved on the first round

Needed help

  • nothing

@Param-Harrison
Param-Harrison marked this pull request as ready for review October 14, 2026 11:50
@Param-Harrison
Param-Harrison merged commit 2ca197b into main Oct 27, 2026
1 check passed
@Param-Harrison
Param-Harrison deleted the factory/issue-195 branch October 27, 2026 14:49
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.

Exporting an unknown group prints an empty CSV

1 participant