feat(map-efficient): emit learning-handoff so deferred /map-learn auto-loads#154
Merged
Conversation
…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>
Contributor
There was a problem hiding this comment.
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_handoffto the/map-efficientcloseout 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 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>
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.
Problem
/map-efficientwas the only learning-eligible workflow that never invokedwrite_learning_handoff. After a (often hours-long)/map-efficientrun,.map/<branch>/learning-handoff.mddid not exist, so a deferred zero-argument/map-learnfound 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, andmap-reviewalready emit the handoff; onlymap-efficienthad the gap.Change
.claude/skills/map-efficient/SKILL.md— add thewrite_learning_handoffcloseout call in Step 3.3, right afterwrite_run_health_report. Emptytask_titleauto-resolves viaread_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 viamake sync-templates(repo template-sync invariant).tests/test_skills.py— theTestRunHealthCloseoutWiringpinned test asserted the exact 3-line backslash form ofwrite_run_health_report; made it format-agnostic (accepts single-line and backslash-continued forms) while still catching a hardcoded-status regression.Constraints handled
test_skillscap onHIGH_TRAFFIC_COMPACT_SKILL_REFS): the file was at exactly 500. Collapsedwrite_run_health_reportto its single-line form to make room; final 499..agents/skills/map-efficient) intentionally untouched —map-learnis not part of the Codex skill surface, so emitting a handoff there (and referencing$map-learn) would create a dangling reference.Verification
make checkgreen:ruff✓,mypy✓,pyright0/0/0 ✓, hook-lint ✓, 1787 passed, 4 skipped.learning-handoff.md/.jsonas expected.🤖 Generated with Claude Code