Skip to content

[codex] Add Codex metadata projection - #21

Merged
philcunliffe merged 1 commit into
masterfrom
codex/codex-metadata-parity
May 22, 2026
Merged

[codex] Add Codex metadata projection#21
philcunliffe merged 1 commit into
masterfrom
codex/codex-metadata-parity

Conversation

@philcunliffe

Copy link
Copy Markdown
Contributor

Summary

  • project Codex/ChatGPT turn headers into existing ai_gateway_messages columns
  • add safe attributes.codex metadata without a schema migration or backfill
  • extend unit coverage and the Codex gateway smoke for real-shaped Codex headers

Validation

  • node --test test/plugins/ai-gateway-message-projector.test.js
  • npm test
  • npm run lint
  • npm run typecheck
  • npm run smoke -- gateway_codex_capture
  • npm run smoke -- gateway_claude_capture

@philcunliffe
philcunliffe marked this pull request as ready for review May 22, 2026 19:28
@philcunliffe
philcunliffe merged commit 0c053e5 into masterMay 22, 2026
6 checks passed
@platypii
platypii deleted the codex/codex-metadata-parity branch May 28, 2026 06:37
philcunliffe added a commit that referenced this pull request Jun 11, 2026
…91)
* feat(sinks): partition iceberg exports by day with conversation sort
Lay out @hypaware/format-iceberg exports for an archive's job, not the
cache's: partition by day(primaryTimestampColumn) — a writer-owned
default, not the cache's conversation_id-identity cachePartitioning,
which sets an unbounded ~1-file-per-conversation floor compaction can't
beat — and sort each day partition by the dataset's lookup columns
(conversation_id-led) so a conversation lookup prunes row groups by
min/max instead of needing a partition per conversation.
- Promote partitionSpecForDeclaration + validatePartitionSpecStability
(and the declaration type) from src/core/cache/iceberg to a shared
src/core/iceberg home, re-exported from src/core/index.js: they are
core surface consumed by the registry, cache, plugin types, and now
the export (LLP 0003).
- format-iceberg derives the day grain + sort order per dataset at
commit time, creates the table with both, and rejects partition-spec
drift on append (iceberg_partition_spec_drift). Emits hyp_partition_spec
and hyp_sort_order on commit spans.
- Reframe maintenance compaction: available via icebergRewrite but not
run in-daemon and not needed for a day grain (was "blocked by icebird").
Spec: LLP 0022 (rewritten from the abandoned cache-parity decision);
xrefs in LLP 0014 and 0003. Tests: 10 (derivation + drift through the
real icebird write path) plus a passing iceberg_export_partitioned_local_fs
smoke asserting the layout and hyp_partition_spec.
Clustering (icebird #22) and read pruning (#20/#21) require a published
icebird containing commit 3edb15b; the package.json pin must move off
0.8.5 before those benefits land. The code degrades gracefully on 0.8.5
— partitioning and drift work; the sort order is recorded but inert.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(deps): bump icebird 0.8.5 -> 0.8.9 (sort-on-write + scan pruning)
Activates the conversation sort within day partitions and read-side
scan pruning that the partitioned export records in metadata. Clears
the merge blocker: 0.8.9 contains icebird 3edb15b.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(sinks): address PR #91 review — reverse drift guard, on-disk sort assertions, CLI text
- commitBatch now rejects reverse partition-spec drift: appending with no
derived partitioning onto an already-partitioned table throws
iceberg_partition_spec_drift instead of silently skipping the guard
(and mislabeling spans as unpartitioned). LLP 0022#drift-rejection
updated to record the guard as bidirectional; new test alongside the
forward-drift case.
- The conversation sort is now asserted on disk, not just in metadata:
both the commitBatch integration test and the partitioned smoke read a
day-partition parquet file back with hyparquet and assert conversation_id
row order — fails on an icebird that records the sort order but writes
unsorted. Verified against icebird 0.8.9.
- hyp sink maintain CLI text reframed to match maintenance.js / LLP 0022:
compaction is not run by this sink (out-of-band via icebergRewrite), not
'unsupported by icebird'; action label is now compaction_out_of_band.
- Removed stray </content> artifact from the end of LLP 0022.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for freeto 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

@philcunliffe