Skip to content

fix(review): fold linkedIssuePolicy into linkedIssueGateMode's promotion (#4618) - #4755

Merged
JSONbored merged 1 commit into
mainfrom
chore/4618-fold-linked-issue-policy
Jul 10, 2026
Merged

fix(review): fold linkedIssuePolicy into linkedIssueGateMode's promotion (#4618)#4755
JSONbored merged 1 commit into
mainfrom
chore/4618-fold-linked-issue-policy

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Part of #4618's item 1 (config-surface-reduction epic). Three independent knobs claimed to express "require a linked issue": settings.requireLinkedIssue, gate.linkedIssue (linkedIssueGateMode), and the yml-only top-level linkedIssuePolicy. requireLinkedIssue already auto-promoted linkedIssueGateMode to "block" when it was off (#797), but linkedIssuePolicy: required had no such promotion — a self-hoster who set only linkedIssuePolicy: required got an advisory manifest_linked_issue_required nudge, never a real gate blocker, because that finding's own escalation was keyed to manifestPolicyGateMode (an unrelated gate that also governs missing-tests policy), not linkedIssueGateMode.

Fixes both halves of the gap:

  • resolveEffectiveSettings now promotes linkedIssueGateMode to "block" for linkedIssuePolicy: required too, mirroring the requireLinkedIssue promotion (an explicit gate.linkedIssue override still wins, since the promotion only fires when the gate is still "off").
  • manifest_linked_issue_required now escalates to a hard blocker via EITHER manifestPolicyGateMode: block (back-compat) OR linkedIssueGateMode: block (the new promoted path) — without this, the promotion above would be a no-op. manifest_missing_tests is unaffected; it stays keyed to manifestPolicyGateMode alone.

Mirrored in the gate-decision engine twin (gate-advisory.ts) and documented in both .gittensory.yml.example and its canonical copy (config/examples/gittensory.full.yml).

Test plan

  • npx tsc --noEmit — clean
  • Full unit + integration suite: 686 files / 13,652 tests passing
  • npm run test:coverage (unsharded) — zero uncovered statements/branches on every changed line, including the new dual-??-fallback branches introduced by the OR'd escalation check
  • npm run engine-parity:drift-check, npm run docs:drift-check, npm run manifest:drift-check — all pass
  • npm audit --audit-level=moderate — 0 vulnerabilities

…ion (#4618)

Three independent knobs claimed to express "require a linked issue":
settings.requireLinkedIssue, gate.linkedIssue (linkedIssueGateMode), and
the yml-only top-level linkedIssuePolicy. requireLinkedIssue already
auto-promoted linkedIssueGateMode to "block" when it was off (#797), but
linkedIssuePolicy: required had no such promotion -- a self-hoster who
set only linkedIssuePolicy: required got an advisory manifest_linked_issue_required
nudge, never a real gate blocker, because that finding's own escalation
was keyed to manifestPolicyGateMode (an unrelated gate that also governs
missing-tests policy), not linkedIssueGateMode.

Fixes both halves of the gap:
- resolveEffectiveSettings now promotes linkedIssueGateMode to "block"
  for linkedIssuePolicy: required too, mirroring the requireLinkedIssue
  promotion (an explicit gate.linkedIssue override still wins, since the
  promotion only fires when the gate is still "off").
- manifest_linked_issue_required now escalates to a hard blocker via
  EITHER manifestPolicyGateMode: block (back-compat) OR
  linkedIssueGateMode: block (the new promoted path) -- without this,
  the promotion above would be a no-op. manifest_missing_tests is
  unaffected; it stays keyed to manifestPolicyGateMode alone.

Mirrored in the gate-decision engine twin (gate-advisory.ts) and
documented in both .gittensory.yml.example and its canonical copy.
@JSONbored JSONbored linked an issue Jul 10, 2026 that may be closed by this pull request
4 tasks
@JSONbored JSONbored self-assigned this Jul 10, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 5ff3d71 Commit Preview URL

Branch Preview URL
Jul 10 2026, 11:10 PM

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.22%. Comparing base (82ccb70) to head (5ff3d71).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4755   +/-   ##
=======================================
  Coverage   94.21%   94.22%           
=======================================
  Files         440      440           
  Lines       38712    38716    +4     
  Branches    14101    14105    +4     
=======================================
+ Hits        36474    36479    +5     
  Misses       1577     1577           
+ Partials      661      660    -1     
Files with missing lines Coverage Δ
...es/gittensory-engine/src/advisory/gate-advisory.ts 100.00% <100.00%> (ø)
src/rules/advisory.ts 97.77% <100.00%> (+0.38%) ⬆️
src/signals/focus-manifest.ts 99.64% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

loopover-orb Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-10 23:21:46 UTC

7 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI green · unstable

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This closes a real gap in #4618/#797's linked-issue promotion logic: linkedIssuePolicy: required previously promoted linkedIssueGateMode to block in resolveEffectiveSettings, but manifest_linked_issue_required's own escalation check in isConfiguredGateBlocker never looked at linkedIssueGateMode — only manifestPolicyGateMode — so the promotion was a silent no-op. The fix correctly splits the combined branch so manifest_missing_tests still keys off manifestPolicyGateMode alone, while manifest_linked_issue_required now blocks via either gate (OR), preserving back-compat and honoring an explicit gate.linkedIssue override (checked before the promotion line since applyGateConfigOverrides runs first). Both mirrored files (engine package and src/rules/advisory.ts) were updated in lockstep and engine-parity:drift-check passed, and the test suite exercises both branches of each ?? fallback plus the end-to-end promotion path.

Nits — 3 non-blocking
  • The manifest_linked_issue_required escalation logic is duplicated verbatim across packages/gittensory-engine/src/advisory/gate-advisory.ts and src/rules/advisory.ts (gate-advisory.ts:589-593, advisory.ts:959-963) — this mirrored-twin pattern is an existing repo convention per the description, but each future policy tweak now needs manual sync in two places relying on drift-check to catch mismatches.
  • The comment in focus-manifest.ts above the promotion line is fairly long (5 lines) for what is a one-line condition change; could be trimmed to just the 'why' (the previous no-op gap) rather than re-explaining the whole promotion mechanism already documented in gittensory.full.yml.
  • Consider extracting the shared isConfiguredGateBlocker escalation logic (or at least the manifest_linked_issue_required branch) into a single function imported by both the engine package and src/rules/advisory.ts to eliminate the duplication nit, if the mirrored-file architecture allows shared imports — otherwise document why duplication is required (e.g. package boundary constraints).

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
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 (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 48 registered-repo PR(s), 40 merged, 285 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 48 PR(s), 285 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 48 PR(s), 285 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 10, 2026
@JSONbored
JSONbored merged commit 3ae7ece into main Jul 10, 2026
13 checks passed
@JSONbored
JSONbored deleted the chore/4618-fold-linked-issue-policy branch July 10, 2026 23:22
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. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

Reduce redundant config surface: linked-issue knob, gateCheckMode, label fields

1 participant