Summary
Add a small read/write v2 document metadata workflow so imported generic documents can be classified and filtered without opening SQLite manually.
Scope
- Add
bb documents update DOCUMENT_ID for metadata fields already present on BB_DOCUMENT.
- Support updating document type, jurisdiction code, tax year, and status.
- Add filters to
bb documents list for type, jurisdiction, tax year, and status.
- Keep SQL behind DAO/service helpers rather than inline CLI command bodies.
- Keep the slice parser-free, inference-free, and extracted-text-free.
- Update README, changelog, and AI context.
Validation rules
jurisdiction_code is normalized to uppercase when supplied.
tax_year must be a four-digit year when supplied.
document_status must be one of the supported v2 statuses.
- Missing document IDs fail clearly.
- An update with no metadata options fails clearly.
Out of scope
- Parser detection.
- Observation/entity inference.
- Extracted text storage.
- JSON/CSV output changes.
- Generic document inspect/report commands.
Acceptance criteria
bb documents update DOCUMENT_ID --type bank_statement --jurisdiction US --tax-year 2025 updates the document metadata.
bb documents list --type bank_statement --jurisdiction US --tax-year 2025 filters the document table.
bb documents show DOCUMENT_ID reflects updated metadata.
- Existing
bb documents import, list/show, and legacy commands continue working.
- Validation passes.
Summary
Add a small read/write v2 document metadata workflow so imported generic documents can be classified and filtered without opening SQLite manually.
Scope
bb documents update DOCUMENT_IDfor metadata fields already present onBB_DOCUMENT.bb documents listfor type, jurisdiction, tax year, and status.Validation rules
jurisdiction_codeis normalized to uppercase when supplied.tax_yearmust be a four-digit year when supplied.document_statusmust be one of the supported v2 statuses.Out of scope
Acceptance criteria
bb documents update DOCUMENT_ID --type bank_statement --jurisdiction US --tax-year 2025updates the document metadata.bb documents list --type bank_statement --jurisdiction US --tax-year 2025filters the document table.bb documents show DOCUMENT_IDreflects updated metadata.bb documents import, list/show, and legacy commands continue working.