Refactor Component-Service Layer#732
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors how Aegis Stack tracks component/service file ownership and feature detection by making the spec registry (and each spec’s FileManifest) the single source of truth. It also adds a suite of guard/characterization tests to prevent silent drift in manifests, shared-file regeneration, and CLI option parsing/interactive selection flows.
Changes:
- Derive
post_gen_tasks.get_component_file_mapping()fromFileManifestviacompute_file_mapping(); extendget_component_files()to support a “full footprint” for removals (option-gated extras included). - Introduce
PluginSpec.marker_pathand updateaegis updatefeature detection to use registry-driven markers (instead of a hand-maintained path map). - Add/expand tests that lock in these contracts (derived mappings, marker correctness, shared-file completeness, CLI parsing/interactive selection behavior).
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Bumps typer dependency version in the lockfile. |
CHANGELOG.md |
Adds release notes including the typer bump. |
aegis/core/template_cleanup.py |
Uses AnswerKeys.ANSWERS_FILENAME instead of a hardcoded answers filename. |
aegis/core/services.py |
Adds marker_path, derives i18n keys for service types, and refines AI/auth file manifests (incl. option-gated extras). |
aegis/core/post_gen_tasks.py |
Replaces hand-maintained component→files dict with compute_file_mapping(); derives render context include-flags from registries. |
aegis/core/plugins/spec.py |
Adds marker_path to PluginSpec for on-disk install detection. |
aegis/core/manual_updater.py |
Ensures removal uses the full component/service footprint; uses AnswerKeys.ANSWERS_FILENAME. |
aegis/core/file_manifest.py |
Documents and exposes compute_file_mapping() as the source for derived file mappings. |
aegis/core/copier_updater.py |
Uses AnswerKeys.ANSWERS_FILENAME and derives service name set from the service registry. |
aegis/core/copier_manager.py |
Uses AnswerKeys.ANSWERS_FILENAME for copier answers handling. |
aegis/core/components.py |
Adds marker_path to components and models scheduler persistence as a manifest “extras” group. |
aegis/core/component_files.py |
Adds full footprint support; consumes derived mappings; adds spec-extras folding. |
aegis/config/shared_files.py |
Refactors shared-file policy declaration and documents the completeness test guard. |
aegis/commands/update.py |
Derives feature detection from registry marker_path values; uses AnswerKeys.ANSWERS_FILENAME consistently. |
aegis/commands/services.py |
Uses registry-provided i18n keys and enum declaration order for service-type grouping. |
aegis/commands/plugins.py |
Uses AnswerKeys.ANSWERS_FILENAME when resolving answers from disk. |
aegis/cli/interactive.py |
Introduces a step-engine + SelectionUI protocol for init selection; derives interactive add-service prompts from registry/service types. |
aegis/cli/callbacks.py |
Collapses per-service option parsing blocks into a handler registry while preserving messages/side effects. |
tests/core/test_file_mapping_derivation.py |
Adds guards that the mapping is derived, manifest paths exist, markers resolve, and footprints split correctly. |
tests/core/test_constants_usage.py |
Adds a source scan guard to prevent hardcoding shared constants (answers filename, infra order drift). |
tests/cli/test_update_feature_detection.py |
Adds characterization + registry-driven detection coverage for _detect_existing_features. |
tests/cli/test_shared_files_completeness.py |
Adds a “minimal vs maximal stack diff” guard ensuring stack-dependent shared files are registered/allowlisted. |
tests/cli/test_service_callbacks.py |
Characterization tests for bracket-syntax parsing and error messages in CLI callbacks. |
tests/cli/test_remove_command.py |
Adds an end-to-end regression test ensuring AI option-gated extras are deleted on aegis remove ai. |
tests/cli/test_interactive_service_selection.py |
Characterization tests for interactive add-service selection; verifies registry-driven offerings. |
tests/cli/test_interactive_project_selection.py |
Characterization tests for init-flow selection and new scripted UI seam for the engine. |
tests/cli/conftest.py |
Adds a stack fixture variant to generate AI with rag/voice enabled for remove-path regression testing. |
7c5c2ca to
081b7ef
Compare
081b7ef to
0b84cd2
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.