Implementation Plan: Remediation — source-dir-enforcement-seam Part A#4201
Merged
Trecek merged 7 commits intoJul 7, 2026
Merged
Conversation
…NGREDIENTS discriminator The fleet dispatch path (apply_config_authoritative_overrides) was using `ing.authority == "config"` as its discriminator — the same as the recipe schema annotation — which is too broad. This caused source_dir to be silently replaced with the git remote URL from resolve_ingredient_defaults, killing bootstrap_clone within 90 seconds of any fleet dispatch on a recipe that declared source_dir with authority: config. - Change A2: Import BACKEND_CAPABILITY_INGREDIENTS from autoskillit.core - Change A1: Replace the monolithic overwrite loop with a three-branch structure using the correct discriminator for each key class: SERVER_AUTHORITATIVE_INGREDIENTS (server-owned), BACKEND_CAPABILITY_INGREDIENTS (backend-owned), and the implicit caller-sovereign branch (no-op for source_dir) - Change A3 + T1-T3: Add three new tests exposing the bug (source_dir preservation, no URL injection when absent, only-mutates-enforcement-keys contract), and update the existing masking test to assert the corrected behavior instead of validating the injection bug Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uthoritative_overrides
…rrides and strengthen T2 assertion
…havior The fourth elif branch (key not in CONFIG_AUTHORITY_KEYS → warning) was removed in the prior commit restoring the three-branch structure. Two tests verified that warning behavior and now fail. Update them to assert only the correct three-branch behavior: unknown caller-sovereign keys are retained silently without a warning.
…ient branch The BACKEND_CAPABILITY_INGREDIENTS warning log was identical to the SERVER_AUTHORITATIVE_INGREDIENTS warning, making it impossible for log consumers to distinguish which branch fired. Use a branch-specific message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…it test The test docstring stated the key is retained silently (no warning), but no assertion verified this contract. Add structlog.testing.capture_logs() and a negative assertion to guard against regression to warn-on-unknown behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ync integration test The test docstring stated the caller-sovereign path emits no warning, but the test dropped the prior warning assertion without adding an explicit no-warning check. Add structlog.testing.capture_logs() and a negative assertion to prevent regression to the old warn-on-unknown behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Two concrete code defects were left behind by the prior implementation round and are cited in the remediation audit:
REQ-004 — unauthorized fourth branch:
apply_config_authoritative_overridesinsrc/autoskillit/config/ingredient_defaults.pycontains a fourthelif key not in CONFIG_AUTHORITY_KEYS: logger.warning(...)branch that the plan never authorized. The plan specifies exactly three branches:SERVER_AUTHORITATIVE_INGREDIENTS,BACKEND_CAPABILITY_INGREDIENTS, and an implicitelse(caller-sovereign). The fourth branch must be removed so the loop body matches the specified three-branch structure.REQ-009 — weak T2 assertion: The T2 test
test_apply_config_authoritative_overrides_source_dir_not_injected_when_absentusescaptured["ingredients"].get("source_dir") != URL— a weaker assertion that passes ifsource_diris present with any non-URL value (e.g., the empty string""injected byexecute_dispatchwhen the caller omits the ingredient and the recipe definesdefault=""). The test must assert"source_dir" not in resultagainst the output ofapply_config_authoritative_overridesdirectly, bypassing theexecute_dispatchdefault-injection path.Both changes are in the same commit to satisfy the green-gate invariant (the T2 test must pass after the function fix, and the function fix changes the behavior T2 validates).
Part B (introducing
CALLER_SOVEREIGN_INGREDIENTS, tightening config-authority-requires-resolve-source, removingauthority: configfrom 15 recipe YAMLs) is a separate task and must NOT be implemented here.Closes #4200
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/remediation-20260707-023904-630849/.autoskillit/temp/make-plan/remediation_source-dir-enforcement-seam-part-a_plan_2026-07-07_035458.md🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown