forgexa-cli 1.101.0__tar.gz → 1.101.2__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.101.2}/PKG-INFO +1 -1
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/__init__.py +1 -1
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/code_review_rules.py +4 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/daemon.py +49 -7
- forgexa_cli-1.101.2/forgexa_cli/ocr_adapter.py +1066 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli.egg-info/PKG-INFO +1 -1
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli.egg-info/SOURCES.txt +1 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/pyproject.toml +1 -1
- forgexa_cli-1.101.2/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.101.2}/README.md +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/_build_config.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/_local_bind.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/agent_core.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/autoupgrade.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/aws_evidence.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/aws_logs_evidence.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/component_runtime.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/main.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/observability_contract.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/observability_evidence.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/py.typed +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/runtime_evidence.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/workspace_storage.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli/zcode_protocol.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli.egg-info/dependency_links.txt +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli.egg-info/entry_points.txt +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli.egg-info/requires.txt +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/forgexa_cli.egg-info/top_level.txt +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/setup.cfg +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_auth_and_runtime_commands.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_autoupgrade.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_check_command.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_expiry_warnings_and_revoke.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_local_bind_commands.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_publish_script.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_runtime_credentials.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_session_credentials.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_silent_install.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_upgrade_observability.py +0 -0
- {forgexa_cli-1.101.0 → forgexa_cli-1.101.2}/tests/test_workspace_storage.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""forgexa-cli — Forgexa command-line client."""
|
|
2
|
-
__version__ = "1.101.
|
|
2
|
+
__version__ = "1.101.2"
|
|
@@ -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.101.
|
|
1431
|
+
DAEMON_VERSION = "1.101.2"
|
|
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
|
|
|
@@ -14806,9 +14814,16 @@ class RuntimeDaemon:
|
|
|
14806
14814
|
return failed("delivery_review_fix_failed", "The selected repair could not be applied or pushed")
|
|
14807
14815
|
|
|
14808
14816
|
async def _execute_delivery_code_review(self, task, agent, workspace_path) -> TaskResult:
|
|
14817
|
+
engine_identity = None
|
|
14818
|
+
|
|
14809
14819
|
def failed(code: str, message: str) -> TaskResult:
|
|
14810
14820
|
return TaskResult(status="failed", exit_code=-1, stdout="", stderr="", failure_code=code,
|
|
14811
|
-
error=message, execution_attempt_id=task.execution_attempt_id
|
|
14821
|
+
error=message, execution_attempt_id=task.execution_attempt_id,
|
|
14822
|
+
metrics={"delivery_review_engine_identity": engine_identity} if engine_identity else {})
|
|
14823
|
+
|
|
14824
|
+
def remember_identity(identity):
|
|
14825
|
+
nonlocal engine_identity
|
|
14826
|
+
engine_identity = identity
|
|
14812
14827
|
|
|
14813
14828
|
if str(getattr(agent, "agent_id", "")).lower() != "claude":
|
|
14814
14829
|
return failed("delivery_review_agent_unsupported", "This agent has no verified read-only delivery review mode")
|
|
@@ -14824,7 +14839,7 @@ class RuntimeDaemon:
|
|
|
14824
14839
|
snapshot = data.get("delivery_review_snapshot")
|
|
14825
14840
|
try:
|
|
14826
14841
|
config = snapshot["config"]
|
|
14827
|
-
if (config["version"] != 2 or config["engine"]
|
|
14842
|
+
if (config["version"] != 2 or config["engine"] not in {"agent", "ocr_delegate"}
|
|
14828
14843
|
or code_review_rules.review_config_sha256(config) != snapshot["review_config_sha256"]):
|
|
14829
14844
|
raise ValueError("Invalid review identity")
|
|
14830
14845
|
if not isinstance(config["context"], dict) or not isinstance(config["additional_instructions"], str):
|
|
@@ -14933,9 +14948,27 @@ class RuntimeDaemon:
|
|
|
14933
14948
|
recheck_by_batch = code_review_rules.assign_recheck_issues(
|
|
14934
14949
|
[batch_paths for batch_paths, _ in batches], selected_issues,
|
|
14935
14950
|
)
|
|
14951
|
+
engine_evidence = None
|
|
14952
|
+
if snapshot is not None and snapshot["config"]["engine"] == "ocr_delegate":
|
|
14953
|
+
try:
|
|
14954
|
+
engine_evidence = await ocr_adapter.run_selected_ocr_range_preview(
|
|
14955
|
+
workspace_path, target, head, base, paths,
|
|
14956
|
+
expected_identity=data.get("delivery_review_engine_identity"),
|
|
14957
|
+
timeout=min(float(task.timeout_seconds or 30), 60), on_identity=remember_identity,
|
|
14958
|
+
)
|
|
14959
|
+
except ocr_adapter.OcrAdapterError as error:
|
|
14960
|
+
return failed(error.code, "Open Code Review could not safely cover the fixed review range")
|
|
14936
14961
|
if not paths and not recheck:
|
|
14962
|
+
if engine_identity:
|
|
14963
|
+
try:
|
|
14964
|
+
await ocr_adapter.verify_selected_ocr_identity(engine_identity)
|
|
14965
|
+
except ocr_adapter.OcrAdapterError as error:
|
|
14966
|
+
return failed(error.code, "The selected Open Code Review instance changed during review")
|
|
14937
14967
|
return TaskResult(status="success", exit_code=0, stdout="", stderr="", git=git,
|
|
14938
|
-
metrics={"delivery_code_review": metadata
|
|
14968
|
+
metrics={"delivery_code_review": metadata,
|
|
14969
|
+
**({"delivery_review_engine_identity": engine_identity,
|
|
14970
|
+
"delivery_review_engine_evidence": engine_evidence} if engine_evidence else {})},
|
|
14971
|
+
has_verified_completion=True,
|
|
14939
14972
|
critic_review={"collection_status": "not_applicable"},
|
|
14940
14973
|
execution_attempt_id=task.execution_attempt_id)
|
|
14941
14974
|
if paths and not diff:
|
|
@@ -14990,7 +15023,8 @@ class RuntimeDaemon:
|
|
|
14990
15023
|
rules = (
|
|
14991
15024
|
"\nApproved review rules are subordinate to the platform's fixed scope, "
|
|
14992
15025
|
"read-only permissions, output contract and human decisions. "
|
|
14993
|
-
"Report conflicts instead of changing those requirements
|
|
15026
|
+
"Report conflicts instead of changing those requirements. "
|
|
15027
|
+
"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
15028
|
+ config["rule_package"]["template"]
|
|
14995
15029
|
+ "\n\nProject additions:\n" + config["additional_instructions"]
|
|
14996
15030
|
)
|
|
@@ -15103,8 +15137,16 @@ class RuntimeDaemon:
|
|
|
15103
15137
|
report["rechecked_issues"] = rechecked
|
|
15104
15138
|
if len(issues) > 100 or len(json.dumps(report, ensure_ascii=False).encode("utf-8")) > 100_000:
|
|
15105
15139
|
return failed("delivery_review_output_invalid", "The complete review result exceeds the available output scope")
|
|
15140
|
+
if engine_identity:
|
|
15141
|
+
try:
|
|
15142
|
+
await ocr_adapter.verify_selected_ocr_identity(engine_identity)
|
|
15143
|
+
except ocr_adapter.OcrAdapterError as error:
|
|
15144
|
+
return failed(error.code, "The selected Open Code Review instance changed during review")
|
|
15106
15145
|
return TaskResult(status="success", exit_code=0, stdout="", stderr="", git=git,
|
|
15107
|
-
metrics={**combined_metrics, "delivery_code_review": metadata
|
|
15146
|
+
metrics={**combined_metrics, "delivery_code_review": metadata,
|
|
15147
|
+
**({"delivery_review_engine_identity": engine_identity,
|
|
15148
|
+
"delivery_review_engine_evidence": engine_evidence} if engine_evidence else {})},
|
|
15149
|
+
has_verified_completion=True,
|
|
15108
15150
|
critic_review={"collection_status": "completed", "result": report, "agent_used": "claude"},
|
|
15109
15151
|
execution_attempt_id=task.execution_attempt_id)
|
|
15110
15152
|
|