Skip to content

fix(component): unwrap posting-level meta-values (symmetric)#180

Merged
robcohen merged 1 commit into
mainfrom
fix/component-posting-meta
Jun 18, 2026
Merged

fix(component): unwrap posting-level meta-values (symmetric)#180
robcohen merged 1 commit into
mainfrom
fix/component-posting-meta

Conversation

@robcohen

Copy link
Copy Markdown
Member

Follow-up for #173 (1 of the remaining 5). Posting metadata (list<meta-entry>) marshalled its meta-values tagged ({"type":"text","value":...}), whereas directive meta.user is unwrapped — so e.g. any(overage:"GB$") saw a dict instead of the string "12.34 GB" and matched nothing.

Fix (symmetric — the key detail)

  • _marshal: unwrap meta-values in any list<meta-entry> pair-list.
  • _unmarshal: re-tag them via _meta_value_json, mirroring the meta.user path.

A _marshal-only unwrap regressed the suite 5→17 (the tagged shape is coupled to the clamp/_unmarshal round-trip). Doing both directions keeps the round-trip intact.

Impact

Full suite via the component: 5 → 4 failures, no regressions (test_advanced_filter[overage] passes; component round-trip unit tests green). ruff + mypy clean. Default JSON-RPC path unaffected.

Remaining 4 are rustledger-side (clamp provenance + load filename arg), tracked in #173.

Posting metadata (`list<meta-entry>`) marshalled its meta-values tagged
(`{"type":"text","value":...}`), where directive `meta.user` is unwrapped —
so e.g. an `overage: "12.34 GB"` posting-meta filter saw a dict, not the
string.

Unwrap meta-values in any `list<meta-entry>` pair-list in `_marshal`, and —
crucially — re-tag them in `_unmarshal` (via `_meta_value_json`), mirroring the
`meta.user` path. A `_marshal`-only unwrap broke the clamp round-trip (the
earlier naive attempt regressed the suite); doing both directions keeps it
intact. Full suite via component: 5 -> 4 failures, no regressions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant