fix: _apply_links overwrites related_skills regardless of current value#16
Open
bipinhcs11 wants to merge 1 commit into
Open
fix: _apply_links overwrites related_skills regardless of current value#16bipinhcs11 wants to merge 1 commit into
bipinhcs11 wants to merge 1 commit into
Conversation
… value Previously the `related_skills:` frontmatter was only rewritten when its current value was a placeholder sentinel (`none`, `PLACEHOLDER`, or `[PLACEHOLDER]`). A second `link-ingest` run — e.g. after the Phase 2 updater triggers a re-link — silently left the frontmatter stale while still rewriting the body Related Skills table, making frontmatter and body inconsistent without any error or warning. Fix: replace the placeholder-only regex with `.*` so any existing value is overwritten. Guard with `if joined:` so an empty link list doesn't blank out the field. Adds `test_existing_real_value_overwritten` to pin the correct behaviour. Co-Authored-By: Claude Sonnet 4.6 <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.
What and why
_apply_linksinlink.pyupdates two things in a SKILL.md when cross-domain links are found:related_skills:frontmatter field## Related Skillsbody tableThe body table was always rewritten correctly. But the frontmatter was only updated when its current value was a placeholder sentinel —
none,PLACEHOLDER, or[PLACEHOLDER]. Any other value (including real skill IDs written by a previouslink-ingestrun) was silently left stale.Concrete failure mode
link-ingestsetsrelated_skills: invoice-compare✓link-ingestre-runs with a new link topayment-methodrelated_skills: invoice-compare(stale); body table sayspayment-method(correct) — inconsistent, no errorrelated_skills: payment-methodChanges
tools/skill_generator/link.pyrelated_skills:regex from placeholder-only to.*; addedif joined:guard so an empty link list doesn't blank the fieldtests/test_link.pytest_existing_real_value_overwrittenregression testAll 173 tests pass (172 existing + 1 new).
Follow-ups spotted (not in this PR)
_extract_properties_prefixesincrawler.pycomputes atopvariable that is never used (dead code), and the docstring falsely claims it filters byCONFIG_PREFIXES_OF_INTEREST. Separate cleanup PR.CONFIG_PREFIXES_OF_INTERESTconstant is defined incrawler.pybut never referenced in code — either wire it in or remove it.Generated by Claude Code