Skip to content

docs: restructure calm.md for readability - #5604

Merged
kunchenguid merged 3 commits into
kunchenguid:mainfrom
tmchow:docs/calm-readable
Sep 27, 2026
Merged

kunchenguid merged 3 commits into
kunchenguid:mainfrom
tmchow:docs/calm-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/calm.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/calm.md so it is easier to scan. The page now opens with a one-line statement of who it is for. Long paragraphs are split into shorter ### subsections, such as "Working boat", "Queued Firstmate inputs on Pi", "Toggling Calm on Claude Code", and "Claude Code support bounds". Lists of hidden and visible rows are now bullet lists, and there is one sentence per line.
  • Added tables for harness support and for the shared rule that decides when Calm preserves or hides an assistant text block (a newline, or CALM_PRESERVE_MIN_CHARS (240) trimmed characters, keeps the block).
  • Kept the existing headings and anchors, and moved no content from other pages. The page keeps the same defaults, identifiers, quoted strings, and link targets. It adds only in-page links to the new preservation-rule section and to #pi-compatibility. This change touches documentation only and has no runtime impact.

Risk Assessment

✅ Low: This change only touches documentation. I checked the rewrite against the original: all four original headings and their anchors (#pi, #pi-compatibility, #claude-code) are still there. Both fenced code blocks are byte-identical. Every link target is preserved. The new in-page anchor (#shared-preservation-rule-for-assistant-text) matches its heading. Every fact, default, number, hex color, identifier, file path and quoted string from the original appears in the new text with its meaning unchanged.

Testing

This is a docs-only change to docs/calm.md with no runtime surface, so no scenario could be driven live. A static comparison against the base found that all original headings, both fenced code blocks (byte-identical), every link target, every inline identifier, and every number are preserved. The anchors that other docs link to still resolve. Only new ### subsections and two ## sections were added.

  • Live validation: ⚠️ no-surface - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
An operator running Calm on Pi or Claude Code sees the same runtime behavior after the docs rewrite ⏸️ untested no No live surface to validate: only Markdown documentation changed. No code, script, or config that Calm or Firstmate runs was modified.
A reader following links to calm.md#pi-compatibility or calm.md#claude-code from docs/calm-mode-feasibility.md lands on an existing section ⏸️ untested no No live surface to validate: this is a docs-only change. Anchor resolution was checked statically against the Markdown headings, not in a running product.
The rewrite keeps every original heading, fenced code block (byte-identical), link target, identifier, and numeric value ⏸️ untested no No live surface to validate: this is a docs-only change. The preservation check is a static text comparison, not a product run.
Evidence: calm.md preservation check (static)

Source: calm.md preservation check (static)

base headings missing in new: []
new headings added: ['## Harness support and default', '## Shared preservation rule for assistant text', '### Working boat', '### Boat motion', '### Boat position between working periods', '### What Calm hides on Pi', '### Queued Firstmate inputs on Pi', '### What stays unchanged on Pi', '### What stays visible on Pi', '### Pi versions and missing API seams', '### Session check for queued inputs', '### Built-in tool override collisions', '### Owning docs and files', '### Pi regression entry points', '### The firstmate-calm mod', '### Enabling function hooks', '### Toggling Calm on Claude Code', '### Working sailboat on Claude Code', '### What Calm hides on Claude Code', '### Record-backed operational doorbell', '### What stays unchanged on Claude Code', '### Claude Code support bounds', '### Claude Code regression entry points']
fenced blocks base/new: 2 2 all base blocks present byte-identical: True
links missing in new: []
inline code spans missing in new: []
numbers missing in new: []
docs/calm-mode-feasibility.md:15:[`calm.md`](calm.md#pi-compatibility) owns the current Pi compatibility contract.
docs/calm-mode-feasibility.md:24:[`calm.md`](calm.md#pi-compatibility) owns the current user-facing collision behavior and limitation.
docs/calm-mode-feasibility.md:83:The adapter probes for that exact method and, per the [compatibility contract](calm.md#pi-compatibility), degrades independently with a diagnostic rather than gating on a version number.
docs/calm-mode-feasibility.md:141:The adapter probes for that exact method and, per the [compatibility contract](calm.md#pi-compatibility), degrades independently with a diagnostic rather than gating on a version number.
docs/calm-mode-feasibility.md:192:Claude-bound typed away escalations and launch briefs instead use the record-backed carrier owned by `bin/fm-operational-input.sh`; its replay limit is described in [`calm.md`](calm.md#claude-code).
docs/calm-mode-feasibility.md:248:Pi 0.81.1 through 0.82.0, Pi 0.84.4, and Pi 0.85.1 export `AssistantMessageComponent` and `InteractiveMode`, so Calm uses separate idempotent, API-probed adapters for assistant thinking layout and the complete operational-user transcript row while leaving all message data and non-Calm rendering unchanged; see the [compatibility contract](calm.md#pi-compatibility) for how a future Pi lacking one of those exports is handled.
docs/calm-mode-feasibility.md:313:`tests/fm-calm-claude-mod.test.sh` needs no Claude Code binary: it proves the mod is one hooks module with no command, skill, agent, or classic hook path around its opt-in, that Pi's working ship renders byte-for-byte the shared sprite core painted in ANSI at every width and step, that the Raster packing lays that frame out exactly, that the mod resolves its home like Pi, that its live and restored working-note classifiers enforce the visibility boundaries [`calm.md`](calm.md#claude-code) owns, and that its operational-input classifier agrees with `bin/fm-operational-input.sh` on a corpus the shell owner itself encodes plus legacy shapes and near misses.
docs/calm-mode-feasibility.md:747:Working-note and preserved-reply keys are recorded from `turn.step` per text block and seeded from `$.session.messages()` for a restored transcript, with [`calm.md`](calm.md#claude-code) owning the exact Claude Code visibility contract.
docs/calm-mode-feasibility.md:806:For the current delivery and presentation contracts, see [`fm-operational-input.sh`](../bin/fm-operational-input.sh) and [`calm.md`](calm.md#claude-code).
- Outcome: ⚠️ 1 warning across 1 run (26.8s)

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); An operator running Calm on Pi or Claude Code sees the same runtime behavior after the docs rewrite: No live surface to validate: only Markdown documentation changed. No code, script, or config that Calm or Firstmate runs was modified.; A reader following links to calm.md#pi-compatibility or calm.md#claude-code from docs/calm-mode-feasibility.md lands on an existing section: No live surface to validate: this is a docs-only change. Anchor resolution was checked statically against the Markdown headings, not in a running product.; The rewrite keeps every original heading, fenced code block (byte-identical), link target, identifier, and numeric value: No live surface to validate: this is a docs-only change. The preservation check is a static text comparison, not a product run.
  • Live validation: ⚠️ no-surface - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
An operator running Calm on Pi or Claude Code sees the same runtime behavior after the docs rewrite ⏸️ untested no No live surface to validate: only Markdown documentation changed. No code, script, or config that Calm or Firstmate runs was modified.
A reader following links to calm.md#pi-compatibility or calm.md#claude-code from docs/calm-mode-feasibility.md lands on an existing section ⏸️ untested no No live surface to validate: this is a docs-only change. Anchor resolution was checked statically against the Markdown headings, not in a running product.
The rewrite keeps every original heading, fenced code block (byte-identical), link target, identifier, and numeric value ⏸️ untested no No live surface to validate: this is a docs-only change. The preservation check is a static text comparison, not a product run.
  • git diff --stat 30ef650..7a30ca3 (only docs/calm.md changed)
  • Python static comparison of base vs target docs/calm.md: headings, fenced code blocks, link targets, inline code spans, numbers
  • grep -rn 'calm.md#' docs README.md plus a heading check for ## Pi compatibility and ## Claude Code
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Restructure the Calm mode prose into sections, lists, and tables without changing documented behavior. Every original heading, anchor, fenced code block, inline-code span, link target, number, and quoted string is preserved.
The Built-in tool override collisions lead-in covers a session that reloads with Calm already on, as the original text did.
@tmchow tmchow changed the title docs: make the Calm mode guide easier to read docs: make calm easier to read Sep 25, 2026
# Conflicts:
#	docs/calm.md
@tmchow tmchow changed the title docs: make calm easier to read docs: restructure calm.md for readability Sep 27, 2026
@kunchenguid
kunchenguid merged commit f62a7d9 into kunchenguid:main Sep 27, 2026
20 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.

mehulbhagwani pushed a commit to mehulbhagwani/firstmate that referenced this pull request Sep 27, 2026
* docs: make calm easier to read

Restructure the Calm mode prose into sections, lists, and tables without changing documented behavior. Every original heading, anchor, fenced code block, inline-code span, link target, number, and quoted string is preserved.

* docs: restore reload case in calm override lead-in

The Built-in tool override collisions lead-in covers a session that reloads with Calm already on, as the original text did.
mehulbhagwani pushed a commit to mehulbhagwani/firstmate that referenced this pull request Sep 27, 2026
* docs: make calm easier to read

Restructure the Calm mode prose into sections, lists, and tables without changing documented behavior. Every original heading, anchor, fenced code block, inline-code span, link target, number, and quoted string is preserved.

* docs: restore reload case in calm override lead-in

The Built-in tool override collisions lead-in covers a session that reloads with Calm already on, as the original text did.
mehulbhagwani pushed a commit to mehulbhagwani/firstmate that referenced this pull request Sep 27, 2026
* docs: make calm easier to read

Restructure the Calm mode prose into sections, lists, and tables without changing documented behavior. Every original heading, anchor, fenced code block, inline-code span, link target, number, and quoted string is preserved.

* docs: restore reload case in calm override lead-in

The Built-in tool override collisions lead-in covers a session that reloads with Calm already on, as the original text did.
knowttl pushed a commit to knowttl/firstmate that referenced this pull request Sep 29, 2026
* docs: make calm easier to read

Restructure the Calm mode prose into sections, lists, and tables without changing documented behavior. Every original heading, anchor, fenced code block, inline-code span, link target, number, and quoted string is preserved.

* docs: restore reload case in calm override lead-in

The Built-in tool override collisions lead-in covers a session that reloads with Calm already on, as the original text did.
jredgard added a commit to jredgard/firstmate that referenced this pull request Sep 29, 2026
… DevOps delivery (#15)

* fix(bin): surface unrecognized status prefixes instead of reading them as silence (#5588)

* fix(bin): surface an unrecognized status prefix instead of dropping it

A parked or holding declaration, and a verb whose correlation token did not parse, never became an event, so the supervisor still saw the earlier line.

* no-mistakes(review): Require verb-shaped unrecognized status prefixes, add continuation tests

* no-mistakes(document): Document unrecognized status prefix escalation in afk skill

* no-mistakes(ci): I reproduced the "Behavior portable serial 6" failure locally and fixed it by changing the test data in one test. No product code changed. **What failed:** `tests/fm-session-start.test.sh`, in `test_orphan_status_logs_are_printed`, with "matched status log was printed 2 times". **Why:** the test writes status lines with made-up prefixes, `matched: surfaced once` and `orphan: step N`. The test only uses them as placeholder text. It checks that the session-start digest prints each task's status tail exactly once. This PR (#4763) deliberately makes an unrecognized one-word lowercase prefix a status event. So those lines now surface as captain-relevant events, and the wake queue's STATUS OUTCOME BACKSTOP section prints them a second time. The code under review is behaving as the issue asks. Only the test's placeholder data had become meaningful. **Rule the test depends on:** its status lines must not be captain-relevant, so the digest is the only place they are printed. Both lines in this test broke that rule. The orphan line would have failed the same count check right after the matched line did. **Fix:** in that test only, I switched both lines to the recognized, non-captain verb `working:`: `working: surfaced once` and `working: orphan step 1..6`. I updated the matching assertions and counts to use the new text. What the test checks is unchanged: orphan logs are labelled, the tail is bounded, the log path is printed, and each tail appears once. **Verification:** before the fix, the test failed locally the same way as in CI. After it, `bash tests/fm-session-start.test.sh` reports "all assertions passed

* no-mistakes(review): Detect unrecognized prefixes on unstamped lines; share verb list

---------

Co-authored-by: Kun's firstmate <[email protected]>

* fix(bin): report the failing item when remote inheritance fails (#5658)

Fixes #5295

Session start now reports a remote inheritance failure using the
push's own error line instead of the first unchanged item that
happened to print before it, and the shared captain preferences
header check now names the first required phrase it did not find,
on both the local and remote inheritance paths.

* fix(bin): stand down the Claude Stop auto-arm on pi-code-delivered payloads (#5657)

* fix(bin): stand down the Claude Stop auto-arm on pi-code-delivered payloads

pi-code loads the tracked Claude settings but has no asyncRewake, so it
awaits every Stop hook; without a stand-down the auto-arm runs
synchronously inside Pi's turn end and holds it open for the declared
multi-hour timeout. Stand down when the payload's transcript_path
contains a /.pi/ path component, the same discriminator the closed-but-
unmerged fix in #3352 used, with an explicit string-type check on the
jq filter.

Fixes #3343

* no-mistakes(document): document pi-code stand-down in harness integrations reference

* fix(bin): match whole multi-word project names in the registry lookup (#5659)

* fix(bin): match whole multi-word project names in the registry lookup

bin/fm-project-mode.sh matched a registered project name against only the
first whitespace-delimited token of a registry row, so a name containing a
space never matched, silently defaulting the project to no-mistakes off
instead of its declared posture.

The lookup now matches the whole registered name against the raw line text,
so a name is compared literally (never as a regex) and a name that is a
leading prefix of another registered name still resolves to its own row.

* no-mistakes(document): docs already accurate for multiword registry name match

* chore: drop accidental empty err file

Co-authored