Repository navigation
fix(bin): read list-shaped Lavish results so queued comments are never lost - #4
Merged
Merged
Conversation
…ents are never lost lavish-axi frames queued feedback as a TOON list, not a table, whenever an item carries a nested object such as a table-cell target. The adapter only recognized the tabular header, so read reported 0 of N items as complete and answers dropped board choices. One shared parser now reads both shapes for read, the silence check, and the keyed-answer extraction; read shows each item's nested target and never certifies an unparseable block as complete.
…eads hide nothing
…eature/lavish-read-list-format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
A Lavish review board result carrying 12 queued comments was read back by
bin/fm-procevent-lavish.sh readasdeclared_items: 0,presented_items: 0,ANNOTATIONS: (none),complete: yes, so the comments looked empty and would have been lost if the raw result had not been checked by hand. Comments sent on a Lavish board must always reach Firstmate.The installed lavish-axi is 0.1.64. Its poll result frames queued feedback as a list, not the tabular header the reader expects:
A freeform message item has
text: Freeform message.What Changed
bin/fm-procevent-lavish.sh readnow parses Lavish's TOON list shape (prompts[N]:followed by- key: valueitems), as well as the tabularprompts[N]{...}:header. Declared and presented counts, annotations (uid, selector, tag, text, prompt), and freeform messages all come through. Nested fields liketarget.*andattachmentsare flattened into the output. Any item or content block that can't be fully presented is counted as unpresented and never markedcomplete: yes.state.json) instead ofconfig/lavish-axi-host. On newer Lavish releases, staged replies go through the synchronouslavish-axi replycommand. There is a newdeliver-replysubcommand, andarmnow checks that a listener is actually running.tests/fm-procevent.test.shhas new list-shaped read coverage.feature/fm-upstream-syncbranch, which brings in upstream Firstmate changes acrossbin/, docs, skills, harness extensions and tests. Highlights: the supervision host, Devin harness support, the fleet ledger, the live lab builder, and worker account and host-mirror helpers.tests/fm-fleet-ledger.test.shnow creates checkouts onfeature/<task-id>to match the fork's branch naming.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The reader change stays inside one parser that every consumer shares. It handles realistic lavish-axi 0.1.64 TOON output correctly (list items, text-range, layout-warnings, nested arrays, tabular attachments, messages), and behavioral tests back it. The only gap found is a malformed-input edge case that the tabular path already had.
Testing
I checked the intent end to end on a real lavish-axi 0.1.64 board. I queued 12 comments through the server's prompt API, including a table-cell target, a text-range selection and a freeform message, then polled the real list-shaped result. The base-commit reader turned that capture into 0 declared, 0 presented, no annotations and
complete: yes, which is exactly the reported loss. The fixed reader shows declared 12, presented 12, unpresented 0 and complete: yes. It prints all 11 annotations with their comment text, selectors and flattened target fields (table-cell labels; text-range start/end offsets and paths), and the freeform message as CAPTAIN MESSAGE. On the same capture,classifyreturns feedback andsilentexits 1 (not silent). I also rantests/fm-procevent.test.sh, and all the read-related cases passed, including the list-shape, attachments, text-range, layout-warnings and message-field regressions. The file later stops on a macOS-onlysetsidgap that was already there before this change. This is CLI-only, so the evidence is transcripts, not screenshots. I made no changes to the worktree.Evidence: Raw lavish-axi 0.1.64 poll result with 12 queued comments (list shape)
Source: Raw lavish-axi 0.1.64 poll result with 12 queued comments (list shape)
Evidence: Base-commit `read` output: bug reproduced (0 items, complete: yes)
Source: Base-commit
readoutput: bug reproduced (0 items, complete: yes)SESSION-ENDING MESSAGE: (none) declared_items: 0 presented_items: 0 complete: yes ANNOTATIONS: (none) END LAVISH RESULT (0 of 0)Evidence: Fixed `read` output: all 12 comments presented
Source: Fixed
readoutput: all 12 comments presentedCAPTAIN MESSAGE | Overall looks good, ship it after fixes fields: | text: Freeform message END CAPTAIN MESSAGE declared_items: 12 presented_items: 12 unpresented_items: 0 complete: yes annotation_count: 11 ... ANNOTATION 11 of 11 prompt: | reword this target: | end.offset: 19 | end.path[0]: 0 | start.offset: 5 | type: text-range END LAVISH RESULT (12 of 12)Evidence: classify/silent on the live capture
Source: classify/silent on the live capture
Evidence: Queued prompt payload posted to the live board
Source: Queued prompt payload posted to the live board
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-procevent-lavish.sh:729- When a block has more items than its header declares, the extras are dropped and the read still sayscomplete: yes. Both the new list path (line 729) and the tabular path (line 691) stop reading atwantitems. Reproduced:prompts[1]:followed by two- uid:items givespresented_items: 1andcomplete: yes, and the second comment (second) never appears. The tabular path already behaved this way before this change. Real lavish-axi output always has matching counts, so this only happens with a malformed or tampered capture. It still weakens the round-2 promise thatcomplete: yesmeans everything was presented. Fix: keep scanning afterwantitems, and if any further item or row exists, count it as malformed or setunparsedso the verdict becomescomplete: no.tests/fm-procevent.test.sh:5128- On macOS the test file stops at line 5128 withsetsid: command not found(draining-holder fixture), because macOS has nosetsidbinary. This was already in the base commit, is unrelated to the read-format change, and should not affect Linux CI. It does stop local macOS runs from finishing the file. Possible fix: a portable fallback such asperl -e 'use POSIX; setsid(); exec @ARGV' sleep 60 &.Started a live lavish-axi 0.1.64 server with an isolated state dir under the evidence directory (LAVISH_AXI_STATE_DIR,LAVISH_AXI_PORT=47813,--no-open --no-gate)Queued 12 comments through the board's ownPOST /api/<key>/promptsendpoint: 9 element comments, 1 table-cell target, 1 text-range target with nested start/end path arrays, and 1 freeformtag: messagelavish-axi poll board.html --timeout-ms 20000returned the real list-shapedprompts[12]:resultbin/fm-procevent-lavish.sh read poll-result.txton the target commitSamereadusingbin/from base commit 89e14597 (git archive into a temp dir), which reproduced the reported bugbin/fm-procevent-lavish.sh classifyandsilenton the live capturebash tests/fm-procevent.test.sh: every test through the list-shaped read, attachments, text-range, layout-warnings and message-field cases passed (fail() exits immediately, so reaching later tests means these passed). The run then stopped at line 5128 onsetsid: command not found✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.