forgexa-cli 1.104.1__tar.gz → 1.104.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.
Files changed (40) hide show
  1. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/PKG-INFO +1 -1
  2. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/__init__.py +1 -1
  3. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/daemon.py +69 -6
  4. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli.egg-info/PKG-INFO +1 -1
  5. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/pyproject.toml +1 -1
  6. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/README.md +0 -0
  7. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/_build_config.py +0 -0
  8. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/_local_bind.py +0 -0
  9. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/agent_core.py +0 -0
  10. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/autoupgrade.py +0 -0
  11. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/aws_evidence.py +0 -0
  12. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/aws_logs_evidence.py +0 -0
  13. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/code_review_rules.py +0 -0
  14. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/component_runtime.py +0 -0
  15. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/main.py +0 -0
  16. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/observability_contract.py +0 -0
  17. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/observability_evidence.py +0 -0
  18. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/ocr_adapter.py +0 -0
  19. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/py.typed +0 -0
  20. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/runtime_evidence.py +0 -0
  21. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/workspace_storage.py +0 -0
  22. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli/zcode_protocol.py +0 -0
  23. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli.egg-info/SOURCES.txt +0 -0
  24. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli.egg-info/dependency_links.txt +0 -0
  25. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli.egg-info/entry_points.txt +0 -0
  26. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli.egg-info/requires.txt +0 -0
  27. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/forgexa_cli.egg-info/top_level.txt +0 -0
  28. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/setup.cfg +0 -0
  29. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_auth_and_runtime_commands.py +0 -0
  30. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_autoupgrade.py +0 -0
  31. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_check_command.py +0 -0
  32. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_delivery_review_packaged.py +0 -0
  33. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_expiry_warnings_and_revoke.py +0 -0
  34. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_local_bind_commands.py +0 -0
  35. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_publish_script.py +0 -0
  36. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_runtime_credentials.py +0 -0
  37. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_session_credentials.py +0 -0
  38. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_silent_install.py +0 -0
  39. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_upgrade_observability.py +0 -0
  40. {forgexa_cli-1.104.1 → forgexa_cli-1.104.2}/tests/test_workspace_storage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.104.1
3
+ Version: 1.104.2
4
4
  Summary: Forgexa CLI — command-line client and AI agent runtime for the Forgexa platform
5
5
  Author-email: Jason Sun <dev.winds@gmail.com>
6
6
  License-Expression: MIT
@@ -1,2 +1,2 @@
1
1
  """forgexa-cli — Forgexa command-line client."""
2
- __version__ = "1.104.1"
2
+ __version__ = "1.104.2"
@@ -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.1"
1431
+ DAEMON_VERSION = "1.104.2"
1432
1432
 
1433
1433
 
1434
1434
  def _detect_client_type() -> str:
@@ -6709,13 +6709,19 @@ def _delivery_review_sandbox_command(command: list[str], workspace: Path, home:
6709
6709
  wrapped += ["--ro-bind", path, path]
6710
6710
  wrapped += ["--proc", "/proc", "--dev", "/dev", "--tmpfs", "/tmp", "--tmpfs", "/var/tmp"]
6711
6711
  for root in sorted(read_roots):
6712
- if not Path(root).is_dir():
6712
+ path = Path(root)
6713
+ if not path.exists():
6714
+ continue
6715
+ if not path.is_dir() and not path.is_file():
6713
6716
  raise RuntimeError("delivery_review_sandbox_scope_invalid")
6714
6717
  wrapped += ["--ro-bind", root, root]
6715
6718
  wrapped += ["--bind" if writable else "--ro-bind", str(workspace_path), str(workspace_path)]
6716
6719
  wrapped += ["--bind", str(home_path), str(home_path)]
6717
6720
  protected = {path.absolute() for path in (deny_paths or [])}
6718
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
6719
6725
  for directory, directories, files in os.walk(root, followlinks=False):
6720
6726
  for name in [*directories, *files]:
6721
6727
  path = Path(directory) / name
@@ -15260,11 +15266,15 @@ class RuntimeDaemon:
15260
15266
 
15261
15267
  async def _execute_delivery_code_review(self, task, agent, workspace_path) -> TaskResult:
15262
15268
  engine_identity = None
15269
+ preparation_failure = None
15263
15270
 
15264
15271
  def failed(code: str, message: str) -> TaskResult:
15265
15272
  return TaskResult(status="failed", exit_code=-1, stdout="", stderr="", failure_code=code,
15266
15273
  error=message, execution_attempt_id=task.execution_attempt_id,
15267
- metrics={"delivery_review_engine_identity": engine_identity} if engine_identity else {})
15274
+ metrics={
15275
+ **({"delivery_review_engine_identity": engine_identity} if engine_identity else {}),
15276
+ **({"delivery_review_preparation": preparation_failure} if preparation_failure else {}),
15277
+ })
15268
15278
 
15269
15279
  def remember_identity(identity):
15270
15280
  nonlocal engine_identity
@@ -15305,9 +15315,12 @@ class RuntimeDaemon:
15305
15315
  if not task.workspace_branch or not default_branch or default_branch.startswith("-"):
15306
15316
  return failed("delivery_review_scope_incomplete", "The candidate or target branch is unavailable")
15307
15317
 
15318
+ preparation_stage = "workspace_branch"
15308
15319
  try:
15309
15320
  branch = (await self.workspace_manager._git("branch", "--show-current", cwd=workspace_path, timeout=10)).strip()
15321
+ preparation_stage = "candidate_head"
15310
15322
  head = (await self.workspace_manager._git("rev-parse", "--verify", "HEAD^{commit}", cwd=workspace_path, timeout=10)).strip()
15323
+ preparation_stage = "workspace_status"
15311
15324
  dirty = await self.workspace_manager._git(
15312
15325
  "--no-optional-locks", "status", "--porcelain=v1", "-z", "--untracked-files=no", cwd=workspace_path, timeout=10,
15313
15326
  )
@@ -15315,6 +15328,7 @@ class RuntimeDaemon:
15315
15328
  return failed("delivery_review_candidate_changed", "The candidate branch or workspace changed")
15316
15329
  target_ref = ""
15317
15330
  target = ""
15331
+ preparation_stage = "target_ref"
15318
15332
  for candidate in (f"refs/remotes/origin/{default_branch}", f"refs/heads/{default_branch}"):
15319
15333
  try:
15320
15334
  target = (await self.workspace_manager._git(
@@ -15330,7 +15344,37 @@ class RuntimeDaemon:
15330
15344
  expected_target = (task.input_data or {}).get("delivery_review_expected_target")
15331
15345
  if (expected_head is not None and expected_head != head) or (expected_target is not None and expected_target != target):
15332
15346
  return failed("delivery_review_candidate_changed", "The local workspace does not match the requested review version")
15333
- base = (await self.workspace_manager._git("merge-base", target, head, cwd=workspace_path, timeout=10)).strip()
15347
+ preparation_stage = "merge_base"
15348
+ try:
15349
+ base = (await self.workspace_manager._git("merge-base", target, head, cwd=workspace_path, timeout=10)).strip()
15350
+ except RuntimeError:
15351
+ if task.workspace_resolution != "cloud_worktree":
15352
+ raise
15353
+ shallow = (await self.workspace_manager._git(
15354
+ "rev-parse", "--is-shallow-repository", cwd=workspace_path, timeout=10,
15355
+ )).strip()
15356
+ if shallow != "true":
15357
+ raise
15358
+ await self.workspace_manager._git("check-ref-format", f"refs/heads/{default_branch}", cwd=workspace_path, timeout=10)
15359
+ for deepen in (128, 512):
15360
+ preparation_stage = "history_fetch"
15361
+ await self.workspace_manager._git(
15362
+ "fetch", "--no-tags", "--no-recurse-submodules", "--no-write-fetch-head", "--refmap=",
15363
+ f"--deepen={deepen}", "origin", f"refs/heads/{default_branch}", f"refs/heads/{branch}",
15364
+ cwd=workspace_path, timeout=60, project_key=(task.project or {}).get("project_key"),
15365
+ )
15366
+ preparation_stage = "merge_base"
15367
+ try:
15368
+ base = (await self.workspace_manager._git("merge-base", target, head, cwd=workspace_path, timeout=10)).strip()
15369
+ break
15370
+ except RuntimeError:
15371
+ if deepen == 512:
15372
+ raise
15373
+ current_head = (await self.workspace_manager._git("rev-parse", "--verify", "HEAD^{commit}", cwd=workspace_path, timeout=10)).strip()
15374
+ current_target = (await self.workspace_manager._git("rev-parse", "--verify", f"{target_ref}^{{commit}}", cwd=workspace_path, timeout=10)).strip()
15375
+ if current_head != head or current_target != target:
15376
+ return failed("delivery_review_candidate_changed", "The candidate or target changed while resolving review history")
15377
+ preparation_stage = "changed_files"
15334
15378
  changed = await self.workspace_manager._git(
15335
15379
  "diff", "--no-ext-diff", "--no-textconv", "--no-renames", "--name-only", "-z",
15336
15380
  base, head, "--", cwd=workspace_path, timeout=60,
@@ -15338,6 +15382,7 @@ class RuntimeDaemon:
15338
15382
  paths = [path for path in changed.split("\x00") if path]
15339
15383
  if len(paths) > 200 or any(_is_sensitive_local_path(path) for path in paths):
15340
15384
  return failed("delivery_review_scope_incomplete", "The changed-file scope exceeds review limits")
15385
+ preparation_stage = "candidate_diff"
15341
15386
  diff = await self.workspace_manager._git(
15342
15387
  "diff", "--no-ext-diff", "--no-textconv", "--no-renames", "--unified=3",
15343
15388
  base, head, "--", cwd=workspace_path, timeout=60,
@@ -15349,6 +15394,7 @@ class RuntimeDaemon:
15349
15394
  batches = []
15350
15395
  batch_paths, batch_diff = [], ""
15351
15396
  for path in paths:
15397
+ preparation_stage = "file_diff"
15352
15398
  file_diff = await self.workspace_manager._git(
15353
15399
  "--literal-pathspecs", "diff", "--no-ext-diff", "--no-textconv", "--no-renames", "--unified=3",
15354
15400
  base, head, "--", path, cwd=workspace_path, timeout=60,
@@ -15365,8 +15411,25 @@ class RuntimeDaemon:
15365
15411
  if len(batches) > 8:
15366
15412
  return failed("delivery_review_scope_incomplete", "The complete diff requires too many review batches")
15367
15413
  except (OSError, RuntimeError, ValueError, UnicodeError) as error:
15368
- logger.warning("Cannot prepare delivery review scope: %s", type(error).__name__)
15369
- return failed("delivery_review_scope_incomplete", "The complete candidate diff is unavailable")
15414
+ detail = str(error).lower()
15415
+ reason = "git_command_failed"
15416
+ for category, pattern in (
15417
+ ("git_timeout", r"timed out|timeout"),
15418
+ ("git_resource_exhausted", r"cannot allocate memory|unable to mmap|out of memory"),
15419
+ ("git_access_denied", r"permission denied|dubious ownership|authentication failed|could not read username"),
15420
+ ("git_object_unavailable", r"bad object|not a valid|unknown revision|invalid object|unable to read|missing blob|bad tree|corrupt"),
15421
+ ("git_history_unavailable", r"no merge base|no merge-base|unrelated histories"),
15422
+ ):
15423
+ if re.search(pattern, detail):
15424
+ reason = category
15425
+ break
15426
+ if isinstance(error, UnicodeError):
15427
+ reason = "git_output_encoding"
15428
+ elif preparation_stage == "merge_base" and reason == "git_command_failed":
15429
+ reason = "git_history_unavailable"
15430
+ preparation_failure = {"stage": preparation_stage, "reason": reason, "error_type": type(error).__name__}
15431
+ logger.warning("Cannot prepare delivery review scope (stage=%s, reason=%s, type=%s)", preparation_stage, reason, type(error).__name__)
15432
+ return failed("delivery_review_scope_incomplete", f"The complete candidate diff is unavailable (stage={preparation_stage}; reason={reason}). Resolve the original workspace's Git prerequisite before retrying; switching Agent cannot fix this preparation failure.")
15370
15433
 
15371
15434
  metadata = {"version": protocol, "base_sha": base, "target_sha": target, "head_sha": head,
15372
15435
  "changed_files": paths, "reviewed_batches": [batch_paths for batch_paths, _ in batches] if paths else []}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.104.1
3
+ Version: 1.104.2
4
4
  Summary: Forgexa CLI — command-line client and AI agent runtime for the Forgexa platform
5
5
  Author-email: Jason Sun <dev.winds@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "forgexa-cli"
3
- version = "1.104.1"
3
+ version = "1.104.2"
4
4
  description = "Forgexa CLI — command-line client and AI agent runtime for the Forgexa platform"
5
5
  requires-python = ">=3.9"
6
6
  license = "MIT"
File without changes
File without changes