Skip to content

Document Missing ToolContext Protocol-Typed Fields#3898

Merged
Trecek merged 5 commits into
developfrom
document-missing-toolcontext-protocol-typed-fields/3769
Jun 8, 2026
Merged

Document Missing ToolContext Protocol-Typed Fields#3898
Trecek merged 5 commits into
developfrom
document-missing-toolcontext-protocol-typed-fields/3769

Conversation

@Trecek

@Trecek Trecek commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add docstring entries for the 10 undocumented protocol-typed service fields on ToolContext (lines 68–116 of pipeline/context.py), fix 3 stale hardcoded service-field counts in server/_factory.py and server/CLAUDE.md, and add an architectural test enforcing that every protocol-typed field is documented in the docstring going forward.

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260607-214120-720004/.autoskillit/temp/make-plan/document_missing_toolcontext_protocol_fields_plan_2026-06-07_215200.md

Closes #3769

🤖 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 60 7.2k 846.5k 69.0k 31 49.8k 6m 57s
verify* sonnet 1 92 15.2k 507.7k 58.8k 29 37.2k 5m 15s
implement* MiniMax-M3 1 66.4k 11.6k 1.1M 73.7k 46 0 4m 28s
audit_impl* sonnet 1 1.7k 7.2k 167.9k 41.2k 14 26.0k 3m 30s
prepare_pr* MiniMax-M3 1 39.4k 1.7k 157.2k 42.2k 12 0 59s
compose_pr* MiniMax-M3 1 37.1k 1.2k 187.8k 39.3k 14 0 39s
Total 144.8k 44.2k 2.9M 73.7k 113.0k 21m 49s

* 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 78 13512.9 0.0 149.3
audit_impl 0
prepare_pr 0
compose_pr 0
Total 78 37447.7 1448.4 566.2

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 60 7.2k 846.5k 49.8k 6m 57s
sonnet 2 1.8k 22.4k 675.5k 63.2k 8m 46s
MiniMax-M3 3 142.9k 14.5k 1.4M 0 6m 6s

Trecek and others added 5 commits June 7, 2026 21:58
Add docstring entries for github_api_log, background, the five contract
resolvers (output_pattern, write_expected, read_only, input_contract,
completion_required), quota_refresh_task, fleet_lock, and
build_protected_campaign_ids. Closes the doc/code drift flagged by
audit-arch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ness

Adds test_toolcontext_protocol_fields_documented_in_docstring which
discovers all protocol-typed fields on ToolContext and asserts each has
a corresponding entry in the Fields section of the class docstring.
Self-closing: any future protocol-typed field added without docstring
documentation will fail this test.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The ToolContext DI container has 24 protocol-typed service fields
(field(default=None)), not 23. Refresh the docstrings in
server/_factory.py and server/CLAUDE.md to reflect the current count.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The parser now scans for the first non-empty, non-dashes line after the
Fields header rather than assuming exactly one separator line follows.
`not stripped.startswith(" ")` is always True after strip() — use the
raw `line` to correctly skip indented continuation lines when parsing
the ToolContext Fields docstring section.
@Trecek Trecek added this pull request to the merge queue Jun 8, 2026
Merged via the queue into develop with commit 3afd773 Jun 8, 2026
3 checks passed
@Trecek Trecek deleted the document-missing-toolcontext-protocol-typed-fields/3769 branch June 8, 2026 05:36
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