Skip to content

fix(skf-audit-skill): give an empty QMD collection setup's route, and route a stale one - #1278

Merged
armelhbobdad merged 2 commits into
mainfrom
fix/audit-empty-collection-advice
Nov 19, 2026
Merged

armelhbobdad merged 2 commits into
mainfrom
fix/audit-empty-collection-advice

Conversation

@armelhbobdad

Copy link
Copy Markdown
Owner

Fixes #1271.

Release target: patch. The only fragment is a new fixed one: the audit's advice now matches what qmd does.

What was broken

On Deep tier, Audit Skill's semantic diff (semantic-diff.md §2 item 1) probes the skill's registered extraction collection with qmd ls. When QMD listed no file for it, the step said the collection "has never been indexed" and logged "Run qmd update to (re-)index {collection.path}, then re-audit". The direct-content fallback it then took was right. The diagnosis and the advice were not:

  • qmd 2.8.3 qmd collection add indexes the folder at once, and Create Skill registers the collection only after that add succeeds. So an empty extraction collection almost always means its folder is gone (for one, a Drop Skill purge of the version Create Skill last compiled deletes it, and the next qmd update empties the collection) or holds no file its pattern matches. qmd update cannot refill it, so the same line came back on every audit, and nothing said qmd collection remove.
  • A bare qmd update takes no collection name: it re-indexes every collection on the machine and empties any whose folder is gone. The log asked for no qmd embed after it either.
  • {collection.path} was bound nowhere: a registry entry holds no path.
  • Once the user removes the collection as setup's FORGE STATUS banner now advises (fix(skf-setup): tell the user how to clear an empty QMD collection whose folder is gone #1260), its registry entry stays until the next Deep-tier setup, and qmd ls prints Collection not found: <name> and exits 1. No case named that outcome.

What changed

The empty case. The probe names the line qmd ls prints for it (No files found in collection: <name>), or Files: 0 in qmd status whatever its (updated ...) text, and says the folder is most often gone or holds no matching file. The log now gives setup's route, with the name filled in:

  1. qmd collection show <name> gives the folder.
  2. When that folder is gone or holds no file its pattern matches: qmd collection remove <name>. The next Deep-tier setup drops the registry entry, and a Create Skill run of the skill then registers a fresh collection. That last clause is the audit's own: without it the user is never told how Deep-tier semantic coverage comes back.
  3. Only when the folder does hold such files: qmd update (with setup's machine-wide caveat), then qmd embed -c <name>, and re-audit.

The label stays <name> (registered but empty), and the step still takes the direct-content fallback.

A collection QMD no longer holds. A new sub-bullet of the empty case, since the same probe finds it. On Collection not found, the step logs that the registry entry is stale, that the next Deep-tier setup cleans it, and that a Create Skill run registers a fresh collection. The Semantic Drift header labels it <name> (registered but not in QMD), and the step takes the same direct-content fallback, which later audits keep until Create Skill registers a fresh collection.

Smaller fixes. The find step now binds {collection_name} from the entry's name: the cases used it, but nothing bound it. "never indexed" and {collection.path} are gone. The fallback's "used when" list and the T1-low-fallback line of the report's confidence legend (report.md) name the new reason.

The audit still only advises: it runs no qmd collection remove, qmd update or qmd embed. Setup, qmd-registry.md, Create Skill and Drop Skill are unchanged.

Fragments

  • New audit-semantic-diff-empty-collection-advice.yaml (fixed, skf-audit-skill): the empty-collection route, the stale-entry route and its label, and the confidence legend. The link commit adds this pull request's number to its prs once it opens.

Tests

  • test_a_missing_registry_takes_the_direct_content_fallback in test-skf-audit-drift-json.py now pins:
    • the {collection_name} binding in the find step;
    • the empty case's probe lines, qmd collection show, qmd collection remove, the Create Skill clause, the qmd update caveat and qmd embed -c;
    • the Collection not found sub-bullet: its log, its label and fallback as one phrase, and the sentence on later audits;
    • the fallback's new "used when" list.
  • It also checks that semantic-diff.md holds exactly one qmd update, after "When the folder does hold such files", and no "never been indexed", "never indexed", {collection.path} or (updated never).
  • A tripwire for the second copy of setup's advice: the qmd update caveat phrase must appear in both semantic-diff.md and setup's banner emitter (skf-emit-result-envelope.py). If a later change rewrites the banner's caveat, this fails, and the audit's log is brought back in step.
  • Fail before: the base text holds "has never been indexed", {collection.path} and (updated never), which the test now bans, and none of the pinned route phrases.

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

Review

Three review layers (blind, edge-case, verification-gap) read the first draft. The verification-gap layer found no gaps; the other two raised 23 findings:

  • Patched (three fixes for five findings: both layers raised the first two):
    • The T1-low-fallback legend named only an unregistered or empty collection, while the new route also reports T1-low-fallback.
    • The stale-entry log told the user nothing to do. It now ends with the Create Skill route.
    • The fragment's summary was one long chain of clauses. It now gives one sentence per route.
  • Deferred:
    • "Example 2: Consumer Discovery" in qmd-registry.md still describes only found and not found, so it misses the empty route (older than this change) and the new one. This change leaves that file alone; a docs-only follow-up adds both.
  • Rejected (17), among them:
    • Other qmd ls failures, and an empty name in a hand-edited registry: no route before this change either, unlikely, and each fix adds a branch.
    • Naming MCP probe signals: the qmd MCP status tool shows an empty and a missing collection alike, and Deep tier requires the qmd CLI.
    • An envelope warning for the repair advice: a new warning code is new public surface, and no fallback case records one today.
    • Re-adding setup's "re-indexing cannot refill it" clause: every condition and command already matches setup's lines, and the caveat phrase is the one tripwire.

🤖 Generated with Claude Code

armelhbobdad and others added 2 commits November 19, 2026 15:37
… route one QMD no longer holds

On Deep tier, the audit's semantic diff called a registered extraction
collection with no files one that had never been indexed, and logged
"Run `qmd update` to (re-)index" a folder placeholder nothing bound. qmd
2.8.3 indexes a folder as soon as it is added, so such a collection's
folder is almost always gone or holds no file its pattern matches:
`qmd update` cannot refill it, re-indexes every collection on the
machine, and was followed by no `qmd embed`. A registered collection
that `qmd ls` reports as `Collection not found`, as it is once the user
removes it the way setup advises, matched no case at all.

The empty-collection log now gives setup's FORGE STATUS route:
`qmd collection show <name>` for the folder;
`qmd collection remove <name>` when that folder is gone or holds no
matching file, after which the next Deep-tier setup drops the registry
entry and a Create Skill run of the skill registers a fresh collection;
and, only for a folder that does hold matching files, `qmd update` with
its machine-wide caveat, then `qmd embed -c <name>`. A collection QMD no
longer holds is logged as a stale registry entry with the same Create
Skill route, is labeled `registered but not in QMD`, and takes the
direct-content fallback, as an empty one does. The find step now binds
the collection name the cases use, and the report's confidence legend
names the new reason.

The audit test pins both routes, bans the old wording, and checks that
the audit's log and setup's banner share the same `qmd update` caveat,
so the two copies cannot drift apart unnoticed.

Fixes #1271

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 19:55
@armelhbobdad
armelhbobdad merged commit 8003ecf into main Nov 19, 2026
10 checks passed
@armelhbobdad
armelhbobdad deleted the fix/audit-empty-collection-advice 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