Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,14 @@ obligation ledger and transport contract for Sinex-backed evidence mode: a
mirroring `polylogue.toml` `[sinex] mode` / config key `sinex_mode`, default
`off`) gates whether a normalized-session material revision
(`polylogue/material_protocol/v1/`) gets a durable `source.db` obligation row
and an attempted publish through an injected `SinexTransport`; off mode
performs zero transport work and writes zero obligation rows.
**`sinex_mode` itself is not yet consumed anywhere**: no ingest, daemon, or
CLI call site constructs a `PublicationService` from that config value, so
setting `mode = "mirror"`/`"primary"` in `polylogue.toml` today has no
observable effect on real archive writes (`polylogue config --format json`
surfaces this as a `sinex_mode_not_yet_wired` diagnostic). See
[docs/sinex-interop.md](sinex-interop.md) for the full design, current scope,
and the cross-repo blocker on live Sinex transport.
and exact replay bytes. The daemon drains those obligations through an
injected `SinexTransport`; `primary` holds only the affected local projections
until an allowed durable receipt, while `mirror` exposes lag without blocking
local reads. Off mode performs zero transport work and writes zero obligation
rows. Backed modes require deployment composition to register a concrete
transport; `LocalReferenceTransport` is never selected for deployment. See
[docs/sinex-interop.md](sinex-interop.md) for the full design and the
cross-repo blocker on live Sinex settlement.

## Placement Rules

Expand Down
2 changes: 1 addition & 1 deletion docs/sinex-interop.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The full Sinex-backed architecture described here is a target, not the current i

Polylogue is, and permanently remains, SQLite-native: standalone SQLite is a first-class, supported product mode, not a deprecated migration path (operator directive, 2026-07-13). `polylogue.toml`'s `[sinex] mode` selects the Sinex-backed authority profile and defaults to `off`, which performs zero Sinex transport work and creates no durable publication obligations.

`polylogue.sinex` (polylogue-303r.2) is the first real Polylogue-side publication producer: a durable `source.db` obligation ledger (`sinex_publication_obligations`, mode `mirror`/`primary`, idempotent by protocol version + revision id + manifest digest), a transport contract modeled on Sinex's documented `DurableEmissionReceipt` (sinex-r6d.11) and `RawEnvelopeSettlement` (sinex-r6d.12) primitives, and a `PublicationService` that stages obligations in the same transaction as the evidence they cover and only reports a revision confirmed when a receipt actually unlocks progress. Its tests exercise the service against an in-process, contract-faithful reference transport (`LocalReferenceTransport`) rather than live Sinex JetStream: as of this package landing, Sinex's own consumer implementation for this exact contract (sinex-4j2.1.1) has not merged, and sinex-r6d.11 itself — the receipt primitive this contract targets — is still open upstream. **No production code path is wired to either transport yet**: setting `[sinex] mode = "mirror"` (or `"primary"`) in `polylogue.toml` today has zero effect on real archive writes — no ingest, daemon, or CLI call site constructs a `PublicationService` from that setting — and `polylogue config --format json` surfaces this explicitly as a `sinex_mode_not_yet_wired` diagnostic. Wiring a real deployment to either the reference transport or live Sinex transport is follow-up work, not something this package's landing completes unilaterally. See `polylogue/sinex/__init__.py` for the full scope note and `tests/unit/sinex/` for the durability/idempotency/receipt-barrier proof this package carries today.
`polylogue.sinex` (polylogue-303r.2.1) wires the local publication producer into production ingest and daemon convergence: mirror/primary ingest encodes and verifies the accepted normalized revision, then atomically records its exact manifest/segment bytes and durable `source.db` obligation. The daemon drains that outbox through a deployment-injected transport, persists bounded retry/receipt state, and recovers from source-tier bytes after restart or ops reset. `primary` blocks only the affected newest local projection until an allowed durable receipt; `mirror` reports exact lag while local reads continue. `off` performs no encoding, outbox write, service construction, or transport work. `LocalReferenceTransport` remains an in-process contract double used only by tests. A backed daemon with no deployment-registered transport fails explicitly; this change does not infer credentials/endpoints or present the test double as a deployed Sinex adapter. The real material/JetStream/settlement integration remains `polylogue-303r.2.2`, pending the corresponding Sinex capabilities.

Before `polylogue.sinex` landed, Polylogue could at most emit a low-volume bridge event to Sinex containing session metadata such as identity, origin, content hash, message count, model, and optional cost — the current package supersedes that as the intended producer, though it does not yet make Sinex the authority for complete transcript content or Polylogue user state end-to-end (that requires the remaining 303r.1/.4/.5/.6 phases plus the live Sinex counterpart above).

Expand Down
46 changes: 8 additions & 38 deletions polylogue/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,17 +677,16 @@ def effective_path(self) -> str:
toml_path="sinex.mode",
env_var="POLYLOGUE_SINEX_MODE",
owner_class="network-security",
reload_behavior="unwired",
reload_behavior="daemon-startup",
description=(
"Sinex-backed evidence-mode authority profile: off (default; SQLite is "
"canonical, zero Sinex transport work), mirror (durable local commit plus "
"a best-effort publication obligation), or primary (local projection "
"advance waits for a confirming Sinex receipt). NOT YET CONSUMED: no "
"ingest, daemon, or CLI code path currently reads this value to construct "
"a PublicationService (Ref polylogue-303r.2) -- setting mirror/primary "
"today only surfaces a `sinex_mode_not_yet_wired` config diagnostic, it "
"does not create publication obligations or call any transport. See "
"docs/sinex-interop.md and polylogue/sinex/__init__.py."
"advance waits for an allowed durable Sinex receipt: confirmed persistence, "
"durable debt, or lossless spool acceptance). Mirror/primary are wired "
"through ingest and daemon convergence, and require deployment composition "
"to register a concrete Sinex transport; no reference transport is selected "
"automatically. See docs/sinex-interop.md and polylogue/sinex/__init__.py."
),
),
ConfigInventoryEntry(
Expand Down Expand Up @@ -1654,15 +1653,7 @@ def config_diagnostics(cfg: PolylogueConfig | None = None) -> list[dict[str, obj


def _sinex_mode_diagnostics(resolved: PolylogueConfig) -> list[dict[str, object]]:
"""Diagnose ``sinex_mode``: unrecognized values, and the current unwired state.

``sinex_mode`` is a real, tested authority-profile selector
(``polylogue.sinex``, design polylogue-303r.2), but as of this diagnostic
landing no ingest, daemon, or CLI code path reads it to construct a
``PublicationService``. Configuring ``mirror``/``primary`` must never be a
silent no-op (the package's own design principle) -- surface that gap
here instead of leaving an operator to discover it by absence of effect.
"""
"""Report invalid Sinex authority-mode values before daemon startup."""
mode = resolved.sinex_mode
if mode not in _KNOWN_SINEX_MODES:
return [
Expand All @@ -1675,28 +1666,7 @@ def _sinex_mode_diagnostics(resolved: PolylogueConfig) -> list[dict[str, object]
cfg=resolved,
)
]
if mode == "off":
return []
return [
_config_diagnostic(
code="sinex_mode_not_yet_wired",
severity="warning",
key="sinex_mode",
message=(
f"sinex_mode={mode!r} is configured but no ingest, daemon, or CLI code path "
"currently constructs a PublicationService from it -- this setting has zero "
"observable effect on real archive writes today."
),
next_action=(
"The durable obligation ledger and transport contract exist and are tested "
"(polylogue/sinex/, Ref polylogue-303r.2), but hot-path wiring into "
"ingest/daemon/CLI is deferred follow-up work, and live Sinex transport is "
"additionally blocked on unmerged upstream Sinex work (sinex-4j2.1.1, "
"sinex-r6d.11). Leave sinex_mode=off until that wiring lands."
),
cfg=resolved,
)
]
return []


def effective_config_payload(
Expand Down
Loading