Skip to content

signals: onboarding-pack buildPreviewMarkdown silently drops populated discouragedPaths field #9286

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

Context

src/signals/onboarding-pack.ts's RepoOnboardingContributionLane type carries a sanitized
discouragedPaths field, populated end-to-end from the focus manifest through
repo-policy-compiler.ts's buildDirectPrLane/buildIssueDiscoveryLane (both explicitly set
discouragedPaths: lane.discouragedPaths, see src/signals/repo-policy-compiler.ts:75 and :91).

But buildPreviewMarkdown in src/signals/onboarding-pack.ts (the function that renders the
onboarding-pack preview markdown) only renders three of the lane's list fields via
appendNestedListpreferredPaths, validationExpectations, and publicNotes — at
approximately lines 410-415. discouragedPaths is silently dropped and never appears in the
rendered onboarding-pack markdown, even though it's a real, populated, sanitized field a
contributor reading the onboarding pack should see.

test/unit/onboarding-pack.test.ts seeds discouragedPaths: ["scripts/release/"] (line 29) as
part of its fixture but never asserts the string appears anywhere in preview.previewMarkdown
confirming this is an untested gap, not an intentional omission.

The identical class of bug (a populated field silently dropped by a sibling markdown-rendering
adapter) was previously fixed in this repo as #5943 for labelPolicy.note.

Requirements

  • buildPreviewMarkdown in src/signals/onboarding-pack.ts must render each contribution lane's
    discouragedPaths in the "Contribution lanes" section of the output markdown, using the same
    appendNestedList(lines, "Discouraged paths", lane.discouragedPaths) pattern already used for
    preferredPaths, validationExpectations, and publicNotes in the same loop.
  • Do not change the rendering shape of the other three existing nested lists.
  • Do not rename or restructure RepoOnboardingContributionLane — only fix the renderer.

Deliverables

  • buildPreviewMarkdown in src/signals/onboarding-pack.ts calls appendNestedList for
    lane.discouragedPaths under a "Discouraged paths" label, alongside the existing three
    appendNestedList calls in the same lane-rendering loop.
  • test/unit/onboarding-pack.test.ts's existing fixture (which already seeds
    discouragedPaths: ["scripts/release/"]) gains an assertion that
    preview.previewMarkdown contains "scripts/release/" under a "Discouraged paths" heading.
  • A new or extended test case covers the empty-array case (discouragedPaths: []) producing
    no "Discouraged paths" section, matching appendNestedList's existing no-op-on-empty
    behavior for the other three fields.

All three deliverables are required in this single PR — this is not intentionally narrow.

Test Coverage Requirements

This repo enforces 99%+ Codecov patch coverage, branch-counted, on every changed line/branch in
src/**. The new appendNestedList call and its two test cases above must be covered.

Expected Outcome

A repo's onboarding-pack preview markdown, when a contribution lane has discouraged paths
configured, now actually lists them — matching what the underlying data already carries and what
a contributor reading the pack needs to know.

Links & Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions