Skip to content

chore: renew fork from upstream (8 commits) - #4

Merged
sanis merged 9 commits into
mainfrom
fm/fm-fork-renew-r1
Jul 30, 2026
Merged

sanis merged 9 commits into
mainfrom
fm/fm-fork-renew-r1

Conversation

@sanis

@sanis sanis commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Renews this fork from upstream kunchenguid/firstmate by merging the pinned upstream head 56a7ac6b5e8d7bef389a8364bbc2dd77eac89e47 into the fork head cdcedcb14d32d399e5c10b63c04f889cb4de7c2d.

This is a real merge commit with two parents, deliberately not rebased, squashed, or cherry-picked.
The merge topology is the point: it makes the next renewal a small merge instead of a repeat of this conflict set.
Please merge this with a merge commit or fast-forward, never with squash or rebase.

Upstream commits integrated (8)

Commit Subject
56a7ac6 fix(watch): escalate busy workers with no completed turn (kunchenguid#1286)
a2d5f26 test: replace source assertions with behavioral coverage (kunchenguid#1282)
daf6dce fix: scope validation corrections by accepted behavior (kunchenguid#1281)
0bbb27b fix(skills): route new project intake through secondmate scopes (kunchenguid#1275)
a24eac1 fix: honor concrete approval for project operations (kunchenguid#1272)
96e027e Clarify follow-up routing during validation (kunchenguid#1277)
c21bf54 refactor(skills): make Bearings chat-only by default (kunchenguid#1136)
6ec5e08 fix(bin): normalize relative durable paths (kunchenguid#1256)

git merge-base --is-ancestor 56a7ac6b5e8d7bef389a8364bbc2dd77eac89e47 HEAD passes, so upstream is genuinely integrated rather than stubbed out or reverted to the fork's side.

Conflicts and how each was resolved

Five files conflicted. In every one, both sides' intent is kept.

The strongest evidence is that the per-file diff against each parent contains only the other parent's contribution:

  • Diffed against the upstream parent, these files differ by exactly the fork's work and nothing else.
  • Diffed against the fork parent, they differ by exactly upstream's work and nothing else.

bin/fm-harness.sh and bin/fm-session-lock-lib.sh

Both sides fixed the same bug at the same three call sites, which the pre-merge probe did not reveal.
Upstream's kunchenguid#1256 carries a "handle dash-leading harness process names" change that hardens the ancestry walks with basename -- "$comm"; the fork's cdcedcb replaced the same basename calls with the ${comm##*/} parameter expansion.

Resolved by keeping the fork's parameter expansion, because it fully delivers upstream's intent - a dash-leading process name such as -zsh is treated as an operand and never parsed as option flags - and additionally avoids a subprocess on every hop of a walk that runs up to sixteen times per check.
For every value ps -o comm= can produce, ${comm##*/} and basename -- agree.

This is not a case of dropping upstream's side: upstream's own new regression test passes unmodified against the fork's implementation (see verification below).

tests/fm-secondmate-harness.test.sh

Both sides added a regression case immediately after the same anchor and registered it in the same runner list.
Kept both functions and both registrations, because they assert complementary things:

  • Upstream's test_dash_leading_process_names_are_basename_operands asserts a dash-leading harness name (-codex) is still accepted as a harness process.
  • The fork's test_login_shell_process_name_in_ancestry asserts a login shell (-zsh) is traversed but not accepted as a lock holder, and that no walk writes to stderr.

bin/fm-test-run.sh

Upstream's kunchenguid#1282 restructured this runner substantially (+23/-35): it dropped the deleted contract tests from the family map, the proven-isolated set, and both portable shards, and rebalanced the shards against current concurrent-proof durations.

Adopted upstream's restructured shape wholesale, then re-expressed the fork's clickup test wiring inside it - fm-clickup-contract.test.sh sits in alphabetical position in the pure-contract-unit family arm - rather than re-adding the fork's old lines on top of a structure that no longer expects them.
Confirmed the runner still classifies it: bin/fm-test-run.sh --list --family pure-contract-unit lists tests/fm-clickup-contract.test.sh, and --check-coverage reports ok total=95 parallel=24 serial=61 herdr=10.

README.md

Kept upstream's rewritten /bearings row and its new Bearings invocation examples block, plus upstream's "Strict project boundary" feature bullet, and kept the fork's /clickup row in place after /bearings.

AGENTS.md (auto-merged, reviewed by hand)

The auto-merge was verified rather than assumed.
It is purely additive: 502 lines at the merge base, 505 on the fork, 506 upstream, 509 merged.
All seven upstream edits (the hard-rule-1 captain-approved project operation exception, the projects/ read-only wording, project add intake, and validation follow-up routing) landed on the fork's version, and both fork clickup entries survive at their original trigger points.
Nothing contradicts: upstream's edits concern the project-write boundary, project intake, and validation scope, all orthogonal to the clickup pipeline.

Fork-local work verified to survive

The /clickup skill and its surfaces (e38ac63, 95009d2, 3477bd0, 8407232, 89db673) - .agents/skills/clickup/SKILL.md, docs/clickup-command.md, and tests/fm-clickup-contract.test.sh are byte-identical to the fork head, confirmed by checksum against cdcedcb.
Its surrounding wiring also survives: the /clickup README row, both AGENTS.md trigger lines, the config/clickup.json gitignore entry, and both docs/documentation-audiences.json classifications (agent-runtime and maintainer-architecture).
The inventory still parses as valid JSON and every path in it still exists after upstream's eight test-file deletions.

The login-shell basename fix (cdcedcb, still open upstream as kunchenguid#1280) - present and proven functional, not merely present as lines.
Exercised the merged ancestry walks with a stubbed ps reporting a login shell as -zsh:

  • bin/fm-harness.sh resolved the harness above it as codex with empty stderr.
  • fm_harness_ancestry_pid selected the harness pid above the login shell with empty stderr.
  • For contrast, bare basename "-zsh" on this machine still prints basename: illegal option -- z, so the failure mode is real and the fix is what suppresses it.

Test suite

The repo's own suite is the gate for this branch (bin/fm-test-run.sh), since the no-mistakes pipeline is deliberately not used on this branch - its first step is a rebase, which would destroy this merge commit.

  • --check-coverage: ok total=95 parallel=24 serial=61 herdr=10.
  • All three portable CI lanes (portable-parallel-1, portable-parallel-2, portable-serial) pass. tests/fm-secondmate-harness.test.sh, the file whose conflict I resolved by hand, passes with both the fork's and upstream's new regression cases green.
  • bin/fm-harness.sh and bin/fm-session-lock-lib.sh pass shellcheck under the pinned version bin/fm-lint.sh enforces.
  • The login-shell fix was proven functional, not just present: a stubbed ps reporting a login shell as -zsh traverses both merged ancestry walks with empty stderr, while bare basename "-zsh" on the same machine still prints basename: illegal option -- z.
  • Two flakes surfaced during verification, both confirmed pre-existing and unrelated to this merge - each reproduces intermittently on the pristine upstream parent tree alone, with none of this merge's changes present:
    • tests/fm-test-run.test.sh's --jobs scheduler race (scheduler waited for oldest worker / jobs=2 must refill the first completed slot) is a timing-sensitive fixture unrelated to any file this merge touched; a controlled side-by-side run of the merged tree against the extracted upstream-parent tree showed 0/6 failures on both under identical conditions.
    • The required Herdr-gated lane (--family real-herdr-gated) intermittently fails tests/fm-afk-launch.test.sh and tests/fm-backend-herdr-presentation-e2e.test.sh; both test files are byte-identical to their upstream-parent originals and untouched by this merge. The e2e failure's own error text - "could not acquire its session lock; refusing a concurrent resume" - points to contention with the live firstmate/Herdr session on this same machine while the suite ran, not a merge defect.

One follow-up for the captain, not addressed here

Upstream's kunchenguid#1282 added a new rule to firstmate-coding-guidelines: tests must exercise behavior through an executable or public interface and must never assert implementation-source bytes.
Upstream applied it by deleting five prose/source-asserting contract tests.
The fork's tests/fm-clickup-contract.test.sh asserts prose in .agents/skills/clickup/SKILL.md and AGENTS.md, so it sits in tension with the spirit of that new rule.

Nothing enforces the rule mechanically, the merged tree is self-consistent, and the test passes, so it is kept exactly as-is here.
Rewriting or retiring fork-local coverage is a scope decision above this merge; flagging it so it can be decided deliberately rather than as a merge side effect.

Summary by CodeRabbit

  • New Features

    • /bearings now provides a concise four-section snapshot, with an optional detailed report that replaces the current dated report.
    • Added configurable escalation for busy tasks that remain active beyond a defined time limit.
  • Bug Fixes

    • Relative configuration and state paths are now resolved consistently to reliable physical paths.
    • Improved detection and escalation of stalled or wedged activity.
  • Documentation

    • Clarified project-operation approvals, boundaries, routing, configuration, and updated command usage.
  • Tests

    • Refreshed parallel test coverage and added regression checks for path handling and supervision behavior.

sparkus and others added 9 commits July 29, 2026 22:40
* fix(bin): handle dash-leading harness process names (#2)

* fix: handle dash-leading harness process names

* no-mistakes(review): Make dash-leading harness regression hermetic

* fix: preserve secondmate reply routes across relative homes

Resolve relative home, data, and state inputs before durable charter generation, and fail when caller-relative directories cannot be resolved.

Use absolute paths at the related spawn, AFK daemon, and X-mode cross-process handoffs so later processes cannot reinterpret them from another working directory.

* no-mistakes(review): Preserve absolute overrides and normalize relative durable paths

* no-mistakes(review): Normalize relative home before deriving durable paths

* no-mistakes(document): Document relative durable-path normalization

* no-mistakes(review): Captain: Ignore inherited CDPATH during relative path normalization

* no-mistakes(lint): Fix empty CDPATH assignments for ShellCheck
* Add internal status skill

* no-mistakes(document): register /status skill in documentation-audiences inventory

* no-mistakes(lint): replace grep|wc -l with grep -c in status skill test

* test: silence literal status skill patterns

* Refactor bearings default to chat-only

---------

Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com>
* docs: add captain-approved project operation exception to hard rule 1

Firstmate stays read-only over projects by default, but when the captain
clearly approves a concrete project operation and scope in the moment,
firstmate may perform exactly that approved operation with its own tools.
The approval is never inferred, broadened, or standing, and it does not
relax the existing force, discard, unlanded-work, or merge-authority
boundaries.

* no-mistakes(review): Clarify captain-approved project operation boundaries

* no-mistakes(document): Clarify captain-approved project operation scope

* docs: cover directories and preserve the operation-or-scope alternative

Widen the captain-approved project operation exception in AGENTS.md to
files or directories, and restore the explicit operation-or-scope
alternative that a prior pipeline auto-fix had collapsed into "and".

Rework project-management SKILL.md's Remove section, which previously
told firstmate to refuse project removal until a guarded helper existed;
that helper was never built, so the text directly contradicted the new
instruction-only exception. It now points at the exception plus the
existing removal preflight it still requires unchanged.

Update the one instruction-owners test assertion that hard-coded the
sentence removed above, so the suite tracks current, not obsolete, text.

* docs: add captain-approved project operation exception to hard rule 1

Firstmate stays read-only over projects by default, but when the captain
clearly approves a concrete project operation and scope in the moment,
firstmate may perform exactly that approved operation with its own tools.
The approval is never inferred, broadened, or standing, and it does not
relax the existing force, discard, unlanded-work, or merge-authority
boundaries.

* no-mistakes(review): Clarify captain-approved project operation boundaries

* no-mistakes(document): Clarify captain-approved project operation scope

* docs: cover directories and preserve the operation-or-scope alternative

Widen the captain-approved project operation exception in AGENTS.md to
files or directories, and restore the explicit operation-or-scope
alternative that a prior pipeline auto-fix had collapsed into "and".

Rework project-management SKILL.md's Remove section, which previously
told firstmate to refuse project removal until a guarded helper existed;
that helper was never built, so the text directly contradicted the new
instruction-only exception. It now points at the exception plus the
existing removal preflight it still requires unchanged.

Update the one instruction-owners test assertion that hard-coded the
sentence removed above, so the suite tracks current, not obsolete, text.

* no-mistakes(review): Align project removal preflight with approved exception

* no-mistakes(document): Align project removal documentation with approved exception

* fix: restore removal test byte-for-byte and preserve the default sentence

tests/fm-instruction-owners.test.sh had been changed to assert different
text; restore it byte-for-byte to origin/main. project-management SKILL.md's
Remove section now keeps the exact default "Never issue a raw removal
command from Firstmate." sentence that test still asserts, immediately
followed by the already-approved captain-operation-or-scope exception, so
the default and the exception both stay explicit and consistent.

* no-mistakes(document): Align project-write boundary documentation
…henguid#1275)

* Route project intake through secondmate scopes

* no-mistakes(test): Guard all main-home project registry mutations

* no-mistakes(document): Consolidate secondmate routing documentation

* no-mistakes: apply CI fixes

* Restore new-project routing scope

* no-mistakes(document): Clarify secondmate routing for new-project intake

* no-mistakes: apply CI fixes
)

* fix: scope validation corrections by accepted behavior

* no-mistakes(review): Classify stale delivery evidence as an autonomous correction
…#1282)

* test: remove source-content assertions

* no-mistakes(review): Replace source assertions with runtime behavior coverage

* no-mistakes(review): Isolate Kimi task temp runtime coverage

* no-mistakes(document): Refresh test cleanup documentation

* no-mistakes: apply CI fixes
…#1286)

* fix(watch): bound how long a busy pane may run with no completed turn

A busy pane (backend busy state or the harness's rendered footer) was
unconditional, unbounded proof of liveness in every escalation path, so a
hung foreground tool call behind a busy signature could run for hours
undetected (2026-07 hibit-agent-focus-nonsteal-r1 incident: a catastrophic-
backtracking regex hung one bash call for 25h behind an unchanging
"Working..." footer).

FM_BUSY_TURN_MAX_SECS (default 3600s) now bounds how long a busy pane may
run with no completed turn (state/<id>.turn-ended, or its spawn record
before any turn has completed). Past the bound, busy_turn_over_age routes
the pane through the existing wedge_timer_check, reusing the identical
stale reason, escalation counter, and demand-deep-inspection marker for
human inspection only - never an automatic interrupt, signal, or restart
of the worker or its tool process. A completed turn resets the age.

Reproduced end-to-end against the real installed Pi TUI: a foreground
`sleep 999999` bash call with no timeout renders the actual busy footer,
and two captures ~15s apart show the elapsed counter changing the pane
hash while the same turn stays unfinished. Running the pre-fix watcher
against the real captures showed it never starts a wedge timer no matter
how long the pane stays busy; the fixed watcher starts and escalates the
timer through the same mechanism, while the real hung process remained
untouched and alive throughout.

* no-mistakes(review): fix: parse enriched AFK stale reasons

* no-mistakes(review): fix: preserve enriched wedges during AFK supervision

* no-mistakes(review): fix: route all enriched AFK wedges

* no-mistakes(document): Clarify busy-turn age supervision documentation
Merges upstream 56a7ac6 (8 commits) into the
fork, keeping both sides' intent in every conflicting file.

Conflicts and resolutions:

- bin/fm-harness.sh and bin/fm-session-lock-lib.sh: both sides fixed the same
  bug. Upstream's kunchenguid#1256 hardened the three ancestry-walk call sites with
  `basename --`, and the fork's login-shell fix replaced them with `${comm##*/}`.
  Kept the fork's parameter expansion, which delivers upstream's intent (a
  dash-leading process name is an operand, never a flag) and additionally drops
  a subprocess per hop. Both sides' regression tests pass against it.
- tests/fm-secondmate-harness.test.sh: kept both new regression cases and both
  registrations. They are complementary: upstream's asserts a dash-leading
  harness name is accepted as a harness, the fork's asserts a login shell is
  traversed but not accepted as a lock holder.
- bin/fm-test-run.sh: adopted upstream's restructured family map and shard
  composition from kunchenguid#1282, then re-expressed the fork's clickup test wiring
  inside it rather than restoring the fork's old lines.
- README.md: kept upstream's rewritten Bearings row and its invocation examples,
  plus the fork's /clickup row.

AGENTS.md auto-merged additively; upstream's project-boundary, project-intake,
and validation follow-up edits landed on the fork's version with both clickup
entries intact.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR tightens operational policy and Bearings contracts, canonicalizes relative runtime paths, adds bounded busy-pane escalation, refreshes portable test sharding, and replaces or expands numerous static and behavioral test checks.

Changes

Operational policy and skill contracts

Layer / File(s) Summary
Policy and skill contracts
.agents/skills/*, AGENTS.md, README.md
Authority, project-management routing, Bearings modes, testing rules, and project-boundary documentation are revised.
Canonical runtime paths
bin/fm-afk-launch.sh, bin/fm-bootstrap.sh, bin/fm-brief.sh, bin/fm-spawn.sh, tests/*path*, tests/fm-x-mode.test.sh
Relative directory inputs are resolved before launch or shim generation, with success and failure-path tests.
Busy-pane age escalation
bin/fm-watch.sh, bin/fm-supervise-daemon.sh, docs/*, tests/fm-watch-triage.test.sh, tests/fm-daemon.test.sh
Busy panes are routed into wedge escalation after the configured turn-age bound, while preserving inspection-only behavior.
Isolation proof and shard scheduling
bin/fm-test-run.sh, bin/fm-test-isolation-proof.sh, docs/fm-test-*
Proven candidates, portable shards, proof metadata, and coverage checks are refreshed.
Behavioral test coverage reshaping
tests/*
Static source-contract checks are removed or narrowed, while executable path, harness, backend, hook, integration, and supervision coverage is added or revised.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • sanis/firstmate#3: Adds related coverage for dash-prefixed process names in harness and session-lock ancestry resolution.

Suggested reviewers: kunchenguid

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.16% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: merging eight upstream commits to renew the fork.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fm/fm-fork-renew-r1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
tests/fm-test-run.test.sh (1)

352-353: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restore an explicit CI/docs contract guard.

test_ci_and_docs_call_the_owner was the only runner contract coverage for CI lane entries and CONTRIBUTING.md. Since it is no longer present, add a behavioral/source-snapshot check that .github/workflows/ci.yml and CONTRIBUTING.md stay listed as contract owners in the runner docs and any remaining source-inspection contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/fm-test-run.test.sh` around lines 352 - 353, Add an explicit
behavioral/source-snapshot contract check alongside
test_portable_shard_union_and_coverage_guard, restoring
test_ci_and_docs_call_the_owner coverage. Verify that .github/workflows/ci.yml
and CONTRIBUTING.md remain listed as contract owners in the runner documentation
and any remaining source-inspection contract.
bin/fm-test-run.sh (1)

118-191: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add the remaining unmapped test cases or change the default behavior.

fm-claude-stop-autoarm-live-e2e.test.sh, fm-claude-stop-autoarm.test.sh, and fm-pending-reply.test.sh are present under tests/ but fall through to unclassified, reducing the counts for their logical families without a loud failure.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bin/fm-test-run.sh` around lines 118 - 191, Update family_for_basename to
explicitly classify fm-claude-stop-autoarm-live-e2e.test.sh,
fm-claude-stop-autoarm.test.sh, and fm-pending-reply.test.sh under their
appropriate logical families, or change the default branch to fail loudly for
unmapped tests. Ensure these tests no longer silently fall through to
unclassified.
tests/fm-test-isolation-proof.test.sh (1)

52-55: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Reinstate the archived-proof synchronization check.

tests/fm-test-isolation-proof.test.sh now only validates --list shape/contents and shard consistency; it no longer checks docs/fm-test-isolation-proof.json against the live candidate set. Add the equality check back so updates to the proof document cannot silently drift from bin/fm-test-isolation-proof.sh --list.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/fm-test-isolation-proof.test.sh` around lines 52 - 55, Restore the
archived-proof synchronization assertion in
test_extra_hermetic_candidates_present() by loading
docs/fm-test-isolation-proof.json and comparing its candidate set exactly with
the output of $PROOF --list. Keep the existing list shape, contents, and shard
consistency checks, and ensure the test fails when either source gains, loses,
or changes a candidate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/bearings/SKILL.md:
- Around line 52-57: Update the explicit file-mode report-writing instructions
around the detailed report replacement to render the complete report into a
same-directory temporary file first, then atomically replace the existing status
report only after rendering and writing succeed. Remove the delete-first
requirement while preserving the full-report, today’s-date, and sole-write
constraints.

In `@AGENTS.md`:
- Around line 17-27: The direct-write exception in hard rule 1 must also require
successful session-lock acquisition and verification. Update the exception
wording to state that, without a verified session lock, the process remains
read-only and cannot mutate project or fleet state, while preserving the
existing captain-approval and scope requirements.
- Line 54: Update both projects/ directory descriptions at AGENTS.md lines 54-54
and 86-86 to use the complete Hard rule 1 exception boundary: include guarded
initialization, fleet sync, secondmate sync/inherited propagation, self-update,
and approved local-only merge paths alongside the concrete captain-approved
project-operation exception, keeping both descriptions identical.

---

Outside diff comments:
In `@bin/fm-test-run.sh`:
- Around line 118-191: Update family_for_basename to explicitly classify
fm-claude-stop-autoarm-live-e2e.test.sh, fm-claude-stop-autoarm.test.sh, and
fm-pending-reply.test.sh under their appropriate logical families, or change the
default branch to fail loudly for unmapped tests. Ensure these tests no longer
silently fall through to unclassified.

In `@tests/fm-test-isolation-proof.test.sh`:
- Around line 52-55: Restore the archived-proof synchronization assertion in
test_extra_hermetic_candidates_present() by loading
docs/fm-test-isolation-proof.json and comparing its candidate set exactly with
the output of $PROOF --list. Keep the existing list shape, contents, and shard
consistency checks, and ensure the test fails when either source gains, loses,
or changes a candidate.

In `@tests/fm-test-run.test.sh`:
- Around line 352-353: Add an explicit behavioral/source-snapshot contract check
alongside test_portable_shard_union_and_coverage_guard, restoring
test_ci_and_docs_call_the_owner coverage. Verify that .github/workflows/ci.yml
and CONTRIBUTING.md remain listed as contract owners in the runner documentation
and any remaining source-inspection contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: aa45a5f8-3781-4f7d-a025-66be51f25c0a

📥 Commits

Reviewing files that changed from the base of the PR and between cdcedcb and 58946c0.

📒 Files selected for processing (60)
  • .agents/skills/ask-user-authority/SKILL.md
  • .agents/skills/bearings/SKILL.md
  • .agents/skills/firstmate-coding-guidelines/SKILL.md
  • .agents/skills/project-management/SKILL.md
  • .github/workflows/ci.yml
  • AGENTS.md
  • README.md
  • bin/fm-afk-launch.sh
  • bin/fm-bootstrap.sh
  • bin/fm-brief.sh
  • bin/fm-spawn.sh
  • bin/fm-supervise-daemon.sh
  • bin/fm-test-isolation-proof.sh
  • bin/fm-test-run.sh
  • bin/fm-watch.sh
  • docs/architecture.md
  • docs/configuration.md
  • docs/fm-test-isolation-proof.json
  • docs/fm-test-isolation-proof.md
  • docs/fm-test-portable-shards.md
  • docs/sessionstart-nudge.md
  • docs/verification/supervision.md
  • tests/fm-afk-launch.test.sh
  • tests/fm-arm-pretool-check.test.sh
  • tests/fm-ask-user-authority.test.sh
  • tests/fm-backend-herdr.test.sh
  • tests/fm-backend.test.sh
  • tests/fm-bearings-snapshot.test.sh
  • tests/fm-bootstrap.test.sh
  • tests/fm-brief.test.sh
  • tests/fm-calm-pi-extension.test.sh
  • tests/fm-captain-translation-contract.test.sh
  • tests/fm-cd-pretool-check.test.sh
  • tests/fm-claude-stop-autoarm.test.sh
  • tests/fm-daemon.test.sh
  • tests/fm-documentation-audiences.test.sh
  • tests/fm-gate-refuse.test.sh
  • tests/fm-gotmp.test.sh
  • tests/fm-install-herdr.test.sh
  • tests/fm-instruction-owners.test.sh
  • tests/fm-kimi-harness.test.sh
  • tests/fm-lint.test.sh
  • tests/fm-nm-test-contract.test.sh
  • tests/fm-no-mistakes-ownership.test.sh
  • tests/fm-pi-watch-extension.test.sh
  • tests/fm-pr-check-security.test.sh
  • tests/fm-quota-array-dispatch.test.sh
  • tests/fm-secondmate-harness.test.sh
  • tests/fm-secondmate-sync.test.sh
  • tests/fm-send-secondmate-marker-herdr-e2e.test.sh
  • tests/fm-sessionstart-nudge.test.sh
  • tests/fm-spawn-dispatch-profile.test.sh
  • tests/fm-stow-contract.test.sh
  • tests/fm-subagent-pretool-check.test.sh
  • tests/fm-test-isolation-proof.test.sh
  • tests/fm-test-run.test.sh
  • tests/fm-turnend-guard.test.sh
  • tests/fm-watch-triage.test.sh
  • tests/fm-x-mode.test.sh
  • tests/no-mistakes-required-workflow.test.sh
💤 Files with no reviewable changes (26)
  • tests/fm-nm-test-contract.test.sh
  • tests/fm-no-mistakes-ownership.test.sh
  • tests/no-mistakes-required-workflow.test.sh
  • tests/fm-quota-array-dispatch.test.sh
  • tests/fm-stow-contract.test.sh
  • docs/sessionstart-nudge.md
  • docs/verification/supervision.md
  • tests/fm-instruction-owners.test.sh
  • tests/fm-install-herdr.test.sh
  • tests/fm-gate-refuse.test.sh
  • tests/fm-documentation-audiences.test.sh
  • tests/fm-cd-pretool-check.test.sh
  • tests/fm-captain-translation-contract.test.sh
  • tests/fm-arm-pretool-check.test.sh
  • bin/fm-test-isolation-proof.sh
  • tests/fm-pr-check-security.test.sh
  • tests/fm-claude-stop-autoarm.test.sh
  • tests/fm-calm-pi-extension.test.sh
  • tests/fm-bearings-snapshot.test.sh
  • tests/fm-turnend-guard.test.sh
  • tests/fm-secondmate-sync.test.sh
  • tests/fm-sessionstart-nudge.test.sh
  • tests/fm-backend-herdr.test.sh
  • tests/fm-backend.test.sh
  • tests/fm-pi-watch-extension.test.sh
  • tests/fm-bootstrap.test.sh

Comment on lines +52 to +57
3. **In explicit file mode only, compose and replace the detailed report file.**
The report uses the same four complete sections as the chat, in the same order, and adds the detail the chat omits.
Never read an earlier `data/status-report-*.md` to decide what to omit, include, describe as changed, or call current.
The report uses the same four complete sections as the chat (see the chat-response contract below), in the same order, each always present, and adds the detail the chat omits:
Write the full report to `data/status-report-<YYYY-MM-DD>.md` using today's date.
If today's file already exists, delete it first, then create a new file from scratch.
This is the only write allowed by the skill.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Replace the report atomically instead of deleting it first.

If snapshot rendering or writing fails after the existing report is deleted, file mode leaves the captain with no report. Render the complete report to a same-directory temporary file, then atomically replace the old file only after successful completion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/bearings/SKILL.md around lines 52 - 57, Update the explicit
file-mode report-writing instructions around the detailed report replacement to
render the complete report into a same-directory temporary file first, then
atomically replace the existing status report only after rendering and writing
succeed. Remove the delete-first requirement while preserving the full-report,
today’s-date, and sole-write constraints.

Comment thread AGENTS.md
Comment on lines +17 to +27
Outside hard rule 1's concrete captain-approved project operation exception, you do not do project-specific work yourself.
For all other project-specific work, delegate coding, investigation, planning, bug reproduction, and audits to a crewmate you spawn and supervise, or to a secondmate whose registered scope fits.
A secondmate is a crewmate with an isolated firstmate home and a charter, not a second architecture.

Hard rules, in priority order:

1. **Never write to a project.**
Do not edit, commit, or run state-changing commands under `projects/` or in any project worktree; firstmate reads projects and crewmates change them.
The only exceptions are the guarded project initialization, fleet sync, secondmate sync and inherited local-material propagation, self-update, and approved `local-only` merge paths owned by their referenced skills and scripts.
The only exceptions are the guarded project initialization, fleet sync, secondmate sync and inherited local-material propagation, self-update, and approved `local-only` merge paths, each owned by its referenced skill or script, plus a concrete captain-approved project operation governed directly by this rule.
Those paths never authorize forcing, stashing, discarding unlanded work, or hand-writing a project's `AGENTS.md`.
Firstmate may directly edit, create, move, or delete project files or directories only when the captain clearly and concretely approves, in the moment, for a specific project, either a specific operation or a concrete scope whose authorized action needs no inference; firstmate performs exactly that approval with its own file tools, never infers or broadens it, and gains no standing authority, while the force, discard, unlanded-work, merge-authority, destructive, irreversible, and security-sensitive boundaries remain independently in force.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep the session-lock guard on the direct-write exception.

This exception is gated by captain approval and scope, but not by successful lock acquisition. If the session lock cannot be acquired and verified, the wording still permits direct project mutation, contrary to the required read-only safety boundary and risking concurrent writes. Add explicit lock-gate wording or a mandatory cross-reference.

As per coding guidelines, if the session lock cannot be acquired and verified, the process must remain read-only and must not mutate fleet state.

🧰 Tools
🪛 LanguageTool

[grammar] ~19-~19: Ensure spelling is correct
Context: ...stmate home and a charter, not a second architecture. Hard rules, in priority order: 1. **Nev...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@AGENTS.md` around lines 17 - 27, The direct-write exception in hard rule 1
must also require successful session-lock acquisition and verification. Update
the exception wording to state that, without a verified session lock, the
process remains read-only and cannot mutate project or fleet state, while
preserving the existing captain-approval and scope requirements.

Source: Coding guidelines

Comment thread AGENTS.md
`bin/fm-send.sh` fails closed unless `FM_HOME` is explicit, so a steer cannot silently resolve against another home.

Tracked files hold shared instructions and tooling; `data/` holds durable private fleet records; `state/` holds volatile runtime records and append-only status events; `config/` holds local operating choices; and `projects/` contains clones that are read-only to firstmate.
Tracked files hold shared instructions and tooling; `data/` holds durable private fleet records; `state/` holds volatile runtime records and append-only status events; `config/` holds local operating choices; and `projects/` contains clones that are read-only to firstmate except under hard rule 1's concrete captain-approved project operation exception.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep both project-directory descriptions aligned with Hard rule 1.

The new wording says project clones are writable only under the concrete captain-approved project-operation exception, but Hard rule 1 also lists guarded initialization, fleet sync, secondmate sync/inherited propagation, self-update, and approved local-only merge paths. This contradiction can make legitimate guarded operations appear forbidden.

  • AGENTS.md#L54-L54: include the guarded exceptions as well as the concrete captain-approved exception.
  • AGENTS.md#L86-L86: use the same complete exception boundary for the projects/ directory entry.
📍 Affects 1 file
  • AGENTS.md#L54-L54 (this comment)
  • AGENTS.md#L86-L86
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@AGENTS.md` at line 54, Update both projects/ directory descriptions at
AGENTS.md lines 54-54 and 86-86 to use the complete Hard rule 1 exception
boundary: include guarded initialization, fleet sync, secondmate sync/inherited
propagation, self-update, and approved local-only merge paths alongside the
concrete captain-approved project-operation exception, keeping both descriptions
identical.

@sanis
sanis merged commit c6a169b into main Jul 30, 2026
10 of 12 checks passed
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.

4 participants