Repository navigation
feat(skf-update-skill): restate a waiting joined gotchas value on an unchanged source - #1275
Merged
Merged
Conversation
… apply a repeated URL once A docs-only apply returned every record it was given as exports_affected, so the records it left out (no name, no url, or on a document the map holds entries of that changed_urls does not list) were counted, although the same run's provenance warning said they were not applied. A nameless record on a URL the map held no entry of also added that URL to files_changed, though nothing was written there. A URL listed twice in changed_urls was applied twice: the entries came out right, but files_changed counted the document twice and the summary's entries.added and entries.removed named each of its exports twice. apply now folds repeated changed_urls as refresh-hashes does (exact strings, the first kept), lets only a named record add a URL the map holds no entry of, and returns the records it applied as exports_affected. The module and function docstrings say what a docs-only run's two counts are: the URLs it applied (each changed_urls URL once, and each URL a named record gives that the map held no entry of) and the records it applied, so a record left out counts toward neither. Which entries a run writes or removes, and the warning text, stay as they were. Fixes #1266 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nly update that compared none A docs-only update's compare-hashes call filed a doc_sources entry recorded with a null content hash under skipped_null_hash without fetching it, and neither the re-extraction nor refresh-hashes ever hashed it, so no update checked that page again, although the metadata step said the next update would. The docs-only manifest also set no_changes from the changed list alone, so a run that compared no document (each one unreadable or null, or no doc_sources at all) ended no-changes with "Source code matches provenance map exactly", and a run that skipped some documents never said so. compare-hashes gains --fetch-null, which Update Skill passes and Audit Skill does not: a null entry is fetched and lands in changed with old_hash null when it can be read, so the update re-reads it and records its hash, or in fetch_failed when it cannot, which warns doc-fetch-failed. Change detection now stops blocked at detect-changes:doc-hashes in every mode, --detect-only and --dry-run included, when it compared no document, naming each one with its reason (or that metadata.json records no doc_sources) and the way out; that stop replaces the doc-drift-not-checked warning. The docs-only manifest's counts add docs_tracked, docs_unchanged and docs_not_checked, and a no-change run says how many tracked documents match their recorded hashes and how many could not be checked, in place of the source-code sentence. Without the flag, compare-hashes behaves as before, so Audit Skill's doc-drift step still skips a null entry. no_changes still means the changed list is empty, and the new stop keeps a run that compared nothing from reaching it. The update envelope schema and the Update Skill docs name the stop. Fixes #1267 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unchanged source merge.md Priority 9 restates the pitfalls of a joined prior |gotchas: value as SKILL.md bullets, but only on a run that reaches merge. On an unchanged source detect-changes.md §4 took the no-change shortcut, so after an export carried such a value an Update Skill re-run ended no-changes, the next export dropped the value, and from then on `gotchas prior` returned null and no update could restate it. Export Skill's carry warning named no such run, and its drop warning sent the user to update-skill after the drop, when it could no longer help. Before the shortcut, §4 now runs Priority 9's own `gotchas prior` call and restates its rules: when Priority 9 would write at least one bullet (a joined pitfall no single place states whole, one of whose parts SKILL.md states with a citation, uncontradicted, in no gotchas-type place yet), a run without --detect-only or --dry-run goes on to re-extraction with the empty change manifest, so merge, write and verify run and a new version is written. A read-only run keeps the shortcut and warns gotchas-not-restated, which the update envelope schema lists. Export Skill's carry warning now names that update-skill run for a single skill and the by-hand route for a stack skill, which update-skill does not update, and its drop warning says to state the pitfall by hand, as a SKILL.md bullet between [MANUAL] markers or in the evidence report's T2-future section. The user docs say the same. A no-change run for which Priority 9 would write nothing, or whose call fails, takes the shortcut as before, with no new warning. On the empty manifest re-extraction writes empty records and apply changes no provenance entry, so the run records no source change. Its version is chosen as on any update that writes, so a docs-only skill records the higher version its --target-version or skill brief names. Fixes #1269 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #1269.
Release target: minor. The new
update-restate-gotchas-unchanged-source.yamlfragment ischanged, since an update that used to endno-changescan now write a version and endsuccess, and the other new fragment isfixed.Stacked on #1274: this branch holds that pull request's two commits under its own one, so merge #1274 first; the diff then shows only this change.
What was broken
Update Skill's merge Priority 9 (#1253) restates each pitfall of a joined prior
|gotchas:value as a SKILL.md bullet, so the export after an update keeps those pitfalls. It runs only when an update reaches merge. On an unchanged source, detect-changes.md §4 takes the no-change shortcut and skips steps 3 to 5, and no flag forces a run past it.So after an export carried a joined value once (
gotchas_carried), an Update Skill re-run on the same source endedno-changeswith nothing written, and the next export dropped the value asalready-carried. From then on the value was gone from the prior line,gotchas priorreturned null, and no later update, even one with source changes, had anything to restate.The export warnings did not say this. The carry warning named no run that would keep the value. The drop warning sent the user to "re-forge the skill with update-skill" after the drop, when update-skill could no longer help.
What changed
The no-change gate. Before the shortcut, detect-changes.md §4 now runs Priority 9's own
gotchas priorcall, through a newrebuildManagedSectionsProbeOrderthat matches merge.md's, and restates Priority 9's rules in §4 itself, since a step reads no later step file. The gate holds only when Priority 9 would write at least one bullet: a prior pitfall joins several pitfalls that each warn on their own; no one T2-future annotation, bullet of a section whose heading names gotchas, deprecations, migration, breaking changes or import corrections, deprecated or removed## Key API Summaryrow or Quick Startawaitcall states it whole; and SKILL.md states, with a citation and uncontradicted, one of its pitfalls that no such annotation, bullet, row or call states yet. A looser gate would write a version with no content change on every unchanged-source update.{run_dir}/reextract-records.json. On the empty manifest re-extraction writes empty records andapplychanges no provenance entry, so the run records no source change. Priority 9 writes the bullets, write.md §5 regenerates the snippet, and the run writes a new version with the statussuccess.--detect-onlyor--dry-runrun keeps the shortcut, writes nothing and warnsgotchas-not-restated. The update envelope schema'swarningsdescription lists the code.The version is chosen as on any update that writes (merge-write.md §6b, not edited): the next patch version, which is the cost the issue accepted, or
{source_version_detected}when one is bound. So a docs-only skill whose--target-versionor skill brief names a higher version (#1261) records it on this route although no document changed, and gets notarget-version-not-recorded.The export warnings (generate-snippet.md §3a, which update-skill's write.md §5 also relays into its own report):
gotchas_carriednow says that, for a value that joins several pitfalls in a single skill, an update-skill run without--detect-onlyor--dry-runbefore the next export restates in SKILL.md each of its pitfalls that SKILL.md still states with a citation, even on an unchanged source, and that the next export keeps as many of those as the line's 3 slots hold and names the rest as left off. A stack skill gets the by-hand route instead, since update-skill halts on one at its Stack Skill Guard.gotchas_dropped_staleno longer sends a dropped pitfall to update-skill. It says no update-skill run can restate one once the|gotchas:line no longer holds it and, while SKILL.md does not state it yet as a bullet of such a section, to state it by hand as one, between[MANUAL]markers so a later update keeps it, or in the evidence report's T2-future section, then export again. The "not yet" condition matters: the restate run drops the joined value right after writing its bullets, and its own report would otherwise ask for bullets SKILL.md already holds. The## Key API Summaryrow and Quick Start routes are gone from this advice, since an update can rewrite both.Docs. workflows.md (Update Skill's Headless paragraph) and concepts.md (Version Pinning: a docs-only skill's named version is also written by an update that restates such pitfalls).
detect-changes.md is 35,900 characters against the 36,000-character stage budget.
Fragments
update-restate-gotchas-unchanged-source.yaml(changed, skf-update-skill): the run past the shortcut, its new version andsuccess, the docs-only version case, andgotchas-not-restatedon a read-only run.export-gotchas-warnings-name-the-fix.yaml(fixed, skf-export-skill): what the carry warning now advises for a single and a stack skill, and the drop warning's by-hand route.prsonce it opens.Tests
test-skf-update-restate-gotchas.py, five tests (18 cases):gotchas priorcall, the probe order equal to merge.md's, the schema entry, the two docs sentences, and that wordings the review found wrong are gone.atodand the next export keepsa; b; cwithdleft off; a read-only run leaves the value to be dropped. The drop warning that run relays carries its "not yet" condition.,, a value one bullet, row or annotation states whole, and parts that are already bullets, uncited, gone or in annotations do not. Each case also pins the §4 clause it stands for.skf-build-change-manifest.pybuildandapplyon the empty manifest, normal and docs-only (recordstoo in normal mode),applygiven the manifest, the records,--metadata-inand--lists-out, which write.md §3 passes in every mode: no file record, no provenance entry changed, counts 0.test-skf-export-terminal.py: the drop-warning pin now bans "re-forge the skill with update-skill" and pins the by-hand route with its[MANUAL]markers;CARRY_RESTATEis pinned afterCARRY_PROMISE, with the stack-skill route and init.md's stack guard;DROP_COMES_BACKtakes the new sentence.applytest pins helper behaviour the base already had, which is why no helper changed.The pre-commit hook ran the full
npm testfor each commit.Review
Four rounds, each with a blind hunter, an edge-case hunter and a verification-gap audit.
,, or a value a migration bullet or removed row states whole, held the gate while Priority 9 wrote nothing (an empty version on every unchanged-source update); the docs and the update fragment left out the citation condition.applyflags the test passes.successwithfiles_modifiedandexports_affected0: report.md §2 and the result summary carry nogotchas_restated, so a pipeline that skips re-testing or re-exporting onno-changesseessuccesswith no cause named.left_offanddroppedwarnings name{resolved_skill_package}, which init.md binds to the pre-update version, so their hand-edit path may point at the superseded version. A real run's warnings would settle it; the fix lands in write.md §5 or merge-write.md §6b.gotchas priorcall takes the shortcut silently, as it did when the call never ran; the gate and Priority 9 judge separately (they match today, and a back-route in merge.md was out of scope); following the carry advice with--from-test-reportand no gap restates nothing, which is why the advice names a plain run.🤖 Generated with Claude Code