test: pin rollout token parsing and publish safety guards #31
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.65) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.65 · 326 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.346
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.065
Real PR Conversation Timeline
1 comments
"Review active on #31"
general
weight: 0.35
mangeshraut712
Two modules with no tests, where a one-line refactor would quietly corrupt stats or delete the wrong directory:
lib/rollout-tokens.jsfeeds every report's token totals.-
token_countevents are cumulative, so only the last valid snapshot may win.-
token_count-shaped payloads on non-event_msgrecords are ignored, and a latertoken_countwith no usage doesn't clobber the total.- Malformed JSONL lines are skipped, a missing file gives zero usage, and negative or NaN counts become 0.
lib/publish.jsis the only code that runsfs.rmrecursively and pushes to the user's repo.- Repo-slug, branch-name (
--exec=,@{,.lock) and site-dir (including backslash traversal) validation.- Refusing to delete a work dir without the publish-clone marker.
- The
generatedAt-only no-op.- The add/commit/push sequence, run offline through the existing injectable
gitrunner and tmp dirs.These are tests only: 9 new tests, all passing locally. (Locally, 4 suites need
@inquirer/promptsinstalled; that's the same onmain, and CI installs it.)<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/mangeshraut712/codex-insights/pull/31" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->