Skip to content

fix(signals): reuse shared linked-issue-required predicate in AI signal bundle#4631

Merged
JSONbored merged 1 commit into
mainfrom
fix/linked-issue-check-parity-4606
Jul 10, 2026
Merged

fix(signals): reuse shared linked-issue-required predicate in AI signal bundle#4631
JSONbored merged 1 commit into
mainfrom
fix/linked-issue-check-parity-4606

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • buildPublicCommentSignalBundle re-derived the "is a linked issue effectively required" condition
    independently of publicSafePreflightFindings, checking only settings.requireLinkedIssue and
    omitting the settings.linkedIssueGateMode !== "off" half that the doc comment on the shared
    filter says both call sites must agree on.
  • A repo that opts into the gate purely via .gittensory.yml's linkedIssueGateMode: "block" (the
    modern config-as-code path, never touching the legacy DB-backed requireLinkedIssue boolean) got
    correct behavior in the main preflight/comment surface, but the AI-rewrite signal bundle silently
    dropped the missing_linked_issue finding from the context handed to the optional AI-rewrite layer.
  • Fix: buildPublicCommentSignalBundle now calls publicSafePreflightFindings directly and maps the
    result to titles, instead of re-deriving the filter chain a third time. This also picks up the
    bounty-lifecycle filter and the broader private-term check (detail/publicText/action, not just
    code/title) that the shared function already applies — strictly more conservative than before, never
    less.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint (no workflow files touched)
  • npm run typecheck
  • npm run test:coverage locally (scoped to test/unit/signals.test.ts + test/unit/signals-coverage.test.ts with coverage restricted to src/signals/engine.ts); the new line (publicFindingTitles = publicSafePreflightFindings(...)) is exercised by both the pre-existing bundle tests and the new regression test — no new branches are introduced at the call site itself, the branches live inside the already-covered shared predicate.
  • npm run test:workers (no worker-pool code touched)
  • npm run build:mcp (ran as part of confirming a fresh worktree needed the workspace packages built before other test files would resolve; unaffected by this change)
  • npm run test:mcp-pack (no MCP package changes)
  • npm run ui:openapi:check
  • npm run ui:lint (no UI files touched)
  • npm run ui:typecheck (no UI files touched)
  • npm run ui:build (no UI files touched)
  • npm audit --audit-level=moderate (no dependency changes)
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — added a regression test (test/unit/signals.test.ts) covering both sides of the fixed condition: linkedIssueGateMode: "block" with requireLinkedIssue: false (previously dropped, now correctly surfaced) and linkedIssueGateMode: "off" with requireLinkedIssue: false (correctly still dropped).

If any required check was skipped, explain why:

  • This is a two-line backend logic change confined to src/signals/engine.ts; the skipped checks (actionlint, workers, MCP pack, UI lint/typecheck/build, dependency audit) have no surface this diff touches. npm run db:migrations:check and npm run db:schema-drift:check were also run locally and pass (no DB/schema change). Full CI (test:ci) will run the complete gate on push.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — no auth/session surface touched.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no API/OpenAPI/MCP surface touched; ui:openapi:check and ui:openapi:settings-parity both pass unchanged.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI changes.)
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots... (N/A — no visible UI change; backend-only fix.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (N/A — no doc-facing behavior change; docs:drift-check unaffected.)

UI Evidence

N/A — backend-only fix, no visible UI surface.

Notes

@superagent-security

Copy link
Copy Markdown
Contributor

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

@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.11%. Comparing base (2234cb7) to head (1431a13).
⚠️ Report is 8 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4631      +/-   ##
==========================================
- Coverage   94.11%   94.11%   -0.01%     
==========================================
  Files         432      432              
  Lines       38370    38365       -5     
  Branches    13989    13988       -1     
==========================================
- Hits        36113    36108       -5     
  Misses       1600     1600              
  Partials      657      657              
Files with missing lines Coverage Δ
src/signals/engine.ts 97.45% <100.00%> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

gittensory-orb Bot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-10 08:47:36 UTC

2 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 consolidates buildPublicCommentSignalBundle's finding-filter logic to call the shared publicSafePreflightFindings helper instead of re-deriving severity/linked-issue-gate/private-term/slice logic a third time, closing the specific gap where a repo using only .gittensory.yml's linkedIssueGateMode (never touching the legacy requireLinkedIssue boolean) had missing_linked_issue silently dropped from the AI-rewrite signal bundle. The added regression test exercises both arms of the underlying OR condition (linkedIssueGateMode: "block" with requireLinkedIssue: false surfaces the finding; linkedIssueGateMode: "off" with requireLinkedIssue: false correctly omits it), which is exactly the real path that was broken. The change is strictly more conservative (adds bounty-lifecycle filtering and broader private-term coverage) and is a minimal, single-purpose fix.

Nits — 4 non-blocking
  • The PR checkbox claims a linked open issue but no issue number appears in the description text itself (only referenced as historical `Fix divergent linked-issue-required check in buildPublicCommentSignalBundle #4606` in a code comment) — worth confirming the actual `Closes #N` line is present in the real PR body since it's not visible in this diff.
  • engine.ts:5175 relies on publicSafePreflightFindings applying the same publicSignalLevel-based slice (2 vs 5) that was previously inlined — since the function body isn't in this diff, confirm via the existing signals-coverage test that the slice count still matches both `minimal` and `standard` levels for this call site.
  • Consider asserting the slice-length behavior (minimal vs standard publicSignalLevel) explicitly in the new test, since that behavior moved from inline code to the shared helper and losing it would be a silent regression.
  • The inline comment citing `Fix divergent linked-issue-required check in buildPublicCommentSignalBundle #4606` is good practice for future drift prevention — keep doing this for shared-filter call sites per the doc comment convention already on publicSafePreflightFindings.

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, 334 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 48 PR(s), 334 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: not available
  • Official Gittensor activity: 48 PR(s), 334 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

@gittensory-orb gittensory-orb Bot added the manual-review Gittensor contributor context label Jul 10, 2026
…al bundle

buildPublicCommentSignalBundle re-derived the linked-issue-gate condition
independently of publicSafePreflightFindings, checking only
requireLinkedIssue and omitting the linkedIssueGateMode !== "off" half. A
repo that opts into the gate purely via linkedIssueGateMode: "block" in
.gittensory.yml (never touching the legacy requireLinkedIssue boolean) had
the missing-linked-issue finding silently dropped from the context handed
to the optional AI-rewrite layer, even though the main preflight/comment
surface correctly kept it.

Have buildPublicCommentSignalBundle call publicSafePreflightFindings
directly instead of duplicating the condition a third time, so the two
call sites can never diverge again.

Fixes #4606
@JSONbored JSONbored force-pushed the fix/linked-issue-check-parity-4606 branch from bb9a123 to 1431a13 Compare July 10, 2026 08:36
@JSONbored JSONbored merged commit 8929094 into main Jul 10, 2026
11 checks passed
@JSONbored JSONbored deleted the fix/linked-issue-check-parity-4606 branch July 10, 2026 08:54
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.5x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant