@danmoisan/drm-copilot-mcp 0.0.6 → 1.0.0
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.
- package/out/mcp-server.js +10213 -398
- package/package.json +2 -2
- package/resources/claude-customizations/.claude/hooks/enforce-completion-consistency.ps1 +127 -17
- package/resources/claude-customizations/.claude/hooks/enforce-completion-helpers.ps1 +163 -0
- package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +0 -12
- package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output.ps1 +68 -1
- package/resources/config/orchestration-routing.json +3 -3
- package/resources/codex-and-agents-customizations/.codex/scripts/post-codex-worktree-session.ps1 +0 -5
- package/resources/scripts/dev_tools/__init__.py +0 -0
- package/resources/scripts/dev_tools/_orchestrator_state_human_interaction.py +0 -127
- package/resources/scripts/dev_tools/_orchestrator_state_routing.py +0 -216
- package/resources/scripts/dev_tools/agentic_sync.py +0 -819
- package/resources/scripts/dev_tools/codex_native_converter/__init__.py +0 -11
- package/resources/scripts/dev_tools/codex_native_converter/__main__.py +0 -6
- package/resources/scripts/dev_tools/codex_native_converter/cli.py +0 -11
- package/resources/scripts/dev_tools/new_active_feature_folder.py +0 -79
- package/resources/scripts/dev_tools/new_active_feature_folder_docs.py +0 -268
- package/resources/scripts/dev_tools/new_active_feature_folder_flow.py +0 -366
- package/resources/scripts/dev_tools/new_active_feature_folder_io.py +0 -306
- package/resources/scripts/dev_tools/new_active_feature_folder_markdown.py +0 -252
- package/resources/scripts/dev_tools/new_active_feature_folder_models.py +0 -136
- package/resources/scripts/dev_tools/new_potential_bug_entry.py +0 -465
- package/resources/scripts/dev_tools/potential_to_issue.py +0 -421
- package/resources/scripts/dev_tools/potential_to_issue_content.py +0 -212
- package/resources/scripts/dev_tools/pr_context/__init__.py +0 -0
- package/resources/scripts/dev_tools/pr_context/collector.py +0 -619
- package/resources/scripts/dev_tools/pr_context/feature_docs.py +0 -349
- package/resources/scripts/dev_tools/pr_context/git.py +0 -153
- package/resources/scripts/dev_tools/pr_context/github.py +0 -549
- package/resources/scripts/dev_tools/pr_context/models.py +0 -198
- package/resources/scripts/dev_tools/pr_context/render.py +0 -342
- package/resources/scripts/dev_tools/pr_context/render_feature_excerpts.py +0 -256
- package/resources/scripts/dev_tools/pr_context/render_pr_helpers.py +0 -291
- package/resources/scripts/dev_tools/pr_context/summary_helpers.py +0 -386
- package/resources/scripts/dev_tools/pr_context/verification_evidence.py +0 -171
- package/resources/scripts/dev_tools/prompt_mode_contract.py +0 -152
- package/resources/scripts/dev_tools/push_down_claude_customizations.py +0 -403
- package/resources/scripts/dev_tools/push_down_claude_filesystem.py +0 -472
- package/resources/scripts/dev_tools/push_down_claude_pack_selection.py +0 -401
- package/resources/scripts/dev_tools/push_down_codex_and_agents_customizations.py +0 -139
- package/resources/scripts/dev_tools/push_down_copilot_customizations.py +0 -504
- package/resources/scripts/dev_tools/push_down_copilot_customizations_filesystem.py +0 -217
- package/resources/scripts/dev_tools/push_down_copilot_customizations_rewrites.py +0 -293
- package/resources/scripts/dev_tools/resolve_file_prompt.py +0 -457
- package/resources/scripts/dev_tools/resolve_hard_lock_prompt.py +0 -444
- package/resources/scripts/dev_tools/validate_orchestration_artifacts.py +0 -246
- package/resources/scripts/dev_tools/validate_orchestration_review_artifacts.py +0 -107
- package/resources/scripts/dev_tools/validate_orchestrator_state.py +0 -505
- package/resources/scripts/dev_tools/validate_policy_audit_artifact.py +0 -472
- package/resources/templates/codex_native_converter.py +0 -35
- package/resources/templates/collect_commit_context.py +0 -212
- package/resources/templates/collect_pr_context.py +0 -74
- package/resources/templates/hello_python.py +0 -11
- package/resources/templates/new_active_feature_folder.py +0 -67
- package/resources/templates/new_potential_bug_entry.py +0 -54
- package/resources/templates/potential_to_issue.py +0 -55
- package/resources/templates/push_down_claude_customizations.py +0 -233
- package/resources/templates/push_down_codex_and_agents_customizations.py +0 -95
- package/resources/templates/push_down_copilot_customizations.py +0 -124
- package/resources/templates/resolve_atomic_plan_prompt.py +0 -75
- package/resources/templates/resolve_hard_lock_prompt.py +0 -65
- package/resources/templates/validate_orchestration_artifacts.py +0 -55
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"""Collect Git commit context for commit message generation.
|
|
2
|
-
|
|
3
|
-
This script gathers staged changes and repository state information
|
|
4
|
-
to provide context for generating conventional commit messages.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
from __future__ import annotations
|
|
8
|
-
|
|
9
|
-
import argparse
|
|
10
|
-
import shutil
|
|
11
|
-
import subprocess
|
|
12
|
-
import sys
|
|
13
|
-
from pathlib import Path
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def run_git(args: list[str], allow_error: bool = False) -> str:
|
|
17
|
-
"""Run a git command and return stdout.
|
|
18
|
-
|
|
19
|
-
Args:
|
|
20
|
-
args: Git subcommand and arguments (e.g., ["status", "-sb"])
|
|
21
|
-
allow_error: If True, return empty output on error instead of raising
|
|
22
|
-
|
|
23
|
-
Returns:
|
|
24
|
-
Git command stdout as string, stripped of whitespace
|
|
25
|
-
|
|
26
|
-
Raises:
|
|
27
|
-
FileNotFoundError: If git executable not found on PATH
|
|
28
|
-
subprocess.CalledProcessError: If git command fails and allow_error is False
|
|
29
|
-
"""
|
|
30
|
-
# Validate git executable exists
|
|
31
|
-
git_exe = shutil.which("git")
|
|
32
|
-
if not git_exe:
|
|
33
|
-
raise FileNotFoundError("git executable not found on PATH")
|
|
34
|
-
|
|
35
|
-
try:
|
|
36
|
-
result = subprocess.run( # noqa: S603 - static analysis can't verify runtime validation
|
|
37
|
-
[git_exe, *args],
|
|
38
|
-
capture_output=True,
|
|
39
|
-
text=True,
|
|
40
|
-
encoding="utf-8",
|
|
41
|
-
errors="replace",
|
|
42
|
-
check=not allow_error,
|
|
43
|
-
)
|
|
44
|
-
stdout = result.stdout or ""
|
|
45
|
-
return stdout.strip()
|
|
46
|
-
except subprocess.CalledProcessError as e:
|
|
47
|
-
if allow_error:
|
|
48
|
-
stdout = e.stdout or ""
|
|
49
|
-
return stdout.strip()
|
|
50
|
-
raise
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def collect_commit_context(output_path: Path) -> None:
|
|
54
|
-
"""Collect commit context and write to output file."""
|
|
55
|
-
sections: list[str] = []
|
|
56
|
-
|
|
57
|
-
sections.append("Please generate a commit message based on the following content:")
|
|
58
|
-
sections.append("\n")
|
|
59
|
-
|
|
60
|
-
# Repository remotes
|
|
61
|
-
sections.append("===== Repository remotes =====")
|
|
62
|
-
sections.append("")
|
|
63
|
-
remotes = run_git(["remote", "-v"])
|
|
64
|
-
sections.append(remotes)
|
|
65
|
-
sections.append("")
|
|
66
|
-
|
|
67
|
-
# Current branch
|
|
68
|
-
sections.append("===== Current branch =====")
|
|
69
|
-
sections.append("")
|
|
70
|
-
branch = run_git(["rev-parse", "--abbrev-ref", "HEAD"])
|
|
71
|
-
sections.append(branch)
|
|
72
|
-
sections.append("")
|
|
73
|
-
|
|
74
|
-
# Upstream
|
|
75
|
-
sections.append("===== Upstream =====")
|
|
76
|
-
sections.append("")
|
|
77
|
-
upstream = run_git(
|
|
78
|
-
["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"], allow_error=True
|
|
79
|
-
)
|
|
80
|
-
sections.append(upstream if upstream else "(no upstream)")
|
|
81
|
-
sections.append("")
|
|
82
|
-
|
|
83
|
-
# Status (short)
|
|
84
|
-
sections.append("===== Status (short) =====")
|
|
85
|
-
sections.append("")
|
|
86
|
-
status = run_git(["status", "-sb"])
|
|
87
|
-
sections.append(status)
|
|
88
|
-
sections.append("")
|
|
89
|
-
|
|
90
|
-
# Staged files (name-status)
|
|
91
|
-
sections.append("===== Staged files (name-status) =====")
|
|
92
|
-
sections.append("")
|
|
93
|
-
staged = run_git(["diff", "--cached", "--name-status"], allow_error=True)
|
|
94
|
-
sections.append(staged if staged else "(no staged changes)")
|
|
95
|
-
sections.append("")
|
|
96
|
-
|
|
97
|
-
# Staged diff
|
|
98
|
-
sections.append("===== Staged diff =====")
|
|
99
|
-
sections.append("")
|
|
100
|
-
staged_diff = run_git(["diff", "--cached"], allow_error=True)
|
|
101
|
-
sections.append(staged_diff if staged_diff else "(no staged changes)")
|
|
102
|
-
sections.append("")
|
|
103
|
-
|
|
104
|
-
# Unstaged files (name-status)
|
|
105
|
-
sections.append("===== Unstaged files (name-status) =====")
|
|
106
|
-
sections.append("")
|
|
107
|
-
unstaged = run_git(["diff", "--name-status"], allow_error=True)
|
|
108
|
-
sections.append(unstaged if unstaged else "(no unstaged changes)")
|
|
109
|
-
sections.append("")
|
|
110
|
-
|
|
111
|
-
# Unstaged diff
|
|
112
|
-
sections.append("===== Unstaged diff =====")
|
|
113
|
-
sections.append("")
|
|
114
|
-
unstaged_diff = run_git(["diff"], allow_error=True)
|
|
115
|
-
sections.append(unstaged_diff if unstaged_diff else "(no unstaged changes)")
|
|
116
|
-
sections.append("")
|
|
117
|
-
|
|
118
|
-
# Untracked files
|
|
119
|
-
sections.append("===== Untracked files =====")
|
|
120
|
-
sections.append("")
|
|
121
|
-
untracked = run_git(
|
|
122
|
-
["ls-files", "--others", "--exclude-standard"], allow_error=True
|
|
123
|
-
)
|
|
124
|
-
sections.append(untracked if untracked else "(no untracked files)")
|
|
125
|
-
sections.append("")
|
|
126
|
-
|
|
127
|
-
# Diff stat (combined)
|
|
128
|
-
sections.append("===== Diff stat (staged + unstaged) =====")
|
|
129
|
-
sections.append("")
|
|
130
|
-
diff_stat = run_git(["diff", "HEAD", "--stat"], allow_error=True)
|
|
131
|
-
sections.append(diff_stat if diff_stat else "(no changes)")
|
|
132
|
-
sections.append("")
|
|
133
|
-
|
|
134
|
-
# Changed Python files
|
|
135
|
-
sections.append("===== Changed Python files =====")
|
|
136
|
-
sections.append("")
|
|
137
|
-
all_changed = run_git(["diff", "HEAD", "--name-only"], allow_error=True)
|
|
138
|
-
py_files = (
|
|
139
|
-
[f for f in all_changed.split("\n") if f.endswith(".py")] if all_changed else []
|
|
140
|
-
)
|
|
141
|
-
sections.append("\n".join(py_files) if py_files else "(no Python files changed)")
|
|
142
|
-
sections.append("")
|
|
143
|
-
|
|
144
|
-
# Last commit (header only)
|
|
145
|
-
sections.append("===== Last commit (header only) =====")
|
|
146
|
-
sections.append("")
|
|
147
|
-
last_commit = run_git(
|
|
148
|
-
["log", "-1", "--format=%H%n%aN <%aE>%n%aD%n%cN <%cE>%n%cD%n%s%n%b"],
|
|
149
|
-
allow_error=True,
|
|
150
|
-
)
|
|
151
|
-
if last_commit:
|
|
152
|
-
lines = last_commit.split("\n")
|
|
153
|
-
sections.append(f"commit {lines[0]}")
|
|
154
|
-
if len(lines) > 1:
|
|
155
|
-
sections.append(f"Author: {lines[1]}")
|
|
156
|
-
if len(lines) > 2:
|
|
157
|
-
sections.append(f"AuthorDate: {lines[2]}")
|
|
158
|
-
if len(lines) > 3:
|
|
159
|
-
sections.append(f"Commit: {lines[3]}")
|
|
160
|
-
if len(lines) > 4:
|
|
161
|
-
sections.append(f"CommitDate: {lines[4]}")
|
|
162
|
-
if len(lines) > 5:
|
|
163
|
-
sections.append("")
|
|
164
|
-
sections.append(f" {lines[5]}")
|
|
165
|
-
for line in lines[6:]:
|
|
166
|
-
if line.strip():
|
|
167
|
-
sections.append(f" {line}")
|
|
168
|
-
else:
|
|
169
|
-
sections.append("(no previous commits)")
|
|
170
|
-
sections.append("")
|
|
171
|
-
|
|
172
|
-
# Change intent (editable section)
|
|
173
|
-
sections.append("===== Change intent (edit below) =====")
|
|
174
|
-
sections.append("- What/why summary:")
|
|
175
|
-
sections.append("- Breaking changes:")
|
|
176
|
-
sections.append("- Affected modules:")
|
|
177
|
-
sections.append("- Issue/PR refs:")
|
|
178
|
-
sections.append("")
|
|
179
|
-
|
|
180
|
-
# Write to output file
|
|
181
|
-
output_path.parent.mkdir(parents=True, exist_ok=True)
|
|
182
|
-
output_path.write_text("\n".join(sections), encoding="utf-8")
|
|
183
|
-
print(f"Commit context written to: {output_path}")
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
def main(argv: list[str] | None = None) -> int:
|
|
187
|
-
"""Main entry point."""
|
|
188
|
-
parser = argparse.ArgumentParser(
|
|
189
|
-
description="Collect Git commit context for commit message generation"
|
|
190
|
-
)
|
|
191
|
-
parser.add_argument(
|
|
192
|
-
"--output",
|
|
193
|
-
"-o",
|
|
194
|
-
type=Path,
|
|
195
|
-
default=Path("artifacts/commit_context.txt"),
|
|
196
|
-
help="Output file path (default: artifacts/commit_context.txt)",
|
|
197
|
-
)
|
|
198
|
-
args = parser.parse_args(argv)
|
|
199
|
-
|
|
200
|
-
try:
|
|
201
|
-
collect_commit_context(args.output)
|
|
202
|
-
return 0
|
|
203
|
-
except subprocess.CalledProcessError as e:
|
|
204
|
-
print(f"Git command failed: {e}", file=sys.stderr)
|
|
205
|
-
return 1
|
|
206
|
-
except Exception as e:
|
|
207
|
-
print(f"Error: {e}", file=sys.stderr)
|
|
208
|
-
return 1
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if __name__ == "__main__":
|
|
212
|
-
sys.exit(main())
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"""Compatibility wrapper for extension-side PR context collection.
|
|
2
|
-
|
|
3
|
-
Purpose:
|
|
4
|
-
Preserve the historical bundled-script entry point while delegating all
|
|
5
|
-
collection/rendering behavior to the bundled package implementation.
|
|
6
|
-
|
|
7
|
-
Usage:
|
|
8
|
-
python collect_pr_context.py --base <ref> --repo-root <path> \
|
|
9
|
-
--out <path> --appendix-out <path>
|
|
10
|
-
|
|
11
|
-
Flow:
|
|
12
|
-
1. Ensure `resources/scripts/` is importable at runtime.
|
|
13
|
-
2. Import `dev_tools.pr_context.collector.main` from bundled sources.
|
|
14
|
-
3. Invoke collector entrypoint in-process with unmodified CLI args.
|
|
15
|
-
|
|
16
|
-
Invariants / Constraints:
|
|
17
|
-
- No PR context rendering logic is implemented in this wrapper.
|
|
18
|
-
- Argument contract is owned by the collector module and forwarded unchanged.
|
|
19
|
-
|
|
20
|
-
Side Effects:
|
|
21
|
-
Imports bundled collector code and executes it in the current Python process.
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
from __future__ import annotations
|
|
25
|
-
|
|
26
|
-
import importlib
|
|
27
|
-
import sys
|
|
28
|
-
from pathlib import Path
|
|
29
|
-
from typing import TYPE_CHECKING, cast
|
|
30
|
-
|
|
31
|
-
if TYPE_CHECKING:
|
|
32
|
-
from collections.abc import Callable
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def _ensure_bundled_scripts_import_path() -> None:
|
|
36
|
-
"""Prepend bundled `resources/scripts` directory to ``sys.path``.
|
|
37
|
-
|
|
38
|
-
Purpose:
|
|
39
|
-
Make extension-bundled Python packages importable regardless of the
|
|
40
|
-
destination workspace layout.
|
|
41
|
-
|
|
42
|
-
Side Effects:
|
|
43
|
-
Mutates ``sys.path`` by inserting the bundled scripts directory at
|
|
44
|
-
index 0 when not already present.
|
|
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 bundled PR-context collector entrypoint in-process.
|
|
55
|
-
|
|
56
|
-
Purpose:
|
|
57
|
-
Keep the bundled extension script as a thin adapter and avoid duplicated
|
|
58
|
-
PR-context business logic while preserving collector-owned CLI parsing.
|
|
59
|
-
|
|
60
|
-
Returns:
|
|
61
|
-
Exit code from bundled collector main function.
|
|
62
|
-
|
|
63
|
-
Side Effects:
|
|
64
|
-
Imports the bundled collector module and executes its CLI flow.
|
|
65
|
-
"""
|
|
66
|
-
_ensure_bundled_scripts_import_path()
|
|
67
|
-
collector_module = importlib.import_module("dev_tools.pr_context.collector")
|
|
68
|
-
collector_main = cast("Callable[[], int]", collector_module.main)
|
|
69
|
-
|
|
70
|
-
return collector_main()
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if __name__ == "__main__":
|
|
74
|
-
raise SystemExit(main())
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def main() -> None:
|
|
5
|
-
output_file = Path("artifacts/hello_python.txt")
|
|
6
|
-
output_file.parent.mkdir(parents=True, exist_ok=True)
|
|
7
|
-
output_file.write_text("hello_python:ok\n", encoding="utf-8")
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if __name__ == "__main__":
|
|
11
|
-
main()
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"""Compatibility wrapper for extension-side active feature folder creation.
|
|
2
|
-
|
|
3
|
-
Purpose:
|
|
4
|
-
Preserve the bundled-script entry point while delegating folder-creation
|
|
5
|
-
behavior to the bundled package implementation.
|
|
6
|
-
|
|
7
|
-
Usage:
|
|
8
|
-
python new_active_feature_folder.py --feature-name <name> --type <type> \
|
|
9
|
-
[--issue-number <number>] --work-mode <mode>
|
|
10
|
-
|
|
11
|
-
Flow:
|
|
12
|
-
1. Ensure `resources/scripts/` is importable at runtime.
|
|
13
|
-
2. Import `dev_tools.new_active_feature_folder` from bundled sources.
|
|
14
|
-
3. Invoke the bundled CLI entrypoint in-process with unmodified CLI args.
|
|
15
|
-
|
|
16
|
-
Invariants / Constraints:
|
|
17
|
-
- No feature-folder business logic is implemented in this wrapper.
|
|
18
|
-
- Argument contract is owned by the bundled folder-creation module and
|
|
19
|
-
forwarded unchanged.
|
|
20
|
-
|
|
21
|
-
Side Effects:
|
|
22
|
-
Imports bundled folder-creation code and executes it in the current Python
|
|
23
|
-
process.
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
from __future__ import annotations
|
|
27
|
-
|
|
28
|
-
import importlib
|
|
29
|
-
import sys
|
|
30
|
-
from pathlib import Path
|
|
31
|
-
from typing import TYPE_CHECKING, cast
|
|
32
|
-
|
|
33
|
-
if TYPE_CHECKING:
|
|
34
|
-
from collections.abc import Callable
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def _ensure_bundled_scripts_import_path() -> None:
|
|
38
|
-
"""Prepend bundled `resources/scripts` directory to ``sys.path``."""
|
|
39
|
-
scripts_dir = Path(__file__).resolve().parent.parent / "scripts"
|
|
40
|
-
scripts_dir_str = str(scripts_dir)
|
|
41
|
-
|
|
42
|
-
if scripts_dir_str not in sys.path:
|
|
43
|
-
sys.path.insert(0, scripts_dir_str)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def main() -> int:
|
|
47
|
-
"""Execute bundled active-feature-folder entrypoint in-process.
|
|
48
|
-
|
|
49
|
-
Injects ``--template-root`` pointing to the extension's bundled
|
|
50
|
-
``feature-templates`` directory so the downstream module resolves
|
|
51
|
-
templates from the extension rather than the workspace.
|
|
52
|
-
"""
|
|
53
|
-
_ensure_bundled_scripts_import_path()
|
|
54
|
-
|
|
55
|
-
# Compute the bundled template root relative to this wrapper script.
|
|
56
|
-
template_root = str(Path(__file__).resolve().parent.parent / "feature-templates")
|
|
57
|
-
if "--template-root" not in sys.argv:
|
|
58
|
-
sys.argv.extend(["--template-root", template_root])
|
|
59
|
-
|
|
60
|
-
module = importlib.import_module("dev_tools.new_active_feature_folder")
|
|
61
|
-
module_main = cast("Callable[[], None]", module.main)
|
|
62
|
-
module_main()
|
|
63
|
-
return 0
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if __name__ == "__main__":
|
|
67
|
-
raise SystemExit(main())
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"""Compatibility wrapper for extension-side potential bug entry creation.
|
|
2
|
-
|
|
3
|
-
Purpose:
|
|
4
|
-
Preserve the bundled-script entry point while delegating bug-entry creation
|
|
5
|
-
behavior to the bundled package implementation.
|
|
6
|
-
|
|
7
|
-
Usage:
|
|
8
|
-
python new_potential_bug_entry.py --short-name <name> [--template-root <path>]
|
|
9
|
-
|
|
10
|
-
Flow:
|
|
11
|
-
1. Ensure `resources/scripts/` is importable at runtime.
|
|
12
|
-
2. Import `dev_tools.new_potential_bug_entry` from bundled sources.
|
|
13
|
-
3. Invoke the bundled CLI entrypoint in-process with unmodified CLI args.
|
|
14
|
-
|
|
15
|
-
Invariants / Constraints:
|
|
16
|
-
- No bug-entry business logic is implemented in this wrapper.
|
|
17
|
-
- Argument contract is owned by the bundled bug-entry module and forwarded
|
|
18
|
-
unchanged.
|
|
19
|
-
|
|
20
|
-
Side Effects:
|
|
21
|
-
Imports bundled bug-entry code and executes it in the current Python process.
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
from __future__ import annotations
|
|
25
|
-
|
|
26
|
-
import importlib
|
|
27
|
-
import sys
|
|
28
|
-
from pathlib import Path
|
|
29
|
-
from typing import TYPE_CHECKING, cast
|
|
30
|
-
|
|
31
|
-
if TYPE_CHECKING:
|
|
32
|
-
from collections.abc import Callable
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def _ensure_bundled_scripts_import_path() -> None:
|
|
36
|
-
"""Prepend bundled `resources/scripts` directory to ``sys.path``."""
|
|
37
|
-
scripts_dir = Path(__file__).resolve().parent.parent / "scripts"
|
|
38
|
-
scripts_dir_str = str(scripts_dir)
|
|
39
|
-
|
|
40
|
-
if scripts_dir_str not in sys.path:
|
|
41
|
-
sys.path.insert(0, scripts_dir_str)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def main() -> int:
|
|
45
|
-
"""Execute bundled potential-bug-entry entrypoint in-process."""
|
|
46
|
-
_ensure_bundled_scripts_import_path()
|
|
47
|
-
module = importlib.import_module("dev_tools.new_potential_bug_entry")
|
|
48
|
-
module_main = cast("Callable[[], None]", module.main)
|
|
49
|
-
module_main()
|
|
50
|
-
return 0
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if __name__ == "__main__":
|
|
54
|
-
raise SystemExit(main())
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"""Compatibility wrapper for extension-side potential-to-issue promotion.
|
|
2
|
-
|
|
3
|
-
Purpose:
|
|
4
|
-
Preserve the bundled-script entry point while delegating promotion behavior
|
|
5
|
-
to the bundled package implementation.
|
|
6
|
-
|
|
7
|
-
Usage:
|
|
8
|
-
python potential_to_issue.py --potential-path <path> --promotion-type <type> \
|
|
9
|
-
--work-mode <mode>
|
|
10
|
-
|
|
11
|
-
Flow:
|
|
12
|
-
1. Ensure `resources/scripts/` is importable at runtime.
|
|
13
|
-
2. Import `dev_tools.potential_to_issue` from bundled sources.
|
|
14
|
-
3. Invoke the bundled CLI entrypoint in-process with unmodified CLI args.
|
|
15
|
-
|
|
16
|
-
Invariants / Constraints:
|
|
17
|
-
- No promotion business logic is implemented in this wrapper.
|
|
18
|
-
- Argument contract is owned by the bundled promotion module and forwarded
|
|
19
|
-
unchanged.
|
|
20
|
-
|
|
21
|
-
Side Effects:
|
|
22
|
-
Imports bundled promotion 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 potential-to-issue entrypoint in-process."""
|
|
47
|
-
_ensure_bundled_scripts_import_path()
|
|
48
|
-
module = importlib.import_module("dev_tools.potential_to_issue")
|
|
49
|
-
module_main = cast("Callable[[], None]", module.main)
|
|
50
|
-
module_main()
|
|
51
|
-
return 0
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if __name__ == "__main__":
|
|
55
|
-
raise SystemExit(main())
|