Refactor Plugins Core - #926
Open
lbedner wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors how stack-dependent “shared files” are detected and regenerated by replacing the hand-maintained shared-files registry with an answers-diff render engine and a derived scope boundary (component/service-owned vs shared). It also introduces spec-declared post-render hooks (for transforms like worker backend renames), expands regression/property tests around the new engine, and improves plugin install/upgrade ergonomics with backup reporting.
Changes:
- Add
RenderDiffEngineto classify/apply per-file actions by rendering old/new answers and diffing results, with per-template header policy annotations. - Derive engine scope from manifests (
get_all_owned_paths/get_shared_scope) and add completeness/transition-coverage tests to prevent “falls through” staleness regressions. - Extend plugin install flow: fix shared-file regen ordering for
add_plugin, and snapshot locally modified plugin-owned files under.aegis/plugin-backups/.
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/core/test_shared_scope_completeness.py | New property test ensuring every stack-dependent path is handled by scope/ownership/exclusion. |
| tests/core/test_render_diff.py | Unit tests for render-diff discovery, classification, apply behavior, and formatting parity. |
| tests/core/test_render_diff_transition_coverage.py | Property tests asserting add/remove transitions always write/resolve required shared files. |
| tests/core/test_render_diff_real_templates.py | Integration tests verifying real templates carry policy annotations and don’t leak headers. |
| tests/core/test_render_diff_policy.py | Unit tests for parsing/behavior of per-template policy annotations. |
| tests/core/test_render_diff_merge_failure.py | Targeted tests for merge-tool/ruff failure paths to ensure safe PRESERVE behavior. |
| tests/core/test_post_render_hook.py | Tests for spec-declared post-render hooks and removal answer resets. |
| tests/core/test_plugin_cli_registration.py | Doc comment update to reflect derived shared scope behavior. |
| tests/core/test_manual_updater_plugins.py | Adds plugin overwrite semantics docs + backup-on-replace regression tests. |
| tests/core/test_component_ownership.py | Tests for owned-path derivation and shared-scope boundary rules/exceptions. |
| tests/core/conftest.py | Shared helpers for render-diff test fixture engine/template creation. |
| tests/cli/test_shared_files_completeness.py | Removes legacy shared-files allowlist completeness guard (superseded by derived tests). |
| tests/cli/test_issue_870_warn_only_regeneration.py | Rewrites Dockerfile warn-if-diverged regression tests to use real templates/engine path. |
| tests/cli/test_issue_814_add_parity.py | Updates documentation/comments to reflect derived scope replacing shared-files list. |
| tests/cli/test_issue_715_three_way_merge.py | Updates monkeypatch target to match merge path moved into render-diff engine. |
| tests/cli/test_issue_715_shared_file_divergence.py | Fixes tests to actually exercise a real answers change (non-no-op regen). |
| tests/cli/test_add_service_preserves_state.py | Comment update to reflect derived shared-file scope. |
| tests/cli/test_add_service_auth_regen.py | Comment update to reflect shared-files list removal. |
| tests/cli/test_add_plugin_shared_regen.py | New regression test for add-plugin shared-file regen ordering bug. |
| tests/cli/test_add_ingress_populates_stubs.py | New regression test for whole-file-gated stub population on ingress add/remove. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/README.md.jinja | Adds user-owned policy annotation to prevent regen clobbering. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/mkdocs.yml.jinja | Adds user-owned policy annotation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/docs/health.md.jinja | Adds user-owned policy annotation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/docs/development.md.jinja | Adds user-owned policy annotation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/docs/api.md.jinja | Adds user-owned policy annotation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/Dockerfile.jinja | Adds warn-if-diverged policy annotation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/system/health_db.py.jinja | Adds no-backup policy annotation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/system/health_db_sqlite.py.jinja | Adds no-backup policy annotation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/system/health_db_postgres.py.jinja | Adds no-backup policy annotation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/backend/startup/database_init.py.jinja | Adds no-backup policy annotation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/.gitignore.jinja | Ignores *.backup created by shared-file overwrites. |
| aegis/i18n/locales/en.py | Adds message key for plugin local-change replacement warning. |
| aegis/i18n/locales/de.py | Adds message key for plugin local-change replacement warning. |
| aegis/i18n/locales/es.py | Adds message key for plugin local-change replacement warning. |
| aegis/i18n/locales/fr.py | Adds message key for plugin local-change replacement warning. |
| aegis/i18n/locales/ja.py | Adds message key for plugin local-change replacement warning. |
| aegis/i18n/locales/ko.py | Adds message key for plugin local-change replacement warning. |
| aegis/i18n/locales/ru.py | Adds message key for plugin local-change replacement warning. |
| aegis/i18n/locales/zh.py | Adds message key for plugin local-change replacement warning. |
| aegis/i18n/locales/zh_hant.py | Adds message key for plugin local-change replacement warning. |
| aegis/core/template_cleanup.py | Updates doc reference to the new merge implementation location. |
| aegis/core/render_diff.py | Introduces the answers-diff render engine with policy annotations and apply semantics. |
| aegis/core/post_gen_tasks.py | Runs spec-declared post-render transforms at init for enabled specs. |
| aegis/core/plugins/spec.py | Extends PluginSpec with post_render and reset_answers_on_remove declarations. |
| aegis/core/manual_updater.py | Rewires shared-file regeneration to render-diff engine + derived scope; fixes add-plugin ordering; adds plugin backup-on-replace reporting; adds post-render hook + answer reset support. |
| aegis/core/components.py | Declares worker post-render hook and scheduler answer resets on removal in specs. |
| aegis/core/component_files.py | Adds owned-path derivation, shared-scope derivation, and engine-unsafe path exclusions. |
| aegis/config/shared_files.py | Deletes legacy centralized shared-files registry. |
| .claude/skills/template-dev/SKILL.md | Updates guidance to reference render-diff engine and derived ownership/scope rules. |
| .claude/skills/add-service/SKILL.md | Updates guidance: shared files are derived, not registered. |
| .claude/skills/add-component/SKILL.md | Updates guidance: shared files are derived, not registered. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
lbedner
force-pushed
the
refactor-plugins-core
branch
from
August 10, 2026 22:52
f1a8712 to
3e4181b
Compare
lbedner
force-pushed
the
refactor-plugins-core
branch
from
August 18, 2026 02:25
3e4181b to
3ebdca4
Compare
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.
No description provided.