codeburn/tests
AVSR Pavan Kumar b6bf233f46
feat(act): defer-* plan kinds for native deferral config (part 2 of #614) (#631)
* feat(optimize): mcp-deferral-gaps finding family

Add three read-only detectors for MCP tool-def deferral coverage gaps:

- mcp-deferral-off: sessions carrying MCP tool-def overhead with zero
  ToolSearch invocations and no deferred_tools_delta inventory across
  the window. Cause attribution, each with its own message and fix:
  stale ENABLE_TOOL_SEARCH=false (settings env, any scope, or shell
  profile), non-first-party ANTHROPIC_BASE_URL (reported as unknown
  proxy — never assumes capability), Vertex AI config, all observed
  Claude Code versions predating default-on tool search (v2.1.7), or
  a generic deferral-appears-inactive fallback.
- mcp-alwaysload-hygiene: alwaysLoad-pinned servers whose observed
  call rate is below 1 call per 5 sessions (named constant). Notes the
  5s startup-blocking cost of alwaysLoad in the explanation.
- mcp-defer-threshold: ENABLE_TOOL_SEARCH=auto/auto:N overrides whose
  threshold the estimated def volume never reaches, so tools load
  upfront; recommends the tightest auto:N that would defer.

Detection only: no FindingApply payloads, no act-layer changes, no
file mutation. Users without deferral gaps see zero new output —
deferral-active evidence (ToolSearch calls or inventory) suppresses
the findings, and each detector gates on conservative named
thresholds. Config readers take an injectable homeDir (PlanContext
style) for hermetic tests.

Discrepancies vs the design notes, codebase/live-docs win:
- The Claude Code changelog records default-on (2.1.7), not first
  ship, so the version cause uses the default-on boundary.
- Per-tool "anthropic/alwaysLoad" lives in server-served tool _meta,
  not static config; server-level only, limitation documented.
- Live docs confirm auto default threshold 10% of context window and
  the alwaysLoad v2.1.121+ requirement.

Refs getagentseal/codeburn#614

* feat(act): defer-* plan kinds for native deferral config

Wire the mcp-deferral-gaps findings to the act machinery with three
new plan kinds, all through the existing ConfigDocs/runAction path
(journaled, backed up, stale-guarded, dry-run previewable, undo
restores byte-identical files):

- defer-enable: removes a stale ENABLE_TOOL_SEARCH=false from the
  settings env of the scope where the finding recorded it. Refusal
  paths render as manual notes instead of plans: shell-profile lines
  (codeburn only appends marker blocks to shell files, never edits
  user lines), unknown proxies (setting the override blind makes
  requests fail outright on proxies that don't forward tool_reference
  blocks — the note says to verify first), Vertex, and old versions.
  A proxy-verified cause (set by the part-3 verifier) produces a real
  ENABLE_TOOL_SEARCH=true plan in user settings.
- defer-alwaysload: strips alwaysLoad: true from the named servers in
  the exact config files the finding recorded. Gated on an injectable
  installed-version probe (default: claude --version); below v2.1.121,
  unparseable, or probe failure all refuse with a note naming the
  required version. Preview notes the removed up-to-5s startup block.
- defer-threshold: rewrites the auto override to the recommended
  auto:N, or deletes it when the finding says the default already
  defers (removeOverride).

Findings now carry FindingApply payloads (path, scope, cause, servers,
recommended N); detector text is unchanged, so plain optimize renders
byte-identically to before. Every plan links its findingId into the
ActionRecord and states that changes take effect on the next session
(the config is read at Claude Code start).

Discrepancy vs the design notes: no existing version-check helper was
found in guard/ or act/ to reuse, so the detector's parseVersion/
versionPredates are exported and shared instead of adding a parallel
comparator.

Refs getagentseal/codeburn#614

---------

Co-authored-by: AgentSeal <hello@agentseal.org>
2026-07-16 19:01:54 -07:00
..
fixtures Merge origin/main into feat/desktop-app 2026-07-16 07:52:28 -07:00
providers copilot: extract skill invocations so Skills & Agents populates (#654) (#697) 2026-07-16 12:02:34 -07:00
security
setup feat: add CodeWhale provider support (#674) 2026-07-16 03:12:28 -07:00
sharing feat(dashboard): add granular session and model timelines (#673) 2026-07-16 03:04:54 -07:00
act-journal.test.ts
act-model-defaults.test.ts feat: implement act apply-model and report baseline tripwire (#607) (#616) 2026-07-16 11:10:08 -07:00
act-report.test.ts feat: implement act apply-model and report baseline tripwire (#607) (#616) 2026-07-16 11:10:08 -07:00
act-undo.test.ts
antigravity-statusline.test.ts
audit-report.test.ts
bash-commands.test.ts fix(bash): attribute wrapped commands to the real tool, not the wrapper (#658) 2026-07-10 06:36:07 -07:00
blob-to-text.test.ts
budget.test.ts feat(budget): spend budgets with overview display and scriptable --check (#562) 2026-07-16 11:10:16 -07:00
cache-persistence-coldstart.test.ts feat(app): refresh cadence, instant switching, cache coherence, telemetry v1 2026-07-16 11:47:05 -07:00
classifier.test.ts
cli-budget.test.ts feat(budget): spend budgets with overview display and scriptable --check (#562) 2026-07-16 11:10:16 -07:00
cli-date.test.ts
cli-deepseek-v4-pricing.test.ts
cli-devin-model-variants.test.ts
cli-emitters.test.ts feat(cli): add compare and sessions JSON emitters 2026-07-11 12:16:45 -07:00
cli-export-date-range.test.ts
cli-json-daily.test.ts
cli-model-savings.test.ts
cli-plan.test.ts
cli-price-override.test.ts
cli-provider-validation.test.ts
cli-proxy-path.test.ts
cli-settings-json.test.ts feat(cli): price-override --list --format json 2026-07-16 03:45:36 -07:00
cli-status-menubar.test.ts feat(cli): scan progress protocol, incremental cache saves, --no-timeline 2026-07-16 10:51:18 -07:00
codex-cache-invalidation.test.ts feat(app): refresh cadence, instant switching, cache coherence, telemetry v1 2026-07-16 11:47:05 -07:00
codex-credits.test.ts
compare-stats.test.ts fix(cli): compare cache-hit rate excludes cache writes 2026-07-16 01:14:41 -07:00
content-utils.test.ts
currency-rounding.test.ts fix(currency): resolve RON symbol to "lei" across all surfaces 2026-07-06 03:43:03 +03:00
daily-cache.test.ts fix: audit batch — prefetch one-shot, turn-anchored day bucketing, warm-path collapse 2026-07-16 15:37:03 -07:00
dashboard.test.ts feat(dashboard): make Daily Activity history directly scrollable (#672) 2026-07-16 04:10:08 -07:00
date-range-filter.test.ts
day-aggregator-savings.test.ts
day-aggregator.test.ts fix: audit batch — prefetch one-shot, turn-anchored day bucketing, warm-path collapse 2026-07-16 15:37:03 -07:00
defer-plans.test.ts feat(act): defer-* plan kinds for native deferral config (part 2 of #614) (#631) 2026-07-16 19:01:54 -07:00
devices-json.test.ts fix(cli): surface mDNS scan errors, robust spend-flow rollup + date label, harden tests 2026-07-10 16:20:41 -07:00
doctor.test.ts feat(doctor): per-provider detection diagnostics (#685) 2026-07-16 10:38:08 -07:00
export.test.ts feat(export): subagentType and model on per-record exports; --by-agent follow-ups (#712) 2026-07-16 16:35:33 -07:00
fetch-utils.test.ts
format-mark-estimated.test.ts fix(report): surface estimated costs distinctly (#688) 2026-07-16 10:46:21 -07:00
fs-utils.test.ts
granular-history.test.ts feat(dashboard): add granular session and model timelines (#673) 2026-07-16 03:04:54 -07:00
guard-hooks.test.ts feat(claude): account for /advisor escalations under the advisor model (#659) 2026-07-16 07:42:49 -07:00
guard-install.test.ts
hydration-interrupt-convergence.test.ts fix: hydration completeness markers, cold-only splash, honest switching, prefetch 2026-07-16 14:05:11 -07:00
kiro-cache-invalidation.test.ts feat(app): refresh cadence, instant switching, cache coherence, telemetry v1 2026-07-16 11:47:05 -07:00
local-model-savings.test.ts
mcp-coverage.test.ts
mcp-deferral.test.ts feat(act): defer-* plan kinds for native deferral config (part 2 of #614) (#631) 2026-07-16 19:01:54 -07:00
mcp-redact.test.ts feat(dashboard): add granular session and model timelines (#673) 2026-07-16 03:04:54 -07:00
mcp-server.test.ts
mcp-tables.test.ts
menubar-installer.test.ts Fix menubar install release lookup 2026-07-08 21:36:20 +02:00
menubar-json.test.ts Merge origin/main into feat/desktop-app 2026-07-16 07:52:28 -07:00
menubar-report-parity.test.ts fix: hydration completeness markers, cold-only splash, honest switching, prefetch 2026-07-16 14:05:11 -07:00
menubar-savings.test.ts
minimax.test.ts
model-efficiency.test.ts
models-hoist.test.ts
models-report.test.ts feat(export): subagentType and model on per-record exports; --by-agent follow-ups (#712) 2026-07-16 16:35:33 -07:00
models.test.ts fix(report): only exact zero-rate overrides suppress the unpriced flag 2026-07-09 21:22:23 +02:00
optimize-apply.test.ts
optimize-fs.test.ts
optimize-zero-edit-savings.test.ts optimize: bound zero-edit low-worth savings estimate to a recovery fraction (#640) (#691) 2026-07-16 11:09:44 -07:00
optimize.test.ts optimize: bound zero-edit low-worth savings estimate to a recovery fraction (#640) (#691) 2026-07-16 11:09:44 -07:00
otel-cache-aggregation.test.ts
overview.test.ts feat(budget): spend budgets with overview display and scriptable --check (#562) 2026-07-16 11:10:16 -07:00
parser-advisor-usage.test.ts feat(claude): account for /advisor escalations under the advisor model (#659) 2026-07-16 07:42:49 -07:00
parser-antigravity-timestamp.test.ts feat(app): refresh cadence, instant switching, cache coherence, telemetry v1 2026-07-16 11:47:05 -07:00
parser-claude-cwd.test.ts
parser-compact-entry.test.ts
parser-estimated-cost.test.ts fix(report): surface estimated costs distinctly (#688) 2026-07-16 10:46:21 -07:00
parser-filter.test.ts
parser-gemini-cache.test.ts feat(app): refresh cadence, instant switching, cache coherence, telemetry v1 2026-07-16 11:47:05 -07:00
parser-hydration-lock.test.ts fix: audit batch — prefetch one-shot, turn-anchored day bucketing, warm-path collapse 2026-07-16 15:37:03 -07:00
parser-large-json-scanner-parity.test.ts parser: dedupe the twin string/Buffer large-JSONL scanners (#698) 2026-07-16 12:23:06 -07:00
parser-large-json-scanner.test.ts
parser-large-session.test.ts
parser-local-savings.test.ts
parser-mcp-inventory.test.ts
parser-number-helpers.test.ts
parser-proxy-codex-only.test.ts
parser-proxy-merge.test.ts
parser-proxy-pricing.test.ts
parser-skip-line.test.ts
parser-subagent-collection.test.ts
parser.test.ts feat(app): refresh cadence, instant switching, cache coherence, telemetry v1 2026-07-16 11:47:05 -07:00
plan-usage.test.ts
plans.test.ts
pricing-fallback-data.test.ts feat(pricing): automatic gap-fill from models.dev and OpenRouter (#457) 2026-06-09 21:17:23 +02:00
provider-registry.test.ts feat: add CodeWhale provider support (#674) 2026-07-16 03:12:28 -07:00
provider-turn-grouping.test.ts kiro: preserve credit-based cost through the session cache 2026-07-14 22:35:51 +00:00
scan-progress.test.ts fix(parser): keep scan-progress out of the interactive dashboard and compare TUIs 2026-07-10 00:50:35 +02:00
session-cache.test.ts feat(app): refresh cadence, instant switching, cache coherence, telemetry v1 2026-07-16 11:47:05 -07:00
sessions-report.test.ts feat(cli): add compare and sessions JSON emitters 2026-07-11 12:16:45 -07:00
spend-flow.test.ts fix(cli): surface mDNS scan errors, robust spend-flow rollup + date label, harden tests 2026-07-10 16:20:41 -07:00
sync-e2e.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
sync-headless-e2e.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
sync-infra-e2e.test.ts test(sync): unit, mock-IdP e2e, and developer-only integration tests 2026-07-12 16:05:34 +00:00
sync-ledger-otlp.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
sync-push.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
sync.test.ts fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
token-estimate.test.ts Extract shared token estimation helper, migrate all CHARS_PER_TOKEN sites (#644) (#677) 2026-07-16 11:58:22 -07:00
usage-aggregator.test.ts feat(dashboard): add granular session and model timelines (#673) 2026-07-16 03:04:54 -07:00
web-dashboard.test.ts feat(dashboard): add granular session and model timelines (#673) 2026-07-16 03:04:54 -07:00
yield-overlap-attribution.test.ts yield: single-owner commit attribution, ambiguous bucket, heuristic caveat (#692) 2026-07-16 13:09:26 -07:00
yield-repo-grouping.test.ts fix(yield): group commit attribution by canonical repo, not launch path 2026-07-16 18:58:49 -07:00
yield.test.ts yield: single-owner commit attribution, ambiguous bucket, heuristic caveat (#692) 2026-07-16 13:09:26 -07:00