{
  "findings": [
    {
      "title": "Correlate replies without the ephemeral context stub",
      "body": "OMP's public `context` contract modifies only the provider-bound message clone; it does not persist the synthetic `<msg ...>` user message into `session_stop.messages` or `agent_end.messages`. For every item accepted by the new active-turn branch, `completed.stub` is therefore absent here, so `extractReply` returns empty and the sender receives \"turn ended without an assistant response\" even when the model produced a reply. `tests/omp-extension.mjs:1739` hides this by constructing `agent_end` from `boundary.messages`, which real OMP does not do. Record an assistant-message baseline when accepting the item and correlate the later assistant independently of the synthetic stub, then make the test pass realistic persisted messages.",
      "priority": 1,
      "confidence": 0.99,
      "file_path": "adapter/strings/omp-spt.mjs",
      "line_start": 1767,
      "line_end": 1772
    },
    {
      "title": "Re-inject active-turn messages on every provider context",
      "body": "Setting `activeInjected` makes all later `context` events skip the item. Because OMP does not persist a `context` replacement, the envelope is present for only the first provider call; if that response calls a tool, the following model continuation is rebuilt without the accepted peer request and can answer or act without the message it owns. Keep the active item injected at a stable position on every provider context until it settles, and add a test that emits a second `context` event after a tool boundary.",
      "priority": 1,
      "confidence": 0.99,
      "file_path": "adapter/strings/omp-spt.mjs",
      "line_start": 1696,
      "line_end": 1698
    },
    {
      "title": "Bound shortform dispatch below OMP's handler deadline",
      "body": "Targets are sent sequentially inside `completeTurn`, while each production `runCommand` can consume the 15-second default timeout and OMP stops awaiting an extension handler after 30 seconds. Three nonresponsive targets therefore leave this promise running after OMP has timed out the stop/end handler; a new turn can start, then the stale completion resumes and publishes `idle` or queues its status turn over the newer turn. Dispatch with a bounded aggregate deadline below OMP's handler cap, preferably in parallel with cancellation, and finish custody/state transitions before work that can outlive the lifecycle callback.",
      "priority": 1,
      "confidence": 0.97,
      "file_path": "adapter/strings/omp-spt.mjs",
      "line_start": 1730,
      "line_end": 1738
    },
    {
      "title": "Dispatch shortforms only from the current turn",
      "body": "When there is no inbound `completed` item, `completed?.stub` is `undefined`, so `extractReply` searches the entire transcript and returns the latest assistant entry regardless of which turn produced it. If a later turn fails or is aborted before producing a new assistant message, the previous turn's already-dispatched `@<... @>` output is selected and sent again. Capture the assistant baseline at `agent_start` or use a verified current-turn assistant entry, and mark processed output so an abnormal empty turn cannot replay prior peer commands.",
      "priority": 1,
      "confidence": 0.94,
      "file_path": "adapter/strings/omp-spt.mjs",
      "line_start": 1783,
      "line_end": 1783
    },
    {
      "title": "Stop peer-status wakeups once shutdown begins",
      "body": "If `session_shutdown` starts while a shortform `send` is in flight, teardown sets `stopping` and aborts the command, but this function catches that rejection, finishes the loops, and still calls `sendMessage` with `nextTurn` plus `triggerTurn`. OMP's public delivery contract schedules an internal continuation in that case, so shutdown can create a new agent turn after listener/custody teardown has begun. Re-check `stopping` after each awaited send and immediately before status injection, and suppress the status wake during teardown.",
      "priority": 1,
      "confidence": 0.96,
      "file_path": "adapter/strings/omp-spt.mjs",
      "line_start": 1745,
      "line_end": 1753
    },
    {
      "title": "Preserve Linux path identity during auto-resume",
      "body": "`normalizePath` lowercases every path and strips every trailing slash. On supported Linux hosts, `/work/Foo` and `/work/foo` are different projects but compare equal, while the root path `/` normalizes to an empty string and disables the CWD filter entirely. `/live --auto` can consequently rank and confirm the most recent identity from another project as \"compatible.\" Resolve and compare paths with platform-appropriate case semantics, and preserve filesystem roots when removing trailing separators.",
      "priority": 2,
      "confidence": 0.99,
      "file_path": "adapter/strings/omp-spt.mjs",
      "line_start": 614,
      "line_end": 618
    },
    {
      "title": "Determine launch-time endpoint type before checkpointing",
      "body": "The normal `SPT_ENDPOINT_ID` startup path calls `activateEndpoint(initialId, undefined, ...)`, so `activationType` remains undefined even though the documented launch surface hosts both ReadyAgent and LiveAgent identities. This guard rejects only endpoints activated explicitly through `/ready`; a normally launched ReadyAgent can call `spt_checkpoint`, compact its context, and queue a live-only continuation. Populate the type from the public endpoint-info/identity response during launch and require `live_agent` explicitly before compacting; add a launch-time ReadyAgent case to the test.",
      "priority": 2,
      "confidence": 0.98,
      "file_path": "adapter/strings/omp-spt.mjs",
      "line_start": 1101,
      "line_end": 1110
    },
    {
      "title": "Exclude all Markdown code spans from shortform dispatch",
      "body": "The mask is line-oriented and recognizes only fenced blocks and backtick spans whose opener and closer are on the same line. A literal example in a four-space indented code block, or inside a valid backtick code span that crosses a newline, remains visible to `parsePeerShortforms` and is sent as a real peer message despite the new tests' stated no-side-effect rule for quoted code. Use a CommonMark-aware code-span/block scanner, or at minimum carry inline-span state across lines and mask indented code blocks, with regression cases for both forms.",
      "priority": 2,
      "confidence": 0.99,
      "file_path": "adapter/strings/omp-spt.mjs",
      "line_start": 179,
      "line_end": 185
    },
    {
      "title": "Check every public poll command shape",
      "body": "Both new \"no background poll\" assertions inspect only `call.args[3]`, which catches an `spt api ... poll` shape but not the public top-level `spt poll` shape (`args[0] === \"poll\"`) or a poll started through `spawnProcess`. A regression that adds the forbidden background poll can therefore leave both acceptance tests green. Assert that neither recorded command arguments nor spawned child arguments select `poll`, while still allowing the one authenticated `listen` child.",
      "priority": 2,
      "confidence": 0.99,
      "file_path": "tests/omp-extension.mjs",
      "line_start": 1542,
      "line_end": 1544
    },
    {
      "title": "Prove checkpoint waits for compaction before waking",
      "body": "The fake `compact` records its invocation synchronously and resolves immediately, so these final-state assertions also pass if production code starts compaction without awaiting it and sends the wake first. That means the test tagged for the ordered compact-plus-wake requirement does not prove its defining ordering. Return a deferred promise from `onCompact`, start `tool.execute` without awaiting it, assert `sentMessages` is empty while compaction is pending, then resolve the gate and verify exactly one wake.",
      "priority": 2,
      "confidence": 0.99,
      "file_path": "tests/omp-extension.mjs",
      "line_start": 1863,
      "line_end": 1872
    }
  ],
  "overall_correctness": "incorrect",
  "explanation": "The patch does not satisfy active-turn delivery and custody: OMP context replacements are nonpersistent, so accepted messages disappear after the first provider call and their replies are miscorrelated. Peer shortform completion also introduces handler-timeout and shutdown races, with additional auto-resume, checkpoint-role, Markdown parsing, and acceptance-test gaps.",
  "confidence": 0.99
}