Skip to content

fix(skills): a directory a skill walk cannot list is an error, a row or a note, not a smaller tree - #1481

Merged
napetrov merged 6 commits into
intel:mainfrom
antonwolfy:fix/skill-walk-unlistable
Dec 2, 2026
Merged

napetrov merged 6 commits into
intel:mainfrom
antonwolfy:fix/skill-walk-unlistable

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A walk of a skill tree with os.walk and no onerror skips a directory it cannot list (mode 0o111, non-root), so a skill or a bundled file under it is left out with no error. This is the class #1211 fixed for seven digests; these are two more sites, found while fixing #1168.

Input (non-root) On main Now
root with a/SKILL.md (name s) and sub/x/SKILL.md (name t), chmod 111 sub: walk_skill_files(root) ['a/SKILL.md'] raises PermissionError, filename is …/sub
same root: discover_skills(root) skills ['s'] raises, so skill-catalog: refuses with folder cannot be listed and --catalog (catalog trigger-set, catalog trigger-probe) and catalog formats exit 2 naming the folder
same root: _scan_skill_files(root) (catalog check) 1 entry (s) 2: s and an error row sub whose error says the folder cannot be listed, so the skills under it may be missing
same root: catalog novelty _items(root, None) 1 item 2: a and an error item sub (a not_loaded error row of the sweep; the run exits 1)
skill sk with .h/a.sh (hidden), chmod 111 .h: script check .h/a.sh not checked, no note note the script check did not read .h: the folder cannot be listed
skill sk with refs/a.md, chmod 111 refs, reviewed as an unloaded skill: command and content checks [('refs/a.md', 'a')] then [], no note note the command check did not read refs: …; the content check did not read refs: …

Fix option taken for #1208: the issue's first, a re-raising default onerror in walk_skill_files, with the catalog scan and catalog novelty passing their own. Every caller of discover_skills already maps an OSError to an input error, so a raising default makes them correct with no change and a new caller cannot forget it; the other option leaves the silent default for the next caller. Fix option taken for #1209: the issue's first, an onerror that records the folder and a bundle-file-unchecked note, for all three checks. docs/external-content.md already gives that note for a hidden folder that cannot be listed, and a review is one row of a scan that goes on, so a note keeps the rest of the row where an exception would drop it.

Closes #1208
Closes #1209

The same cause in skill_treatment._check_links (a link out of the skill inside a hidden folder that cannot be listed is not checked) is tracked in #1479. catalog provenance skipping the new error row without a word is tracked in #1480.

Changes

  • skills/loader.py: walk_skill_files re-raises the OSError of a directory it cannot list when it has no onerror (catalog_eval_inventory keeps its own). discover_skills, skill_files and detect_skill_packages raise through; their callers (treatments/factory.py, commands/catalog.py for --catalog and catalog formats, commands/catalog_probe.py) already turn the OSError into a refusal naming the folder, so they are unchanged. New unlisted_dirs picks the directories that stand for skills that may be missing: not one under a template folder, and not one that a skill's own load error names (_load_names loads the skill and compares the OSError's folder). A hidden folder of a skill (the loader leaves it out, so a checkout-root skill's .claude is one), and one inside a skill that fails on its frontmatter before it lists its files, are not named by any row, so each gets an error row. skill_files (so discover_skills) leaves an unlistable folder under a template folder out, as it leaves out the skills there, and raises for any other.
  • external/catalog.py _scan_skill_files and commands/catalog_novelty.py _items (with a new _candidate helper, to stay under the complexity cap) pass an onerror and add one error row or item per such directory, at the place its SKILL.md would sort. Downstream: catalog check rows get state: error, skill_sha256: null, no review (_unloaded_text finds no SKILL.md); catalog novelty takes it as a skill that does not load (_refuse_to_run gives not_loaded, no call is made, the run exits 1); review_skill_dir reads it as the skill's own not-loaded error when the directory is the skill itself.
  • external/unlisted.py (new): recorder is the os.walk onerror of the three checks and note_unchecked adds the bundle-file-unchecked note. command_checks._bundled_texts, content_checks._text_files and script_checks._bundled_files take an optional unlisted list (as do command_findings, content_findings, skill_md_content_findings and script_findings), and validate.review_skills and the unloaded-skill reviews add the note, naming the check and the folder relative to the skill.
  • A row carries one bundle-file-unchecked note: when the unreferenced check already gave one, the reasons of the three checks follow its message. A broken skill keeps the review that holds the note (its load error may fail on the frontmatter before it lists the folder, and then names no folder).
  • Docs: external-content.md (the bundle-file-unchecked cases and what catalog check, skill-catalog: and --catalog do), finding-codes.md, skill-novelty.md (catalog novelty).
  • external/unlisted.py load_error_text and commands/catalog_scan.py skill_row: a skill that fails to load with an OSError naming a directory has <folder> cannot be listed (<reason>) as its error, and skill_row never takes such a row as the exempt unloaded skill of an unsupported host (.cursor) or of OpenCode, whose unsupported-skill-format note had made it skipped with no error. The row is error and names the folder. skill_row reads the new SkillCatalogEntry.unlisted flag (set for the folder's own row and for a load that raised the listing OSError, through is_listing_failure), not the words of the error, so a readable skill whose checkout directory is named cannot be listed stays skipped.
  • Tests: tests/test_skill_walk_unlistable.py (walk_skill_files with no onerror skips a directory it cannot list: discover_skills, catalog scan and catalog_novelty miss the skills in it #1208) and tests/test_bundled_checks_unlistable.py (catalog static checks walk a skill's files with os.walk and no onerror: a script or document in a directory they cannot list is not checked #1209). test_catalog_bundle_unreferenced.py::test_an_unlistable_hidden_folder_with_every_file_named_gives_no_bundled_file_note (renamed, same assertions) pins that a hidden folder that cannot be listed leaves the row with no unreferenced-check bundle-file-unchecked note; the script check now gives its own note for it, so the test asserts that the unreferenced check gives none. test_a_standalone_review_reads_the_bundled_scripts pins that review_skill_dir of a skill with scripts/setup.sh containing pip install requests reports install-unpinned.
  • test_catalog_bundle_unreferenced.py and test_catalog_command_checks.py pinned that a skill with an unlistable folder has no review (or the one scan row); a broken skill now has a review that holds only the bundle-file-unchecked note, and a hidden folder has a row of its own, so the tests assert those.
  • Changelog fragments (Fixed).

Risk

discover_skills and walk_skill_files raise OSError where they returned a smaller list; every in-tree caller already handles it, and a caller outside the tree that does not will see the exception. catalog check has one more error row (and catalog novelty one more error row, exit 1) for a directory above the skills, a hidden directory inside a skill, or a directory of a skill that fails on its frontmatter, that cannot be listed, so a scan that was ok on a smaller tree now has an error; the row names the directory. discover_skills leaves an unlistable directory under a template directory out and does not raise for it; catalog formats still refuses one with exit 2, since it lists the packages under a template. A review with a hidden folder that cannot be listed (script check) or an unloaded skill with a folder that cannot be listed (command and content checks) has a note, which does not change its state; --ignore bundle-file-unchecked drops it. Nothing changes for a tree that can be listed.

Merge with #1238: it changes command_findings's body (the own argument to _findings_in) and sits beside _bundled_texts; this PR changes command_findings's signature, its docstring and the sources += line (one argument), and git merge-tree of the two meets a conflict in command_checks.py there, a small one: keep both arguments. #1317 and #1426 change other functions of command_checks.py and merge cleanly with this branch.

Testing

On a Linux review host, at 9e2d4e08 (on main 9e41f5e):

  • make ci-local: 38 passed, 0 failed, 16 skipped (docker and network smoke, the pinned Claude Code client, conda-forge, semgrep, the jobs that do not run on a PR, the matrix legs on other Pythons). 32120 tests passed, 27 skipped.
  • The repro of both issues, as the new tests: on main's code test_skill_walk_unlistable.py gives 6 failed, 3 passed (first failure: the catalog novelty items, [('a', 's', True)] == [('a', 's', True), ('sub', 'sub', False)]), and test_bundled_checks_unlistable.py gives 8 failed, 2 passed (first failure: the recorded folders, {'command': []} != {'command': ['refs']}; main has no unlisted argument, so the base copy was given one that it ignores). The 3 and 2 that pass pin what does not change (the walk hands a directory to a given onerror, a directory under a template is left out, a listable skill has no note).
  • 19 mutants, each failed by the test that claims its line (a dropped onerror in each of the five walks, no re-raise, no error row or item, the nested-folder and template rules, no note, notes not merged, an empty note, the one-or-several wording, the relative folder name, the messages).
  • make ci-local's mutation of changed lines at f0810fd5: 80 mutants of 109, 68 killed, 12 survived, 0 not run. Two new survivors are the unlisted flag: the False default of the field and the unlisted=True of the folder's own row (that row has no review, so it is an error either way), and the dropped not skill.loaded clause of skill_row (as below, only an unloaded skill's codes make not_a_failed_load true). Survivors at e7e5bd73: the checkout argument of review_skills (two mutants, the line this PR re-wrapped) and the at_root=False default of content_findings; in skill_row the dropped not skill.loaded clause and in unlisted.load_error_text the dropped exc.filename is not None clause (neither changes a result: only an unloaded skill's codes make not_a_failed_load true, and an OSError with no filename has no directory to test); and in loader._load_names and unlisted_dirs the exc.filename is not None clause (two mutants), a False returned as None (two), and the is_relative_to clause (it only skips loading skills that are elsewhere).
  • Review follow-up repros, as tests: with a template folder template/inner of mode 0o111, discover_skills raised PermissionError for it before and now returns the skills; with ROOT/SKILL.md and ROOT/.claude/skills/x/SKILL.md and .claude of mode 0o111, catalog check gives .claude an error row (before: the root row only); the same for a/.h/n/SKILL.md under a skill a, and for a/refs under an a/SKILL.md with no frontmatter (which also keeps the content check's bundle-file-unchecked note). On the head the round started from, the 5 new tests fail (5 failed, 21 passed of the two files). Mutants, each failed by its test: skill_files walking with the raising default (no template exception), a raise for every failed folder, unlisted_dirs with no _load_names (any folder inside a skill is its own), _kept_load_error_review back to dropping a note-only review, note_unchecked never joining the note already there, _candidate with no check for a SKILL.md that is a directory.
  • Repro of the .cursor case, as test_a_folder_that_cannot_be_listed_in_a_skill_of_an_unsupported_host_is_an_error_row: ROOT/.cursor/skills/sk/SKILL.md (valid) with chmod 111 sk/refs gave state skipped and error None at c9caae1f, and gives error naming refs now; on main's code the test fails. Mutants, each failed by its test: skill_row with no cannot be listed condition, and review_skills passing at_root without not standalone to command_findings (test_a_standalone_review_reads_the_bundled_scripts fails).
  • Repro of the directory name: a readable cannot be listed/.cursor/skills/sk/SKILL.md with no frontmatter was error at e7e5bd73 (the checkout's name was in the error text) and is skipped now, as test_a_readable_unsupported_host_skill_in_a_folder_named_cannot_be_listed_is_still_skipped; it was skipped on main. Mutant: skill_row deciding from the words cannot be listed in the path and error again fails it, and only it (1 failed, 15 passed of the file).
  • catalog formats --root on a tree with template/inner of mode 0o111 exits 2 (--root: [Errno 13] Permission denied: '…/template/inner'), as for any other folder it cannot list, while discover_skills leaves that folder out: catalog formats lists the packages under a template (as not loadable), so a table without them would be smaller than the tree. test_catalog_formats_refuses_a_directory_under_a_template_that_it_cannot_list pins it; the mutant that makes cmd_catalog_formats return for a failure naming a template folder fails it.
  • Run by hand on a tree with chmod 111 sub: catalog check --root … --kind skills --format json gives the row of s and the error row of sub (state error, skill_sha256 null).
  • Not run: Python 3.11, 3.12 and 3.14; the repro as root (the new tests skip when the process can list a mode 0o111 directory); Windows.

Open questions

None.

Revert

A plain revert restores the old behaviour: a directory that cannot be listed is left out of the walks again. Nothing is stored.

Checklist

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass
  • Docs updated (or N/A) — see the docs-drift checklist in CONTRIBUTING.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md [the diff was read and the checks of that section run except the cross-version and as-root runs named under Testing]
  • Each new raise/exit and test names the doc, contract or issue it traces to [the _raise helper has no docstring of its own; walk_skill_files's docstring says why it raises, and each new test file's docstring names the issue and doc]
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

)

walk_skill_files had no onerror by default, so os.walk skipped a directory it could not list (mode 0o111, non-root) and discover_skills, the catalog scan and catalog novelty left out the skills under it with no error.

With no onerror the walk now re-raises the OSError, whose filename names the directory. discover_skills and detect_skill_packages raise through, and their callers already turn an OSError into a refusal naming the folder: the skill-catalog: arm, catalog trigger-set, catalog trigger-probe and catalog formats. catalog_eval_inventory keeps its own onerror.

The catalog scan (_scan_skill_files) and catalog novelty (_items) pass an onerror and add one error row for each such directory, saying that the skills under it may be missing, so the scan goes on as it does for a skill that does not load. A directory under a template folder is left out silently, as the scaffold's files are, and so is one inside a skill's own directory (loader.unlisted_dirs): that skill's load error already names it.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
The command, content and script checks walked a skill's files with os.walk and no onerror, so a folder they could not list (mode 0o111, non-root) was left out and the scripts and documents in it read as checked, with no note on the row. The script check walks hidden folders, so for a skill that loads, a hidden folder it cannot list dropped its scripts; the command and content checks reach it for a skill that does not load.

Each walk (_bundled_texts, _text_files, _bundled_files) now records the folder it could not list, relative to the skill, in an optional list its callers pass (command_findings, content_findings, skill_md_content_findings and script_findings take it as unlisted=). review_skills and the unloaded-skill reviews add one bundle-file-unchecked note naming the check and the folder, such as the script check did not read .h: the folder cannot be listed. A row has one note of that code: when the unreferenced check gave one for the same folder, the reasons follow its message. A broken skill whose only extra finding would be that note keeps no review, since its load error names the folder.

The existing test of an unlistable hidden folder with every file named pinned that the row has no bundle-file-unchecked note; the script check now gives one for that folder, so the test asserts that the unreferenced check gives none (its own claim) and the script check's note is pinned in the new test file.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@exai-bot

exai-bot commented Dec 1, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s).

CI at 9e2d4e0: 21 passing, 4 skipped.

Review details
  • Commit reviewed: 9e2d4e0 against merge base f0810fd
  • Coverage: 4 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 103k tokens (69k from cache), 21s
  • Tool calls: 14 (9 file_read, 3 code_search, 1 local_check_results, 1 pr_threads)
  • Unlistable site handling, documentation, and regression tests: 4 files

Comment thread dokimi/dokimi/skills/loader.py Resolved
Comment thread dokimi/dokimi/skills/loader.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Overbroad diagnostic suppression can silently omit nested skills from catalog checks and erase the sole unreadable-resource warning from catalog and standalone reviews.

2 open issues
What changed in this PR

2 new findings.

This PR makes dokimi’s skill discovery and static checks report directories they cannot list instead of silently treating them as smaller trees, addressing #1208 and #1209.

Changes:

  • Raise directory-listing errors by default and represent them as error rows in catalog scans and novelty sweeps.
  • Record incomplete command, content and script checks in a shared bundle-file-unchecked note.
  • Add regression tests and update documentation and release notes.
File Description
dokimi/​tests/​test_skill_walk_unlistable.py Tests discovery failures and catalog error rows.
dokimi/​tests/​test_catalog_bundle_unreferenced.py Distinguishes unreferenced-check notes from script-check notes.
dokimi/​tests/​test_bundled_checks_unlistable.py Tests incomplete checks and merged notes.
dokimi/​dokimi/​skills/​loader.py Raises walk errors and selects unlisted-directory diagnostics.
dokimi/​dokimi/​external/​validate.py Integrates incomplete-check notes into reviews.
dokimi/​dokimi/​external/​unlisted.py Adds shared directory-error recording and note merging.
dokimi/​dokimi/​external/​script_checks.py Records directories the script walk cannot list.
dokimi/​dokimi/​external/​content_checks.py Records directories the content walk cannot list.
dokimi/​dokimi/​external/​command_checks.py Records directories the command walk cannot list.
dokimi/​dokimi/​external/​catalog.py Creates catalog error entries for unlisted directories.
dokimi/​dokimi/​commands/​catalog_novelty.py Creates novelty error items for unlisted directories.
dokimi/​docs/​skill-novelty.md Documents directory errors in novelty sweeps.
dokimi/​docs/​finding-codes.md Expands the unchecked-note definition.
dokimi/​docs/​external-content.md Documents listing failures and incomplete-check notes.
dokimi/​changelog.d/​20261201_130000_skill-walk-unlistable.md Summarizes discovery and static-check fixes.

Review effort: Balanced

Comment thread dokimi/dokimi/skills/loader.py Resolved
Comment thread dokimi/dokimi/external/validate.py Resolved
@codecov-commenter

codecov-commenter commented Dec 1, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.35%. Comparing base (9e41f5e) to head (9e2d4e0).
⚠️ Report is 30 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1481      +/-   ##
==========================================
+ Coverage   96.31%   96.35%   +0.04%     
==========================================
  Files         515      524       +9     
  Lines       68928    70347    +1419     
  Branches    11933    12154     +221     
==========================================
+ Hits        66389    67786    +1397     
- Misses       1563     1586      +23     
+ Partials      976      975       -1     
Files with missing lines Coverage Δ
dokimi/dokimi/commands/catalog_novelty.py 94.03% <100.00%> (+0.64%) ⬆️
dokimi/dokimi/commands/catalog_scan.py 97.34% <100.00%> (ø)
dokimi/dokimi/external/catalog.py 100.00% <100.00%> (ø)
dokimi/dokimi/external/command_checks.py 97.06% <100.00%> (-0.24%) ⬇️
dokimi/dokimi/external/content_checks.py 94.96% <100.00%> (+0.01%) ⬆️
dokimi/dokimi/external/script_checks.py 93.06% <100.00%> (+0.01%) ⬆️
dokimi/dokimi/external/unlisted.py 100.00% <100.00%> (ø)
dokimi/dokimi/external/validate.py 98.76% <100.00%> (+0.03%) ⬆️
dokimi/dokimi/skills/loader.py 100.00% <100.00%> (ø)

... and 68 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Mutation of changed lines

⚠️ Tests miss 12 of 80 small breaks of the lines this PR changes, and not every break was tried

At 9e2d4e0: 68 caught · 12 missed

Each row is a small deliberate break (a mutant) of a line this PR changes that every test reaching that line still passes. Add a test that fails on it or, if it cannot change behaviour, put # mutation-ok[<operator>]: <reason> at the end of the line or alone on the line above.

Where Operator Change no test notices Tests reaching the line
dokimi/dokimi/external/catalog.py:65 flip-bool False → True 33
dokimi/dokimi/external/catalog.py:124 flip-bool True → False 12
dokimi/dokimi/external/content_checks.py:463 flip-bool False → True 33
dokimi/dokimi/external/validate.py:721 take-branch None if standalone else entry.source_root → (None) 969
dokimi/dokimi/skills/loader.py:247 drop-clause exc.filename is not None and Path(str(exc.filename)) == directory → (Path(str(exc.filename)) == directory) 4
dokimi/dokimi/external/unlisted.py:25 drop-clause isinstance(exc, OSError) and exc.filename is not None → (isinstance(exc, OSError)) 129
dokimi/dokimi/external/validate.py:721 take-branch None if standalone else entry.source_root → (entry.source_root) 969
dokimi/dokimi/skills/loader.py:247 drop-clause exc.filename is not None and Path(str(exc.filename)) == directory → (exc.filename is not None) 4
dokimi/dokimi/skills/loader.py:249 return-none False → None 4
dokimi/dokimi/skills/loader.py:250 return-none False → None 6
dokimi/dokimi/skills/loader.py:265 drop-clause d.is_relative_to(skill_file.parent) and _load_names(skill_file, d) → (_load_names(skill_file, d)) 17
dokimi/dokimi/commands/catalog_scan.py:119 drop-clause not skill.loaded and not skill.unlisted and not_a_failed_load([f.c → (not skill.unlisted and not_a_failed_load([f.code for f in review.findings] if r 262

Not checked:

  • 29 more breaks of covered changed lines were over the limit and not tried
  • 21 changed lines were not mutated

Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary.

…s is left out

Settles the review threads on the unlistable-folder walks. discover_skills leaves an unlistable folder under a template directory out, as it leaves out the skills there. unlisted_dirs drops a folder inside a skill only when that skill's load error names it, so a checkout-root skill's hidden folder, a hidden folder of a nested skill and a folder of a skill that fails on its frontmatter first each get an error row. A broken skill keeps the bundle-file-unchecked note of a folder its checks could not list. recorder loses its two unreachable branches.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>

@vchamarthi vchamarthi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antonwolfy, could you fix the problem I found (below), fix the small thing I've marked fix before merge (in the line comments), fix what the bot's thread on dokimi/dokimi/skills/loader.py:235, the bot's thread on dokimi/dokimi/skills/loader.py:254, the bot's thread on dokimi/dokimi/skills/loader.py:254 and the bot's thread on dokimi/dokimi/external/validate.py:425 still point out and answer my question below? Then push and I'll take another look.

On lines this PR doesn't change (1): GitHub can't take a line comment there
  • dokimi/dokimi/commands/catalog_scan.py:146

    Must fix (blocking): A skill folder under .cursor whose listing is refused, with a readable SKILL.md, is skipped with no error, so the failure is lost.
    Input: ROOT/.cursor/skills/sk/SKILL.md with a valid name and description, then chmod 111 on sk.
    Got: On the latest commit skill_row gives state skipped and error None: the readable SKILL.md gets the unsupported-skill-format note, so not_a_failed_load marks the entry exempt, and the exemption clears the cannot be listed error.

    Also at: dokimi/dokimi/commands/catalog_scan.py:119, dokimi/dokimi/commands/catalog_scan.py:136.

    Suggestion: Keep a listing failure out of the exemption: the entry from the scan should say it is a listing failure, and skill_row should count it as a failed load whatever the review's codes are.

    I tested this patch: it fixes the problem, and the tests still pass.

    Patch
    --- a/dokimi/dokimi/commands/catalog_scan.py
    +++ b/dokimi/dokimi/commands/catalog_scan.py
    @@ -116,7 +116,7 @@
         from dokimi.external.validate import name_risky_commands
     
         # An unloaded SKILL.md that is plain Markdown under OpenCode or an unsupported host is a warning or a note here, not a failed load (skill_format).
    -    exempt = not skill.loaded and not_a_failed_load([f.code for f in review.findings] if review else [])  # before --ignore
    +    exempt = not skill.loaded and not_a_failed_load([f.code for f in review.findings] if review else []) and "cannot be listed" not in (skill.error or "")  # before --ignore
         read = _listing_source(skill)
         preview = listing_preview(skill, read)
         listing_chars = listed_chars(review)
    Details

    I'd expect state error and an error naming sk, since the folder's skills may be missing. The same happens for an .opencode skill with no description in its SKILL.md, which gives state warn and no error.

My question before I approve:

  • The changelog says a folder inside a skill that cannot be listed is that skill's load error. Fix the changelog sentence to say the note for a hidden folder, or make a hidden folder a load error and change docs/external-content.md to match.
Optional, non-blocking (1)
  • dokimi/tests/test_catalog_bundle_unreferenced.py:754: The name test_an_unlistable_hidden_folder_with_every_file_named_gives_no_note says the row gets no note, which the script check now contradicts.

What I checked on 1bf0153:

  • When I changed the code on purpose, the tests still passed for 1 of 12 changes, and no test pins this one down yet (non-blocking): dokimi/dokimi/external/unlisted.py:28 (the handled error is raised again).
  • The 152 changed tests pass, and fail on main as expected.
  • The full test suite passes with main merged in (35,213 tests), apart from failures main has too.
  • It merges cleanly onto main.

Comment thread dokimi/dokimi/external/validate.py Resolved
…kill is an error row

A skill under `.cursor` whose bundled folder cannot be listed failed to load, but its `unsupported-skill-format` note made `skill_row` treat the failure as exempt, so the row was `skipped` with no error. A load failure that is an OSError naming a directory now carries `cannot be listed` in its error, and `skill_row` never exempts a row whose error says so.

The changelog fragment now says what a hidden folder inside a skill gets: an error row of its own and a `bundle-file-unchecked` note on the skill, not that skill's load error.

A test pins that a standalone `review_skill_dir` reads the bundled scripts (`install-unpinned`), and the test of an unlistable hidden folder is renamed to say it gives no bundled-file note.

Test-narrowed: test_an_unlistable_hidden_folder_with_every_file_named_gives_no_note is renamed to test_an_unlistable_hidden_folder_with_every_file_named_gives_no_bundled_file_note; its assertions are unchanged.
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@antonwolfy

Copy link
Copy Markdown
Contributor Author

(commented) @antonwolfy, could you fix the problem I found (below), fix the small thing I've marked fix before merge (in the line comments), fix what the bot's [thread](https://github.com/intel/dokimi

@vchamarthi (#1481 (review)): The .cursor case reproduced: ROOT/.cursor/skills/sk/SKILL.md valid, chmod 111 sk/refs gave state skipped and error None. The load error of a skill that fails on a directory is the OSError's own text ([Errno 13] Permission denied: '…/refs'), which does not contain cannot be listed, so the suggested string test alone would not have caught it. In e7e5bd7 load_error_text writes <folder> cannot be listed (<reason>) as the error of such a load failure, and skill_row never exempts a row whose error says so; the row is now error and names refs (test_a_folder_that_cannot_be_listed_in_a_skill_of_an_unsupported_host_is_an_error_row, which fails without the condition and on main). The .opencode skill with no description is not the same case: it fails on its missing description before it lists anything, stays warn, and the folder gets its own error row (refs, state error).

The changelog sentence now says what a hidden folder inside a skill gets: an error row of its own (the loader leaves it out) and a bundle-file-unchecked note on the skill, while a folder that the skill's load error names is that skill's error. I ran a skill a with a mode 111 .h folder: rows .h (error) and a (ok, note the script check did not read .h: the folder cannot be listed). No code change for that part.

The test test_an_unlistable_hidden_folder_with_every_file_named_gives_no_note is renamed …_gives_no_bundled_file_note, assertions unchanged (the commit carries a Test-narrowed: line for the rename check).

@antonwolfy

Copy link
Copy Markdown
Contributor Author

Ready for another look at e7e5bd7; 1 checks still pending (Windows smoke test (py3.13)); every other check passed.

@antonwolfy
antonwolfy requested a review from vchamarthi December 1, 2026 17:37

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change class: CONTRACT (head e7e5bd7)

  • Contract: candidate. defaults dokimi/dokimi/external/command_checks.py:493; defaults dokimi/dokimi/external/command_checks.py:527
  • Responsibility: none
  • Dependency: none
  • Review depth: check the changed surface: callers, docs, tests pin new behaviour
  • Coverage gaps: none

The standalone bundled-command regression is covered, and unreadable folders under unsupported hosts now produce an error. All 313 tests in the changed test files passed locally. One narrow diagnostic issue remains.

Comment thread dokimi/dokimi/commands/catalog_scan.py Resolved
…the words of its error

Review point on intel#1481: whether an unloaded unsupported-host SKILL.md is an error row was decided by finding "cannot be listed" in the row's error text, so a readable skill whose checkout directory was named `cannot be listed` changed from skipped to error.

SkillCatalogEntry gains an `unlisted` flag, set where the scan builds a row for a folder it could not list (the folder's own row and a skill whose load raised the listing OSError, through `is_listing_failure`). `skill_row` reads the flag, so the error text and the directory names no longer decide the state.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@antonwolfy

Copy link
Copy Markdown
Contributor Author

(approved) ### Change class: CONTRACT (head e7e5bd7)

@napetrov (#1481 (review)): Approval with no change asked for; the one narrow diagnostic issue it mentions is the thread 4759344247, answered above. I ran the changed test files and the guard tests at f0810fd (1744 passed) and make ci-local (38 passed, 0 failed, 16 skipped).

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change class: CONTRACT (head f0810fd)

  • Contract: candidate. defaults dokimi/dokimi/external/command_checks.py:493; defaults dokimi/dokimi/external/command_checks.py:527
  • Responsibility: none
  • Dependency: none
  • Review depth: check the changed surface: callers, docs, tests pin new behaviour
  • Coverage gaps: none

Checked the explicit unlisted flag through discovery and catalog reporting, including a readable checkout named “cannot be listed”. All 314 tests in the four changed test modules passed. The single failing wheel check timed the unrelated Markdown opener test (67.52 against a limit of 64); that exact test passed locally on the PR merge tree.

@vchamarthi vchamarthi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antonwolfy, could you fix the small thing I've marked fix before merge (in the line comments) and answer my question below? I'll approve once that's done.
I'll approve once that's done.

My question before I approve:

  • catalog check gives exit 0 and no row for an unlistable folder under template, but catalog formats --root on the same tree exits 2 with --root: [Errno 13] Permission denied naming template/inner. Decide whether catalog formats skips a folder under template as discover_skills now does, and say which in dokimi/docs/external-content.md or in the PR description.

What I checked on f0810fd:

  • When I changed the code on purpose, the tests still passed for 4 of 12 changes, and no test pins these down yet (non-blocking): dokimi/dokimi/external/catalog.py:134 (the handled error is raised again), dokimi/dokimi/external/unlisted.py:28 (the handled error is raised again), dokimi/dokimi/skills/loader.py:246 (the handled error is raised again) and 1 more.
  • The 314 changed tests pass, and fail on main as expected.
  • The full test suite passes with main merged in (40,812 tests), apart from failures main has too.
  • It merges cleanly onto main.

Comment thread dokimi/dokimi/external/unlisted.py Resolved
…ats refuses a template folder

Settles the review comment on unlisted.py: the comment on the recorder said os.walk errs only below its top, but it calls onerror for an unlistable top too (recorded as ".").

Settles the question on catalog formats: it lists the packages under a template folder (as not loadable), so it keeps refusing a template folder it cannot list with exit 2, unlike discover_skills. The doc and the changelog fragment say so, and a test pins it.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@antonwolfy

Copy link
Copy Markdown
Contributor Author

(approved) ### Change class: CONTRACT (head f0810fd)

@napetrov (#1481 (review)): Nothing to change. The one failing wheel check is the timing test test_the_opener_of_each_link_of_one_row_is_found_without_reading_the_brackets_before_it (67.5 against a limit of 64); this branch does not have that test (it comes with main), and #1520 tracks it as flaky.

@antonwolfy

Copy link
Copy Markdown
Contributor Author

(commented) @antonwolfy, could you fix the small thing I've marked fix before merge (in the line comments) and answer my question below? I'll approve once that's done.

@vchamarthi (#1481 (review)): catalog formats keeps refusing a folder under template with exit 2, and 9e2d4e0 says so in docs/external-content.md, the changelog fragment and the PR description. I reproduced your case: catalog formats --root on a tree with template/inner of mode 0o111 exits 2 with --root: [Errno 13] Permission denied: '…/template/inner'. It does not skip like discover_skills because it lists the packages under a template as not loadable (detect_skill_packages), so a table that left the folder out would be smaller than the tree. The new test test_catalog_formats_refuses_a_directory_under_a_template_that_it_cannot_list pins it. The 4 of 12 changes your mutation run left alive (handled error raised again in catalog.py:134, unlisted.py:28, loader.py:246) are listed under the PR's mutation survivors; I did not add tests for them in this round.

@antonwolfy

Copy link
Copy Markdown
Contributor Author

Ready for another look at 9e2d4e0; 1 checks still pending (Windows smoke test (py3.13)); every other check passed.

@antonwolfy
antonwolfy requested a review from vchamarthi December 2, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants