Skip to content

DRAFT: Exchanges() provenance sub-store (companion to baton-axiomatic #175)#989

Draft
c1-squire-dev[bot] wants to merge 1 commit into
mainfrom
paul.querna/provenance-exchanges-substore
Draft

DRAFT: Exchanges() provenance sub-store (companion to baton-axiomatic #175)#989
c1-squire-dev[bot] wants to merge 1 commit into
mainfrom
paul.querna/provenance-exchanges-substore

Conversation

@c1-squire-dev

@c1-squire-dev c1-squire-dev Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

SDK-side storage for per-object request provenance — companion to baton-axiomatic PR #175 (RFC 0001).

Persists captured (redacted) transport exchanges in the .c1z so the export tool can resolve an emitted object's c1.connector.v2.RequestId annotations back to the request/response that built it.

What

  • c1zstore.ExchangeStore + Exchange row type, reached via the optional c1zstore.ExchangesProvider interface (the syncer type-asserts for it). Engines and external Store implementations that predate provenance compile unchanged.
  • *C1File SQLite implementation: PutExchanges / GetExchange / ListExchangesForObject. The exchanges table is created on demand and is deliberately not registered in allTableDescriptors — exchanges are a per-sync debug side-store and must not enter the object sync-diff/clone machinery (which keys every table on external_id). Lazy creation also yields "old .c1z opens empty" for free.
  • Round-trip test (TestExchangesSubStoreRoundTrip) + compile-time capability assertions. go test ./pkg/dotc1z/... green.

Not included (next step)

The cross-process handoff (RFC §6.7): the StreamCapturedExchanges ConnectorService RPC + the syncer-side consumer, which require a proto change in the c1 monorepo. This branch lands the storage shape so that RPC can target it.

🤖 Generated with Claude Code

…quest-provenance)

Companion to baton-axiomatic PR #175 (RFC 0001, per-object request provenance).
Adds the SDK-side storage for captured transport exchanges so the export tool can
resolve an emitted object's c1.connector.v2.RequestId annotations back to the
(redacted) request/response that built it.

- c1zstore.ExchangeStore + Exchange row type, reached via the OPTIONAL
  c1zstore.ExchangesProvider interface (type-asserted by the syncer) so engines
  and external Store implementations that predate provenance compile unchanged.
- *C1File SQLite implementation: PutExchanges / GetExchange /
  ListExchangesForObject, with the exchanges table created on demand.
  Deliberately NOT registered in allTableDescriptors: exchanges are a per-sync
  debug side-store and must not enter the object sync-diff/clone machinery (which
  keys every table on external_id). Lazy creation also yields "old .c1z opens
  empty" for free.
- Round-trip test + compile-time capability assertions.

Not included (the cross-process handoff, RFC §6.7): the StreamCapturedExchanges
ConnectorService RPC + the syncer-side consumer, which require a proto change in
the c1 monorepo. This branch lands the storage shape so the RPC can target it.

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
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