Skip to content

feat(bearings): support dated Captain's Call deferrals - #8449

Open
mehulbhagwani wants to merge 8 commits into
kunchenguid:mainfrom
mehulbhagwani:fm/fm-board-later-defer
Open

mehulbhagwani wants to merge 8 commits into
kunchenguid:mainfrom
mehulbhagwani:fm/fm-board-later-defer

Conversation

@mehulbhagwani

@mehulbhagwani mehulbhagwani commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7854

Intent

Let a Bearings decision use a future UTC deferral date without losing the original question or creating an unsafe release race.

What Changed

  • Add structured defer_until support to Bearings decision cards, validating future UTC dates and carrying the selected date through rendered board submissions.
  • Re-hold deferred captain decisions through the keyed-answer intake while preserving their original question, options, and hold timestamp; invalidate stale PR settlement policies and guard against concurrent releases.
  • Update lifecycle documentation and expand board rendering, payload validation, and captain-hold regression coverage.

Risk Assessment

✅ Low: The change is bounded to structured board deferral transport, locked hold mutation, policy invalidation ordering, and corresponding documentation/tests; no source-verifiable material defect was found.

Testing

Ran the focused captain-hold lifecycle suite and a live disposable-home adversarial check; all derived deferral scenarios passed, with reviewer-visible evidence showing policy preservation after failed re-hold.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Board later answer preserves the captain hold and invalidates stale settlement policy ✅ pass live bash tests/fm-captain-hold-lifecycle.test.sh (tests test_board_later_answer_keeps_the_original_hold and test_board_deferral_invalidates_pr_policy)
Failed re-hold does not destroy the existing PR settlement policy ✅ pass live ~/.no-mistakes/evidence/01M8CZACTC9E9A4JR5WA5674H2/deferral-policy-ordering.txt
Invalid or stale deferrals are refused without changing task state ✅ pass live bash tests/fm-captain-hold-lifecycle.test.sh (invalid-date and concurrent-release portions of test_board_later_answer_keeps_the_original_hold and `test_board_deferral_rechecks_hold_after_concurren…
Evidence: Deferral policy ordering evidence

Source: Deferral policy ordering evidence

Live disposable-home transcript proving a simulated tasks-axi hold failure leaves the existing hold-pr-policy.json present and the task still captain-held.

=== live deferral ordering check ===
fixture: disposable markdown tasks-axi home
answer input: live-defer-policy<TAB>later<TAB>Revisit<TAB><TAB>2099-07-20
answers exit=1
skipped: live-defer-policy (simulated transient hold backend failurefm-captain-hold: could not defer task live-defer-policy for the captain)
answers: closed=0 skipped=1
policy before failed re-hold: present=yes
policy after failed re-hold: present=yes
task after failed re-hold:
task:
  id: live-defer-policy
  title: "Choose later https://github.com/sample/sample/pull/42"
  state: queued
  blocked: no
  blocked_by: none
  held: yes
  hold_reason: "fm-hold-v1:Q2hvb3NlIGEgcm91dGU="
  hold_kind: captain
  hold_until: "-"
  kind: scout
  repo: sample
  priority: "-"
  created: 2026-11-27
  closed: "-"
  deps: none
  links: "pr:https://github.com/sample/sample/pull/42"
  body: "Captain hold set: 2026-11-26T23:08:21Z"

Closes #7854

Pipeline

Updates from git push no-mistakes

⏭️ **Intent** - skipped

Step was skipped.

⚠️ **Rebase** - 1 warning
  • ⚠️ bin/fm-captain-hold.sh - merge conflict rebasing onto origin/main
🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ bin/fm-captain-hold.sh:1582 - The deferral path deletes hold-pr-policy.json before attempting the re-hold. If tasks_axi hold fails (for example a transient backend/write failure), the original captain hold remains unchanged but its valid automatic PR-settlement policy has already been destroyed, so a later merge can no longer settle it. Perform policy invalidation only after the hold mutation succeeds, with an explicit recovery/error path for invalidation failure. The same ordering/invariant is localized here at bin/fm-captain-hold.sh:1582 and the immediately following hold at bin/fm-captain-hold.sh:1584.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
A keyed board deferral re-holds the captain task and invalidates its prior PR settlement policy ✅ pass live board-deferral-policy.log from the focused test_board_deferral_invalidates_pr_policy lifecycle test
A failed re-hold does not destroy the existing PR settlement policy ✅ pass live failed-deferral-preserves-policy.log from an isolated real fm-captain-hold run with tasks-axi hold deliberately failing
  • bash tests/.tmp-captain-hold-target.test.sh running test_board_deferral_invalidates_pr_policy
  • Focused isolated regression driver invoking bin/fm-captain-hold.sh answers with a failing tasks-axi hold backend
  • bash tests/fm-captain-hold-lifecycle.test.sh (broader suite attempted; it exceeded the command budget after progressing through the captain-hold scenarios)

✅ No issues found.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Board later answer preserves the captain hold and invalidates stale settlement policy ✅ pass live bash tests/fm-captain-hold-lifecycle.test.sh (tests test_board_later_answer_keeps_the_original_hold and test_board_deferral_invalidates_pr_policy)
Failed re-hold does not destroy the existing PR settlement policy ✅ pass live ~/.no-mistakes/evidence/01M8CZACTC9E9A4JR5WA5674H2/deferral-policy-ordering.txt
Invalid or stale deferrals are refused without changing task state ✅ pass live bash tests/fm-captain-hold-lifecycle.test.sh (invalid-date and concurrent-release portions of test_board_later_answer_keeps_the_original_hold and `test_board_deferral_rechecks_hold_after_concurren…
  • bash tests/fm-captain-hold-lifecycle.test.sh
  • Disposable-home keyed answers run with an injected transient tasks-axi hold failure and persisted-state inspection
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Reviews (1) · Last reviewed commit: "no-mistakes(lint): Quote done literal to..." · Reviewed by Greptile

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @mehulbhagwani. This is a careful fix for #7854, and the concurrent-release and settlement-policy cases are exactly the edges I'd have asked about. This is my first look.

What I checked on head 37b12587 (vs main 427056c4, 0 behind):

  • I read the whole diff: the bearings and captain-hold-lifecycle skills, the board template, bin/fm-bearings-board.sh, bin/fm-captain-hold.sh, bin/fm-procevent-lavish.sh, docs/captain-hold-lifecycle.md and three test files. It has no workflow, CI-config, network or credential changes.
  • The bug is still real on main. The board's "later" answer goes through answers, which closes the task, and the skill's follow-up hold --until then refuses because the task is already closed.
  • With this head, a decision-card option can carry defer_until. The board validator only accepts it as a future YYYY-MM-DD on decision cards. The Lavish adapter only relays it from a versioned, non-reconcile structured selection, so legacy captures and typed notes can't schedule anything. The intake rechecks that the task is still captain-held under the task lock, keeps the original reason, origin and hold timestamp, and invalidates any PR settlement policy, the same way hold does. Lines without the fifth field behave exactly as on main.
  • Away posture: a dated deferral of a release card keeps the task held, and an undated release line is still refused. That's the conservative direction. A deferral carries no more authority than the close the same board choice could already make.
  • The no-mistakes attestation binds this head with no skipped steps, and live validation is go (10 of 10). "PR must be raised via no-mistakes", the Test coverage guard and Repo invariants pass. Greptile scored it 5/5 with no open threads. Closes #7854 is correct. The one-line CSS wrap fixes a mobile overflow that already exists on main.

contract-class: restore (my own read). The lifecycle skill and docs already promise that a "later" answer keeps the call held and moves it to Charted Next with its date, and on main the board path breaks that promise. No new observer, wake or Bearings surface is added.

VISION.md, rule by rule

  • One captain, one interface: aligns. A deferred call comes back on its date instead of vanishing.
  • Authority is explicit and never inferred: aligns. Only a structured, card-declared option can defer, and prose can't forge a date, task id or mode.
  • Scripts own the mechanics, agents own the judgment: aligns. The agent picks the date when composing the card, and the script validates and applies it exactly.
  • A restart is a non-event: aligns. The deferral is a durable hold with its date, not chat memory.
  • Delegation with a spine: aligns. Settlement policies are invalidated, and a concurrent release wins over a stale deferral.
  • The fleet outlives any vendor: neutral.
  • Scope: aligns. A field failure becomes regression coverage.

Nothing is waiting on you. The red "Full suite" row only means our full-ci label isn't on yet. We're holding new full-suite runs until main's own CI is green again, and once it is, the full suite runs here.

@mehulbhagwani mehulbhagwani changed the title fix(bin): keep deferred bearings decisions held until their date feat: defer captain-held board decisions until a future date Nov 26, 2026
@mehulbhagwani
mehulbhagwani force-pushed the fm/fm-board-later-defer branch from dbc3d93 to 99f7696 Compare November 26, 2026 23:10
@mehulbhagwani mehulbhagwani changed the title feat: defer captain-held board decisions until a future date feat(bearings): support dated Captain's Call deferrals Nov 26, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @mehulbhagwani. I reviewed new head 99f7696b (on main 4ffd3495).

Diff review (stands in for Greptile while it's out): safe, no P1. The deferral path in bin/fm-captain-hold.sh (defer_keyed_answer) takes the task control lock, rechecks under it that the task is still captain-held and open, keeps the original reason, re-holds with --until, and invalidates the PR settlement policy only after the hold succeeds. A failed re-hold leaves the policy in place, and your live transcript shows that. The keyed-answer intake rejects anything that isn't a real future YYYY-MM-DD, the board validator only allows defer_until on decision cards, and the Lavish adapter only relays it from a versioned, non-reconcile selection. No workflow, network or credential changes. Quick checks pass, 0 threads, and it merges cleanly.

Waiting on you for two things:

  1. Re-raise with no skipped steps. The attestation on this head has intent: skipped. Every step has to complete on the head we'd merge, so please push it through git push no-mistakes once more.
  2. Put Closes #7854 back in the description (plain text, not in backticks). The regenerated body dropped it, so the issue wouldn't close on merge.

Contract class: restore, unchanged: the lifecycle docs already promise that a "later" answer keeps the call held and dated. VISION is as in my earlier comment (aligns on every rule). Once it's re-raised cleanly, this gets the full suite and, as a restore, merges after a green run.

@mehulbhagwani

Copy link
Copy Markdown
Contributor Author

Closes #7854 is back at the top of this PR. Head 99f7696b is unchanged. The re-attestation attempt did not update this PR, so the skipped Intent step is still outstanding here.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @mehulbhagwani. Closes #7854 is back as plain text and GitHub now links the issue, so that ask is done.

The other ask is still open. The attestation on 99f7696b still has intent: skipped, and every step has to complete on the head we'd merge. If the re-raise didn't update the PR, it probably didn't reach the end of the pipeline. Please run git push no-mistakes again and check that the PR body's attestation shows every step completed, including intent. If it's the same code, the head can stay the same.

Nothing else has changed. Diff review: safe, no P1 (same head). Quick checks pass, there are no threads, and it merges cleanly onto main 2d15e1b0. Contract class: restore. Once the attestation is clean, this gets the full suite and merges after a green run. Waiting on you: the clean re-raise.

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.

Bearings board "later" answer closes the captain-held task, and the documented hold --until re-hold then refuses

2 participants