|
| 1 | +# wp1 — live measurement: what is stale, what is a real defect |
| 2 | + |
| 3 | +Measured 2026-08-29 by direct probe of three hosts plus the current tree. |
| 4 | +This phase changed no production code. |
| 5 | + |
| 6 | +## Host attribution |
| 7 | + |
| 8 | +| host | opencodex | process | age at measurement | verdict | |
| 9 | +|------|-----------|---------|--------------------|---------| |
| 10 | +| jun's mac (local) | 2.35.0, run from the checkout via `bun src/cli/index.ts start --port 10100` | PID 62773 | started 2026-08-28 22:12:11 | **STALE by 3 commits** | |
| 11 | +| `suji` (sujis-MacBook-Pro, 100.65.106.2) | 2.24.2, installed binary `~/.local/bin/ocx` | PID 98048 | uptime 941472s ≈ **10.9 days** | **GROSSLY STALE** — predates every Kiro fix in this unit | |
| 12 | +| `macmini-cf` (juniui-Macmini) | checkout `~/opencodex` at `d7a82a8fc` (dev, includes all of #2819) | none | `ocx` not installed, no proxy running | current source, not serving | |
| 13 | + |
| 14 | +Commands: `ps -o lstart=,etime= -p 62773`, `curl -s localhost:10100/healthz` on each |
| 15 | +host, `git log --oneline -3` in `~/opencodex` on macmini-cf. |
| 16 | + |
| 17 | +## Finding 1 — part of the non-termination report is a stale process |
| 18 | + |
| 19 | +The local proxy the user was routed through started at **22:12:11**. Three commits |
| 20 | +of #2819 landed *after* that: |
| 21 | + |
| 22 | +| commit | time | content | |
| 23 | +|--------|------|---------| |
| 24 | +| `b0740840d` | 22:14 | mark the physical attempt as locally answered too | |
| 25 | +| `d9d26552f` | 22:15 | state the code-mode echo rule before the first call | |
| 26 | +| `68eaf45d8` | 22:30 | remember a delivered final answer instead of trusting the client to echo phase | |
| 27 | + |
| 28 | +`68eaf45d8` is the one that matters: it stops the terminal boundary from depending |
| 29 | +on the client echoing `phase`. A proxy started before it cannot have the completed |
| 30 | +form of the wp1 terminal-boundary fix. So the user's "still doesn't finish" report |
| 31 | +is measured against a binary that never contained the finished fix. |
| 32 | + |
| 33 | +`suji` is worse and is worth stating plainly: at 2.24.2 with 10.9 days of uptime it |
| 34 | +predates the entire unit, so any Kiro turn routed there reproduces every symptom |
| 35 | +regardless of what `dev` contains. |
| 36 | + |
| 37 | +**This does not close the report.** It explains part of it. Finding 2 is a real |
| 38 | +defect in current source. |
| 39 | + |
| 40 | +## Finding 2 — the duplicate answer is live in current `dev` |
| 41 | + |
| 42 | +Live probes against the running proxy (`/v1/responses`, streaming, |
| 43 | +`kiro/claude-opus-5`): |
| 44 | + |
| 45 | +- plain question, no tools -> 1 visible assistant message, `phase: "final_answer"`, `end_turn: true` |
| 46 | +- question with a tool available, answered directly -> 1 visible message |
| 47 | +- tool-result round trip -> normal `function_call` |
| 48 | + |
| 49 | +Those turns are clean, which is consistent with finding 1's fix having landed in |
| 50 | +source. But the duplicate needs a specific shape: **one inference that emits |
| 51 | +ordinary prose AND then calls the private completion tool**. The model does not |
| 52 | +take that shape on every turn, so a live probe is not a reliable trigger. |
| 53 | + |
| 54 | +It does not need to be. The shape is pinned deterministically by the suite in the |
| 55 | +current tree — `tests/kiro-stream.test.ts` asserts the duplicate as expected |
| 56 | +behaviour in three places: |
| 57 | + |
| 58 | +| test | asserted events | |
| 59 | +|------|-----------------| |
| 60 | +| "tool-enabled commentary can finish only through a fragmented private completion call" (:267) | `"Checking the result."` commentary, then `"Task complete."` final_answer | |
| 61 | +| "STOP_SEQUENCE text also enters bounded completion validation" (:659) | `"Done."` commentary, then `"Done."` final_answer — **byte-identical** | |
| 62 | +| "END_TURN does not promote a private completion answer's commentary" (:746) | `"Checking the result."` commentary, then `"Task complete."` final_answer | |
| 63 | + |
| 64 | +Verified green at HEAD: `bun test tests/kiro-stream.test.ts -t "STOP_SEQUENCE text |
| 65 | +also enters bounded completion validation"` -> 1 pass, 3 expect() calls. |
| 66 | + |
| 67 | +The `:659` case is the user's symptom exactly: the same text delivered twice, once |
| 68 | +as commentary and once as the final answer. `src/bridge.ts` splits on the phase |
| 69 | +change, so the client renders two assistant messages. |
| 70 | + |
| 71 | +Mechanism in source, unchanged from `000_research.md`: |
| 72 | +`src/adapters/kiro.ts:1468` flushes the whole `deferred` collection |
| 73 | +unconditionally when `mode === "required"`, immediately before the completion |
| 74 | +answer is emitted as `final_answer`. Nothing consumes the retained prose when a |
| 75 | +valid completion answer supersedes it. |
| 76 | + |
| 77 | +## Finding 3 — the outer drain is a second, independent emitter |
| 78 | + |
| 79 | +`parseKiroAttempt` drains `deferred` again at `src/adapters/kiro.ts:996-999` after |
| 80 | +the inner generator returns. Skipping only the inner flush at `:1468` therefore |
| 81 | +does not remove the duplicate — it reverses its order. Any fix must CONSUME the |
| 82 | +collection, not skip one of its two readers. This confirms the audit round-2 |
| 83 | +correction in `020_wp2_duplicate_answer.md` against current source. |
| 84 | + |
| 85 | +## Conclusion |
| 86 | + |
| 87 | +- The non-termination report: **partly stale process** (local proxy predates |
| 88 | + `68eaf45d8`; `suji` predates the entire unit). Restart is the remedy, not a code |
| 89 | + change. |
| 90 | +- The duplicate answer: **a real, currently-pinned defect in `dev`**. It is wp2. |
| 91 | + |
| 92 | +Both hosts need a restart onto current `dev` before any further live judgement of |
| 93 | +turn termination is meaningful. |
| 94 | + |
0 commit comments