plan-manager-client 0.2.135__tar.gz → 0.2.136__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. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/PKG-INFO +1 -1
  2. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/dispatch.py +27 -0
  3. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/facade_bug_project_mixin.py +11 -3
  4. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/facade_context_gate_mixin.py +8 -0
  5. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/server_api.py +5 -1
  6. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/server_api_mutating.py +2 -0
  7. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client.egg-info/PKG-INFO +1 -1
  8. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/tests/test_dispatch_validation_error_classification.py +36 -0
  9. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/__init__.py +0 -0
  10. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/_version.py +0 -0
  11. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/authoring_diagnostics.py +0 -0
  12. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/client.py +0 -0
  13. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/config.py +0 -0
  14. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/delivery/__init__.py +0 -0
  15. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/delivery/archive.py +0 -0
  16. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/delivery/atomicity.py +0 -0
  17. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/delivery/commit.py +0 -0
  18. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/delivery/destination.py +0 -0
  19. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/delivery/provenance.py +0 -0
  20. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/delivery/upload.py +0 -0
  21. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/export_fetch_chunks.py +0 -0
  22. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/export_fetch_request.py +0 -0
  23. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/export_fetch_unpack.py +0 -0
  24. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/export_fetch_verify.py +0 -0
  25. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/facade_agent_config_mixin.py +0 -0
  26. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/facade_entity_common_mixin.py +0 -0
  27. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/facade_hrs_file_mixin.py +0 -0
  28. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/facade_plan_hrs_mixin.py +0 -0
  29. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/facade_runtime_mixin.py +0 -0
  30. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/facade_step_graph_mixin.py +0 -0
  31. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/info_walker.py +0 -0
  32. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client/scenario_runtime.py +0 -0
  33. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client.egg-info/SOURCES.txt +0 -0
  34. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client.egg-info/dependency_links.txt +0 -0
  35. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client.egg-info/requires.txt +0 -0
  36. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/plan_manager_client.egg-info/top_level.txt +0 -0
  37. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/pyproject.toml +0 -0
  38. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/setup.cfg +0 -0
  39. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/tests/test_client_server_api_sync.py +0 -0
  40. {plan_manager_client-0.2.135 → plan_manager_client-0.2.136}/tests/test_contract_facade_passthrough.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plan-manager-client
3
- Version: 0.2.135
3
+ Version: 0.2.136
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.3
@@ -53,6 +53,32 @@ def _adapter_validation_error_result(status: object) -> dict[str, Any] | None:
53
53
  ):
54
54
  return candidate
55
55
 
56
+ # The server's pre-execution refusals (command_execution false) and "Method not
57
+ # found" keep a bare ``{status: "error", code, message, data}`` result at
58
+ # status.data.result / status.result, with no success/error keys (bug ccb5f95f).
59
+ if isinstance(status, dict):
60
+ bare_candidates: list[object] = []
61
+ for holder in (status.get("result"), status.get("data")):
62
+ bare_candidates.append(holder)
63
+ if isinstance(holder, dict):
64
+ bare_candidates.append(holder.get("result"))
65
+ for bare in bare_candidates:
66
+ if (
67
+ isinstance(bare, dict)
68
+ and bare.get("status") == "error"
69
+ and bare.get("code") in _BARE_REFUSAL_CODES
70
+ and isinstance(bare.get("message"), str)
71
+ ):
72
+ bare_data = bare.get("data")
73
+ return {
74
+ "success": False,
75
+ "error": {
76
+ "code": bare["code"],
77
+ "message": bare["message"],
78
+ "data": bare_data if isinstance(bare_data, dict) else {},
79
+ },
80
+ }
81
+
56
82
  # A command-session failure persists the queue terminal status instead of
57
83
  # the ErrorResult. Adapter pre-execution validation failures retain an
58
84
  # unambiguous status discriminator and the original ValidationError message.
@@ -186,6 +212,7 @@ def _relation_violation(lowered: str) -> str:
186
212
  return "value"
187
213
 
188
214
 
215
+ _BARE_REFUSAL_CODES = (-32602, -32601)
189
216
  _UNKNOWN_PARAMETERS_PREFIX = "Invalid parameters: "
190
217
  _NON_VALIDATION_MARKERS = (
191
218
  "timed out",
@@ -166,9 +166,17 @@ class BugProjectCommandsMixin:
166
166
  """List the projects that directly depend on a given project (reverse-dependency lookup)."""
167
167
  return await self._call("project_dependents", params)
168
168
 
169
- async def project_uuid_reserve(self, **params: Any) -> Any:
170
- """Reserve, release, or resolve an external project UUID namespace reservation."""
171
- return await self._call("project_uuid_reserve", params)
169
+ async def project_import(self, **params: Any) -> Any:
170
+ """Import a code-analysis-server project into the registry (the only way a project enters it; idempotent)."""
171
+ return await self._call("project_import", params)
172
+
173
+ async def project_list(self, **params: Any) -> Any:
174
+ """List the imported projects, filtered by imported_by or imported_by_prefix, with owned and referenced counts."""
175
+ return await self._call("project_list", params)
176
+
177
+ async def project_remove(self, **params: Any) -> Any:
178
+ """Remove an imported project from the registry; refused while records own or reference it."""
179
+ return await self._call("project_remove", params)
172
180
 
173
181
  async def project_view(self, **params: Any) -> Any:
174
182
  """Project-centric aggregate view: paginated todos/bugs (plus a comments count) scoped to one project, direct or transitive via bound plans."""
@@ -237,6 +237,14 @@ class ContextGateCommandsMixin:
237
237
  """Purge a batch of already soft-deleted rows of one entity type, reporting per-row removals and reference-blocked refusals."""
238
238
  return await self._call("runtime_purge_batch", params)
239
239
 
240
+ async def garbage_find(self, **params: Any) -> Any:
241
+ """List the lost records (owner, parent or anchor missing from the registry) or the surplus records (test leftovers by creator prefix and age) that garbage_purge would remove (read-only, paginated)."""
242
+ return await self._call("garbage_find", params)
243
+
244
+ async def garbage_purge(self, **params: Any) -> Any:
245
+ """Remove exactly the records garbage_find lists for the same parameters, with their dependants, in one transaction (dry_run=true by default; optional ids narrow the selection)."""
246
+ return await self._call("garbage_purge", params)
247
+
240
248
  async def reference_inspect(self, **params: Any) -> Any:
241
249
  """Inspect the cross-entity reference graph around one entity: which live rows point at it, optionally traversed transitively with cycle detection (read-only, paginated)."""
242
250
  return await self._call("reference_inspect", params)
@@ -247,7 +247,9 @@ COMMAND_NAMES: frozenset[str] = frozenset(
247
247
  "project_dependency_list",
248
248
  "project_dependency_discover",
249
249
  "project_dependents",
250
- "project_uuid_reserve",
250
+ "project_import",
251
+ "project_list",
252
+ "project_remove",
251
253
  "project_view",
252
254
  "command_catalog_dump",
253
255
  "graph_dependents",
@@ -257,6 +259,8 @@ COMMAND_NAMES: frozenset[str] = frozenset(
257
259
  "step_prompt_verify",
258
260
  "audit_list",
259
261
  "runtime_purge_batch",
262
+ "garbage_find",
263
+ "garbage_purge",
260
264
  "reference_inspect",
261
265
  "id_resolve",
262
266
  "reference_repair",
@@ -23,6 +23,8 @@ MUTATING_COMMAND_NAMES: frozenset[str] = frozenset(
23
23
  "plan_project_detach",
24
24
  "plan_project_set_primary",
25
25
  "plan_project_clear_primary",
26
+ "project_import",
27
+ "project_remove",
26
28
  "plan_import",
27
29
  "export_archive",
28
30
  "hrs_import",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plan-manager-client
3
- Version: 0.2.135
3
+ Version: 0.2.136
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.3
@@ -94,3 +94,39 @@ def test_genuine_session_failure_without_nested_error_is_not_recovered() -> None
94
94
  """A failed job with command_execution true and no nested ErrorResult stays a session failure."""
95
95
  assert _adapter_validation_error_result(_nested_refusal_status({"success": True, "data": {}})) is None
96
96
  assert _adapter_validation_error_result(_nested_refusal_status(None)) is None
97
+
98
+
99
+ def _bare_status(code: int, message: str, data: dict) -> dict:
100
+ """Recorded shape: status.data.result is a bare error dict, command_execution false."""
101
+ return {
102
+ "success": True,
103
+ "data": {
104
+ "status": "failed",
105
+ "command_execution": False,
106
+ "job_success": False,
107
+ "error": None,
108
+ "description": message,
109
+ "result": {"status": "error", "code": code, "message": message, "data": data},
110
+ },
111
+ }
112
+
113
+
114
+ def test_bare_invalid_parameters_refusal_is_surfaced() -> None:
115
+ """The bare -32602 refusal (no success/error keys, no prefix) returns the server error."""
116
+ data = {"invalid_parameters": ["gs_step_id"], "violation": "unknown"}
117
+ message = "Invalid parameters: gs_step_id. Allowed parameters: ['plan', 'scope']"
118
+ result = _adapter_validation_error_result(_bare_status(-32602, message, data))
119
+ assert result == {"success": False, "error": {"code": -32602, "message": message, "data": data}}
120
+
121
+
122
+ def test_bare_method_not_found_is_surfaced() -> None:
123
+ """The bare -32601 Method not found result returns the server error."""
124
+ result = _adapter_validation_error_result(_bare_status(-32601, "Method not found: matrix_call_move", {}))
125
+ assert result is not None
126
+ assert result["error"]["code"] == -32601
127
+ assert result["error"]["message"] == "Method not found: matrix_call_move"
128
+
129
+
130
+ def test_bare_domain_error_is_not_recovered() -> None:
131
+ """A bare error with another code is not treated as a refusal."""
132
+ assert _adapter_validation_error_result(_bare_status(-32000, "boom", {})) is None