Skip to content

Add transport-neutral conversation materialization #224

Description

@Amidwestnoob

Feature description

Add a transport-neutral library that converts closed conversation windows into immutable source documents.

Motivation

Conversation sources need stable evidence identifiers, deterministic document boundaries, content hashes, and replay-safe resume state. These rules do not belong to one transport, database, scheduler, or model provider.

The library must preserve caller-supplied source, speaker, authority, time, and evidence identifiers. It must fail closed when a turn cannot fit one complete rendered document.

Proposed solution

Add a small conversation package that provides:

  • Typed conversation turns and closed windows
  • Deterministic text cleaning
  • Explicit optional truncation with an omitted-middle digest
  • Exact duplicate handling
  • Turn-boundary splitting
  • Final rendered-document size checks
  • Closed-window fingerprints
  • Content-addressed manifests
  • Replay-safe resume state
  • Recovery splitting for uncompiled documents
  • Oldest-first bounded compile selection
  • Compile-budget checks
  • Optional compile receipts
  • Verified claim application through the temporal-claims API

Scope boundaries

The caller controls source filters, window boundaries, privacy filters, credentials, and scheduler limits.

The change must not add:

  • Database queries
  • Transport-specific rules
  • Live input
  • Scheduler wiring
  • Model calls
  • Private source content
  • Ingest-bundle plugin registration

This feature does not depend on PR #179. A future PR #179 adapter can call the conversation materializer.

The implementation depends on the temporal-claims API in PR #223.

Validation

Use deterministic synthetic tests. Require full tests, Ruff, format checks, Mypy, file-size checks, privacy scans, and package builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions