fix(content-lane): split a scalar source field's multi-item block sequence per URL - #9900
Conversation
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-29 20:15:46 UTC
Review summary Nits — 2 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9900 +/- ##
===========================================
- Coverage 91.76% 79.37% -12.40%
===========================================
Files 921 282 -639
Lines 113173 58785 -54388
Branches 27244 8686 -18558
===========================================
- Hits 103854 46659 -57195
- Misses 8034 11843 +3809
+ Partials 1285 283 -1002
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…uence per URL parseSimpleFrontmatter collapses a block sequence to a comma-joined string, and for a scalar source field that value goes to scalarSourceUrlValues, which only splits the flow (`[a, b]`) form. So a documentationUrl authored as a two-item block sequence yielded the single string "https://a.example/1, https://b.example/2"; new URL() throws on it, producing outcome invalid_url / hard_failure and failing the whole source-evidence report on a submission whose sources are both live. JSONbored#8016's tests covered only the single-item case (a one-item join is a valid URL), so it went undetected. Add scalarSequenceItems, which reads the raw frontmatter block and returns one value per `- item` for a bare block sequence (mirroring listSourceUrlValues' for..of + `as string` style), used by the scalar-field loop; a non-sequence form (inline, flow, or block scalar) returns null and keeps the existing scalar reader. A single-item sequence still yields exactly one URL, and a genuinely malformed value still hard-fails. Closes JSONbored#9668
Summary
parseSimpleFrontmatter(src/review/content-lane/source-evidence.ts) collapses a block sequence to a comma-joined string, and for a scalar source field that value flows toscalarSourceUrlValues, which only knows how to split the flow ([a, b]) form. So adocumentationUrlauthored as a two-item block sequence yielded the single string"https://a.example/1, https://b.example/2".new URL()throws on that, sovalidateFetchableSourceUrlreturnsoutcome: "invalid_url"→status: "hard_failure",blocking: true, the whole report"failed", andsourceEvidenceCloseDecisionemits a "dead or invalid source URL" close/manual on a submission whose sources are both live.The sibling list path (
listSourceUrlValues) already splits each- iteminto its ownSubmittedSourceUrl; only the scalar path collapsed.#8016's tests covered only the single-item sequence (a one-item join produces a valid URL), which is why this went undetected.Fix
Add
scalarSequenceItems(source, field), a small state machine over the raw frontmatter block (mirroringlistSourceUrlValues'for..of+as stringstyle) that returns one raw value per- itemwhen the field is authored as a bare block sequence (field:with an empty inline value). The scalar-field loop uses it to emit oneSubmittedSourceUrlper item. For every non-sequence form (an inline scalar, a flow[a, b]list, or a block scalar|/>) it returnsnull, so the existingparseSimpleFrontmatter+scalarSourceUrlValuesreader is unchanged. A single-item sequence still yields exactly one URL with today's value, and a genuinely malformed value still hard-fails — the change removes a false positive without weakening the real check.Tests
Added to
test/unit/content-lane-source-evidence.test.ts:SubmittedSourceUrlentries with the two distinct URLs.checkSubmittedSourceEvidenceover that two-item field with a stubfetchImplreturning 200 for both reportsstatus: "passed"(today:"failed"/invalid_url).notaurl) still yieldsoutcome: "invalid_url"/status: "hard_failure".The two multi-item cases fail against the current joined-string behaviour. Full file passes (94/94); local coverage of
source-evidence.tsis 100% statements/branches/lines.Closes #9668