Skip to content

Recipe completeness guard in _parse_recipe#2155

Merged
Trecek merged 1 commit into
developfrom
recipe-completeness-guard-in-parse-recipe/2063
May 7, 2026
Merged

Recipe completeness guard in _parse_recipe#2155
Trecek merged 1 commit into
developfrom
recipe-completeness-guard-in-parse-recipe/2063

Conversation

@Trecek
Copy link
Copy Markdown
Collaborator

@Trecek Trecek commented May 7, 2026

Summary

Add a _PARSE_RECIPE_HANDLED_FIELDS frozenset and import-time assertion to src/autoskillit/recipe/io.py, mirroring the existing _PARSE_STEP_HANDLED_FIELDS guard pattern. This ensures that any field added to the Recipe dataclass without a corresponding mapping in _parse_recipe() triggers an immediate RuntimeError at import time, preventing silent-default bugs like the one that occurred with requires_features (commit f3ef62bb4).

Three Recipe fields are computed post-load (content_hash, composite_hash, blocks) and are not mapped in _parse_recipe(). A separate _RECIPE_COMPUTED_FIELDS frozenset accounts for these so the assertion checks _PARSE_RECIPE_HANDLED_FIELDS | _RECIPE_COMPUTED_FIELDS == frozenset(Recipe.__dataclass_fields__).

Closes #2063

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260507-024534-284532/.autoskillit/temp/make-plan/recipe_completeness_guard_plan_2026-05-07_025300.md

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
plan claude-opus-4-6 1 68 6.0k 496.3k 53.3k 50 42.6k 3m 20s
verify claude-opus-4-6 1 1.3k 5.1k 528.9k 48.8k 50 35.9k 2m 56s
implement* MiniMax-M2.7-highspeed 1 301.7k 4.9k 592.2k 29.8k 44 16.1k 1m 53s
prepare_pr* MiniMax-M2.7-highspeed 1 57.5k 2.9k 178.5k 29.8k 18 42.1k 1m 13s
compose_pr* MiniMax-M2.7-highspeed 1 43.9k 1.1k 178.5k 29.8k 14 41.9k 36s
review_pr claude-sonnet-4-6 1 84 13.1k 345.4k 47.6k 32 36.4k 2m 56s
resolve_review claude-sonnet-4-6 1 253 12.9k 1.3M 62.9k 71 50.3k 4m 57s
Total 404.8k 46.1k 3.6M 62.9k 265.4k 17m 53s

* 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 62 9552.1 260.3 79.2
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 0
Total 62 58784.9 4280.6 743.8

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
claude-opus-4-6 2 1.4k 11.1k 1.0M 78.6k 6m 16s
MiniMax-M2.7-highspeed 3 403.1k 8.9k 949.3k 100.2k 3m 42s

Add _PARSE_RECIPE_HANDLED_FIELDS and _RECIPE_COMPUTED_FIELDS frozensets
with an import-time assertion in io.py, mirroring the existing
_PARSE_STEP_HANDLED_FIELDS guard pattern. This prevents silent-default
bugs when new fields are added to the Recipe dataclass without a
corresponding mapping in _parse_recipe().

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator Author

@Trecek Trecek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoSkillit PR Review — Verdict: approved_with_comments

Comment thread tests/recipe/test_io_parsing.py
Comment thread src/autoskillit/recipe/io.py
Copy link
Copy Markdown
Collaborator Author

@Trecek Trecek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoSkillit review: warning-only findings detected. See inline comments — no blocking changes required.

@Trecek Trecek added this pull request to the merge queue May 7, 2026
Merged via the queue into develop with commit 0d839dd May 7, 2026
2 checks passed
@Trecek Trecek deleted the recipe-completeness-guard-in-parse-recipe/2063 branch May 7, 2026 10:59
Trecek added a commit that referenced this pull request May 8, 2026
## Summary

Add a `_PARSE_RECIPE_HANDLED_FIELDS` frozenset and import-time assertion
to `src/autoskillit/recipe/io.py`, mirroring the existing
`_PARSE_STEP_HANDLED_FIELDS` guard pattern. This ensures that any field
added to the `Recipe` dataclass without a corresponding mapping in
`_parse_recipe()` triggers an immediate `RuntimeError` at import time,
preventing silent-default bugs like the one that occurred with
`requires_features` (commit `f3ef62bb4`).

Three `Recipe` fields are computed post-load (`content_hash`,
`composite_hash`, `blocks`) and are not mapped in `_parse_recipe()`. A
separate `_RECIPE_COMPUTED_FIELDS` frozenset accounts for these so the
assertion checks `_PARSE_RECIPE_HANDLED_FIELDS | _RECIPE_COMPUTED_FIELDS
== frozenset(Recipe.__dataclass_fields__)`.

Closes #2063

## Implementation Plan

Plan file:
`/home/talon/projects/autoskillit-runs/impl-20260507-024534-284532/.autoskillit/temp/make-plan/recipe_completeness_guard_plan_2026-05-07_025300.md`

🤖 Generated with [Claude Code](https://claude.com/claude-code) via
AutoSkillit
<!-- autoskillit:pipeline-signature
steps=prepare_pr,run_arch_lenses,compose_pr,annotate_pr_diff,review_pr
-->

## Token Usage Summary

| Step | Model | count | uncached | output | cache_read | peak_ctx |
turns | cache_write | time |

|------|-------|-------|----------|--------|------------|----------|-------|-------------|------|
| plan | claude-opus-4-6 | 1 | 68 | 6.0k | 496.3k | 53.3k | 50 | 42.6k |
3m 20s |
| verify | claude-opus-4-6 | 1 | 1.3k | 5.1k | 528.9k | 48.8k | 50 |
35.9k | 2m 56s |
| implement* | MiniMax-M2.7-highspeed | 1 | 301.7k | 4.9k | 592.2k |
29.8k | 44 | 16.1k | 1m 53s |
| prepare_pr* | MiniMax-M2.7-highspeed | 1 | 57.5k | 2.9k | 178.5k |
29.8k | 18 | 42.1k | 1m 13s |
| compose_pr* | MiniMax-M2.7-highspeed | 1 | 43.9k | 1.1k | 178.5k |
29.8k | 14 | 41.9k | 36s |
| **Total** | | | 404.4k | 20.0k | 2.0M | 53.3k | | 178.7k | 9m 58s |

\* *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 | 62 | 9552.1 | 260.3 | 79.2 |
| prepare_pr | 0 | — | — | — |
| compose_pr | 0 | — | — | — |
| **Total** | **62** | 31846.1 | 2882.9 | 323.4 |

## Model Usage Breakdown

| Model | steps | uncached | output | cache_read | cache_write | time |
|-------|-------|----------|--------|------------|-------------|------|
| claude-opus-4-6 | 2 | 1.4k | 11.1k | 1.0M | 78.6k | 6m 16s |
| MiniMax-M2.7-highspeed | 3 | 403.1k | 8.9k | 949.3k | 100.2k | 3m 42s
|

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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