Skip to content

feat(supervise): chat-transport executor — conversation workers with real resume continuity; P1 live path made valid - #730

Merged
drewstone merged 2 commits into
mainfrom
feat/chat-transport-executor
Aug 3, 2026
Merged

feat(supervise): chat-transport executor — conversation workers with real resume continuity; P1 live path made valid#730
drewstone merged 2 commits into
mainfrom
feat/chat-transport-executor

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Closes #721. Part of #694.

  • chatTransportExecutor + chatWorkerSeam: workers as conversations on a bare OpenAI-compatible endpoint — no sandbox — with full kernel citizenship (pinning, conserved spend, settle/verdict, ledger, trace). Real resume: a continuity: 'resume' spawn continues the exact recorded message list (proven at the wire; micro-revert kills 3 tests). Metering is honest by construction: usd only from response cost fields, else usdKnown: false — no estimation code exists in the module. Transport failures settle infra-flagged, never fake success. Non-streaming by design (documented: streaming usage can't mark an unmetered turn).
  • examples/graphs/user-sim-conversation.ts: the conversation graph — simulated-user root, chat worker, resume edge; three-worker message-chain proven offline.
  • P1 live path made valid (all three audited gaps + one sampling refutation closed): both arms' coders on the same substrate AND the same pinned sampling (PARITY_CODER_SAMPLING, asserted at captured requests); multishot arm maps bridge cost fields so the estimate fallback never fires on priced turns (usdSource on the record); ParityRecord gains infraShots/tokensKnown/usdKnown so an infra-dead live run is visibly not a non-convergence (scripted-500 tests per arm). Bonus root-fix: the offline scripted driver brain now meters, un-tainting the conserved pool.

Audited SHIP on the module (resume, metering, failure semantics, offline strace, non-tautology probes all held); the live-path sampling asymmetry the audit REFUTED is fixed and pinned by test.

0.128.0 + CHANGELOG. Suite 2379; all gates green.

…tions transport (#721)

chatTransportExecutor: a first-class Executor whose runtime is a plain
OpenAI-compatible /v1/chat/completions transport — the worker is a model
conversation, not a sandboxed process. Non-streaming (the one-shot Spend
carries tokensKnown/usdKnown honesty markers the streaming channel cannot),
tokens metered from transport usage fields, dollars only from response cost
fields (never a local estimate), transport failures settle as loud infra
errors, and session continuity keys recorded message lists by settled worker
id so a continuity:'resume' spawn continues the exact conversation.
chatWorkerSeam is the session-owning makeWorkerAgent seam workerFromBackend
refuses to be; chatCompletionsTransport is the one shared wire function.

examples/graphs/user-sim-conversation.ts: a conversation as a graph — the
simulated user is a persona-profile node, the product agent a chat worker,
each turn a ledgered resume traversal; offline test asserts the resumed
message-history chain on wire-captured requests, ledger continuity stamps,
seam lineage, and conserved spend.

examples/p1-parity live path: both arms' coders share one chat-completions
substrate (the graph arm on chatTransportExecutor, delegates edge
continuity:'resume' matching runMultishot's single transcript), the live
graph arm gains its required reviewer router brain, and every model is
explicit — the 'parity/unspecified' fallback is gone and missing env fails
loud.
… USD, infra/validity channel

F1: chatTransportExecutor gains maxTokens (sent as max_tokens on every
request); both parity arms pin coder sampling to one shared constant
(PARITY_CODER_SAMPLING, 0.7/2500) so a paired row cannot measure a
sampling difference and call it an orchestration effect. The multishot
arm's 2000-token tool-follow-up request class is documented as the one
residual on the ParityRecord doc block.

F2: the live multishot transport maps the bridge's usage.cost/cost_usd
onto the transport result's costUsd (same read order as
chatTransportExecutor), so runMultishot meters measured dollars instead
of firing its price-table estimator every live turn; ParityRecord gains
usdSource: measured | estimated | unknown so every row states which.

F4: ParityRecord gains the infra/validity channel — infraShots (graph
arm: infra-flagged down settles of delegates-bound workers via the run's
hook stream; multishot arm: transport throws counted at the metering
seam, settling an honest row instead of crashing the cell), plus
tokensKnown/usdKnown (false when any counted completion lacked
usage/cost; a dead turn counts as unreported, never zero). The offline
scripted brain now meters its synthetic usage so completed offline runs
are all-clear, and one scripted-500 test per arm proves the infra row is
visibly not an ordinary non-convergence.

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved drewstone PR — 3a290d00

This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: drewstone_author · 2026-08-03T21:07:04Z

@drewstone
drewstone merged commit 233e511 into main Aug 3, 2026
4 checks passed
@drewstone
drewstone deleted the feat/chat-transport-executor branch August 3, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants