agentpack-cli 0.3.31__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.
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/PKG-INFO +23 -10
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/README.md +22 -9
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/pyproject.toml +1 -1
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/__init__.py +1 -1
- agentpack_cli-0.3.33/src/agentpack/analysis/broad_context.py +213 -0
- agentpack_cli-0.3.33/src/agentpack/analysis/context_intent.py +41 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/ranking.py +19 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/application/pack_service.py +113 -3
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/benchmark.py +2 -2
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/ci_cmd.py +2 -2
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/doctor.py +22 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/eval_cmd.py +121 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/hook_cmd.py +53 -8
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/init.py +2 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/learn.py +1 -1
- agentpack_cli-0.3.33/src/agentpack/commands/memory.py +144 -0
- agentpack_cli-0.3.33/src/agentpack/commands/perf.py +157 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/release_check.py +6 -4
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/review_cmd.py +181 -0
- agentpack_cli-0.3.33/src/agentpack/core/citations.py +540 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/config.py +18 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/context_pack.py +182 -46
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/evals.py +216 -2
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/models.py +43 -0
- agentpack_cli-0.3.33/src/agentpack/data/agentpack-review.md +46 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/.codex-plugin/plugin.json +5 -5
- agentpack_cli-0.3.33/src/agentpack/data/codex_plugin/.github/dependabot.yml +6 -0
- agentpack_cli-0.3.33/src/agentpack/data/codex_plugin/.github/workflows/hol-plugin-scanner.yml +26 -0
- agentpack_cli-0.3.33/src/agentpack/data/codex_plugin/skills/agentpack-review.md +42 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/review/stage1-understanding.md +6 -3
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/review/stage2-judge.md +6 -2
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/integrations/git_hooks.py +2 -1
- agentpack_cli-0.3.33/src/agentpack/learning/episodes.py +147 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/learning/extractor.py +80 -2
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/learning/models.py +11 -0
- agentpack_cli-0.3.33/src/agentpack/learning/quality.py +129 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/learning/renderers.py +33 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/mcp_server.py +48 -10
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/renderers/markdown.py +120 -4
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/router/prompt_builder.py +10 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/router/service.py +56 -19
- agentpack_cli-0.3.31/src/agentpack/commands/memory.py +0 -76
- agentpack_cli-0.3.31/src/agentpack/commands/perf.py +0 -69
- agentpack_cli-0.3.31/src/agentpack/data/agentpack-review.md +0 -31
- agentpack_cli-0.3.31/src/agentpack/data/codex_plugin/skills/agentpack-review.md +0 -27
- agentpack_cli-0.3.31/src/agentpack/learning/quality.py +0 -47
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/.gitignore +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/LICENSE +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/adapters/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/adapters/antigravity.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/adapters/base.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/adapters/claude.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/adapters/codex.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/adapters/cursor.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/adapters/detect.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/adapters/generic.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/adapters/windsurf.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/dependency_graph.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/go_imports.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/java_imports.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/js_ts_imports.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/monorepo.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/naming_signals.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/python_ast.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/python_imports.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/repo_map.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/role_inference.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/rust_imports.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/symbols.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/task_classifier.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/analysis/tests.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/application/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/cli.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/_shared.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/claude_cmd.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/compress_output.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/dashboard.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/dev_check.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/diagnose_selection.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/diff.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/explain.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/guard.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/ignore_cmd.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/install.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/mcp_cmd.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/migrate.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/monitor.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/next_cmd.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/pack.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/quickstart.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/release_cmd.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/repair.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/retrieve.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/route.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/scan.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/skills.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/start_cmd.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/state_cmd.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/stats.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/status.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/summarize.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/task_cmd.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/threads.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/tune.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/upgrade.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/verify_wheel.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/watch.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/workflow_cmd.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/commands/wrap.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/bootstrap.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/cache.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/changed_paths.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/command_surface.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/diff.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/e2e_benchmark.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/execution_state.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/git.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/git_hooks.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/global_install.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/ignore.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/loop_protocol.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/merkle.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/modes.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/pack_handoff.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/pack_registry.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/redactor.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/scanner.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/snapshot.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/structured_format.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/task_freshness.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/thread_context.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/token_estimator.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/toon_parser.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/core/vscode_tasks.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/dashboard/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/dashboard/collectors.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/dashboard/models.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/dashboard/renderers.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/agentpack-learn.md +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/agentpack.md +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/.codexignore +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/LICENSE +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/README.md +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/SECURITY.md +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/assets/icon.svg +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/assets/route-demo.svg +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack-learn.md +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack-pack.md +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack-refresh.md +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack-route.md +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/data/codex_plugin/skills/agentpack.md +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/installers/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/installers/antigravity.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/installers/claude.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/installers/codex.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/installers/cursor.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/installers/windsurf.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/integrations/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/integrations/agents.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/integrations/global_install.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/integrations/platform.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/integrations/vscode_tasks.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/learning/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/learning/collector.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/learning/feedback.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/learning/lesson_ranker.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/learning/provider.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/learning/skill_map.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/output_compression/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/output_compression/core.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/renderers/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/renderers/compact.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/renderers/receipts.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/renderers/toon.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/router/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/router/discovery.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/router/models.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/router/parser.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/router/scoring.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/router/skills_index.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/session/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/session/events.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/session/references.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/session/state.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/summaries/__init__.py +0 -0
- {agentpack_cli-0.3.31 → agentpack_cli-0.3.33}/src/agentpack/summaries/base.py +0 -0
- {agentpack_cli-0.3.31 → 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.
|
|
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/
|
|
@@ -164,7 +164,7 @@ agentpack task set "fix billing webhook retry handling"
|
|
|
164
164
|
agentpack pack --task auto
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks,
|
|
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.
|
|
168
168
|
It reuses cached file summaries and snapshot metadata so repeated packs do not start from zero.
|
|
169
169
|
|
|
170
170
|
## What AgentPack Gives Your Agent
|
|
@@ -174,28 +174,41 @@ It reuses cached file summaries and snapshot metadata so repeated packs do not s
|
|
|
174
174
|
- likely tests and commands
|
|
175
175
|
- repo rules and agent instructions
|
|
176
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
|
|
177
181
|
- cached summaries for faster repeated orientation
|
|
178
182
|
- omitted-file receipts for review
|
|
179
183
|
- freshness warnings when task or git state changes
|
|
180
184
|
- local benchmark data when selected context misses real changed files
|
|
181
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
|
+
|
|
182
195
|
## Proof So Far
|
|
183
196
|
|
|
184
|
-
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.
|
|
185
198
|
|
|
186
199
|
Current scoped result:
|
|
187
200
|
|
|
188
201
|
| Signal | Result | Developer meaning |
|
|
189
202
|
|---|---:|---|
|
|
190
|
-
| Public commit cases |
|
|
191
|
-
| Average recall |
|
|
192
|
-
| Token precision | 51.
|
|
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? |
|
|
193
206
|
| Pack p50 | 315 tokens | typical compact starting context |
|
|
194
207
|
| Pack p95 | 1,137 tokens | larger but still bounded starting context |
|
|
195
208
|
|
|
196
|
-
Source: [`benchmarks/results/2026-06-
|
|
209
|
+
Source: [`benchmarks/results/2026-06-25-public.md`](benchmarks/results/2026-06-25-public.md). Benchmark guide: [`docs/benchmarking.md`](docs/benchmarking.md).
|
|
197
210
|
|
|
198
|
-
This is useful but not magic. It says AgentPack often gets meaningful files into a small pack. It does not
|
|
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.
|
|
199
212
|
|
|
200
213
|
## What We Want To Prove Next
|
|
201
214
|
|
|
@@ -278,7 +291,7 @@ Do not use AgentPack when:
|
|
|
278
291
|
|
|
279
292
|
## How It Works
|
|
280
293
|
|
|
281
|
-
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.
|
|
282
295
|
|
|
283
296
|
It can expose the same workflow through CLI, markdown files, MCP tools, hooks, plugins, and CI.
|
|
284
297
|
|
|
@@ -333,7 +346,7 @@ pipx ensurepath
|
|
|
333
346
|
|
|
334
347
|
## Status
|
|
335
348
|
|
|
336
|
-
Alpha: `0.3.
|
|
349
|
+
Alpha: `0.3.33`.
|
|
337
350
|
|
|
338
351
|
Works, tested, and used in real sessions. Python and JavaScript/TypeScript have strongest support. APIs may change before 1.0.
|
|
339
352
|
|
|
@@ -117,7 +117,7 @@ agentpack task set "fix billing webhook retry handling"
|
|
|
117
117
|
agentpack pack --task auto
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks,
|
|
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.
|
|
121
121
|
It reuses cached file summaries and snapshot metadata so repeated packs do not start from zero.
|
|
122
122
|
|
|
123
123
|
## What AgentPack Gives Your Agent
|
|
@@ -127,28 +127,41 @@ It reuses cached file summaries and snapshot metadata so repeated packs do not s
|
|
|
127
127
|
- likely tests and commands
|
|
128
128
|
- repo rules and agent instructions
|
|
129
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
|
|
130
134
|
- cached summaries for faster repeated orientation
|
|
131
135
|
- omitted-file receipts for review
|
|
132
136
|
- freshness warnings when task or git state changes
|
|
133
137
|
- local benchmark data when selected context misses real changed files
|
|
134
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
|
+
|
|
135
148
|
## Proof So Far
|
|
136
149
|
|
|
137
|
-
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.
|
|
138
151
|
|
|
139
152
|
Current scoped result:
|
|
140
153
|
|
|
141
154
|
| Signal | Result | Developer meaning |
|
|
142
155
|
|---|---:|---|
|
|
143
|
-
| Public commit cases |
|
|
144
|
-
| Average recall |
|
|
145
|
-
| Token precision | 51.
|
|
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? |
|
|
146
159
|
| Pack p50 | 315 tokens | typical compact starting context |
|
|
147
160
|
| Pack p95 | 1,137 tokens | larger but still bounded starting context |
|
|
148
161
|
|
|
149
|
-
Source: [`benchmarks/results/2026-06-
|
|
162
|
+
Source: [`benchmarks/results/2026-06-25-public.md`](benchmarks/results/2026-06-25-public.md). Benchmark guide: [`docs/benchmarking.md`](docs/benchmarking.md).
|
|
150
163
|
|
|
151
|
-
This is useful but not magic. It says AgentPack often gets meaningful files into a small pack. It does not
|
|
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.
|
|
152
165
|
|
|
153
166
|
## What We Want To Prove Next
|
|
154
167
|
|
|
@@ -231,7 +244,7 @@ Do not use AgentPack when:
|
|
|
231
244
|
|
|
232
245
|
## How It Works
|
|
233
246
|
|
|
234
|
-
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.
|
|
235
248
|
|
|
236
249
|
It can expose the same workflow through CLI, markdown files, MCP tools, hooks, plugins, and CI.
|
|
237
250
|
|
|
@@ -286,7 +299,7 @@ pipx ensurepath
|
|
|
286
299
|
|
|
287
300
|
## Status
|
|
288
301
|
|
|
289
|
-
Alpha: `0.3.
|
|
302
|
+
Alpha: `0.3.33`.
|
|
290
303
|
|
|
291
304
|
Works, tested, and used in real sessions. Python and JavaScript/TypeScript have strongest support. APIs may change before 1.0.
|
|
292
305
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "agentpack-cli"
|
|
3
|
-
version = "0.3.
|
|
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"
|
|
@@ -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
|