agentwrangler 0.1.1-next.fbffef0 → 0.2.1-next.5ed2140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/README.md +53 -12
  3. package/dist/apply/artifact-framework.js +484 -0
  4. package/dist/apply/jobs.js +8 -6
  5. package/dist/apply/open-terminal-child.mjs +4 -1
  6. package/dist/apply/open-terminal.js +64 -17
  7. package/dist/cli/agentwrangler.js +21 -6
  8. package/dist/cli/audit/index.js +277 -0
  9. package/dist/cli/audit/prompt.md +227 -0
  10. package/dist/cli/audit/query.mjs +59 -0
  11. package/dist/cli/audit/render.mjs +167 -0
  12. package/dist/cli/audit/scan.mjs +369 -0
  13. package/dist/cli/statusline.js +294 -0
  14. package/dist/daemon/boot-state.js +128 -0
  15. package/dist/daemon/config.js +21 -1
  16. package/dist/daemon/data-version.js +34 -0
  17. package/dist/daemon/detector-counters.js +98 -0
  18. package/dist/daemon/detector-pass.js +98 -0
  19. package/dist/daemon/diagnostics-snapshot.js +270 -0
  20. package/dist/daemon/diagnostics-worker-runner.js +71 -0
  21. package/dist/daemon/diagnostics-worker.js +31 -0
  22. package/dist/daemon/headroom-snapshot.js +64 -0
  23. package/dist/daemon/headroom-worker-runner.js +66 -0
  24. package/dist/daemon/headroom-worker.js +26 -0
  25. package/dist/daemon/heavy-job-gate.js +41 -0
  26. package/dist/daemon/history-worker-runner.js +71 -0
  27. package/dist/daemon/history-worker.js +49 -0
  28. package/dist/daemon/http.js +45 -99
  29. package/dist/daemon/index.js +530 -66
  30. package/dist/daemon/instance-lock.js +62 -0
  31. package/dist/daemon/job-budgets.js +211 -0
  32. package/dist/daemon/lifecycle.js +25 -13
  33. package/dist/daemon/outcomes-control.js +157 -0
  34. package/dist/daemon/outcomes-pass.js +193 -70
  35. package/dist/daemon/perf-monitor.js +503 -0
  36. package/dist/daemon/readiness.js +19 -16
  37. package/dist/daemon/recs-snapshot.js +242 -0
  38. package/dist/daemon/recs-worker-runner.js +87 -0
  39. package/dist/daemon/recs-worker.js +40 -0
  40. package/dist/daemon/route-budgets.js +182 -0
  41. package/dist/daemon/route-snapshot-build.js +9 -0
  42. package/dist/daemon/route-snapshot-worker.js +26 -0
  43. package/dist/daemon/route-snapshot.js +105 -0
  44. package/dist/daemon/router.js +1156 -319
  45. package/dist/daemon/scan-offload.js +107 -0
  46. package/dist/daemon/scan-roots.js +18 -0
  47. package/dist/daemon/scan-tasks.js +99 -0
  48. package/dist/daemon/scan-worker.js +37 -0
  49. package/dist/daemon/schedule-job.js +62 -0
  50. package/dist/daemon/snapshot-service.js +152 -0
  51. package/dist/daemon/static.js +142 -46
  52. package/dist/daemon/timer-probe.js +58 -0
  53. package/dist/daemon/wal-checkpoint-worker.js +23 -0
  54. package/dist/daemon/wal-checkpointer.js +92 -0
  55. package/dist/db/idle-checkpoint.js +56 -0
  56. package/dist/db/migrate.js +52 -7
  57. package/dist/db/migrations/020_local_command_retention.sql +50 -0
  58. package/dist/db/migrations/021_recommendation_feedback.sql +25 -0
  59. package/dist/db/migrations/022_classifier_boundaries.sql +27 -0
  60. package/dist/db/migrations/023_privacy_contract.sql +73 -0
  61. package/dist/db/migrations/024_finding_contract_v2.sql +50 -0
  62. package/dist/db/migrations/025_tool_error_classifier.sql +76 -0
  63. package/dist/db/migrations/026_recommendation_contract_guards.sql +102 -0
  64. package/dist/db/migrations/027_handler_recommendation_storage.sql +532 -0
  65. package/dist/db/migrations/028_tool_event_content.sql +27 -0
  66. package/dist/db/migrations/029_subagent_meta.sql +13 -0
  67. package/dist/db/migrations/030_detector_week_results.sql +33 -0
  68. package/dist/db/migrations/031_detector_status_live.sql +15 -0
  69. package/dist/db/migrations/032_session_title.sql +3 -0
  70. package/dist/db/migrations/033_compaction_positions.sql +2 -0
  71. package/dist/db/migrations/034_ingest_metric_events_session_position.sql +3 -0
  72. package/dist/db/migrations/035_rec_lifecycle.sql +82 -0
  73. package/dist/db/migrations/036_rec_lifecycle_actions.sql +17 -0
  74. package/dist/db/migrations/037_subagent_meta_session_index.sql +2 -0
  75. package/dist/db/migrations/038_turns_agent_id.sql +5 -0
  76. package/dist/db/migrations/039_unrestrict_app_content.sql +9 -0
  77. package/dist/db/migrations/040_ledger_daily.sql +53 -0
  78. package/dist/db/migrations/041_perf_indexes.sql +13 -0
  79. package/dist/db/migrations/042_limit_snapshots.sql +11 -0
  80. package/dist/db/migrations/043_tool_error_labels_v2.sql +101 -0
  81. package/dist/db/migrations/044_c6_edit_string_hashes.sql +7 -0
  82. package/dist/db/migrations/045_catalog_items.sql +32 -0
  83. package/dist/db/migrations/046_detector_contract_v2.sql +35 -0
  84. package/dist/db/migrations/047_ingest_metric_events_event_ts.sql +4 -0
  85. package/dist/db/migrations/048_ingest_offset_identity.sql +15 -0
  86. package/dist/db/migrations/049_setup_grade_snapshots.sql +18 -0
  87. package/dist/db/migrations/050_setup_grade_indexes.sql +8 -0
  88. package/dist/db/migrations/051_judge_verdicts.sql +14 -0
  89. package/dist/db/migrations/052_classifier_version_2.sql +38 -0
  90. package/dist/db/migrations/053_turns_grade_cover.sql +7 -0
  91. package/dist/db/open.js +13 -0
  92. package/dist/db/stmt-cache.js +23 -0
  93. package/dist/db/write-gate.js +104 -0
  94. package/dist/db/write-intent.js +66 -0
  95. package/dist/detector/cache-collapse.js +156 -0
  96. package/dist/detector/cache-ttl.js +58 -0
  97. package/dist/detector/calibration.js +35 -18
  98. package/dist/detector/certification.js +77 -0
  99. package/dist/detector/check-guidance.js +213 -0
  100. package/dist/detector/check-registry.js +713 -0
  101. package/dist/detector/claim-ledger.js +521 -0
  102. package/dist/detector/context-probe.js +222 -55
  103. package/dist/detector/contracts.js +99 -0
  104. package/dist/detector/d1-source-identity.js +27 -11
  105. package/dist/detector/d7-loop-analysis.js +263 -0
  106. package/dist/detector/detectors/a1_tool_result_bloat.js +249 -0
  107. package/dist/detector/detectors/a2_task_output_bloat.js +243 -0
  108. package/dist/detector/detectors/b1_cache_read_collapse.js +339 -0
  109. package/dist/detector/detectors/b2_cache_ttl_gap.js +200 -0
  110. package/dist/detector/detectors/b3_resume_cache_miss.js +285 -0
  111. package/dist/detector/detectors/b4_mid_session_prefix_break.js +179 -0
  112. package/dist/detector/detectors/c11_mcp_output_cap.js +154 -0
  113. package/dist/detector/detectors/c1_tool_error_rate.js +200 -0
  114. package/dist/detector/detectors/c2_content_not_found.js +128 -0
  115. package/dist/detector/detectors/c3_edit_before_read.js +142 -0
  116. package/dist/detector/detectors/c4_failed_edit_recovery.js +215 -0
  117. package/dist/detector/detectors/c5_same_error_loop.js +363 -0
  118. package/dist/detector/detectors/c6_edit_flip_flop.js +191 -0
  119. package/dist/detector/detectors/c7_bash_failure_cluster.js +225 -0
  120. package/dist/detector/detectors/c9_denial_friction.js +198 -0
  121. package/dist/detector/detectors/d10_catalog_footprint.js +248 -92
  122. package/dist/detector/detectors/d11_tool_error_rate.js +125 -0
  123. package/dist/detector/detectors/d12_subagent_overspawn.js +135 -0
  124. package/dist/detector/detectors/d14_interrupt_cancel.js +189 -0
  125. package/dist/detector/detectors/d1_ctx_always_loaded.js +262 -75
  126. package/dist/detector/detectors/d2_session_long_full_context.js +387 -88
  127. package/dist/detector/detectors/d4_model_mismatch.js +335 -161
  128. package/dist/detector/detectors/d5_limit_burn_forecast.js +222 -44
  129. package/dist/detector/detectors/d6_tool_result_bloat.js +272 -260
  130. package/dist/detector/detectors/d7_loop_retry_waste.js +565 -218
  131. package/dist/detector/detectors/d8_cache_write_churn.js +310 -163
  132. package/dist/detector/detectors/d9_idle_background_session.js +127 -79
  133. package/dist/detector/detectors/e1_orientation_before_first_edit.js +180 -0
  134. package/dist/detector/detectors/e2_main_thread_mechanical_runs.js +227 -0
  135. package/dist/detector/detectors/g11_high_spend_failure.js +233 -0
  136. package/dist/detector/detectors/h1_destructive_operations.js +202 -0
  137. package/dist/detector/engine.js +829 -15
  138. package/dist/detector/finding-registry.js +61 -0
  139. package/dist/detector/index.js +1 -1
  140. package/dist/detector/ledger-daily.js +183 -0
  141. package/dist/detector/measurement.js +13 -8
  142. package/dist/detector/model-windows.js +23 -0
  143. package/dist/detector/practice-registry.js +14 -4
  144. package/dist/detector/privacy-contract.js +1065 -0
  145. package/dist/detector/rec-id.js +16 -0
  146. package/dist/detector/registry.js +44 -0
  147. package/dist/detector/result-claims.js +253 -0
  148. package/dist/detector/savings.js +598 -54
  149. package/dist/detector/setup-grade.js +658 -0
  150. package/dist/detector/tier-price.js +56 -0
  151. package/dist/detector/turn-claim.js +681 -0
  152. package/dist/detector/waste-turn-claims.js +94 -0
  153. package/dist/detector/wave1-reconciliation.js +157 -0
  154. package/dist/detector/write-price.js +130 -0
  155. package/dist/effects/engine.js +122 -23
  156. package/dist/effects/index.js +1 -0
  157. package/dist/effects/registry.js +276 -8
  158. package/dist/effects/scope-identity.js +19 -0
  159. package/dist/effects/sql-observer.js +564 -9
  160. package/dist/effects/store.js +216 -29
  161. package/dist/evidence/common/approved-input.js +2 -1
  162. package/dist/evidence/common/boundary.js +2 -1
  163. package/dist/evidence/cond1/packet.js +6 -3
  164. package/dist/evidence/cond1/prepare.js +4 -2
  165. package/dist/evidence/create-approval.js +2 -1
  166. package/dist/evidence/create-scratch.js +2 -1
  167. package/dist/evidence/discover-approval.js +6 -2
  168. package/dist/evidence/g2/cli.js +7 -9
  169. package/dist/evidence/precision-artifact-guard.js +231 -0
  170. package/dist/evidence/precision-gate.js +329 -0
  171. package/dist/evidence/r3/prepare.js +3 -1
  172. package/dist/hook/context-budget-hook.mjs +46 -41
  173. package/dist/hook/limit-burn-hook.mjs +10 -8
  174. package/dist/hook/loop-guard-hook.mjs +5 -6
  175. package/dist/ingest/agent-id-backfill.js +85 -0
  176. package/dist/ingest/boot-progress.js +194 -0
  177. package/dist/ingest/canary-purge.js +52 -0
  178. package/dist/ingest/churn-collector.js +37 -16
  179. package/dist/ingest/commit-linker.js +171 -0
  180. package/dist/ingest/compaction-boundaries.js +74 -0
  181. package/dist/ingest/destructive-relabel.js +88 -0
  182. package/dist/ingest/destructive.js +204 -0
  183. package/dist/ingest/discovery.js +22 -7
  184. package/dist/ingest/enrichment-epoch.js +35 -0
  185. package/dist/ingest/index.js +1 -0
  186. package/dist/ingest/ingestor.js +1397 -185
  187. package/dist/ingest/interrupt-relabel.js +98 -0
  188. package/dist/ingest/n-computability.js +61 -0
  189. package/dist/ingest/parser.js +291 -28
  190. package/dist/ingest/pricing.js +162 -14
  191. package/dist/ingest/reconcile.js +18 -0
  192. package/dist/ingest/reprice.js +84 -0
  193. package/dist/ingest/secrets-filter.js +97 -0
  194. package/dist/ingest/session-attribution-repair.js +157 -0
  195. package/dist/ingest/tail.js +104 -8
  196. package/dist/ingest/test-command-repair.js +45 -0
  197. package/dist/ingest/test-seams.js +107 -0
  198. package/dist/ingest/tool-error-classifier.js +120 -0
  199. package/dist/ingest/tool-error-repair.js +46 -0
  200. package/dist/ingest/types.js +17 -4
  201. package/dist/ingest/workspace-mapping.js +26 -18
  202. package/dist/ingest/worktree-workspace-merge.js +38 -0
  203. package/dist/judge/claude-cli.js +201 -0
  204. package/dist/judge/judge-service.js +270 -0
  205. package/dist/judge/verdict.js +160 -0
  206. package/dist/oauth/count-tokens.js +13 -21
  207. package/dist/oauth/credentials.js +53 -25
  208. package/dist/oauth/judge-g2-client.js +9 -28
  209. package/dist/oauth/usage-cache.js +96 -0
  210. package/dist/oauth/usage.js +11 -162
  211. package/dist/outcomes/conclusions.js +15 -0
  212. package/dist/outcomes/findings.js +31 -8
  213. package/dist/outcomes/github/client.js +1 -0
  214. package/dist/outcomes/github/credential.js +96 -58
  215. package/dist/outcomes/github/gh-cli-client.js +117 -1
  216. package/dist/outcomes/github/pr-page.js +277 -0
  217. package/dist/outcomes/linker.js +200 -8
  218. package/dist/outcomes/stage-summary.js +80 -0
  219. package/dist/outcomes/sync.js +152 -19
  220. package/dist/query/api/agents-liveness.js +98 -14
  221. package/dist/query/api/burn-status.js +78 -15
  222. package/dist/query/api/context-budget.js +21 -6
  223. package/dist/query/api/decision-method-registry.js +30 -0
  224. package/dist/query/api/decision-ranker-types.js +6 -0
  225. package/dist/query/api/decision-track.js +188 -0
  226. package/dist/query/api/decision-view-types.js +1 -0
  227. package/dist/query/api/diagnostics-avoidable.js +9 -0
  228. package/dist/query/api/diagnostics-causes.js +374 -0
  229. package/dist/query/api/diagnostics-census.js +259 -0
  230. package/dist/query/api/diagnostics-triage.js +643 -0
  231. package/dist/query/api/diagnostics.js +278 -0
  232. package/dist/query/api/effect-service.js +406 -23
  233. package/dist/query/api/efficiency-headroom.js +40 -35
  234. package/dist/query/api/esf-observations.js +90 -61
  235. package/dist/query/api/evidence-packet-types.js +3 -0
  236. package/dist/query/api/evidence-packet.js +316 -0
  237. package/dist/query/api/feedback-store.js +301 -0
  238. package/dist/query/api/hook-config.js +3 -2
  239. package/dist/query/api/hot-sessions.js +213 -7
  240. package/dist/query/api/index.js +6 -2
  241. package/dist/query/api/judge-payload-scrub.js +186 -0
  242. package/dist/query/api/judge-payload.js +336 -0
  243. package/dist/query/api/judge-setup.js +249 -0
  244. package/dist/query/api/ledger-aggregate.js +133 -0
  245. package/dist/query/api/ledger-daily-provider.js +122 -0
  246. package/dist/query/api/opportunity-composer-types.js +3 -0
  247. package/dist/query/api/opportunity-composer.js +303 -0
  248. package/dist/query/api/overview-view.js +167 -0
  249. package/dist/query/api/overview.js +152 -12
  250. package/dist/query/api/rec-actions/accessor.js +28 -0
  251. package/dist/query/api/rec-actions/card-rules.js +149 -0
  252. package/dist/query/api/rec-actions/families/cache.js +528 -0
  253. package/dist/query/api/rec-actions/families/context.js +1104 -0
  254. package/dist/query/api/rec-actions/families/errors.js +970 -0
  255. package/dist/query/api/rec-actions/families/orientation.js +45 -0
  256. package/dist/query/api/rec-actions/families/permissions.js +504 -0
  257. package/dist/query/api/rec-actions/families/routing.js +333 -0
  258. package/dist/query/api/rec-actions/guardrails.js +67 -0
  259. package/dist/query/api/rec-actions/index.js +90 -0
  260. package/dist/query/api/rec-actions/prompt.js +93 -0
  261. package/dist/query/api/rec-actions/settings-registry.js +67 -0
  262. package/dist/query/api/rec-actions/trigger.js +2015 -0
  263. package/dist/query/api/rec-actions/types.js +2 -0
  264. package/dist/query/api/rec-actions/validate.js +184 -0
  265. package/dist/query/api/rec-actions/why.js +42 -0
  266. package/dist/query/api/rec-evidence.js +204 -0
  267. package/dist/query/api/rec-prompt.js +139 -131
  268. package/dist/query/api/recommendation-queue-reader.js +197 -0
  269. package/dist/query/api/recommendation-queue.js +258 -0
  270. package/dist/query/api/recommendations-ledger.js +19 -12
  271. package/dist/query/api/recommendations.js +1138 -220
  272. package/dist/query/api/reports.js +17 -5
  273. package/dist/query/api/self-percentiles.js +9 -2
  274. package/dist/query/api/session-breakdown.js +91 -0
  275. package/dist/query/api/session-drivers.js +166 -17
  276. package/dist/query/api/session-story.js +335 -0
  277. package/dist/query/api/settings.js +2 -2
  278. package/dist/query/api/spend-flavor.js +1 -1
  279. package/dist/query/api/tool-calls.js +1442 -0
  280. package/dist/query/api/trends.js +22 -6
  281. package/dist/query/cap-weighted.js +1 -1
  282. package/dist/query/decision-contract.js +79 -0
  283. package/dist/query/limits/cli-usage.js +412 -0
  284. package/dist/query/limits/compute.js +39 -0
  285. package/dist/query/limits/history.js +143 -0
  286. package/dist/query/limits/index.js +482 -0
  287. package/dist/query/limits/last-good-store.js +53 -0
  288. package/dist/query/limits/snapshot-store.js +21 -0
  289. package/dist/query/limits/statusline-install.js +268 -0
  290. package/dist/query/limits/statusline.js +115 -0
  291. package/dist/query/limits/types.js +11 -0
  292. package/dist/query/limits/usage-sources.js +106 -0
  293. package/dist/query/limits/weight-fit.js +109 -0
  294. package/dist/query/recommendation-contract.js +66 -0
  295. package/dist/query/settings-store.js +116 -25
  296. package/dist/query/spend.js +180 -80
  297. package/dist/recommendations/capabilities.js +146 -0
  298. package/dist/recommendations/correlation.js +63 -0
  299. package/dist/recommendations/engine.js +248 -0
  300. package/dist/recommendations/handlers/h2-output-context/index.js +314 -0
  301. package/dist/recommendations/handlers/h3-cache-efficiency/index.js +260 -0
  302. package/dist/recommendations/handlers/h4-error-loop/index.js +346 -0
  303. package/dist/recommendations/handlers/h5-permission-friction/index.js +373 -0
  304. package/dist/recommendations/handlers/h6-durable-corrections/index.js +286 -0
  305. package/dist/recommendations/investigation-prompt.js +179 -0
  306. package/dist/recommendations/legacy-adapter.js +36 -0
  307. package/dist/recommendations/persistence.js +71 -0
  308. package/dist/recommendations/queue-contract.js +14 -0
  309. package/dist/recommendations/ranking-policy.js +98 -0
  310. package/dist/recommendations/registry.js +29 -0
  311. package/dist/recommendations/shadow.js +59 -0
  312. package/dist/recommendations/storage.js +497 -0
  313. package/dist/recommendations/types.js +88 -0
  314. package/dist/recommendations/value.js +29 -0
  315. package/dist/scanner/env-scan.js +240 -0
  316. package/dist/shared/claude-child-env.js +9 -0
  317. package/dist/shared/schemas/overview-view.js +214 -0
  318. package/dist/ui/assets/DiagnosticsPage-BCaUDFxE.js +1 -0
  319. package/dist/ui/assets/EmptyState-C7EQV0p-.js +1 -0
  320. package/dist/ui/assets/GlossaryPage-D0nTvq42.js +1 -0
  321. package/dist/ui/assets/HotSessionsPage-C_HsxJFF.js +1 -0
  322. package/dist/ui/assets/JudgeSetupPage-fQj6m0G4.js +2 -0
  323. package/dist/ui/assets/KpiCard-B1-vShSH.js +1 -0
  324. package/dist/ui/assets/Modal-CRuYwITz.js +1 -0
  325. package/dist/ui/assets/OverviewPage-3_QR8iee.js +1 -0
  326. package/dist/ui/assets/PartialBadge-DatGI4yN.js +1 -0
  327. package/dist/ui/assets/RecommendationsPage-C1bGp6fc.js +3 -0
  328. package/dist/ui/assets/SessionDetailPage-Dx4-Akgp.js +2 -0
  329. package/dist/ui/assets/SettingsPage-DZwji9oq.js +25 -0
  330. package/dist/ui/assets/Skeleton-CFvSDQMx.js +1 -0
  331. package/dist/ui/assets/SpendPercentileChip-DhKskPQk.js +1 -0
  332. package/dist/ui/assets/StateChip-D0IFZyGe.js +1 -0
  333. package/dist/ui/assets/WorkspaceDetailPage-DqWtAW49.js +1 -0
  334. package/dist/ui/assets/WorkspacesPage-DzN9L9oH.js +1 -0
  335. package/dist/ui/assets/bands-dF7VjHZE.js +1 -0
  336. package/dist/ui/assets/drilldown-seed--YO7LBXB.js +1 -0
  337. package/dist/ui/assets/effect-client-DatnwqXw.js +1 -0
  338. package/dist/ui/assets/esf-client-DxAXbBnk.js +1 -0
  339. package/dist/ui/assets/history-status-CoFOVM1Y.js +1 -0
  340. package/dist/ui/assets/index-Ctw3qvV7.css +1 -0
  341. package/dist/ui/assets/index-jONT-smE.js +10 -0
  342. package/dist/ui/assets/prompt-templates-B55TZOUy.js +13 -0
  343. package/dist/ui/assets/recharts-DzqPq0lG.js +112 -0
  344. package/dist/ui/assets/short-id-C12NbqLn.js +1 -0
  345. package/dist/ui/assets/useExperimentalActions-oeWGgxs5.js +1 -0
  346. package/dist/ui/assets/workspace-names-zbeGPydt.js +1 -0
  347. package/dist/ui/index.html +95 -24
  348. package/dist/ui/media/Agent-Wrangler-Logo@2x.png +0 -0
  349. package/dist/ui/media/Agent-Wrangler-Logo@4x.png +0 -0
  350. package/package.json +26 -5
  351. package/dist/query/api/reported-work.js +0 -46
  352. package/dist/query/api/work-records.js +0 -85
  353. package/dist/ui/assets/BarChart-BOecTQgC.js +0 -3
  354. package/dist/ui/assets/BriefsPage-CjvXspiw.js +0 -2
  355. package/dist/ui/assets/CacheWriteSpikesChart-5Pn1sUZC.js +0 -1
  356. package/dist/ui/assets/CartesianChart-56rkZQt4.js +0 -84
  357. package/dist/ui/assets/Chip-BZTcuGOm.js +0 -1
  358. package/dist/ui/assets/ComposedChart-C8PPdkFl.js +0 -1
  359. package/dist/ui/assets/EmptyState-BfD86Pv3.js +0 -1
  360. package/dist/ui/assets/FlavorDecomposition-BsOuw4CF.js +0 -1
  361. package/dist/ui/assets/FrictionCell-DQBJsot-.js +0 -2
  362. package/dist/ui/assets/GlossaryPage-DutLIAlv.js +0 -1
  363. package/dist/ui/assets/HotSessionsPage-DLWlyBfb.js +0 -1
  364. package/dist/ui/assets/InfoTip-BrYyvCNl.js +0 -1
  365. package/dist/ui/assets/Legend-DzSAmt8-.js +0 -5
  366. package/dist/ui/assets/Line-1eksYo3m.js +0 -1
  367. package/dist/ui/assets/Modal-DX-JN5Ul.js +0 -1
  368. package/dist/ui/assets/ObservationEvidence-Bbsc-DCW.js +0 -1
  369. package/dist/ui/assets/ObservationEvidence-Cy92xibu.css +0 -1
  370. package/dist/ui/assets/OverviewPage-CWgzRIqk.js +0 -2
  371. package/dist/ui/assets/RecommendationsPage-sRHEku70.js +0 -2
  372. package/dist/ui/assets/Scatter-Ys7Lbhjf.js +0 -1
  373. package/dist/ui/assets/SessionDetailPage-L02ituTQ.js +0 -1
  374. package/dist/ui/assets/SettingsPage-DJjWicvx.js +0 -25
  375. package/dist/ui/assets/Skeleton-ab1u7ntu.js +0 -1
  376. package/dist/ui/assets/SpendPercentileChip-DnRJWBUP.js +0 -1
  377. package/dist/ui/assets/TrendChart-_nohASRq.js +0 -1
  378. package/dist/ui/assets/WorkspaceDetailPage-BQ3XA3Hf.js +0 -1
  379. package/dist/ui/assets/WorkspacesPage-DKdpBgC9.js +0 -1
  380. package/dist/ui/assets/chart-theme-0POFlal8.js +0 -1
  381. package/dist/ui/assets/graphicalItemSelectors-B97PsJDp.js +0 -1
  382. package/dist/ui/assets/index-DAAmee2m.js +0 -41
  383. package/dist/ui/assets/index-D_IJsvkJ.css +0 -1
  384. package/dist/ui/assets/prompt-templates-CVzMex9L.js +0 -13
  385. package/dist/ui/assets/rec-sessions-ggz9MYgP.js +0 -1
  386. package/dist/ui/assets/useExperimentalActions-avkWaDmQ.js +0 -1
  387. package/dist/work-records/allocation.js +0 -242
  388. package/dist/work-records/ids.js +0 -80
  389. package/dist/work-records/index.js +0 -4
  390. package/dist/work-records/store.js +0 -376
  391. package/dist/work-records/types.js +0 -29
  392. package/dist/work-records/validation.js +0 -71
package/CHANGELOG.md ADDED
@@ -0,0 +1,107 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.0]
10
+
11
+ A large release: a redesigned dashboard, 31 detectors (up from 9), one ranked list of recommendations with
12
+ measured effects, and a new Rate my setup page. Usage limits are now read through your own Claude Code CLI, and
13
+ one-click apply is off. Full notes: [docs/releases/0.2.0.md](https://github.com/Doogit/AgentWrangler/blob/main/docs/releases/0.2.0.md).
14
+
15
+ ### Performance
16
+ - Opens sooner on first launch (newest sessions first, the rest in the background) and stays responsive while it
17
+ reads.
18
+ - Transcript reading runs in short time slices. History, recommendations, Usage patterns and headroom are built in
19
+ background worker threads and served from snapshots, so page requests do not wait on them.
20
+ - Copied or renamed transcripts are not read again, warm restarts skip unchanged files, and one browser tab polls
21
+ for status on behalf of the others.
22
+ - Measured in our release test gate while a backfill is running: daemon event-loop p99 ≤ 50 ms, and each of the 67
23
+ budgeted API routes within its p95 latency budget (250 ms for most routes).
24
+
25
+ ### UI / dashboard
26
+ - New sidebar groups, a redesigned Overview, Sessions and Workspaces, and new Usage patterns and Help pages.
27
+ - Overview: a Usage limits card, $ and Tokens spend tabs, a 12-week chart of your implied weekly limit, and your most
28
+ expensive sessions of the last 7 days. Sessions is paged, with cache hit %, peak context and subagent cost columns.
29
+ - Usage patterns groups avoidable spend and reliability problems by root cause, with the affected sessions.
30
+ - Removed: the Briefs tab (now Rate my setup), work records, and the Overview cache-efficiency tile.
31
+
32
+ ### Detectors
33
+ - 31 detectors (up from 9), each tested with a must-fire and a near-miss fixture.
34
+ - New areas include oversized tool output, cache misses and breaks, tool error rates, edits before reads, repeated
35
+ errors, permission denials, subagent over-spawning and destructive operations.
36
+ - Dollar figures are estimates at list prices; a card says **Not estimated** when it cannot price the finding.
37
+ Shared turns are no longer counted twice, and subagent turns are attributed and priced.
38
+
39
+ ### Handlers and recommendations
40
+ - One list ranked by dollars per week; **Track** a change and AgentWrangler measures its effect over 14 days.
41
+ Dismissals and adoptions can be undone.
42
+ - Each card shows a summary, why it matters, the evidence (sessions and turns) and its actions. A change it cannot
43
+ measure says "Effect not measured" instead of guessing.
44
+ - Resetting recommendations keeps the ones you acted on and their measured effects.
45
+
46
+ ### Judge module
47
+ - **Rate my setup** grades your Claude Code setup; optional **Judge me** asks Claude for a review after showing you
48
+ what will be sent.
49
+ - Checks cover settings, hooks, CLAUDE.md and memory files, MCP servers, permissions, skills and agents. A snapshot
50
+ is saved each time your grade changes.
51
+ - Judge me runs your own `claude` with no tools, no MCP servers and no saved session; secrets are blocked. Typical
52
+ cost: $0.30–$0.40 of your Claude usage.
53
+
54
+ ### Usage limits
55
+ - Read by running your own `claude -p /usage` in the background (on by default, off in Settings), or from the
56
+ statusline. AgentWrangler no longer sends your Claude login token anywhere.
57
+ - The reader runs only while the dashboard is open: at most every 5 minutes when you are active, hourly when idle,
58
+ and not while the statusline reading is fresh. Only percentages, reset times and model labels are kept.
59
+ - The card keeps the last good reading across restarts and marks it stale when it is old.
60
+
61
+ ### Ingest and data
62
+ - Reads `/clear`, `/compact`, session titles and subagent attribution; price fixes; one daemon per database and a
63
+ backup before each migration. Some unused API routes were removed (see the full notes).
64
+ - 38 new database migrations. A database written by a newer AgentWrangler is refused instead of damaged; the
65
+ pre-migration backup (`.pre-migrate.bak`) is skipped above 512 MB.
66
+ - Price fixes for Opus 5.5 and Sonnet 5.5 cache reads and Haiku 5.5 tiers, with a re-price of stored history.
67
+
68
+ ### CLI, install and packaging
69
+ - **The default address is now `http://127.0.0.1:2929`** (was `127.0.0.1:47821`). Set `AW_PORT` to keep the old
70
+ port. Update bookmarks.
71
+ - New `agentwrangler statusline` (install from Settings; wraps your existing statusline command).
72
+ - New `agentwrangler audit` (experimental). The npm package now includes this changelog. Still requires Node.js 22
73
+ to 24.
74
+
75
+ ### macOS
76
+ - Non-blocking Keychain read, a checked and time-limited Terminal.app launch for Open in Claude Code, and a macOS
77
+ first-run smoke test in CI.
78
+ - The Keychain read is limited to 3 seconds and cached; the Terminal.app launch gives up after 20 seconds.
79
+
80
+ ### Security and privacy
81
+ - `ANTHROPIC_API_KEY` is never passed to a `claude` that AgentWrangler starts. Write requests need a per-run token.
82
+ - Guardrail hooks no longer skip Claude Code's permission prompt; reinstall them from Settings after upgrading.
83
+ - The local database may hold secrets-filtered transcript excerpts; nothing leaves your machine as sync, backup or
84
+ telemetry.
85
+
86
+ ### Off in 0.2.0 / known limits
87
+ - One-click apply is off (`403 APPLY_DISABLED`); use Copy prompt or Open in Claude Code (Settings > Advanced >
88
+ Experimental actions).
89
+ - The macOS Keychain and Terminal Automation prompts are not yet tested on a real Mac.
90
+
91
+ ## [0.1.0] - 2026-09-04
92
+
93
+ Initial public release.
94
+
95
+ ### Added
96
+ - Local-first observability daemon (bound to `127.0.0.1:47821`) and a browser dashboard that joins
97
+ your Claude Code token spend to the pull requests each session merged or closed — entirely on your
98
+ machine, with no cloud backend and no telemetry.
99
+ - Installable guardrails, turn-key from the dashboard: a dangerous-command deny hook, a PreCompact
100
+ checkpoint, and a context-budget warning.
101
+ - SQLite-backed local store (`~/.agentwrangler/db.sqlite`) that persists only aggregates, ids,
102
+ counts, and structural anchors — never raw transcript or PR content (the SEC-101 privacy
103
+ invariant).
104
+ - Optional GitHub token (read locally, never logged) powering the PR-outcomes feature.
105
+
106
+ [0.2.0]: https://github.com/Doogit/AgentWrangler/releases/tag/v0.2.0
107
+ [0.1.0]: https://github.com/Doogit/AgentWrangler/releases/tag/v0.1.0
package/README.md CHANGED
@@ -16,7 +16,7 @@ Requires **Node 22-24 and npm**, plus Claude Code transcripts for populated char
16
16
  npx agentwrangler@latest
17
17
  ```
18
18
 
19
- Open **http://127.0.0.1:47821** if the browser does not open automatically. Keep the terminal
19
+ Open **http://127.0.0.1:2929** if the browser does not open automatically. Keep the terminal
20
20
  running; press **Ctrl+C** to stop. The first scan runs in the background. An empty history is
21
21
  valid: use Claude Code, then return after ingestion. If a daemon is already running, stop it
22
22
  before starting another on the same port.
@@ -35,8 +35,10 @@ before starting another on the same port.
35
35
  Read its evidence and caveats. A modeled amount is a projection; directional advice may
36
36
  have no dollar estimate. If nothing fires, there is nothing to adopt just to finish setup.
37
37
  4. **Make one deliberate change.** A copied prompt is an artifact to review and run yourself.
38
- It does not edit files. After completing a supported change, use **I completed the change**
39
- when offered, then **Track this change** to record a baseline.
38
+ It does not edit files. **Open in Claude Code** (Settings > Advanced > Experimental actions,
39
+ off by default) starts your own `claude` in a terminal; nothing is applied for you. After
40
+ completing a supported change, use **I completed the change** when offered, then **Track**
41
+ to record a baseline.
40
42
  5. **Return to the Impact ledger.** Tracking starts observation, not a savings claim. Eligible
41
43
  signals use a 14-day observation window and may finish inconclusive. You can finish this
42
44
  first visit without a GitHub token, calibration, or installed hooks.
@@ -50,7 +52,7 @@ session inspection, and supported recommendation tracking work without either.
50
52
 
51
53
  ## Dashboard preview
52
54
 
53
- ![Synthetic Overview: spend for the selected window, model mix, and links to sessions and recommendations](https://raw.githubusercontent.com/Doogit/AgentWrangler/main/docs/assets/overview.png)
55
+ ![Synthetic Overview: usage limits read through Claude Code /usage, spend for the selected window, and the top recommendations](https://raw.githubusercontent.com/Doogit/AgentWrangler/main/docs/assets/overview.png)
54
56
 
55
57
  This static preview uses synthetic data. [The dashboard tour](https://github.com/Doogit/AgentWrangler/blob/main/docs/dashboard-tour.md)
56
58
  contains the other views and an optional animated preview.
@@ -64,7 +66,7 @@ contains the other views and an optional animated preview.
64
66
  | Understand the dollars and verdicts | [Metric vocabulary](https://github.com/Doogit/AgentWrangler/blob/main/docs/dashboard-tour.md#glossary-how-to-read-this-dashboard) |
65
67
  | Fix an empty dashboard | [First launch](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#first-launch) |
66
68
  | Connect GitHub or calibrate limits | [Optional setup](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#optional-setup) |
67
- | Read a weekly summary | [Briefs](https://github.com/Doogit/AgentWrangler/blob/main/docs/dashboard-tour.md#briefs) |
69
+ | Grade my Claude Code setup | [Rate my setup](https://github.com/Doogit/AgentWrangler/blob/main/docs/dashboard-tour.md#rate-my-setup): a score and tier against a cited rubric, what the next tier needs, and an optional AI review |
68
70
 
69
71
  ## Installable guardrails — local checks inside Claude Code, before the waste
70
72
 
@@ -81,22 +83,61 @@ five hooks; **Copy install prompt** prepares instructions for three. Copying alo
81
83
 
82
84
  [Installation, removal, and the checkpoint privacy details](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#in-session-guardrails).
83
85
 
86
+ ## Usage limits — read from Claude Code
87
+
88
+ By default AgentWrangler runs your own `claude -p /usage` in the background, only while the
89
+ dashboard is open: at most every 5 minutes when you have been active, hourly when idle, and not
90
+ while the statusline reading is fresh. It runs your own `claude` CLI and never reads your Claude
91
+ login. It stores only percentages, reset times and model labels in
92
+ `~/.agentwrangler/usage-cli.json`. Turn it off with the Settings checkbox **Read usage via Claude
93
+ Code /usage** or `AW_USAGE_CLI=off`.
94
+
95
+ The Claude Code statusline is the optional alternative: it updates on every turn and makes no
96
+ background calls. Settings **Install statusline** points Claude Code's `statusLine` at
97
+ `agentwrangler statusline`, after showing the exact before/after of `~/.claude/settings.json` and
98
+ saving a timestamped backup. It prints a one-line status (model, repo, branch, context, 5h/7d
99
+ limits, session cost) and saves only the two limit percentages and reset times to
100
+ `~/.agentwrangler/statusline-limits.json`. An existing statusline keeps running and displaying
101
+ (`--wrap "<your command>"`); Uninstall restores it. The 5-hour and weekly figures come from
102
+ whichever reading is newer; per-model weekly rows come only from `/usage`.
103
+
84
104
  ## Privacy and limits
85
105
 
86
- - The daemon binds to **127.0.0.1**. There is no telemetry or hosted product backend.
87
- - SQLite contains aggregates and structural data, and can also contain local command text
88
- and filesystem paths. Treat it as sensitive. The optional PreCompact hook makes separate
106
+ - The daemon binds to **127.0.0.1**. There is no telemetry or hosted product backend. By default
107
+ the only outbound call is your own `claude` CLI's `/usage` call for Usage limits; GitHub sync,
108
+ Judge me and calibration are opt-in.
109
+ - SQLite holds token counts and structural data, filesystem paths, and some transcript
110
+ content: the shell command text of tool calls and short error excerpts from failed tool
111
+ results, after a best-effort secrets filter. Recommendation cards also read the calls behind
112
+ a finding back from your transcripts to show what ran. All of it stays on your machine.
113
+ Treat the database and any backups as sensitive. The optional PreCompact hook makes separate
89
114
  raw transcript copies on your machine.
90
- - Usage refresh can contact Anthropic using your existing Claude Code sign-in. GitHub
91
- outcomes sync requires a configured token. [Privacy details](https://github.com/Doogit/AgentWrangler/blob/main/docs/privacy.md).
115
+ - Rate my setup's optional **Judge me** review sends a redacted summary of your setup to Claude
116
+ through your own `claude` CLI, only after you approve the exact payload. GitHub outcomes sync
117
+ requires a configured token. [Privacy details](https://github.com/Doogit/AgentWrangler/blob/main/docs/privacy.md).
92
118
  - Claude Code format changes can require parser updates. This is a single-user tool.
93
119
  - Windows local validation and Linux/macOS CI smoke coverage do not establish full native
94
- accessibility or credential-store compatibility on every platform.
120
+ accessibility or credential-store compatibility on every platform. The macOS Keychain and
121
+ Terminal.app Automation prompts have not been tested on a real Mac in 0.2.0.
122
+
123
+ ## How it works
124
+
125
+ ![How data moves through AgentWrangler: logs are read and priced, detectors find waste, and the dashboard serves recommendations](https://raw.githubusercontent.com/Doogit/AgentWrangler/main/docs/assets/how-it-works.png)
126
+
127
+ AgentWrangler is one local Node process. It tails Claude Code's log files (new lines every 2 s,
128
+ new files every 30 s), stores what it needs in SQLite at `~/.agentwrangler/db.sqlite`, and runs
129
+ detectors over the data to build recommendations. Long passes run in worker threads so the
130
+ dashboard stays responsive. The browser UI talks to the daemon at `127.0.0.1:2929`. There is no
131
+ separate service or scheduled task: stop the daemon and its background work stops.
132
+
133
+ [Background jobs, ingest, storage, detectors, API, and the privacy boundary](https://github.com/Doogit/AgentWrangler/blob/main/docs/how-it-works.md).
95
134
 
96
135
  ## Deeper documentation
97
136
 
137
+ [What's new](https://github.com/Doogit/AgentWrangler/blob/main/CHANGELOG.md) |
138
+ [In-app Help guide](https://github.com/Doogit/AgentWrangler/blob/main/docs/help/guide.md) |
98
139
  [Configuration](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#configuration) |
99
- [Architecture](https://github.com/Doogit/AgentWrangler/blob/main/docs/planning/AgentWrangler_Technical_Architecture_v4_5_0.md) |
140
+ [Architecture](https://github.com/Doogit/AgentWrangler/blob/main/docs/how-it-works.md) |
100
141
  [Data model and metrics](https://github.com/Doogit/AgentWrangler/blob/main/docs/planning/AgentWrangler_Data_Model_and_Metrics_v2.md) |
101
142
  [Contributing](https://github.com/Doogit/AgentWrangler/blob/main/.github/CONTRIBUTING.md) |
102
143
  [Security policy](https://github.com/Doogit/AgentWrangler/blob/main/.github/SECURITY.md)