agentpack-cli 0.3.30__tar.gz → 0.3.33__tar.gz

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 (193) hide show
  1. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/PKG-INFO +36 -12
  2. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/README.md +35 -11
  3. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/pyproject.toml +1 -1
  4. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/__init__.py +1 -1
  5. agentpack_cli-0.3.33/src/agentpack/analysis/broad_context.py +213 -0
  6. agentpack_cli-0.3.33/src/agentpack/analysis/context_intent.py +41 -0
  7. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/ranking.py +19 -0
  8. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/application/pack_service.py +113 -3
  9. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/benchmark.py +2 -2
  10. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/ci_cmd.py +2 -2
  11. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/doctor.py +22 -0
  12. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/eval_cmd.py +121 -0
  13. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/hook_cmd.py +53 -8
  14. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/init.py +2 -0
  15. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/learn.py +1 -1
  16. agentpack_cli-0.3.33/src/agentpack/commands/memory.py +144 -0
  17. agentpack_cli-0.3.33/src/agentpack/commands/perf.py +157 -0
  18. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/release_check.py +6 -4
  19. agentpack_cli-0.3.33/src/agentpack/commands/review_cmd.py +627 -0
  20. agentpack_cli-0.3.33/src/agentpack/core/citations.py +540 -0
  21. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/config.py +30 -0
  22. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/context_pack.py +182 -46
  23. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/evals.py +216 -2
  24. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/models.py +43 -0
  25. agentpack_cli-0.3.33/src/agentpack/core/pack_handoff.py +169 -0
  26. agentpack_cli-0.3.33/src/agentpack/core/structured_format.py +47 -0
  27. agentpack_cli-0.3.33/src/agentpack/core/toon_parser.py +165 -0
  28. agentpack_cli-0.3.33/src/agentpack/data/agentpack-review.md +46 -0
  29. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/.codex-plugin/plugin.json +9 -3
  30. agentpack_cli-0.3.33/src/agentpack/data/codex_plugin/.github/dependabot.yml +6 -0
  31. agentpack_cli-0.3.33/src/agentpack/data/codex_plugin/.github/workflows/hol-plugin-scanner.yml +26 -0
  32. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/README.md +11 -0
  33. agentpack_cli-0.3.33/src/agentpack/data/codex_plugin/assets/icon.svg +1 -0
  34. agentpack_cli-0.3.33/src/agentpack/data/codex_plugin/assets/route-demo.svg +1 -0
  35. agentpack_cli-0.3.33/src/agentpack/data/codex_plugin/skills/agentpack-review.md +42 -0
  36. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/review/stage1-understanding.md +7 -4
  37. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/review/stage2-judge.md +10 -6
  38. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/installers/antigravity.py +1 -0
  39. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/installers/claude.py +2 -0
  40. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/installers/codex.py +82 -0
  41. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/installers/cursor.py +1 -0
  42. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/installers/windsurf.py +1 -0
  43. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/integrations/agents.py +77 -3
  44. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/integrations/git_hooks.py +2 -1
  45. agentpack_cli-0.3.33/src/agentpack/learning/episodes.py +147 -0
  46. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/learning/extractor.py +80 -2
  47. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/learning/models.py +11 -0
  48. agentpack_cli-0.3.33/src/agentpack/learning/quality.py +129 -0
  49. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/learning/renderers.py +33 -0
  50. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/mcp_server.py +75 -31
  51. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/renderers/markdown.py +154 -12
  52. agentpack_cli-0.3.33/src/agentpack/renderers/toon.py +157 -0
  53. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/router/models.py +3 -0
  54. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/router/prompt_builder.py +16 -0
  55. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/router/service.py +79 -19
  56. agentpack_cli-0.3.30/src/agentpack/commands/memory.py +0 -76
  57. agentpack_cli-0.3.30/src/agentpack/commands/perf.py +0 -69
  58. agentpack_cli-0.3.30/src/agentpack/commands/review_cmd.py +0 -315
  59. agentpack_cli-0.3.30/src/agentpack/core/pack_handoff.py +0 -77
  60. agentpack_cli-0.3.30/src/agentpack/data/agentpack-review.md +0 -29
  61. agentpack_cli-0.3.30/src/agentpack/data/codex_plugin/assets/icon.svg +0 -10
  62. agentpack_cli-0.3.30/src/agentpack/data/codex_plugin/skills/agentpack-review.md +0 -25
  63. agentpack_cli-0.3.30/src/agentpack/learning/quality.py +0 -47
  64. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/.gitignore +0 -0
  65. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/LICENSE +0 -0
  66. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/adapters/__init__.py +0 -0
  67. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/adapters/antigravity.py +0 -0
  68. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/adapters/base.py +0 -0
  69. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/adapters/claude.py +0 -0
  70. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/adapters/codex.py +0 -0
  71. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/adapters/cursor.py +0 -0
  72. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/adapters/detect.py +0 -0
  73. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/adapters/generic.py +0 -0
  74. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/adapters/windsurf.py +0 -0
  75. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/__init__.py +0 -0
  76. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/dependency_graph.py +0 -0
  77. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/go_imports.py +0 -0
  78. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/java_imports.py +0 -0
  79. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/js_ts_imports.py +0 -0
  80. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/monorepo.py +0 -0
  81. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/naming_signals.py +0 -0
  82. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/python_ast.py +0 -0
  83. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/python_imports.py +0 -0
  84. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/repo_map.py +0 -0
  85. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/role_inference.py +0 -0
  86. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/rust_imports.py +0 -0
  87. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/symbols.py +0 -0
  88. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/task_classifier.py +0 -0
  89. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/analysis/tests.py +0 -0
  90. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/application/__init__.py +0 -0
  91. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/cli.py +0 -0
  92. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/__init__.py +0 -0
  93. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/_shared.py +0 -0
  94. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/claude_cmd.py +0 -0
  95. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/compress_output.py +0 -0
  96. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/dashboard.py +0 -0
  97. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/dev_check.py +0 -0
  98. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/diagnose_selection.py +0 -0
  99. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/diff.py +0 -0
  100. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/explain.py +0 -0
  101. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/guard.py +0 -0
  102. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/ignore_cmd.py +0 -0
  103. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/install.py +0 -0
  104. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/mcp_cmd.py +0 -0
  105. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/migrate.py +0 -0
  106. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/monitor.py +0 -0
  107. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/next_cmd.py +0 -0
  108. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/pack.py +0 -0
  109. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/quickstart.py +0 -0
  110. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/release_cmd.py +0 -0
  111. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/repair.py +0 -0
  112. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/retrieve.py +0 -0
  113. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/route.py +0 -0
  114. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/scan.py +0 -0
  115. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/skills.py +0 -0
  116. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/start_cmd.py +0 -0
  117. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/state_cmd.py +0 -0
  118. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/stats.py +0 -0
  119. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/status.py +0 -0
  120. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/summarize.py +0 -0
  121. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/task_cmd.py +0 -0
  122. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/threads.py +0 -0
  123. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/tune.py +0 -0
  124. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/upgrade.py +0 -0
  125. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/verify_wheel.py +0 -0
  126. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/watch.py +0 -0
  127. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/workflow_cmd.py +0 -0
  128. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/commands/wrap.py +0 -0
  129. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/__init__.py +0 -0
  130. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/bootstrap.py +0 -0
  131. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/cache.py +0 -0
  132. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/changed_paths.py +0 -0
  133. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/command_surface.py +0 -0
  134. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/diff.py +0 -0
  135. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/e2e_benchmark.py +0 -0
  136. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/execution_state.py +0 -0
  137. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/git.py +0 -0
  138. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/git_hooks.py +0 -0
  139. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/global_install.py +0 -0
  140. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/ignore.py +0 -0
  141. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/loop_protocol.py +0 -0
  142. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/merkle.py +0 -0
  143. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/modes.py +0 -0
  144. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/pack_registry.py +0 -0
  145. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/redactor.py +0 -0
  146. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/scanner.py +0 -0
  147. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/snapshot.py +0 -0
  148. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/task_freshness.py +0 -0
  149. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/thread_context.py +0 -0
  150. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/token_estimator.py +0 -0
  151. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/core/vscode_tasks.py +0 -0
  152. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/dashboard/__init__.py +0 -0
  153. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/dashboard/collectors.py +0 -0
  154. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/dashboard/models.py +0 -0
  155. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/dashboard/renderers.py +0 -0
  156. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/agentpack-learn.md +0 -0
  157. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/agentpack.md +0 -0
  158. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/.codexignore +0 -0
  159. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/LICENSE +0 -0
  160. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/SECURITY.md +0 -0
  161. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack-learn.md +0 -0
  162. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack-pack.md +0 -0
  163. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack-refresh.md +0 -0
  164. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack-route.md +0 -0
  165. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack.md +0 -0
  166. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/installers/__init__.py +0 -0
  167. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/integrations/__init__.py +0 -0
  168. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/integrations/global_install.py +0 -0
  169. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/integrations/platform.py +0 -0
  170. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/integrations/vscode_tasks.py +0 -0
  171. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/learning/__init__.py +0 -0
  172. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/learning/collector.py +0 -0
  173. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/learning/feedback.py +0 -0
  174. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/learning/lesson_ranker.py +0 -0
  175. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/learning/provider.py +0 -0
  176. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/learning/skill_map.py +0 -0
  177. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/output_compression/__init__.py +0 -0
  178. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/output_compression/core.py +0 -0
  179. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/renderers/__init__.py +0 -0
  180. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/renderers/compact.py +0 -0
  181. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/renderers/receipts.py +0 -0
  182. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/router/__init__.py +0 -0
  183. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/router/discovery.py +0 -0
  184. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/router/parser.py +0 -0
  185. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/router/scoring.py +0 -0
  186. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/router/skills_index.py +0 -0
  187. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/session/__init__.py +0 -0
  188. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/session/events.py +0 -0
  189. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/session/references.py +0 -0
  190. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/session/state.py +0 -0
  191. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/summaries/__init__.py +0 -0
  192. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/summaries/base.py +0 -0
  193. {agentpack_cli-0.3.30 → agentpack_cli-0.3.33}/src/agentpack/summaries/offline.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentpack-cli
3
- Version: 0.3.30
3
+ Version: 0.3.33
4
4
  Summary: Local context engine for AI coding agents that ranks relevant repo files and builds compact task-focused context packs for Claude Code, Codex, Cursor, Windsurf, MCP, and CI workflows.
5
5
  Project-URL: Homepage, https://github.com/vishal2612200/agentpack
6
6
  Project-URL: Documentation, https://vishal2612200.github.io/agentpack/
@@ -65,6 +65,8 @@ Description-Content-Type: text/markdown
65
65
  <a href="https://pepy.tech/projects/agentpack-cli"><img alt="PyPI downloads" src="https://static.pepy.tech/personalized-badge/agentpack-cli?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads"></a>
66
66
  <a href="https://www.npmjs.com/package/@vishal2612200/agentpack"><img alt="npm version" src="https://img.shields.io/npm/v/@vishal2612200/agentpack.svg"></a>
67
67
  <a href="https://www.npmjs.com/package/@vishal2612200/agentpack"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@vishal2612200/agentpack.svg"></a>
68
+ <a href="https://hol.org/registry/plugins/agentpack%2Fagentpack"><img alt="HOL trust score" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fhol.org%2Fapi%2Fregistry%2Fbadges%2Fplugin%3Fslug%3Dagentpack%252Fagentpack%26metric%3Dtrust%26style%3Dflat"></a>
69
+ <a href="https://hol.org/registry/plugins/agentpack%2Fagentpack"><img alt="HOL security score" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fhol.org%2Fapi%2Fregistry%2Fbadges%2Fplugin%3Fslug%3Dagentpack%252Fagentpack%26metric%3Dsecurity%26style%3Dflat"></a>
68
70
  <a href="https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml/badge.svg"></a>
69
71
  <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
70
72
  </p>
@@ -162,7 +164,7 @@ agentpack task set "fix billing webhook retry handling"
162
164
  agentpack pack --task auto
163
165
  ```
164
166
 
165
- AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks, and token stats.
167
+ AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks, token stats, and `.agentpack/citations.json` source provenance for the packed claims.
166
168
  It reuses cached file summaries and snapshot metadata so repeated packs do not start from zero.
167
169
 
168
170
  ## What AgentPack Gives Your Agent
@@ -172,28 +174,41 @@ It reuses cached file summaries and snapshot metadata so repeated packs do not s
172
174
  - likely tests and commands
173
175
  - repo rules and agent instructions
174
176
  - compact context pack under budget
177
+ - curated broad repo context for review/share/audit tasks without a separate bundle command
178
+ - citation-backed provenance for packed claims and review artifacts
179
+ - review preflight and staged review prompts for file-grounded PR review
180
+ - local memory, evaluation, and runtime/performance diagnostics for repeat workflows
175
181
  - cached summaries for faster repeated orientation
176
182
  - omitted-file receipts for review
177
183
  - freshness warnings when task or git state changes
178
184
  - local benchmark data when selected context misses real changed files
179
185
 
186
+ ## What's Current In 0.3.33
187
+
188
+ - Grounded broad context now supports review, sharing, audit, and repo-overview tasks with citation checks and scoped safety gates.
189
+ - Review workflows now push agents through preflight, understanding, and findings stages instead of letting review prompts answer inline.
190
+ - Pack and route fallbacks are stricter about stale context, missing MCP surfaces, and source provenance.
191
+ - The npm wrapper preserves the selected Python descriptor when creating the versioned CLI environment.
192
+ - Packaged Codex plugin metadata, docs URLs, and scanner automation now score cleanly in local HOL scans.
193
+ - Light fixture recall improved by keeping correlated source/deploy summaries and using concrete owner terms in fixture tasks.
194
+
180
195
  ## Proof So Far
181
196
 
182
- AgentPack's current public benchmark checks one narrow thing: whether selected context overlaps with files actually changed in historical commits.
197
+ AgentPack's current public benchmark checks one narrow thing: whether selected context overlaps with files actually changed in historical commits. Treat it as evidence for a ranked starting map, not proof that any agent will finish every task faster or better.
183
198
 
184
199
  Current scoped result:
185
200
 
186
201
  | Signal | Result | Developer meaning |
187
202
  |---|---:|---|
188
- | Public commit cases | 108 | real historical file-selection checks |
189
- | Average recall | 66.0% | did AgentPack include files that mattered? |
190
- | Token precision | 51.1% | how much of pack was useful instead of noise? |
203
+ | Public commit cases | 107 | real historical file-selection checks |
204
+ | Average recall | 65.7% | did AgentPack include files that mattered? |
205
+ | Token precision | 51.4% | how much of pack was useful instead of noise? |
191
206
  | Pack p50 | 315 tokens | typical compact starting context |
192
207
  | Pack p95 | 1,137 tokens | larger but still bounded starting context |
193
208
 
194
- Source: [`benchmarks/results/2026-06-14-public.md`](benchmarks/results/2026-06-14-public.md). Benchmark guide: [`docs/benchmarking.md`](docs/benchmarking.md).
209
+ Source: [`benchmarks/results/2026-06-25-public.md`](benchmarks/results/2026-06-25-public.md). Benchmark guide: [`docs/benchmarking.md`](docs/benchmarking.md).
195
210
 
196
- This is useful but not magic. It says AgentPack often gets meaningful files into a small pack. It does not claim every agent finishes faster or writes better code. Agent success A/B benchmarks should report task success, tool calls, token cost, and time-to-first-correct-file.
211
+ This is useful but not magic. It says AgentPack often gets meaningful files into a small pack. It does not replace source inspection, tests, runtime evidence, or review. Agent success A/B benchmarks should report task success, tool calls, token cost, validation quality, and time-to-first-correct-file.
197
212
 
198
213
  ## What We Want To Prove Next
199
214
 
@@ -227,10 +242,19 @@ Inside Codex:
227
242
  ```text
228
243
  @agentpack-route fix auth token expiry
229
244
  @agentpack-pack fix auth token expiry
230
- @agentpack-review
245
+ @agentpack-review focus on backward compatibility
231
246
  ```
232
247
 
233
- The plugin calls the local AgentPack engine. It does not upload code and does not turn AgentPack into a coding agent.
248
+ The Codex plugin calls the local AgentPack engine. Codex setup enables the
249
+ local `agentpack@local` bundle so commands like `@agentpack-review` match the
250
+ installed CLI version. Verify with `agentpack doctor --agent codex` after
251
+ upgrades.
252
+
253
+ The review flow prepares a local two-stage PR review bundle: preflight metadata,
254
+ a runbook, stage prompts, and branch-scoped understanding/findings JSON files.
255
+ It does not replace `gh pr view`, `git diff`, direct code reads, or tests.
256
+
257
+ AgentPack does not upload code and does not turn AgentPack into a coding agent.
234
258
 
235
259
  See [`docs/agent-plugins.md`](docs/agent-plugins.md) and [`docs/codex-plugin.md`](docs/codex-plugin.md).
236
260
 
@@ -267,7 +291,7 @@ Do not use AgentPack when:
267
291
 
268
292
  ## How It Works
269
293
 
270
- AgentPack scans repo locally, builds and reuses file summaries, indexes local skills and rules, combines filename, git, config, dependency, summary, and benchmark signals, ranks likely files for task, then renders a compact context pack.
294
+ AgentPack scans repo locally, builds and reuses file summaries, indexes local skills and rules, combines filename, git, config, dependency, summary, memory, and benchmark signals, ranks likely files for task, then renders a compact context pack. Review/share/audit tasks also get broad module summaries and inventory receipts in the same artifact.
271
295
 
272
296
  It can expose the same workflow through CLI, markdown files, MCP tools, hooks, plugins, and CI.
273
297
 
@@ -322,7 +346,7 @@ pipx ensurepath
322
346
 
323
347
  ## Status
324
348
 
325
- Alpha: `0.3.25`.
349
+ Alpha: `0.3.33`.
326
350
 
327
351
  Works, tested, and used in real sessions. Python and JavaScript/TypeScript have strongest support. APIs may change before 1.0.
328
352
 
@@ -18,6 +18,8 @@
18
18
  <a href="https://pepy.tech/projects/agentpack-cli"><img alt="PyPI downloads" src="https://static.pepy.tech/personalized-badge/agentpack-cli?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads"></a>
19
19
  <a href="https://www.npmjs.com/package/@vishal2612200/agentpack"><img alt="npm version" src="https://img.shields.io/npm/v/@vishal2612200/agentpack.svg"></a>
20
20
  <a href="https://www.npmjs.com/package/@vishal2612200/agentpack"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@vishal2612200/agentpack.svg"></a>
21
+ <a href="https://hol.org/registry/plugins/agentpack%2Fagentpack"><img alt="HOL trust score" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fhol.org%2Fapi%2Fregistry%2Fbadges%2Fplugin%3Fslug%3Dagentpack%252Fagentpack%26metric%3Dtrust%26style%3Dflat"></a>
22
+ <a href="https://hol.org/registry/plugins/agentpack%2Fagentpack"><img alt="HOL security score" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fhol.org%2Fapi%2Fregistry%2Fbadges%2Fplugin%3Fslug%3Dagentpack%252Fagentpack%26metric%3Dsecurity%26style%3Dflat"></a>
21
23
  <a href="https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml/badge.svg"></a>
22
24
  <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
23
25
  </p>
@@ -115,7 +117,7 @@ agentpack task set "fix billing webhook retry handling"
115
117
  agentpack pack --task auto
116
118
  ```
117
119
 
118
- AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks, and token stats.
120
+ AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks, token stats, and `.agentpack/citations.json` source provenance for the packed claims.
119
121
  It reuses cached file summaries and snapshot metadata so repeated packs do not start from zero.
120
122
 
121
123
  ## What AgentPack Gives Your Agent
@@ -125,28 +127,41 @@ It reuses cached file summaries and snapshot metadata so repeated packs do not s
125
127
  - likely tests and commands
126
128
  - repo rules and agent instructions
127
129
  - compact context pack under budget
130
+ - curated broad repo context for review/share/audit tasks without a separate bundle command
131
+ - citation-backed provenance for packed claims and review artifacts
132
+ - review preflight and staged review prompts for file-grounded PR review
133
+ - local memory, evaluation, and runtime/performance diagnostics for repeat workflows
128
134
  - cached summaries for faster repeated orientation
129
135
  - omitted-file receipts for review
130
136
  - freshness warnings when task or git state changes
131
137
  - local benchmark data when selected context misses real changed files
132
138
 
139
+ ## What's Current In 0.3.33
140
+
141
+ - Grounded broad context now supports review, sharing, audit, and repo-overview tasks with citation checks and scoped safety gates.
142
+ - Review workflows now push agents through preflight, understanding, and findings stages instead of letting review prompts answer inline.
143
+ - Pack and route fallbacks are stricter about stale context, missing MCP surfaces, and source provenance.
144
+ - The npm wrapper preserves the selected Python descriptor when creating the versioned CLI environment.
145
+ - Packaged Codex plugin metadata, docs URLs, and scanner automation now score cleanly in local HOL scans.
146
+ - Light fixture recall improved by keeping correlated source/deploy summaries and using concrete owner terms in fixture tasks.
147
+
133
148
  ## Proof So Far
134
149
 
135
- AgentPack's current public benchmark checks one narrow thing: whether selected context overlaps with files actually changed in historical commits.
150
+ AgentPack's current public benchmark checks one narrow thing: whether selected context overlaps with files actually changed in historical commits. Treat it as evidence for a ranked starting map, not proof that any agent will finish every task faster or better.
136
151
 
137
152
  Current scoped result:
138
153
 
139
154
  | Signal | Result | Developer meaning |
140
155
  |---|---:|---|
141
- | Public commit cases | 108 | real historical file-selection checks |
142
- | Average recall | 66.0% | did AgentPack include files that mattered? |
143
- | Token precision | 51.1% | how much of pack was useful instead of noise? |
156
+ | Public commit cases | 107 | real historical file-selection checks |
157
+ | Average recall | 65.7% | did AgentPack include files that mattered? |
158
+ | Token precision | 51.4% | how much of pack was useful instead of noise? |
144
159
  | Pack p50 | 315 tokens | typical compact starting context |
145
160
  | Pack p95 | 1,137 tokens | larger but still bounded starting context |
146
161
 
147
- Source: [`benchmarks/results/2026-06-14-public.md`](benchmarks/results/2026-06-14-public.md). Benchmark guide: [`docs/benchmarking.md`](docs/benchmarking.md).
162
+ Source: [`benchmarks/results/2026-06-25-public.md`](benchmarks/results/2026-06-25-public.md). Benchmark guide: [`docs/benchmarking.md`](docs/benchmarking.md).
148
163
 
149
- This is useful but not magic. It says AgentPack often gets meaningful files into a small pack. It does not claim every agent finishes faster or writes better code. Agent success A/B benchmarks should report task success, tool calls, token cost, and time-to-first-correct-file.
164
+ This is useful but not magic. It says AgentPack often gets meaningful files into a small pack. It does not replace source inspection, tests, runtime evidence, or review. Agent success A/B benchmarks should report task success, tool calls, token cost, validation quality, and time-to-first-correct-file.
150
165
 
151
166
  ## What We Want To Prove Next
152
167
 
@@ -180,10 +195,19 @@ Inside Codex:
180
195
  ```text
181
196
  @agentpack-route fix auth token expiry
182
197
  @agentpack-pack fix auth token expiry
183
- @agentpack-review
198
+ @agentpack-review focus on backward compatibility
184
199
  ```
185
200
 
186
- The plugin calls the local AgentPack engine. It does not upload code and does not turn AgentPack into a coding agent.
201
+ The Codex plugin calls the local AgentPack engine. Codex setup enables the
202
+ local `agentpack@local` bundle so commands like `@agentpack-review` match the
203
+ installed CLI version. Verify with `agentpack doctor --agent codex` after
204
+ upgrades.
205
+
206
+ The review flow prepares a local two-stage PR review bundle: preflight metadata,
207
+ a runbook, stage prompts, and branch-scoped understanding/findings JSON files.
208
+ It does not replace `gh pr view`, `git diff`, direct code reads, or tests.
209
+
210
+ AgentPack does not upload code and does not turn AgentPack into a coding agent.
187
211
 
188
212
  See [`docs/agent-plugins.md`](docs/agent-plugins.md) and [`docs/codex-plugin.md`](docs/codex-plugin.md).
189
213
 
@@ -220,7 +244,7 @@ Do not use AgentPack when:
220
244
 
221
245
  ## How It Works
222
246
 
223
- AgentPack scans repo locally, builds and reuses file summaries, indexes local skills and rules, combines filename, git, config, dependency, summary, and benchmark signals, ranks likely files for task, then renders a compact context pack.
247
+ AgentPack scans repo locally, builds and reuses file summaries, indexes local skills and rules, combines filename, git, config, dependency, summary, memory, and benchmark signals, ranks likely files for task, then renders a compact context pack. Review/share/audit tasks also get broad module summaries and inventory receipts in the same artifact.
224
248
 
225
249
  It can expose the same workflow through CLI, markdown files, MCP tools, hooks, plugins, and CI.
226
250
 
@@ -275,7 +299,7 @@ pipx ensurepath
275
299
 
276
300
  ## Status
277
301
 
278
- Alpha: `0.3.25`.
302
+ Alpha: `0.3.33`.
279
303
 
280
304
  Works, tested, and used in real sessions. Python and JavaScript/TypeScript have strongest support. APIs may change before 1.0.
281
305
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentpack-cli"
3
- version = "0.3.30"
3
+ version = "0.3.33"
4
4
  description = "Local context engine for AI coding agents that ranks relevant repo files and builds compact task-focused context packs for Claude Code, Codex, Cursor, Windsurf, MCP, and CI workflows."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -1,3 +1,3 @@
1
1
  """AgentPack — task-aware context packing for AI coding agents."""
2
2
 
3
- __version__ = "0.3.30"
3
+ __version__ = "0.3.33"
@@ -0,0 +1,213 @@
1
+ from __future__ import annotations
2
+
3
+ from collections import defaultdict
4
+ from pathlib import PurePosixPath
5
+ from typing import Any
6
+
7
+ from agentpack.core.citations import file_citation
8
+ from agentpack.core.models import BroadContext, Citation, FileInfo, ModuleSummary
9
+ from agentpack.core.token_estimator import estimate_tokens
10
+
11
+ _CONFIG_NAMES = {
12
+ "pyproject.toml", "package.json", "pnpm-workspace.yaml", "yarn.lock", "package-lock.json",
13
+ "requirements.txt", "poetry.lock", "setup.py", "setup.cfg", "tox.ini", "ruff.toml",
14
+ "tsconfig.json", "vite.config.ts", "next.config.js", "dockerfile", "docker-compose.yml",
15
+ }
16
+ _ENTRYPOINT_PARTS = ("main", "app", "cli", "server", "index", "routes", "router", "api")
17
+ _TEST_PARTS = ("test", "tests", "spec", "specs")
18
+ _DOC_EXTS = {".md", ".rst", ".txt"}
19
+
20
+
21
+ def build_broad_context(
22
+ *,
23
+ files: list[FileInfo],
24
+ summaries: dict[str, Any],
25
+ scored: list[tuple[Any, float, list[str]]],
26
+ intent: str,
27
+ max_module_summaries: int,
28
+ max_inventory_files: int,
29
+ budget_tokens: int,
30
+ ) -> BroadContext:
31
+ """Build curated broad repo context without extra file reads."""
32
+ if budget_tokens <= 0:
33
+ budget_tokens = 1_000
34
+ score_map = {fi.path: score for fi, score, _reasons in scored}
35
+ packable = sorted(
36
+ (fi for fi in files if not fi.ignored and not fi.binary),
37
+ key=lambda fi: (-score_map.get(fi.path, 0.0), fi.path),
38
+ )
39
+ entrypoints: list[str] = []
40
+ configs: list[str] = []
41
+ docs: list[str] = []
42
+ tests: list[str] = []
43
+ inventory: list[str] = []
44
+ omitted: list[str] = []
45
+
46
+ modules: dict[str, list[FileInfo]] = defaultdict(list)
47
+ for fi in packable:
48
+ module = _module_for(fi.path)
49
+ modules[module].append(fi)
50
+ category = _category(fi.path)
51
+ if category == "entrypoint" and len(entrypoints) < 25:
52
+ entrypoints.append(fi.path)
53
+ elif category == "config" and len(configs) < 25:
54
+ configs.append(fi.path)
55
+ elif category == "doc" and len(docs) < 25:
56
+ docs.append(fi.path)
57
+ elif category == "test" and len(tests) < 25:
58
+ tests.append(fi.path)
59
+ if len(inventory) < max_inventory_files:
60
+ inventory.append(fi.path)
61
+ else:
62
+ omitted.append(fi.path)
63
+
64
+ ranked_modules = sorted(
65
+ modules.items(),
66
+ key=lambda item: (-_module_score(item[1], score_map), item[0]),
67
+ )
68
+ module_summaries: list[ModuleSummary] = []
69
+ for module, module_files in ranked_modules[:max_module_summaries]:
70
+ module_summaries.append(_summarize_module(module, module_files, summaries, score_map))
71
+ for module, module_files in ranked_modules[max_module_summaries:]:
72
+ omitted.extend(fi.path for fi in module_files[:3])
73
+
74
+ context = BroadContext(
75
+ intent=intent,
76
+ inventory_files=len(packable),
77
+ module_summaries=module_summaries,
78
+ entrypoints=_dedupe(entrypoints),
79
+ configs=_dedupe(configs),
80
+ docs=_dedupe(docs),
81
+ tests=_dedupe(tests),
82
+ inventory=_dedupe(inventory),
83
+ semantic_clusters=_semantic_clusters(packable, summaries, score_map),
84
+ omitted_by_budget=_dedupe(omitted),
85
+ citations=_inventory_citations(packable, inventory),
86
+ )
87
+ return _trim_to_budget(context, budget_tokens)
88
+
89
+
90
+ def _module_for(path: str) -> str:
91
+ parts = PurePosixPath(path).parts
92
+ if not parts:
93
+ return "."
94
+ if parts[0] in {"src", "tests", "docs"} and len(parts) > 1:
95
+ return "/".join(parts[:2])
96
+ if parts[0] in {"apps", "packages", "services", "libs"} and len(parts) > 1:
97
+ return "/".join(parts[:2])
98
+ return parts[0]
99
+
100
+
101
+ def _category(path: str) -> str:
102
+ lower = path.lower()
103
+ name = lower.rsplit("/", 1)[-1]
104
+ suffix = PurePosixPath(lower).suffix
105
+ parts = set(PurePosixPath(lower).parts)
106
+ stem = PurePosixPath(lower).stem
107
+ if name in _CONFIG_NAMES or "config" in stem:
108
+ return "config"
109
+ if suffix in _DOC_EXTS:
110
+ return "doc"
111
+ if parts & set(_TEST_PARTS) or stem.startswith("test_") or stem.endswith("_test") or stem.endswith(".test"):
112
+ return "test"
113
+ if any(part in stem for part in _ENTRYPOINT_PARTS):
114
+ return "entrypoint"
115
+ return "file"
116
+
117
+
118
+ def _module_score(files: list[FileInfo], score_map: dict[str, float]) -> float:
119
+ return sum(score_map.get(fi.path, 0.0) for fi in files[:20]) + min(len(files), 20)
120
+
121
+
122
+ def _summarize_module(
123
+ module: str,
124
+ files: list[FileInfo],
125
+ summaries: dict[str, Any],
126
+ score_map: dict[str, float],
127
+ ) -> ModuleSummary:
128
+ ordered = sorted(files, key=lambda fi: (-score_map.get(fi.path, 0.0), fi.path))
129
+ languages = sorted({fi.language for fi in files if fi.language})[:6]
130
+ key_files = [fi.path for fi in ordered[:8]]
131
+ roles: list[str] = []
132
+ for fi in ordered[:12]:
133
+ summary = summaries.get(fi.path) or {}
134
+ role = summary.get("role") or summary.get("domain") or summary.get("summary")
135
+ if isinstance(role, str) and role.strip():
136
+ roles.append(role.strip().splitlines()[0][:120])
137
+ text = "; ".join(_dedupe(roles)[:3])
138
+ return ModuleSummary(
139
+ path=module,
140
+ files=len(files),
141
+ tokens=sum(fi.estimated_tokens for fi in files),
142
+ languages=languages,
143
+ key_files=key_files,
144
+ summary=text or "Repository area with no cached semantic summary yet.",
145
+ citations=[
146
+ file_citation(
147
+ fi,
148
+ kind="summary",
149
+ claim_id=f"module:{module}:{fi.path}",
150
+ note=f"module summary source for {module}",
151
+ )
152
+ for fi in ordered[:5]
153
+ ],
154
+ )
155
+
156
+
157
+ def _semantic_clusters(
158
+ files: list[FileInfo],
159
+ summaries: dict[str, Any],
160
+ score_map: dict[str, float],
161
+ limit: int = 12,
162
+ ) -> list[str]:
163
+ buckets: dict[str, list[str]] = defaultdict(list)
164
+ for fi in sorted(files, key=lambda item: (-score_map.get(item.path, 0.0), item.path)):
165
+ summary = summaries.get(fi.path) or {}
166
+ label = summary.get("role") or summary.get("domain")
167
+ if not isinstance(label, str) or not label.strip():
168
+ continue
169
+ key = label.strip().splitlines()[0][:60]
170
+ if len(buckets[key]) < 6:
171
+ buckets[key].append(fi.path)
172
+ ranked = sorted(buckets.items(), key=lambda item: (-len(item[1]), item[0]))[:limit]
173
+ return [f"{label}: " + ", ".join(paths) for label, paths in ranked]
174
+
175
+
176
+ def _trim_to_budget(context: BroadContext, budget_tokens: int) -> BroadContext:
177
+ while estimate_tokens(context.model_dump_json()) > budget_tokens and context.module_summaries:
178
+ context.omitted_by_budget.extend(context.module_summaries.pop().key_files[:3])
179
+ while estimate_tokens(context.model_dump_json()) > budget_tokens and context.inventory:
180
+ context.omitted_by_budget.append(context.inventory.pop())
181
+ while estimate_tokens(context.model_dump_json()) > budget_tokens and context.semantic_clusters:
182
+ context.semantic_clusters.pop()
183
+ if len(context.omitted_by_budget) > 100:
184
+ context.omitted_by_budget = context.omitted_by_budget[:100]
185
+ return context
186
+
187
+
188
+ def _dedupe(values: list[str]) -> list[str]:
189
+ seen: set[str] = set()
190
+ out: list[str] = []
191
+ for value in values:
192
+ if value not in seen:
193
+ seen.add(value)
194
+ out.append(value)
195
+ return out
196
+
197
+
198
+ def _inventory_citations(files: list[FileInfo], inventory: list[str]) -> list[Citation]:
199
+ by_path = {fi.path: fi for fi in files}
200
+ citations: list[Citation] = []
201
+ for path in inventory[:25]:
202
+ fi = by_path.get(path)
203
+ if fi is None:
204
+ continue
205
+ citations.append(
206
+ file_citation(
207
+ fi,
208
+ kind="summary",
209
+ claim_id=f"broad-context:{path}",
210
+ note="broad context inventory source",
211
+ )
212
+ )
213
+ return citations
@@ -0,0 +1,41 @@
1
+ from __future__ import annotations
2
+
3
+ import re
4
+ from typing import Literal
5
+
6
+
7
+ ContextIntent = Literal["coding_task", "review", "share", "repo_overview", "audit"]
8
+
9
+ _AUDIT_TERMS = ("audit", "security review", "risk review", "architecture review")
10
+ _REVIEW_TERMS = ("review", "pr", "pull request", "code review")
11
+ _SHARE_TERMS = ("share", "handoff", "promptable artifact", "broad context")
12
+ _OVERVIEW_TERMS = ("repo overview", "repository overview", "explain repo", "understand repo", "map repo")
13
+
14
+
15
+ def infer_context_intent(task: str, *, task_mode: str | None = None) -> ContextIntent:
16
+ text = " ".join((task or "").lower().replace("_", " ").replace("-", " ").split())
17
+ mode = (task_mode or "").lower()
18
+ if mode == "pr_review" or _has_any(text, _REVIEW_TERMS):
19
+ if _has_any(text, _AUDIT_TERMS):
20
+ return "audit"
21
+ return "review"
22
+ if _has_any(text, _AUDIT_TERMS):
23
+ return "audit"
24
+ if _has_any(text, _SHARE_TERMS):
25
+ return "share"
26
+ if _has_any(text, _OVERVIEW_TERMS):
27
+ return "repo_overview"
28
+ return "coding_task"
29
+
30
+
31
+ def broad_context_enabled(config_value: str, intent: ContextIntent) -> bool:
32
+ value = (config_value or "auto").strip().lower()
33
+ if value == "off":
34
+ return False
35
+ if value == "on":
36
+ return True
37
+ return intent in {"review", "share", "repo_overview", "audit"}
38
+
39
+
40
+ def _has_any(text: str, terms: tuple[str, ...]) -> bool:
41
+ return any(re.search(rf"(?<![a-z0-9_]){re.escape(term)}(?![a-z0-9_])", text) for term in terms)
@@ -283,6 +283,11 @@ _FILENAME_CORROBORATION_PREFIXES = (
283
283
  "workspace match",
284
284
  )
285
285
 
286
+ _GENERATED_AGENT_ARTIFACT_PREFIXES = (
287
+ ".agentpack/",
288
+ ".agent/",
289
+ )
290
+
286
291
 
287
292
  def _add_keyword_weight(weights: dict[str, float], keyword: str, weight: float) -> None:
288
293
  weights[keyword] = max(weights.get(keyword, 0.0), weight)
@@ -1277,6 +1282,16 @@ def _has_strong_structural_reason(reasons: list[str]) -> bool:
1277
1282
  )
1278
1283
 
1279
1284
 
1285
+ def _is_generated_agent_artifact(path: str) -> bool:
1286
+ return path.startswith(_GENERATED_AGENT_ARTIFACT_PREFIXES)
1287
+
1288
+
1289
+ def _generated_agent_artifact_score(score: float, *, changed: bool) -> float:
1290
+ if changed:
1291
+ return min(score, 160.0)
1292
+ return min(score * 0.25, 80.0)
1293
+
1294
+
1280
1295
  def _keyword_only_false_positive(path: str, reasons: list[str], content_hits: int) -> bool:
1281
1296
  if _is_test_file(path):
1282
1297
  return False
@@ -1617,6 +1632,10 @@ def score_files(
1617
1632
  score = max(0.0, score * 0.72)
1618
1633
  reasons.append("likely false positive: keyword-only match")
1619
1634
 
1635
+ if _is_generated_agent_artifact(fi.path):
1636
+ score = _generated_agent_artifact_score(score, changed=fi.path in changed_paths)
1637
+ reasons.append("generated agent artifact dampening")
1638
+
1620
1639
  results.append((fi, score, reasons))
1621
1640
 
1622
1641
  return results