forgexa-cli 1.101.0__tar.gz → 1.102.0__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.101.0 → forgexa_cli-1.102.0}/PKG-INFO +1 -1
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/__init__.py +1 -1
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/code_review_rules.py +4 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/daemon.py +55 -8
- forgexa_cli-1.102.0/forgexa_cli/ocr_adapter.py +1066 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli.egg-info/PKG-INFO +1 -1
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli.egg-info/SOURCES.txt +1 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/pyproject.toml +1 -1
- forgexa_cli-1.102.0/tests/test_delivery_review_packaged.py +73 -0
- forgexa_cli-1.101.0/forgexa_cli/ocr_adapter.py +0 -423
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/README.md +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/_build_config.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/_local_bind.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/agent_core.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/autoupgrade.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/aws_evidence.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/aws_logs_evidence.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/component_runtime.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/main.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/observability_contract.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/observability_evidence.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/py.typed +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/runtime_evidence.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/workspace_storage.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli/zcode_protocol.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli.egg-info/dependency_links.txt +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli.egg-info/entry_points.txt +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli.egg-info/requires.txt +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/forgexa_cli.egg-info/top_level.txt +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/setup.cfg +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_auth_and_runtime_commands.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_autoupgrade.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_check_command.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_expiry_warnings_and_revoke.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_local_bind_commands.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_publish_script.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_runtime_credentials.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_session_credentials.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_silent_install.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_upgrade_observability.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.102.0}/tests/test_workspace_storage.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""forgexa-cli — Forgexa command-line client."""
|
|
2
|
-
__version__ = "1.
|
|
2
|
+
__version__ = "1.102.0"
|
|
@@ -38,6 +38,10 @@ def _valid_path(value, *, pattern=False):
|
|
|
38
38
|
return str(PurePosixPath(value)) == value
|
|
39
39
|
|
|
40
40
|
|
|
41
|
+
def is_valid_review_path(value):
|
|
42
|
+
return _valid_path(value)
|
|
43
|
+
|
|
44
|
+
|
|
41
45
|
def validate_rule_package(template, rule_sections):
|
|
42
46
|
if not isinstance(template, str) or not template.strip() or not isinstance(rule_sections, list):
|
|
43
47
|
raise ValueError("A core rule and a list of rule sections are required")
|
|
@@ -91,6 +91,14 @@ except ImportError:
|
|
|
91
91
|
except ImportError:
|
|
92
92
|
import code_review_rules # type: ignore[no-redef]
|
|
93
93
|
|
|
94
|
+
try:
|
|
95
|
+
from app import ocr_adapter
|
|
96
|
+
except ImportError:
|
|
97
|
+
try:
|
|
98
|
+
from . import ocr_adapter # type: ignore[no-redef]
|
|
99
|
+
except ImportError:
|
|
100
|
+
import ocr_adapter # type: ignore[no-redef]
|
|
101
|
+
|
|
94
102
|
try:
|
|
95
103
|
from app.zcode_protocol import (
|
|
96
104
|
ZCodeProtocolError,
|
|
@@ -1420,7 +1428,7 @@ except (ImportError, ModuleNotFoundError):
|
|
|
1420
1428
|
# DAEMON_VERSION is the protocol/logic version of the daemon code.
|
|
1421
1429
|
# Kept in sync with pyproject.toml version via bump-version.sh.
|
|
1422
1430
|
# CLIENT_TYPE identifies which packaging/distribution this daemon runs in.
|
|
1423
|
-
DAEMON_VERSION = "1.
|
|
1431
|
+
DAEMON_VERSION = "1.102.0"
|
|
1424
1432
|
|
|
1425
1433
|
|
|
1426
1434
|
def _detect_client_type() -> str:
|
|
@@ -6603,7 +6611,7 @@ def _workspace_has_recent_activity(
|
|
|
6603
6611
|
|
|
6604
6612
|
def _delivery_review_capabilities() -> dict:
|
|
6605
6613
|
if sys.platform == "darwin" and shutil.which("sandbox-exec"):
|
|
6606
|
-
return {"delivery_code_review": {"protocol_version": 2}}
|
|
6614
|
+
return {"delivery_code_review": {"protocol_version": 2, "ocr_delegation_version": 1}}
|
|
6607
6615
|
return {}
|
|
6608
6616
|
|
|
6609
6617
|
|
|
@@ -6612,7 +6620,12 @@ def _delivery_review_sandbox_command(command: list[str], workspace: Path, home:
|
|
|
6612
6620
|
sandbox = shutil.which("sandbox-exec") if sys.platform == "darwin" else None
|
|
6613
6621
|
if not sandbox:
|
|
6614
6622
|
raise RuntimeError("delivery_review_sandbox_unavailable")
|
|
6615
|
-
|
|
6623
|
+
claude_tmp = Path("/tmp").resolve() / f"claude-{os.getuid()}"
|
|
6624
|
+
allowed = [
|
|
6625
|
+
f"(subpath {json.dumps(str(home.resolve()))})",
|
|
6626
|
+
f"(subpath {json.dumps(str(claude_tmp))})",
|
|
6627
|
+
'(literal "/dev/null")',
|
|
6628
|
+
]
|
|
6616
6629
|
if writable:
|
|
6617
6630
|
allowed.append(f"(subpath {json.dumps(str(workspace.resolve()))})")
|
|
6618
6631
|
profile = "(version 1)(allow default)(deny file-write*)(allow file-write* " + " ".join(allowed) + ")"
|
|
@@ -14806,9 +14819,16 @@ class RuntimeDaemon:
|
|
|
14806
14819
|
return failed("delivery_review_fix_failed", "The selected repair could not be applied or pushed")
|
|
14807
14820
|
|
|
14808
14821
|
async def _execute_delivery_code_review(self, task, agent, workspace_path) -> TaskResult:
|
|
14822
|
+
engine_identity = None
|
|
14823
|
+
|
|
14809
14824
|
def failed(code: str, message: str) -> TaskResult:
|
|
14810
14825
|
return TaskResult(status="failed", exit_code=-1, stdout="", stderr="", failure_code=code,
|
|
14811
|
-
error=message, execution_attempt_id=task.execution_attempt_id
|
|
14826
|
+
error=message, execution_attempt_id=task.execution_attempt_id,
|
|
14827
|
+
metrics={"delivery_review_engine_identity": engine_identity} if engine_identity else {})
|
|
14828
|
+
|
|
14829
|
+
def remember_identity(identity):
|
|
14830
|
+
nonlocal engine_identity
|
|
14831
|
+
engine_identity = identity
|
|
14812
14832
|
|
|
14813
14833
|
if str(getattr(agent, "agent_id", "")).lower() != "claude":
|
|
14814
14834
|
return failed("delivery_review_agent_unsupported", "This agent has no verified read-only delivery review mode")
|
|
@@ -14824,7 +14844,7 @@ class RuntimeDaemon:
|
|
|
14824
14844
|
snapshot = data.get("delivery_review_snapshot")
|
|
14825
14845
|
try:
|
|
14826
14846
|
config = snapshot["config"]
|
|
14827
|
-
if (config["version"] != 2 or config["engine"]
|
|
14847
|
+
if (config["version"] != 2 or config["engine"] not in {"agent", "ocr_delegate"}
|
|
14828
14848
|
or code_review_rules.review_config_sha256(config) != snapshot["review_config_sha256"]):
|
|
14829
14849
|
raise ValueError("Invalid review identity")
|
|
14830
14850
|
if not isinstance(config["context"], dict) or not isinstance(config["additional_instructions"], str):
|
|
@@ -14933,9 +14953,27 @@ class RuntimeDaemon:
|
|
|
14933
14953
|
recheck_by_batch = code_review_rules.assign_recheck_issues(
|
|
14934
14954
|
[batch_paths for batch_paths, _ in batches], selected_issues,
|
|
14935
14955
|
)
|
|
14956
|
+
engine_evidence = None
|
|
14957
|
+
if snapshot is not None and snapshot["config"]["engine"] == "ocr_delegate":
|
|
14958
|
+
try:
|
|
14959
|
+
engine_evidence = await ocr_adapter.run_selected_ocr_range_preview(
|
|
14960
|
+
workspace_path, target, head, base, paths,
|
|
14961
|
+
expected_identity=data.get("delivery_review_engine_identity"),
|
|
14962
|
+
timeout=min(float(task.timeout_seconds or 30), 60), on_identity=remember_identity,
|
|
14963
|
+
)
|
|
14964
|
+
except ocr_adapter.OcrAdapterError as error:
|
|
14965
|
+
return failed(error.code, "Open Code Review could not safely cover the fixed review range")
|
|
14936
14966
|
if not paths and not recheck:
|
|
14967
|
+
if engine_identity:
|
|
14968
|
+
try:
|
|
14969
|
+
await ocr_adapter.verify_selected_ocr_identity(engine_identity)
|
|
14970
|
+
except ocr_adapter.OcrAdapterError as error:
|
|
14971
|
+
return failed(error.code, "The selected Open Code Review instance changed during review")
|
|
14937
14972
|
return TaskResult(status="success", exit_code=0, stdout="", stderr="", git=git,
|
|
14938
|
-
metrics={"delivery_code_review": metadata
|
|
14973
|
+
metrics={"delivery_code_review": metadata,
|
|
14974
|
+
**({"delivery_review_engine_identity": engine_identity,
|
|
14975
|
+
"delivery_review_engine_evidence": engine_evidence} if engine_evidence else {})},
|
|
14976
|
+
has_verified_completion=True,
|
|
14939
14977
|
critic_review={"collection_status": "not_applicable"},
|
|
14940
14978
|
execution_attempt_id=task.execution_attempt_id)
|
|
14941
14979
|
if paths and not diff:
|
|
@@ -14990,7 +15028,8 @@ class RuntimeDaemon:
|
|
|
14990
15028
|
rules = (
|
|
14991
15029
|
"\nApproved review rules are subordinate to the platform's fixed scope, "
|
|
14992
15030
|
"read-only permissions, output contract and human decisions. "
|
|
14993
|
-
"Report conflicts instead of changing those requirements
|
|
15031
|
+
"Report conflicts instead of changing those requirements. "
|
|
15032
|
+
"An issue may include confidence as an integer from 1 to 10; it is a self-assessment, not a gate.\n\nCore rules:\n"
|
|
14994
15033
|
+ config["rule_package"]["template"]
|
|
14995
15034
|
+ "\n\nProject additions:\n" + config["additional_instructions"]
|
|
14996
15035
|
)
|
|
@@ -15103,8 +15142,16 @@ class RuntimeDaemon:
|
|
|
15103
15142
|
report["rechecked_issues"] = rechecked
|
|
15104
15143
|
if len(issues) > 100 or len(json.dumps(report, ensure_ascii=False).encode("utf-8")) > 100_000:
|
|
15105
15144
|
return failed("delivery_review_output_invalid", "The complete review result exceeds the available output scope")
|
|
15145
|
+
if engine_identity:
|
|
15146
|
+
try:
|
|
15147
|
+
await ocr_adapter.verify_selected_ocr_identity(engine_identity)
|
|
15148
|
+
except ocr_adapter.OcrAdapterError as error:
|
|
15149
|
+
return failed(error.code, "The selected Open Code Review instance changed during review")
|
|
15106
15150
|
return TaskResult(status="success", exit_code=0, stdout="", stderr="", git=git,
|
|
15107
|
-
metrics={**combined_metrics, "delivery_code_review": metadata
|
|
15151
|
+
metrics={**combined_metrics, "delivery_code_review": metadata,
|
|
15152
|
+
**({"delivery_review_engine_identity": engine_identity,
|
|
15153
|
+
"delivery_review_engine_evidence": engine_evidence} if engine_evidence else {})},
|
|
15154
|
+
has_verified_completion=True,
|
|
15108
15155
|
critic_review={"collection_status": "completed", "result": report, "agent_used": "claude"},
|
|
15109
15156
|
execution_attempt_id=task.execution_attempt_id)
|
|
15110
15157
|
|