@danmoisan/drm-copilot-mcp 0.0.6 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/out/mcp-server.js +10213 -398
  2. package/package.json +2 -2
  3. package/resources/claude-customizations/.claude/hooks/enforce-completion-consistency.ps1 +127 -17
  4. package/resources/claude-customizations/.claude/hooks/enforce-completion-helpers.ps1 +163 -0
  5. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +0 -12
  6. package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output.ps1 +68 -1
  7. package/resources/config/orchestration-routing.json +3 -3
  8. package/resources/codex-and-agents-customizations/.codex/scripts/post-codex-worktree-session.ps1 +0 -5
  9. package/resources/scripts/dev_tools/__init__.py +0 -0
  10. package/resources/scripts/dev_tools/_orchestrator_state_human_interaction.py +0 -127
  11. package/resources/scripts/dev_tools/_orchestrator_state_routing.py +0 -216
  12. package/resources/scripts/dev_tools/agentic_sync.py +0 -819
  13. package/resources/scripts/dev_tools/codex_native_converter/__init__.py +0 -11
  14. package/resources/scripts/dev_tools/codex_native_converter/__main__.py +0 -6
  15. package/resources/scripts/dev_tools/codex_native_converter/cli.py +0 -11
  16. package/resources/scripts/dev_tools/new_active_feature_folder.py +0 -79
  17. package/resources/scripts/dev_tools/new_active_feature_folder_docs.py +0 -268
  18. package/resources/scripts/dev_tools/new_active_feature_folder_flow.py +0 -366
  19. package/resources/scripts/dev_tools/new_active_feature_folder_io.py +0 -306
  20. package/resources/scripts/dev_tools/new_active_feature_folder_markdown.py +0 -252
  21. package/resources/scripts/dev_tools/new_active_feature_folder_models.py +0 -136
  22. package/resources/scripts/dev_tools/new_potential_bug_entry.py +0 -465
  23. package/resources/scripts/dev_tools/potential_to_issue.py +0 -421
  24. package/resources/scripts/dev_tools/potential_to_issue_content.py +0 -212
  25. package/resources/scripts/dev_tools/pr_context/__init__.py +0 -0
  26. package/resources/scripts/dev_tools/pr_context/collector.py +0 -619
  27. package/resources/scripts/dev_tools/pr_context/feature_docs.py +0 -349
  28. package/resources/scripts/dev_tools/pr_context/git.py +0 -153
  29. package/resources/scripts/dev_tools/pr_context/github.py +0 -549
  30. package/resources/scripts/dev_tools/pr_context/models.py +0 -198
  31. package/resources/scripts/dev_tools/pr_context/render.py +0 -342
  32. package/resources/scripts/dev_tools/pr_context/render_feature_excerpts.py +0 -256
  33. package/resources/scripts/dev_tools/pr_context/render_pr_helpers.py +0 -291
  34. package/resources/scripts/dev_tools/pr_context/summary_helpers.py +0 -386
  35. package/resources/scripts/dev_tools/pr_context/verification_evidence.py +0 -171
  36. package/resources/scripts/dev_tools/prompt_mode_contract.py +0 -152
  37. package/resources/scripts/dev_tools/push_down_claude_customizations.py +0 -403
  38. package/resources/scripts/dev_tools/push_down_claude_filesystem.py +0 -472
  39. package/resources/scripts/dev_tools/push_down_claude_pack_selection.py +0 -401
  40. package/resources/scripts/dev_tools/push_down_codex_and_agents_customizations.py +0 -139
  41. package/resources/scripts/dev_tools/push_down_copilot_customizations.py +0 -504
  42. package/resources/scripts/dev_tools/push_down_copilot_customizations_filesystem.py +0 -217
  43. package/resources/scripts/dev_tools/push_down_copilot_customizations_rewrites.py +0 -293
  44. package/resources/scripts/dev_tools/resolve_file_prompt.py +0 -457
  45. package/resources/scripts/dev_tools/resolve_hard_lock_prompt.py +0 -444
  46. package/resources/scripts/dev_tools/validate_orchestration_artifacts.py +0 -246
  47. package/resources/scripts/dev_tools/validate_orchestration_review_artifacts.py +0 -107
  48. package/resources/scripts/dev_tools/validate_orchestrator_state.py +0 -505
  49. package/resources/scripts/dev_tools/validate_policy_audit_artifact.py +0 -472
  50. package/resources/templates/codex_native_converter.py +0 -35
  51. package/resources/templates/collect_commit_context.py +0 -212
  52. package/resources/templates/collect_pr_context.py +0 -74
  53. package/resources/templates/hello_python.py +0 -11
  54. package/resources/templates/new_active_feature_folder.py +0 -67
  55. package/resources/templates/new_potential_bug_entry.py +0 -54
  56. package/resources/templates/potential_to_issue.py +0 -55
  57. package/resources/templates/push_down_claude_customizations.py +0 -233
  58. package/resources/templates/push_down_codex_and_agents_customizations.py +0 -95
  59. package/resources/templates/push_down_copilot_customizations.py +0 -124
  60. package/resources/templates/resolve_atomic_plan_prompt.py +0 -75
  61. package/resources/templates/resolve_hard_lock_prompt.py +0 -65
  62. package/resources/templates/validate_orchestration_artifacts.py +0 -55
@@ -1,233 +0,0 @@
1
- """Bundled template entry point for the `.claude` customization push-down.
2
-
3
- Purpose:
4
- Provide the extension-invoked CLI that publishes the bundled `.claude`
5
- payload into a destination workspace. This template bootstraps the bundled
6
- ``resources/scripts`` directory onto ``sys.path`` and then delegates all
7
- pack-selection, C# variant-routing, and memory-mode logic to the bundled
8
- ``push_down_claude_customizations`` engine module so the template and the
9
- repository source stay behaviorally identical.
10
-
11
- Settings-local configuration is excluded from push-down because it holds
12
- host-specific overrides. Agent-memory files under `.claude/agent-memory/`
13
- are filtered by the engine's content-based scope check; only general-scoped
14
- memories are distributed.
15
-
16
- Responsibilities:
17
- - Ensure the bundled scripts directory is importable when invoked directly
18
- from ``resources/templates/``.
19
- - Parse the CLI arguments (``--destination``, ``--packs``,
20
- ``--csharp-variant``, ``--memory-mode``).
21
- - Resolve the source root and bundle root to the sibling bundled
22
- ``claude-customizations`` directory so the template distributes the
23
- bundled payload rather than a destination workspace's own `.claude`.
24
-
25
- Side Effects:
26
- Mutates ``sys.path`` at import time; reads bundled source files and writes
27
- destination files through the publisher engine.
28
- """
29
-
30
- from __future__ import annotations
31
-
32
- import argparse
33
- import sys
34
- from pathlib import Path
35
-
36
-
37
- def _ensure_bundled_scripts_import_path() -> None:
38
- """Prepend bundled ``resources/scripts`` directory to ``sys.path``.
39
-
40
- Purpose:
41
- Make extension-bundled Python packages importable when this template is
42
- invoked directly from ``resources/templates/`` rather than from the
43
- repository root. Without this bootstrap, neither
44
- ``scripts.dev_tools.push_down_claude_customizations`` nor the fallback
45
- ``dev_tools.push_down_claude_customizations`` import resolves because
46
- ``resources/scripts`` is not on ``sys.path`` by default.
47
-
48
- Side Effects:
49
- Mutates ``sys.path`` by inserting the bundled scripts directory at
50
- index 0 when not already present.
51
- """
52
- scripts_dir = Path(__file__).resolve().parent.parent / "scripts"
53
- scripts_dir_str = str(scripts_dir)
54
-
55
- if scripts_dir_str not in sys.path:
56
- sys.path.insert(0, scripts_dir_str)
57
-
58
-
59
- _ensure_bundled_scripts_import_path()
60
-
61
- try:
62
- from scripts.dev_tools.push_down_claude_customizations import (
63
- CSHARP_VARIANT_CHOICES,
64
- MEMORY_MODE_CHOICES,
65
- PushDownSummary,
66
- push_down_customizations,
67
- )
68
- from scripts.dev_tools.push_down_copilot_customizations import (
69
- PushDownFileSystem,
70
- RealPushDownFileSystem,
71
- resolve_cli_path,
72
- )
73
- except ModuleNotFoundError as error:
74
- if error.name is None or not error.name.startswith("scripts"):
75
- raise
76
- from dev_tools.push_down_claude_customizations import (
77
- CSHARP_VARIANT_CHOICES,
78
- MEMORY_MODE_CHOICES,
79
- PushDownSummary,
80
- push_down_customizations,
81
- )
82
- from dev_tools.push_down_copilot_customizations import (
83
- PushDownFileSystem,
84
- RealPushDownFileSystem,
85
- resolve_cli_path,
86
- )
87
-
88
- MODULE_ENTRY_POINT = "scripts.dev_tools.push_down_claude_customizations"
89
-
90
- __all__ = ["main", "parse_args"]
91
-
92
-
93
- def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
94
- """Parse CLI arguments for the bundled Claude customization push-down.
95
-
96
- Purpose:
97
- Mirror the repository entry point's CLI contract, including the optional
98
- ``--packs``, ``--csharp-variant``, and ``--memory-mode`` flags. With no
99
- optional flags the parsed namespace yields the backward-compatible
100
- defaults (``packs=None``, ``csharp_variant="modern"``,
101
- ``memory_mode="overwrite"``).
102
-
103
- Args:
104
- argv (list[str] | None): Optional argument list for tests or embedding.
105
-
106
- Returns:
107
- argparse.Namespace: Parsed arguments with attributes ``destination``,
108
- ``packs``, ``csharp_variant``, and ``memory_mode``.
109
-
110
- Raises:
111
- SystemExit: Raised by ``argparse`` when arguments are invalid.
112
-
113
- Side Effects:
114
- Emits usage/help text through ``argparse`` when parsing fails.
115
- """
116
- parser = argparse.ArgumentParser(
117
- description=(
118
- "Publish bundled Claude customizations with "
119
- f"python -m {MODULE_ENTRY_POINT}."
120
- )
121
- )
122
- parser.add_argument(
123
- "--destination",
124
- required=True,
125
- help=("Destination workspace root that will receive the copied .claude tree."),
126
- )
127
- parser.add_argument(
128
- "--packs",
129
- default=None,
130
- help=(
131
- "Comma-separated language pack names to publish (for example "
132
- "'core,typescript'). When omitted, the full tree is published. "
133
- "'core' is always included."
134
- ),
135
- )
136
- parser.add_argument(
137
- "--csharp-variant",
138
- dest="csharp_variant",
139
- choices=CSHARP_VARIANT_CHOICES,
140
- default="modern",
141
- help="C# toolchain variant to source ('modern' default or 'legacy').",
142
- )
143
- parser.add_argument(
144
- "--memory-mode",
145
- dest="memory_mode",
146
- choices=MEMORY_MODE_CHOICES,
147
- default="overwrite",
148
- help=("Agent-memory handling mode: 'overwrite' (default), 'merge', or 'skip'."),
149
- )
150
- return parser.parse_args(argv)
151
-
152
-
153
- def _parse_packs_argument(packs_value: str | None) -> frozenset[str] | None:
154
- """Parse the raw ``--packs`` CLI value into a normalized pack-name set.
155
-
156
- Args:
157
- packs_value (str | None): The raw comma-separated value, or ``None`` when
158
- the flag was omitted.
159
-
160
- Returns:
161
- frozenset[str] | None: The set of non-empty, stripped pack names, or
162
- ``None`` when the flag was omitted or contained only empty entries (the
163
- publish-everything default).
164
- """
165
- if packs_value is None:
166
- return None
167
- # Strip whitespace and drop empty entries so trailing commas or stray spaces
168
- # do not produce empty pack names.
169
- names = {entry.strip() for entry in packs_value.split(",") if entry.strip()}
170
- if not names:
171
- return None
172
- return frozenset(names)
173
-
174
-
175
- def main(
176
- argv: list[str] | None = None,
177
- *,
178
- repo_root: Path | None = None,
179
- fs: PushDownFileSystem | None = None,
180
- ) -> int:
181
- """Run the bundled Claude customization push-down publisher CLI.
182
-
183
- Purpose:
184
- Parse arguments, resolve the source and bundle roots to the sibling
185
- bundled ``claude-customizations`` directory, thread the pack selection,
186
- C# variant, and memory mode into the engine, and print the summary
187
- artifact path. With no optional flags this is byte-for-byte equivalent
188
- to the prior bundled publish-everything/overwrite behavior.
189
-
190
- Args:
191
- argv (list[str] | None): Optional CLI argument list.
192
- repo_root (Path | None): Optional explicit source root for tests; when
193
- absent, the bundled ``claude-customizations`` directory is used.
194
- fs (PushDownFileSystem | None): Optional filesystem adapter for tests.
195
-
196
- Returns:
197
- int: Process exit code (``0`` on success).
198
-
199
- Side Effects:
200
- Reads bundled source files and writes destination files and the summary
201
- artifact through the adapter.
202
- """
203
- args = parse_args(argv)
204
- # Resolve the source root to the bundled customizations directory so the
205
- # template distributes the bundled `.claude` payload rather than copying a
206
- # destination workspace's existing `.claude` back onto itself. The bundle
207
- # root that holds the pack manifests and legacy variant subtree is the same
208
- # customizations directory. The optional `repo_root` argument still allows
209
- # tests to inject an explicit root.
210
- customizations_root = (
211
- Path(__file__).resolve().parent.parent / "claude-customizations"
212
- )
213
- resolved_repo_root = resolve_cli_path(repo_root or customizations_root)
214
- resolved_destination = resolve_cli_path(args.destination)
215
- resolved_fs = fs or RealPushDownFileSystem()
216
- packs = _parse_packs_argument(args.packs)
217
- summary: PushDownSummary = push_down_customizations(
218
- repo_root=resolved_repo_root,
219
- destination_root=resolved_destination,
220
- fs=resolved_fs,
221
- source_root=resolved_repo_root,
222
- artifact_root=resolved_repo_root,
223
- packs=packs,
224
- csharp_variant=args.csharp_variant,
225
- memory_mode=args.memory_mode,
226
- bundle_root=resolved_repo_root,
227
- )
228
- print(f"Wrote push-down summary artifact to: {summary.artifact_path}")
229
- return 0
230
-
231
-
232
- if __name__ == "__main__":
233
- raise SystemExit(main())
@@ -1,95 +0,0 @@
1
- """Compatibility wrapper for extension-side Codex/agents customization publishing.
2
-
3
- Purpose:
4
- Preserve the bundled-script entry point while delegating all publishing
5
- behavior to the bundled package implementation.
6
- """
7
-
8
- from __future__ import annotations
9
-
10
- import argparse
11
- import importlib
12
- import sys
13
- from pathlib import Path
14
- from typing import Protocol
15
-
16
-
17
- class _PublisherResult(Protocol):
18
- """Typed contract for the push-down summary surface accessed by this wrapper."""
19
-
20
- artifact_path: str
21
-
22
-
23
- class _FileSystemFactory(Protocol):
24
- """Construction contract for the publisher's filesystem implementation."""
25
-
26
- def __call__(self) -> object: ...
27
-
28
-
29
- class _PublisherFunction(Protocol):
30
- """Call contract matching the bundled push_down_customizations signature."""
31
-
32
- def __call__(
33
- self,
34
- *,
35
- repo_root: Path,
36
- destination_root: Path,
37
- fs: object,
38
- source_root: Path,
39
- artifact_root: Path,
40
- ) -> _PublisherResult: ...
41
-
42
-
43
- def _ensure_bundled_scripts_import_path() -> None:
44
- """Prepend bundled `resources/scripts` directory to ``sys.path``."""
45
-
46
- scripts_dir = Path(__file__).resolve().parent.parent / "scripts"
47
- scripts_dir_str = str(scripts_dir)
48
-
49
- if scripts_dir_str not in sys.path:
50
- sys.path.insert(0, scripts_dir_str)
51
-
52
-
53
- def main() -> int:
54
- """Execute the bundled Codex/agents publisher in-process."""
55
-
56
- _ensure_bundled_scripts_import_path()
57
-
58
- parser = argparse.ArgumentParser(
59
- description="Bundled Codex/agents customization publisher wrapper."
60
- )
61
- parser.add_argument(
62
- "--destination",
63
- required=True,
64
- help=(
65
- "Destination workspace root that will receive the copied .codex "
66
- "and .agents trees."
67
- ),
68
- )
69
- args = parser.parse_args()
70
-
71
- module = importlib.import_module(
72
- "dev_tools.push_down_codex_and_agents_customizations"
73
- )
74
- publish_fn: _PublisherFunction = module.push_down_customizations
75
- fs_factory: _FileSystemFactory = module.RealPushDownFileSystem
76
-
77
- customizations_root = (
78
- Path(__file__).resolve().parent.parent / "codex-and-agents-customizations"
79
- )
80
- resolved_destination = Path(args.destination).expanduser().resolve()
81
- artifact_root = Path.cwd().resolve()
82
-
83
- summary = publish_fn(
84
- repo_root=customizations_root,
85
- destination_root=resolved_destination,
86
- fs=fs_factory(),
87
- source_root=customizations_root,
88
- artifact_root=artifact_root,
89
- )
90
- print(f"Wrote push-down summary artifact to: {summary.artifact_path}")
91
- return 0
92
-
93
-
94
- if __name__ == "__main__":
95
- raise SystemExit(main())
@@ -1,124 +0,0 @@
1
- """Compatibility wrapper for extension-side push-down customization publishing.
2
-
3
- Purpose:
4
- Preserve the bundled-script entry point while delegating all publishing
5
- behavior to the bundled package implementation.
6
-
7
- Usage:
8
- python push_down_copilot_customizations.py --destination <path>
9
-
10
- Flow:
11
- 1. Ensure `resources/scripts/` is importable at runtime.
12
- 2. Import `dev_tools.push_down_copilot_customizations` from bundled sources.
13
- 3. Resolve `source_root` to `resources/customizations` payload.
14
- 4. Resolve `artifact_root` to the current working directory.
15
- 5. Invoke publisher in-process with `--destination` from CLI args.
16
-
17
- Invariants / Constraints:
18
- - No publishing logic is implemented in this wrapper.
19
- - Argument contract is owned by the publisher module and forwarded unchanged.
20
-
21
- Side Effects:
22
- Imports bundled publisher code and executes it in the current Python process.
23
- """
24
-
25
- from __future__ import annotations
26
-
27
- import argparse
28
- import importlib
29
- import sys
30
- from pathlib import Path
31
- from typing import Protocol
32
-
33
-
34
- class _PublisherResult(Protocol):
35
- """Typed contract for the PushDownSummary surface accessed by this wrapper."""
36
-
37
- artifact_path: str
38
-
39
-
40
- class _FileSystemFactory(Protocol):
41
- """Construction contract for the publisher's filesystem implementation."""
42
-
43
- def __call__(self) -> object: ...
44
-
45
-
46
- class _PublisherFunction(Protocol):
47
- """Call contract matching the bundled push_down_customizations signature."""
48
-
49
- def __call__(
50
- self,
51
- *,
52
- repo_root: Path,
53
- destination_root: Path,
54
- fs: object,
55
- source_root: Path,
56
- artifact_root: Path,
57
- ) -> _PublisherResult: ...
58
-
59
-
60
- def _ensure_bundled_scripts_import_path() -> None:
61
- """Prepend bundled `resources/scripts` directory to ``sys.path``.
62
-
63
- Purpose:
64
- Make extension-bundled Python packages importable regardless of the
65
- destination workspace layout.
66
-
67
- Side Effects:
68
- Mutates ``sys.path`` by inserting the bundled scripts directory at
69
- index 0 when not already present.
70
- """
71
- scripts_dir = Path(__file__).resolve().parent.parent / "scripts"
72
- scripts_dir_str = str(scripts_dir)
73
-
74
- if scripts_dir_str not in sys.path:
75
- sys.path.insert(0, scripts_dir_str)
76
-
77
-
78
- def main() -> int:
79
- """Execute bundled push-down customization publisher in-process.
80
-
81
- Purpose:
82
- Keep the bundled extension script as a thin adapter and avoid duplicated
83
- publishing logic while resolving source and artifact roots automatically.
84
-
85
- Returns:
86
- Exit code from bundled publisher main function.
87
-
88
- Side Effects:
89
- Imports the bundled publisher module and executes its publishing flow.
90
- """
91
- _ensure_bundled_scripts_import_path()
92
-
93
- parser = argparse.ArgumentParser(
94
- description="Bundled push-down customization publisher wrapper."
95
- )
96
- parser.add_argument(
97
- "--destination",
98
- required=True,
99
- help="Destination workspace root that will receive the copied .github trees.",
100
- )
101
- args = parser.parse_args()
102
-
103
- # Extract typed callables from the dynamically loaded publisher module.
104
- module = importlib.import_module("dev_tools.push_down_copilot_customizations")
105
- publish_fn: _PublisherFunction = module.push_down_customizations
106
- fs_factory: _FileSystemFactory = module.RealPushDownFileSystem
107
-
108
- customizations_root = Path(__file__).resolve().parent.parent / "customizations"
109
- resolved_destination = Path(args.destination).expanduser().resolve()
110
- artifact_root = Path.cwd().resolve()
111
-
112
- summary = publish_fn(
113
- repo_root=customizations_root,
114
- destination_root=resolved_destination,
115
- fs=fs_factory(),
116
- source_root=customizations_root,
117
- artifact_root=artifact_root,
118
- )
119
- print(f"Wrote push-down summary artifact to: {summary.artifact_path}")
120
- return 0
121
-
122
-
123
- if __name__ == "__main__":
124
- raise SystemExit(main())
@@ -1,75 +0,0 @@
1
- """Compatibility wrapper for extension-side atomic-plan prompt resolution.
2
-
3
- Purpose:
4
- Preserve a stable bundled-script entry point while delegating atomic-plan
5
- prompt resolution to the bundled resolver module under `resources/scripts`.
6
-
7
- Usage:
8
- python resolve_atomic_plan_prompt.py --target <plan> --workspace <root>
9
-
10
- Flow:
11
- 1. Ensure `resources/scripts/` is importable.
12
- 2. Inject the bundled atomic-plan prompt template when `--template` is absent.
13
- 3. Import `dev_tools.resolve_file_prompt` from bundled sources.
14
- 4. Execute the bundled resolver in-process and return its exit code.
15
- """
16
-
17
- from __future__ import annotations
18
-
19
- import importlib
20
- import sys
21
- from pathlib import Path
22
- from typing import TYPE_CHECKING, cast
23
-
24
- if TYPE_CHECKING:
25
- from collections.abc import Callable
26
-
27
-
28
- def _ensure_bundled_scripts_import_path() -> None:
29
- """Prepend bundled `resources/scripts` directory to `sys.path`."""
30
- scripts_dir = Path(__file__).resolve().parent.parent / "scripts"
31
- scripts_dir_str = str(scripts_dir)
32
- if scripts_dir_str not in sys.path:
33
- sys.path.insert(0, scripts_dir_str)
34
-
35
-
36
- def main() -> int:
37
- """Execute bundled atomic-plan prompt resolution in-process.
38
-
39
- Purpose:
40
- Keep the wrapper free of prompt-resolution business logic while ensuring
41
- the bundled atomic-plan prompt template is supplied when the caller does
42
- not pass `--template` explicitly.
43
-
44
- Args:
45
- None.
46
-
47
- Returns:
48
- int: Exit code returned by the bundled resolver module.
49
-
50
- Raises:
51
- None explicitly. Import or resolver failures propagate to the caller.
52
-
53
- Side Effects:
54
- Mutates `sys.argv` additively when `--template` is absent and imports the
55
- bundled resolver module in the current Python process.
56
- """
57
- _ensure_bundled_scripts_import_path()
58
-
59
- template_path = (
60
- Path(__file__).resolve().parent.parent
61
- / "customizations"
62
- / ".github"
63
- / "prompts"
64
- / "generate-atomic-plan.prompt.md"
65
- )
66
- if "--template" not in sys.argv:
67
- sys.argv.extend(["--template", str(template_path)])
68
-
69
- module = importlib.import_module("dev_tools.resolve_file_prompt")
70
- module_main = cast("Callable[[], int]", module.main)
71
- return int(module_main())
72
-
73
-
74
- if __name__ == "__main__":
75
- raise SystemExit(main())
@@ -1,65 +0,0 @@
1
- """Compatibility wrapper for extension-side hard-lock prompt resolution.
2
-
3
- Purpose:
4
- Preserve the bundled-script entry point while delegating hard-lock prompt
5
- resolution behavior to the bundled package implementation.
6
-
7
- Usage:
8
- python resolve_hard_lock_prompt.py --target <plan> --workspace <workspace>
9
-
10
- Flow:
11
- 1. Ensure `resources/scripts/` is importable at runtime.
12
- 2. Inject the bundled `.github/codex` template root when the caller omitted it.
13
- 3. Import `dev_tools.resolve_hard_lock_prompt` from bundled sources.
14
- 4. Invoke the bundled CLI entrypoint in-process with the active CLI args.
15
-
16
- Invariants / Constraints:
17
- - No prompt-resolution business logic is implemented in this wrapper.
18
- - Argument contract is owned by the bundled resolver module and forwarded
19
- unchanged except for additive `--template-root` injection.
20
-
21
- Side Effects:
22
- Imports bundled resolver code and executes it in the current Python process.
23
- """
24
-
25
- from __future__ import annotations
26
-
27
- import importlib
28
- import sys
29
- from pathlib import Path
30
- from typing import TYPE_CHECKING, cast
31
-
32
- if TYPE_CHECKING:
33
- from collections.abc import Callable
34
-
35
-
36
- def _ensure_bundled_scripts_import_path() -> None:
37
- """Prepend bundled `resources/scripts` directory to ``sys.path``."""
38
- scripts_dir = Path(__file__).resolve().parent.parent / "scripts"
39
- scripts_dir_str = str(scripts_dir)
40
-
41
- if scripts_dir_str not in sys.path:
42
- sys.path.insert(0, scripts_dir_str)
43
-
44
-
45
- def main() -> int:
46
- """Execute bundled hard-lock prompt resolution in-process.
47
-
48
- Injects `--template-root` pointing to the extension's bundled hard-lock
49
- prompt templates when the caller did not already provide one.
50
- """
51
- _ensure_bundled_scripts_import_path()
52
-
53
- template_root = str(
54
- Path(__file__).resolve().parent.parent / "customizations" / ".github" / "codex"
55
- )
56
- if "--template-root" not in sys.argv:
57
- sys.argv.extend(["--template-root", template_root])
58
-
59
- module = importlib.import_module("dev_tools.resolve_hard_lock_prompt")
60
- module_main = cast("Callable[[], int]", module.main)
61
- return int(module_main())
62
-
63
-
64
- if __name__ == "__main__":
65
- raise SystemExit(main())
@@ -1,55 +0,0 @@
1
- """Compatibility wrapper for extension-side orchestration artifact validation.
2
-
3
- Purpose:
4
- Preserve the bundled-script entry point while delegating validation
5
- behavior to the bundled package implementation.
6
-
7
- Usage:
8
- python validate_orchestration_artifacts.py <artifact_type> <path>
9
- [--require-complete]
10
-
11
- Flow:
12
- 1. Ensure ``resources/scripts/`` is importable at runtime.
13
- 2. Import ``dev_tools.validate_orchestration_artifacts`` from bundled sources.
14
- 3. Invoke the bundled CLI entrypoint in-process with the active CLI args.
15
-
16
- Invariants / Constraints:
17
- - No validation business logic is implemented in this wrapper.
18
- - Argument contract is owned by the bundled validator module and forwarded
19
- unchanged.
20
-
21
- Side Effects:
22
- Imports bundled validator code and executes it in the current Python process.
23
- """
24
-
25
- from __future__ import annotations
26
-
27
- import importlib
28
- import sys
29
- from pathlib import Path
30
- from typing import TYPE_CHECKING, cast
31
-
32
- if TYPE_CHECKING:
33
- from collections.abc import Callable
34
-
35
-
36
- def _ensure_bundled_scripts_import_path() -> None:
37
- """Prepend bundled ``resources/scripts`` directory to ``sys.path``."""
38
- scripts_dir = Path(__file__).resolve().parent.parent / "scripts"
39
- scripts_dir_str = str(scripts_dir)
40
-
41
- if scripts_dir_str not in sys.path:
42
- sys.path.insert(0, scripts_dir_str)
43
-
44
-
45
- def main() -> int:
46
- """Execute bundled orchestration artifact validation in-process."""
47
- _ensure_bundled_scripts_import_path()
48
-
49
- module = importlib.import_module("dev_tools.validate_orchestration_artifacts")
50
- module_main = cast("Callable[..., int]", module.main)
51
- return int(module_main())
52
-
53
-
54
- if __name__ == "__main__":
55
- raise SystemExit(main())