fix(resume): validate --task slug before overwriting _active.md (v3.4.14) - #242
Merged
Conversation
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
Found during the adversarial review round of #241:
/resume --task=<slug>(resume SKILL.md Step 1.3) overwrote the active-thread pointer_active.mdBEFORE Step 2 checked whether any pause file exists for that slug. A mistyped slug therefore rewrote the pointer into an orphan (Step 2.3 only warns and stops), silently deactivating the previously active thread.Change
--taskslug is now checked before the pointer is touched — the pause-file glob must return ≥1 match; on zero matches/resumereports "No pause file found — active thread unchanged" and stops without writing.--taskvalue must be plain kebab-case before it is interpolated into the glob — a value like*would otherwise match any thread's files, "pass" validation, and write a corrupt pointer. The same shape check is added at/pause --task's thread-switch entry point, closing the class at both places user-typed slugs enter the pointer/glob path (pointer-derived slugs elsewhere only ever come from these validated writers)._active.mdoverwrite itself fails,/resumestops instead of announcing a thread the pointer does not record (mirrors/pause's write-failure contract)._active.md; the "same rule as/resumeStep 2" cross-reference in pause's Auto-Finalize section is unaffected..claude-pluginand.codex-pluginmanifests) + CHANGELOG entry.Review
Risk-scaled pre-PR review: one cold adversarial pass (contract/failure-behavior — walked every
/resumepath and the/pause --taskinteraction) and one repo-consistency/deliverable pass (whole-repo stale-reference sweep, version-bump precedent, changelog accuracy). The adversarial pass's Important finding (glob-metacharacter slug) and two Minor findings (write-failure handling, step-numbering ambiguity) were fixed in the second commit; the consistency pass's changelog wording nits are folded in as well.🤖 Generated with Claude Code