Skip to content

Rectify: Note/With Block Consistency — Semantic Rule Immunity - #4460

Merged
Trecek merged 7 commits into
developfrom
impl-rectify-note-with-consistency-20260804-113118
Aug 4, 2026
Merged

Rectify: Note/With Block Consistency — Semantic Rule Immunity#4460
Trecek merged 7 commits into
developfrom
impl-rectify-note-with-consistency-20260804-113118

Conversation

@Trecek

@Trecek Trecek commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Recipe note: fields (LLM prompts consumed by the orchestrator) can silently contradict their step's with: block after a migration rewrites the structured invocation shape but leaves the prose stale. The contradiction causes a wasted run_skill round-trip: the orchestrator follows the note's stale instruction, the runtime binder rejects the shape mismatch (recipe_execution_static_tool_mismatch), and recovery depends on the orchestrator improvising from a free-text error message.

This PR delivers architectural immunity: a semantic rule that catches note/with contradictions at recipe validation time, plus fixes for all four existing stale-note defects.

Changes

New semantic rule — note-shape-contradiction

  • src/autoskillit/recipe/rules/rules_note_shape_contradiction.py: Six detection patterns covering append/embed/concatenate/replace verbs and inline-arg examples (both quoted and unquoted). Fires at Severity.ERROR — blocks recipe validation.
  • Two-layer gate: Only fires when the step has migrated to the compiled-template shape (skill_inputs in with_args) AND skill_command is static (excludes dynamic command-name templates like /autoskillit:arch-lens-{slug}).
  • Registered in recipe/__init__.py alphabetically among existing rule imports.

Fixed stale notes (4 bundled recipes)

Recipe Step Contradiction
remediation.yaml investigate Note said "append to skill_command" — issue URL is passed via skill_inputs.topic
implementation-groups.yaml plan Note said "append to skill_command" for issue_url and adversarial_review_level — both are skill_inputs keys
merge-prs.yaml merge_pr Note said "Appends to skill_command" for pr_number and complexity — both are skill_inputs keys
research.yaml plan_phase Note said "Replace in skill_command" for group_files — passed via skill_inputs.task

All notes now correctly describe the structured skill_inputs shape and explicitly instruct not to modify skill_command. Compiled JSON regenerated for all four recipes.

Tests

  • tests/recipe/test_rules_note_shape_contradiction.py: 6 synthetic test cases covering detection and false-positive exclusion.
  • tests/recipe/test_note_with_consistency.py: Bundled recipe integrity test parametrized over all_validated_recipe_paths() (all 15+ recipes).

Investigation Reference

.autoskillit/temp/rectify/rectify_note_with_consistency_2026-08-04_174500.md

🤖 Generated with Claude Code

Closes #4456

Trecek and others added 7 commits August 4, 2026 13:49
Add a new semantic rule that detects note/with_args shape contradictions
at recipe validation time. When a run_skill step has structured
skill_inputs in its with: block but its note: instructs inline-arg
concatenation into skill_command, the rule flags this as an ERROR —
preventing wasted run_skill round-trips that would be rejected by the
runtime binder.

Includes:
- rules_note_shape_contradiction.py: six detection patterns covering
  append/embed/concatenate/replace verbs and inline-arg examples
- Rule registration in recipe/__init__.py
- Unit tests with synthetic steps (6 cases)
- Bundled recipe integrity test parametrized over all validated recipes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix note/with_args shape contradictions in:
- remediation.yaml investigate step: note said "append to skill_command"
  but issue URL is passed via skill_inputs.topic
- implementation-groups.yaml plan step: note said "append to skill_command"
  for issue_url and adversarial_review_level, both are skill_inputs keys
- merge-prs.yaml merge_pr step: note said "Appends to skill_command"
  for pr_number and complexity, both are skill_inputs keys
- research.yaml plan_phase step: note said "Replace in skill_command"
  for group_files, which is passed via skill_inputs.task

All notes now correctly describe the structured skill_inputs shape and
explicitly instruct not to modify skill_command.

Includes regenerated compiled JSON for all four recipes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test_no_skills_extended_skill_uses_autoskillit_prefix contract test
requires source files to use /merge-pr (not /autoskillit:merge-pr) for
skills_extended skills. Updated the comment in the rule module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Trecek
Trecek force-pushed the impl-rectify-note-with-consistency-20260804-113118 branch from 18412ef to 76c63df Compare August 4, 2026 21:04
@Trecek
Trecek enabled auto-merge August 4, 2026 21:07
@Trecek
Trecek added this pull request to the merge queue Aug 4, 2026
Merged via the queue into develop with commit b304d3d Aug 4, 2026
3 checks passed
@Trecek
Trecek deleted the impl-rectify-note-with-consistency-20260804-113118 branch August 4, 2026 21:20
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