Skip to content

fix(engine): use aggregate repo-stat issues for cache-only outcome totals - #511

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-cache-only-issue-totals-in-repo-stats
Jun 10, 2026
Merged

fix(engine): use aggregate repo-stat issues for cache-only outcome totals#511
JSONbored merged 1 commit into
mainfrom
codex/fix-cache-only-issue-totals-in-repo-stats

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Fix a correctness regression where cache-only contributor totals dropped aggregate ContributorRepoStatRecord.issues when detailed IssueRecord rows were absent or truncated, causing history totals to undercount compared to profile/reconciliation cached totals.

Description

  • Update src/signals/engine.ts to compute openIssueRows, closedIssueRows, and cachedIssueCount = Math.max(cachedIssues.length, cachedStat?.issues ?? 0) and to use cachedIssueCount as a fallback when official issue counts are absent.
  • Ensure openIssues falls back to openIssueRows and closedIssues falls back to Math.max(closedIssueRows, cachedIssueCount - openIssueRows, 0) so issues = openIssues + closedIssues preserves aggregate repo-stat counts.
  • Add a unit test in test/unit/signals-v2.test.ts that constructs a cache-only contributor with repoStats.issues = 7 and no IssueRecord rows and asserts profile, repo outcome, history totals, and reconciliation all reflect the aggregate issue count.
  • Maintain existing behavior that official Gittensor totals remain authoritative when present.

Testing

  • Ran npx vitest run test/unit/signals-v2.test.ts and the test file passed (all tests succeeded).
  • Ran npm run typecheck (tsc --noEmit) and it completed successfully.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 9, 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 d0e4536 Commit Preview URL

Branch Preview URL
Jun 10 2026, 08:24 AM

@superagent-security

Copy link
Copy Markdown
Contributor

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

@ghost

ghost commented Jun 9, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #511 is no longer open. No action.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 9, 2026
@JSONbored JSONbored self-assigned this Jun 10, 2026
@JSONbored JSONbored changed the title Use aggregate repo-stat issues for cache-only outcome totals fix(outcomes): Use aggregate repo-stat issues for cache-only outcome totals Jun 10, 2026
@JSONbored JSONbored changed the title fix(outcomes): Use aggregate repo-stat issues for cache-only outcome totals fix(engine): Use aggregate repo-stat issues for cache-only outcome totals Jun 10, 2026
@github-actions github-actions Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 10, 2026
@JSONbored
JSONbored force-pushed the codex/fix-cache-only-issue-totals-in-repo-stats branch from b690dd7 to d0e4536 Compare June 10, 2026 08:23
@JSONbored JSONbored changed the title fix(engine): Use aggregate repo-stat issues for cache-only outcome totals fix(engine): use aggregate repo-stat issues for cache-only outcome totals Jun 10, 2026
@JSONbored
JSONbored merged commit dd6a362 into main Jun 10, 2026
11 checks passed
@JSONbored
JSONbored deleted the codex/fix-cache-only-issue-totals-in-repo-stats branch June 10, 2026 08:26
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 10, 2026
@JSONbored JSONbored added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jun 10, 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. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant