Reform publish: reference-chain only inclusion (replaces flat-mirror)#16
Open
electricessence wants to merge 1 commit into
Open
Reform publish: reference-chain only inclusion (replaces flat-mirror)#16electricessence wants to merge 1 commit into
electricessence wants to merge 1 commit into
Conversation
Background: 0.1.4 changed inclusion semantics from reference-walk-only to flat-mirror-all-non-denied to fix tool-bundling gaps. That fix was an overcorrection — session notes (research.md, redundancy-audit.md, draft tasks) rode along into every release dist because they sat in skill folders. Operator: "reachable from SKILL.md via reference chain, period." Restore reference-chain-only semantics with a hardened walker: - New helpers: Get-RefsFromContent (backtick-quoted spans + shell-command bare-name patterns), Build-InclusionSet (BFS walk from SKILL.md as root). - Walk admits a file if: ref pattern matches AND file exists AND not denied AND within sourceRoot AND not under a dot-ancestor. `.md`/`.txt` files are recursively scanned for more refs. - Change-detection loop (lines 184–191) now uses Build-InclusionSet so the manifest delta reflects what the new build would actually ship. - Build-dist loop now copies only files in the inclusion set; tracks $totalExcluded separately from $totalDenied. deny-list.ps1: fixed dead-code bug where `*.uncompressed.md` was added to a HashSet[string] (literal match only, never wildcard). Moved to $DenyPatterns where `-like` matches. Now correctly catches `eval.uncompressed.md` and similar variants. New file: tools/publish-rule.spec.md — formal spec for inclusion semantics. Companion changes in skills repo (separate commit/branch): three SKILL.md files (messaging, markdown-hygiene-lint, hash-record-prune) had tool refs that weren't reachable under strict ref-walk; added explicit backtick refs so co-located scripts stay in the inclusion set. Co-Authored-By: Claude Opus 4.7 <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.
Summary
Restore reference-chain-only semantics in
tools/publish.ps1. Files ship if and only if they are reachable from a skill'sSKILL.mdvia the reference chain. Eliminates the 0.4.0 dist leaks (research.md,redundancy-audit.md, draft task files, etc.).Operator framing: "reachable from SKILL.md via reference chain, period."
What changed
tools/publish.ps1— flat-mirror replaced with BFS walker (Build-InclusionSet) that follows two ref patterns: backtick-quoted spans and shell-command bare names. Change-detection and build-dist both use the walker.build/deny-list.ps1— fixed wildcard bug where*.uncompressed.mdwas added toHashSet[string](literal match only). Moved to$DenyPatterns(-likematch works).tools/publish-rule.spec.md— new formal spec for inclusion semantics.Companion change (skills repo)
Three SKILL.md files had tool refs that weren't reachable under strict walk; explicit backtick refs need to be added in skills repo:
messaging/SKILL.md(8 scripts)markdown-hygiene/markdown-hygiene-lint/SKILL.md(verify scripts)hash-record/hash-record-prune/SKILL.md(prune scripts)These edits are staged locally in skills repo on a follow-up; will PR separately or fold into next dev→master loop.
Out of scope (deferred)
-BuildOnlyflag to let operator audit dist diff before commit (separate PR; planned for next pass).Test plan
🤖 Generated with Claude Code