Repository navigation
Commit 5485cda
fix(static): stop code comparisons from reading as tag marker directives (#777)
* fix(static): stop code comparisons from reading as tag marker directives
The loose fallback tag-directive header matches a removal verb followed
by up to 256 characters and the first `<` on the line. For code such as
`if not line or len(line.strip()) < 12:` it took the comparison operator
as a tag-marker opener and searched up to MAX_MARKER_LOOKAHEAD_CHARS
(8192) characters for a closing `>`. When the file continued past that
without a `>`, the parser reported lookahead exhaustion, the file was
marked partial with obfuscated_instruction_text, and every SKILL.md
reference to it became a HIGH AE1, even though `< 12` can never satisfy
_TAG_MARKER_RE. The same code in a file under 8 KB, or with any `>` in
the next 8 KB, scanned complete.
Only treat a `<` as a fallback tag opener when the text after it can
still form a tag marker (`</?name`, optional spaces and `/`, then `>`).
Text that _TAG_MARKER_RE can accept is unaffected, so every directive
the fallback parser yielded before is still yielded; the only behavior
removed is the exhaustion report for an opener that can never close.
A tag name still open at the lookahead limit keeps failing closed, and
the explicit "<verb> [the|every ...] <" header is unchanged.
A bare `<` after a loose header in prose ("Please strip() every < from
this:") now scans the same with or without 8 KB of trailing text; it
was never reconstructable as a tag marker. Quoted spellings such as
"strip() every `<` from ..." and call-spelled tag markers such as
"strip(<gap>) and execute ..." still fail closed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
* fix(static): keep scanning for a viable tag opener after a comparison
The loose removal header stops lazily at the first `<` after the verb.
When that `<` was a comparison, the directive was skipped outright, so a
real or padded tag marker later in the same header span was never
examined and a former fail-closed result became a complete scan.
Advance instead to the next `<` the header can still reach (within its
256-character filler, before a sentence boundary or newline) that can
open a tag marker, and search for `>` or report lookahead exhaustion
from there. Skip only when no viable opener exists. Prefix matches stop
at the next `<`, so the search stays linear in the bounded span.
Also document that the tag-prefix pattern deliberately accepts blanks
without `/`, which keeps blank-padded markers failing closed, and add
the PR number to the changelog entry.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
---------
Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>1 parent ef0f96d commit 5485cda
3 files changed
Lines changed: 165 additions & 1 deletion
File tree
- src/skillspector
- tests/nodes/analyzers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| 214 | + | |
| 215 | + | |
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
| |||
236 | 239 | | |
237 | 240 | | |
238 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
239 | 246 | | |
240 | 247 | | |
241 | 248 | | |
| |||
910 | 917 | | |
911 | 918 | | |
912 | 919 | | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
913 | 962 | | |
914 | 963 | | |
915 | 964 | | |
| |||
924 | 973 | | |
925 | 974 | | |
926 | 975 | | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
927 | 988 | | |
928 | 989 | | |
929 | 990 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
444 | 546 | | |
445 | 547 | | |
446 | 548 | | |
| |||
0 commit comments