Document Missing ToolContext Protocol-Typed Fields#3898
Merged
Trecek merged 5 commits intoJun 8, 2026
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add docstring entries for the 10 undocumented protocol-typed service fields on
ToolContext(lines 68–116 ofpipeline/context.py), fix 3 stale hardcoded service-field counts inserver/_factory.pyandserver/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.mdCloses #3769
🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown