Skip to content

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

Open
SaulMoro wants to merge 1 commit into
Tencent:mainfrom
SaulMoro:fix/dry-run-stats-preview-followup
Open

SaulMoro wants to merge 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

Followup to merged #970. Legacy sessions split across scopes use their already-reported credit in previews. Missing baseline snapshots reuse the same owners without seeding the disk file. Only the stats/recall guard rows move; #971 rows remain unchanged.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Test Plan

  • Before: built-CLI stats/recall tests failed at the merged guard. After restoring the guard, the split-session regression showed preview 2 sessions / 8 turns, real stats 1 session / 6 turns. Missing interventions/daily snapshots also seeded session-owners.jsonl during preview.
  • After: npm run build, npx tsc --noEmit, npm run lint pass. npx vitest run: 8015 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. Stats preview and real stats both show 1 session / 6 turns. Recall preview returns Deployment timeout fix. Full fixture SHA256 stays 9acfcb0ee2f22beaaacb01ee6bedf19e2ccda204a53dae2aa0a99ad13cac8c54 across both previews, 121 files. Owners/index/sessions remain absent; config bytes remain identical after real stats too. Real stats still seeds owners and prints no dry-run notice; explicit preview retains its migration notice.
  • Public regressions compare totals and the complete preview file tree. Existing shrink/partial rebuild, output-refusal and votes-reader tests pass in the full suite. Extra provider/agent coverage remains CI work; the full E2E matrix was not rerun.

Related Issues

Refs #900 (C6, C9 followup)
Refs #972

Merge Danger

Door: two-way

Blast Radius: stats

No storage format change or global cache. Real stats retains ordinary owner seeding. Reporting callers retain disk-backed defaults.

Notes for Reviewers

Addresses the remaining #970 review and its merge integration defect. The new state lives in one stats invocation; scope filtering and baseline/credit reads consume it. The reports checkout remains unrefreshed during preview, so totals can still differ from real stats when remote reports changed.

Updated both usage guides. No affected refusal wording exists in skill-data or designs; help and command-reference generation are unchanged. Whole branch diff and shared-state readers/writers are documented in /tmp/teamai-900/C-sol-round3-result.md.

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.

1 participant