Skip to content

Implementation Plan: T5-P4-A6-WP1 Enforce the contract — remove _FORWARD_DECLARED exemption, add capability gate branch coverage#4100

Merged
Trecek merged 3 commits into
developfrom
t5-p4-a6-wp1-enforce-the-contract-once-p2-a1-wp3-lands-its-c/4023-2
Jun 13, 2026
Merged

Implementation Plan: T5-P4-A6-WP1 Enforce the contract — remove _FORWARD_DECLARED exemption, add capability gate branch coverage#4100
Trecek merged 3 commits into
developfrom
t5-p4-a6-wp1-enforce-the-contract-once-p2-a1-wp3-lands-its-c/4023-2

Conversation

@Trecek

@Trecek Trecek commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add a capability gate to classify_infra_exit so context exhaustion detection is only applied when the backend declares supports_context_exhaustion_detection=True. This creates a production consumer of the BackendCapabilities field, allowing its removal from _FORWARD_DECLARED. Two new branch tests verify the gate: capability=False suppresses CONTEXT_EXHAUSTED, capability=True produces it.

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260612-190625-055731/.autoskillit/temp/make-plan/t5_p4_a6_wp1_enforce_contract_plan_2026-06-12_192600.md

Closes #4023

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
plan* opus[1m] 1 1.8k 23.0k 1.5M 112.6k 45 113.9k 13m 22s
verify* sonnet 1 68 10.8k 351.2k 61.7k 23 40.8k 4m 29s
implement* MiniMax-M3 1 1.4M 6.2k 0 0 58 0 3m 57s
fix* sonnet 1 134 6.0k 792.8k 64.1k 38 43.2k 5m 23s
audit_impl* sonnet 1 498 6.3k 205.4k 41.8k 19 26.8k 3m 31s
prepare_pr* MiniMax-M3 1 188.4k 2.4k 0 0 11 0 46s
compose_pr* MiniMax-M3 1 176.3k 1.3k 0 0 13 0 47s
review_pr* sonnet 1 140 27.4k 846.6k 74.2k 44 53.9k 5m 56s
resolve_review* sonnet 1 327 12.3k 2.5M 78.8k 84 57.9k 6m 53s
Total 1.8M 95.7k 6.2M 112.6k 336.5k 45m 8s

* Step used a non-Anthropic provider; caching behavior may differ.

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
plan 0
verify 0
implement 65 0.0 0.0 95.8
fix 4 198190.8 10791.0 1493.5
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 31 81158.6 1867.5 397.7
Total 100 61812.1 3365.3 957.3

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 1.8k 23.0k 1.5M 113.9k 13m 22s
sonnet 5 1.2k 62.8k 4.7M 222.6k 26m 15s
MiniMax-M3 3 1.8M 9.9k 0 0 5m 30s

Trecek and others added 3 commits June 12, 2026 19:27
…on detection

Gate the two context-exhaustion checks in classify_infra_exit on
supports_context_exhaustion_detection. When the caller passes a
BackendCapabilities object, the gate is enforced; when capabilities is
None (default), detection remains enabled for backward compatibility.

- Add capabilities keyword-only param to classify_infra_exit
- Production call site (_headless_result.py:554) passes backend.capabilities
- Remove supports_context_exhaustion_detection from _FORWARD_DECLARED
  and NOT_YET_LIVE exemption sets (now has a production consumer)
- Add TestContextExhaustionCapabilityGate covering both gate branches

Plan: T5-P4-A6-WP1
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ility gate

The capability gate in classify_infra_exit wraps both the JSONL check and the
_CODEX_CONTEXT_EXHAUSTION_PATTERN stderr check, but only the JSONL path was
exercised in TestContextExhaustionCapabilityGate. Add two tests that exercise
the stderr path: one verifying capability=False suppresses it, one verifying
capability=True detects it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Trecek Trecek added this pull request to the merge queue Jun 13, 2026
Merged via the queue into develop with commit 6c1a806 Jun 13, 2026
3 checks passed
@Trecek Trecek deleted the t5-p4-a6-wp1-enforce-the-contract-once-p2-a1-wp3-lands-its-c/4023-2 branch June 13, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant