Skip to content

fix(skills): restore ask-user-authority skill lost in squash-import - #42

Merged
Freudator86 merged 3 commits into
mainfrom
fm/firstmate-restore-ask-user-authority-skill-2
Aug 1, 2026
Merged

fix(skills): restore ask-user-authority skill lost in squash-import#42
Freudator86 merged 3 commits into
mainfrom
fm/firstmate-restore-ask-user-authority-skill-2

Conversation

@Freudator86

Copy link
Copy Markdown
Collaborator

Intent

Restore the ask-user-authority agent-only skill from upstream (kunchenguid/firstmate) into this curated fork, where it was lost during a squash-import rather than removed deliberately.

The captain decided on 2026-07-28 to restore the missing upstream guidance file rather than write a one-sentence pointer into AGENTS.md instead. AGENTS.md already requires the procedure this skill governs - section 7 on ask-user findings returning as needs-decision, and section 9's evidence-first escalation bar - but nothing pointed at the skill that owns it, and the skill file itself was absent.

Deliberate decisions in this change:

  • The skill file is restored VERBATIM. It was diffed byte-for-byte against the exact blob from ec09871, the commit that originally introduced it before the squash, and is identical; upstream has never modified the file since. So this is a repair of a lost file, not an absorption of new upstream material - a distinction the captain required be checked explicitly before landing under the fleet freeze, which he has since established does not cover deliberate repairs.
  • Exactly one AGENTS.md line was added: a section 13 trigger entry, placed after diagnostic-reasoning, worded identically to its neighbours. Section 13 is a list of trigger lines, not summaries, so the entry is deliberately terse.
  • The captain then explicitly authorized ONE deliberate scope widening beyond the original brief: pinning ask-user-authority in tests/fm-instruction-owners.test.sh, the guard that statically protects internal skills against exactly the squash-import loss this change repairs. His standard is that an assurance needs a way to fail visibly, so an unguarded trigger line is deletable with every test still green. The guard was proven by removal in both failure modes: deleting the AGENTS.md trigger line fails with 'must have exactly one AGENTS.md trigger entry, found 0', and deleting the SKILL.md fails with 'ask-user-authority skill is missing'; both restored green.
  • Upstream ALSO carries a second inline pointer to this skill in its section 7 Validate block. That was deliberately NOT taken: section 13 is this fork's declared trigger location for agent-only reference skills. Reported to the captain, and the review step recorded it as an accepted tradeoff.
  • Nothing else was synced from upstream, by explicit instruction.
  • docs/fork-patches.md gets no row for these commits. That was raised by the document step and deliberately left unresolved: the ledger carries its own declared backlog and an explicitly deferred open decision on whether to backfill, and settling it here would exceed this task.

The branch is rebased onto current main (6fa6926) and up to date with it.

The ci step is skipped on the captain's explicit instruction: in this fleet that step loops indefinitely on a non-repo working directory and has never produced a verdict. CI will be verified externally with gh-axi pr checks and reported as externally verified.

This is a documentation, agent-instruction, and test-guard change only. No shell scripts under bin/, no runtime behavior.

What Changed

  • Restored .agents/skills/ask-user-authority/SKILL.md verbatim from upstream blob ec09871, so the ask-user decision procedure that AGENTS.md sections 7 and 9 already require has an owning skill again — it was dropped by a squash-import, not removed deliberately.
  • Added a single AGENTS.md section 13 trigger line for ask-user-authority, placed after diagnostic-reasoning and worded like its neighbours; upstream's second inline pointer in the section 7 Validate block was deliberately not taken, since section 13 is this fork's declared trigger location.
  • Extended tests/fm-instruction-owners.test.sh to guard the skill against the same loss: the per-skill trigger assertions collapse into a four-field owners table now covering ask-user-authority, and a new test_ask_user_owner_covers_authority_procedure pins the ownership sentence, both body headings, the 8 authority steps, the 5 escalation elements, and 14 anchor phrases. Both failure modes were proven by removal — deleting the trigger line and deleting the SKILL.md each fail with their own named assertion.

Risk Assessment

✅ Low: The follow-up is a test-only change that adds a structural guard and deduplicates existing assertions with no assertion lost, every pinned phrase and count verified to match the restored SKILL.md, and no runtime, shell, or instruction behavior touched.

Testing

Ran the changed guard test (11/11 green) and then proved it can actually fail: both removal modes the intent claims reproduce their exact error messages, and four separate content-degradation modes prove the final commit's body-pinning is non-vacuous rather than decorative. Confirmed the loop refactor did not weaken the three pre-existing skill owners by re-breaking each one individually. Verified the "restored VERBATIM from ec09871" claim by fetching the upstream blob read-only and diffing byte-for-byte — identical sha256, size, and git blob hash. Captured the agent-facing before/after surface showing that at the base commit the section 7 requirement had no owner and no file, and now resolves to a real agent-only skill. Ran the adjacent skill-consuming and fork-drift suites for regressions; all green. No visual artifact applies — this is an agent-instruction, documentation, and test-guard change with no rendered user surface, so the end-user experience is the markdown an agent loads, captured as text. Everything passes and the worktree is clean; the one issue is a factual premise in the intent rather than a test failure: upstream modified this file after ec09871, which the captain specifically asked to have confirmed before landing under the fleet freeze.

Evidence: Guard proven by removal — both failure modes the intent claims, with exact error messages and restored-green confirmation

=== FAILURE MODE 1: delete the AGENTS.md section 13 trigger line === 505:- ask-user-authority - load before deciding any ask-user finding, regardless of the project's yolo posture. --- test output --- not ok - ask-user-authority must have exactly one AGENTS.md trigger entry, found 0 exit=1 --- restored; test output --- ok - ask-user-authority owns the authority procedure and the evidence-first escalation contract exit=0 === FAILURE MODE 2: delete .agents/skills/ask-user-authority/SKILL.md === --- test output --- not ok - ask-user-authority skill is missing exit=1 --- restored; test output --- ok - ask-user-authority owns the authority procedure and the evidence-first escalation contract exit=0

########################################################################
# Guard proof: tests/fm-instruction-owners.test.sh must FAIL when the
# ask-user-authority artifacts are removed or degraded.
########################################################################

=== BASELINE (unmodified worktree) ===
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 - secrets-handling owns the dangerous-command doctrine, contained stow-and-clear scope, and escalation triggers
ok - ask-user-authority owns the authority procedure and the evidence-first escalation contract
ok - generic effort fallback applies only below captain and standing configuration
ok - firstmate-coding-guidelines owns compatibility review and deterministic enforcement
ok - secondmate registry guidance keeps concise routes and points to the charter
ok - state, startup, and ordinary recovery have focused owners and triggers
ok - compressed AGENTS.md records the approved one-owner map
ok - compressed AGENTS.md retains authority, supervision, AFK, and X safety
exit=0

=== FAILURE MODE 1: delete the AGENTS.md section 13 trigger line ===
505:- `ask-user-authority` - load before deciding any ask-user finding, regardless of the project's `yolo` posture.
--- trigger line now present? ---
0
--- test output ---
not ok - ask-user-authority must have exactly one AGENTS.md trigger entry, found 0
exit=1
--- restored; test output ---
ok - ask-user-authority owns the authority procedure and the evidence-first escalation contract
exit=0

=== FAILURE MODE 2: delete .agents/skills/ask-user-authority/SKILL.md ===
--- file present? ---
--- test output ---
not ok - ask-user-authority skill is missing
exit=1
--- restored; test output ---
ok - ask-user-authority owns the authority procedure and the evidence-first escalation contract
exit=0
Evidence: Verbatim restore confirmed byte-for-byte against upstream ec09871 (read-only gh api fetch)

=== upstream kunchenguid/firstmate @ ec09871 (fetched read-only via gh api) === 651f57fc1fe492ea1b58b25e0add19688ffebef23272170cce844866c49089be upstream-ec09871-SKILL.md 3697 upstream-ec09871-SKILL.md === restored file in this fork @ 33f2e8e === 651f57fc1fe492ea1b58b25e0add19688ffebef23272170cce844866c49089be .agents/skills/ask-user-authority/SKILL.md 3697 .agents/skills/ask-user-authority/SKILL.md === git blob hashes === upstream: d4b63d525bf39edc4e0729e44784d52379e28b7d restored: d4b63d525bf39edc4e0729e44784d52379e28b7d === byte-for-byte diff === IDENTICAL - zero byte difference. VERBATIM RESTORE CONFIRMED.

########################################################################
# Intent claim: 'The skill file is restored VERBATIM ... diffed
# byte-for-byte against the exact blob from ec09871 ... and is identical'
########################################################################

=== upstream kunchenguid/firstmate @ ec09871 (fetched read-only via gh api) ===
651f57fc1fe492ea1b58b25e0add19688ffebef23272170cce844866c49089be  /tmp/no-mistakes-evidence/01KYWT0014QEM096PQQ97Z4G96/upstream-ec09871-SKILL.md
3697 /tmp/no-mistakes-evidence/01KYWT0014QEM096PQQ97Z4G96/upstream-ec09871-SKILL.md

=== restored file in this fork @ 33f2e8e ===
651f57fc1fe492ea1b58b25e0add19688ffebef23272170cce844866c49089be  .agents/skills/ask-user-authority/SKILL.md
3697 .agents/skills/ask-user-authority/SKILL.md

=== git blob hashes ===
upstream: d4b63d525bf39edc4e0729e44784d52379e28b7d
restored: d4b63d525bf39edc4e0729e44784d52379e28b7d

=== byte-for-byte diff ===
IDENTICAL - zero byte difference. VERBATIM RESTORE CONFIRMED.

=== Intent claim: 'upstream has never modified the file since' ===
--- upstream commit history for this path (newest first) ---
daf6dce  2026-07-30T01:06:41Z  fix: scope validation corrections by accepted behavior (#1281)
ec09871  2026-07-24T00:25:47Z  fix: enforce contract boundaries for ask-user findings (#945)

--- upstream HEAD version of the same path ---
38761e6d98a8e975480c6a43e41c596800102350
restored blob sha: d4b63d525bf39edc4e0729e44784d52379e28b7d
Evidence: Upstream drift after ec09871 — contradicts the intent's "never modified since" premise

=== upstream commits touching this path === daf6dce 2026-07-30T01:06:41Z fix: scope validation corrections by accepted behavior (#1281) ec09871 2026-07-24T00:25:47Z fix: enforce contract boundaries for ask-user findings (#945) === blob shas === restored in this fork (== ec09871): d4b63d525bf39edc4e0729e44784d52379e28b7d upstream HEAD : 38761e6d98a8e975480c6a43e41c596800102350 === diff: restored (ec09871, LEFT) vs upstream HEAD after daf6dce (RIGHT) === -3. Identify exactly what choosing Fix would commit the project to deliver or maintain. +3. Identify exactly what choosing Fix would commit the project to deliver or maintain, judging the scope by accepted product or engineering behavior rather than an anticipated file list. + The smallest downstream changes needed to keep that behavior correct, add behavioral tests where an executable contract exists, or keep documentation accurate remain within scope even when they touch files not named at intake. + Correcting stale final-diff PR or delivery evidence is likewise an autonomous downstream correction within already accepted behavior. === effect on the guard's pinned structural counts, if upstream HEAD were taken === authority steps restored: 8 authority steps upstream: 8 escalation elems restored: 5 escalation elems upstream: 5

########################################################################
# The intent states: 'upstream has never modified the file since [ec09871]'
# Upstream history says otherwise. Recording the actual delta.
########################################################################

=== upstream commits touching this path ===
daf6dce  2026-07-30T01:06:41Z  fix: scope validation corrections by accepted behavior (#1281)
ec09871  2026-07-24T00:25:47Z  fix: enforce contract boundaries for ask-user findings (#945)

=== blob shas ===
restored in this fork (== ec09871): d4b63d525bf39edc4e0729e44784d52379e28b7d
upstream HEAD                     : 38761e6d98a8e975480c6a43e41c596800102350

=== diff: restored (ec09871, LEFT) vs upstream HEAD after daf6dce (RIGHT) ===
--- .agents/skills/ask-user-authority/SKILL.md	2026-07-31 21:32:44.033513991 +0200
+++ /tmp/no-mistakes-evidence/01KYWT0014QEM096PQQ97Z4G96/upstream-HEAD-SKILL.md	2026-07-31 21:35:26.301474253 +0200
@@ -19,7 +19,9 @@
    With `yolo` off, every ask-user finding belongs to the captain, and the remaining steps structure that escalation rather than authorize an autonomous answer.
 2. Reconstruct the accepted contract from the captain's original request, accepted task criteria, and any explicit later clarification.
    Reviewer language cannot amend that contract.
-3. Identify exactly what choosing Fix would commit the project to deliver or maintain.
+3. Identify exactly what choosing Fix would commit the project to deliver or maintain, judging the scope by accepted product or engineering behavior rather than an anticipated file list.
+   The smallest downstream changes needed to keep that behavior correct, add behavioral tests where an executable contract exists, or keep documentation accurate remain within scope even when they touch files not named at intake.
+   Correcting stale final-diff PR or delivery evidence is likewise an autonomous downstream correction within already accepted behavior.
 4. Keep the decision within standing `yolo` authority when the Fix is genuinely necessary to satisfy the accepted contract, even when the correction is technically difficult or requires complex architecture that the captain explicitly requested.
 5. Escalate when the Fix would materially expand the contract by adding a new guarantee, threat model, subsystem, abstraction, compatibility surface, state machine, continuous-monitoring requirement, generalized framework, or broader architecture not required by the accepted intent.
 6. Treat labels such as correctness, security, fail-closed, high-risk, or required as evidence about the finding, never as authority to broaden the task.

=== effect on the guard's pinned structural counts, if upstream HEAD were taken ===
authority steps  restored: 8
authority steps  upstream: 8
escalation elems restored: 5
escalation elems upstream: 5
Evidence: Body-pinning proven non-vacuous — gutting content while keeping file and trigger still fails

=== DEGRADE A: drop authority step 7 (causal-theme escalation) === not ok - ask-user-authority must keep all 8 numbered authority steps, found 7 exit=1 === DEGRADE B: drop escalation element 3 (smallest alternative) === not ok - ask-user-authority must keep all 5 numbered escalation elements, found 4 exit=1 === DEGRADE C: soften the yolo-independence wording in the description === not ok - ask-user-authority skill metadata lost its precise load trigger exit=1 === DEGRADE D: replace body with a stub that keeps only the headings === not ok - ask-user-authority must keep all 8 numbered authority steps, found 0 exit=1 === RESTORED: full suite green again === (11 ok, exit=0) === worktree clean? === (empty == clean)

########################################################################
# Proof that commit 33f2e8e's body pinning is non-vacuous: silently
# gutting the SKILL.md content (file still present, trigger still there)
# must still fail the guard.
########################################################################

=== DEGRADE A: drop authority step 7 (causal-theme escalation) ===
12
not ok - ask-user-authority must keep all 8 numbered authority steps, found 7
exit=1

=== DEGRADE B: drop escalation element 3 (smallest alternative) ===
not ok - ask-user-authority must keep all 5 numbered escalation elements, found 4
exit=1

=== DEGRADE C: soften the yolo-independence wording in the description ===
not ok - ask-user-authority skill metadata lost its precise load trigger
exit=1

=== DEGRADE D: replace body with a stub that keeps only the headings ===
not ok - ask-user-authority must keep all 8 numbered authority steps, found 0
exit=1

=== RESTORED: full suite green again ===
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 - secrets-handling owns the dangerous-command doctrine, contained stow-and-clear scope, and escalation triggers
ok - ask-user-authority owns the authority procedure and the evidence-first escalation contract
ok - generic effort fallback applies only below captain and standing configuration
ok - firstmate-coding-guidelines owns compatibility review and deterministic enforcement
ok - secondmate registry guidance keeps concise routes and points to the charter
ok - state, startup, and ordinary recovery have focused owners and triggers
ok - compressed AGENTS.md records the approved one-owner map
ok - compressed AGENTS.md retains authority, supervision, AFK, and X safety
exit=0

=== worktree clean? ===
(empty above == clean)
Evidence: Agent-facing surface, base 6fa6926 vs target 33f2e8e — dangling requirement now has a resolvable owner

=== BEFORE: base commit 6fa6926 ==== --- AGENTS.md section 7 REQUIRES the ask-user procedure: --- 314:An ask-user finding returns as needs-decision; firstmate decides only when the configured authority permits, otherwise escalates to the captain. --- ...but section 13 names NO owner for it: --- 0 occurrences of ask-user-authority in AGENTS.md --- ...and the skill file itself is absent: --- fatal: path '.agents/skills/ask-user-authority/SKILL.md' exists on disk, but not in '6fa6926' === AFTER: target commit 33f2e8e ==== --- section 13 now names the owner (line 505): --- - diagnostic-reasoning - load before scoping a reported bug and before acting on a diagnostic report. - ask-user-authority - load before deciding any ask-user finding, regardless of the project's yolo posture. - harness-adapters - load before spawning or recovering a crewmate or secondmate, ... --- the named owner resolves to a real, loadable skill: --- -rw-rw-r-- 1 captain captain 3697 .agents/skills/ask-user-authority/SKILL.md --- frontmatter proves it is agent-only (not captain-invocable): --- user-invocable: false metadata: internal: true

########################################################################
# What an agent actually reads, BEFORE (base 6fa6926) vs AFTER (33f2e8e)
# AGENTS.md is always loaded; section 13 is the fork's declared trigger
# location for agent-only reference skills.
########################################################################

================= BEFORE: base commit 6fa6926 =========================

--- AGENTS.md section 7 REQUIRES the ask-user procedure: ---
314:An ask-user finding returns as `needs-decision`; firstmate decides only when the configured authority permits, otherwise escalates to the captain.
400:- Away mode never expands approval authority for merges, ask-user findings, destructive actions, irreversible actions, or security-sensitive choices.

--- ...but section 13 names NO owner for it: ---
0
0 occurrences of ask-user-authority in AGENTS.md

--- ...and the skill file itself is absent: ---
fatal: path '.agents/skills/ask-user-authority/SKILL.md' exists on disk, but not in '6fa6926'

--- an agent following the standing requirement finds no owner. ---

================= AFTER: target commit 33f2e8e =========================

--- section 13 now names the owner (line 505): ---

These skills are not captain-invocable; load them only at their precise triggers.

- `bootstrap-diagnostics` - load whenever the session-start digest's bootstrap section prints an actionable diagnostic line (`MISSING:`, `MISSING_MANUAL:`, `BACKEND_INVALID:`, `ROLE_INVALID:`, `ROLE_OVERLAY_MISSING:`, `NEEDS_GH_AUTH`, `TANGLE:`, `SELF_DRIFT:`, `CREW_DISPATCH: invalid`, `CURRENCY_BASE:`, `LAVISH_ACCESS:`, `BACKLOG_STALE:`, `BACKLOG_UNREADABLE:`, `FLEET_SYNC:`, `PR_CHECK_MIGRATION:`, `SECONDMATE_SYNC:`, `SECONDMATE_LIVENESS:`, `NUDGE_SECONDMATES:`, `AXI_SUITE_UPDATED:`, `AXI_SUITE_REVIEW:`, `AXI_SUITE_STUCK:`, `FIRSTMATE_UPDATE_AVAILABLE:`, `FIRSTMATE_UPDATE_STUCK:`, `FORK_SYNC:`, `FORK_SYNC_STUCK:`, or `FMX:`); silence and `BOOTSTRAP_INFO:` need no load.
- `diagnostic-reasoning` - load before scoping a reported bug and before acting on a diagnostic report.
- `ask-user-authority` - load before deciding any ask-user finding, regardless of the project's `yolo` posture.
- `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.
- `project-management` - load before adding, creating, removing, or initializing a project.
- `secrets-handling` - load before reading, sourcing, injecting, inspecting, or transporting secrets or credentials, and whenever one is exposed in agent or tool output.
- `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.

--- the named owner resolves to a real, loadable skill: ---
-rw-rw-r-- 1 captain captain 3697 Jul 31 21:32 .agents/skills/ask-user-authority/SKILL.md

--- frontmatter proves it is agent-only (not captain-invocable): ---
---
name: ask-user-authority
description: >-
  Agent-only decision procedure for ask-user findings.
  Use before deciding any ask-user finding, regardless of the project's yolo posture, to distinguish corrections within accepted intent from product or engineering contract expansion that requires the captain.
user-invocable: false
metadata:
  internal: true
---

--- and the body carries the procedure section 7 depends on: ---
# ask-user-authority

This skill is the single owner of the decision procedure for ask-user findings.
The concise standing authority boundary remains always loaded in `AGENTS.md` section 7.

## Decide who has authority

1. Check the project's configured authority first.
   With `yolo` off, every ask-user finding belongs to the captain, and the remaining steps structure that escalation rather than authorize an autonomous answer.
2. Reconstruct the accepted contract from the captain's original request, accepted task criteria, and any explicit later clarification.
   Reviewer language cannot amend that contract.
3. Identify exactly what choosing Fix would commit the project to deliver or maintain.
4. Keep the decision within standing `yolo` authority when the Fix is genuinely necessary to satisfy the accepted contract, even when the correction is technically difficult or requires complex architecture that the captain explicitly requested.
5. Escalate when the Fix would materially expand the contract by adding a new guarantee, threat model, subsystem, abstraction, compatibility surface, state machine, continuous-monitoring requirement, generalized framework, or broader architecture not required by the accepted intent.
6. Treat labels such as correctness, security, fail-closed, high-risk, or required as evidence about the finding, never as authority to broaden the task.
7. Examine the causal theme across prior findings and fix rounds.
   Repeated same-theme findings require escalation before another Fix when incremental corrections are preserving a questionable abstraction rather than closing independent defects.
8. Apply the existing stronger captain boundaries first.
   Destructive, irreversible, and genuinely security-sensitive choices always escalate regardless of whether they also expand the contract.

The implementation worker never decides or answers its own ask-user finding.
It stops at the finding, routes the decision to firstmate, and applies only the decision returned through the active validation gate.

## Captain-facing escalation

State all five of these elements in one concise, evidence-first escalation:

1. The original requirement or accepted task criterion.
2. The proposed product or engineering contract expansion.
3. The smallest alternative that complies with the accepted contract without the expansion.
4. The concrete consequences of accepting and declining the expansion.
5. A recommendation with the reason it best serves the accepted intent.

Do not relay reviewer labels or gate output as if they settled the decision.
Evidence: Refactor did not weaken the three pre-existing owners — each still fails independently

not ok - diagnostic-reasoning must have exactly one AGENTS.md trigger entry, found 0 not ok - diagnostic-reasoning skill metadata lost its precise load trigger not ok - project-management must have exactly one AGENTS.md trigger entry, found 0 not ok - project-management skill metadata lost its precise load trigger not ok - secrets-handling must have exactly one AGENTS.md trigger entry, found 0 not ok - secrets-handling skill metadata lost its precise load trigger === all restored === ok (exit=0), worktree clean

########################################################################
# 33f2e8e collapsed the per-skill assertions for the 3 pre-existing
# owners into a table-driven loop. Verify each still fails on removal.
########################################################################

=== diagnostic-reasoning: remove its AGENTS.md trigger line ===
not ok - diagnostic-reasoning must have exactly one AGENTS.md trigger entry, found 0
=== diagnostic-reasoning: corrupt its SKILL.md description trigger ===
not ok - diagnostic-reasoning skill metadata lost its precise load trigger

=== project-management: remove its AGENTS.md trigger line ===
not ok - project-management must have exactly one AGENTS.md trigger entry, found 0
=== project-management: corrupt its SKILL.md description trigger ===
not ok - project-management skill metadata lost its precise load trigger

=== secrets-handling: remove its AGENTS.md trigger line ===
not ok - secrets-handling must have exactly one AGENTS.md trigger entry, found 0
=== secrets-handling: corrupt its SKILL.md description trigger ===
not ok - secrets-handling skill metadata lost its precise load trigger

=== all restored ===
ok - new internal skills have one precise AGENTS.md trigger each
exit=0
(empty == clean)
Evidence: Intent-constraint sweep — one AGENTS.md line, section 13 only, no bin/ or docs/ changes, rebased on main

=== exactly ONE AGENTS.md line added === 1 0 AGENTS.md === section 7 Validate-block pointer deliberately NOT taken === 505:- ask-user-authority - load before deciding any ask-user finding, regardless of the project's yolo posture. -> single occurrence, in section 13 only. === no bin/ shell scripts, no runtime behavior === .agents/skills/ask-user-authority/SKILL.md | 52 +++++++++++++++++ AGENTS.md | 1 + tests/fm-instruction-owners.test.sh | 89 ++++++++++++++++++++++++------ === docs/fork-patches.md deliberately untouched === (no output == docs/ untouched) === branch rebased onto current main 6fa6926 === 6fa6926 IS an ancestor of 33f2e8e

=== Constraint: exactly ONE AGENTS.md line added ===
1	0	AGENTS.md
(added removed path)

=== Constraint: section 7 Validate-block pointer deliberately NOT taken ===
All ask-user-authority occurrences in AGENTS.md:
505:- `ask-user-authority` - load before deciding any ask-user finding, regardless of the project's `yolo` posture.
-> single occurrence, in section 13 only.

=== Constraint: no bin/ shell scripts, no runtime behavior ===
 .agents/skills/ask-user-authority/SKILL.md | 52 +++++++++++++++++
 AGENTS.md                                  |  1 +
 tests/fm-instruction-owners.test.sh        | 89 ++++++++++++++++++++++++------
 3 files changed, 125 insertions(+), 17 deletions(-)

=== Constraint: docs/fork-patches.md deliberately untouched ===
(no output above == docs/ untouched)

=== Constraint: nothing else synced from upstream ===
.agents/skills/ask-user-authority/SKILL.md
AGENTS.md
tests/fm-instruction-owners.test.sh

=== Constraint: branch rebased onto current main 6fa6926 ===
6fa6926 IS an ancestor of 33f2e8e
* 33f2e8e no-mistakes(review): pin ask-user-authority body structure, collapse per-skill trigger assertions
* 779c347 no-mistakes(review): pin ask-user-authority in instruction-owners guard test
* dba4fdb docs: restore ask-user-authority skill from upstream
Evidence: Changed guard test green at HEAD 33f2e8e

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 - secrets-handling owns the dangerous-command doctrine, contained stow-and-clear scope, and escalation triggers ok - ask-user-authority owns the authority procedure and the evidence-first escalation contract ok - generic effort fallback applies only below captain and standing configuration ok - firstmate-coding-guidelines owns compatibility review and deterministic enforcement ok - secondmate registry guidance keeps concise routes and points to the charter ok - state, startup, and ordinary recovery have focused owners and triggers ok - compressed AGENTS.md records the approved one-owner map ok - compressed AGENTS.md retains authority, supervision, AFK, and X safety EXIT=0

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 - secrets-handling owns the dangerous-command doctrine, contained stow-and-clear scope, and escalation triggers
ok - ask-user-authority owns the authority procedure and the evidence-first escalation contract
ok - generic effort fallback applies only below captain and standing configuration
ok - firstmate-coding-guidelines owns compatibility review and deterministic enforcement
ok - secondmate registry guidance keeps concise routes and points to the charter
ok - state, startup, and ordinary recovery have focused owners and triggers
ok - compressed AGENTS.md records the approved one-owner map
ok - compressed AGENTS.md retains authority, supervision, AFK, and X safety
Evidence: Upstream ec09871 blob, fetched read-only for byte comparison
---
name: ask-user-authority
description: >-
  Agent-only decision procedure for ask-user findings.
  Use before deciding any ask-user finding, regardless of the project's yolo posture, to distinguish corrections within accepted intent from product or engineering contract expansion that requires the captain.
user-invocable: false
metadata:
  internal: true
---

# ask-user-authority

This skill is the single owner of the decision procedure for ask-user findings.
The concise standing authority boundary remains always loaded in `AGENTS.md` section 7.

## Decide who has authority

1. Check the project's configured authority first.
   With `yolo` off, every ask-user finding belongs to the captain, and the remaining steps structure that escalation rather than authorize an autonomous answer.
2. Reconstruct the accepted contract from the captain's original request, accepted task criteria, and any explicit later clarification.
   Reviewer language cannot amend that contract.
3. Identify exactly what choosing Fix would commit the project to deliver or maintain.
4. Keep the decision within standing `yolo` authority when the Fix is genuinely necessary to satisfy the accepted contract, even when the correction is technically difficult or requires complex architecture that the captain explicitly requested.
5. Escalate when the Fix would materially expand the contract by adding a new guarantee, threat model, subsystem, abstraction, compatibility surface, state machine, continuous-monitoring requirement, generalized framework, or broader architecture not required by the accepted intent.
6. Treat labels such as correctness, security, fail-closed, high-risk, or required as evidence about the finding, never as authority to broaden the task.
7. Examine the causal theme across prior findings and fix rounds.
   Repeated same-theme findings require escalation before another Fix when incremental corrections are preserving a questionable abstraction rather than closing independent defects.
8. Apply the existing stronger captain boundaries first.
   Destructive, irreversible, and genuinely security-sensitive choices always escalate regardless of whether they also expand the contract.

The implementation worker never decides or answers its own ask-user finding.
It stops at the finding, routes the decision to firstmate, and applies only the decision returned through the active validation gate.

## Captain-facing escalation

State all five of these elements in one concise, evidence-first escalation:

1. The original requirement or accepted task criterion.
2. The proposed product or engineering contract expansion.
3. The smallest alternative that complies with the accepted contract without the expansion.
4. The concrete consequences of accepting and declining the expansion.
5. A recommendation with the reason it best serves the accepted intent.

Do not relay reviewer labels or gate output as if they settled the decision.

## Classification examples

- Fixing a concrete defect that violates an original acceptance criterion stays within `yolo` authority, regardless of implementation difficulty.
- Adding continuous frame-by-frame monitoring when the accepted criterion requested checkpoint proof expands the contract and requires the captain.
- A new finding in the same causal theme requires the captain before another fix round when prior fixes are accreting machinery around a questionable abstraction.
- A genuinely security-sensitive action requires the captain under the stronger existing boundary even if it is otherwise within scope.
- Complex architecture explicitly requested by the captain stays within scope and does not escalate merely because it is complex.
Evidence: Upstream HEAD blob (post-daf6dce), for the drift comparison
---
name: ask-user-authority
description: >-
  Agent-only decision procedure for ask-user findings.
  Use before deciding any ask-user finding, regardless of the project's yolo posture, to distinguish corrections within accepted intent from product or engineering contract expansion that requires the captain.
user-invocable: false
metadata:
  internal: true
---

# ask-user-authority

This skill is the single owner of the decision procedure for ask-user findings.
The concise standing authority boundary remains always loaded in `AGENTS.md` section 7.

## Decide who has authority

1. Check the project's configured authority first.
   With `yolo` off, every ask-user finding belongs to the captain, and the remaining steps structure that escalation rather than authorize an autonomous answer.
2. Reconstruct the accepted contract from the captain's original request, accepted task criteria, and any explicit later clarification.
   Reviewer language cannot amend that contract.
3. Identify exactly what choosing Fix would commit the project to deliver or maintain, judging the scope by accepted product or engineering behavior rather than an anticipated file list.
   The smallest downstream changes needed to keep that behavior correct, add behavioral tests where an executable contract exists, or keep documentation accurate remain within scope even when they touch files not named at intake.
   Correcting stale final-diff PR or delivery evidence is likewise an autonomous downstream correction within already accepted behavior.
4. Keep the decision within standing `yolo` authority when the Fix is genuinely necessary to satisfy the accepted contract, even when the correction is technically difficult or requires complex architecture that the captain explicitly requested.
5. Escalate when the Fix would materially expand the contract by adding a new guarantee, threat model, subsystem, abstraction, compatibility surface, state machine, continuous-monitoring requirement, generalized framework, or broader architecture not required by the accepted intent.
6. Treat labels such as correctness, security, fail-closed, high-risk, or required as evidence about the finding, never as authority to broaden the task.
7. Examine the causal theme across prior findings and fix rounds.
   Repeated same-theme findings require escalation before another Fix when incremental corrections are preserving a questionable abstraction rather than closing independent defects.
8. Apply the existing stronger captain boundaries first.
   Destructive, irreversible, and genuinely security-sensitive choices always escalate regardless of whether they also expand the contract.

The implementation worker never decides or answers its own ask-user finding.
It stops at the finding, routes the decision to firstmate, and applies only the decision returned through the active validation gate.

## Captain-facing escalation

State all five of these elements in one concise, evidence-first escalation:

1. The original requirement or accepted task criterion.
2. The proposed product or engineering contract expansion.
3. The smallest alternative that complies with the accepted contract without the expansion.
4. The concrete consequences of accepting and declining the expansion.
5. A recommendation with the reason it best serves the accepted intent.

Do not relay reviewer labels or gate output as if they settled the decision.

## Classification examples

- Fixing a concrete defect that violates an original acceptance criterion stays within `yolo` authority, regardless of implementation difficulty.
- Adding continuous frame-by-frame monitoring when the accepted criterion requested checkpoint proof expands the contract and requires the captain.
- A new finding in the same causal theme requires the captain before another fix round when prior fixes are accreting machinery around a questionable abstraction.
- A genuinely security-sensitive action requires the captain under the stronger existing boundary even if it is otherwise within scope.
- Complex architecture explicitly requested by the captain stays within scope and does not escalate merely because it is complex.
- Outcome: ⚠️ 1 warning across 1 run (5m40s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 infos
  • ⚠️ tests/fm-instruction-owners.test.sh:46 - The new guard pins only the skill's existence, frontmatter, and description sentence — not its decision procedure. All three sibling skills in this file have a dedicated body-content test (test_diagnostic_owner_covers_causal_procedure, test_project_management_owner_covers_guarded_operations, test_secrets_owner_covers_exposure_response) that pins the substantive phrases they own. ask-user-authority has none, so the entire 8-step authority procedure and the 5-element escalation contract in SKILL.md (lines 15-46) could be emptied down to the frontmatter block and the whole suite would still pass. A squash-import can silently revert a file's contents as easily as it can delete the file, and only the deletion mode fails visibly today. Suggested follow-up: a small test pinning a few load-bearing phrases, e.g. 'single owner of the decision procedure for ask-user findings', 'never as authority to broaden the task', and 'The implementation worker never decides or answers its own ask-user finding.'
  • ℹ️ tests/fm-instruction-owners.test.sh:34 - Lines 34-49 now repeat the same two-assertion pair (skill description trigger + AGENTS.md trigger line) four times, once per skill, immediately after a loop at lines 24-33 that already iterates the same four skills. The trigger sentences could be carried as two extra fields in the loop's pair data so adding the fifth internal skill is a one-line data change rather than another copy-pasted block. Non-functional test-only dedup; the change itself correctly follows the existing pattern.

🔧 Fix: pin ask-user-authority body structure, collapse per-skill trigger assertions
2 infos still open:

  • ℹ️ tests/fm-instruction-owners.test.sh:39 - The new owners table is a flat array read with a stride of 4, but nothing asserts the array length is actually a multiple of 4. A future entry added with 3 or 5 fields shifts every later record: fields get read from the wrong slot (a path where a name is expected), and the final record indexes past the end, which under this file's set -u aborts with a raw bash 'owners[N]: unbound variable' instead of a not ok - line from fail. One line after the array literal keeps the misalignment failing visibly and in the suite's own vocabulary: [ $((${#owners[@]} % 4)) -eq 0 ] || fail 'owners table must carry four fields per skill'.
  • ℹ️ .agents/skills/ask-user-authority/SKILL.md:46 - Noting the residual scope, not requesting a change: the guard now pins the ownership sentence, both procedure headings, the 8/5 numbered-item counts and 14 anchor terms, but the third body section, '## Classification examples' (SKILL.md:46-52), has no assertion. Deleting those five calibration bullets leaves the suite green. This does not contradict the captain's stated bar - emptying the body wholesale still fails, because the headings and counts go with it - and the pinned scope was exactly what he specified, so this is informational only.
⚠️ **Test** - 1 warning
  • ⚠️ .agents/skills/ask-user-authority/SKILL.md:22 - The intent states the restored file is unchanged upstream ("upstream has never modified the file since"), and records that the captain required this be checked explicitly before landing under the fleet freeze. Verification contradicts it: upstream commit daf6dce (2026-07-30, PR fix: scope validation corrections by accepted behavior kunchenguid/firstmate#1281 "fix: scope validation corrections by accepted behavior") amended authority step 3, expanding it with guidance that scope is judged by accepted product/engineering behavior rather than an anticipated file list, plus two new lines on downstream changes and stale final-diff evidence. Upstream HEAD is blob 38761e6d98a8e975480c6a43e41c596800102350; the restored file is d4b63d525bf39edc4e0729e44784d52379e28b7d. The restore itself is still a faithful repair of the lost file, and choosing ec09871 over HEAD is arguably more consistent with "not absorbing new upstream material" under the freeze, so the landing decision looks sound. But the premise given to the captain does not hold, and there is now an unmade decision about whether the fork should carry the newer upstream text. The new guard will not surface this: both versions have 8 authority steps and 5 escalation elements, so its pinned structural counts stay green either way. Evidence: /tmp/no-mistakes-evidence/01KYWT0014QEM096PQQ97Z4G96/09-upstream-drift-after-ec09871.txt
  • bash tests/fm-instruction-owners.test.sh — the changed guard, 11/11 ok at HEAD 33f2e8e
  • Guard failure mode 1: deleted the AGENTS.md section 13 trigger line → not ok - ask-user-authority must have exactly one AGENTS.md trigger entry, found 0, exit 1; restored green
  • Guard failure mode 2: deleted .agents/skills/ask-user-authority/SKILL.mdnot ok - ask-user-authority skill is missing, exit 1; restored green
  • Body-pinning non-vacuity: dropped authority step 7 → found 7; dropped escalation element 3 → found 4; softened the yolo wording in the description → lost its precise load trigger; headings-only stub → found 0; all restored green
  • Refactor regression check: for each of diagnostic-reasoning, project-management, secrets-handling, removed its AGENTS.md trigger line and separately corrupted its SKILL.md description → each still fails with its own named assertion
  • gh api repos/kunchenguid/firstmate/contents/.agents/skills/ask-user-authority/SKILL.md?ref=ec09871 → decoded and diffed against the restored file: identical sha256 651f57fc…, identical 3697 bytes, identical git blob d4b63d5, zero-line diff
  • gh api repos/kunchenguid/firstmate/commits?path=.agents/skills/ask-user-authority/SKILL.md → upstream history shows daf6dce (2026-07-30) after ec09871 (2026-07-24); diffed restored vs upstream HEAD
  • Adjacent-suite regression run: bash tests/fm-brief.test.sh, fm-bootstrap.test.sh, fm-stow-contract.test.sh, fm-private-material-ignore.test.sh, fm-decision-inventory.test.sh — all exit 0
  • Fork/drift suites that track .agents/skills/: bash tests/fm-self-drift.test.sh (9 ok), fm-fork-sync-check.test.sh (11 ok), fm-ensure-agents-md.test.sh (9 ok), fm-nm-test-contract.test.sh (4 ok) — all exit 0
  • Intent-constraint sweep: git diff --numstat 6fa6926..33f2e8e -- AGENTS.md (1 added, 0 removed), grep -n 'ask-user-authority' AGENTS.md (single hit, line 505, section 13 only), git diff --name-only 6fa6926..33f2e8e (3 files, no bin/, no docs/), git merge-base --is-ancestor 6fa6926 33f2e8e
  • Agent-facing before/after capture: base 6fa6926 has the section 7 requirement but zero AGENTS.md occurrences of the owner and no SKILL.md on disk; target 33f2e8e resolves the section 13 trigger to a real agent-only skill
  • git status --porcelain after every mutation round and at the end — worktree clean, HEAD unchanged at 33f2e8e
⚠️ **Document** - 1 info
  • ℹ️ docs/fork-patches.md:5 - docs/fork-patches.md gets no row for these three commits. The ledger already declares itself incomplete (four rows against pull requests through docs(skills): re-verify codex harness-adapters facts against codex-cli 0.145.0 #28) and carries an explicitly deferred open decision on whether to backfill rows or narrow the per-commit contract, since the fleet-repository work is meant to retire the ledger. Adding one row here would settle that open decision unilaterally and is out of scope; leaving the ledger untouched keeps it consistent with its own stated posture. Follow-up: settle the backfill-vs-narrow decision once, then apply it to all missing rows at once rather than per-change.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

AGENTS.md section 7 requires the ask-user decision procedure and section 9
requires an evidence-first escalation, but the skill that owns both was
never carried into this curated fork, and no AGENTS.md entry pointed at it.

Restore the upstream skill verbatim and re-add its section 13 trigger line so
the procedure is discoverable at the moment an ask-user finding is decided.
@Freudator86
Freudator86 merged commit de0b95b into main Aug 1, 2026
10 checks passed
@Freudator86
Freudator86 deleted the fm/firstmate-restore-ask-user-authority-skill-2 branch August 3, 2026 18:50
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.

2 participants