fix(cli): tb export mentions agency buyers on an agency-only DB (#143) - #201
Merged
Conversation
`counts['solicitation']` is the CITY SPINE alone. On a DB that has agency
data (agency enrichment has run) but no City-spine `sync` data, the export
correctly wrote a full `buyers` section, but the success line read
`Exported 0 solicitations to <path>` -- indistinguishable from an export
that genuinely did nothing.
`buyer` is only ever non-zero once agency enrichment has seeded it, so the
plain City-spine case (the overwhelming majority of real exports) is
unaffected -- verified live both ways:
agency-only DB: Exported 0 solicitations + 3 agency buyer(s) to ...
plain fresh DB: Exported 0 solicitations to ...
2 new tests. Confirmed red against the pre-fix code (the agency-only
assertion fails with the exact string this issue reports; the plain-DB
test stays green throughout), then restored. 776 tests passing.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W53WHx8mm2UHuLFAQWeF62
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #143.
The bug
counts['solicitation']in_cmd_export's success line counts the City spine alone. On a DBthat has agency data (
agency_solicitation/agency_award/agency_bid+ the exportbuyerssection) but no City-spine
syncdata,tb exportprintedExported 0 solicitations to <path>— even though it correctly wrote a full
buyerssection. A successful export read as though itdid nothing.
The fix
Matches the issue's own suggested wording: mention the agency
buyercount alongsidesolicitations when it's non-zero.
buyeris only ever non-zero once agency enrichment has seeded it (seed_buyers), so the plainCity-spine case — the overwhelming majority of real exports — is completely unaffected: no
+0 agency buyer(s)clutter on a run that's never touched agencies.Verification
Live, both cases:
2 new tests, confirmed genuinely red against the pre-fix code by reverting the fix in place:
the agency-only assertion fails with exactly the string this issue reports, while the plain-DB
test stays green throughout — proving the fix is targeted. Restored after.
776 tests passing.
🤖 Generated with Claude Code
https://claude.ai/code/session_01W53WHx8mm2UHuLFAQWeF62