Skip to content

docs: restructure turnend-guard.md for readability - #5611

Merged
kunchenguid merged 4 commits into
kunchenguid:mainfrom
tmchow:docs/turnend-guard-readable
Sep 27, 2026
Merged

kunchenguid merged 4 commits into
kunchenguid:mainfrom
tmchow:docs/turnend-guard-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/turnend-guard.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/turnend-guard.md to be easier to read. Long prose paragraphs are now bullet lists, numbered steps, and one sentence per line. The rewrite keeps every documented fact, identifier, quoted string, and link target, and it leaves every fenced code block unchanged.
  • Added a short intro that says what the doc covers and who it is for, plus a "Find a topic" table that links to the main sections.
  • Split ## Guard predicates and ## Harness integrations into smaller ###/#### subsections, such as primary scope, supervision need, foreign session-lock owner, Claude cooperative mode, and Cursor park. All existing headings and anchors are kept. This is a documentation-only change with no runtime behavior impact.

Risk Assessment

✅ Low: The change only touches documentation. The merge with origin/main kept all three upstream edits to docs/turnend-guard.md: the FM_WATCHER_STALL_BOUND ceiling, the pi-code stand-down, and the Cursor beforeSubmitPrompt dialog-mirror registration. It restructured them without dropping any fact. Every heading, backticked identifier, link target, and quoted string from the base version is still present, and both earlier user-directed fixes are intact.

Testing

This is a docs-only Markdown rewrite with no runtime product surface, so nothing could be driven live. The structural checks against the base version found no lost heading or anchor, no fenced block to preserve, and no dropped link target, identifier, or quoted string. All four inbound anchors resolve, and both user-directed prose fixes are present. The structural report is saved as evidence.

  • Live validation: ⚠️ no-surface - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
A reader follows a link from bin/ or tests/ to a turnend-guard.md section (#guard-predicates, #harness-integrations, #compatibility-limits, #regression-coverage) and lands on that section ⏸️ untested no This is a documentation-only change with no runtime product to drive. The static anchor check passed.
The rewritten doc keeps every original heading, link target, backticked identifier, and quoted string, and its relative links still resolve ⏸️ untested no This is a docs-only Markdown rewrite, so only structural checks apply, and those passed. There is no runtime behavior to exercise.
The user-directed fixes are present: TERM retirement is scoped to the legacy owner, and the Cursor live e2e line names the Cursor park behavior ⏸️ untested no These are prose fixes in documentation, checked by reading the file. No product exists to run.
Evidence: turnend-guard structural preservation check

Source: turnend-guard structural preservation check

old headings: 7 new headings: 32 dropped headings: [] dropped anchors: [] old fences: 0 new fences: 0 fences preserved: True dropped link targets: [] dropped backticked identifiers: [] dropped quoted strings: [] unresolved relative/intra-doc links in new doc: [] inbound anchors referenced in repo: ['compatibility-limits', 'guard-predicates', 'harness-integrations', 'regression-coverage'] inbound anchors missing in new doc: []

old headings: 7 new headings: 32
dropped headings: []
dropped anchors: []
old fences: 0 new fences: 0 fences preserved: True
dropped link targets: []
dropped backticked identifiers: []
dropped quoted strings: []
unresolved relative/intra-doc links in new doc: []
inbound anchors referenced in repo: ['compatibility-limits', 'guard-predicates', 'harness-integrations', 'regression-coverage']
inbound anchors missing in new doc: []
- Outcome: ⚠️ 1 warning across 1 run (32.1s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ this change has no live-validatable surface; proceed without live validation? (0 of 3 scenarios were driven live against the product); A reader follows a link from bin/ or tests/ to a turnend-guard.md section (#guard-predicates, #harness-integrations, #compatibility-limits, #regression-coverage) and lands on that section: This is a documentation-only change with no runtime product to drive. The static anchor check passed.; The rewritten doc keeps every original heading, link target, backticked identifier, and quoted string, and its relative links still resolve: This is a docs-only Markdown rewrite, so only structural checks apply, and those passed. There is no runtime behavior to exercise.; The user-directed fixes are present: TERM retirement is scoped to the legacy owner, and the Cursor live e2e line names the Cursor park behavior: These are prose fixes in documentation, checked by reading the file. No product exists to run.
  • Live validation: ⚠️ no-surface - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
A reader follows a link from bin/ or tests/ to a turnend-guard.md section (#guard-predicates, #harness-integrations, #compatibility-limits, #regression-coverage) and lands on that section ⏸️ untested no This is a documentation-only change with no runtime product to drive. The static anchor check passed.
The rewritten doc keeps every original heading, link target, backticked identifier, and quoted string, and its relative links still resolve ⏸️ untested no This is a docs-only Markdown rewrite, so only structural checks apply, and those passed. There is no runtime behavior to exercise.
The user-directed fixes are present: TERM retirement is scoped to the legacy owner, and the Cursor live e2e line names the Cursor park behavior ⏸️ untested no These are prose fixes in documentation, checked by reading the file. No product exists to run.
  • git diff --stat 30ef650 2381b46 (confirmed the only change is docs/turnend-guard.md)
  • A Python structural comparison of old and new docs/turnend-guard.md covering headings, anchor slugs, fenced blocks, link targets, backticked identifiers, quoted strings, and relative-link resolution
  • git grep -ohE 'turnend-guard\.md#[A-Za-z0-9_-]+', checking every inbound anchor against the new doc
  • grep -n 'stuck legacy owner\|FM_CURSOR_PRIMARY_LIVE_E2E' docs/turnend-guard.md (confirmed both user-directed fixes)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Restructure the turn-end guard doc's prose into shorter sections, lists, and tables without changing documented behavior. Every original heading, anchor, inline identifier, link target, and number is kept.