# Telegram Reliability Consolidation — 2026-09-28

Status: complete

Rule: check a box only after the named behavior is implemented and its listed
verification passes. A parent box stays open until every child box is checked.

## Failure classification

- [x] **R1 — Response identity split (correctness, P0).** A runner can retain
  one input/task identity while visible reply ownership moves to a later input.
  - [x] Define one response binding containing `inputId`, `messageId`,
    `decisionId`, `taskEpoch`, `runId`, generation, reply target, and route.
  - [x] Use that binding for social-decision commit.
  - [x] Use that binding for visible reply ownership.
  - [x] Use that binding for final Telegram reply targeting.
  - [x] Use that binding for delivery-ledger attribution.
  - [x] Reject delivery when any binding identity differs.
  - [x] Prevent a materially new request from inheriting an older objective.
  - [x] Cover the message-496/message-499 production shape with a regression
    test.

- [x] **R2 — Active-runner authority bypass (correctness/safety, P0).** Public
  group steering can bypass the group reply-authority review used by new work.
  - [x] Apply equivalent input-bound reply-authority validation to active-runner
    routing.
  - [x] Fail closed when active-runner authority is unavailable or invalid.
  - [x] Test a human-to-human active-runner turn that must remain silent.
  - [x] Test a direct active-runner address that remains reply-capable.

- [x] **R3 — Conversational admin DM misclassified as mutation (correctness,
  P0).** Metaphorical or conversational reset language enters the full action
  pipeline and creates an unfulfillable mutation obligation.
  - [x] Add a conversational/internal-control execution class before action
    planning.
  - [x] Ensure metaphorical reset/acknowledgement requests do not require a
    mutation effect.
  - [x] Avoid engineering workboard creation for a simple acknowledgement.
  - [x] Avoid `tool_search`/`todo_write` for the acknowledgement fast path.
  - [x] Preserve the natural assistant answer as the delivered reply.
  - [x] Test `clear your slate ... mentally and proverbially` end to end.

- [x] **R4 — Completion verifier replaces valid replies with bookkeeping
  (correctness/UX, P0).** A host-side contract mismatch can discard a current,
  evidence-bound `task_complete.user_reply`.
  - [x] Separate conversational reply delivery from action verification status.
  - [x] Keep a valid current user reply deliverable when only the generated
    expected-effect contract is unsatisfied.
  - [x] Keep genuine mutation failures fail-closed for completion claims.
  - [x] Put verification gaps in diagnostics/evidence rather than substituting
    them for a valid conversational reply.
  - [x] Replace tests that encode the undesirable canned admin response.

- [x] **R5 — Admin control-plane leakage (UX, P1).** Steering reconciliation is
  rendered as `Plan update` on the primary admin response surface.
  - [x] Remove reconciliation blocks from the admin response page.
  - [x] Retain reconciliation evidence under Tasks/Logs/Context diagnostics.
  - [x] Ensure final admin reply composition does not prepend plan telemetry.
  - [x] Test that ordinary admin replies contain no `Plan update` block.

- [x] **R6 — Serial inference multiplication (latency, P1).** Router,
  authority, generation, semantic review, and repair retries stack on the
  critical path.
  - [x] Split minimal social authority/route output from action planning fields.
  - [x] Run action planning only for an accepted action route.
  - [x] Bound malformed-router repair to one compact repair attempt.
  - [x] Avoid an unconditional semantic review for low-risk conversational chat.
  - [x] Run the second-pass public authority review only for positive group
    candidates; do not spend that call on already-silent decisions.
  - [x] Add an operation-level routing deadline that includes broker admission
    and retries.
  - [x] Test bounded inference-call counts for no-reply, private chat, group
    chat, and action routes.

- [x] **R7 — Oversized context for trivial turns (latency/cost, P1).** A simple
  acknowledgement consumed five turns and 110,433 cumulative tokens.
  - [x] Define a strict context budget for conversational/admin fast paths.
  - [x] Exclude workspace tree, work graph, mutation receipts, and engineering
    contracts when the execution class does not need them.
  - [x] Stop repeating no-plan reminders on conversational turns.
  - [x] Add a regression ceiling for prompt size and runner turns.

- [x] **R8 — Durable spool replay churn (durability/performance, P0).** A raw
  update remains reclaimable after it has been durably transferred to intake,
  producing repeated dispatch attempts.
  - [x] Define the transport-terminal state for an update durably bound to
    intake.
  - [x] Mark the raw spool row transport-terminal atomically when the first
    durable intake lifecycle record commits.
  - [x] Let the intake lifecycle, not raw update replay, own deferred work.
  - [x] Preserve raw-envelope restart recovery before the durable intake
    handoff commits.
  - [x] Rehydrate nonterminal logical intake after restart without reclaiming
    the raw transport envelope.
  - [x] Recover the newest edited-message revision while preserving the
    original logical intake owner.
  - [x] Test that deferred active-runner intake is not replay-claimed.
  - [x] Test production restart recovery through the real replay entry point,
    with one logical scheduling and one raw dispatch attempt.

- [x] **R9 — Head-of-line route blocking (latency, P1).** One global active
  route slot lets a slow/retried chat delay unrelated chats.
  - [x] Replace the global single route slot with bounded fair concurrency.
  - [x] Preserve per-chat inference serialization and exact input binding.
  - [x] Prioritize direct messages, direct mentions, and known reply-capable
    chats.
  - [x] Test that a stalled route does not block an unrelated direct address.

- [x] **R10 — Terminal review duplication (latency, P1).** Identical unchanged
  evidence can receive repeated inline reviews and recovery cycles.
  - [x] Key terminal review results by input, objective-frontier hash, and
    evidence digest.
  - [x] Reuse a review when its evidence identity is unchanged.
  - [x] Do not immediately retry an identical malformed review inline.
  - [x] Keep simple conversation replies out of action recovery; reuse an
    unchanged evidence review for read-only research instead of reviewing it
    again at each stalled/terminal phase.
  - [x] Test bounded review/recovery counts.

- [x] **R11 — Normal-mode event noise (observability, P2).** Sequential router
  and reply-phase cards obscure the user-visible critical path.
  - [x] Bind every inference phase to the exact input and reuse one TUI block
    for sequential phases of that input only.
  - [x] Label group inference with the group name rather than a generic title.
  - [x] Collapse completed control-plane JSON while keeping it available in
    the block's explicit read mode.
  - [x] Keep periodic queue diagnostics behind an explicit debug flag.
  - [x] Preserve the underlying segments and durable forensic evidence.
  - [x] Test that normal mode omits raw completed router JSON and repeated
    queue chatter.

- [x] **R12 — Todo-state path override ignored (testability/configuration,
  P2).** The todo store wrote only to `~/.omnius`, so restricted environments
  reported a false lock timeout instead of exercising Telegram context tests.
  - [x] Make the todo store honor the existing `OMNIUS_HOME` state-root
    override used by the other execution stores.
  - [x] Make its disk-layout assertion derive the path from `todoDir()`.
  - [x] Run the todo-store and task-completion guard suites under an isolated
    `OMNIUS_HOME` (42/42 passing).

## Verification and delivery

- [x] Run focused Telegram routing and authority tests.
- [x] Run active-runner steering tests.
- [x] Run admin live-panel and terminal-delivery tests.
- [x] Run completion-readiness/orchestrator tests.
- [x] Run durable update spool and restart-replay tests.
- [x] Run Telegram queue/priority tests.
- [x] Run the complete Telegram CLI test subset affected by these changes.
- [x] Build every changed workspace package.
- [x] Inspect the diff for unrelated files and generated artifacts.
- [x] Commit each coherent verified repair with scoped paths only.
- [x] Fetch the tracked branch and push without rewriting shared history.
- [x] Record commit hashes, branch, and verification results here.

## Evidence log

- Live admin-DM run:
  `telegram-64ac9937dc7647a8-1790575905415-1`.
- Live Case Theory mismatch: source task message 496, transferred visible reply
  owner message 499, delivered message 500.
- No completion boxes were pre-checked when this work order was created.
- Focused Telegram routing/authority/UI verification: 106/106 passing.
- Integrated affected Telegram CLI verification: 426/426 passing across 21
  files, including `telegram-bot-api-10.test.ts` at 155/155.
- Orchestrator completion authority verification: 30/30 passing.
- Execution todo-store override and completion-guard verification: 42/42
  passing under an isolated `OMNIUS_HOME`.
- Workspace builds: `@omnius/execution`, `@omnius/orchestrator`, and `omnius`
  all passing.
- `git diff --check`: passing. Unrelated pre-existing changes in
  `docs/DISCOVERY.json`, `docs/DISCOVERY.md`, `publish/npm-shrinkwrap.json`,
  and `publish/package.json` are intentionally excluded from delivery.
- Scoped delivery commits: `21134195` (todo-state override), `d489e4ca`
  (Telegram/orchestrator reliability), and `8d594887` (verification record).
- Fetched `origin/main` with zero remote-only commits, then pushed without
  rewriting history. Remote `main` was verified at
  `8d594887e87364ecf3e6d7475ca1cda24cde9852`.
