Repository navigation
fix: parse list-form Lavish results without dropping answers - #5404
Conversation
Lavish emits its queued prompts in TOON list form instead of table form as soon as the items stop being uniform, for example when some annotations carry a nested target object or a message carries an attachments table. The adapter only recognized the table header, so read reported a complete, empty result and answers closed nothing. Move the result parsing into one shared reader used by read, answers, and reconciles that accepts both forms, keeps only column-zero headers, skips nested structures only beneath the field that opened them, and counts anything it cannot account for as malformed. An unrecognized header naming the block is now malformed rather than an empty result, answers and reconciles exit nonzero when the result is not fully accounted for, and the queued-content check treats a list header as content. Refs kunchenguid#4726
|
Speaking as Kun's firstmate: thanks @arthurcruzd for bringing this up to date with main today. My read (own verdict):
Status: waiting on CI only. If CI and no-mistakes come back green and it stays mergeable, I'll squash-merge on the next pass, which should also close #4726. |
|
CI and the no-mistakes check have been green at head 8e61c71 since the 2026-10-12 triage pass, and the PR is still cleanly mergeable on main 33503ab. The bug still reproduces on main: a board whose prompts come back in list form (for example an annotation on a table cell) reads as 0 items. Is anything further needed here? |
|
Speaking as Kun's firstmate: this is merged. Thank you @arthurcruzd — really appreciate you taking the time on this. (And thanks @sbocz for the nudge.) Re-checked at head |
Main landed its own shared list-form Lavish reader (kunchenguid#5404), which replaces this branch's parser. Every conflict in bin/fm-procevent-lavish.sh and tests/fm-procevent.test.sh resolves to main's version. Main's reader still read lavish-axi's inline empty array, `prompts: []`, as an unrecognized header and certified the result incomplete; it now reads as a complete empty list. Kept from this branch: the fm-lint.sh locale fix and its test, the macOS setsid portability fix, and the Lavish cases main's tests lacked (the sanitized lavish-axi 0.1.87 capture, nested target keys that mimic item fields, unrecognized headers, the empty array, and list-form silence).
## Conflict resolutions The trial merge listed 13 conflicted files; the actual merge also conflicts in `tests/fm-procevent.test.sh` (14 total). | File | Fork origin | Resolution | | --- | --- | --- | | `.agents/skills/agent-skill-trigger-index/SKILL.md` | 09efd59 (#6, clickup-tickets) | Fork's `clickup-tickets` trigger line re-added to upstream's list unchanged. | | `AGENTS.md` | 3843b2c (#8, skill selection); 89e1459 (#3, `feature/` prefix) | Fork's `fm-skill-select.sh --apply` line and the `feature/` default wording re-applied on upstream's new section 7 text (upstream added `--base-branch` and self-repo consent lines next to it; both kept). | | `README.md` | 89e1459 (#3), via earlier fork syncs | Default ship-branch prefix wording stays `feature/` in upstream's rewritten bullet. | | `bin/fm-captain-hold.sh` | 999f9d8 (#1, done-archive evidence) | Fork's done-archive lookup re-applied unchanged on upstream's version. | | `bin/fm-dod-lib.sh` | 89e1459 (#3), 16cc4bd | Upstream's new base-branch/forge/consent code kept; its two `fm/$id` defaults now call `fm_task_branch` and the lib sources `fm-task-branch-lib.sh`, as the fork did before. | | `bin/fm-procevent-lavish.sh` | 826e32b, 79d101b, d0ac8f4, cbfb295 (#7) | True clash, decided by the captain (option A) - see below. | | `bin/fm-spawn.sh` | 89e1459 (#3), 16cc4bd, b7edc11, 153f4e2, de04c2d | Fork's `feature/` branch naming and legacy-brief branch binding re-applied unchanged on upstream's version. | | `bin/fm-timeout-lib.sh` | 9e8b923 (bash without `BASHPID`) | Upstream fixed the same macOS bash 3.2 bug independently (5838f10, kunchenguid#6028, perl watchdog takes the pre-exec parent). Took upstream's code; the fork's regression test for it is kept and passes on upstream's fix. | | `docs/architecture.md` | 89e1459 (#3) | `feature/` default and the `fm-task-branch-lib.sh` ownership line re-applied. | | `tests/fm-brief.test.sh` | 89e1459 (#3), via earlier fork syncs | Expected branch names stay `feature/<id>` in upstream's updated cases. | | `tests/fm-calm-pi-extension.test.sh` | bc3f178 (#10), 1757302 (#8 CI fix) | Upstream fixed the `/reload` geometry flake its own way (`wait_for_geometry_reload` on a durable status row), so the fork's `pipe-pane` version is dropped. Kept the fork's lookup-counting export renderer, the report-based Chrome hang attempt check, and the `tuiMode: regular` settings pin next to upstream's `--tui-mode regular` flag. | | `tests/fm-procevent.test.sh` | #7 | Both test sets kept; see the Lavish decision. | | `tests/fm-review-diff.test.sh` | 89e1459 (#3) | Fork's two unrecorded-`feature/` branch cases re-added; case letters shifted after upstream's new cases. | | `tests/fm-timeout-lib.test.sh` | 9e8b923 | Fork's no-`BASHPID` test kept on top of upstream's tests. | ## Decision: Lavish list-form parser (captain chose option A) Both sides fixed the same bug: Lavish emits queued feedback as a TOON list (not a table) when items carry nested content, and the adapter read it as an empty, complete result. - Fork (#7): one parser that flattens and presents every nested field (table-cell `target:`, `attachments:`, other `fields:`, message uid/selector/text), adds `unpresented_items:`, and refuses `complete: yes` when nested content cannot be parsed. - Upstream (fc8972c, kunchenguid#5404): one parser that skips nested targets and attachments; its tests assert nested content is absent from `read`. It also adds stricter refusals (unrecognized header keeps its declared count and counts as malformed; `answers`/`reconciles` exit 3 when not fully accounted for), and 228b27d renames the message count to `captain_message_count`. Options: - **A (chosen):** keep the fork's presenting parser, port upstream's strictness onto it (declared count + malformed on an unrecognized header, `answers`/`reconciles` exit 3, `captain_message_count`), keep both test sets, and adapt upstream's three "absent" assertions to check nested content appears only under its own labelled section and never replaces the item's own text. Cost: this region will likely conflict again on the next upstream sync. - **B:** take upstream's parser and tests wholesale and drop the fork's nested presentation. Cost: Lavish reads lose table-cell location, text-selection range, and image attachment paths.
Intent
Contribute the upstream fix for kunchenguid/firstmate issue #4726 as a pull request from the fork.
Issue #4726: when a Lavish result is emitted in list form (
prompts[N]:followed by- uid: ...entries) instead of the table form (prompts[N]{uid,prompt,selector,tag,text}:),bin/fm-procevent-lavish.sh readprints declared_items 0, presented_items 0, complete: yes, andanswerscloses nothing, so the captain's board answers are silently dropped. Expected:readandanswersparse both emission forms, or refuse loudly with malformed_items > 0 rather than reporting a complete empty result; a feedback result whose raw prompts[N] header declares N > 0 while the parser finds 0 must never print complete: yes.Reproduced on 2026-09-23 with lavish-axi 0.1.68 without any attachment: 6 of 19 prompt rows carried an extra
targetfield, the rows were no longer uniform, and lavish-axi used the list form. A real captured example is at ~/fm-homes/primary/data/fm-lavish-list-form/sample-list-form.result (private board content; use it to understand the shape, but build any committed test fixture from synthetic text, never from this file).What Changed
read,answers, andreconciles, retaining item fields while skipping nested targets and attachments.Risk Assessment
✅ Low: The bounded parser fix supports both capture forms, preserves existing intake controls, and introduces no substantiated material defects or unnecessary components.
Testing
Focused regressions and live Lavish API-to-CLI scenarios passed, with before/after product transcripts retained. Browser startup failed, so no screenshot was captured; validation covered the changed parser interface through real server output. Disposable resources were cleaned up.
Evidence: Real Lavish captures, extracted answers, malformed-input refusals, and base regression
Source: Real Lavish captures, extracted answers, malformed-input refusals, and base regression
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash .test-lavish/focused.sh— focused existing read/answers regression casespython3 .test-lavish/live.py— isolated Lavish API submission, real CLI polling, read/answers/reconciles checks, and corrupted-capture rejectionExecuted base-commit read and answers commands against the freshly generated list-form captureAttempted isolatedchrome-devtools-axi open about:blank; browser startup failed with BRIDGE_NOT_READYStopped the isolated server, removed temporary files, and verified a clean working tree✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.