refactor: streamline firstmate operating guidance - #368
Merged
Conversation
ruby-dlee
force-pushed
the
fm/firstmate-instruction-debloat-v4
branch
from
August 27, 2026 03:10
0ababf5 to
2b9aeb0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Comprehensively simplify Firstmate's tracked instruction and harness guidance so future sessions prioritize direct captain answers, live ownership, recursive unblocking, bounded validation, and continuous cleanup instead of accumulating passive process. Treat AGENTS.md as the always-loaded hot path: retain only unconditional identity, authority, safety, routing, and trigger rules there; move or delete conditional procedure, duplicated mechanics, stale narrative, and repeated contract text using existing authoritative skills, docs, or script headers rather than inventing another framework. Measure and report before/after lines and bytes for every instruction surface changed, and require a meaningful net reduction overall. Preserve the captain/firstmate relationship, the no-project-writes rule, merge authority, unlanded-work protection, direct-answer obligation, active unblock obligation, and the current single-operator design doctrine. Do not weaken budget, credential-custody, irreversible-data-loss, or unlanded-work safety. Do not merely rewrite grievances as more prose; convert repeated unenforceable instructions into one clear owner or remove them. Inspect generated brief scaffolds and loaded agent-only skills for contradictions that cause parked work, but change only what is necessary for the simplification. Preserve the brief emitter's executable isolation and secondmate-idle contracts. Remove source-content-only instruction assertions rather than treating wording as behavioral proof, and keep the behavior-test inventory and duration registry consistent with the authoritative test inventory. Preserve every recovered pipeline commit and the current main history without reset, stash, force, or dropped work. Do not touch .pi/extensions/fm-primary-pi-watch.ts, .pi/extensions/fm-primary-turnend-guard.ts, docs/supervision-protocols/pi.md, docs/turnend-guard.md, tests/fm-pi-primary-compaction-live-e2e.test.sh, tests/fm-pi-watch-extension.test.sh, or tests/fm-turnend-guard.test.sh because the active compaction-continuity repair owns those files. Do not modify private files under /Users/dongkeun/firstmate-home/data except this task's required completion and status artifacts. Deliver the focused reduction through review, test, document, lint, push, PR, and CI without merging the PR.
What Changed
AGENTS.mdto Firstmate’s always-loaded identity, authority, safety, routing, and skill-trigger rules.Risk Assessment
✅ Low: The comprehensive instruction reduction now preserves the required authority and safety invariants, routes conditional mechanics to existing owners, maintains brief isolation and secondmate-idle contracts, and introduces no substantiated source regression.
Testing
The configured baseline, focused Agent Fleet pytest consumer, and brief-generator behavior suite passed; manual generation produced reviewer-visible ship and project-less secondmate briefs that preserve executable isolation, recursive unblocking, bounded completion, and idle contracts, with no testing residue left in the worktree.
Evidence: Generated ship brief
Evidence: Generated secondmate idle charter
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
AGENTS.md- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
AGENTS.md:68- The required criterion says AGENTS.md must “retain only unconditional identity, authority, safety, routing, and trigger rules,” but the changed hot path still embeds conditional procedures: execute and interpret session start (lines 68–82), classify and route each task (lines 134–149), and run wake/supervision handling (lines 159–178). These procedures remain always loaded instead of being routed to their existing script, documentation, and triggered-skill owners, so the requested boundary is still unmet.🔧 Fix: Route conditional procedures from hot path
1 warning still open:
AGENTS.md- The fixer could not prove the semantic repair with a public/executable fail-before/pass-after regression and relevant integration or consumer compatibility evidence; primary-agent handoff is required.🔧 **Test** - 1 issue found → auto-fixed ✅
if [ "${FM_AZURE_VALIDATION_CELL:-0}" = 1 ]; then exec "$FM_AZURE_VALIDATION_SHARD_BRIDGE" behavior --count "${FM_AZURE_VALIDATION_SHARD_COUNT:-8}"; else exec bin/fm-no-mistakes-test-command.sh; fi🔧 Fix: Remove source-content-only AGENTS instruction assertions
✅ Re-checked - no issues remain.
if [ "${FM_AZURE_VALIDATION_CELL:-0}" = 1 ]; then exec "$FM_AZURE_VALIDATION_SHARD_BRIDGE" behavior --count "${FM_AZURE_VALIDATION_SHARD_COUNT:-8}"; else exec bin/fm-no-mistakes-test-command.sh; fiConfigured baseline:if [ "${FM_AZURE_VALIDATION_CELL:-0}" = 1 ]; then exec "$FM_AZURE_VALIDATION_SHARD_BRIDGE" behavior --count "${FM_AZURE_VALIDATION_SHARD_COUNT:-8}"; else exec bin/fm-no-mistakes-test-command.sh; fi(already passed)uv run --project tools/agent-fleet pytest tools/agent-fleet/teststests/fm-brief.test.shGenerated a ship brief withFM_GATE_REFUSE_BYPASS=1 FM_HOME=<evidence-dir> bin/fm-brief.sh evidence-ship firstmateGenerated a project-less secondmate charter withFM_GATE_REFUSE_BYPASS=1 FM_HOME=<evidence-dir> FM_SECONDMATE_CHARTER='Evidence-only idle charter validation' bin/fm-brief.sh evidence-secondmate --secondmate --no-projectsInspected the generated artifacts for isolated-worktree, recursive-unblocking, completion-report, and secondmate-idle behavior usingrgVerified testing left the worktree clean withgit status --short✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.