Skip to content

feat(snapshot): expose structured asks and working, landed, and parked page fields - #6717

Open
dsdevq wants to merge 8 commits into
kunchenguid:mainfrom
dsdevq:fm/fm-upstream-snapshot-fields
Open

dsdevq wants to merge 8 commits into
kunchenguid:mainfrom
dsdevq:fm/fm-upstream-snapshot-fields

Conversation

@dsdevq

@dsdevq dsdevq commented Oct 6, 2026 •

Copy link
Copy Markdown

Intent

Extend bin/fm-fleet-snapshot.sh so a fleet page can render four sections - real asks, working, landed, parked - from structured fields without parsing prose. This is step 4 of the dashboard fleet-layout investigation; its substance:

  1. Real asks. decisions_open[] today is every captain hold with hold_bucket == "live" (rows {id,key,verb,summary,reason,hold_until,hold_bucket,hold_age_days,source}). "Live" means "not dated and not blocked", not "a question is waiting": on 2026-10-05 all 17 entries were parked items whose restart condition is something other than the captain's answer. Needed: an ask object present only when the restart condition is the captain's answer - {question, options[{id,label,recommended}], free_text_allowed, link}, the shape of decision contract v1 (feat(notify-relay): typed decision contract with one push per decision id lifekit-hq/lifekit-stack#290) - with decisions_open keeping only rows that carry one. The snapshot's own rule stands: no hold reason or body prose is ever matched, so the ask comes from structured data written at hold time by the existing captain-hold owner; choosing that field is part of this task. If narrowing decisions_open would hide existing holds from current consumers (Bearings, the parent fleet view), keep decisions_open as it is and expose asks additively (ask on the row plus a count), and say in the PR which was chosen and why.
  2. Working. active_children[] today is {id,name,kind,repo,state,doing,source}; name is work.title cut to 70 characters and carries conventional-commit prefixes; doing is current_state.detail. Needed per child: title_plain (no prefixes, ids, kinds or status words; never cut mid-word), since_epoch, produces (pr|report|landing), open_url (the linked issue now, the PR once it exists, the board for a scout). kind and doing stay.
  3. Landed. landed[] today is {id,title,kind,completion,hold_kind,local_note,pr_url,report_path}. Needed: project, title_plain, and open_url by the same rule (nothing invented when there is no link).
  4. Parked. holds[] today is {id,title,reason,blocked_by,blocked_by_ids,unresolved_blocker_ids,source}, capped at 20 while counts.holds reports the real number. Needed: restart {kind: proposals|captain_word|date|after_work|event, until?, blocker_ids?, text} decided only from structured fields (hold_until and unresolved_blocker_ids already cover date and after_work; a kind structured fields cannot prove is never guessed from prose), the correct total beside the capped list, project, title_plain.
  5. Bump the schema id of every object whose shape changes, and add tests to the suite bin/fm-test-run.sh runs (tests/fm-fleet-snapshot-view.test.sh is the neighbour).

Out of scope: the lifekit-stack publisher (board link from the hold binding, serving reports as URLs), the dashboard page itself, and any change to how holds are bucketed.

On the maintainer's two questions on #6717 (mixed v1/v2 upgrade order; describing the ask shape without depending on lifekit-stack), answered 2026-10-07: "1. yes. 2. yes". That accepts both recommendations: keep the v2 snapshot and home-summary format with readers accepting v1 and v2, and document that the parent upgrades first; reword the ask shape in the doc so it stands on its own, without depending on lifekit-stack; then reply on the PR to those two questions as recommended, in the project's own voice, with no agent names.

What Changed

  • fm-captain-hold.sh hold accepts a new --ask-file option. It validates and normalizes a structured ask (question, options[{id,label,recommended}], free_text_allowed, link) and stores it on a Captain hold ask: body line. The ask is tied to one hold lifecycle: repeating an active hold keeps it, a new lifecycle drops it, and a refused hold restores the previous line. The ask's shape and storage are defined only in the new bin/fm-hold-ask-lib.sh.
  • The fleet snapshot is now fm-fleet-snapshot.v2 and the home summary is now fm-secondmate-home-summary.v2. The snapshot reads the ask back without parsing any prose. decisions_open still lists every live hold, and each row now carries ask (or null), with a new counts.asks. The list is not narrowed to asks because Bearings and the parent fleet view treat it as the live Captain's Call. The summary rows gain new fields:
    • active_children: title_plain, since_epoch, produces, open_url
    • landed: project, title_plain, open_url
    • holds: project, title_plain, and a structured-only restart {kind,until?,blocker_ids?,text}. proposals is reserved and never emitted. The capped holds list reports its real total and adds an omitted entry when rows are cut.
  • Readers (fm-fleet-snapshot.sh, fm-home-summary-refresh.sh, fm-secondmate-reconcile.sh) now accept both v1 and v2 documents. Mixed-version fleets must upgrade the parent home first, and the docs say so. The docs also describe the ask shape on its own terms, cover the new lib, and update the schema ids. New regression tests cover ask lifecycle, page fields, and child-state restart rows. fm-test-run.sh routes the new lib to its test families, and the CI snapshot test count goes from 18 to 20.

Risk Assessment

✅ Low: The new fields are additive, decided only from structured state, and covered by tests that run the script. The latest commits only add a case-insensitive status-word strip and doc wording, and the v1/v2 compatibility window and parent-first upgrade order follow the user's recorded decisions.

Testing

I ran the four targeted suites for the snapshot, hold-ask, home-summary and reconcile paths, and all pass. I also ran the real fm-fleet-snapshot.sh --secondmate-home-summary on the page-fields fixture and saved its JSON as evidence. The output matches the intent: - Asks: only the hold with a valid stored ask line gets an ask object. Options stay in the order the hold author wrote them, and counts.asks is 1. decisions_open still lists every live hold, so asks are added alongside rather than replacing anything. - Working: each child has title_plain (prefixes and status words removed), since_epoch, produces (pr, report or landing) and open_url (the issue, or the PR once one exists). A scout with no linked issue or PR has a null link, as agreed earlier. - Landed: rows carry project and title_plain, and open_url is filled only when a link is recorded. - Parked: restart.kind is one of captain_word, date, after_work or event, and is null where no structured field proves it. The capped list of 3 still reports the real total of 9, with 6 marked as omitted. This is a JSON producer with no rendered page, so the evidence is the emitted JSON rather than screenshots. The PR reply to the maintainer's two questions is a delivery step outside this test phase, so I did not check it.

Evidence: Page-field view of the emitted v2 home summary (asks, working, landed, parked, capped total)

Source: Page-field view of the emitted v2 home summary (asks, working, landed, parked, capped total)

{
  "schema": "fm-secondmate-home-summary.v2",
  "counts": {
    "active_children": 3,
    "decisions_open": 3,
    "asks": 1,
    "holds": 9,
    "queued": 7,
    "landed": 3,
    "endpoints": 5
  },
  "decisions_open": [
    {
      "id": "ask-hold",
      "hold_bucket": "live",
      "ask": {
        "link": "https://board.example/session/b1",
        "question": "Which export format ships first?",
        "free_text_allowed": true,
        "options": [
          {
            "recommended": false,
            "id": "csv",
            "label": "CSV"
          },
          {
            "recommended": true,
            "id": "json",
            "label": "JSON"
          }
        ]
      }
    },
    {
      "id": "plain-hold",
      "hold_bucket": "live",
      "ask": null
    },
    {
      "id": "bad-ask-hold",
      "hold_bucket": "live",
      "ask": null
    }
  ],
  "active_children": [
    {
      "id": "ship-a",
      "name": "feat(api): ship-a Export widget for the dashboard page",
      "title_plain": "Export widget for the dashboard page",
      "kind": "ship",
      "since_epoch": 1783000000,
      "produces": "pr",
      "open_url": "https://github.com/o/alpha/issues/12"
    },
    {
      "id": "scout-b",
      "name": "SCOUT alpha: investigate the flaky upload path",
      "title_plain": "investigate the flaky upload path",
      "kind": "scout",
      "since_epoch": 1783468800,
      "produces": "report",
      "open_url": null
    },
    {
      "id": "local-c",
      "name": "fix: Local landing for alpha/beta",
      "title_plain": "Local landing for alpha/beta",
      "kind": "ship",
      "since_epoch": 1783555200,
      "produces": "landing",
      "open_url": "https://github.com/o/alpha/pull/44"
    }
  ],
  "landed": [
    {
      "id": "done-pr",
      "project": "alpha",
      "title_plain": "Speed up the lint lane",
      "open_url": "https://github.com/o/alpha/pull/7",
      "report_path": null
    },
    {
      "id": "done-issue",
      "project": "beta",
      "title_plain": "Close the audit gap",
      "open_url": "https://github.com/o/alpha/issues/3",
      "report_path": null
    },
    {
      "id": "done-scout",
      "project": "alpha",
      "title_plain": "Scout the cache",
      "open_url": null,
      "report_path": "data/done-scout/report.md"
    }
  ],
  "holds": [
    {
      "id": "ask-hold",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Choose the export format",
      "restart": {
        "kind": "captain_word",
        "text": "Options: CSV or JSON?"
      }
    },
    {
      "id": "plain-hold",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Which route should we take?",
      "restart": {
        "kind": null,
        "text": "Pick A or B - recommended A"
      }
    },
    {
      "id": "bad-ask-hold",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Reserved answer id",
      "restart": {
        "kind": null,
        "text": "choose"
      }
    },
    {
      "id": "dated-ask",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Revisit the export later",
      "restart": {
        "kind": "date",
        "until": "2026-12-01",
        "text": "revisit later"
      }
    },
    {
      "id": "after-hold",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Follow-up after the widget",
      "restart": {
        "kind": "after_work",
        "blocker_ids": [
          "ship-a"
        ],
        "text": null
      }
    },
    {
      "id": "vendor-hold",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Vendor reply needed",
      "restart": {
        "kind": "event",
        "text": "vendor replies"
      }
    },
    {
      "id": "parked-hold",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Parked idea",
      "restart": {
        "kind": null,
        "text": "later maybe"
      }
    },
    {
      "id": "paused-d",
      "source": "child-state",
      "project": "alpha",
      "title_plain": "Wait for the vendor window",
      "restart": {
        "kind": "event",
        "text": "waiting for the vendor window"
      }
    },
    {
      "id": "blocked-e",
      "source": "child-state",
      "project": "alpha",
      "title_plain": "Wire the widget into the page",
      "restart": {
        "kind": "after_work",
        "blocker_ids": [
          "ship-a"
        ],
        "text": "waiting for ship-a to land"
      }
    }
  ],
  "capped_run": {
    "holds_listed": 3,
    "counts_holds": 9,
    "omitted": [
      {
        "surface": "holds",
        "count": 6
      },
      {
        "surface": "queued",
        "count": 4
      }
    ]
  }
}
Evidence: Full fm-secondmate-home-summary.v2 document emitted for the page-fields fixture

Source: Full fm-secondmate-home-summary.v2 document emitted for the page-fields fixture

{
  "schema": "fm-secondmate-home-summary.v2",
  "hold_classifier_schema": "fm-captain-hold-buckets.v1",
  "contributions": {
    "known": 4,
    "checked": 0,
    "counts": {
      "captain": 0,
      "fleet": 4,
      "maintainer": 0,
      "nobody": 0
    },
    "unmeasured": 0,
    "complete": false,
    "proven_clear": false,
    "stale_verdicts": 0,
    "missing_verdicts": 0,
    "unreadable_records": 0,
    "valid_until": 900,
    "captain": [],
    "captain_omitted": 0
  },
  "generated": "2026-07-25T00:00:00Z",
  "generated_epoch": 1784937600,
  "home": "/tmp/fm-fleet-snapshot.Xiu9ak/summary-page-fields",
  "valid": true,
  "reason": null,
  "invalidity": {
    "kind": null,
    "ids": []
  },
  "state": "captain_decision",
  "active_children": [
    {
      "id": "ship-a",
      "kind": "ship",
      "state": "working",
      "repo": "alpha",
      "name": "feat(api): ship-a Export widget for the dashboard page",
      "source": "pane",
      "doing": "harness busy (claude-hook)",
      "title_plain": "Export widget for the dashboard page",
      "since_epoch": 1783000000,
      "produces": "pr",
      "open_url": "https://github.com/o/alpha/issues/12"
    },
    {
      "id": "scout-b",
      "kind": "scout",
      "state": "working",
      "repo": "alpha",
      "name": "SCOUT alpha: investigate the flaky upload path",
      "source": "pane",
      "doing": "harness busy (claude-hook)",
      "title_plain": "investigate the flaky upload path",
      "since_epoch": 1783468800,
      "produces": "report",
      "open_url": null
    },
    {
      "id": "local-c",
      "kind": "ship",
      "state": "working",
      "repo": "alpha",
      "name": "fix: Local landing for alpha/beta",
      "source": "pane",
      "doing": "harness busy (claude-hook)",
      "title_plain": "Local landing for alpha/beta",
      "since_epoch": 1783555200,
      "produces": "landing",
      "open_url": "https://github.com/o/alpha/pull/44"
    }
  ],
  "decisions_open": [
    {
      "id": "ask-hold",
      "key": "ask-hold",
      "verb": "captain-hold",
      "summary": "Choose the export format",
      "reason": "Options: CSV or JSON?",
      "hold_until": null,
      "hold_bucket": "live",
      "hold_age_days": 5,
      "source": "backlog",
      "ask": {
        "link": "https://board.example/session/b1",
        "question": "Which export format ships first?",
        "free_text_allowed": true,
        "options": [
          {
            "recommended": false,
            "id": "csv",
            "label": "CSV"
          },
          {
            "recommended": true,
            "id": "json",
            "label": "JSON"
          }
        ]
      }
    },
    {
      "id": "plain-hold",
      "key": "plain-hold",
      "verb": "captain-hold",
      "summary": "Which route should we take?",
      "reason": "Pick A or B - recommended A",
      "hold_until": null,
      "hold_bucket": "live",
      "hold_age_days": 5,
      "source": "backlog",
      "ask": null
    },
    {
      "id": "bad-ask-hold",
      "key": "bad-ask-hold",
      "verb": "captain-hold",
      "summary": "Reserved answer id",
      "reason": "choose",
      "hold_until": null,
      "hold_bucket": "live",
      "hold_age_days": 5,
      "source": "backlog",
      "ask": null
    }
  ],
  "holds": [
    {
      "id": "ask-hold",
      "title": "Choose the export format",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "reason": "Options: CSV or JSON?",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Choose the export format",
      "restart": {
        "kind": "captain_word",
        "text": "Options: CSV or JSON?"
      }
    },
    {
      "id": "plain-hold",
      "title": "Which route should we take?",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "reason": "Pick A or B - recommended A",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Which route should we take?",
      "restart": {
        "kind": null,
        "text": "Pick A or B - recommended A"
      }
    },
    {
      "id": "bad-ask-hold",
      "title": "Reserved answer id",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "reason": "choose",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Reserved answer id",
      "restart": {
        "kind": null,
        "text": "choose"
      }
    },
    {
      "id": "dated-ask",
      "title": "Revisit the export later",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "reason": "revisit later",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Revisit the export later",
      "restart": {
        "kind": "date",
        "until": "2026-12-01",
        "text": "revisit later"
      }
    },
    {
      "id": "after-hold",
      "title": "Follow-up after the widget",
      "blocked_by": "ship-a",
      "blocked_by_ids": [
        "ship-a"
      ],
      "unresolved_blocker_ids": [
        "ship-a"
      ],
      "reason": "blocked",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Follow-up after the widget",
      "restart": {
        "kind": "after_work",
        "blocker_ids": [
          "ship-a"
        ],
        "text": null
      }
    },
    {
      "id": "vendor-hold",
      "title": "Vendor reply needed",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "reason": "vendor replies",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Vendor reply needed",
      "restart": {
        "kind": "event",
        "text": "vendor replies"
      }
    },
    {
      "id": "parked-hold",
      "title": "Parked idea",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "reason": "later maybe",
      "source": "backlog",
      "project": "alpha",
      "title_plain": "Parked idea",
      "restart": {
        "kind": null,
        "text": "later maybe"
      }
    },
    {
      "id": "paused-d",
      "title": "paused-d",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "reason": "waiting for the vendor window",
      "source": "child-state",
      "project": "alpha",
      "title_plain": "Wait for the vendor window",
      "restart": {
        "kind": "event",
        "text": "waiting for the vendor window"
      }
    },
    {
      "id": "blocked-e",
      "title": "blocked-e",
      "blocked_by": "ship-a",
      "blocked_by_ids": [
        "ship-a"
      ],
      "unresolved_blocker_ids": [
        "ship-a"
      ],
      "reason": "waiting for ship-a to land",
      "source": "child-state",
      "project": "alpha",
      "title_plain": "Wire the widget into the page",
      "restart": {
        "kind": "after_work",
        "blocker_ids": [
          "ship-a"
        ],
        "text": "waiting for ship-a to land"
      }
    }
  ],
  "queued": [
    {
      "id": "dated-ask",
      "title": "Revisit the export later",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "blocked_reason": null,
      "hold_reason": "revisit later",
      "hold_kind": "captain",
      "hold_until": "2026-12-01",
      "hold_bucket": "dated",
      "hold_age_days": 5,
      "captain_actionable": false,
      "repo": "alpha",
      "kind": "captain",
      "since": null
    },
    {
      "id": "after-hold",
      "title": "Follow-up after the widget",
      "blocked_by": "ship-a",
      "blocked_by_ids": [
        "ship-a"
      ],
      "unresolved_blocker_ids": [
        "ship-a"
      ],
      "blocked_reason": null,
      "hold_reason": null,
      "hold_kind": null,
      "hold_until": null,
      "hold_bucket": null,
      "hold_age_days": null,
      "captain_actionable": false,
      "repo": "alpha",
      "kind": "ship",
      "since": null
    },
    {
      "id": "vendor-hold",
      "title": "Vendor reply needed",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "blocked_reason": null,
      "hold_reason": "vendor replies",
      "hold_kind": "external",
      "hold_until": null,
      "hold_bucket": null,
      "hold_age_days": null,
      "captain_actionable": false,
      "repo": "alpha",
      "kind": "ship",
      "since": null
    },
    {
      "id": "parked-hold",
      "title": "Parked idea",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "blocked_reason": null,
      "hold_reason": "later maybe",
      "hold_kind": "parked",
      "hold_until": null,
      "hold_bucket": null,
      "hold_age_days": null,
      "captain_actionable": false,
      "repo": "alpha",
      "kind": "ship",
      "since": null
    },
    {
      "id": "ask-hold",
      "title": "Choose the export format",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "blocked_reason": null,
      "hold_reason": "Options: CSV or JSON?",
      "hold_kind": "captain",
      "hold_until": null,
      "hold_bucket": "live",
      "hold_age_days": 5,
      "captain_actionable": true,
      "repo": "alpha",
      "kind": "captain",
      "since": null
    },
    {
      "id": "plain-hold",
      "title": "Which route should we take?",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "blocked_reason": null,
      "hold_reason": "Pick A or B - recommended A",
      "hold_kind": "captain",
      "hold_until": null,
      "hold_bucket": "live",
      "hold_age_days": 5,
      "captain_actionable": true,
      "repo": "alpha",
      "kind": "captain",
      "since": null
    },
    {
      "id": "bad-ask-hold",
      "title": "Reserved answer id",
      "blocked_by": null,
      "blocked_by_ids": [],
      "unresolved_blocker_ids": [],
      "blocked_reason": null,
      "hold_reason": "choose",
      "hold_kind": "captain",
      "hold_until": null,
      "hold_bucket": "live",
      "hold_age_days": 5,
      "captain_actionable": true,
      "repo": "alpha",
      "kind": "captain",
      "since": null
    }
  ],
  "landed": [
    {
      "id": "done-pr",
      "title": "chore(ci): done-pr Speed up the lint lane",
      "kind": "ship",
      "hold_kind": null,
      "pr_url": "https://github.com/o/alpha/pull/7",
      "report_path": null,
      "local_note": null,
      "completion": {
        "verb": "merged",
        "date": "2026-07-06"
      },
      "project": "alpha",
      "title_plain": "Speed up the lint lane",
      "open_url": "https://github.com/o/alpha/pull/7"
    },
    {
      "id": "done-issue",
      "title": "Close the audit gap",
      "kind": "ship",
      "hold_kind": null,
      "pr_url": null,
      "report_path": null,
      "local_note": null,
      "completion": {
        "verb": "done",
        "date": "2026-07-05"
      },
      "project": "beta",
      "title_plain": "Close the audit gap",
      "open_url": "https://github.com/o/alpha/issues/3"
    },
    {
      "id": "done-scout",
      "title": "Scout the cache",
      "kind": "scout",
      "hold_kind": null,
      "pr_url": null,
      "report_path": "data/done-scout/report.md",
      "local_note": null,
      "completion": {
        "date": "2026-07-04",
        "verb": "reported"
      },
      "project": "alpha",
      "title_plain": "Scout the cache",
      "open_url": null
    }
  ],
  "endpoints": [
    {
      "id": "blocked-e",
      "state": "paused",
      "source": "status-log",
      "endpoint": {
        "target": "firstmate:fm-blocked-e",
        "exists": true,
        "agent_alive": "not_checked",
        "status": "unknown",
        "observed_at": "2026-07-25T00:00:00Z",
        "freshness": "fresh"
      }
    },
    {
      "id": "local-c",
      "state": "working",
      "source": "pane",
      "endpoint": {
        "target": "firstmate:fm-local-c",
        "exists": true,
        "agent_alive": "not_checked",
        "status": "unknown",
        "observed_at": "2026-07-25T00:00:00Z",
        "freshness": "fresh"
      }
    },
    {
      "id": "paused-d",
      "state": "paused",
      "source": "status-log",
      "endpoint": {
        "target": "firstmate:fm-paused-d",
        "exists": true,
        "agent_alive": "not_checked",
        "status": "unknown",
        "observed_at": "2026-07-25T00:00:00Z",
        "freshness": "fresh"
      }
    },
    {
      "id": "scout-b",
      "state": "working",
      "source": "pane",
      "endpoint": {
        "target": "firstmate:fm-scout-b",
        "exists": true,
        "agent_alive": "not_checked",
        "status": "unknown",
        "observed_at": "2026-07-25T00:00:00Z",
        "freshness": "fresh"
      }
    },
    {
      "id": "ship-a",
      "state": "working",
      "source": "pane",
      "endpoint": {
        "target": "firstmate:fm-ship-a",
        "exists": true,
        "agent_alive": "not_checked",
        "status": "unknown",
        "observed_at": "2026-07-25T00:00:00Z",
        "freshness": "fresh"
      }
    }
  ],
  "counts": {
    "active_children": 3,
    "decisions_open": 3,
    "asks": 1,
    "holds": 9,
    "queued": 7,
    "landed": 3,
    "endpoints": 5
  },
  "omitted": []
}
Evidence: fm-fleet-snapshot-view test run log

Source: fm-fleet-snapshot-view test run log

ok - empty fleet snapshot and view use explicit absence markers
ok - fixture snapshot covers task rows, backlog rows, pointers, stable ordering, and emission-time event age
ok - home-summary excludes kind=secondmate from unowned_current and terminal_in_flight
ok - undated captain holds age after a configurable threshold, decided only from structured fields
ok - captain-hold buckets are total, mutually exclusive, and never decided by prose
ok - main_inventory discloses orphan/unstructured and clears when inventory is consistent
ok - backlog normalization preserves strict roles and resolves every blocker compatibly
ok - snapshot event hints follow reconciled current state
ok - durable fold keeps an open decision past a later unrelated event
ok - a live secondmate endpoint preserves unrelated open decisions
ok - durable captain-held transfer closes the duplicate live status decision
ok - durable fold clears a decision only on a keyed resolution
ok - a completed scout's stale decision surfaces as a report pointer, not pending
ok - a scout still parked at a decision stays pending (terminal clear does not over-fire)
ok - snapshot includes durable scout reports after teardown
ok - snapshot parses tasks-axi rows and respects operational overrides
ok - fleet view renders the snapshot without secondmate peek guidance
ok - fleet view renders secondmate agent liveness
ok - home summary exposes asks, working, landed, and parked page fields from structured state only
ok - plain titles drop prefixes and status words and are never cut mid-word
Evidence: fm-captain-hold-lifecycle test run log

Source: fm-captain-hold-lifecycle test run log

ok - marked hold reasons round-trip through public reads, fleet, startup, and return without changing other fields
ok - new, active, and released holds require the origin first with and without deferral
ok - historical self-inventories name a workable repair that preserves sibling entries
ok - completion and verification compare backend identities for entries and current or stored origins
ok - complete refuses the origin as its own captain-call inventory
ok - complete refuses an entry held for another origin and flags one with none recorded
ok - report-only unresolved captain call is reproduced and completion refuses before loss
ok - both body-decoding paths work without the allow_nonref default
ok - cleanup preserves every byte of a retained body's non-ASCII characters
ok - the completion gate attests captain-held inventory and transfers open status decisions
ok - answer records the captain's words, closes idempotently, and releases routed work
ok - release frees held work with the captain's words recorded and the body preserved
ok - captain holds become visible only after their hold-set timestamp is durable
ok - an interrupted answer preserves its hold age until close retry
ok - a deferred captain call leaves the live Captain's Call until its date and stays answerable
ok - an out-of-band close is recordable with the captain's word and nothing else
ok - ended visual review follows the same captain-hold completion owner
ok - resolved findings and decision-like prose do not create captain-held tasks
ok - terminal single-owner stale status decisions do not block empty inventory
ok - main-home and secondmate-home captain calls remain correctly routed
ok - a secondmate home publishes each hold occurrence and its answer on the parent channel
ok - secondmate resolutions publish before retiring durable retry triggers
ok - a bound channel's captured answers close their captain-held tasks at answer time
ok - only a bound captured source creates reconcile requests
ok - normal answers and their replays retire reconcile requests
ok - reconcile closes a moot call with evidence and keeps an active one open with a note
ok - reconcile outcomes apply durable mutations once across partial failures
ok - a channel source with no decision binding closes nothing
ok - legacy identities, metadata, bindings, and the shim keep working
ok - a board answer reaches the keyed-answer intake and wakes firstmate
ok - the chat channel feeds the same keyed-answer intake a captured review does
ok - completion and verification validate origins before constructing paths
ok - a status resolution over a still-open captain-held task is signalled, not closed
ok - a captain call with no routed work, a verified transfer, an open decision, and an answered call all stay silent
ok - cleanup leaves a captain-held work item open with its deliverable, and only an answer closes it
ok - release and scout report retention distinguish deliveries from rejected merge answers
ok - an interrupted cleanup keeps the captain call recoverable and session start retains it
ok - an answer before cleanup replay preserves the retained report
ok - an answer before cleanup replay notes the retained Gerrit change
ok - an unusable pending-close record names its reason instead of a bare refusal
ok - an unsupported relocated report does not wedge the captain's answer
ok - cleanup retains captain calls in the configured backlog
ok - cleanup keeps a captain-held Gerrit task open and records its change URL
ok - merge approval releases before zero-retention cleanup records completion
ok - the PR merge entrypoint refuses a captain-held task before merging
ok - the local merge entrypoint refuses a captain-held task before merging
ok - the PR merge entrypoint separates an unreadable authority record from an absent one
ok - the local merge entrypoint separates an unreadable authority record from an absent one
ok - merge entrypoints reject unsafe identities and absent state before locking
ok - merge entrypoints refuse a replacement incarnation after waiting for cleanup
ok - merge entrypoints own task state before forced cleanup can retire it
ok - a released merge passes the guarded entrypoint and remains recently landed
ok - cleanup refuses a ship row when its captain hold cannot be read
ok - skipped on markdown-only tasks-axi: verify against a beads-migrated hold
ok - skipped on markdown-only tasks-axi: verify against a prefix-migrated hold
ok - skipped on markdown-only tasks-axi: prefer a marker-noted row over a prefix namesake
ok - skipped on markdown-only tasks-axi: complete against a beads-migrated hold
ok - skipped on markdown-only tasks-axi: verify an unresolvable beads legacy id
ok - skipped on markdown-only tasks-axi: verify a derived pre-collapse key
ok - captain-hold mutations address the beads backend without a markdown override
ok - skipped on markdown-only tasks-axi: captain-hold create under due.required without types.custom
ok - a hold ask is validated, kept within its lifecycle, and restored when the hold is refused

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 tests/fm-fleet-snapshot-view.test.sh (20 ok, including the page-fields test, the word-boundary plain-title test, and the child-state blocker regression)
  • bash tests/fm-captain-hold-lifecycle.test.sh (62 ok, including the test that validates the hold ask, keeps it through the hold's lifecycle and restores it when the hold is refused, with the multi-document and boolean-link refusal cases)
  • bash tests/fm-home-summary-refresh.test.sh (21 ok; its 'Terminated' lines come from the timeout cases that end workers on purpose)
  • bash tests/fm-secondmate-reconcile.test.sh (22 ok; it reads both v1 and v2 snapshots)
  • Manual end-to-end check: ran the fixture from test_home_summary_page_fields_come_from_structured_state through a temp copy of the test (outside the worktree) with bin/fm-fleet-snapshot.sh --secondmate-home-summary wrapped in a tee, then pulled the page fields out with jq
  • Read commit 7e713840: the bin/fm-fleet-snapshot.sh header says the parent home upgrades first, and the ask shape in bin/fm-hold-ask-lib.sh is now described without pointing at lifekit-stack
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Adds structured ask fields to fleet snapshot and home summary schemas.

The PR appears safe to merge, with no outstanding findings.

Reviews (4) · Last reviewed commit: "docs(snapshot): state parent-first upgra..." · Reviewed by Greptile

Comment thread bin/fm-fleet-snapshot.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Status: waiting on CI, then a captain decision · contract-class: new-default · head 87d61517

Thank you for this. The ask is stored as structured data, never guessed from prose, decisions_open is kept as it was with the new fields added beside it, and the Greptile blocker-detail fix landed with a regression test. The no-mistakes attestation matches this head and Greptile's latest review is clean.

CI: I approved the fork workflow runs at this head (CI 37513771420; no-mistakes 37513771472, 37513773092, 37525893476). Nothing is needed from you unless they come back red.

On the class: --ask-file is opt-in, but every home's snapshot and home summary change shape and move to fm-fleet-snapshot.v2 / fm-secondmate-home-summary.v2 by default. That's a new default-on fleet/Bearings projection, so this is new-default. Once CI is green it goes to Kun for a decision instead of auto-merge, and that part is on him, not you.

Two things the decision will weigh, worth a sentence from you if you have one (not blocking):

  1. Mixed versions: new readers accept v1 or v2, but a parent still on older code checks .schema == "fm-secondmate-home-summary.v1", so it would treat an upgraded child's summary as invalid until the parent upgrades too. Is that upgrade order acceptable, or should the child keep publishing v1 for a while?
  2. Generic surface: the ask shape follows an external project's decision contract (lifekit-stack). It's fine if that shape stands on its own, but the shared surface should stay generic, so the doc should describe it without depending on that repo.

VISION.md per-rule: One captain, one interface: aligns (a fleet page can show real asks without parsing prose). Authority explicit: aligns (an ask exists only when written at hold time). Scripts/agents split: aligns (structured fields, no prose matching). Restart is a non-event: cannot tell (the v1/v2 mixed-version window above). Delegation with a spine: n/a. Outlives any vendor: aligns. Scope: cannot tell (shared surface shaped by one home's external dashboard contract; default-on schema bump, while presentation features are expected to be opt-in).

dsdevq added 7 commits October 7, 2026 08:20
…age fields

Record a validated ask at captain-hold time (hold --ask-file, owned by
bin/fm-hold-ask-lib.sh) and surface it in the fleet snapshot only while the
captain's answer is what restarts the work. Add title_plain, since_epoch,
produces, and open_url to active children; project, title_plain, and open_url
to landed rows; project, title_plain, and a structured restart condition to
holds, plus an omitted entry when the holds list is capped. decisions_open
keeps every live hold and gains the ask additively with counts.asks.

Bump fm-secondmate-home-summary to v2 and fm-fleet-snapshot to v2; parents and
the reconcile intake still accept v1 documents.
… CI and "Require no-mistakes" never ran. Both runs (37511816384, 37511816605) completed with conclusion `action_required` and zero jobs. The PR is cross-repository (dsdevq fork into kunchenguid/firstmate), so the workflows await maintainer approval. Not caused by this PR's code; no code change applies. 2. Greptile Review failed on one P2 comment at bin/fm-fleet-snapshot.sh:1194, and it was correct. The child-state parked row for an in-flight paused/parked/blocked child evaluated `restart` on `{}` instead of the backlog row `$work`, and hard-coded `blocked_by:null, blocked_by_ids:[], unresolved_blocker_ids:[]`. A paused child with a recorded unresolved blocker therefore reported `restart.kind: "event"` (and a blocked one `null`) with empty blocker fields, so the fleet page could not show which work must finish first. Reproduced with a new fixture before fixing. Fix (bin/fm-fleet-snapshot.sh, child-state branch of $holds_all): source `blocked_by`, `blocked_by_ids`, `unresolved_blocker_ids`, and `restart` from `$work`, matching the backlog-row branch. Fixing restart alone would have left the row contradicting itself (empty unresolved_blocker_ids beside restart.blocker_ids). The other restart kinds are unaffected: this branch already excludes rows with hold_reason+hold_kind, so `$work.ask` is always null there and date/captain_word/external cannot fire; paused-without-blockers still yields `event`. The header comment already documents after_work for unresolved blockers, so no doc change. No schema shape change (restart and the blocker fields already existed on holds rows), so no schema bump. Regression test (tests/fm-fleet-snapshot-view.test.sh, test_home_summary_page_fields_come_from_structured_state): added in-flight child `blocked-e` with `blocked-by: ship-a`, idle, status `paused: waiting for ship-a to land`; asserts source child-state, restart.kind after_work with blocker_ids ["ship-a"], unresolved_blocker_ids ["ship-a"], blocked_by "ship-a", title_plain. The capped-list totals moved from 8/5 to 9/6. The test failed before the fix (row showed kind event and empty blockers) and passes after. Verification: tests/fm-fleet-snapshot-view.test.sh 20/20 ok; tests/fm-home-summary-refresh.test.sh 21/21 ok; tests/fm-secondmate-reconcile.test.sh 22/22 ok; shellcheck -x on both changed files clean. tests/fm-captain-hold-lifecycle.test.sh was still running in the background when this result was returned; it does not exercise the changed jq branch. Changes are left uncommitted in the worktree for the outer executor
@dsdevq
dsdevq force-pushed the fm/fm-upstream-snapshot-fields branch from 87d6151 to e54693f Compare October 7, 2026 07:49
@dsdevq dsdevq changed the title feat(snapshot): expose structured asks, working, landed, and parked page fields feat(bin): expose structured asks and fleet-page fields in the home summary Oct 7, 2026
@dsdevq dsdevq changed the title feat(bin): expose structured asks and fleet-page fields in the home summary feat(snapshot): expose structured asks and working, landed, and parked page fields Oct 7, 2026
@dsdevq

dsdevq commented Oct 7, 2026

Copy link
Copy Markdown
Author

Thanks for the two questions.

  1. Mixed versions: keeping v2. Readers accept both v1 and v2, so the upgrade order is parent home first; an older parent reports an upgraded child's v2 summary as unavailable until it upgrades too. That order is now documented in the bin/fm-fleet-snapshot.sh header (7e71384).
  2. Generic surface: the bin/fm-hold-ask-lib.sh header now describes the ask shape on its own terms - question, options of {id,label,recommended}, free_text_allowed, and an optional link - with no dependency on or reference to an external project.

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.

2 participants