Skip to content

feat(skf-update-skill): restate a waiting joined gotchas value on an unchanged source - #1275

Merged
armelhbobdad merged 4 commits into
mainfrom
fix/update-restate-gotchas
Nov 19, 2026
Merged

armelhbobdad merged 4 commits into
mainfrom
fix/update-restate-gotchas

Conversation

@armelhbobdad

@armelhbobdad armelhbobdad commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1269.

Release target: minor. The new update-restate-gotchas-unchanged-source.yaml fragment is changed, since an update that used to end no-changes can now write a version and end success, and the other new fragment is fixed.

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 ended no-changes with nothing written, and the next export dropped the value as already-carried. From then on the value was gone from the prior line, gotchas prior returned 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 prior call, through a new rebuildManagedSectionsProbeOrder that 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 Summary row or Quick Start await call 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.

  • A plain run displays one line ("Source unchanged, but a joined gotchas value is being restated ...") and goes on to re-extraction with the empty change manifest, skipping §5. It goes through step 3 rather than straight to merge because merge, write and verify read {run_dir}/reextract-records.json. On the empty manifest re-extraction writes empty records and apply changes 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 status success.
  • A --detect-only or --dry-run run keeps the shortcut, writes nothing and warns gotchas-not-restated. The update envelope schema's warnings description lists the code.
  • Every other no-change run takes the shortcut as before, with no new warning: one whose gate does not hold, and one whose call fails or finds no helper path.

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-version or skill brief names a higher version (#1261) records it on this route although no document changed, and gets no target-version-not-recorded.

The export warnings (generate-snippet.md §3a, which update-skill's write.md §5 also relays into its own report):

  • gotchas_carried now says that, for a value that joins several pitfalls in a single skill, an update-skill run without --detect-only or --dry-run before 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_stale no 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 Summary row 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

  • New update-restate-gotchas-unchanged-source.yaml (changed, skf-update-skill): the run past the shortcut, its new version and success, the docs-only version case, and gotchas-not-restated on a read-only run.
  • New 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.
  • The link commit adds this pull request's number to each new fragment's prs once it opens.

Tests

  • New Update Skill restates a joined prior gotchas value only on a run that reaches merge, so a re-run on an unchanged source leaves it for the next export to drop, and the drop warning still sends the user to Update Skill #1269 section in test-skf-update-restate-gotchas.py, five tests (18 cases):
    • §4: the gate's clauses in order before the shortcut's display block, one gotchas prior call, the probe order equal to merge.md's, the schema entry, the two docs sentences, and that wordings the review found wrong are gone.
    • Carry, an unchanged-source update and the next export, modelled with the rebuild helper: a plain run restates a to d and the next export keeps a; b; c with d left off; a read-only run leaves the value to be dropped. The drop warning that run relays carries its "not yet" condition.
    • 12 cases for when the gate holds: a carried or not-yet-carried joined value does; no gotchas line, single pitfalls, one pitfall whose wording holds a , , 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.py build and apply on the empty manifest, normal and docs-only (records too in normal mode), apply given the manifest, the records, --metadata-in and --lists-out, which write.md §3 passes in every mode: no file record, no provenance entry changed, counts 0.
    • A changed source still routes through §5.
  • 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_RESTATE is pinned after CARRY_PROMISE, with the stack-skill route and init.md's stack guard; DROP_COMES_BACK takes the new sentence.
  • No fail-before run is recorded. The base has none of the §4 or §3a prose these tests pin, and the apply test pins helper behaviour the base already had, which is why no helper changed.

The pre-commit hook ran the full npm test for each commit.

Review

Four rounds, each with a blind hunter, an edge-case hunter and a verification-gap audit.

  • Patched:
    • Round 1 (24 findings): the gate's actions were not tied to its condition, so every no-change run would have gone on or warned; its parts check missed T2-future annotations; the display line and carry advice promised every pitfall a slot on a 3-slot line; the drop advice's row and Quick Start routes were edits an update can undo.
    • Round 2 (23): the gate reworded Priority 9's rule and lost two of its limits, so one pitfall holding a , , 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.
    • Round 3 (25): the restate run's own report relayed a drop warning saying update-skill cannot restate the value it had just restated, and asked for those bullets by hand; the drop warning is now forward-looking and conditional. Also the display line's slot wording and concepts.md's "one or more pitfalls".
    • Round 4 (21): a test docstring overclaimed which apply flags the test passes.
  • Deferred:
    • A restate-only run ends success with files_modified and exports_affected 0: report.md §2 and the result summary carry no gotchas_restated, so a pipeline that skips re-testing or re-exporting on no-changes sees success with no cause named.
    • Unverified: in an update run the relayed left_off and dropped warnings 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.
  • Rejected (mostly carried from round to round): a read-only run whose gate held still shows the "no update needed" block beside the new warning; a failing gotchas prior call 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-report and no gap restates nothing, which is why the advice names a plain run.

🤖 Generated with Claude Code

armelhbobdad and others added 4 commits November 19, 2026 15:36
… 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>
@armelhbobdad
armelhbobdad marked this pull request as ready for review November 19, 2026 20:17
@armelhbobdad
armelhbobdad merged commit 484edd0 into main Nov 19, 2026
10 checks passed
@armelhbobdad
armelhbobdad deleted the fix/update-restate-gotchas branch November 19, 2026 20:18
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant