Skip to content

fix(db): reset expanded linked issue claims - #1818

Merged
JSONbored merged 4 commits into
mainfrom
codex/propose-fix-for-vulnerability-in-gittensory
Jun 30, 2026
Merged

fix(db): reset expanded linked issue claims#1818
JSONbored merged 4 commits into
mainfrom
codex/propose-fix-for-vulnerability-in-gittensory

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent a PR from backdating newly added linked issues by inheriting an unrelated older PR-level claim timestamp when the linked-issue set changes.

Description

  • Change resolveLinkedIssueClaimedAt to only preserve the existing linkedIssueClaimedAt when the stored linkedIssuesJson is identical to the incoming linkedIssuesJson, otherwise use the current observed claim time.
  • Remove the previous overlap-based preservation logic that allowed overlapping linked-issue sets to retain an old timestamp.
  • Update the unit regression in test/unit/db-parsers.test.ts to assert that expanding a PR's linked-issue set resets the PR-level linkedIssueClaimedAt to the current observed time while unchanged sets still preserve the original timestamp.

Testing

  • Ran npx vitest run test/unit/db-parsers.test.ts, and the updated tests in that file passed.
  • Ran npm run typecheck and TypeScript checks completed without errors.
  • Ran npm audit --audit-level=moderate which failed due to the npm registry audit endpoint returning 403 Forbidden (external network/audit issue), so the dependency-review step could not be completed locally.
  • Ran a targeted coverage invocation npm run test:coverage -- --run test/unit/db-parsers.test.ts; tests executed, but the coverage job failed global thresholds because only the single test file was exercised (the repository-wide coverage thresholds remain unmet by that targeted run).

Codex Task

@loopover-orb

loopover-orb Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-06-30 09:46:33 UTC

2 files · 1 AI reviewer · no blockers · readiness 91/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The change moves PR-level linked issue timestamp preservation from overlap-based reuse to exact same-set reuse, so expanding or replacing the linked issue set gets a fresh observed timestamp while reorder-only changes keep the prior timestamp. The production path builds the incoming JSON from `record.linkedIssues`, and the added regression covers same, expanded, reordered, disjoint, cleared, missing timestamp, and malformed cached JSON cases. I do not see a reachable correctness break in the visible diff.

Nits — 4 non-blocking
  • nit: `src/db/repositories.ts:380` uses a multiline `if` without braces; add braces around the return block to match the complexity of the condition and avoid future edit hazards.
  • nit: `src/db/repositories.ts:388` casts any parsed array to `number[]`; consider filtering to finite positive integers so malformed cached JSON cannot affect set normalization semantics.
  • `src/db/repositories.ts:380` should wrap the preservation branch in braces for maintainability.
  • `src/db/repositories.ts:388` could normalize parsed values with a numeric guard before passing them to `sameLinkedIssueSet`.
Signal Result Evidence
Code review ✅ No 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 (size label size:S; no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 2 registered-repo PR(s), 2 merged, 270 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 2 PR(s), 270 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 2 PR(s), 270 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.
  • No action.
  • 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 gittensor gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 30, 2026
@JSONbored JSONbored self-assigned this Jun 30, 2026
@dosubot dosubot Bot added the size:XS label Jun 30, 2026
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.70%. Comparing base (c0891f7) to head (013e03e).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1818      +/-   ##
==========================================
+ Coverage   95.67%   95.70%   +0.03%     
==========================================
  Files         215      215              
  Lines       23402    23473      +71     
  Branches     8453     8479      +26     
==========================================
+ Hits        22391    22466      +75     
+ Misses        419      418       -1     
+ Partials      592      589       -3     
Files with missing lines Coverage Δ
src/db/repositories.ts 96.20% <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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 30, 2026

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 f56170c Commit Preview URL

Branch Preview URL
Jun 30 2026, 09:09 AM

@dosubot dosubot Bot added size:S and removed size:XS labels Jun 30, 2026
@JSONbored
JSONbored merged commit ecb4f77 into main Jun 30, 2026
17 checks passed
@JSONbored
JSONbored deleted the codex/propose-fix-for-vulnerability-in-gittensory branch June 30, 2026 09:49
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 30, 2026
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.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant