fix(signals): carry labelPolicy.note through focusManifestPolicyToCompilerOutput - #6020
Conversation
…pilerOutput
Two adapters compile the same FocusManifest into the same
RepoPolicyCompilerOutput.labelPolicy shape and disagreed on one field:
compileRepoPolicyCompilerOutput (repo-policy-compiler.ts) sets
note: labelPolicyNote(linkedIssuePolicy), while
focusManifestPolicyToCompilerOutput (onboarding-pack.ts) omitted note
entirely.
The adapter's own doc comment says it produces the shape expected by
buildRepoOnboardingPackPreview, so the two should agree for the same
manifest. Because it didn't, buildRegistrationReadiness's
onboardingPackPreview.labelPolicy always rendered note: null -- silently
dropping the linked-issue guidance ("Link a tracked issue before opening
a pull request.") that the same manifest produces via the direct
onboarding-pack API/MCP path.
Export the existing labelPolicyNote helper and reuse it as-is rather than
duplicating its strings; the reverse import in repo-policy-compiler.ts is
type-only and erased, so no runtime cycle is introduced. No other field
mapping is touched.
Closes JSONbored#5943
|
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 #6020 +/- ##
=======================================
Coverage 95.16% 95.16%
=======================================
Files 591 591
Lines 46934 46934
Branches 15000 15000
=======================================
Hits 44664 44664
Misses 1512 1512
Partials 758 758
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-15 07:19:07 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
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://gittensory.aethereal.dev/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.
|
Summary
Closes #5943
Two adapters compile the same
FocusManifestPolicyinto the sameRepoPolicyCompilerOutput.labelPolicyshape, and disagreed on one field:compileRepoPolicyCompilerOutput(src/signals/repo-policy-compiler.ts) — the direct onboarding-pack API route + MCP tool path — setsnote: labelPolicyNote(policy.publicSafe.validation.linkedIssuePolicy).focusManifestPolicyToCompilerOutput(src/signals/onboarding-pack.ts) — used bybuildRegistrationReadiness'sonboardingPackPreview— omittednoteentirely.The adapter's own doc comment says it adapts a compiled policy "into the
RepoPolicyCompilerOutputshape expected bybuildRepoOnboardingPackPreview", so the two should agree for the same manifest. Because it didn't,sanitizeLabelPolicyreceivednote: undefinedand emittednull— so the registration-readiness report (surfaced to repo owners evaluating whether to register) always showedlabelPolicy.note: null, silently losing the linked-issue guidance (e.g. "Link a tracked issue before opening a pull request.") that the very same manifest produces via the direct API/MCP path.Fix:
exportthe existinglabelPolicyNotehelper and reuse it as-is from the adapter. Per the issue's first suggested approach (the more minimal diff): the reverse import inrepo-policy-compiler.tsis type-only and erased at compile time, so this introduces no runtime cycle. The helper's threelinkedIssuePolicybranches are unchanged and not duplicated, and no other field mapping infocusManifestPolicyToCompilerOutputis touched.Scope
fix(signals): …).labelPolicyNote.CONTRIBUTING.md; nosite//CNAME/lovablechanges; no changelog edit.Validation
git diff --checkclean.npm run typecheck— exit 0.onboarding-pack,registration-readiness,repo-policy-compiler,policy-sanitizer,self-dogfood-registration-pack,focus-manifest— 763 tests passed. These are the complete blast radius:focusManifestPolicyToCompilerOutputhas exactly one caller (registration-readiness.ts:174), and every test file importingbuildRegistrationReadinessis included.coverage/lcov.infofor the exact changed lines:labelPolicyNote's body is covered (hits 30/23/18) andfocusManifestPolicyToCompilerOutputis covered (hits 10). No uncovered changed lines.main.New tests:
labelPolicy.noteparity across both adapters for all threelinkedIssuePolicyvalues (required/preferred/optional) — asserts a non-null note that is byte-identical tocompileRepoPolicyCompilerOutput's, covering everylabelPolicyNotebranch.labelPolicyfield is untouched (the fix is scoped tonote).buildRegistrationReadiness:onboardingPackPreview.labelPolicy.noteis no longer alwaysnull.If any required check was skipped, explain why:
test:cinot run end-to-end locally (Linux-only steps on Windows; the repo's full suite is not reliable under this environment). The change-relevant gates — typecheck, the complete affected-suite set, and per-line patch coverage — were validated directly and are green.ui:openapi:checkreports stale on a clean checkout ofmainin this environment (pre-existing, unrelated to this diff, which changes a runtime value and no schema), so no regenerated artifact is included — deliberately avoiding unrelated churn.Safety
sanitizeLabelPolicy→safeOptionalPublicText, and the text is the identical string the direct onboarding-pack path already publishes.registration-readiness's forbidden-public-language assertions remain green.labelPolicy.notealready exists in the type and schema; only its runtime value is corrected).