Skip to content

feat(context): fan-out override application sites (PR-C carry-forward, ADR-0008 PR-D-prep)#627

Merged
memtomem merged 2 commits intomainfrom
feat/pr-d-prep-fanout-override
Apr 30, 2026
Merged

feat(context): fan-out override application sites (PR-C carry-forward, ADR-0008 PR-D-prep)#627
memtomem merged 2 commits intomainfrom
feat/pr-d-prep-fanout-override

Conversation

@memtomem
Copy link
Copy Markdown
Owner

Summary

PR-C shipped the OVERRIDE_FORMATS matrix and the _PR_C_ACTIVE_TYPES gate
but deferred the actual override application call sites in
generate_all_agents / generate_all_commands. Without this prep, simply
removing the gate in PR-D would activate _override.resolve() for
agents/commands but produce no observable behavior change — the resolver's
return value would never be applied to the runtime file.

This PR adds the application call sites as dead code under the PR-C
gate
: _PR_C_ACTIVE_TYPES = frozenset({"skills"}) keeps resolve()
returning None for agents/commands, so the new code paths are exercised
only by the new tests. PR-D removes the gate and the application paths
become live.

Mirrors the skills fan-out pattern at skills.py:213-220 line-by-line.

Changes

  • context/agents.py: per-vendor _override.resolve + atomic_write_bytes
    in generate_all_agents after atomic_write_text(out_path, content)

  • context/commands.py: same pattern in generate_all_commands

  • tests/test_context_override.py:

    • test_agents_fanout_does_not_apply_override_under_gate
    • test_commands_fanout_does_not_apply_override_under_gate

    These pin "fan-out application is inactive while gate is on", complementing
    the existing resolve-level pins (test_resolve_skips_agents_in_pr_c,
    test_resolve_skips_commands_in_pr_c). PR-D inverts both pairs together.

Series context

ADR-0008 wiki layer series:

Test plan

  • uv run ruff check packages/memtomem/src packages/memtomem/tests — clean
  • uv run ruff format --check packages/memtomem/src packages/memtomem/tests — clean
  • uv run pytest packages/memtomem/tests/test_context_override.py -v — 13 passed (incl. 2 new)
  • uv run pytest packages/memtomem/tests/ -m "not ollama" — 3449 passed, no regressions

🤖 Generated with Claude Code

pandas-studio and others added 2 commits May 1, 2026 07:19
PR-C shipped the OVERRIDE_FORMATS matrix and the _PR_C_ACTIVE_TYPES gate but
deferred the actual application call sites in generate_all_agents /
generate_all_commands. Surfacing as a separate prep PR before PR-D removes
the gate. No behavior change while the gate restricts resolve() to skills.

- agents.py: per-vendor override resolve + atomic_write_bytes in
  generate_all_agents, mirroring the skills.py:213-220 pattern
- commands.py: same pattern in generate_all_commands
- tests pin "inactive under gate" at the fan-out level so the one-line
  gate flip in PR-D is a verifiable behavior diff (resolve-level pins
  already exist as test_resolve_skips_*_in_pr_c)

Co-Authored-By: Claude <[email protected]>
Per self-review on PR #627:

- Add positive assertion (canonical body marker present) in
  test_agents_fanout_does_not_apply_override_under_gate and
  test_commands_fanout_does_not_apply_override_under_gate. Closes the
  false-pass path where a generator failure writing garbage could be
  mistaken for gate-correct behavior. PR-D's invert pair becomes a
  clean symmetric flip (marker disappears, ``!=`` flips to ``==``).
- Inline comment at the two new override application sites referencing
  PR-D' (carry-forward #1) so future readers do not independently
  rediscover the canonical→override race window and "fix" it. The note
  intentionally points at skills.py:213-220 as the precedent.

Co-Authored-By: Claude <[email protected]>
@memtomem memtomem merged commit 524e5bf into main Apr 30, 2026
7 checks passed
@memtomem memtomem deleted the feat/pr-d-prep-fanout-override branch April 30, 2026 22:31
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants