Skip to content

feat(map-efficient): emit learning-handoff so deferred /map-learn auto-loads#154

Merged
azalio merged 2 commits into
mainfrom
feldspar-agave
May 30, 2026
Merged

feat(map-efficient): emit learning-handoff so deferred /map-learn auto-loads#154
azalio merged 2 commits into
mainfrom
feldspar-agave

Conversation

@azalio
Copy link
Copy Markdown
Owner

@azalio azalio commented May 30, 2026

Problem

/map-efficient was the only learning-eligible workflow that never invoked write_learning_handoff. After a (often hours-long) /map-efficient run, .map/<branch>/learning-handoff.md did not exist, so a deferred zero-argument /map-learn found no artifact and silently fell back to reconstructing the workflow summary from in-context memory ("No handoff artifact — I'll use an inline summary…"). That inline reconstruction degrades as the original run context ages out of the window.

map-check, map-debug, and map-review already emit the handoff; only map-efficient had the gap.

Change

  • .claude/skills/map-efficient/SKILL.md — add the write_learning_handoff closeout call in Step 3.3, right after write_run_health_report. Empty task_title auto-resolves via read_current_goal. Updated the closeout prose and Step 4 next-command to surface /map-learn.
  • src/mapify_cli/templates/skills/map-efficient/SKILL.md — synced byte-for-byte via make sync-templates (repo template-sync invariant).
  • tests/test_skills.py — the TestRunHealthCloseoutWiring pinned test asserted the exact 3-line backslash form of write_run_health_report; made it format-agnostic (accepts single-line and backslash-continued forms) while still catching a hardcoded-status regression.

Constraints handled

  • 500-line active-body budget (test_skills cap on HIGH_TRAFFIC_COMPACT_SKILL_REFS): the file was at exactly 500. Collapsed write_run_health_report to its single-line form to make room; final 499.
  • Codex variant (.agents/skills/map-efficient) intentionally untouchedmap-learn is not part of the Codex skill surface, so emitting a handoff there (and referencing $map-learn) would create a dangling reference.
  • Guard test negative-proofed — hardcoded the status, confirmed RED, restored, confirmed GREEN.

Verification

  • make check green: ruff ✓, mypy ✓, pyright 0/0/0 ✓, hook-lint ✓, 1787 passed, 4 skipped.
  • Ran the new CLI command directly — it parses and writes learning-handoff.md/.json as expected.

🤖 Generated with Claude Code

…o-loads

/map-efficient was the only learning-eligible workflow that never called
write_learning_handoff, so `.map/<branch>/learning-handoff.md` was absent
after a run. A deferred zero-argument /map-learn then found no artifact and
fell back to reconstructing the workflow summary from in-context memory.

Add the write_learning_handoff closeout call to map-efficient Step 3.3,
right after write_run_health_report, so the handoff bundle is produced for
every run. Empty task_title auto-resolves via read_current_goal.

To stay within the 500-line active-body budget (test_skills line cap on
HIGH_TRAFFIC_COMPACT_SKILL_REFS), collapse write_run_health_report to its
single-line form; the pinned closeout-wiring test is made format-agnostic
(accepts single-line and backslash-continued forms) while still catching a
hardcoded status regression. Negative-proofed: green->red->green.

Codex variant (.agents/skills/map-efficient) intentionally untouched —
map-learn is not part of the Codex skill surface.

Synced .claude -> templates per repo invariant. make check green
(ruff/mypy/pyright 0/0/0, 1787 passed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 30, 2026 08:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR wires /map-efficient into the existing learning handoff flow so deferred zero-argument /map-learn can load a persisted handoff after efficient runs.

Changes:

  • Adds write_learning_handoff to the /map-efficient closeout path.
  • Syncs the Claude skill template copy.
  • Loosens the run-health closeout test to allow compact and backslash-continued invocations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
.claude/skills/map-efficient/SKILL.md Adds learning handoff emission and updates closeout/summary guidance.
src/mapify_cli/templates/skills/map-efficient/SKILL.md Mirrors the skill changes for packaged templates.
tests/test_skills.py Updates run-health invocation assertions to support compact formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_skills.py
Comment on lines +1173 to +1176
assert not re.search(
"write_run_health_report" + token_gap + re.escape(skill_name)
+ token_gap + r"(?:complete|pending|blocked|won't_do|superseded)\b",
content,
Copilot review on PR #154: the hardcoded-status negative guard matched
`write_run_health_report <skill> complete` but not the quoted shell form
`write_run_health_report <skill> "complete"`, even though the surrounding
examples quote the status argument. Allow an optional leading quote before
the literal so the regression test covers both shell forms it claims to reject.

Negative-proofed: a quoted `"complete"` hardcode now turns the guard RED;
clean state stays GREEN.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@azalio azalio merged commit b85414a into main May 30, 2026
6 checks passed
@azalio azalio deleted the feldspar-agave branch May 30, 2026 08:41
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