fix(selfhost): ignore YAML inline comments on review-skill name and when - #2724
Conversation
parseReviewSkill captured the whole value tail for name and when, so an inline comment leaked in: `name: SQL Rubric # note` became the literal label, and `when: "**/*.sql" # note` became a glob that never matches — silently disabling the rubric with no error. Strip a trailing ` # …` comment before the quote-strip, byte-identical to isReviewSkillEnabled; a `#` with no preceding whitespace (C# Rubric, a#b) stays part of the value.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-03 08:47:54 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2724 +/- ##
==========================================
- Coverage 96.09% 96.00% -0.09%
==========================================
Files 243 244 +1
Lines 27236 27284 +48
Branches 9897 9913 +16
==========================================
+ Hits 26173 26195 +22
- Misses 438 462 +24
- Partials 625 627 +2
🚀 New features to boost your workflow:
|
Address review: the inline-comment strip must not fire inside a quoted scalar. Read name/when via a quote-aware extractor — a quoted value keeps its body verbatim (so name: "SQL JSONbored#1 Rubric" stays "SQL JSONbored#1 Rubric"), while a trailing inline comment after the value is still dropped and an unquoted a#b keeps its #.
…canner
Address review: the hand-rolled quoted-scalar scanner mishandled
YAML-escaped double quotes ("SQL \"Index\" Rubric") and doubled single
quotes ('Owner''s Rubric'). Decode each value with the yaml parser
(already imported) so quoting, escapes, and trailing inline comments are
handled correctly; a value the parser rejects standalone (an unquoted
*-leading glob) falls back to a lenient comment/quote strip so it still
works.
A self-host operator annotating their private review rubrics inline — the most common way to document YAML — silently breaks them today:
parseReviewSkillcaptured the whole value tail and stripped only surrounding quotes, not a trailing comment:namebecame"SQL Rubric # our sql-index rubric"— the comment leaked into the label rendered in the reviewer prompt (## skill: …).whenbecame'**/*.sql" # only sql files'— a stray quote + comment.reviewSkillAppliesglob-matches that against changed paths, so it never matches and the rubric silently never fires, with no error (a container-private file with no CI lint over it).Fix
Decode
name/whenthrough the YAML parser (yaml, already imported in this module) instead of hand-rolling scalar parsing. Each value is parsed as a standalone YAML scalar, so quoting, escaped\"/ doubled''quotes, and trailing inline comments are all handled correctly:name: "SQL #1 Rubric"→SQL #1 Rubric(internal#preserved)name: "SQL \"Index\" Rubric"→SQL "Index" Rubric;name: 'Owner''s Rubric'→Owner's Rubricname: SQL Rubric # note→SQL Rubric(comment dropped);name: a#b→a#bA value the parser rejects standalone — notably an unquoted
*-leading glob (when: **/…, which is invalid standalone YAML) — falls back to a lenient inline-comment/quote strip so those globs keep working exactly as before. Each field is parsed independently, so a malformed value in one never affects the other.Tests
Adds regression cases for inline comments, internal
#, escaped/doubled quotes, an unquoted glob (no regression), a non-string scalar, and a malformed unterminated quote. Verified the pre-fix behavior FAILS these and the fix PASSES; the fullprivate-config+focus-manifestsuites stay green.No linked issue: issue creation is unavailable for this account.