plan-manager-client 0.2.159__tar.gz → 0.2.161__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 (44) hide show
  1. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/PKG-INFO +1 -1
  2. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/dispatch.py +24 -1
  3. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_context_gate_mixin.py +1 -1
  4. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/id_rule.py +13 -2
  5. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client.egg-info/PKG-INFO +1 -1
  6. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/__init__.py +0 -0
  7. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/_version.py +0 -0
  8. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/authoring_diagnostics.py +0 -0
  9. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/client.py +0 -0
  10. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/config.py +0 -0
  11. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/delivery/__init__.py +0 -0
  12. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/delivery/archive.py +0 -0
  13. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/delivery/atomicity.py +0 -0
  14. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/delivery/commit.py +0 -0
  15. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/delivery/destination.py +0 -0
  16. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/delivery/provenance.py +0 -0
  17. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/delivery/upload.py +0 -0
  18. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/export_fetch_chunks.py +0 -0
  19. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/export_fetch_request.py +0 -0
  20. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/export_fetch_unpack.py +0 -0
  21. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/export_fetch_verify.py +0 -0
  22. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_agent_config_mixin.py +0 -0
  23. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_bug_project_mixin.py +0 -0
  24. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_entity_common_mixin.py +0 -0
  25. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_hrs_file_mixin.py +0 -0
  26. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_plan_hrs_mixin.py +0 -0
  27. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_runtime_mixin/__init__.py +0 -0
  28. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_runtime_mixin/authoring_part.py +0 -0
  29. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_runtime_mixin/facade.py +0 -0
  30. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_runtime_mixin/overlay_part.py +0 -0
  31. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/facade_step_graph_mixin.py +0 -0
  32. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/info_walker.py +0 -0
  33. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/scenario_runtime.py +0 -0
  34. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/server_api.py +0 -0
  35. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client/server_api_mutating.py +0 -0
  36. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client.egg-info/SOURCES.txt +0 -0
  37. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client.egg-info/dependency_links.txt +0 -0
  38. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client.egg-info/requires.txt +0 -0
  39. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/plan_manager_client.egg-info/top_level.txt +0 -0
  40. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/pyproject.toml +0 -0
  41. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/setup.cfg +0 -0
  42. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/tests/test_client_server_api_sync.py +0 -0
  43. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/tests/test_contract_facade_passthrough.py +0 -0
  44. {plan_manager_client-0.2.159 → plan_manager_client-0.2.161}/tests/test_dispatch_validation_error_classification.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plan-manager-client
3
- Version: 0.2.159
3
+ Version: 0.2.161
4
4
  Summary: First-class client library for the plan_manager JSON-RPC API: full command-surface facade plus export delivery module boundary.
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: mcp-proxy-adapter==8.11.10
@@ -80,6 +80,29 @@ def _adapter_validation_error_result(status: object) -> dict[str, Any] | None:
80
80
  },
81
81
  }
82
82
 
83
+ # A command that EXECUTED and ended with its own ErrorResult (command_execution true,
84
+ # job_success false) keeps that ErrorResult at status.data.result.result (bug 970e0443:
85
+ # ``help`` with an unknown cmdname, code -32601). The caller gets the job's own error
86
+ # envelope, as for a non-queued command, never a CommandSessionFailedError.
87
+ if isinstance(status, dict):
88
+ executed = status.get("data")
89
+ if (
90
+ isinstance(executed, dict)
91
+ and executed.get("status") == "failed"
92
+ and executed.get("command_execution") is True
93
+ and executed.get("job_success") is False
94
+ ):
95
+ executed_result = executed.get("result")
96
+ inner = executed_result.get("result") if isinstance(executed_result, dict) else None
97
+ if (
98
+ isinstance(inner, dict)
99
+ and inner.get("success") is False
100
+ and isinstance(inner.get("error"), dict)
101
+ and isinstance(inner["error"].get("code"), int)
102
+ and isinstance(inner["error"].get("message"), str)
103
+ ):
104
+ return inner
105
+
83
106
  # A command-session failure persists the queue terminal status instead of
84
107
  # the ErrorResult. Adapter pre-execution validation failures retain an
85
108
  # unambiguous status discriminator and the original ValidationError message.
@@ -291,7 +314,7 @@ class _CommandDispatchMixin:
291
314
  value from the unified response for both immediate and queued commands.
292
315
  """
293
316
  try:
294
- check_call_ids(params) # uuid4 discipline (block 2, D7): an invalid identifier is refused before the call is sent
317
+ check_call_ids(params, command) # uuid4 discipline (block 2, D7): an invalid identifier is refused before the call is sent
295
318
  except InvalidIdentifierError as refusal:
296
319
  # The refusal is the command's own answer (-32602, violation value), never an exception out of the facade (0153 GI2).
297
320
  return refusal.as_answer()
@@ -196,7 +196,7 @@ class ContextGateCommandsMixin:
196
196
  return await self._call("plan_score", params)
197
197
 
198
198
  async def plan_unfreeze(self, **params: Any) -> Any:
199
- """Reopen the frozen steps of a plan (or of one branch: a step, its descendants and its ancestors) as drafts; audited, one plan version, no cascade."""
199
+ """Reopen the frozen steps of a plan (or of one branch: a step, its descendants and its ancestors, or of one HRS paragraph: the closure of its label) as drafts; dry_run lists them without writing; audited, one plan version, no cascade."""
200
200
  return await self._call("plan_unfreeze", params)
201
201
 
202
202
  async def plan_version_list(self, **params: Any) -> Any:
@@ -37,6 +37,13 @@ UUID_PARAMETER_NAMES: frozenset[str] = frozenset({
37
37
  })
38
38
  """The parameters the server declares ``format: uuid`` (every command of the live catalog, generated from the schemas)."""
39
39
 
40
+ FREE_TEXT_PARAMETERS: dict[str, frozenset[str]] = {
41
+ "plan_comment_set": frozenset({"comment"}),
42
+ "project_update": frozenset({"comment"}),
43
+ }
44
+ """Per command: parameters whose NAME is in ``UUID_PARAMETER_NAMES`` for other commands but carry free text here (the
45
+ ``comment`` of plan_comment_set and project_update is prose, the ``comment`` of comment_update/comment_delete is a uuid)."""
46
+
40
47
 
41
48
  class InvalidIdentifierError(ValueError):
42
49
  """A client-side refusal of an identifier value: the server's -32602 / violation value shape, before the call."""
@@ -85,12 +92,16 @@ def _is_id_shape(value: Any) -> bool:
85
92
  return isinstance(value, str) and _CANONICAL.match(value) is not None
86
93
 
87
94
 
88
- def check_call_ids(params: dict[str, Any] | None) -> None:
95
+ def check_call_ids(params: dict[str, Any] | None, command: str | None = None) -> None:
89
96
  """Refuse locally every identifier value of a call that fails rule D1 (see the module docstring).
90
97
 
91
- Raises InvalidIdentifierError naming the parameter and the exact value. Nothing is sent when it raises.
98
+ Raises InvalidIdentifierError naming the parameter and the exact value. Nothing is sent when it raises. A parameter
99
+ that ``FREE_TEXT_PARAMETERS`` lists for ``command`` is free text there and is never checked.
92
100
  """
101
+ free_text = FREE_TEXT_PARAMETERS.get(command or "", frozenset())
93
102
  for name, value in (params or {}).items():
103
+ if name in free_text:
104
+ continue
94
105
  if name in UUID_PARAMETER_NAMES:
95
106
  values = value if isinstance(value, list) else [value]
96
107
  for item in values:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plan-manager-client
3
- Version: 0.2.159
3
+ Version: 0.2.161
4
4
  Summary: First-class client library for the plan_manager JSON-RPC API: full command-surface facade plus export delivery module boundary.
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: mcp-proxy-adapter==8.11.10