Skip to content

Fix requireLinkedIssue docs and generated contributor docs that overclaim enforcement #5287

Description

@JSONbored

Context

requireLinkedIssue (plain boolean, no doc comment, dashboard-writable) sounds like a real requirement toggle. The sole blocking authority is actually linkedIssueGateMode === "block" (src/rules/advisory.ts:918), whose real, applied default is "advisory" (src/db/schema.ts:70, live via src/db/repositories.ts:531) — not "off". The one promotion path that turns requireLinkedIssue into a real block (src/signals/focus-manifest.ts:626-627) only fires when linkedIssueGateMode is explicitly "off", so it never fires at the actual default.

Worse: the generated contributor-facing docs assert the opposite of reality. repo-skill-render.ts:121 prints "Required: yes/no" and repo-doc-render.ts:106 prints "Requires a linked issue: yes/no", both derived solely from requireLinkedIssue with zero visibility into gate mode. The common case — a maintainer flips "Require linked issue" on and never separately touches the linkedIssueGateMode dropdown — silently does NOT block: PRs without a linked issue still merge cleanly, while generated docs tell contributors it's "Required: yes." src/db/schema.ts:62's own comment overstates what the toggle does, reinforcing the same misunderstanding in-repo.

Requirements

  • Do NOT widen the focus-manifest.ts:626 promotion condition to fire on any non-"block" mode — that would be a real behavior change (repos currently relying on the advisory default would start hard-blocking) and needs its own separate product decision, not bundled into this doc fix.

Deliverables

  • Add a doc comment to requireLinkedIssue (src/types.ts:949) clarifying it only surfaces the missing_linked_issue advisory finding and does not block on its own.
  • Add linkedIssueGateMode to RepoProfileContributionWorkflow (repo-profile.ts:57-67), populated in extractRepoProfile (:270-276).
  • Fix repo-skill-render.ts:121 and repo-doc-render.ts:106 to report "Required: yes" only when linkedIssueGateMode === "block" — the actual blocking condition — not from requireLinkedIssue alone.
  • Correct the misleading db/schema.ts:62 comment.
  • Add a regression test: requireLinkedIssue=true + default linkedIssueGateMode="advisory" → generated docs must NOT claim a linked issue is required.

Expected Outcome

Generated contributor-facing docs (repo skill / CLAUDE.md) accurately reflect whether a linked issue is actually enforced, and a maintainer reading requireLinkedIssue's own doc comment understands it alone does not block.

Links & Resources

  • Evidence: src/types.ts:949; src/rules/advisory.ts:918; src/signals/engine.ts:4305; src/review/repo-skill-render.ts:27,121; src/review/repo-doc-render.ts:106; src/signals/focus-manifest.ts:626-627

Part of #5270 (roadmap epic).

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions