-
[NA] [BE] Persist per-block subcategory on cipx_spend_blocks (#7657)
发布于
2026-07-29 10:17:08 +00:00 - [BE] feat: persist per-block origin on cipx_spend_blocks
cipx now emits
originon each block: which variant of its category the block
is, when the category is a mixed population a harness setting only partly
removes. Formemorythe values are auto_memory / project_instructions / rule /
user_global (see cost-intelligence-proxy-internal#61).Reads it through to a new LowCardinality(String) column. Plain passthrough --
lane/bd_lane/label/is_definition are untouched, so memory keeps lane 'memory',
label = resource, is_definition = 1 and no breakdown row changes shape.Why it matters downstream: Claude Code's
autoMemoryEnabled: falsedrops only
the auto-memory directory, not the project CLAUDE.md or .claude/rules files
sharing the lane, so pricing that setting off the whole lane is a guess. The
distinction can't be recovered fromresource, whose rendered display name
collapses to the bare "{repo} {file}" shape when the user handle is unresolved --
byte-identical to project instructions at a repo root.'' means unknown, not a value: every row written before cipx emitted the field
reads '' via the column DEFAULT, and residual rows set it explicitly. Consumers
must treat '' as "can't tell" rather than an implicit default.Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
- [BE] fix: renumber the origin migration to 000112
000111 is already taken on main by
000111_add_seat_identity_fields_to_cipx_trace_identities.sql (#7605, merged
after this branch was cut). Liquibase's includeAll tolerates duplicate prefixes
-- 000106/000107 already have two files each -- but the collision is confusing
and leaves ordering to alphabetical chance, so take the next free number.Re-running is safe for anyone who already applied the old name: the statement is
ADD COLUMN IF NOT EXISTS.- [BE] docs: qualify the autoMemoryEnabled reference in the block test
The comment named
autoMemoryEnabledwith no owner, so an opik reader greps for
it, finds nothing, and reasonably concludes it's a flag that was never built. It
is built -- it's a Claude Code setting, and the lever that prices it lives in
ai-cost-backend (catalog_v2's auto_memory policy) -- but neither is in this repo.Say so, and say what this repo's part actually is: persist the distinction.
Matches how the cipx-side comments already qualify it as "Claude Code's".Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
- [BE] refactor: rename the origin column to subcategory
Follows cipx renaming the wire field:
originreads like provenance, when what it
carries is a subdivision ofcategory— which variant of that category the block
is.subcategorysays that, and reads naturally beside the existingcategoryand
parent_categorycolumns.Renames the column, the migration (000112_add_subcategory_to_cipx_spend_blocks), the
BlockRow component and the JSON key it reads. Nothing has been released, so there is
no rename-in-place to do: the column is simply created under its final name.Note for anyone who already ran the previous changeset locally: the id changed, so
Liquibase addssubcategoryand leaves the oldorigincolumn behind. Harmless —
drop it by hand, or recreate the dev database.Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com
下载附件