Skip to content

fix(content-lane): split a scalar source field's multi-item block sequence per URL - #9900

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-content-lane-source-url-seq-9668-v2
Jul 29, 2026
Merged

fix(content-lane): split a scalar source field's multi-item block sequence per URL#9900
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-content-lane-source-url-seq-9668-v2

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

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 to scalarSourceUrlValues, which only knows how to split 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 that, so validateFetchableSourceUrl returns outcome: "invalid_url"status: "hard_failure", blocking: true, the whole report "failed", and sourceEvidenceCloseDecision emits a "dead or invalid source URL" close/manual on a submission whose sources are both live.

The sibling list path (listSourceUrlValues) already splits each - item into its own SubmittedSourceUrl; 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 (mirroring listSourceUrlValues' for..of + as string style) that returns one raw value per - item when the field is authored as a bare block sequence (field: with an empty inline value). The scalar-field loop uses it to emit one SubmittedSourceUrl per item. For every non-sequence form (an inline scalar, a flow [a, b] list, or a block scalar |/>) it returns null, so the existing parseSimpleFrontmatter + scalarSourceUrlValues reader 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:

  • A scalar field carrying a two-item block sequence produces two SubmittedSourceUrl entries with the two distinct URLs.
  • checkSubmittedSourceEvidence over that two-item field with a stub fetchImpl returning 200 for both reports status: "passed" (today: "failed" / invalid_url).
  • The single-item sequence case is byte-identical to today.
  • A genuinely malformed value (notaurl) still yields outcome: "invalid_url" / status: "hard_failure".
  • Terminator coverage: a sequence ends at the next top-level key and at a blank line, an empty item is skipped, and an empty-valued field yields no URL.

The two multi-item cases fail against the current joined-string behaviour. Full file passes (94/94); local coverage of source-evidence.ts is 100% statements/branches/lines.

Closes #9668

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 29, 2026 20:07
@loopover-orb

loopover-orb Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-29 20:15:46 UTC

2 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The change correctly addresses the issue where scalar source fields authored as YAML block sequences were being collapsed into a single string, causing validation failures. The new `scalarSequenceItems` function properly splits block sequences into individual URLs, and the tests verify this behavior. The fix maintains existing validation logic while resolving the false positive for multi-item sequences.

Nits — 2 non-blocking
  • The `scalarSequenceItems` function could benefit from more detailed comments explaining the regex patterns used for parsing block sequences.
  • Consider adding a constant for the `9_` magic number used in the test cases to improve readability.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9668
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 251 registered-repo PR(s), 99 merged, 38 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 251 PR(s), 38 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR implements scalarSequenceItems to split multi-item block sequences into individual URLs, mirrors listSourceUrlValues' logic, and adds all required tests including regression cases for two-item sequences, single-item preservation, and invalid URL checks. The diff directly addresses the issue's core defect and all deliverables.

Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Ruby, TypeScript, Svelte, Cuda, JavaScript, Markdown, MDX
  • Official Gittensor activity: 251 PR(s), 38 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.37%. Comparing base (af98111) to head (0d1aa6b).
⚠️ Report is 4 commits behind head on main.

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     
Flag Coverage Δ
backend 100.00% <100.00%> (+4.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/content-lane/source-evidence.ts 100.00% <100.00%> (ø)

... and 772 files with indirect coverage changes

…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

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit b5385ca into JSONbored:main Jul 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

orb(content-lane): a multi-item source-URL sequence is joined into one unparseable URL and

1 participant