Skip to content

fix(skills): show the Next action marker in autopilot's handoff example - #3113

Merged
mlorentedev merged 2 commits into
mainfrom
fix/autopilot-handoff-next-action
Nov 3, 2026
Merged

mlorentedev merged 2 commits into
mainfrom
fix/autopilot-handoff-next-action

Conversation

@mlorentedev

@mlorentedev mlorentedev commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Closes #3110

What

The autopilot skill's exit protocol piped $BODY into dotf mem handoff-write without showing a body. An agent following it literally wrote a thread with no **Next action:**, which handoff-write warns about and still writes.

  • harness/skills/autopilot/SKILL.md (a render of the vault's 00_meta/skills/autopilot/SKILL.md; the vault edit is attached in a comment and still needs applying there): the example now shows the body as printf arguments (a heredoc terminator breaks when the example sits indented in a list item), including the **Next action:** line, with a sentence saying why it is not optional.
  • cli/internal/mem/thread.go: the warning now names the marker it looks for (no **Next action:** line, ...), so the message says what to add.
  • cli/internal/mem/skill_example_test.go (new): extracts the example body from the skill and runs it through ThreadWarnings. It fails if the example ever draws a warning. Mutation check: deleting the **Next action:** line from the skill made it fail with no Next action ... first step.

Not done, by choice: making handoff-write refuse without the marker. The code documents that a warning never blocks the write ("a handoff in an odd shape is still a handoff, and refusing it would lose it"), so a refusal is a behaviour change to a public CLI contract and belongs in its own ticket. The issue lists it as optional.

Evidence (run from cli/)

go build ./...      ok
go vet ./...        ok
gofmt -l .          (empty)
go test ./...       all packages ok
golangci-lint run   0 issues.
go test ./internal/mem -run 'TestAutopilotHandoffExample|TestThreadWarnings' -v
--- PASS: TestAutopilotHandoffExampleCarriesNextAction
--- PASS: TestThreadWarningsNameOnlyWhatIsMissingOrUnknown
dotf harness check: OK: no harness drift
bats tests/harness-generated-sha.bats: ok 1..3
bats tests/forge-skills-use-dotf-forge.bats tests/skills-pipeline.bats: all ok

Red first: before the skill edit the new test failed with autopilot SKILL.md has no printf ... | dotf mem handoff-write example.

Knowledge

  • Lesson: none: a one-line omission in a skill example, now pinned by a test.
  • ADR: none: no decision changed.
  • Runbook: none: no procedure changed.

The example piped a $BODY it never showed into handoff-write, so an agent
following it wrote a thread with no first step. Show the body, with the
**Next action:** line, and pin it: a test feeds the example's own body to
ThreadWarnings and fails if the writer would warn. The warning now names the
marker it looks for.
…e change

The skill is generated from the vault (00_meta/skills/autopilot/SKILL.md); the
declared sha now matches the body.
@mlorentedev

Copy link
Copy Markdown
Owner Author

Vault source still needs this change

harness/skills/autopilot/SKILL.md is generated from the vault (00_meta/skills/autopilot/SKILL.md), so this PR's copy is a render, and the first CI run failed the generated-sha check until I re-rendered it (dotf harness refresh against a scratch vault clone carrying the edit, keeping only the autopilot record; the unrelated insights/vault-doctor drift that refresh also reports is #3097's). The vault itself was not touched: its checkout holds other sessions' uncommitted work. Until this edit lands in the vault, the next dotf harness refresh reverts the example and the new test in cli/internal/mem goes red, which is the guard working.

Edit to apply to 00_meta/skills/autopilot/SKILL.md in the vault:

diff --git a/00_meta/skills/autopilot/SKILL.md b/00_meta/skills/autopilot/SKILL.md
index d46aa80c..c88e14d8 100644
--- a/00_meta/skills/autopilot/SKILL.md
+++ b/00_meta/skills/autopilot/SKILL.md
@@ -323,8 +323,15 @@ When the operator returns, the time window expires, the backlog empties, or a st
    ```bash
    MEMORY_MD="$(dotf env path VAULT_PATH)/10_projects/<repo>/memory/MEMORY.md"
    dotf mem thread                        # which thread am I: wt-<slug>, or main@<host>
-   printf '%s' "$BODY" | dotf mem handoff-write --memory "$MEMORY_MD" --agent <agent>
+   printf '%s\n' \
+     '> Updated: <YYYY-MM-DD><br>' \
+     '**Last task:** <what this run did, with PR numbers><br>' \
+     '**Next action:** <the one concrete first step for the next session><br>' \
+     '**Awaiting Manu:** <decisions only the operator can take; drop the line if none>' |
+     dotf mem handoff-write --memory "$MEMORY_MD" --agent <agent>
    ```
+   The `**Next action:**` line is not optional: without it `handoff-write` warns
+   "no `**Next action:**` line" and still writes the thread, so the next session starts with no first step.
    The full checklist (journal, board reconciliation, artifact summary, one next action) is
    `00_meta/skills/handoff/SKILL.md`. `--memory "$REPO_ROOT/MEMORY.md"` — which an earlier draft used —
    would write the handoff nowhere near where the next session reads it.

@mlorentedev
mlorentedev marked this pull request as ready for review November 3, 2026 05:51
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 1280b8a and 118ca75.

Files selected for processing: 4
  • cli/internal/mem/skill_example_test.go
  • cli/internal/mem/thread.go
  • cli/internal/mem/thread_test.go
  • harness/skills/autopilot/SKILL.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@mlorentedev

Copy link
Copy Markdown
Owner Author

Review triage

The PR author did this triage.

  • CodeRabbit: posted a rate-limit notice only; it names no file, line or claim, so no review ran. Nothing to apply. Disposition: declined as a review, disclosed as unreviewed by it (review-attestation reads pending for the same reason).
  • review (pr-agent): still pending when this was written, no findings posted. This PR is not claimed reviewed by it; if it posts findings I will triage them here and a new push reopens the window.
  • test / test-macos (first run): failed harness-generated-sha because the skill is a render of the vault source. Applied: re-rendered the autopilot record (118ca75); the vault edit is attached in an earlier comment and still needs applying by the owner.
  • CI otherwise green on the head.

Comment on lines +329 to +337
printf '%s\n' \
'> Updated: <YYYY-MM-DD><br>' \
'**Last task:** <what this run did, with PR numbers><br>' \
'**Next action:** <the one concrete first step for the next session><br>' \
'**Awaiting Manu:** <decisions only the operator can take; drop the line if none>' |
dotf mem handoff-write --memory "$MEMORY_MD" --agent <agent>
```
The `**Next action:**` line is not optional: without it `handoff-write` warns
"no `**Next action:**` line" and still writes the thread, so the next session starts with no first step.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Harness compliance

Class: REAL
SSOT (Standing Order #2, knowledge placement): the edited file is generated: true from 00_meta/skills/autopilot/SKILL.md, but only the render is changed here while the generator source stays stale. Concrete trace: any session that runs dotf harness refresh before the vault edit lands regenerates this file from the vault, restoring printf '%s' "$BODY" and dropping the **Next action:** line — agents again learn the broken example, and TestAutopilotHandoffExampleCarriesNextAction goes red in CI until someone re-applies the vault edit out of band. The PR discloses the pending vault edit, but as submitted the fix is one routine refresh away from being undone, and dotf harness check cannot see the divergence.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3110 - Partially compliant

Compliant requirements:

  • The autopilot skill example now prints a **Next action:** <the one concrete first step…> line, with prose stating the line is not optional and quoting the warning text.
  • The warning text now names the exact marker (no **Next action:** line …) so the message says what to add.
  • A new test extracts the example body from the skill and fails if it would draw any handoff-write warning, pinning the acceptance against regressions.

Non-compliant requirements:

  • Optional item: handoff-write still writes the thread with only a warning when the marker is missing; no refusal or non-zero exit, no --allow-no-next-action flag (declined in the PR body with a rationale).

Requires further human verification:

  • The canonical source 00_meta/skills/autopilot/SKILL.md in the vault is only attached as a PR comment and "still needs applying there" — verify the vault skill (not just the generated: true render in this repo) actually carries the **Next action:** example.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Harness compliance
Class: REAL
Definition of Done (debt fixed or ticketed): the PR body explicitly defers two items — making handoff-write refuse without the marker ("belongs in its own ticket") and applying the same example edit to the vault source 00_meta/skills/autopilot/SKILL.md ("still needs applying there") — yet neither is filed as a GitHub issue; both live only in the PR description and a comment. The rule requires each deferred defect to be fixed in scope or filed as a ticket with root cause + fix options; a mention is not an exit. The optional refusal is what the PR itself says needs a ticket, and no ticket number or URL appears anywhere in the PR as submitted.


⚙️ Agent run details
  • Model: openai/mimo-v2.6-flash
  • Tokens: 15,813 in / 15,842 out / 31,655 total
  • Time cost: 241.7s
  • AI calls: 1

@mlorentedev

Copy link
Copy Markdown
Owner Author

Review triage

The PR author did this triage. Reviewer: PR-Agent (## PR Reviewer Guide and one inline finding on 118ca751). CodeRabbit posted a rate-limit notice only, not a review.

Finding Disposition
harness/skills/autopilot/SKILL.md:337 (REAL): only the render changed; the vault source stays stale, so dotf harness refresh would undo the fix Applied outside this repo: the same edit is now in the vault source 00_meta/skills/autopilot/SKILL.md (knowledge commit c48e9a7b). A refresh now renders the same example.
Harness compliance (REAL): the deferred handoff-write refusal was not ticketed Applied: filed as #3123, which records both options. Option (a) changes the "a warning never blocks the write" contract, so the owner decides.
Ticket compliance: the optional refusal is not implemented Declined here, for the reason above; tracked in #3123.

This PR touches harness/, so it is the owner's to merge.

@mlorentedev
mlorentedev merged commit f6fd04e into main Nov 3, 2026
32 of 33 checks passed
@mlorentedev
mlorentedev deleted the fix/autopilot-handoff-next-action branch November 3, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SKILL: autopilot's handoff example omits the Next action marker handoff-write needs

1 participant