Skip to content

feat(channel): THESEUS ledger sink — spoken and dashboard turns become durable receipts - #141

Merged
chazmaniandinkle merged 5 commits into
mainfrom
feat/theseus-ledger-sink
Jul 23, 2026
Merged

feat(channel): THESEUS ledger sink — spoken and dashboard turns become durable receipts#141
chazmaniandinkle merged 5 commits into
mainfrom
feat/theseus-ledger-sink

Conversation

@chazmaniandinkle

Copy link
Copy Markdown
Contributor

What

Every conversational utterance through the channel client — mod3_speak with post_to_chat=True, mod3_dashboard_post as assistant — is also committed as a receipt into the book repo's conversations/inbox/, riding the existing ingest workflow into the THESEUS ledger. mod3's message store is RAM-only (2026-07-23 tomography, gap #6); this is the additive fix at the mouth. The daemon is untouched.

Design

  • Receipts, never direct ledger writes — new-file-only, settled idempotently by id by the existing conversations-ingest workflow; no content contention with the seat or the ingest bot.
  • Identity declared, never inferred — every turn carries origin=seat and a seat-* from (both self-echo suppression keys for the wake line), and the sink enforces the prefix itself.
  • Speech never blocks on the ledger — fire-and-forget via asyncio.to_thread; failures log and swallow; kill switch MOD3_THESEUS_SINK=0.
  • Interprocess flock per repo serializes write→add→commit→push across concurrent channel-client processes and both mouths (git's index.lock is fail-fast, not a queue); receipt ids carry an entropy suffix so same-millisecond writers can't collide; _cleanup drains in-flight sinks (bounded 15s) so a session's final utterance isn't cancelled mid-write.

Verification

  • 17/17 tests (tests/test_theseus_sink.py — real bare-origin+clone git pairs, including a 6-thread concurrency test and the remote-moved rebase race; channel-client regression suite green).
  • Live end-to-end twice against the real book repo: receipt committed → pushed → ingest settled the turn into ledger.json with origin=seat — and the wake-line watcher stayed silent on both commits (no mark ... seat echo).
  • Three-lens adversarial review (concurrency / identity-membrane / failure-modes); both blockers and all should-fixes addressed in the hardening commit, except sink-outcome-invisible-to-caller, which is the intended fire-and-forget contract.

…turns become durable receipts

Every conversational utterance through the channel client (mod3_speak with
post_to_chat, mod3_dashboard_post as assistant) is also committed as a
receipt into the book repo's conversations/inbox/, riding the existing
ingest workflow. Turns declare origin=seat + a seat-* from, so the wake
line never echoes the seat's own voice. Fire-and-forget: speech never
blocks on a git push; kill switch MOD3_THESEUS_SINK=0.
… — latent main-branch trip, unpinned ruff on CI now formats py fences in .md
@chazmaniandinkle
chazmaniandinkle merged commit 5f2eecd into main Jul 23, 2026
7 checks passed
@chazmaniandinkle
chazmaniandinkle deleted the feat/theseus-ledger-sink branch July 23, 2026 23:22
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