Repository navigation
fix(mirror): include Context Guard's published hook runtime - #586
kantorcodes wants to merge 2 commits into
Conversation
PR Summary by QodoInclude Context Guard hook runtime in generated mirrors
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Generator script exceeds 500 code lines
|
| # Context Guard declares Skills in its manifest; its lifecycle hooks, | ||
| # script entry points and state schema live at separate top-level paths. | ||
| # Mirror only these published runtime paths, not arbitrary source files. | ||
| "GreenLv/codex-context-guard": ("hooks", "scripts", "assets/state.schema.json"), |
There was a problem hiding this comment.
1. Generator script exceeds 500 code lines 📘 Rule violation ⚙ Maintainability
scripts/generate_plugins_json.py contains 512 non-blank lines. Because this changed source file crosses the 500-line limit, future maintenance requires splitting the generator into smaller modules.
Agent Prompt
## Issue description
`scripts/generate_plugins_json.py` contains 512 non-blank lines, exceeding the 500-line source-file limit.
## Fix Focus Areas
- scripts/generate_plugins_json.py[62-65]
## Recommended Fix
Refactor the generator into cohesive modules, such as parsing, path selection, mirroring, and marketplace generation, while preserving the existing public behavior and tests. Ensure each resulting source file contains no more than 500 non-blank lines.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # Context Guard declares Skills in its manifest; its lifecycle hooks, | ||
| # script entry points and state schema live at separate top-level paths. | ||
| # Mirror only these published runtime paths, not arbitrary source files. | ||
| "GreenLv/codex-context-guard": ("hooks", "scripts", "assets/state.schema.json"), |
There was a problem hiding this comment.
2. Ignored files in scripts could be mirrored 🐞 Bug ≡ Correctness
The new EXTRA_MIRROR_PATHS entry makes add_recursive_selection copy every archive file under hooks/ and scripts/. Nothing in collect_selected_paths or mirror_plugin_bundle reads .codexignore. Any file the upstream .codexignore excludes (__pycache__/, *.pyc, build/, dist/) would be published into the bundle if it exists under those directories in the archive.
Agent Prompt
### Issue description
Context Guard's recursive extra mirror paths (`hooks`, `scripts`) copy every file beneath them without applying the source `.codexignore`.
### Fix Focus Areas
- scripts/generate_plugins_json.py[266-326]
- tests/test_generate_plugins_json.py[15-43]
### Recommended Fix
Parse the archive's `.codexignore` and drop matching selected paths in `collect_selected_paths` (or at minimum skip `__pycache__` and `*.pyc` under extra paths). Add a test fixture containing an ignored file such as `scripts/__pycache__/x.pyc` and assert it is not selected.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Addresses the original Context Guard maintainer's runtime-mirror defect in issue #357. The existing generated mirror exposes the source manifest but omits upstream
hooks/hooks.json,scripts/context_guard.py,scripts/manage_plugin.pyandassets/state.schema.json, even though those files exist on the current public source and the manifest declares only Skills.Adds a narrow source-specific mirror-path selection for
GreenLv/codex-context-guardand a regression test requiring those runtime paths while excluding an unrelated private-path fixture. Source.codexignorewas inspected; these paths are not excluded. No upstream source files are modified. No catalog approval or publication is requested or implied, and changes must pass ordinary independent review and CI before merge.The connector's file readbacks confirm the current upstream/mirror omission. No end-to-end Codex install or local test suite was executed here because repository clone access is unavailable in this runtime. Changes were authored with AI assistance and are submitted for human review.