Skip to content

fix(bin): read list-shaped Lavish results so queued comments are never lost - #4

Merged
demy00 merged 5 commits into
feature/fm-upstream-syncfrom
feature/lavish-read-list-format
Oct 1, 2026
Merged

demy00 merged 5 commits into
feature/fm-upstream-syncfrom
feature/lavish-read-list-format

Conversation

@demy00

@demy00 demy00 commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Intent

A Lavish review board result carrying 12 queued comments was read back by bin/fm-procevent-lavish.sh read as declared_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:

session:
file: /path/to/board.html
status: feedback
prompts[12]:
- uid: "1"
prompt: <comment text>
selector: "body > main > div:nth-of-type(1)"
tag: div
text: "<element text>"
- uid: "6"
prompt: "<comment text>"
selector: "..."
tag: td
text: "..."
target:
type: table-cell
selector: "..."
rowLabel: Private
columnLabel: Where the AI runs
text: "..."

A freeform message item has text: Freeform message.

What Changed

  • bin/fm-procevent-lavish.sh read now parses Lavish's TOON list shape (prompts[N]: followed by - key: value items), as well as the tabular prompts[N]{...}: header. Declared and presented counts, annotations (uid, selector, tag, text, prompt), and freeform messages all come through. Nested fields like target.* and attachments are flattened into the output. Any item or content block that can't be fully presented is counted as unpresented and never marked complete: yes.
  • Lavish listeners now get the board's host and port from Lavish's own session store (state.json) instead of config/lavish-axi-host. On newer Lavish releases, staged replies go through the synchronous lavish-axi reply command. There is a new deliver-reply subcommand, and arm now checks that a listener is actually running. tests/fm-procevent.test.sh has new list-shaped read coverage.
  • Merges the feature/fm-upstream-sync branch, which brings in upstream Firstmate changes across bin/, 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.sh now creates checkouts on feature/<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, classify returns feedback and silent exits 1 (not silent). I also ran tests/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-only setsid gap 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)

session:
  file: ~/.no-mistakes/evidence/01M3T0WJWPR469BT5NKVHCAVX5/e2e/board.html
  status: feedback
prompts[12]:
  - uid: "1"
    prompt: "Comment number 1: tighten this copy"
    selector: "body > main > div:nth-of-type(1) > p"
    tag: p
    text: Some paragraph text here
  - uid: "2"
    prompt: "Comment number 2: tighten this copy"
    selector: "body > main > div:nth-of-type(1) > p"
    tag: p
    text: Some paragraph text here
  - uid: "3"
    prompt: "Comment number 3: tighten this copy"
    selector: "body > main > div:nth-of-type(1) > p"
    tag: p
    text: Some paragraph text here
  - uid: "4"
    prompt: "Comment number 4: tighten this copy"
    selector: "body > main > div:nth-of-type(1) > p"
    tag: p
    text: Some paragraph text here
  - uid: "5"
    prompt: "Comment number 5: tighten this copy"
    selector: "body > main > div:nth-of-type(1) > p"
    tag: p
    text: Some paragraph text here
  - uid: "6"
    prompt: "Comment number 6: tighten this copy"
    selector: "body > main > div:nth-of-type(1) > p"
    tag: p
    text: Some paragraph text here
  - uid: "7"
    prompt: "Comment number 7: tighten this copy"
    selector: "body > main > div:nth-of-type(1) > p"
    tag: p
    text: Some paragraph text here
  - uid: "8"
    prompt: "Comment number 8: tighten this copy"
    selector: "body > main > div:nth-of-type(1) > p"
    tag: p
    text: Some paragraph text here
  - uid: "9"
    prompt: "Comment number 9: tighten this copy"
    selector: "body > main > div:nth-of-type(1) > p"
    tag: p
    text: Some paragraph text here
  - uid: "10"
    prompt: Clarify where the AI runs
    selector: "table td:nth-of-type(1)"
    tag: td
    text: Private
    target:
      type: table-cell
      selector: "table td:nth-of-type(1)"
      rowLabel: Private
      columnLabel: Where the AI runs
      text: Private
  - uid: "11"
    prompt: reword this
    selector: main p
    tag: p
    text: paragraph text
    target:
      type: text-range
      text: paragraph text
      start:
        selector: main > p
        path[2]: 0,1
        offset: 5
      end:
        selector: main > p
        path[2]: 0,1
        offset: 19
  - uid: ""
    prompt: "Overall looks good, ship it after fixes"
    selector: ""
    tag: message
    text: Freeform message
next_step: "Apply the requested changes to ~/.no-mistakes/evidence/01M3T0WJWPR469BT5NKVHCAVX5/e2e/board.html. Do not respond to the user just yet. Now you must run `lavish-axi poll ~/.no-mistakes/evidence/01M3T0WJWPR469BT5NKVHCAVX5/e2e/board.html --agent-reply \"<message for the user>\"` without --timeout-ms unless the user ended the session. The poll waits silently until the user sends more feedback or ends the session - never kill it. Keep the poll in the foreground by default and let it return the feedback directly to the agent. A background poll is allowed only through a harness-native tracked background-job facility whose completion result is guaranteed to resume or notify the same agent. Never use `nohup`, shell `&`, `disown`, redirected fire-and-forget processes, or a detached terminal without an explicit verified callback merely to keep polling alive. If the harness has no completion-aware background facility, use the foreground poll or first wire a verified wake callback into the surrounding supervisor. Do not tell the user the artifact is being monitored until that wake path is live. If the poll gets killed or times out before feedback arrives, re-run it - feedback remains queued until delivery. Poll delivery consumes the response, so read it completely."
dom_snapshot: ""
Evidence: Base-commit `read` output: bug reproduced (0 items, complete: yes)

Source: Base-commit read output: 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)

SESSION-ENDING MESSAGE: (none)

declared_items: 0
presented_items: 0
malformed_items: 0
complete: yes
lifecycle: feedback
session_ended: (unset)
annotation_count: 0
session_ending_message_count: 0

ANNOTATIONS: (none)
END LAVISH RESULT (0 of 0)
Evidence: Fixed `read` output: all 12 comments presented

Source: Fixed read output: all 12 comments presented

CAPTAIN 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)

CAPTAIN MESSAGE
| Overall looks good, ship it after fixes
fields:
| text: Freeform message
END CAPTAIN MESSAGE

declared_items: 12
presented_items: 12
malformed_items: 0
unpresented_items: 0
complete: yes
lifecycle: feedback
session_ended: (unset)
annotation_count: 11
session_ending_message_count: 1

ANNOTATIONS
ANNOTATION 1 of 11
element_uid: 1
element_selector: body > main > div:nth-of-type(1) > p
tag: p
text:
| Some paragraph text here
prompt:
| Comment number 1: tighten this copy
ANNOTATION 2 of 11
element_uid: 2
element_selector: body > main > div:nth-of-type(1) > p
tag: p
text:
| Some paragraph text here
prompt:
| Comment number 2: tighten this copy
ANNOTATION 3 of 11
element_uid: 3
element_selector: body > main > div:nth-of-type(1) > p
tag: p
text:
| Some paragraph text here
prompt:
| Comment number 3: tighten this copy
ANNOTATION 4 of 11
element_uid: 4
element_selector: body > main > div:nth-of-type(1) > p
tag: p
text:
| Some paragraph text here
prompt:
| Comment number 4: tighten this copy
ANNOTATION 5 of 11
element_uid: 5
element_selector: body > main > div:nth-of-type(1) > p
tag: p
text:
| Some paragraph text here
prompt:
| Comment number 5: tighten this copy
ANNOTATION 6 of 11
element_uid: 6
element_selector: body > main > div:nth-of-type(1) > p
tag: p
text:
| Some paragraph text here
prompt:
| Comment number 6: tighten this copy
ANNOTATION 7 of 11
element_uid: 7
element_selector: body > main > div:nth-of-type(1) > p
tag: p
text:
| Some paragraph text here
prompt:
| Comment number 7: tighten this copy
ANNOTATION 8 of 11
element_uid: 8
element_selector: body > main > div:nth-of-type(1) > p
tag: p
text:
| Some paragraph text here
prompt:
| Comment number 8: tighten this copy
ANNOTATION 9 of 11
element_uid: 9
element_selector: body > main > div:nth-of-type(1) > p
tag: p
text:
| Some paragraph text here
prompt:
| Comment number 9: tighten this copy
ANNOTATION 10 of 11
element_uid: 10
element_selector: table td:nth-of-type(1)
tag: td
text:
| Private
prompt:
| Clarify where the AI runs
target:
| columnLabel: Where the AI runs
| rowLabel: Private
| selector: table td:nth-of-type(1)
| text: Private
| type: table-cell
ANNOTATION 11 of 11
element_uid: 11
element_selector: main p
tag: p
text:
| paragraph text
prompt:
| reword this
target:
| end.offset: 19
| end.path[0]: 0
| end.path[1]: 1
| end.selector: main > p
| start.offset: 5
| start.path[0]: 0
| start.path[1]: 1
| start.selector: main > p
| text: paragraph text
| type: text-range
END ANNOTATIONS
END LAVISH RESULT (12 of 12)
Evidence: classify/silent on the live capture

Source: classify/silent on the live capture

## after fix
classify: feedback
silent exit=1 (non-zero = wake is published)
## base
silent exit=1
Evidence: Queued prompt payload posted to the live board

Source: Queued prompt payload posted to the live board

{"prompts": [{"uid": "1", "prompt": "Comment number 1: tighten this copy", "selector": "body > main > div:nth-of-type(1) > p", "tag": "p", "text": "Some paragraph text here"}, {"uid": "2", "prompt": "Comment number 2: tighten this copy", "selector": "body > main > div:nth-of-type(1) > p", "tag": "p", "text": "Some paragraph text here"}, {"uid": "3", "prompt": "Comment number 3: tighten this copy", "selector": "body > main > div:nth-of-type(1) > p", "tag": "p", "text": "Some paragraph text here"}, {"uid": "4", "prompt": "Comment number 4: tighten this copy", "selector": "body > main > div:nth-of-type(1) > p", "tag": "p", "text": "Some paragraph text here"}, {"uid": "5", "prompt": "Comment number 5: tighten this copy", "selector": "body > main > div:nth-of-type(1) > p", "tag": "p", "text": "Some paragraph text here"}, {"uid": "6", "prompt": "Comment number 6: tighten this copy", "selector": "body > main > div:nth-of-type(1) > p", "tag": "p", "text": "Some paragraph text here"}, {"uid": "7", "prompt": "Comment number 7: tighten this copy", "selector": "body > main > div:nth-of-type(1) > p", "tag": "p", "text": "Some paragraph text here"}, {"uid": "8", "prompt": "Comment number 8: tighten this copy", "selector": "body > main > div:nth-of-type(1) > p", "tag": "p", "text": "Some paragraph text here"}, {"uid": "9", "prompt": "Comment number 9: tighten this copy", "selector": "body > main > div:nth-of-type(1) > p", "tag": "p", "text": "Some paragraph text here"}, {"uid": "10", "prompt": "Clarify where the AI runs", "selector": "table td:nth-of-type(1)", "tag": "td", "text": "Private", "target": {"type": "table-cell", "selector": "table td:nth-of-type(1)", "rowLabel": "Private", "columnLabel": "Where the AI runs", "text": "Private"}}, {"uid": "11", "prompt": "reword this", "selector": "main p", "tag": "p", "text": "paragraph text", "target": {"type": "text-range", "text": "paragraph text", "start": {"selector": "main > p", "path": [0, 1], "offset": 5}, "end": {"selector": "main > p", "path": [0, 1], "offset": 19}}}, {"prompt": "Overall looks good, ship it after fixes", "tag": "message", "text": "Freeform message"}]}
- Outcome: ⚠️ 1 info across 1 run (13m43s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ bin/fm-procevent-lavish.sh:729 - When a block has more items than its header declares, the extras are dropped and the read still says complete: yes. Both the new list path (line 729) and the tabular path (line 691) stop reading at want items. Reproduced: prompts[1]: followed by two - uid: items gives presented_items: 1 and complete: 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 that complete: yes means everything was presented. Fix: keep scanning after want items, and if any further item or row exists, count it as malformed or set unparsed so the verdict becomes complete: no.
⚠️ **Test** - 1 info
  • ℹ️ tests/fm-procevent.test.sh:5128 - On macOS the test file stops at line 5128 with setsid: command not found (draining-holder fixture), because macOS has no setsid binary. 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 as perl -e &#39;use POSIX; setsid(); exec @ARGV&#39; sleep 60 &amp;.
  • 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 own POST /api/&lt;key&gt;/prompts endpoint: 9 element comments, 1 table-cell target, 1 text-range target with nested start/end path arrays, and 1 freeform tag: message
  • lavish-axi poll board.html --timeout-ms 20000 returned the real list-shaped prompts[12]: result
  • bin/fm-procevent-lavish.sh read poll-result.txt on the target commit
  • Same read using bin/ from base commit 89e14597 (git archive into a temp dir), which reproduced the reported bug
  • bin/fm-procevent-lavish.sh classify and silent on the live capture
  • bash 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 on setsid: command not found
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…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.
@demy00
demy00 changed the base branch from main to feature/fm-upstream-sync September 30, 2026 20:40
@demy00
demy00 merged commit e5d238f into feature/fm-upstream-sync Oct 1, 2026
demy00 added a commit that referenced this pull request Oct 1, 2026
Land the Lavish fix (#4) and the ClickUp skill (#6) on main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant