Skip to content

fix(dry-run): restore stats and recall previews with inferred credits - #977

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
SaulMoro:fix/dry-run-stats-preview-followup
Oct 7, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
SaulMoro:fix/dry-run-stats-preview-followup

Conversation

@SaulMoro

@SaulMoro SaulMoro commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

 stats / recall <query> --dry-run
-  guard refuses previews merged in #970
+  guard reaches the existing preview
 stats
-  infer owners, then reread credits from a missing file
+  read owners and credits once, share them with scope/baseline readers

Follow-up to merged #970. Legacy sessions split across scopes reuse their already-reported credit. Missing baseline snapshots reuse the same owners without creating the owners file during preview.

Rebased onto main at 34f32f03. Resolved conflicts in the guard, refusal tests and both usage guides while preserving the Git previews and import-source precedence merged in #971. Removed obsolete merge-order notes from the guides. The five non-conflicting PR files are byte-for-byte unchanged from the original head.

Evidence

Current rebased head a39700a6:

  • npx vitest run src/__tests__/dry-run-guard.test.ts src/__tests__/stats-scope.test.ts src/__tests__/stats-foreign-reports.test.ts src/__tests__/dashboard-report-scope.test.ts src/__tests__/team-push-interventions.test.ts src/__tests__/reports-readers-busy.test.ts src/__tests__/reports-reader-lock.test.ts: 130 tests passed across seven files.
  • npx tsc --noEmit, npm run lint, npm run build, and git diff --check origin/main..HEAD passed.
  • git range-diff confirms that changes from the original PR commit are limited to conflict integration. The guard differs from current main only in the two stats/recall classifications. Its tests cover both fix(dry-run): git previews for remove, roles/projects and import --from-repo (#900) #971 Git previews and fix(dry-run): restore stats and recall previews with inferred credits #977 stats/recall previews.
  • E2E and real-CLI verification were explicitly waived for this rebase. The full unit suite was not rerun. The following evidence belongs to the original head, rather than the rebased head.

Original-head verification at d3fc4c5c:

  • Before: the built CLI refused stats/recall previews. With the guard restored, a legacy split-session fixture showed preview 2 sessions / 8 turns, real stats 1 session / 6 turns. Missing intervention/daily snapshots also created session-owners.jsonl during preview.
  • After: 8,015 unit tests passed, 20 skipped. Relevant built-CLI E2E: 31 passed across stats/recall, refusal, dashboard, report scope reuse and recall maintenance votes.
  • Independent real CLI: python3 /tmp/teamai-900/C-sol-round3-realcli.py "$PWD/dist/index.js" passed. Preview and real stats both showed 1 session / 6 turns. Recall preview returned Deployment timeout fix. The 121-file fixture SHA256 stayed 9acfcb0ee2f22beaaacb01ee6bedf19e2ccda204a53dae2aa0a99ad13cac8c54 across both previews. Owners/index/sessions remained absent, and config bytes stayed identical after real stats. Real stats still seeded owners without a dry-run notice; explicit preview retained its migration notice.

Merge Danger

Door: two-way

Blast Radius: stats

No storage format change or global cache. Owner/credit state belongs to one stats invocation. Scope filtering and baseline/credit readers consume it without changing it. Real stats retains owner seeding; reporting callers retain disk-backed defaults and persist-gated snapshot writes.

The whole branch diff and shared-state readers/writers were reviewed. Preview reads the reports checkout without refreshing it, so totals can differ from real stats when remote reports changed. Extra provider/agent coverage remains CI work.

Related Issues

Refs #900 (C6, C9 follow-up)
Refs #972

Addresses the remaining #970 review. Both usage guides are updated. No affected refusal wording remains in skill-data or designs; help and command-reference generation are unchanged.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

No findings.

The PR description documents sufficient testing, including a representative real-CLI end-to-end verification. I did not run or build the PR, per instructions.

@SaulMoro
SaulMoro force-pushed the fix/dry-run-stats-preview-followup branch from d3fc4c5 to a39700a Compare October 6, 2026 13:57
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

No findings.

The PR description documents sufficient testing, including representative real-CLI end-to-end verification on the original head. Per the review rules, referencing an older commit is not blocking. The earlier review also had no findings.

I only read the specified diff and surrounding code; I did not run, build, or install anything from the PR.

@SaulMoro

SaulMoro commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

@jeff-r2026 This PR fixes the CI issue with stats and recall <query> --dry-run by restoring the previews implemented in #970, while preserving the Git previews from #971. CI is now passing on the rebased head, including the fork-safe E2E tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants