Repository navigation
fix(tier2): chunk shell scripts in one pass instead of once per function header - #423
Merged
Merged
Conversation
…ion header
chunk_shell walked the rest of the script from every function header to
find its closing brace, and counted newlines from the start of the file
for each function's line numbers. A script of `name() {` lines without
closing braces therefore took time quadratic in its size: about 20 s for
53 KiB, and hours for a 1 MiB file.
Pair every brace and record every newline in one pass, then look up each
function's end and line numbers. Unmatched headers still yield no chunk,
and chunk text and line ranges are unchanged. chunk_python now splits
the source into lines once instead of once per function or class.
Tests pin the single pass for both chunkers and the brace pairing with
nested braces, a stray closing brace and an unclosed header.
Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The earlier single-pass tests did not cover line numbering. Counting the newlines in the script prefix once per function, as main does, still passed every chunker test. The unclosed-header test counted only indexed reads, so a rescan built on str.find also passed it. Add a str subclass that adds up the characters read through indexing, slicing, iteration, find, index, count and splitlines. A script of 1,000 closed one-line functions must give each function its own one-line range, and both that script and a script of 1,000 unclosed headers must be read at most ten times over. Main reads each of them about 1,000 times. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The paragraph named only the `name() {` header form. Say that a header
must start a line, may use the `function` keyword and may put the brace
on the next line, and list the forms that are not chunked: indented
headers, `function name {` without parentheses and hyphenated names.
Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The helper's docstring named only regular expressions as uncounted. Reads through other str methods, and any read of a plain str copy made with str(), replace() or join(), are not counted either. A per-header rescan built on re, and the old per-character walk run on str(content), both pass every shell read-count test. Say so, and say that the tests pin the old walks rather than every possible quadratic scan. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 9, 2026
rng1995
marked this pull request as ready for review
November 9, 2026 19:50
rng1995
requested review from
chrisknvidia,
mosheabr and
rmalani-nv
as code owners
November 9, 2026 19:50
This was referenced Nov 11, 2026
Merged
rng1995
commented
Nov 12, 2026
rng1995
left a comment
Collaborator
Author
There was a problem hiding this comment.
Reviewed the complete production diff and regression coverage; checked one-pass brace pairing and line offsets against the prior shell algorithm, Python source-line reuse and linear-work regressions. No actionable findings.
Verification at unchanged head bc3cf2c5477e83a4a780d65d4e960057929a807a: 20 existing CI checks succeeded and 2 were intentionally skipped, including the supported Python tests, lint/package and security/platform gates where applicable. Fresh git merge-tree --write-tree is clean against the frozen main commit ce52a09. No new local test run is claimed for this unchanged code.
rng1995
added a commit
that referenced
this pull request
Nov 12, 2026
Brings in main through b38b71b (#416, #417, #420, #422, #423, #428, #429, #467). Merged without conflicts; CHANGELOG, docs, decoys.py and eval_core/checks.py auto-merged with both sides' edits in separate hunks. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
6 of 9 tasks
chrisknvidia
pushed a commit
to YMuskrat/SkillEvaluator
that referenced
this pull request
Nov 13, 2026
…g references (NVIDIA#457) * fix(tier1): accept SkillSpector partial reports whose only gaps are missing references SkillSpector marks the analysis partial when the skill's instructions name a file the skill does not bundle, such as a file it writes at run time, although every bundled file is still inspected. The Tier 1 security scan then stopped as INCOMPLETE. Accept such a report with a warning when every ledger row is a nonfatal reference_resolution row: reference_missing on any version, or, before SkillSpector 2.12.0, reference_unresolved whose line the report's references list records as missing. Each row must name exactly one listed component that is a regular, single-link file under the scanned root, reached without following a link. The report must also have no partially or entirely uninspected file, no filtered finding, no limitation, no fatal scope exclusion, and universal analyzers that completed every component. A reference that matches several bundled files stays INCOMPLETE. The path check, row predicate and warning text are module-level helpers so later SkillSpector report rules can reuse them. Tests use real offline SkillSpector 2.11.2, 2.12.0 and 2.13.3 reports. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): describe when SkillSpector missing references are a warning Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep a missing reference blocking when it may name a file left out of the scan SkillEvaluator scans a copy of the skill without artifact directories such as evals/, versions/ and node_modules/, and SkillSpector leaves links out of its inventory. A reference to a script there is reported as missing, so the missing-reference rule turned an INCOMPLETE scan into a pass although the script was never inspected. A missing-reference row is now accepted only when: - the report's references list records a missing reference on the row's line, for every SkillSpector version, and that entry's evidence matches the line read from the scanned file; - that line names no entry of the skill that SkillSpector did not inspect: a link, a file the report does not list, or the outermost directory that holds no listed file, and every file inside such a directory. Names are compared case-folded, as written and in NFC, with Markdown escapes removed and with percent-escapes decoded, and must not adjoin another name character. The walk does not follow links and stops at 50,000 entries. A single-file scan root is now read through SecureRoot too, so it must be a single-link file of at most 1,000,000 bytes. A lone SKILL.md is scanned this way, and SkillSpector 2.13.3 reports every reference in it as missing. The warning now says that every file SkillSpector scanned was inspected and that those lines name no file left out of the scan. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): accept missing references alongside referenced images A skill whose SKILL.md shows an image and names a file it writes at run time got both gaps in one partial SkillSpector report, and stayed INCOMPLETE because each rule required its gap to be the only one. _skillspector_missing_reference_notes now separates the reference rows. They pass the same checks as before; the other rows must be referenced images that _skillspector_passive_raster_note accepts, which accounts for the counts, analyzers and limitations. The scan then carries both warnings. A report with images only still goes to the image rule alone. The new fixture is a real SkillSpector 2.13.3 --no-llm report of such a skill. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): state which missing references SkillEvaluator accepts and why The docs and CHANGELOG said that every bundled file is inspected and that the warning quotes the references. SkillEvaluator leaves artifact directories out of the scanned copy, and the warning names only the file and line, so both now say what is checked: the references list, the line, and the files and directories left out of the scan. They also say that missing references may come with accepted referenced images, that the rule covers SkillSpector v2.10 to v2.13.3, and that v2.13.4 and later report these scans as complete_with_caveats, which is not accepted yet. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep missing references blocking when they may name unscanned files Follow-ups to accepting SkillSpector missing references: - A single-file scan root, such as `security-scan path/to/SKILL.md`, now counts every entry beside the file as not inspected, because SkillSpector scans that file alone. Before, a line that named a script beside it passed. - A directory that holds an uninspected entry (an unlisted file, a link or a left-out subtree) is named too, even when it also holds listed files. - A left-out `.git` directory counts by its own name and its hooks other than `*.sample` templates, so `config`, `HEAD` or branch names no longer keep a scan INCOMPLETE. - When the validator's `skillspector_reference_root` is not the scanned root, as for a skill scanned inside a plugin, a missing reference is never accepted, because the line may name a file elsewhere in that artifact. - Tests for each case, and a unit test that patches `stat_is_link_or_reparse` so the reparse-point branch is covered on every OS. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): state the lone-file, plugin, .git and baseline rules for missing references - A lone file is scanned on its own, so a line that names a file beside it keeps the scan INCOMPLETE. - A skill scanned on its own inside a plugin keeps its missing references INCOMPLETE. - Only `.git` itself and its active hooks count as names inside `.git`, and a directory that holds a left-out entry counts too. - No finding may be filtered out, for example by `--skillspector-baseline`. - When one check covers several skills, such as `security-scan` on a folder, a passing skill is listed without its warnings. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep missing references blocking for each skill of a folder scan `security-scan` on a folder, and `validate` or `tier1` on a folder without a configured reference root, scan each skill found in it on its own. A line in such a skill may name a file elsewhere in the folder, such as a plugin's `scripts/install.sh`, that the skill's scan never inspects, yet the missing-reference rule accepted it because the reference root was unset. While a target that is a directory but not a skill is walked, use it as the reference root, so those skills' missing references keep the scan INCOMPLETE as on main. A skill directory, a lone file and a folder with no skill (scanned as a whole) are unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read reference lines with every Markdown escape and character reference resolved The check that a missing reference's line names no file left out of the scan removed only the escapes SkillSpector strips itself (`\\`, `\(`, `\)`, `\<`, `\>`). A Markdown renderer also resolves a backslash escape of any ASCII punctuation and HTML character references, so `[the setup script](node\_modules/run\_all.sh)` or `[the setup script](&NVIDIA#118;ersions/inst&NVIDIA#97;ll.sh)` named a left-out file and still passed. Also read the line with backslash escapes of all ASCII punctuation removed, HTML character references resolved and percent-escapes decoded, up to three of these steps in any order, so either line keeps the scan INCOMPLETE. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): word the missing-reference warning so it holds beside images and for a lone file The warning said "every file SkillSpector scanned was inspected", which is not true when an accepted referenced image is the other gap: the next warning says SkillSpector's text analyzers could not read it. It also said "Files outside the skill were not scanned", although for a lone SKILL.md the files beside it inside the skill are not scanned either. Say instead that SkillSpector reported no other gap for these references, and that files not in the scan, including any outside the scanned path, were not inspected. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): drop the baseline example from the missing-reference conditions The docs and CHANGELOG said that a scan in which `--skillspector-baseline` suppresses a finding stays INCOMPLETE. SkillSpector 2.10.0 to 2.13.3 count findings after filtering as every finding up to the report cap, so a baseline does not change `findings_before_filtering` or `findings_after_filtering`; such a scan passes with the missing-reference warning and the baseline's suppression note. State the actual condition, that the two counts match. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that a folder with no skill keeps its missing references accepted A folder that holds no skill is scanned as one target, so it is its own reference root and the folder-scan rule leaves its accepted missing references unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): accept missing references only for the whole target of a scan The folder rule set a reference root only while a folder was walked, so a scan run outside validate() or validate_security_only(), such as a direct per-directory _run_skillspector() call on one partition of a larger tree, still had no root and accepted missing references that main keeps INCOMPLETE. Record the resolved target for every walk instead, and accept missing references only when the reference root (the configured skillspector_reference_root, or else that target) is the scanned directory. A skill directory, a lone file and a folder with no skill are their own target; a skill found inside a folder is not; a scan with no known target accepts none. _skillspector_missing_reference_notes now requires reference_root. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say which scans may accept missing references in the reference-root docstring The `skillspector_reference_root` docstring describes its default for finding scoping, the scanned directory. The missing-reference rule uses a different default, the whole target of validate() or validate_security_only(); say so next to it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep missing references blocking for each skill of a validate catalog `validate` on a folder of skills runs each skill as its own job, either in process or as a `validate <skill>` child process with --workers above 1. Each job's security scan saw the skill directory as its whole target, so a SkillSpector missing reference in it was accepted, although its line may name a file elsewhere in the folder that the skill's scan never inspected. `security-scan` on the same folder keeps it INCOMPLETE. Pass the folder to each job through a hidden `--catalog-root` option, set by the in-process path and by the child argv. `run_validation` hands it to SecurityValidator as a new `target_root`, which replaces the walk target as the root that missing references are judged against. Finding scoping (`skillspector_reference_root`) is unchanged. The docs no longer say that `tier1` takes a plugin; it takes one skill. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read shell globs, expansions and quotes in reference lines as patterns A missing reference was accepted when its line named no left-out file by its literal name. SkillSpector keeps `*`, `?`, `[...]` and quotes in a Markdown link destination and reports it as `reference_missing`, so a line such as "run [the setup script](v*/*.sh)", `vers?ons/inst?ll.sh`, `ver""sions/inst""all.sh` or `v[e]rsions/i[n]stall.sh` passed although a shell would open the `versions/install.sh` that the staged scan left out. Read each word with shell syntax as a shell would: brace and parameter expansions stand for any text, quotes and backslashes are removed, and each path part is an fnmatch pattern that no left-out name may match. A word made only of `*`, such as a list marker, is skipped. The docs said the decodings apply "in any combination"; they apply up to three steps in any order, and now also name the shell patterns. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): bound the work of checking missing-reference lines Each missing reference's line is checked in up to 40 decoded forms, and every left-out name that is not a plain name run is searched for in each. A skill with tens of thousands of such names left out of the scan and long lines of escapes beside its missing references could keep a scan busy for minutes, where main returns INCOMPLETE at once. Charge the work to one budget per report: decoding a line, every search of a decoded line for such a name, and compiling and matching each shell pattern. A line that would overdraw it is not accepted, so the scan stays INCOMPLETE. Plain name runs are now matched through one lookup per run of the line instead of one test per name, and a line with no left-out names is accepted without decoding it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): match reference-line globs in linear time and cover nested expansions fnmatch.translate scans ahead for the `]` of every `[`, so a word of a few thousand `[` took over a second to translate, and the budget charged a pattern by count, not length. Nested brace and parameter expansions such as `v{e{r,x},y}sions` or `${X:-${Y:-v}}ersions` were left partly literal, and splitting parts at `:` broke `[[:alpha:]]`, which Python's fnmatch does not support anyway. Translate globs with a linear scanner of our own. A bracket expression matches any one character and a stray `]` any text, so the matcher accepts every name the shell would and possibly more, and a pattern with more fixed characters than the longest left-out name is skipped. The regex keeps one backtracking `*` at most, as fnmatch does. Replace everything from the first `${` or brace expansion to its last `}` with `*`, split parts at `/` and also at `=`, `:` and `,`, and charge each pattern by its length. Decoding a line now costs 3,000 per character. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(cli): record validate's hidden --catalog-root option in the CLI surface golden The catalog fix added a hidden `--catalog-root` option to `validate`, which each per-skill job of a folder run receives. Regenerate the golden CLI surface with tests/golden/generate_cli_surface.py; the only change is that option. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(tier1): pass the catalog root next to the content type Open PR NVIDIA#394 appends keyword arguments to `run_validation` and to its call in `validate`. Put `target_root` beside `content_type` in both places instead, so the two changes touch different lines. Behaviour is unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that a word made only of `*` is not read as a glob The reference-line check skips a word made only of `*`, such as a Markdown list marker, when it reads shell patterns. Say so next to the pattern rule. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say when a scan outside the validated target accepts missing references The `_validate_with_applicability` docstring said that a scan run outside the walk accepts no missing reference. That holds only without a configured `skillspector_reference_root`: a direct `_run_skillspector` call whose reference root is the scanned root accepts them, because that scan covers the whole root. Say so, and pin both cases with a test. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(cli): list catalog_root first among the options a catalog child does not inherit Open PR NVIDIA#394 adds eight entries to the `not_forwarded` dict of `test_catalog_child_argv_forwards_every_validate_option`, directly after `"output_dir"`, where this branch added `"catalog_root"`. The two insertions touched the same place, so merging both conflicted. List `catalog_root` first instead, so unchanged lines separate the two hunks. The test is unchanged otherwise. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that Tier 3 output and input fixtures in the skill count as not inspected By default Tier 3 writes its results to `<skill>/evals/results`, which the scanned copy leaves out like the rest of `evals/`. After one run, a line that names `results`, a file the run leaves there such as `report.html` or `summary.json`, or, with `--harbor-keep-jobs`, any bundled file (the kept Harbor tasks copy the skill) keeps the scan INCOMPLETE, although the same line passed before the run. An input fixture in `evals/files` counts the same way. The rule stays as it is, because an author can create these directories by hand. Say so in the missing-reference conditions and in the CHANGELOG entry, and name `--results-dir` and `SKILLEVALUATOR_RESULTS_DIR` as the way to keep a run from changing the result. Pin the behaviour with a test that scans the same skill before and after a generated run tree, for a line naming `results/summary.md`, `report.html`, a bundled script copied by a kept Harbor job, and an `evals/files` fixture. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(tests): wrap the reference-root assertion as ruff format does The new test for a direct scan with a configured reference root had one line over the length limit. Wrap it as `ruff format` does, so the file has no format hunk that `main` does not have. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): move the missing-reference entry into the middle of Unreleased > Fixed The entry was appended at the end of Unreleased > Fixed, where current GitHub main and ten open pull requests also add their entries, so each of those merges conflicted in CHANGELOG.md. Every slot between the section's entries is used by at least one open pull request; the slot before the Measured Agent Resources entry is shared with only one (NVIDIA#423). Move the entry there. The text is unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read zsh groups, cmd.exe variables and Windows short names in reference lines A missing reference was accepted when its line reached a file left out of the scan through syntax that the pattern reading did not know. Each of these passed with the warning that the line names no file left out of the scan, while the same line written as $DIR/$RUN or v{e,x}rsions stayed INCOMPLETE: - zsh groups, such as (v)ersions/(i)nstall.sh or (v|x)ersions; - cmd.exe ^ escapes, such as ver^sions/inst^all.sh; - cmd.exe variables, such as %DIR%/%RUN%; - Windows 8.3 short names, such as NODE_M~1/BOOTST~1.SH. The line is now also read with its shell groups and numeric ranges, with and without its backticks, and with each backtick span that joins a word as a command's output. Each word is read twice: as a POSIX shell reads it, and as cmd.exe or PowerShell read it (^ and quotes removed, %VAR%, !VAR!, %1 and %~dp0 as any text, \ as a directory separator). zsh EXTENDED_GLOB ^ and # are read outside bracket expressions, and a path part with ~ after its first character stands for any name. The work charged for decoding a line rises from 3,000 to 9,000 units per character, so the slowest lines still take no longer per budget than before. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): count files planted in .git outside Git's own layout Inside a left-out .git directory only .git itself and active hooks counted as names, so a skill holding .git/install.sh passed with a line that says "find and run `install.sh`", while the same file in versions/ kept the scan INCOMPLETE. An agent that searches the tree finds either one. Only Git's own layout is now ignored: HEAD, config, description, index, packed-refs, the *_HEAD and other state files, their lock files, and the objects, refs, logs, info and similar directories with what they hold. Any other entry of .git counts with everything inside it, and hooks other than *.sample templates still count. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): say that a named input fixture is INCOMPLETE with or without a Tier 3 run The missing-reference entry grouped input fixtures in evals/files with Tier 3 output and said a line naming one keeps the scan INCOMPLETE after a run, although it passed before. A line naming a fixture is INCOMPLETE as soon as the fixture exists. The sentence is now split: Tier 3 output turns a passing line INCOMPLETE after a run, and a named fixture keeps it INCOMPLETE whenever the fixture exists. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that a shell group stands for what it holds The new paragraph on shell readings said that each group may stand for any text. Only a group with alternatives, an extended glob, a numeric range or a command does; a group such as (v) is read as what it holds, and quotes and escapes are removed. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read backtick spans in reference lines as code, not as commands A backtick span joined to a word was read as a command's output that may name anything. That made plurals such as `topic`s and pairs such as `GET`/`POST` keep a scan INCOMPLETE whenever anything was left out of it, and it still missed a span joined through a quote, as in "`printf '\166'`"ersions. A span that stands alone does the same job: sh "`printf '\166ersions/\151nstall.sh'`" runs versions/install.sh and was never read as any text. The check reads names written in the line; it cannot evaluate a command. So spans are read as Markdown code again, as written and with the backticks removed, and the docs and CHANGELOG say that a name a command prints, or a name on another line, is not detected. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read zsh groups after "]" and zsh globbing flags in reference lines A zsh group kept its parentheses when it followed "]", so "sh [v](e)rsions/[i](n)stall.sh" was not read as versions/install.sh, which plain zsh runs. A group now always loses its parentheses; the line as written is still read, so a Markdown link destination is read as written too. zsh EXTENDED_GLOB globbing flags such as (#a2) (approximate match) or (#c1) (repeat count) were read as literal text, so "(#a2)virsions/(#a2)instell.sh" passed although zsh runs versions/install.sh. A flag changes how the rest of its word matches, across "/" as well, so a run of non-space characters that holds a flag group now stands for any text. Only zsh's flag grammar counts ((#s), (#e), (#q...), (#cN,M) and combinations of i, l, I, b, B, m, M, u, U and aN), so a heading such as "## Notes (NVIDIA#1):" and an anchor link such as [Setup](#setup), which zsh rejects as a bad pattern, are read as before. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read "~" and a whole "x#" in reference lines as narrowly as zsh and Windows do Any path part with "~" after its first character stood for any name, and a whole part "x#" for any name starting with x. So "Summarize in 3~5 sentences", "Keep `notes.md~` backups" and "Write the F# client" kept a scan INCOMPLETE beside `evals/files/meeting.txt`, although nothing they can expand to is left out. - zsh EXTENDED_GLOB reads "a~b" as what "a" matches, except what "b" matches, so the part is now also read as the text before its first "~". - A Windows 8.3 short name such as NODE_M~1, a hashed short name such as NO3F2A~1 and a Samba mangled name all keep the first character of the long name, after the dots and spaces Windows drops (or "_" for one it cannot keep). With text after the "~", the part now stands for any name that holds that character, not for any name. - The part as written is still read, a leading "~" of a word is still a home directory, and one at the start of a later part still stands for any name. A "~" at the end, as in "notes.md~", is not a short name. - zsh "C#" as a whole part matches only names made of "c" ("C", "CC"), so it now matches only those, through a repeat marker that _skillspector_glob_matcher reads. A "#" elsewhere still stands for any text, and a bracket expression before a whole "#" still reads as "x*". The docs list the prose that still stays INCOMPLETE: "$5", "{a,b}", "%APPDATA%", a lone "^", and "approx~10" beside a name with an "a". Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that the missing-reference check reads only the reported line and runs no command The check reads names written in the line that SkillSpector reports, in the spellings a shell, cmd.exe, PowerShell or Windows give them. It does not read other lines or run commands, so a name set on another line (`DIR=node_modules`, then `sh $DIR/$RUN`) or printed by a command (printf in backticks, a pipe into `xargs sh`, `find -exec`, a PowerShell string joined with `+`) is not detected. The docs and CHANGELOG now say that the check keeps an instruction that names a left-out file INCOMPLETE but does not catch a skill written to hide one: without it, such a skill passes whenever SkillSpector reports no missing reference, and with it, also when every reported line is another missing reference. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): hold SkillSpector 2.13.3 reference caveats to the missing-reference conditions Main (7ae25d2) now accepts a SkillSpector 2.13.3 report whose only gaps are reference_missing rows as a reference caveat (reference_caveat_metadata): an INFO finding with skillspector_reference_caveats metadata that keeps the scanner's partial status. That rule reads only the report. So, after the merge, a 2.13.3 report passed when its line names a file left out of the scanned copy (versions/install.sh, node_modules/, a .git hook) or when the skill was scanned inside a larger folder or plugin, which this branch keeps INCOMPLETE. In the partial-analysis branch, when the scan's reference root is known, a caveat that reference_caveat_metadata accepts now also has to pass _skillspector_missing_reference_notes; otherwise the scan keeps the incomplete-analysis error. Without a reference root, such as a direct _run_skillspector call outside validate, reference_caveat_metadata alone decides, as on main, so its tests, which call _validate_skillspector_report without a reference root, are unchanged. When both accept a report, it carries main's caveat finding, not this branch's warning. Tests: - The 2.13.3 cases that pass (the notes writer, the LLM stage, a lone SKILL.md, prose beside fixtures, .git layout names, a folder with no skill, each skill on its own after its folder or plugin scan) now expect the caveat warning; 2.11.2, 2.12.0 and the image case keep this branch's warning. - test_scan_outside_a_validated_target_stays_incomplete uses the 2.12.0 report for the rule here, and checks that a 2.13.3 report in the same direct call passes as a caveat. - New test_reference_caveats_meet_the_same_conditions: the staged versions/install.sh report passes reference_caveat_metadata on its own and stays INCOMPLETE through validate_security_only, both when the script is left out and when the reference root is a folder above. Docs and CHANGELOG say which rule a 2.13.3 report takes and that the conditions apply to it whenever the scan has a known target. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): follow main in scanning authored evals/ files Main (7ae25d2) now keeps authored evals/ and .evals/ files in the SkillSpector scan and leaves out only generated output below them, such as evals/results. So evals/ is no longer a directory left out of the scanned copy, and input fixtures in evals/files are scanned. - The left-out-directory case for evals/install.sh moves to evals/results/install.sh, which the scan still leaves out; a skill with only evals/install.sh is no longer staged. - The input-fixture case of the Tier 3 output test is dropped: a fixture in evals/files is now in the scan, so a line that names it is no longer a reference to a file left out. The three Tier 3 output cases stay. - docs/tier1-validation.mdx and the CHANGELOG entry no longer name evals/ as left out, and no longer say that a line naming an input fixture stays INCOMPLETE; the docs say that the rest of evals/ is scanned. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): scope two reference-root docstrings to the missing-reference rule The skillspector_reference_root and _validate_with_applicability docstrings said a scan without a known reference root accepts no missing reference. Since main 7ae25d2, reference_caveat_metadata still accepts a 2.13.3 report whose only gaps are missing references when no reference root is known, such as in the per-partition scans of tier1/plugin_checks.py. Say that the rule these docstrings describe is _skillspector_missing_reference_notes and that such a report passes as its caveat. No change in behavior. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): name the Tier 3 output test after what it still covers The input-fixture case left this test when main 7ae25d2 started scanning authored evals/ files, so it now covers only Tier 3 output in the skill. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): use evals/results for the left-out files in two missing-reference tests Since 7ae25d2 the scan keeps authored evals/ files, so evals/ is not a directory left out of the scanned copy. Two tests still used evals/ files as left out. They passed only because the mocked 2.13.3 report was captured without those files, so they counted as unlisted files. - test_missing_reference_with_a_referenced_image[line-names-a-left-out-file] adds evals/results/notes.md instead of evals/notes.md. - test_directories_left_out_that_the_line_does_not_name_are_ignored keeps evals/results/run-1/ and .git as its left-out directories, in place of evals/evals.json and evals/files/input.csv. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): accept SkillSpector 2.13.4 complete_with_caveats reports for missing references (NVIDIA#458) * fix(tier1): accept SkillSpector 2.13.4 complete_with_caveats reports for missing references SkillSpector 2.13.4 reports a scan whose only gaps are missing references as complete_with_caveats instead of partial. The security check rejected that status as not recognized, so a skill naming a file it does not bundle was INCOMPLETE with 2.13.4 or later on PATH. Recognize the status from 2.13.4 on. Accept its caveats only when every one is a reference_missing row and they pass the missing-reference rule already applied to partial reports, then show the same warning. Anything else keeps the scan INCOMPLETE with an error naming up to three caveats. The report stays complete, so a LOW report must still say SAFE and its findings are checked as usual. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): describe how complete_with_caveats reports are checked Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep the findings of a caveats report whose caveats are rejected A complete_with_caveats report whose missing-reference caveats fail the rule for a partial report's missing references, for example because the scan does not cover its whole target, now marks the scan INCOMPLETE and keeps checking the report, as the partial branch does. Its findings stay in the result. Before, the report was dropped, so a skill with High findings in a folder target showed none of them with SkillSpector 2.13.4 while 2.13.3 showed all of them. A caveats report with no caveat, or with a caveat that is not a reference_missing row in reference_resolution, contradicts SkillSpector's own rule for the status. It is still not trusted, and its error now names the rows of another kind. The LOW-to-CAUTION recommendation check reads whether the result was incomplete on entry, so a rejected LOW caveats report, which SkillSpector keeps SAFE, is not also rejected for its recommendation. The near-miss tests now assert the exact error of each case. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): add the caveat warning only after the rest of the report passes The warning for accepted complete_with_caveats caveats says they do not mark the scan incomplete. It was added before the recommendation, issue, exit-code and components checks, so a report that one of those rejected showed INCOMPLETE beside that warning. The warning is now added just before the report is accepted. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): make the caveat path near misses reach the bundled-file rules The absolute, escaping, backslash, control-character, unlisted and directory near misses changed only the ledger row's path. The `missing` entry in `references` stayed on SKILL.md, so the reference check rejected each row before the path rules ran, and disabling those rules left every case green. Each path case now moves the `missing` reference with its row and, where the case needs it, the `components` entry. Where the platform allows it, the file the path would name without the rules holds the reference's line, and the absolute case uses `/SKILL.md`, which names SKILL.md once split at "/". A spy asserts that `_skillspector_bundled_file_bytes` refuses the row's path in every path and file case. Disabling the backslash, safe-text, path-part or listed-once rule now fails the backslash, control-character, absolute or unlisted case. SecureRoot also refuses the escaping and directory paths. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that only complete keeps its status after transitive truncation A complete_with_caveats report with `is_complete: false` and a "Transitive traversal truncated: ..." limitation must fail the status marker check: SkillSpector rewrites a truncated caveats report to partial, so only `complete` may keep its status. No test held this; letting the exception also cover complete_with_caveats sent such a report to the partial branch, which kept its findings, and every test stayed green. The new near miss expects "has contradictory status markers" and fails under that change. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): name the phase of a trusted complete_with_caveats caveat The entry said a report is not trusted when it has a caveat that is not a nonfatal `reference_missing` row. A nonfatal `reference_missing` row in another phase is also not trusted: the code drops the report with "reports caveats other than missing references", and the docs require phase `reference_resolution`. The entry now says so. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): keep 2.13.4 caveats blocking for each skill of a validate catalog The stacked branch now judges each skill of a `validate <folder>` run against the folder. The caveat check reuses its missing-reference rule and reference root, so pin that a complete_with_caveats report for such a skill stays INCOMPLETE with the caveat error and no warning, with one and two workers, and that the same skill validated on its own passes. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that a missing reference outside reference_resolution drops the caveats report A complete_with_caveats report whose reference_missing row is in another phase contradicts its status, so it must be untrusted and lose its findings, not only become INCOMPLETE. The only wrong-phase near miss used a report without findings, so checking the reason code alone kept those tests green. Parametrize the findings-dropped test with the instruction-override report's row moved to phase static. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(tests): keep the contradicting-caveats test within the line limit Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): set 2.13.4 caveats apart from the 2.13.3 reference caveat Main (7ae25d2) accepts a fully inspected SkillSpector 2.13.3 partial report whose only gaps are missing references as a reference caveat (reference_caveat_metadata): an INFO finding with skillspector_reference_caveats metadata, decided from the report alone when the scan has no known target. The paragraph and CHANGELOG entry before this branch's now describe that caveat, so "shows the same warning" no longer said which one a complete_with_caveats report gets. That rule reads only partial reports, so it never takes a complete_with_caveats report. Such a report is accepted only by _skillspector_reference_caveat_notes, which needs the scan's reference root to be its scanned root, and it carries the missing-reference warning. - docs/tier1-validation.mdx and the CHANGELOG entry say the caveats show the missing-reference warning, are never accepted from the report alone, so they leave a scan without a known target INCOMPLETE, and add no skillspector_reference_caveats entry. - New test_caveats_are_not_a_2_13_3_reference_caveat: in a direct scan without a reference root, the notes writer's 2.13.3 report passes as main's caveat and its 2.13.4 report stays INCOMPLETE; through validate_security_only the 2.13.4 report passes with the missing-reference warning and has neither the caveat finding nor its metadata. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say which warning 2.13.4 caveats get in the report docstring The _validate_skillspector_report docstring now lists main's 2.13.3 reference-caveat rule (reference_caveat_metadata) beside the missing-reference notes, so "the same warning" for complete_with_caveats reports no longer named one. Name the warning of _skillspector_missing_reference_notes, and say that reference_caveat_metadata reads only partial reports, so it never accepts these caveats, even without a reference root. No change in behavior. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): name the missing-reference warning for 2.13.4 caveats The Unreleased > Fixed entry for complete_with_caveats said the caveats get "the same warning". The entry above it now also describes main's v2.13.3 reference-caveat INFO finding, so name the warning: the missing-reference warning, as docs/tier1-validation.mdx does. No change in behavior. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): rewrap the 2.13.4 caveats entry The previous commit left one 97-character line in the Unreleased > Fixed entry for complete_with_caveats. Rewrap the rest of the entry to 78 columns like its neighbours. Same words. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Signed-off-by: Narendran Raghavan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> --------- Signed-off-by: Narendran Raghavan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
rng1995
added a commit
that referenced
this pull request
Nov 13, 2026
* fix(tier1): accept SkillSpector partial reports whose only gaps are missing references SkillSpector marks the analysis partial when the skill's instructions name a file the skill does not bundle, such as a file it writes at run time, although every bundled file is still inspected. The Tier 1 security scan then stopped as INCOMPLETE. Accept such a report with a warning when every ledger row is a nonfatal reference_resolution row: reference_missing on any version, or, before SkillSpector 2.12.0, reference_unresolved whose line the report's references list records as missing. Each row must name exactly one listed component that is a regular, single-link file under the scanned root, reached without following a link. The report must also have no partially or entirely uninspected file, no filtered finding, no limitation, no fatal scope exclusion, and universal analyzers that completed every component. A reference that matches several bundled files stays INCOMPLETE. The path check, row predicate and warning text are module-level helpers so later SkillSpector report rules can reuse them. Tests use real offline SkillSpector 2.11.2, 2.12.0 and 2.13.3 reports. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): describe when SkillSpector missing references are a warning Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep a missing reference blocking when it may name a file left out of the scan SkillEvaluator scans a copy of the skill without artifact directories such as evals/, versions/ and node_modules/, and SkillSpector leaves links out of its inventory. A reference to a script there is reported as missing, so the missing-reference rule turned an INCOMPLETE scan into a pass although the script was never inspected. A missing-reference row is now accepted only when: - the report's references list records a missing reference on the row's line, for every SkillSpector version, and that entry's evidence matches the line read from the scanned file; - that line names no entry of the skill that SkillSpector did not inspect: a link, a file the report does not list, or the outermost directory that holds no listed file, and every file inside such a directory. Names are compared case-folded, as written and in NFC, with Markdown escapes removed and with percent-escapes decoded, and must not adjoin another name character. The walk does not follow links and stops at 50,000 entries. A single-file scan root is now read through SecureRoot too, so it must be a single-link file of at most 1,000,000 bytes. A lone SKILL.md is scanned this way, and SkillSpector 2.13.3 reports every reference in it as missing. The warning now says that every file SkillSpector scanned was inspected and that those lines name no file left out of the scan. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): accept missing references alongside referenced images A skill whose SKILL.md shows an image and names a file it writes at run time got both gaps in one partial SkillSpector report, and stayed INCOMPLETE because each rule required its gap to be the only one. _skillspector_missing_reference_notes now separates the reference rows. They pass the same checks as before; the other rows must be referenced images that _skillspector_passive_raster_note accepts, which accounts for the counts, analyzers and limitations. The scan then carries both warnings. A report with images only still goes to the image rule alone. The new fixture is a real SkillSpector 2.13.3 --no-llm report of such a skill. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): state which missing references SkillEvaluator accepts and why The docs and CHANGELOG said that every bundled file is inspected and that the warning quotes the references. SkillEvaluator leaves artifact directories out of the scanned copy, and the warning names only the file and line, so both now say what is checked: the references list, the line, and the files and directories left out of the scan. They also say that missing references may come with accepted referenced images, that the rule covers SkillSpector v2.10 to v2.13.3, and that v2.13.4 and later report these scans as complete_with_caveats, which is not accepted yet. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep missing references blocking when they may name unscanned files Follow-ups to accepting SkillSpector missing references: - A single-file scan root, such as `security-scan path/to/SKILL.md`, now counts every entry beside the file as not inspected, because SkillSpector scans that file alone. Before, a line that named a script beside it passed. - A directory that holds an uninspected entry (an unlisted file, a link or a left-out subtree) is named too, even when it also holds listed files. - A left-out `.git` directory counts by its own name and its hooks other than `*.sample` templates, so `config`, `HEAD` or branch names no longer keep a scan INCOMPLETE. - When the validator's `skillspector_reference_root` is not the scanned root, as for a skill scanned inside a plugin, a missing reference is never accepted, because the line may name a file elsewhere in that artifact. - Tests for each case, and a unit test that patches `stat_is_link_or_reparse` so the reparse-point branch is covered on every OS. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): state the lone-file, plugin, .git and baseline rules for missing references - A lone file is scanned on its own, so a line that names a file beside it keeps the scan INCOMPLETE. - A skill scanned on its own inside a plugin keeps its missing references INCOMPLETE. - Only `.git` itself and its active hooks count as names inside `.git`, and a directory that holds a left-out entry counts too. - No finding may be filtered out, for example by `--skillspector-baseline`. - When one check covers several skills, such as `security-scan` on a folder, a passing skill is listed without its warnings. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep missing references blocking for each skill of a folder scan `security-scan` on a folder, and `validate` or `tier1` on a folder without a configured reference root, scan each skill found in it on its own. A line in such a skill may name a file elsewhere in the folder, such as a plugin's `scripts/install.sh`, that the skill's scan never inspects, yet the missing-reference rule accepted it because the reference root was unset. While a target that is a directory but not a skill is walked, use it as the reference root, so those skills' missing references keep the scan INCOMPLETE as on main. A skill directory, a lone file and a folder with no skill (scanned as a whole) are unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read reference lines with every Markdown escape and character reference resolved The check that a missing reference's line names no file left out of the scan removed only the escapes SkillSpector strips itself (`\\`, `\(`, `\)`, `\<`, `\>`). A Markdown renderer also resolves a backslash escape of any ASCII punctuation and HTML character references, so `[the setup script](node\_modules/run\_all.sh)` or `[the setup script](versions/install.sh)` named a left-out file and still passed. Also read the line with backslash escapes of all ASCII punctuation removed, HTML character references resolved and percent-escapes decoded, up to three of these steps in any order, so either line keeps the scan INCOMPLETE. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): word the missing-reference warning so it holds beside images and for a lone file The warning said "every file SkillSpector scanned was inspected", which is not true when an accepted referenced image is the other gap: the next warning says SkillSpector's text analyzers could not read it. It also said "Files outside the skill were not scanned", although for a lone SKILL.md the files beside it inside the skill are not scanned either. Say instead that SkillSpector reported no other gap for these references, and that files not in the scan, including any outside the scanned path, were not inspected. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): drop the baseline example from the missing-reference conditions The docs and CHANGELOG said that a scan in which `--skillspector-baseline` suppresses a finding stays INCOMPLETE. SkillSpector 2.10.0 to 2.13.3 count findings after filtering as every finding up to the report cap, so a baseline does not change `findings_before_filtering` or `findings_after_filtering`; such a scan passes with the missing-reference warning and the baseline's suppression note. State the actual condition, that the two counts match. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that a folder with no skill keeps its missing references accepted A folder that holds no skill is scanned as one target, so it is its own reference root and the folder-scan rule leaves its accepted missing references unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): accept missing references only for the whole target of a scan The folder rule set a reference root only while a folder was walked, so a scan run outside validate() or validate_security_only(), such as a direct per-directory _run_skillspector() call on one partition of a larger tree, still had no root and accepted missing references that main keeps INCOMPLETE. Record the resolved target for every walk instead, and accept missing references only when the reference root (the configured skillspector_reference_root, or else that target) is the scanned directory. A skill directory, a lone file and a folder with no skill are their own target; a skill found inside a folder is not; a scan with no known target accepts none. _skillspector_missing_reference_notes now requires reference_root. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say which scans may accept missing references in the reference-root docstring The `skillspector_reference_root` docstring describes its default for finding scoping, the scanned directory. The missing-reference rule uses a different default, the whole target of validate() or validate_security_only(); say so next to it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): accept SkillSpector 2.13.4 complete_with_caveats reports for missing references SkillSpector 2.13.4 reports a scan whose only gaps are missing references as complete_with_caveats instead of partial. The security check rejected that status as not recognized, so a skill naming a file it does not bundle was INCOMPLETE with 2.13.4 or later on PATH. Recognize the status from 2.13.4 on. Accept its caveats only when every one is a reference_missing row and they pass the missing-reference rule already applied to partial reports, then show the same warning. Anything else keeps the scan INCOMPLETE with an error naming up to three caveats. The report stays complete, so a LOW report must still say SAFE and its findings are checked as usual. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): describe how complete_with_caveats reports are checked Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep the findings of a caveats report whose caveats are rejected A complete_with_caveats report whose missing-reference caveats fail the rule for a partial report's missing references, for example because the scan does not cover its whole target, now marks the scan INCOMPLETE and keeps checking the report, as the partial branch does. Its findings stay in the result. Before, the report was dropped, so a skill with High findings in a folder target showed none of them with SkillSpector 2.13.4 while 2.13.3 showed all of them. A caveats report with no caveat, or with a caveat that is not a reference_missing row in reference_resolution, contradicts SkillSpector's own rule for the status. It is still not trusted, and its error now names the rows of another kind. The LOW-to-CAUTION recommendation check reads whether the result was incomplete on entry, so a rejected LOW caveats report, which SkillSpector keeps SAFE, is not also rejected for its recommendation. The near-miss tests now assert the exact error of each case. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): add the caveat warning only after the rest of the report passes The warning for accepted complete_with_caveats caveats says they do not mark the scan incomplete. It was added before the recommendation, issue, exit-code and components checks, so a report that one of those rejected showed INCOMPLETE beside that warning. The warning is now added just before the report is accepted. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): make the caveat path near misses reach the bundled-file rules The absolute, escaping, backslash, control-character, unlisted and directory near misses changed only the ledger row's path. The `missing` entry in `references` stayed on SKILL.md, so the reference check rejected each row before the path rules ran, and disabling those rules left every case green. Each path case now moves the `missing` reference with its row and, where the case needs it, the `components` entry. Where the platform allows it, the file the path would name without the rules holds the reference's line, and the absolute case uses `/SKILL.md`, which names SKILL.md once split at "/". A spy asserts that `_skillspector_bundled_file_bytes` refuses the row's path in every path and file case. Disabling the backslash, safe-text, path-part or listed-once rule now fails the backslash, control-character, absolute or unlisted case. SecureRoot also refuses the escaping and directory paths. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that only complete keeps its status after transitive truncation A complete_with_caveats report with `is_complete: false` and a "Transitive traversal truncated: ..." limitation must fail the status marker check: SkillSpector rewrites a truncated caveats report to partial, so only `complete` may keep its status. No test held this; letting the exception also cover complete_with_caveats sent such a report to the partial branch, which kept its findings, and every test stayed green. The new near miss expects "has contradictory status markers" and fails under that change. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): name the phase of a trusted complete_with_caveats caveat The entry said a report is not trusted when it has a caveat that is not a nonfatal `reference_missing` row. A nonfatal `reference_missing` row in another phase is also not trusted: the code drops the report with "reports caveats other than missing references", and the docs require phase `reference_resolution`. The entry now says so. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): report hooks SkillSpector cannot model as a Critical gate failure SkillSpector 2.12.0 and later record a nonfatal partial opaque_content row from bundled_execution_surface on a hook manifest whenever they cannot model what a hook does with its input, which includes every command hook. The analysis is reported as partial although the scan finished, so a skill, folder or hooks-only plugin with a command hook stopped as INCOMPLETE. When the row is a whole-file row on a manifest whose BH1 finding says the hook payload is unmodeled (also under a baseline) and the report accounts for it exactly, the row is taken out before the missing-reference and image gates, and the rest of the report decides whether the scan is complete. Each manifest then gets the Critical skillspector_hook_payload_unverified and a gate failure, so a policy severity override cannot pass it, and --llm-verify does not downgrade it. Static and LLM stages report it once. Any other row keeps the scan INCOMPLETE, and its error names only the other rows. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): describe the Critical for hooks SkillSpector cannot model Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep scanning a folder past a skill with unmodeled hooks A folder scan stops at the first skill with a CRITICAL finding unless --continue-on-failure is set, because a CRITICAL used to mean a configuration error that affects every skill. The hook Critical is a fact about one skill's hooks, so stopping there dropped the findings of every later skill from the report while it still said "Security scanning 3 skill(s)". ValidatorBase now skips checks in _FAIL_FAST_EXEMPT_CHECKS when it looks for a CRITICAL that stops the walk. SecurityValidator lists skillspector_hook_payload_unverified there. Any other CRITICAL still stops the walk. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): name the remedy that exists in the hook Critical The Critical said the hooks "need a recorded review before this artifact can pass", and the gate failure said "they need a recorded review", but SkillEvaluator has no way to record such a review. A user who reviewed the hooks, for example with a SkillSpector baseline, could only pass by removing them, and only the docs said so. The Critical now says the check cannot pass while the hooks are present, the gate failure says the same, and the suggestion says that only removing the hooks lets the check pass. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep hook manifests SkillSpector read only in part incomplete SkillSpector emits the same opaque_content row from bundled_execution_surface when it cannot model the hooks and when it could not parse part of the manifest or read only its first 2,048 records. The row's observed_records/limit_records check only ran when both counts were present and only caught observed > limit, so it never fired with SkillSpector 2.13.3, which does not serialize the counts, and it let partly parsed manifests through on every release. The BH1 declaration_count is now read with each unmodeled manifest. With the counts on the row (2.13.4), observed_records must equal it and not exceed limit_records; with one count alone the row is refused. Without them (2.13.3), a BH1 with 2,048 or more declarations is refused. A refused row leaves the scan INCOMPLETE as before. With 2.13.3 a partly parsed manifest still gets the Critical, and it still fails. Real offline --no-llm captures of a skill whose .claude/settings.json has 2,050 command hooks, a second handler whose command is a list, or an env value that is a list, with 2.13.3 and 2.13.4, and of one with a permission rule beside the hook, with 2.13.4, pin the behaviour. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin the fatal and parent-path rules of the hook row The predicate's fatal check was covered only through the report validator, which already refuses a fatal row, so dropping the check from the predicate passed every test. A row path with a ".." part was tested only as an absolute path at the predicate and as a BH1 location in the helper test. The predicate test now refuses a fatal row and a "../hooks.json" row whose manifest is listed, and an end-to-end case puts the row and its BH1 on "../hooks.json" and expects an incomplete scan without the Critical. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): name the remaining gaps when only the hook rows had rows When the hook rows were taken out and the remaining gap had no ledger row of its own, such as an extra limitation, another partially inspected file, a fatal scope exclusion, filtered findings or an analyzer that did not finish, the INCOMPLETE error lost its cause and read only "reports incomplete analysis (status 'partial'); security scan did not complete". _skillspector_hook_surface_is_the_only_gap becomes _skillspector_gaps_without_rows, which describes each of those gaps; an empty list means none remains. The error then names them, for example "limitation 'Transitive traversal stopped early.'" or "1 partially inspected file(s)". A report with other rows still names its rows. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep the hook Critical away from the LLM verifier --llm-verify sent the hook Critical to the verifier with every other finding. The verifier's verdict could not change it, yet it was recorded on the finding (llm_verdict false_positive, llm_confidence high next to a Critical), and a reply without a verdict for that one finding made the whole result INCOMPLETE ("llm-verification"). _verify_findings_with_llm now sends only findings whose check is not in _LLM_VERIFY_EXEMPT_CHECKS and counts verdicts over those. An exempt finding keeps its severity and gets no llm_* metadata, and a scan whose only finding is exempt does not call the verifier. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): report the hook Critical once when the --llm stage is incomplete Both SkillSpector stages run the same static analyzers, so with --llm both report each manifest's Critical and gate failure. Repeated findings were dropped only after a complete enrichment stage, because that rebuild also drops an incomplete stage's error. Now that the static stage completes for hook skills, the enrichment stage runs for them, and when it ended INCOMPLETE for another gap the Critical, its error string and the gate failure were reported twice (critical_count 2). _drop_repeated_hook_reports removes from the enrichment stage the hook Criticals and gate failures the static stage already holds, with their error strings and counts, before the merge and whether or not that stage completed. The gate-failure dedupe in _deduplicate_skillspector_findings is no longer needed and is removed. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): describe partly read hook manifests and the hook Critical's remedy The rule paragraph said every command hook gets the Critical, but a manifest whose command and HTTP hooks SkillSpector all reports as BH2 uploads is modeled and never reaches it. It also said that a manifest with more declarations than SkillSpector reads stays INCOMPLETE, which held only when the row carries record counts. The paragraph now names the BH2 exception and lists what each release shows: with v2.13.4 the record counts must match the BH1 declarations, so a truncated or partly parsed manifest, or a settings file with other records beside its hooks, stays INCOMPLETE; with v2.13.3 only a BH1 at the 2,048-declaration limit does, and a partly parsed manifest gets the Critical. The troubleshooting entry quotes the new messages, says that SkillEvaluator cannot record a review so only removing the hooks passes, that a folder scan goes on past the skill, and that --llm-verify does not send the finding to the verifier. The CHANGELOG entry says the same. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): cover the uninspected-file gap description The gap descriptions for a report without hook rows had a case for each gap but an entirely uninspected file. A report with one such file, and consistent counts, now stays INCOMPLETE with "1 uninspected file(s)" in its error. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that a missing reference stays a warning beside unmodeled hooks Add real SkillSpector v2.13.3 and v2.13.4 --no-llm captures of a skill with a .claude/settings.json command hook whose SKILL.md names output/notes.md, which the skill does not bundle. Both report the hook row and a reference_missing row as partial. The new test checks, with content_type skill and none, that the result fails with one Critical and one gate failure, keeps the missing-reference warning and is not incomplete. It fails when the missing-reference gate gets the report's rows, statuses, counts or limitations from before the hook rows are taken out. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep missing references blocking for each skill of a validate catalog `validate` on a folder of skills runs each skill as its own job, either in process or as a `validate <skill>` child process with --workers above 1. Each job's security scan saw the skill directory as its whole target, so a SkillSpector missing reference in it was accepted, although its line may name a file elsewhere in the folder that the skill's scan never inspected. `security-scan` on the same folder keeps it INCOMPLETE. Pass the folder to each job through a hidden `--catalog-root` option, set by the in-process path and by the child argv. `run_validation` hands it to SecurityValidator as a new `target_root`, which replaces the walk target as the root that missing references are judged against. Finding scoping (`skillspector_reference_root`) is unchanged. The docs no longer say that `tier1` takes a plugin; it takes one skill. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read shell globs, expansions and quotes in reference lines as patterns A missing reference was accepted when its line named no left-out file by its literal name. SkillSpector keeps `*`, `?`, `[...]` and quotes in a Markdown link destination and reports it as `reference_missing`, so a line such as "run [the setup script](v*/*.sh)", `vers?ons/inst?ll.sh`, `ver""sions/inst""all.sh` or `v[e]rsions/i[n]stall.sh` passed although a shell would open the `versions/install.sh` that the staged scan left out. Read each word with shell syntax as a shell would: brace and parameter expansions stand for any text, quotes and backslashes are removed, and each path part is an fnmatch pattern that no left-out name may match. A word made only of `*`, such as a list marker, is skipped. The docs said the decodings apply "in any combination"; they apply up to three steps in any order, and now also name the shell patterns. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): bound the work of checking missing-reference lines Each missing reference's line is checked in up to 40 decoded forms, and every left-out name that is not a plain name run is searched for in each. A skill with tens of thousands of such names left out of the scan and long lines of escapes beside its missing references could keep a scan busy for minutes, where main returns INCOMPLETE at once. Charge the work to one budget per report: decoding a line, every search of a decoded line for such a name, and compiling and matching each shell pattern. A line that would overdraw it is not accepted, so the scan stays INCOMPLETE. Plain name runs are now matched through one lookup per run of the line instead of one test per name, and a line with no left-out names is accepted without decoding it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): match reference-line globs in linear time and cover nested expansions fnmatch.translate scans ahead for the `]` of every `[`, so a word of a few thousand `[` took over a second to translate, and the budget charged a pattern by count, not length. Nested brace and parameter expansions such as `v{e{r,x},y}sions` or `${X:-${Y:-v}}ersions` were left partly literal, and splitting parts at `:` broke `[[:alpha:]]`, which Python's fnmatch does not support anyway. Translate globs with a linear scanner of our own. A bracket expression matches any one character and a stray `]` any text, so the matcher accepts every name the shell would and possibly more, and a pattern with more fixed characters than the longest left-out name is skipped. The regex keeps one backtracking `*` at most, as fnmatch does. Replace everything from the first `${` or brace expansion to its last `}` with `*`, split parts at `/` and also at `=`, `:` and `,`, and charge each pattern by its length. Decoding a line now costs 3,000 per character. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(cli): record validate's hidden --catalog-root option in the CLI surface golden The catalog fix added a hidden `--catalog-root` option to `validate`, which each per-skill job of a folder run receives. Regenerate the golden CLI surface with tests/golden/generate_cli_surface.py; the only change is that option. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(tier1): pass the catalog root next to the content type Open PR #394 appends keyword arguments to `run_validation` and to its call in `validate`. Put `target_root` beside `content_type` in both places instead, so the two changes touch different lines. Behaviour is unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that a word made only of `*` is not read as a glob The reference-line check skips a word made only of `*`, such as a Markdown list marker, when it reads shell patterns. Say so next to the pattern rule. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say when a scan outside the validated target accepts missing references The `_validate_with_applicability` docstring said that a scan run outside the walk accepts no missing reference. That holds only without a configured `skillspector_reference_root`: a direct `_run_skillspector` call whose reference root is the scanned root accepts them, because that scan covers the whole root. Say so, and pin both cases with a test. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(cli): list catalog_root first among the options a catalog child does not inherit Open PR #394 adds eight entries to the `not_forwarded` dict of `test_catalog_child_argv_forwards_every_validate_option`, directly after `"output_dir"`, where this branch added `"catalog_root"`. The two insertions touched the same place, so merging both conflicted. List `catalog_root` first instead, so unchanged lines separate the two hunks. The test is unchanged otherwise. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that Tier 3 output and input fixtures in the skill count as not inspected By default Tier 3 writes its results to `<skill>/evals/results`, which the scanned copy leaves out like the rest of `evals/`. After one run, a line that names `results`, a file the run leaves there such as `report.html` or `summary.json`, or, with `--harbor-keep-jobs`, any bundled file (the kept Harbor tasks copy the skill) keeps the scan INCOMPLETE, although the same line passed before the run. An input fixture in `evals/files` counts the same way. The rule stays as it is, because an author can create these directories by hand. Say so in the missing-reference conditions and in the CHANGELOG entry, and name `--results-dir` and `SKILLEVALUATOR_RESULTS_DIR` as the way to keep a run from changing the result. Pin the behaviour with a test that scans the same skill before and after a generated run tree, for a line naming `results/summary.md`, `report.html`, a bundled script copied by a kept Harbor job, and an `evals/files` fixture. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(tests): wrap the reference-root assertion as ruff format does The new test for a direct scan with a configured reference root had one line over the length limit. Wrap it as `ruff format` does, so the file has no format hunk that `main` does not have. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): move the missing-reference entry into the middle of Unreleased > Fixed The entry was appended at the end of Unreleased > Fixed, where current GitHub main and ten open pull requests also add their entries, so each of those merges conflicted in CHANGELOG.md. Every slot between the section's entries is used by at least one open pull request; the slot before the Measured Agent Resources entry is shared with only one (#423). Move the entry there. The text is unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read zsh groups, cmd.exe variables and Windows short names in reference lines A missing reference was accepted when its line reached a file left out of the scan through syntax that the pattern reading did not know. Each of these passed with the warning that the line names no file left out of the scan, while the same line written as $DIR/$RUN or v{e,x}rsions stayed INCOMPLETE: - zsh groups, such as (v)ersions/(i)nstall.sh or (v|x)ersions; - cmd.exe ^ escapes, such as ver^sions/inst^all.sh; - cmd.exe variables, such as %DIR%/%RUN%; - Windows 8.3 short names, such as NODE_M~1/BOOTST~1.SH. The line is now also read with its shell groups and numeric ranges, with and without its backticks, and with each backtick span that joins a word as a command's output. Each word is read twice: as a POSIX shell reads it, and as cmd.exe or PowerShell read it (^ and quotes removed, %VAR%, !VAR!, %1 and %~dp0 as any text, \ as a directory separator). zsh EXTENDED_GLOB ^ and # are read outside bracket expressions, and a path part with ~ after its first character stands for any name. The work charged for decoding a line rises from 3,000 to 9,000 units per character, so the slowest lines still take no longer per budget than before. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): count files planted in .git outside Git's own layout Inside a left-out .git directory only .git itself and active hooks counted as names, so a skill holding .git/install.sh passed with a line that says "find and run `install.sh`", while the same file in versions/ kept the scan INCOMPLETE. An agent that searches the tree finds either one. Only Git's own layout is now ignored: HEAD, config, description, index, packed-refs, the *_HEAD and other state files, their lock files, and the objects, refs, logs, info and similar directories with what they hold. Any other entry of .git counts with everything inside it, and hooks other than *.sample templates still count. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): say that a named input fixture is INCOMPLETE with or without a Tier 3 run The missing-reference entry grouped input fixtures in evals/files with Tier 3 output and said a line naming one keeps the scan INCOMPLETE after a run, although it passed before. A line naming a fixture is INCOMPLETE as soon as the fixture exists. The sentence is now split: Tier 3 output turns a passing line INCOMPLETE after a run, and a named fixture keeps it INCOMPLETE whenever the fixture exists. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that a shell group stands for what it holds The new paragraph on shell readings said that each group may stand for any text. Only a group with alternatives, an extended glob, a numeric range or a command does; a group such as (v) is read as what it holds, and quotes and escapes are removed. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read backtick spans in reference lines as code, not as commands A backtick span joined to a word was read as a command's output that may name anything. That made plurals such as `topic`s and pairs such as `GET`/`POST` keep a scan INCOMPLETE whenever anything was left out of it, and it still missed a span joined through a quote, as in "`printf '\166'`"ersions. A span that stands alone does the same job: sh "`printf '\166ersions/\151nstall.sh'`" runs versions/install.sh and was never read as any text. The check reads names written in the line; it cannot evaluate a command. So spans are read as Markdown code again, as written and with the backticks removed, and the docs and CHANGELOG say that a name a command prints, or a name on another line, is not detected. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read zsh groups after "]" and zsh globbing flags in reference lines A zsh group kept its parentheses when it followed "]", so "sh [v](e)rsions/[i](n)stall.sh" was not read as versions/install.sh, which plain zsh runs. A group now always loses its parentheses; the line as written is still read, so a Markdown link destination is read as written too. zsh EXTENDED_GLOB globbing flags such as (#a2) (approximate match) or (#c1) (repeat count) were read as literal text, so "(#a2)virsions/(#a2)instell.sh" passed although zsh runs versions/install.sh. A flag changes how the rest of its word matches, across "/" as well, so a run of non-space characters that holds a flag group now stands for any text. Only zsh's flag grammar counts ((#s), (#e), (#q...), (#cN,M) and combinations of i, l, I, b, B, m, M, u, U and aN), so a heading such as "## Notes (#1):" and an anchor link such as [Setup](#setup), which zsh rejects as a bad pattern, are read as before. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): read "~" and a whole "x#" in reference lines as narrowly as zsh and Windows do Any path part with "~" after its first character stood for any name, and a whole part "x#" for any name starting with x. So "Summarize in 3~5 sentences", "Keep `notes.md~` backups" and "Write the F# client" kept a scan INCOMPLETE beside `evals/files/meeting.txt`, although nothing they can expand to is left out. - zsh EXTENDED_GLOB reads "a~b" as what "a" matches, except what "b" matches, so the part is now also read as the text before its first "~". - A Windows 8.3 short name such as NODE_M~1, a hashed short name such as NO3F2A~1 and a Samba mangled name all keep the first character of the long name, after the dots and spaces Windows drops (or "_" for one it cannot keep). With text after the "~", the part now stands for any name that holds that character, not for any name. - The part as written is still read, a leading "~" of a word is still a home directory, and one at the start of a later part still stands for any name. A "~" at the end, as in "notes.md~", is not a short name. - zsh "C#" as a whole part matches only names made of "c" ("C", "CC"), so it now matches only those, through a repeat marker that _skillspector_glob_matcher reads. A "#" elsewhere still stands for any text, and a bracket expression before a whole "#" still reads as "x*". The docs list the prose that still stays INCOMPLETE: "$5", "{a,b}", "%APPDATA%", a lone "^", and "approx~10" beside a name with an "a". Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that the missing-reference check reads only the reported line and runs no command The check reads names written in the line that SkillSpector reports, in the spellings a shell, cmd.exe, PowerShell or Windows give them. It does not read other lines or run commands, so a name set on another line (`DIR=node_modules`, then `sh $DIR/$RUN`) or printed by a command (printf in backticks, a pipe into `xargs sh`, `find -exec`, a PowerShell string joined with `+`) is not detected. The docs and CHANGELOG now say that the check keeps an instruction that names a left-out file INCOMPLETE but does not catch a skill written to hide one: without it, such a skill passes whenever SkillSpector reports no missing reference, and with it, also when every reported line is another missing reference. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): keep 2.13.4 caveats blocking for each skill of a validate catalog The stacked branch now judges each skill of a `validate <folder>` run against the folder. The caveat check reuses its missing-reference rule and reference root, so pin that a complete_with_caveats report for such a skill stays INCOMPLETE with the caveat error and no warning, with one and two workers, and that the same skill validated on its own passes. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that a missing reference outside reference_resolution drops the caveats report A complete_with_caveats report whose reference_missing row is in another phase contradicts its status, so it must be untrusted and lose its findings, not only become INCOMPLETE. The only wrong-phase near miss used a report without findings, so checking the reason code alone kept those tests green. Parametrize the findings-dropped test with the instruction-override report's row moved to phase static. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(tests): keep the contradicting-caveats test within the line limit Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that a folder job's missing reference beside unmodeled hooks stays incomplete The base branch now gives each skill job of a `validate` folder run the folder as its target_root, so that job accepts no missing reference. The hook rows are taken out before the missing-reference gate runs, so pin that the gate still gets that root: with the settings hook and the SKILL.md line that names output/notes.md (v2.13.3 and v2.13.4), the scan stays INCOMPLETE, the error names only the reference row, and the hook Critical and gate failure are still reported. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): say that a folder job's missing reference beside unmodeled hooks stays INCOMPLETE Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that a hook scan with another gap fails the check and records the scan as incomplete The CHANGELOG and docs said that a scan with the hook Critical and another gap, such as a missing reference in a skill checked on its own inside a folder or a v2.13.4 parse-limit row from a hook "timeout" key, stays INCOMPLETE next to the Critical. The reported status puts a confirmed failure ahead of missing evidence, so the check shows FAIL; only the incomplete scans and publication eligibility say incomplete. Reword both, and pin the reported status in the tests of those cases: the check and the run are failed, the scan is listed as incomplete, and publication eligibility is incomplete. A partly read manifest, which gets no Critical, still shows INCOMPLETE. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that a folder security scan keeps each missing reference beside the hook Critical security-scan and validate on a folder of skills scan each skill on its own with the folder as its reference root, so each skill's missing reference stays an incomplete-scan error beside its Critical, as for a skill that validate checks as its own job. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(tests): keep the folder security scan test within the line limit Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): hold SkillSpector 2.13.3 reference caveats to the missing-reference conditions Main (7ae25d252) now accepts a SkillSpector 2.13.3 report whose only gaps are reference_missing rows as a reference caveat (reference_caveat_metadata): an INFO finding with skillspector_reference_caveats metadata that keeps the scanner's partial status. That rule reads only the report. So, after the merge, a 2.13.3 report passed when its line names a file left out of the scanned copy (versions/install.sh, node_modules/, a .git hook) or when the skill was scanned inside a larger folder or plugin, which this branch keeps INCOMPLETE. In the partial-analysis branch, when the scan's reference root is known, a caveat that reference_caveat_metadata accepts now also has to pass _skillspector_missing_reference_notes; otherwise the scan keeps the incomplete-analysis error. Without a reference root, such as a direct _run_skillspector call outside validate, reference_caveat_metadata alone decides, as on main, so its tests, which call _validate_skillspector_report without a reference root, are unchanged. When both accept a report, it carries main's caveat finding, not this branch's warning. Tests: - The 2.13.3 cases that pass (the notes writer, the LLM stage, a lone SKILL.md, prose beside fixtures, .git layout names, a folder with no skill, each skill on its own after its folder or plugin scan) now expect the caveat warning; 2.11.2, 2.12.0 and the image case keep this branch's warning. - test_scan_outside_a_validated_target_stays_incomplete uses the 2.12.0 report for the rule here, and checks that a 2.13.3 report in the same direct call passes as a caveat. - New test_reference_caveats_meet_the_same_conditions: the staged versions/install.sh report passes reference_caveat_metadata on its own and stays INCOMPLETE through validate_security_only, both when the script is left out and when the reference root is a folder above. Docs and CHANGELOG say which rule a 2.13.3 report takes and that the conditions apply to it whenever the scan has a known target. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): follow main in scanning authored evals/ files Main (7ae25d252) now keeps authored evals/ and .evals/ files in the SkillSpector scan and leaves out only generated output below them, such as evals/results. So evals/ is no longer a directory left out of the scanned copy, and input fixtures in evals/files are scanned. - The left-out-directory case for evals/install.sh moves to evals/results/install.sh, which the scan still leaves out; a skill with only evals/install.sh is no longer staged. - The input-fixture case of the Tier 3 output test is dropped: a fixture in evals/files is now in the scan, so a line that names it is no longer a reference to a file left out. The three Tier 3 output cases stay. - docs/tier1-validation.mdx and the CHANGELOG entry no longer name evals/ as left out, and no longer say that a line naming an input fixture stays INCOMPLETE; the docs say that the rest of evals/ is scanned. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): scope two reference-root docstrings to the missing-reference rule The skillspector_reference_root and _validate_with_applicability docstrings said a scan without a known reference root accepts no missing reference. Since main 7ae25d252, reference_caveat_metadata still accepts a 2.13.3 report whose only gaps are missing references when no reference root is known, such as in the per-partition scans of tier1/plugin_checks.py. Say that the rule these docstrings describe is _skillspector_missing_reference_notes and that such a report passes as its caveat. No change in behavior. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): name the Tier 3 output test after what it still covers The input-fixture case left this test when main 7ae25d252 started scanning authored evals/ files, so it now covers only Tier 3 output in the skill. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): use evals/results for the left-out files in two missing-reference tests Since 7ae25d252 the scan keeps authored evals/ files, so evals/ is not a directory left out of the scanned copy. Two tests still used evals/ files as left out. They passed only because the mocked 2.13.3 report was captured without those files, so they counted as unlisted files. - test_missing_reference_with_a_referenced_image[line-names-a-left-out-file] adds evals/results/notes.md instead of evals/notes.md. - test_directories_left_out_that_the_line_does_not_name_are_ignored keeps evals/results/run-1/ and .git as its left-out directories, in place of evals/evals.json and evals/files/input.csv. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): set 2.13.4 caveats apart from the 2.13.3 reference caveat Main (7ae25d252) accepts a fully inspected SkillSpector 2.13.3 partial report whose only gaps are missing references as a reference caveat (reference_caveat_metadata): an INFO finding with skillspector_reference_caveats metadata, decided from the report alone when the scan has no known target. The paragraph and CHANGELOG entry before this branch's now describe that caveat, so "shows the same warning" no longer said which one a complete_with_caveats report gets. That rule reads only partial reports, so it never takes a complete_with_caveats report. Such a report is accepted only by _skillspector_reference_caveat_notes, which needs the scan's reference root to be its scanned root, and it carries the missing-reference warning. - docs/tier1-validation.mdx and the CHANGELOG entry say the caveats show the missing-reference warning, are never accepted from the report alone, so they leave a scan without a known target INCOMPLETE, and add no skillspector_reference_caveats entry. - New test_caveats_are_not_a_2_13_3_reference_caveat: in a direct scan without a reference root, the notes writer's 2.13.3 report passes as main's caveat and its 2.13.4 report stays INCOMPLETE; through validate_security_only the 2.13.4 report passes with the missing-reference warning and has neither the caveat finding nor its metadata. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say which warning 2.13.4 caveats get in the report docstring The _validate_skillspector_report docstring now lists main's 2.13.3 reference-caveat rule (reference_caveat_metadata) beside the missing-reference notes, so "the same warning" for complete_with_caveats reports no longer named one. Name the warning of _skillspector_missing_reference_notes, and say that reference_caveat_metadata reads only partial reports, so it never accepts these caveats, even without a reference root. No change in behavior. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): name the missing-reference warning for 2.13.4 caveats The Unreleased > Fixed entry for complete_with_caveats said the caveats get "the same warning". The entry above it now also describes main's v2.13.3 reference-caveat INFO finding, so name the warning: the missing-reference warning, as docs/tier1-validation.mdx does. No change in behavior. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): rewrap the 2.13.4 caveats entry The previous commit left one 97-character line in the Unreleased > Fixed entry for complete_with_caveats. Rewrap the rest of the entry to 78 columns like its neighbours. Same words. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that the report-only reference caveat skips hook reports main (7ae25d252) accepts a SkillSpector 2.13.3 report whose only gaps are missing references from the report alone, as an INFO skillspector_reference_caveats finding. That check reads the whole report, so a report with a hook row never qualifies, and a missing reference beside the hooks keeps the missing-reference warning. Assert that the hook test with a missing reference gets neither the caveat metadata nor the caveat finding. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say that the report-only reference caveat does not apply beside hooks The page now describes main's (7ae25d252) v2.13.3 missing-reference caveat that is accepted from the report alone. The hook paragraph says that missing references beside the hooks can still be accepted "as described above", so say that this caveat is not one of those routes: it reads the whole report, hook row included. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): say that the report-only reference caveat skips hooks After the merge of main (7ae25d252), the entry above this one covers the v2.13.3 missing-path reference caveat that is accepted from the report alone. That caveat reads the whole report, hook row included, so it never applies beside the hooks: a scan without a known target, such as direct API use or a per-partition plugin scan, records a hooks-plus-missing- reference report as incomplete next to the Critical. The docs page says this already; say it in the hook entry too, and name the scan without a known target among the gaps the rules above do not accept. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say in the report docstring that the caveat skips hooks The hook paragraph of `_validate_skillspector_report` said only that the rest of the report decides whether the scan is complete. The report-only v2.13.3 missing-reference caveat reads the whole report, hook rows included, so it does not apply beside the hooks: without a reference root, a missing reference there records the scan as incomplete next to the Critical. Say so. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): accept SkillSpector 2.13.4 complete_with_caveats reports for missing references (#458) * fix(tier1): accept SkillSpector 2.13.4 complete_with_caveats reports for missing references SkillSpector 2.13.4 reports a scan whose only gaps are missing references as complete_with_caveats instead of partial. The security check rejected that status as not recognized, so a skill naming a file it does not bundle was INCOMPLETE with 2.13.4 or later on PATH. Recognize the status from 2.13.4 on. Accept its caveats only when every one is a reference_missing row and they pass the missing-reference rule already applied to partial reports, then show the same warning. Anything else keeps the scan INCOMPLETE with an error naming up to three caveats. The report stays complete, so a LOW report must still say SAFE and its findings are checked as usual. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): describe how complete_with_caveats reports are checked Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep the findings of a caveats report whose caveats are rejected A complete_with_caveats report whose missing-reference caveats fail the rule for a partial report's missing references, for example because the scan does not cover its whole target, now marks the scan INCOMPLETE and keeps checking the report, as the partial branch does. Its findings stay in the result. Before, the report was dropped, so a skill with High findings in a folder target showed none of them with SkillSpector 2.13.4 while 2.13.3 showed all of them. A caveats report with no caveat, or with a caveat that is not a reference_missing row in reference_resolution, contradicts SkillSpector's own rule for the status. It is still not trusted, and its error now names the rows of another kind. The LOW-to-CAUTION recommendation check reads whether the result was incomplete on entry, so a rejected LOW caveats report, which SkillSpector keeps SAFE, is not also rejected for its recommendation. The near-miss tests now assert the exact error of each case. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): add the caveat warning only after the rest of the report passes The warning for accepted complete_with_caveats caveats says they do not mark the scan incomplete. It was added before the recommendation, issue, exit-code and components checks, so a report that one of those rejected showed INCOMPLETE beside that warning. The warning is now added just before the report is accepted. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): make the caveat path near misses reach the bundled-file rules The absolute, escaping, backslash, control-character, unlisted and directory near misses changed only the ledger row's path. The `missing` entry in `references` stayed on SKILL.md, so the reference check rejected each row before the path rules ran, and disabling those rules left every case green. Each path case now moves the `missing` reference with its row and, where the case needs it, the `components` entry. Where the platform allows it, the file the path would name without the rules holds the reference's line, and the absolute case uses `/SKILL.md`, which names SKILL.md once split at "/". A spy asserts that `_skillspector_bundled_file_bytes` refuses the row's path in every path and file case. Disabling the backslash, safe-text, path-part or listed-once rule now fails the backslash, control-character, absolute or unlisted case. SecureRoot also refuses the escaping and directory paths. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that only complete keeps its status after transitive truncation A complete_with_caveats report with `is_complete: false` and a "Transitive traversal truncated: ..." limitation must fail the status marker check: SkillSpector rewrites a truncated caveats report to partial, so only `complete` may keep its status. No test held this; letting the exception also cover complete_with_caveats sent such a report to the partial branch, which kept its findings, and every test stayed green. The new near miss expects "has contradictory status markers" and fails under that change. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): name the phase of a trusted complete_with_caveats caveat The entry said a report is not trusted when it has a caveat that is not a nonfatal `reference_missing` row. A nonfatal `reference_missing` row in another phase is also not trusted: the code drops the report with "reports caveats other than missing references", and the docs require phase `reference_resolution`. The entry now says so. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): keep 2.13.4 caveats blocking for each skill of a validate catalog The stacked branch now judges each skill of a `validate <folder>` run against the folder. The caveat check reuses its missing-reference rule and reference root, so pin that a complete_with_caveats report for such a skill stays INCOMPLETE with the caveat error and no warning, with one and two workers, and that the same skill validated on its own passes. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier1): pin that a missing reference outside reference_resolution drops the caveats report A complete_with_caveats report whose reference_missing row is in another phase contradicts its status, so it must be untrusted and lose its findings, not only become INCOMPLETE. The only wrong-phase near miss used a report without findings, so checking the reason code alone kept those tests green. Parametrize the findings-dropped test with the instruction-override report's row moved to phase static. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(tests): keep the contradicting-caveats test within the line limit Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): set 2.13.4 caveats apart from the 2.13.3 reference caveat Main (7ae25d252) accepts a fully inspected SkillSpector 2.13.3 partial report whose only gaps are missing references as a reference caveat (reference_caveat_metadata): an INFO finding with skillspector_reference_caveats metadata, decided from the report alone when the scan has no known target. The paragraph and CHANGELOG entry before this branch's now describe that caveat, so "shows the same warning" no longer said which one a complete_with_caveats report gets. That rule reads only partial reports, so it never takes a complete_with_caveats report. Such a report is accepted only by _skillspector_reference_caveat_notes, which needs the scan's reference root to be its scanned root, and it carries the missing-reference warning. - docs/tier1-validation.mdx and the CHANGELOG entry say the caveats show the missing-reference warning, are never accepted from the report alone, so they leave a scan without a known target INCOMPLETE, and add no skillspector_reference_caveats entry. - New test_caveats_are_not_a_2_13_3_reference_caveat: in a direct scan without a reference root, the notes writer's 2.13.3 report passes as main's caveat and its 2.13.4 report stays INCOMPLETE; through validate_security_only the 2.13.4 report passes with the missing-reference warning and has neither the caveat finding nor its metadata. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say which warning 2.13.4 caveats get in the report docstring The _validate_skillspector_report docstring now lists main's 2.13.3 reference-caveat rule (reference_caveat_metadata) beside the missing-reference notes, so "the same warning" for complete_with_caveats reports no longer named one. Name the warning of _skillspector_missing_reference_notes, and say that reference_caveat_metadata reads only partial reports, so it never accepts these caveats, even without a reference root. No change in behavior.…
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
chunk_shellnow pairs every{with its closing}and records every newline in one pass over the script. Eachname() {header then looks up its end in that map, and its start and end lines come from a binary search over the newline positions.chunk_pythonsplits the source into lines once, instead of once per function or class.docs/tier2-deduplication.mdxsays which shell function headers are chunked, how a function's range is found, and that braces are indexed in one pass. CHANGELOG entry under Unreleased > Fixed.PR #28 (plugin evaluation, closed without merging) carried a version of this fix inside its larger change; this PR lands the generic part on its own.
Why
Tier 2 intra-skill deduplication chunks every collected
.shfile, up to the 1 MiB per-file limit. For each function header,chunk_shellwalked the rest of the script looking for the closing brace, and counted newlines from the start of the file to number the lines. A script ofname() {lines without closing braces, from a generated or broken file, therefore took time quadratic in its size. Onmain:mainAt that rate a 1 MiB script takes about two hours. No Tier 2 limit stops it: the chunk ceiling is checked after a file is chunked, and unclosed headers produce no chunks.
Closed functions shorter than the 80-character chunk minimum were quadratic too, through the per-function newline count. A script of
f(){ :; }lines yields no chunks, and 256 KiB of it took 3.8 s onmainand 34 ms with this PR.chunk_pythonalso split the whole file once per function, which is quadratic in the number of functions on a large module.Not fixed here: each function's text is still copied into its chunk, so nested shell functions still build chunk text that grows with the square of the script's size.
_bounded_piecesthen copies it again into 3,000-character pieces, and the chunk ceiling (CONTENT_DEDUP_MAX_CHUNKS) is checked only after the whole file is chunked. For a script of NfN() {headers followed by N closing braces:maincopies function text the same way, but there each copy follows a per-character walk over the same span, so the memory builds up more slowly. The 64 KiB script takes 13 s on this branch and 36 s onmain, and both peak at about 450 MB. A follow-up should stop chunking a file once its chunk count passes the ceiling, or skip function text over a size cap.Kept from public
_bounded_pieces,_pack_paragraphs, the fenced-heading handling,line_offsetand the SPDX preamble filter.}before a header is ignored, nested braces (including${VAR}and braces in strings) are counted as before, and an unclosed header still produces nothing. A differential check over 23,000 random shell and Python inputs (86,000 comparisons acrossmin_charsvalues) gave identical chunks onmainand on this branch.chunk_shell, addsfrom itertools import chainandimport pytest, and adds tests at the start ofTestChunkShell. This PR keeps its hunks disjoint: it addsimport bisectafterimport ast, changes only the function loop, adds a test helper after_cf, and adds its shell tests aftertest_function_bodyand at the end of the class. A three-way merge of fix(tier2): retain trailing shell comments in deduplication #357'schunker.pyandtest_chunker.pyat its head8121e2a3onto this branch is clean. The mergedtest_chunker.pypasses (45 tests: this branch's 34 plus fix(tier2): retain trailing shell comments in deduplication #357's 11 parametrized cases), andruff checkandruff format --checkare clean on the merged files.CHANGELOG.md: it adds one entry under Unreleased > Fixed and touches no other line.Tests
tests/deduplication/utils/test_chunker.pygains 5 tests and a_ReadCountingTexthelper, astrthat adds up the characters read through indexing, slicing, iteration,find,index,countandsplitlines. Reads throughre, through otherstrmethods or of a plainstrcopy are not counted, so the read-count tests pin the old walks, not every possible quadratic scan:test_source_lines_are_split_once_for_many_functions: 100 documented functions, and the source is split into lines exactly once.test_many_unclosed_function_headers_have_linear_character_scanning: 1,000 unclosed headers yield no chunks, with at most 3 indexed character reads per character of the script. It pins only the old per-character walk.test_function_ranges_follow_matching_braces: a stray}, an unclosed header, a function with nested braces and${HOME}, and a one-line function give exactly the expected headings, line ranges and text.test_many_closed_functions_get_line_ranges_without_rereading_the_script: 1,000 closed one-line functions each get their own one-line range, and the script is read at most 10 times over.mainreads it about 997 times over.test_many_unclosed_function_headers_read_the_script_a_bounded_number_of_times: 1,000 unclosed headers yield no chunks, and the script is read at most 10 times over.mainreads it about 976 times over.src/frommainand this PR's tests,test_chunker.pyhas 4 failed and 30 passed. The 4 failures are the four single-pass tests.test_function_ranges_follow_matching_bracespasses onmainand pins behavior this PR keeps.src/: putting backmain's per-function newline count failstest_many_closed_functions_get_line_ranges_without_rereading_the_script(1 failed, 33 passed). Replacing the brace map with a per-headerstr.findrescan failstest_many_unclosed_function_headers_read_the_script_a_bounded_number_of_times(1 failed, 33 passed). Two rewrites that stay quadratic are not caught, and the helper's docstring says so: a per-header rescan built onrepasses all 34 tests, andmain's per-character walk run onstr(content)passes every shell test.tests/deduplication/utils/test_chunker.py: 34 passed.tests/deduplicationandtests/inference/test_llm_client.py: 511 passed, 1 skipped.tests/test_oss_packaging.py,tests/test_ci_workflows.py,tests/test_benchmark_rollout_docs.py,tests/test_ci_change_classifier.py,tests/validators/test_similarity.pyandtests/deduplication/utils: 301 passed, 1 skipped.ruff checkandruff format --checkare clean on the changed Python files, andscripts/check_oss_boundary.pypassed.mainat86f1a1f0(git merge-tree).mainhas not changedchunker.pyortest_chunker.pysince this branch started, and the fail-before run above usedsrc/from35ef01e6. feat(ci): add three-tier onboarding and private report feedback #349, merged since, added a section near the top ofdocs/tier2-deduplication.mdx, away from this PR's paragraph in "What gets chunked".test_many_closed_functions_get_line_ranges_without_rereading_the_script). A squash merge keepsmain's history accurate.🤖 Generated with Claude Code