Skip to content

docs: make captain-hold-lifecycle easier to read - #5610

Merged
kunchenguid merged 3 commits into
kunchenguid:mainfrom
tmchow:docs/captain-hold-lifecycle-readable
Sep 25, 2026
Merged

kunchenguid merged 3 commits into
kunchenguid:mainfrom
tmchow:docs/captain-hold-lifecycle-readable

Conversation

@tmchow

@tmchow tmchow commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Intent

Improve the kunchenguid/firstmate documentation. Many of the docs are hard to read because they were clearly agent-written. That is not necessarily bad, but some docs are almost impossible for a human to understand.
Give docs/captain-hold-lifecycle.md a ce-noslop rewrite that still communicates the same information but improves readability, the way PR #5589 did for docs/configuration.md.
That PR turned long prose paragraphs into task navigation, tables, bullet lists, numbered procedures, and shorter ### subsections. It kept every original heading and anchor, left every fenced code block byte-identical, and preserved every documented fact, default, qualifier, safety limit, identifier, quoted string, and link target, with one sentence per line.
This is a documentation-only change with no runtime behavior impact.

What Changed

  • Rewrote docs/captain-hold-lifecycle.md for readability. It now has a "Find a topic" navigation table, a subcommand overview table (hold, answer, complete, verify, open), and shorter ### subsections under each existing section. Examples include retained-delivery gaps, reconcile requests, fleet snapshot buckets, Bearings placement, and legacy Beads ids.
  • Replaced the long prose paragraphs with one sentence per line, bullet lists, and tables. Every original ## heading and anchor is kept, and the documented facts, identifiers, qualifiers, and link targets are unchanged.
  • Split the Verification record into grouped subsections, such as cleanup, divergence, reconcile, board, and classifier/projection suites. Each subsection lists what a test covers, and "Refreshing this record" explains how to update the record.

Risk Assessment

✅ Low: The change only edits docs. Its fenced code blocks match the base byte for byte, every original heading survives, the new ### headings don't collide with existing slugs, the in-page nav anchors resolve, and the fix rounds correctly fixed F1 (wrong subject), F2 (misplaced item and bold pseudo-headings) and review-1 (the unclear "its").

Testing

The change is Markdown-only, so there is nothing to drive live and no Herdr lab was needed. I ran scripted structural checks comparing the base and target versions of the doc. They confirmed that every original heading and anchor is kept, the only inbound anchor (from docs/configuration.md) still resolves, no link target or inline-code identifier was dropped, the doc has no code fences to alter, and it uses no em or en dashes. The three review fixes are present. I did not produce a rendered visual artifact: no local Markdown renderer (pandoc or python-markdown) is installed, and I chose not to send the doc to GitHub's render API, an external service.

  • Live validation: ⚠️ no-surface - 0 of 4 scenarios driven live against the product
Scenario Result Live Evidence
A reader following an existing link or anchor into captain-hold-lifecycle.md (including docs/configuration.md#L1046 -> #reconcile-re-check-reality-never-a-blind-close) lands on the same heading ⏸️ untested no No live-validatable surface: this is a docs-only Markdown change with no runtime behavior. It was checked statically instead.
The rewrite keeps every documented identifier, link target, and code block ⏸️ untested no No live-validatable surface: this is a docs-only change. The comparison is static text analysis, not product execution.
The review fixes are applied (--force survival attached to the call, the local main item under merges/releases, 'the suite's cases') ⏸️ untested no No live-validatable surface: this is a docs-only wording change, confirmed by reading the file.
The rendered doc reads cleanly (visual) ⏸️ untested no No local Markdown renderer (pandoc or python markdown) is installed. I did not send the doc to GitHub's render API, an external service. The GitHub PR diff view will render it.
Evidence: Structural preservation check output
before headings: 10 after headings: 51
original headings missing/changed: none
original heading order preserved: True
duplicate slugs after: none
original anchors all present: True
fences before: 0 after: 0 byte-identical multiset: True same order: True
link targets dropped: none
link targets added: ['#answer-time-resolution', '#answering-a-call-answer', '#card-hygiene-a-landed-subject-is-not-a-live-call', '#checking-before-scout-teardown-verify', '#cleanup-never-closes-a-captain-call', '#compatibility-with-pre-collapse-installs', '#creating-a-hold-hold', '#mechanism', '#reconcile-re-check-reality-never-a-blind-close', '#record-divergence', '#recording-a-reviewed-inventory-complete', '#source-bindings', '#structured-read-surfaces', '#verification-record', '#verifying-and-retiring-a-request']
broken local links/anchors after: none
em/en dashes after: 0 before: 0
inline code identifiers dropped: none
Evidence: Inbound anchor and review-fix check output
== inbound references to captain-hold-lifecycle.md anchors ==
docs/configuration.md:1046:captain-hold-lifecycle.md#reconcile-re-check-reality-never-a-blind-close
== slugs in new doc ==
OK  #reconcile-re-check-reality-never-a-blind-close
== review fixes ==
10:173:### What `--force` does not lift
23:394:A body that carries a captain resolution record is the captain's own prose and is never mined for that note, so a decision worded `local main` does not become a delivery artifact.
31:488:  The call survives a `--force` cleanup and closes only when `answer` records the captain's words.
32:496:### Merges, releases, and unreadable holds
33:498:- Direct PR and local-only merge entrypoint calls refuse a still-held task before reaching the forge or moving local main.
34:502:- A released call whose decision text is `local main`, closed with no artifact, is not published as a local-only landing.
35:504:### Divergence coverage
40:533:Two of the suite's cases pin how a task body is read back rather than any decision behavior, because both paths that read one are otherwise silent when they get it wrong.
43:595:### Board suite
44:612:### Classifier and projection suites
== lines with >1 sentence (heuristic, outside tables/fences) ==
1. It uses an existing task, or creates one when nothing exists to hold.
2. It records the task's UTC hold-set timestamp as the leading line of the task body.
3. It invokes the underlying tasks-axi hold operation.
4. It verifies both records.
1. It durably writes a resolution block carrying the decision digest and a `Resolution mode:`.
2. It retains the leading hold-set stamp until the selected `tasks-axi done` or `tasks-axi unhold` transition succeeds.
3. It then restores the successful record's resolution-first body ordering.
Evidence: Structural check script
import re, sys, os
before=open(sys.argv[1]).read(); after=open(sys.argv[2]).read(); root=sys.argv[3]
def strip_fences(t):
    return re.sub(r'^`` `.*?^`` `', '', t, flags=re.S|re.M)
def headings(t): return [l for l in strip_fences(t).splitlines() if re.match(r'#{1,6} ', l)]
def fences(t): return re.findall(r'^`` `.*?^`` `', t, flags=re.S|re.M)
def slug(h):
    s=re.sub(r'^#+ ','',h).strip().lower()
    s=re.sub(r'[^\w\- ]','',s); return s.replace(' ','-')
def links(t): return re.findall(r'\]\(([^)\s]+)\)', strip_fences(t))
hb,ha=headings(before),headings(after)
missing=[h for h in hb if h not in ha]
print("before headings:",len(hb),"after headings:",len(ha))
print("original headings missing/changed:",missing or "none")
# order of original headings preserved
idx=[ha.index(h) for h in hb if h in ha]; print("original heading order preserved:", idx==sorted(idx))
sa=[slug(h) for h in ha]; dup=sorted({s for s in sa if sa.count(s)>1}); print("duplicate slugs after:",dup or "none")
sb=set(slug(h) for h in hb); print("original anchors all present:", sb<=set(sa))
fb,fa=fences(before),fences(after)
print("fences before:",len(fb),"after:",len(fa),"byte-identical multiset:", sorted(fb)==sorted(fa), "same order:", fb==fa)
lb,la=set(links(before)),set(links(after))
print("link targets dropped:",sorted(lb-la) or "none"); print("link targets added:",sorted(la-lb) or "none")
bad=[]
for l in la:
    if l.startswith('http'): continue
    path,_,frag=l.partition('#')
    tgt=os.path.normpath(os.path.join(root,'docs',path)) if path else os.path.join(root,'docs/captain-hold-lifecycle.md')
    if not os.path.exists(tgt): bad.append(l); continue
    if frag and tgt.endswith('.md'):
        hs=[slug(h) for h in headings(open(tgt).read())]
        if frag not in hs: bad.append(l)
print("broken local links/anchors after:",bad or "none")
# plain dashes only
print("em/en dashes after:", after.count('—')+after.count('–'), "before:", before.count('—')+before.count('–'))
# backtick identifiers
ib=set(re.findall(r'`([^`\n]+)`', strip_fences(before))); ia=set(re.findall(r'`([^`\n]+)`', strip_fences(after)))
print("inline code identifiers dropped:", sorted(ib-ia) or "none")
- Outcome: ⚠️ 1 warning across 1 run (45.6s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed (2) ✅
  • ⚠️ docs/captain-hold-lifecycle.md:485 - When the rewrite split the long verification sentence, it gave some verbs the wrong subject. Line 485 now reads "That cleanup leaves no pending record behind, survives a --force cleanup, and closes only when answer records the captain's words." A cleanup cannot survive a --force cleanup, and the thing that closes only on answer is the captain call, not the cleanup (see lines 175-176 and the answer path). The original list attached these verbs to the call. Suggested fix: "That cleanup leaves no pending record behind. The call survives a --force cleanup and closes only when answer records the captain's words." This keeps the fact but assigns it to the right subject.
  • ℹ️ docs/captain-hold-lifecycle.md:505 - The item "A released call whose decision text is local main, closed with no artifact, is not published as a local-only landing" is filed under the Record divergence group. It covers Recently Landed note mining (lines 391-395), not divergence, so a reader looking for divergence coverage will be misled. Move it to a landing or merges group, such as "Merges, releases, and unreadable holds". The grouping labels at lines 483, 493, 499, 507, 512 and 520 are also bold pseudo-headings, and they sit directly against their lists. The intent calls for shorter ### subsections, and ce-noslop treats bold labels as an AI tell. Consider making them #### headings to match the rest of the rewrite.

🔧 Fix applied.
3 issues (1 warning, 2 infos) still open:

  • ⚠️ docs/captain-hold-lifecycle.md:485 - When the rewrite split the long verification sentence, it gave some verbs the wrong subject. Line 485 now reads "That cleanup leaves no pending record behind, survives a --force cleanup, and closes only when answer records the captain's words." A cleanup cannot survive a --force cleanup, and the thing that closes only on answer is the captain call, not the cleanup (see lines 175-176 and the answer path). The original list attached these verbs to the call. Suggested fix: "That cleanup leaves no pending record behind. The call survives a --force cleanup and closes only when answer records the captain's words." This keeps the fact but assigns it to the right subject.
  • ℹ️ docs/captain-hold-lifecycle.md:505 - The item "A released call whose decision text is local main, closed with no artifact, is not published as a local-only landing" is filed under the Record divergence group. It covers Recently Landed note mining (lines 391-395), not divergence, so a reader looking for divergence coverage will be misled. Move it to a landing or merges group, such as "Merges, releases, and unreadable holds". The grouping labels at lines 483, 493, 499, 507, 512 and 520 are also bold pseudo-headings, and they sit directly against their lists. The intent calls for shorter ### subsections, and ce-noslop treats bold labels as an AI tell. Consider making them #### headings to match the rest of the rewrite.
  • ℹ️ docs/captain-hold-lifecycle.md:533 - 'Two of its cases pin how a task body is read back...' is now the first sentence under ### Task-body read-back cases. It follows the ### Legacy paths list and five other new ### groups, so 'its' no longer has a nearby antecedent. A reader would take it to mean the legacy paths, not tests/fm-captain-hold-lifecycle.test.sh (line 480). In the original, this sentence came straight after the suite paragraph. The original rewrite split the paragraph; the fix round's new ### headings made the gap wider. Suggested wording: 'Two of the suite's cases pin how a task body is read back...'. That keeps the fact and fixes the reference. No other sibling sites: line 549 already says 'the same suite's beads fixture'.

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

⚠️ **Test** - 1 warning
  • ⚠️ this change has no live-validatable surface; proceed without live validation? (0 of 4 scenarios were driven live against the product); A reader following an existing link or anchor into captain-hold-lifecycle.md (including docs/configuration.md#L1046 -> #reconcile-re-check-reality-never-a-blind-close) lands on the same heading: No live-validatable surface: this is a docs-only Markdown change with no runtime behavior. It was checked statically instead.; The rewrite keeps every documented identifier, link target, and code block: No live-validatable surface: this is a docs-only change. The comparison is static text analysis, not product execution.; The review fixes are applied (--force survival attached to the call, the local main item under merges/releases, 'the suite's cases'): No live-validatable surface: this is a docs-only wording change, confirmed by reading the file.; The rendered doc reads cleanly (visual): No local Markdown renderer (pandoc or python markdown) is installed. I did not send the doc to GitHub's render API, an external service. The GitHub PR diff view will render it.
  • Live validation: ⚠️ no-surface - 0 of 4 scenarios driven live against the product
Scenario Result Live Evidence
A reader following an existing link or anchor into captain-hold-lifecycle.md (including docs/configuration.md#L1046 -> #reconcile-re-check-reality-never-a-blind-close) lands on the same heading ⏸️ untested no No live-validatable surface: this is a docs-only Markdown change with no runtime behavior. It was checked statically instead.
The rewrite keeps every documented identifier, link target, and code block ⏸️ untested no No live-validatable surface: this is a docs-only change. The comparison is static text analysis, not product execution.
The review fixes are applied (--force survival attached to the call, the local main item under merges/releases, 'the suite's cases') ⏸️ untested no No live-validatable surface: this is a docs-only wording change, confirmed by reading the file.
The rendered doc reads cleanly (visual) ⏸️ untested no No local Markdown renderer (pandoc or python markdown) is installed. I did not send the doc to GitHub's render API, an external service. The GitHub PR diff view will render it.
  • git diff --stat b42d4fa..ea8fe8b: only docs/captain-hold-lifecycle.md changed
  • python3 check_doc.py before.md after.md . checked headings, anchors, code fences, link targets, local link and anchor resolution, dashes, and inline-code identifiers
  • grep for inbound captain-hold-lifecycle.md#... references across the repo, each checked against the new heading slugs
  • grep checks for the review fixes: 'The call survives a --force cleanup', the local main item under 'Merges, releases, and unreadable holds', 'Two of the suite's cases', and the '### Divergence coverage' heading
  • awk heuristic for lines holding more than one sentence (hits were only numbered-list markers)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Restructure the captain-hold lifecycle prose into sections, lists, and tables without changing documented behavior. Every original heading, anchor, identifier, number, quoted string, and link target is kept.
@kunchenguid
kunchenguid merged commit 7c501a1 into kunchenguid:main Sep 25, 2026
19 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @tmchow — really appreciate you taking the time on this.

mituso89 pushed a commit to mituso89/firstmate that referenced this pull request Sep 26, 2026
* docs: make captain-hold-lifecycle easier to read

Restructure the captain-hold lifecycle prose into sections, lists, and tables without changing documented behavior. Every original heading, anchor, identifier, number, quoted string, and link target is kept.

* no-mistakes(review): Fix verification record subjects and grouping headings

* no-mistakes(review): Clarify task-body read-back cases belong to the suite
mehulbhagwani pushed a commit to mehulbhagwani/firstmate that referenced this pull request Sep 26, 2026
* docs: make captain-hold-lifecycle easier to read

Restructure the captain-hold lifecycle prose into sections, lists, and tables without changing documented behavior. Every original heading, anchor, identifier, number, quoted string, and link target is kept.

* no-mistakes(review): Fix verification record subjects and grouping headings

* no-mistakes(review): Clarify task-body read-back cases belong to the suite
mehulbhagwani pushed a commit to mehulbhagwani/firstmate that referenced this pull request Sep 26, 2026
* docs: make captain-hold-lifecycle easier to read

Restructure the captain-hold lifecycle prose into sections, lists, and tables without changing documented behavior. Every original heading, anchor, identifier, number, quoted string, and link target is kept.

* no-mistakes(review): Fix verification record subjects and grouping headings

* no-mistakes(review): Clarify task-body read-back cases belong to the suite
ashkonmousavi added a commit to ashkonmousavi/firstmate that referenced this pull request Sep 26, 2026