forgexa-cli 1.104.2__tar.gz → 1.104.3__tar.gz
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.
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/PKG-INFO +1 -1
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/__init__.py +1 -1
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/agent_core.py +89 -2
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/daemon.py +48 -46
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli.egg-info/PKG-INFO +1 -1
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/pyproject.toml +1 -1
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/README.md +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/_build_config.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/_local_bind.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/autoupgrade.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/aws_evidence.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/aws_logs_evidence.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/code_review_rules.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/component_runtime.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/main.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/observability_contract.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/observability_evidence.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/ocr_adapter.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/py.typed +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/runtime_evidence.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/workspace_storage.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli/zcode_protocol.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli.egg-info/SOURCES.txt +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli.egg-info/dependency_links.txt +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli.egg-info/entry_points.txt +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli.egg-info/requires.txt +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/forgexa_cli.egg-info/top_level.txt +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/setup.cfg +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_auth_and_runtime_commands.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_autoupgrade.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_check_command.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_delivery_review_packaged.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_expiry_warnings_and_revoke.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_local_bind_commands.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_publish_script.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_runtime_credentials.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_session_credentials.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_silent_install.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_upgrade_observability.py +0 -0
- {forgexa_cli-1.104.2 → forgexa_cli-1.104.3}/tests/test_workspace_storage.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""forgexa-cli — Forgexa command-line client."""
|
|
2
|
-
__version__ = "1.104.
|
|
2
|
+
__version__ = "1.104.3"
|
|
@@ -3731,13 +3731,28 @@ DELIVERY_REVIEW_AGENT_IDS = frozenset({
|
|
|
3731
3731
|
"claude", "codebuddy", "codex", "copilot", "deepseek", "gemini", "kimi",
|
|
3732
3732
|
"mimo", "minimax", "opencode", "qoder", "qwen", "trae", "zcode",
|
|
3733
3733
|
})
|
|
3734
|
-
LINUX_DELIVERY_REVIEW_AGENT_IDS = frozenset({"claude", "copilot", "opencode"})
|
|
3735
3734
|
DELIVERY_REVIEW_SENSITIVE_PATTERNS = (
|
|
3736
3735
|
r"/[.]env([.][^/]*)?$", r"[.](pem|key|p12|pfx)$", r"/(id_rsa|id_ed25519)([.][^/]*)?$",
|
|
3737
3736
|
r"/[.]aws/credentials$", r"/[.](npmrc|netrc)$", r"/[.]git(/|$)",
|
|
3738
3737
|
)
|
|
3739
3738
|
|
|
3740
3739
|
|
|
3740
|
+
def delivery_review_candidate(input_data: dict | None, workspace_resolution: str = "cloud_worktree") -> dict | None:
|
|
3741
|
+
data = input_data if isinstance(input_data, dict) else {}
|
|
3742
|
+
candidate = data.get("delivery_review_candidate")
|
|
3743
|
+
if (workspace_resolution != "cloud_worktree" or data.get("task") != "delivery_code_review"
|
|
3744
|
+
or not isinstance(candidate, dict) or type(candidate.get("version")) is not int or candidate["version"] != 1
|
|
3745
|
+
or not isinstance(candidate.get("source_delivery_node_id"), str)
|
|
3746
|
+
or candidate["source_delivery_node_id"] != data.get("source_delivery_node_id")
|
|
3747
|
+
or any(not isinstance(candidate.get(key), str) or not candidate[key] for key in ("repo_identity", "branch", "target_branch"))
|
|
3748
|
+
or any(not isinstance(candidate.get(key), str) or not re.fullmatch(r"[a-f0-9]{40}|[a-f0-9]{64}", candidate[key])
|
|
3749
|
+
for key in ("head_sha", "target_sha"))
|
|
3750
|
+
or any(data.get(field) is not None and data[field] != candidate[key]
|
|
3751
|
+
for field, key in (("delivery_review_expected_head", "head_sha"), ("delivery_review_expected_target", "target_sha")))):
|
|
3752
|
+
return None
|
|
3753
|
+
return candidate
|
|
3754
|
+
|
|
3755
|
+
|
|
3741
3756
|
def delivery_review_sandbox_exec() -> str | None:
|
|
3742
3757
|
if sys.platform not in {"darwin", "linux"}:
|
|
3743
3758
|
return None
|
|
@@ -3747,7 +3762,7 @@ def delivery_review_sandbox_exec() -> str | None:
|
|
|
3747
3762
|
if sys.platform == "linux":
|
|
3748
3763
|
try:
|
|
3749
3764
|
probe = subprocess.run(
|
|
3750
|
-
[executable, "--unshare-all", "--die-with-parent", "--new-session",
|
|
3765
|
+
[executable, "--unshare-all", "--share-net", "--die-with-parent", "--new-session",
|
|
3751
3766
|
"--ro-bind", "/", "/", "--proc", "/proc", "--dev", "/dev", "--", "/bin/true"],
|
|
3752
3767
|
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=3, check=False,
|
|
3753
3768
|
)
|
|
@@ -3758,6 +3773,66 @@ def delivery_review_sandbox_exec() -> str | None:
|
|
|
3758
3773
|
return executable
|
|
3759
3774
|
|
|
3760
3775
|
|
|
3776
|
+
def delivery_review_linux_command(
|
|
3777
|
+
command: list[str], *, cwd: Path, home: Path, writable: bool = False, network: bool = True,
|
|
3778
|
+
read_paths: list[Path] | None = None, write_paths: list[Path] | None = None,
|
|
3779
|
+
read_only_paths: list[Path] | None = None, deny_paths: list[Path] | None = None,
|
|
3780
|
+
) -> list[str]:
|
|
3781
|
+
sandbox = delivery_review_sandbox_exec()
|
|
3782
|
+
if sys.platform != "linux" or not sandbox:
|
|
3783
|
+
raise RuntimeError("delivery_review_sandbox_unavailable")
|
|
3784
|
+
user_home, workspace, isolated_home = Path.home().resolve(), cwd.resolve(), home.resolve()
|
|
3785
|
+
roots = {path.resolve() for path in (read_paths or [])}
|
|
3786
|
+
writable_roots = {path.resolve() for path in (write_paths or [])}
|
|
3787
|
+
readonly_roots = {path.resolve() for path in (read_only_paths or [])}
|
|
3788
|
+
if (workspace == isolated_home or workspace in isolated_home.parents or isolated_home in workspace.parents
|
|
3789
|
+
or any(path == user_home or path in user_home.parents for path in {workspace, isolated_home, *roots, *writable_roots, *readonly_roots})
|
|
3790
|
+
or not writable and any(path == workspace or path in workspace.parents or workspace in path.parents for path in writable_roots)):
|
|
3791
|
+
raise RuntimeError("delivery_review_sandbox_scope_invalid")
|
|
3792
|
+
wrapped = [sandbox, "--unshare-all", "--die-with-parent", "--new-session", "--cap-drop", "ALL"]
|
|
3793
|
+
if network:
|
|
3794
|
+
wrapped.append("--share-net")
|
|
3795
|
+
for path in (
|
|
3796
|
+
"/usr", "/bin", "/sbin", "/lib", "/lib64", "/etc/ssl/certs", "/etc/ca-certificates", "/etc/pki",
|
|
3797
|
+
"/etc/resolv.conf", "/etc/hosts", "/etc/nsswitch.conf", "/etc/gai.conf", "/etc/localtime",
|
|
3798
|
+
"/etc/passwd", "/etc/group", "/etc/ld.so.cache", "/etc/alternatives",
|
|
3799
|
+
):
|
|
3800
|
+
if Path(path).exists():
|
|
3801
|
+
wrapped += ["--ro-bind", path, path]
|
|
3802
|
+
wrapped += ["--proc", "/proc", "--dev", "/dev", "--tmpfs", "/tmp", "--tmpfs", "/var/tmp"]
|
|
3803
|
+
for path in sorted(roots):
|
|
3804
|
+
if path.exists():
|
|
3805
|
+
if not path.is_dir() and not path.is_file():
|
|
3806
|
+
raise RuntimeError("delivery_review_sandbox_scope_invalid")
|
|
3807
|
+
wrapped += ["--ro-bind", str(path), str(path)]
|
|
3808
|
+
wrapped += ["--bind" if writable else "--ro-bind", str(workspace), str(workspace)]
|
|
3809
|
+
wrapped += ["--bind", str(isolated_home), str(isolated_home)]
|
|
3810
|
+
for path in sorted(writable_roots):
|
|
3811
|
+
if path.exists():
|
|
3812
|
+
wrapped += ["--bind", str(path), str(path)]
|
|
3813
|
+
for path in sorted(readonly_roots):
|
|
3814
|
+
if path.exists():
|
|
3815
|
+
wrapped += ["--ro-bind", str(path), str(path)]
|
|
3816
|
+
protected = {path.resolve() for path in (deny_paths or [])}
|
|
3817
|
+
for root in {workspace, isolated_home, *writable_roots, *readonly_roots, *(path for path in roots if str(path) != "/usr" and not str(path).startswith(("/usr/", "/bin", "/sbin", "/lib")))}:
|
|
3818
|
+
if any(re.search(pattern, str(root)) for pattern in DELIVERY_REVIEW_SENSITIVE_PATTERNS):
|
|
3819
|
+
protected.add(root)
|
|
3820
|
+
continue
|
|
3821
|
+
for directory, directories, files in os.walk(root, followlinks=False):
|
|
3822
|
+
for name in [*directories, *files]:
|
|
3823
|
+
path = Path(directory) / name
|
|
3824
|
+
if any(re.search(pattern, str(path)) for pattern in DELIVERY_REVIEW_SENSITIVE_PATTERNS):
|
|
3825
|
+
protected.add(path)
|
|
3826
|
+
if name in directories:
|
|
3827
|
+
directories.remove(name)
|
|
3828
|
+
for path in sorted(protected):
|
|
3829
|
+
if path.is_dir():
|
|
3830
|
+
wrapped += ["--tmpfs", str(path)]
|
|
3831
|
+
elif path.exists() or path.is_symlink():
|
|
3832
|
+
wrapped += ["--ro-bind", "/dev/null", str(path)]
|
|
3833
|
+
return [*wrapped, "--chdir", str(workspace), "--", *command]
|
|
3834
|
+
|
|
3835
|
+
|
|
3761
3836
|
_OPENCODE_WORKER_DENIED_TOOLS = (
|
|
3762
3837
|
"task", "subagent", "delegate_task", "call_omo_agent",
|
|
3763
3838
|
"background_output", "background_cancel",
|
|
@@ -4180,6 +4255,12 @@ def _minimax_sandbox(
|
|
|
4180
4255
|
if not sandbox:
|
|
4181
4256
|
raise RuntimeError("MiniMax delivery review sandbox is unavailable")
|
|
4182
4257
|
return [sandbox, "-p", "\n".join(profile), *command]
|
|
4258
|
+
if delivery_review:
|
|
4259
|
+
return delivery_review_linux_command(
|
|
4260
|
+
command, cwd=cwd, home=temporary_root, writable=not read_only,
|
|
4261
|
+
read_paths=[root, Path(admission["build"]["package_root"]).parents[1], Path(admission["build"]["node"]).parent.parent],
|
|
4262
|
+
write_paths=[root / "data"], read_only_paths=protected,
|
|
4263
|
+
)
|
|
4183
4264
|
wrapped = ["bwrap", "--die-with-parent", "--new-session", "--ro-bind", "/", "/",
|
|
4184
4265
|
"--tmpfs", str(Path.home()), "--dev", "/dev", "--proc", "/proc"]
|
|
4185
4266
|
for path in (Path(admission["build"]["package_root"]).parents[1],
|
|
@@ -5022,6 +5103,12 @@ def deepseek_harness_sandbox_command(
|
|
|
5022
5103
|
)
|
|
5023
5104
|
return [sandbox, "-p", profile, *command]
|
|
5024
5105
|
if sys.platform == "linux":
|
|
5106
|
+
if delivery_review:
|
|
5107
|
+
return delivery_review_linux_command(
|
|
5108
|
+
command, cwd=cwd, home=home, writable=not read_only,
|
|
5109
|
+
read_paths=[*(read_paths or []), *([credentials_path] if credentials_path else [])],
|
|
5110
|
+
write_paths=[temporary_root], read_only_paths=git_roots,
|
|
5111
|
+
)
|
|
5025
5112
|
sandbox = shutil.which("bwrap")
|
|
5026
5113
|
if not sandbox:
|
|
5027
5114
|
raise RuntimeError("DeepSeek Harness requires a working bubblewrap outer sandbox")
|
|
@@ -1428,7 +1428,7 @@ except (ImportError, ModuleNotFoundError):
|
|
|
1428
1428
|
# DAEMON_VERSION is the protocol/logic version of the daemon code.
|
|
1429
1429
|
# Kept in sync with pyproject.toml version via bump-version.sh.
|
|
1430
1430
|
# CLIENT_TYPE identifies which packaging/distribution this daemon runs in.
|
|
1431
|
-
DAEMON_VERSION = "1.104.
|
|
1431
|
+
DAEMON_VERSION = "1.104.3"
|
|
1432
1432
|
|
|
1433
1433
|
|
|
1434
1434
|
def _detect_client_type() -> str:
|
|
@@ -3963,6 +3963,38 @@ class WorkspaceManager:
|
|
|
3963
3963
|
if task.workspace_resolution == "local_bind":
|
|
3964
3964
|
return await self._bind_local_workspace(project, task, runtime_id=runtime_id)
|
|
3965
3965
|
|
|
3966
|
+
candidate = agent_core.delivery_review_candidate(task.input_data, task.workspace_resolution)
|
|
3967
|
+
if candidate is not None:
|
|
3968
|
+
self._ensure_dirs()
|
|
3969
|
+
project_key, repo_url, _ = self._configure_project_git_auth(project)
|
|
3970
|
+
if _normalize_repo_identity(repo_url) != candidate["repo_identity"] or task.workspace_branch != candidate["branch"]:
|
|
3971
|
+
raise RuntimeError("delivery_review_candidate_changed: repository or branch identity does not match")
|
|
3972
|
+
parent = self.projects_root / ".delivery-reviews"
|
|
3973
|
+
parent.mkdir(parents=True, exist_ok=True)
|
|
3974
|
+
workspace_path = Path(tempfile.mkdtemp(prefix="candidate-", dir=str(parent)))
|
|
3975
|
+
try:
|
|
3976
|
+
await self._git("check-ref-format", f"refs/heads/{candidate['branch']}", cwd=workspace_path, timeout=10)
|
|
3977
|
+
await self._git("check-ref-format", f"refs/heads/{candidate['target_branch']}", cwd=workspace_path, timeout=10)
|
|
3978
|
+
await self._git("init", "--quiet", "--template=", f"--object-format={'sha256' if len(candidate['head_sha']) == 64 else 'sha1'}", cwd=workspace_path, timeout=10)
|
|
3979
|
+
await self._git("config", "core.hooksPath", os.devnull, cwd=workspace_path, timeout=10)
|
|
3980
|
+
await self._git("config", "core.autocrlf", "false", cwd=workspace_path, timeout=10)
|
|
3981
|
+
await self._git("remote", "add", "origin", repo_url, cwd=workspace_path, timeout=10)
|
|
3982
|
+
await self._git("fetch", "--no-tags", "--no-recurse-submodules", "--no-write-fetch-head", "--refmap=",
|
|
3983
|
+
"origin", candidate["head_sha"], candidate["target_sha"],
|
|
3984
|
+
cwd=workspace_path, timeout=120, project_key=project_key)
|
|
3985
|
+
await self._git("update-ref", f"refs/remotes/origin/{candidate['target_branch']}", candidate["target_sha"], cwd=workspace_path, timeout=10)
|
|
3986
|
+
await self._git("checkout", "--quiet", "-b", candidate["branch"], candidate["head_sha"], cwd=workspace_path, timeout=60)
|
|
3987
|
+
for commit_sha in task.required_commit_shas:
|
|
3988
|
+
if not isinstance(commit_sha, str) or not re.fullmatch(r"[a-f0-9]{40}|[a-f0-9]{64}", commit_sha):
|
|
3989
|
+
raise ValueError("Invalid predecessor commit")
|
|
3990
|
+
await self._git("merge-base", "--is-ancestor", commit_sha, candidate["head_sha"], cwd=workspace_path, timeout=10)
|
|
3991
|
+
return workspace_path
|
|
3992
|
+
except BaseException as error:
|
|
3993
|
+
shutil.rmtree(workspace_path, ignore_errors=True)
|
|
3994
|
+
if isinstance(error, (OSError, RuntimeError, ValueError, UnicodeError)):
|
|
3995
|
+
raise RuntimeError("delivery_review_candidate_unavailable: the fixed commits could not be reconstructed with authorized project access") from None
|
|
3996
|
+
raise
|
|
3997
|
+
|
|
3966
3998
|
if (task.input_data or {}).get("task") in ("delivery_code_review", "delivery_review_fix", "delivery_review_retest"):
|
|
3967
3999
|
project_key = str(project.get("project_key") or "default")
|
|
3968
4000
|
if not re.fullmatch(r"[a-zA-Z0-9_-]+", project_key):
|
|
@@ -6314,8 +6346,8 @@ class WorkspaceManager:
|
|
|
6314
6346
|
return ws_path
|
|
6315
6347
|
|
|
6316
6348
|
async def cleanup_workspace(self, workspace_path: Path):
|
|
6317
|
-
|
|
6318
|
-
|
|
6349
|
+
if workspace_path.parent.resolve() == (self.projects_root / ".delivery-reviews").resolve():
|
|
6350
|
+
shutil.rmtree(workspace_path, ignore_errors=True)
|
|
6319
6351
|
|
|
6320
6352
|
async def _git(self, *args: str, cwd: Path | str | None = None, timeout: int | None = None,
|
|
6321
6353
|
project_key: str | None = None) -> str:
|
|
@@ -6624,7 +6656,8 @@ def _delivery_review_capabilities() -> dict:
|
|
|
6624
6656
|
return {"delivery_code_review": {
|
|
6625
6657
|
"protocol_version": 2,
|
|
6626
6658
|
"ocr_delegation_version": 1,
|
|
6627
|
-
"
|
|
6659
|
+
"candidate_snapshot_version": 1,
|
|
6660
|
+
"agent_ids": sorted(agent_core.DELIVERY_REVIEW_AGENT_IDS),
|
|
6628
6661
|
}}
|
|
6629
6662
|
return {}
|
|
6630
6663
|
|
|
@@ -6696,45 +6729,10 @@ def _delivery_review_sandbox_command(command: list[str], workspace: Path, home:
|
|
|
6696
6729
|
if any(Path(root) == user_home_path or Path(root) in user_home_path.parents for root in read_roots):
|
|
6697
6730
|
raise RuntimeError("delivery_review_sandbox_scope_invalid")
|
|
6698
6731
|
if sys.platform == "linux":
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
system_paths = (
|
|
6703
|
-
"/usr", "/bin", "/sbin", "/lib", "/lib64", "/etc/ssl/certs", "/etc/ca-certificates",
|
|
6704
|
-
"/etc/pki", "/etc/resolv.conf", "/etc/hosts", "/etc/nsswitch.conf", "/etc/gai.conf",
|
|
6705
|
-
"/etc/localtime", "/etc/passwd", "/etc/group", "/etc/ld.so.cache", "/etc/alternatives",
|
|
6732
|
+
return agent_core.delivery_review_linux_command(
|
|
6733
|
+
command, cwd=workspace_path, home=home_path, writable=writable, network=network,
|
|
6734
|
+
read_paths=[Path(root) for root in read_roots], deny_paths=deny_paths,
|
|
6706
6735
|
)
|
|
6707
|
-
for path in system_paths:
|
|
6708
|
-
if Path(path).exists():
|
|
6709
|
-
wrapped += ["--ro-bind", path, path]
|
|
6710
|
-
wrapped += ["--proc", "/proc", "--dev", "/dev", "--tmpfs", "/tmp", "--tmpfs", "/var/tmp"]
|
|
6711
|
-
for root in sorted(read_roots):
|
|
6712
|
-
path = Path(root)
|
|
6713
|
-
if not path.exists():
|
|
6714
|
-
continue
|
|
6715
|
-
if not path.is_dir() and not path.is_file():
|
|
6716
|
-
raise RuntimeError("delivery_review_sandbox_scope_invalid")
|
|
6717
|
-
wrapped += ["--ro-bind", root, root]
|
|
6718
|
-
wrapped += ["--bind" if writable else "--ro-bind", str(workspace_path), str(workspace_path)]
|
|
6719
|
-
wrapped += ["--bind", str(home_path), str(home_path)]
|
|
6720
|
-
protected = {path.absolute() for path in (deny_paths or [])}
|
|
6721
|
-
for root in (workspace_path, home_path, *(Path(path) for path in read_roots if not str(path).startswith(("/usr/", "/bin", "/sbin", "/lib")))):
|
|
6722
|
-
if any(re.search(pattern, str(root)) for pattern in agent_core.DELIVERY_REVIEW_SENSITIVE_PATTERNS):
|
|
6723
|
-
protected.add(root)
|
|
6724
|
-
continue
|
|
6725
|
-
for directory, directories, files in os.walk(root, followlinks=False):
|
|
6726
|
-
for name in [*directories, *files]:
|
|
6727
|
-
path = Path(directory) / name
|
|
6728
|
-
if any(re.search(pattern, str(path)) for pattern in agent_core.DELIVERY_REVIEW_SENSITIVE_PATTERNS):
|
|
6729
|
-
protected.add(path)
|
|
6730
|
-
if name in directories:
|
|
6731
|
-
directories.remove(name)
|
|
6732
|
-
for path in sorted(protected):
|
|
6733
|
-
if path.is_dir():
|
|
6734
|
-
wrapped += ["--tmpfs", str(path)]
|
|
6735
|
-
elif path.exists() or path.is_symlink():
|
|
6736
|
-
wrapped += ["--ro-bind", "/dev/null", str(path)]
|
|
6737
|
-
return [*wrapped, "--chdir", str(workspace_path), "--", *command]
|
|
6738
6736
|
executable_rules = " ".join(f"(subpath {json.dumps(root)})" for root in sorted(read_roots))
|
|
6739
6737
|
metadata_paths = {
|
|
6740
6738
|
str(parent) for root in [*read_roots, str(workspace.resolve()), str(home.resolve())]
|
|
@@ -14029,6 +14027,7 @@ class RuntimeDaemon:
|
|
|
14029
14027
|
workspace_execution_lock: _WorkspaceFileLock | None = None
|
|
14030
14028
|
local_bind_file_lock = None
|
|
14031
14029
|
attachment_staging_dir: Path | None = None
|
|
14030
|
+
workspace_path: Path | None = None
|
|
14032
14031
|
if is_local_bind and task.local_workspace_binding_id:
|
|
14033
14032
|
# OS-level file lock keyed by binding_id (docs/designs/forgexa-
|
|
14034
14033
|
# ide-design.md §6.3): the DB lease (orchestrator.py) prevents
|
|
@@ -15034,6 +15033,8 @@ class RuntimeDaemon:
|
|
|
15034
15033
|
finally:
|
|
15035
15034
|
if self.managed_policy is not None:
|
|
15036
15035
|
await self.managed_policy.finish_task()
|
|
15036
|
+
if workspace_path is not None and agent_core.delivery_review_candidate(task.input_data, task.workspace_resolution) is not None:
|
|
15037
|
+
await self.workspace_manager.cleanup_workspace(workspace_path)
|
|
15037
15038
|
if attachment_staging_dir is not None:
|
|
15038
15039
|
shutil.rmtree(attachment_staging_dir, ignore_errors=True)
|
|
15039
15040
|
if workspace_execution_lock is not None:
|
|
@@ -15324,7 +15325,7 @@ class RuntimeDaemon:
|
|
|
15324
15325
|
dirty = await self.workspace_manager._git(
|
|
15325
15326
|
"--no-optional-locks", "status", "--porcelain=v1", "-z", "--untracked-files=no", cwd=workspace_path, timeout=10,
|
|
15326
15327
|
)
|
|
15327
|
-
if branch != task.workspace_branch or not re.fullmatch(r"[0-9a-f]{40}", head) or dirty:
|
|
15328
|
+
if branch != task.workspace_branch or not re.fullmatch(r"[0-9a-f]{40}|[0-9a-f]{64}", head) or dirty:
|
|
15328
15329
|
return failed("delivery_review_candidate_changed", "The candidate branch or workspace changed")
|
|
15329
15330
|
target_ref = ""
|
|
15330
15331
|
target = ""
|
|
@@ -15338,10 +15339,11 @@ class RuntimeDaemon:
|
|
|
15338
15339
|
break
|
|
15339
15340
|
except RuntimeError:
|
|
15340
15341
|
continue
|
|
15341
|
-
if not target_ref or not re.fullmatch(r"[0-9a-f]{40}", target):
|
|
15342
|
+
if not target_ref or not re.fullmatch(r"[0-9a-f]{40}|[0-9a-f]{64}", target):
|
|
15342
15343
|
return failed("delivery_review_scope_incomplete", "The target branch cannot be resolved")
|
|
15343
|
-
|
|
15344
|
-
|
|
15344
|
+
candidate = agent_core.delivery_review_candidate(task.input_data, task.workspace_resolution) or {}
|
|
15345
|
+
expected_head = (task.input_data or {}).get("delivery_review_expected_head") or candidate.get("head_sha")
|
|
15346
|
+
expected_target = (task.input_data or {}).get("delivery_review_expected_target") or candidate.get("target_sha")
|
|
15345
15347
|
if (expected_head is not None and expected_head != head) or (expected_target is not None and expected_target != target):
|
|
15346
15348
|
return failed("delivery_review_candidate_changed", "The local workspace does not match the requested review version")
|
|
15347
15349
|
preparation_stage = "merge_base"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|