Skip to content

fix(review): parse a scalar source field written as a YAML sequence (#8016) - #8031

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
real-venus:fix/source-evidence-parse-sequence-8016
Jul 22, 2026
Merged

fix(review): parse a scalar source field written as a YAML sequence (#8016)#8031
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
real-venus:fix/source-evidence-parse-sequence-8016

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

source-evidence.ts and duplicates.ts each hand-roll a parseSimpleFrontmatter (a known parity-gap class between these two files — see #7250 / content-repo-spec.ts:132). duplicates.ts's parser has three branches — block-scalar, block/flow-sequence (inline === "", collects - item lines), and plain-scalar — but source-evidence.ts's had only two: the sequence branch was never ported.

Concretely: a scalar-only source field authored as a YAML sequence

documentationUrl:
  - https://docs.acme.example/guide

was captured by duplicates.ts (duplicate detection) but invisible to extractSubmittedSourceUrls/checkSubmittedSourceEvidence (the fetch-reachability hard-close gate) — the URL never got fetch-verified. documentationUrl is a scalar field, not one of the list fields (sourceUrls/retrievalSources) that listSourceUrlValues rescues, so nothing else caught it.

Fix

Port the missing block/flow-sequence branch verbatim from duplicates.ts (including its v8 ignore fallbacks for the ?? "" noUncheckedIndexedAccess guards). The existing block-scalar and plain-scalar cases are unchanged (the final else if (inline !== "") becomes a plain else, reached only for non-empty non-block inline values exactly as before).

Scope

  • Narrow, single coherent change (one parser branch + its regression tests)
  • In wantedPaths (src/review/content-lane/**, test/unit/**); no blockedPaths
  • No secrets/private-scoring terms anywhere
  • No generated-artifact changes required (internal parser; no API/schema/binding/migration change)

Validation

  • npx vitest run test/unit/content-lane-source-evidence.test.ts — 86/86 pass (incl. 2 new #8016 tests: capture + fetch-verification)
  • content-lane-duplicates suite still green (the source-of-truth parser is untouched)
  • Honesty-checked: with the fix reverted, both new tests fail (documentationUrl sequence dropped) — they are genuine regressions, not tautologies
  • typecheck clean on changed files (only the 2 pre-existing local semver TS7016s remain)
  • git diff --check clean

Safety

  • Behavior-preserving for block-scalar and plain-scalar inputs; the change only adds capture for a previously-dropped YAML shape
  • Closes a gap that weakened the source-reachability gate — the fix strengthens it (more submitted URLs are fetch-verified, none newly bypass it)
  • No auth/CORS surface touched; no secrets introduced

Closes #8016

…SONbored#8016)

source-evidence.ts's parseSimpleFrontmatter had only block-scalar and
plain-scalar branches; its sibling duplicates.ts also handles the
block/flow-sequence case (inline === ""). A scalar-only source field
authored as a YAML sequence (e.g. documentationUrl:\n  - https://...) was
therefore captured by the duplicate-detection parser but invisible to
extractSubmittedSourceUrls/checkSubmittedSourceEvidence, silently skipping
the fetch-reachability gate for that URL. Port the missing sequence branch
verbatim from duplicates.ts so both parsers accept the same YAML shapes.
Regression tests cover capture + fetch-verification of the sequence form.
@real-venus
real-venus requested a review from JSONbored as a code owner July 22, 2026 13:58
@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 22, 2026
@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-22 14:06:56 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This ports the missing block/flow-sequence frontmatter branch from duplicates.ts into source-evidence.ts's parseSimpleFrontmatter, so a scalar-only field (e.g. documentationUrl) authored as a YAML sequence is now captured and fetch-verified by the source-evidence gate, closing the parity gap described in #8016. The branch reorder (block-scalar → now empty-inline sequence → plain scalar else) is safe since isBlockScalarHeader("") is false, so the existing block-scalar path is unaffected, and list fields (retrievalSources etc.) are still handled separately by listSourceUrlValues so there's no double-parsing conflict. Two new regression tests (capture-level and full fetch-verification) exercise the real path and would fail without the fix per the PR's stated revert-check.

Nits — 2 non-blocking
  • source-evidence.ts:165-179 duplicates three near-identical `/* v8 ignore next */` comments justifying unreachable `?? ""` fallbacks — consider factoring the bounded-index access into a small helper shared with the block-scalar loop to cut the repetition, though this mirrors duplicates.ts's existing style so it's a minor stylistic call.
  • Nothing structurally to change; the port is verbatim per the PR description and the new tests target the exact previously-invisible path (documentationUrl as a sequence) rather than a fabricated scenario.

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 #8016
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: 106 registered-repo PR(s), 43 merged, 17 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 106 PR(s), 17 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff ports the missing block/flow-sequence branch into source-evidence.ts's parseSimpleFrontmatter, mirroring duplicates.ts's logic, and keeps the plain-scalar/block-scalar branches intact by converting the trailing else-if into a plain else.

Review context
  • Author: real-venus
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Python, Rust, CSS, MDX, Svelte, Swift
  • Official Gittensor activity: 106 PR(s), 17 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

@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 53ad637 into JSONbored:main Jul 22, 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.

source-evidence.ts's parseSimpleFrontmatter silently drops a scalar source field written as a YAML block/flow sequence, unlike duplicates.ts's parser

1 participant