fix(update-skill): write no line read from a drifted tree, and write the entry for a cited new export - #551
Merged
Conversation
…the entry for a cited new export Two gap-driven (--from-test-report) defects deferred from the review of issue 530. Under --allow-workspace-drift with HEAD off the pinned commit, a spot-check could still record moved, so write 3 wrote a source_line read at HEAD while source_commit stayed pinned, and targeted re-extraction wrote full entries from HEAD. Step 3 now keeps the drift helper's status: under the override no spot-check moves or pins a line (moved becomes unknown with a drift WARN, an R5 verified read at HEAD gets one too), the reachability check is skipped, and every gap that needs a line from the tree (rule R3, a Critical/High remediation-path gap, a Critical/High cited export not in the map) halts in step 3 with halted-for-workspace-drift before merge. The halt names the gaps, the full pinned commit and the checkout command. Write 6a keys its line fixes on the same status, merge Priority 2 moves citations only for a moved outcome, and the report, init, SKILL.md and docs describe the override that way. A cited export not held by the map whose spot-check pinned a line had no write 3 branch that added its entry, so the export was documented without provenance and 6a reported it missing. Write 3 now adds one entry at the pinned line, labeled as read by eye (source-read, T1-low, null node type, signature_source T1-low), once per export and file, after the reachability check. The name lookup now narrows same-name entries by the citation's normalized file and line. Co-Authored-By: Claude Opus 5.5 <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.
Follow-up to #530: two update-skill gap-driven (
--from-test-report) defects deferred from the reviews of #532.1. Never write a line read from a drifted tree
The bug. Under
--allow-workspace-driftwith HEAD off the pinned commit, a spot-check could still recordmoved. write §3 then wrote asource_lineread at HEAD whilesource_commitstayed pinned. Targeted re-extraction (§0a) also wrote full entries from HEAD.What changes.
{workspace_drift_status}, plus{head_short_sha}and{pinned_short_sha}). Onlyoverriddenchanges anything. The flag with HEAD at the pinned commit (ok) moves lines as before.overridden, spot-checks change no line:movedbecomesunknownwithunknown_reason: drift-overrideand a WARN that names HEAD and the pinned commit.verifiedread at HEAD also gets a WARN, carrying the definition lines from the test report, so the gap doesn't close silently.halted-for-workspace-drift, and the message names the gaps, the full pinned commit,source_refand the checkout command.blocked.movedoutcome.warnings[]getsworkspace_drift_overridden(the name the envelope schema already documents).init.md,SKILL.md,docs/verifying-a-skill.mdanddocs/workflows.mddescribe the override this way.2. Write the entry for a cited export not in the map
The bug. A cited export the map did not hold, whose spot-check pinned a line, had no write §3 branch that added its entry. The export was documented without provenance, and §6a reported it
missing.What changes.
source-read, T1-low, null node type,signature_sourceT1-low. That is the pairing the stats helper checks.[SRC:]at that line.Verification
npm testexits 0, with the real exit code: 4774 passed, 1 skipped.test/test-skf-update-source-tree-prose.pypins every rule above in eight new tests. One of them runsskf-render-metadata-stats.pyon the new entry's labels read fromwrite.md.Not verified: no live
claude -pgap-driven run with the new prose.🤖 Generated with Claude Code