Skip to content

fix(agent): redact Linear tracker names in PR comments - #3967

Merged
JSONbored merged 1 commit into
mainfrom
codex/propose-fix-for-linear-pr-comment-leak
Jul 7, 2026
Merged

fix(agent): redact Linear tracker names in PR comments#3967
JSONbored merged 1 commit into
mainfrom
codex/propose-fix-for-linear-pr-comment-leak

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent leaking internal Linear project or milestone names into public GitHub PR suggestion comments when a repo opts into the Linear backend because Linear API keys are workspace-scoped and tracker titles may be confidential.
  • Preserve suggestion functionality and signal usefulness while removing direct echoes of Linear tracker titles from public comments.

Description

  • Make suggestion rendering conditional by adding a revealTitles flag to describeMatch and renderSuggestionComment, and only reveal tracker titles when the backend is not linear in maybeSuggestProjectOrMilestoneMatch (src/integrations/project-tracker-adapter.ts).
  • When backend === "linear" the comment text omits the Linear project/milestone names and match-confidence details but keeps useful generic wording (e.g. "matching project" / "linked to the project").
  • Preserve existing Linear matching behavior: findLinearNativeLink and LinearAdapter.listOpenProjects are unchanged; only the public comment content is redacted for Linear-backed matches (src/integrations/linear-adapter.ts and src/integrations/project-tracker-adapter.ts).
  • Update unit tests to cover the native-link and fallback fuzzy-match Linear paths and assert the public comment no longer contains Linear titles (test/unit/linear-adapter.test.ts).

Testing

  • Ran type-check with npm exec tsc -- --noEmit --pretty false, which succeeded.
  • Ran targeted unit tests npx vitest run test/unit/linear-adapter.test.ts --reporter=dot and npx vitest run test/unit/project-tracker-adapter.test.ts --reporter=dot, and both suites passed.
  • Attempted full coverage with npm run test:coverage, but the full suite encountered an existing unrelated recursion (RangeError: Maximum call stack size exceeded in test/unit/queue.test.ts) and was stopped before completion.
  • Ran git diff --check which passed, and npm audit --audit-level=moderate was attempted but the registry audit endpoint returned 403 Forbidden.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-07 08:14:24 UTC

2 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI pending · blocked

⏸️ 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 PR correctly gates title/confidence disclosure in project-tracker suggestion comments behind a new revealTitle/revealTitles flag, wired only for the Linear backend (revealTitles = backend !== 'linear'), which achieves the stated goal of never echoing Linear project/milestone names or match-confidence percentages into public GitHub comments while preserving the native-link and fuzzy-match code paths untouched. The new/updated linear-adapter.test.ts assertions directly verify the redacted text (checking for absence of 'Self-host reliability roadmap' and 'Stealth Launch M3', and presence of the generic 'linked to the project'/'matching project' phrasing) which is a real, non-fabricated test of the changed output. One notable side effect: the fuzzy-match wording change ('This PR looks like it's part of the `Title` project' -> 'part of a matching `Title` project') applies to ALL backends, not just Linear, altering existing GitHub-backend suggestion text as an incidental side effect of a Linear-only redaction fix.

Nits — 5 non-blocking
  • The fuzzy-match phrasing change ('part of the' -> 'part of a matching') in describeMatch (project-tracker-adapter.ts) applies even when revealTitle is true (i.e. for the GitHub backend), which is a wording change beyond the stated Linear-redaction scope; confirm test/unit/project-tracker-adapter.test.ts (untouched by this diff) doesn't assert the old exact phrase, and consider keeping the original 'part of the' wording for the revealed case so only the redacted (Linear) case gets new generic phrasing.
  • When revealTitle is true, 'a matching `Title` project' reads awkwardly compared to the previous 'the `Title` project' — the indefinite article next to a specific, named title is grammatically odd.
  • The PR body/diff doesn't show an explicit 'Closes #NNNN' issue link even though the code comment cites feat(agent): add Linear backend for project/milestone matching #3290 — worth confirming the PR description formally links an eligible open issue per repo convention.
  • In project-tracker-adapter.ts's describeMatch, use a distinct string only for the revealTitle=false fuzzy case (e.g. 'part of a matching project') and preserve 'part of the `Title` project' when revealTitle is true, to avoid changing existing GitHub-backend comment text unnecessarily.
  • Since project-tracker-adapter.test.ts wasn't updated in this diff, add or confirm a coverage assertion there for the unchanged (revealTitle=true) wording so a future refactor doesn't silently drift the GitHub-backend comment text again.

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: 51 registered-repo PR(s), 43 merged, 343 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 51 PR(s), 343 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: 51 PR(s), 343 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

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.66%. Comparing base (1ce4364) to head (5272588).
⚠️ Report is 29 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3967   +/-   ##
=======================================
  Coverage   93.66%   93.66%           
=======================================
  Files         372      372           
  Lines       34856    34858    +2     
  Branches    12743    12745    +2     
=======================================
+ Hits        32649    32651    +2     
  Misses       1588     1588           
  Partials      619      619           
Files with missing lines Coverage Δ
src/integrations/project-tracker-adapter.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 559e10a into main Jul 7, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/propose-fix-for-linear-pr-comment-leak branch July 7, 2026 08:23
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.

Development

Successfully merging this pull request may close these issues.

1 participant