Skip to content

feat: establish instruction ownership foundation - #619

Merged
kunchenguid merged 2 commits into
mainfrom
fm/fm-agents-owners-first-a1
Jul 15, 2026
Merged

kunchenguid merged 2 commits into
mainfrom
fm/fm-agents-owners-first-a1

Conversation

@kunchenguid

@kunchenguid kunchenguid commented Jul 15, 2026 •

Copy link
Copy Markdown
Owner

Intent

Implement PR A, the owners-first foundation for the captain-approved Firstmate AGENTS reduction, without any runtime behavior change and without the later AGENTS deletion or compression pass. Add internal diagnostic-reasoning and project-management skills with precise load triggers and single-owner procedures, add only the generic fallback effort rubric below explicit captain and standing configured effort choices with no Sol-specific policy, and extend shared coding guidance with full supported-harness/backend review plus deterministic idempotent enforcement. Audit existing documentation and script ownership, record the D05 state/startup/recovery placement by keeping state and startup mechanics in docs or script headers and extending stuck-crewmate-recovery for dead ordinary direct reports, while lock refusal, consent, run-once/read-once, and direct-report safety stay inline. Keep delivery lifecycle and fleet supervision in AGENTS, add no personal-review or stacked-review requirement, preserve all old inline content, add only the two new trigger entries, and protect load-bearing ownership with proportionate tests. Open PR A unmerged, do not add a separate reviewer, and do not merge it.

What Changed

  • Add single-owner internal skills for diagnostic reasoning and project management, with precise load triggers and expanded dead-crewmate recovery guidance.
  • Document ownership boundaries for operational state and startup behavior, add effort-selection precedence, and strengthen cross-harness compatibility and idempotent enforcement guidance without changing shell runtime logic.
  • Add contract tests covering skill metadata, ownership triggers, effort fallback rules, shared authoring requirements, and recovery placement.

Risk Assessment

🚨 High: Captain, the code is otherwise well-bounded, but two explicit acceptance criteria are currently unmet and require confirmation before merge.

Testing

The already-passing full baseline suite was supplemented with the focused ownership contract test and manual end-to-end inspection of the installed skill triggers, unchanged runtime surface, preserved AGENTS lifecycle content, and live PR state; all acceptance checks passed, PR #619 is open and unmerged with no reviews, and the latest no-mistakes requirement run succeeded despite the rollup retaining its earlier superseded failure.

Evidence: Owners-first end-to-end acceptance evidence
Owners-first end-to-end acceptance evidence
Target commit: 686006b8c622c8a041450cf76d0138ab3552b45f

Changed product surfaces (base..target):
A	.agents/skills/diagnostic-reasoning/SKILL.md
M	.agents/skills/firstmate-coding-guidelines/SKILL.md
M	.agents/skills/harness-adapters/SKILL.md
A	.agents/skills/project-management/SKILL.md
M	.agents/skills/stuck-crewmate-recovery/SKILL.md
M	AGENTS.md
M	docs/configuration.md
A	tests/fm-instruction-owners.test.sh

Runtime bin changes: 0

Complete AGENTS.md patch (shows only two new skill trigger entries and the extended existing recovery trigger):
diff --git a/AGENTS.md b/AGENTS.md
index 649989f..2edc8ce 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -762,5 +762,7 @@ These skills are not captain-invocable; they are conditional operating reference
 - `bootstrap-diagnostics` - load whenever the session-start digest's bootstrap section prints any diagnostic or capability line (`MISSING:`, `MISSING_MANUAL:`, `BACKEND_INVALID:`, `NEEDS_GH_AUTH`, `TANGLE:`, `CREW_HARNESS_OVERRIDE:`, `CREW_DISPATCH:`, `FLEET_SYNC:`, `SECONDMATE_SYNC:`, `SECONDMATE_LIVENESS:`, `TASKS_AXI:`, `NUDGE_SECONDMATES:`, or `FMX:`); silence needs no load.
+- `diagnostic-reasoning` - load before scoping a reported bug and before acting on a diagnostic report.
 - `harness-adapters` - load before spawning or recovering a crewmate or secondmate, handling a trust dialog, sending a harness-specific skill invocation, interrupting or exiting an agent, resuming an exited agent, or verifying a new harness adapter.
 - `firstmate-orca` - load before switching to Orca, spawning or supervising Orca-backed work, smoke-testing Orca backend behavior, debugging Orca task state, or reconciling Orca-backed task metadata.
-- `stuck-crewmate-recovery` - load after a stale wake, looping pane, repeated confusion, an answered-by-brief question, an unresponsive crewmate, or a failed steer.
+- `project-management` - load before adding, creating, removing, or initializing a project.
+- `stuck-crewmate-recovery` - load when the session-start digest reports an ordinary direct report's endpoint dead or its metadata has no window, or after a stale wake, looping pane, repeated confusion, an answered-by-brief question, an unresponsive crewmate, or a failed steer.
 - `secondmate-provisioning` - load before creating, seeding, validating, launching, handing backlog to, recovering, pushing inherited config into, or retiring a secondmate home, and before editing `data/secondmates.md`.

Added review-policy terms (must be empty):

Installed internal skill discovery surface:
diagnostic-reasoning: name=diagnostic-reasoning user-invocable=false internal=true
- `diagnostic-reasoning` - load before scoping a reported bug and before acting on a diagnostic report.
project-management: name=project-management user-invocable=false internal=true
- `project-management` - load before adding, creating, removing, or initializing a project.

Focused ownership contract exercise:
ok - new internal skills have one precise AGENTS.md trigger each
ok - diagnostic-reasoning owns the approved evidence procedure
ok - project-management owns registry, delivery posture, consent, initialization, and removal safety
ok - generic effort fallback applies only below captain and standing configuration
ok - firstmate-coding-guidelines owns compatibility review and deterministic enforcement
ok - state, startup, and ordinary recovery have focused owners and triggers

Live PR lifecycle surface:
pull_request:
  number: 619
  title: Add instruction owners foundation
  state: open
  author: kunchenguid
  draft: no
  merged: no
  checks: "5 passed, 1 failed, 6 total"
  body: "## Summary\n\n- add diagnostic-reasoning and project-management ownership skills\n- extend shared coding and recovery guidance\n- protect instruction ownership and effort precedence with tests\n\n## Testing\n\n- `bash tests/fm-instruction-owners.test.sh`\n- `bash tests/fm-session-start.test.sh`\n\n## Pipeline\n\nUpdates from [git push no-mistakes](https://github.com/kunchenguid/no-mistakes)\n"
  comment_count: 0 — use --comments to see full comments
  reviews: []

Latest no-mistakes requirement run:
run:
  id: 29455603906
  title: Add instruction owners foundation
  status: completed
  conclusion: success
  workflow: Require no-mistakes
  branch: fm/fm-agents-owners-first-a1
  created: 17m ago
jobs[1]{id,name,status,conclusion}:
  87487992645,PR must be raised via no-mistakes,completed,success
- Outcome: 🔧 1 issue found → auto-fixed (2) ✅ across 3 runs (1h1m25s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 errors
  • 🚨 AGENTS.md:767 - The required criterion says to “preserve all old inline content” and “add only the two new trigger entries,” but this line also replaces the existing stuck-crewmate-recovery trigger with an expanded trigger. Confirm this third AGENTS change is intentional, or restore the original entry.
  • 🚨 The required criterion says “Open PR A unmerged,” but gh-axi pr list --state all --head fm/fm-agents-owners-first-a1 returned zero PRs, and the target commit is not present on a remote branch. PR A still needs to be opened without merging, unless that delivery requirement has changed.
🔧 **Test** - 1 issue found → auto-fixed (2) ✅
  • 🚨 Captain, the required PR A lifecycle state is absent: the target branch is not on origin and gh-axi finds no open or closed PR for it. Therefore “open, unmerged, and no separate reviewer” is not currently satisfied or fully verifiable. Push the branch and open the PR without requesting a reviewer; leave it unmerged.
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • Pre-run baseline: command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • bash tests/fm-instruction-owners.test.sh twice to verify ownership contracts and deterministic repeatability
  • Base-to-target audit confirming only AGENTS, internal skills, docs, and tests changed; unchanged AGENTS content remained byte-identical; prior recovery triggers remained inline; and product additions contained no personal-review, stacked-review, or Sol-specific policy
  • git ls-remote --heads origin refs/heads/fm/fm-agents-owners-first-a1
  • gh-axi pr list --state all --head fm/fm-agents-owners-first-a1 --limit 10
  • git status --short after testing to confirm no transient worktree artifacts remained

🔧 Fix: Captain, open owners-first PR with passing ownership tests
1 error still open:

  • 🚨 PR feat: establish instruction ownership foundation #619 is open, unmerged, non-draft, and has no submitted reviews, but its required PR must be raised via no-mistakes check fails. The PR body lacks the deterministic no-mistakes Pipeline section and signature. Drive the branch through the no-mistakes PR lifecycle so it updates the existing PR and clears the required check, without merging or adding a reviewer.
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • Configured baseline: command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc" (previously completed successfully).
  • bash tests/fm-instruction-owners.test.sh
  • bash tests/fm-session-start.test.sh
  • git diff --exit-code e063ca5e2459ea8cbcefb1d58310b3617318bfb8..686006b8c622c8a041450cf76d0138ab3552b45f -- bin
  • Inspected the complete targeted diff and verified AGENTS.md only adds the two new triggers while extending the existing recovery trigger.
  • gh-axi pr view 619 --reviews
  • gh-axi pr checks 619
  • gh-axi run view 29454382810 --log-failed
  • Verified git status --short remained empty after testing.

🔧 Fix: Restore no-mistakes PR provenance check
✅ Re-checked - no issues remain.

  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • Baseline previously completed: command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • Inspected git diff e063ca5e2459ea8cbcefb1d58310b3617318bfb8..686006b8c622c8a041450cf76d0138ab3552b45f for scope, preserved AGENTS content, runtime changes, trigger additions, and forbidden review policy
  • bash tests/fm-instruction-owners.test.sh
  • gh-axi pr view 619 --reviews
  • gh-axi pr checks 619
  • gh-axi run list
  • gh-axi run view 29455603906
  • Generated owners-first-e2e.txt with the actual skill discovery surface, AGENTS patch, runtime-change count, contract-test transcript, PR state, and latest no-mistakes check result
  • Verified HEAD and origin/fm/fm-agents-owners-first-a1 both resolve to 686006b8c622c8a041450cf76d0138ab3552b45f, with a clean worktree
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid kunchenguid changed the title Add instruction owners foundation feat: establish instruction ownership foundation Jul 15, 2026
@kunchenguid
kunchenguid merged commit fcb9e8a into main Jul 15, 2026
6 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-agents-owners-first-a1 branch July 15, 2026 23:13
Marl0nL added a commit to Marl0nL/firstmate that referenced this pull request Jul 16, 2026