plan-manager-client-dev 0.2.186__py3-none-any.whl
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.
- plan_manager_client/__init__.py +10 -0
- plan_manager_client/_version.py +58 -0
- plan_manager_client/authoring_diagnostics.py +137 -0
- plan_manager_client/client.py +75 -0
- plan_manager_client/config.py +320 -0
- plan_manager_client/delivery/__init__.py +7 -0
- plan_manager_client/delivery/archive.py +140 -0
- plan_manager_client/delivery/atomicity.py +93 -0
- plan_manager_client/delivery/commit.py +113 -0
- plan_manager_client/delivery/destination.py +140 -0
- plan_manager_client/delivery/provenance.py +88 -0
- plan_manager_client/delivery/upload.py +118 -0
- plan_manager_client/dispatch.py +380 -0
- plan_manager_client/export_fetch_chunks.py +166 -0
- plan_manager_client/export_fetch_request.py +88 -0
- plan_manager_client/export_fetch_unpack.py +149 -0
- plan_manager_client/export_fetch_verify.py +101 -0
- plan_manager_client/facade_agent_config_mixin.py +224 -0
- plan_manager_client/facade_bug_project_mixin.py +202 -0
- plan_manager_client/facade_context_gate_mixin.py +303 -0
- plan_manager_client/facade_entity_common_mixin.py +38 -0
- plan_manager_client/facade_hrs_file_mixin.py +206 -0
- plan_manager_client/facade_plan_hrs_mixin.py +200 -0
- plan_manager_client/facade_runtime_mixin/__init__.py +11 -0
- plan_manager_client/facade_runtime_mixin/authoring_part.py +442 -0
- plan_manager_client/facade_runtime_mixin/facade.py +380 -0
- plan_manager_client/facade_runtime_mixin/overlay_part.py +192 -0
- plan_manager_client/facade_step_graph_mixin.py +158 -0
- plan_manager_client/id_rule.py +115 -0
- plan_manager_client/info_walker.py +133 -0
- plan_manager_client/scenario_runtime.py +65 -0
- plan_manager_client/server_api.py +427 -0
- plan_manager_client/server_api_mutating.py +105 -0
- plan_manager_client_dev-0.2.186.dist-info/METADATA +10 -0
- plan_manager_client_dev-0.2.186.dist-info/RECORD +37 -0
- plan_manager_client_dev-0.2.186.dist-info/WHEEL +5 -0
- plan_manager_client_dev-0.2.186.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"""Bug and project-dependency command-family facade mixin.
|
|
2
|
+
|
|
3
|
+
Author: Vasiliy Zdanovskiy
|
|
4
|
+
email: vasilyvz@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class BugProjectCommandsMixin:
|
|
13
|
+
"""One method per plan_manager command in the bug and project-dependency family.
|
|
14
|
+
|
|
15
|
+
Assumes it is mixed into a class that also inherits
|
|
16
|
+
plan_manager_client.dispatch._CommandDispatchMixin, which supplies the
|
|
17
|
+
coroutine async def _call(self, command: str, params: dict[str, Any] | None = None) -> Any
|
|
18
|
+
used by every method below.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
async def bug_create(self, **params: Any) -> Any:
|
|
22
|
+
"""Create a new bug report with its single primary source anchor."""
|
|
23
|
+
return await self._call("bug_create", params)
|
|
24
|
+
|
|
25
|
+
async def bug_get(self, **params: Any) -> Any:
|
|
26
|
+
"""Retrieve a single bug report by identifier."""
|
|
27
|
+
return await self._call("bug_get", params)
|
|
28
|
+
|
|
29
|
+
async def bug_list(self, **params: Any) -> Any:
|
|
30
|
+
"""List bug reports with filtering and pagination."""
|
|
31
|
+
return await self._call("bug_list", params)
|
|
32
|
+
|
|
33
|
+
async def bug_update(self, **params: Any) -> Any:
|
|
34
|
+
"""Patch mutable fields of an existing bug report."""
|
|
35
|
+
return await self._call("bug_update", params)
|
|
36
|
+
|
|
37
|
+
async def bug_reanchor(self, **params: Any) -> Any:
|
|
38
|
+
"""Move a bug report's primary source anchor to a new target, with an audit record."""
|
|
39
|
+
return await self._call("bug_reanchor", params)
|
|
40
|
+
|
|
41
|
+
async def bug_triage(self, **params: Any) -> Any:
|
|
42
|
+
"""Transition a bug report to status triaged."""
|
|
43
|
+
return await self._call("bug_triage", params)
|
|
44
|
+
|
|
45
|
+
async def bug_confirm(self, **params: Any) -> Any:
|
|
46
|
+
"""Transition a bug report to status confirmed."""
|
|
47
|
+
return await self._call("bug_confirm", params)
|
|
48
|
+
|
|
49
|
+
async def bug_reject(self, **params: Any) -> Any:
|
|
50
|
+
"""Transition a bug report to status rejected."""
|
|
51
|
+
return await self._call("bug_reject", params)
|
|
52
|
+
|
|
53
|
+
async def bug_mark_duplicate(self, **params: Any) -> Any:
|
|
54
|
+
"""Mark a bug report as a duplicate of another bug report."""
|
|
55
|
+
return await self._call("bug_mark_duplicate", params)
|
|
56
|
+
|
|
57
|
+
async def bug_reopen(self, **params: Any) -> Any:
|
|
58
|
+
"""Transition a bug report to status reopened on re-discovery."""
|
|
59
|
+
return await self._call("bug_reopen", params)
|
|
60
|
+
|
|
61
|
+
async def bug_close(self, **params: Any) -> Any:
|
|
62
|
+
"""Transition a bug report to status closed after enforcing the closure discipline invariant on server-derived state."""
|
|
63
|
+
return await self._call("bug_close", params)
|
|
64
|
+
|
|
65
|
+
async def bug_delete(self, **params: Any) -> Any:
|
|
66
|
+
"""Delete a bug report: soft by default, hard=true gated by the inbound-reference integrity check, dry_run previews."""
|
|
67
|
+
return await self._call("bug_delete", params)
|
|
68
|
+
|
|
69
|
+
async def bug_impact_add(self, **params: Any) -> Any:
|
|
70
|
+
"""Create one BugImpact record describing an object affected by a bug."""
|
|
71
|
+
return await self._call("bug_impact_add", params)
|
|
72
|
+
|
|
73
|
+
async def bug_impact_get(self, **params: Any) -> Any:
|
|
74
|
+
"""Retrieve a single bug impact record by identifier."""
|
|
75
|
+
return await self._call("bug_impact_get", params)
|
|
76
|
+
|
|
77
|
+
async def bug_impact_update(self, **params: Any) -> Any:
|
|
78
|
+
"""Transition the status or amend fields of an existing BugImpact record."""
|
|
79
|
+
return await self._call("bug_impact_update", params)
|
|
80
|
+
|
|
81
|
+
async def bug_impact_list(self, **params: Any) -> Any:
|
|
82
|
+
"""List BugImpact records for a bug, with uniform filtering and pagination."""
|
|
83
|
+
return await self._call("bug_impact_list", params)
|
|
84
|
+
|
|
85
|
+
async def bug_impact_discover(self, **params: Any) -> Any:
|
|
86
|
+
"""Auto-discover the suspected impact set of a bug from the reverse project dependency graph."""
|
|
87
|
+
return await self._call("bug_impact_discover", params)
|
|
88
|
+
|
|
89
|
+
async def bug_impact_delete(self, **params: Any) -> Any:
|
|
90
|
+
"""Delete a bug impact record: soft by default, hard=true gated by the inbound-reference integrity check, dry_run previews."""
|
|
91
|
+
return await self._call("bug_impact_delete", params)
|
|
92
|
+
|
|
93
|
+
async def bug_fix_create(self, **params: Any) -> Any:
|
|
94
|
+
"""Create a new fix attempt for a bug (C-024)."""
|
|
95
|
+
return await self._call("bug_fix_create", params)
|
|
96
|
+
|
|
97
|
+
async def bug_fix_get(self, **params: Any) -> Any:
|
|
98
|
+
"""Retrieve a single bug fix attempt by identifier."""
|
|
99
|
+
return await self._call("bug_fix_get", params)
|
|
100
|
+
|
|
101
|
+
async def bug_fix_update(self, **params: Any) -> Any:
|
|
102
|
+
"""Update fields or advance the status of an existing bug fix attempt (C-024)."""
|
|
103
|
+
return await self._call("bug_fix_update", params)
|
|
104
|
+
|
|
105
|
+
async def bug_fix_list(self, **params: Any) -> Any:
|
|
106
|
+
"""List the fix attempts recorded for a bug, filtered and paginated (read-only)."""
|
|
107
|
+
return await self._call("bug_fix_list", params)
|
|
108
|
+
|
|
109
|
+
async def bug_fix_verify(self, **params: Any) -> Any:
|
|
110
|
+
"""Record a verification outcome for a fix attempt (C-024)."""
|
|
111
|
+
return await self._call("bug_fix_verify", params)
|
|
112
|
+
|
|
113
|
+
async def bug_fix_delete(self, **params: Any) -> Any:
|
|
114
|
+
"""Delete a bug fix attempt: soft by default, hard=true gated by the inbound-reference integrity check, dry_run previews."""
|
|
115
|
+
return await self._call("bug_fix_delete", params)
|
|
116
|
+
|
|
117
|
+
async def bug_propagation_create(self, **params: Any) -> Any:
|
|
118
|
+
"""Create a bug fix propagation record for one impact target after a source fix."""
|
|
119
|
+
return await self._call("bug_propagation_create", params)
|
|
120
|
+
|
|
121
|
+
async def bug_propagation_get(self, **params: Any) -> Any:
|
|
122
|
+
"""Retrieve a single bug fix propagation record by identifier."""
|
|
123
|
+
return await self._call("bug_propagation_get", params)
|
|
124
|
+
|
|
125
|
+
async def bug_propagation_list(self, **params: Any) -> Any:
|
|
126
|
+
"""List a paginated page of bug fix propagation records filtered by bug fix or impact (read-only)."""
|
|
127
|
+
return await self._call("bug_propagation_list", params)
|
|
128
|
+
|
|
129
|
+
async def bug_propagation_update(self, **params: Any) -> Any:
|
|
130
|
+
"""Update a bug fix propagation record's status, assignment, evidence, or linked TODO."""
|
|
131
|
+
return await self._call("bug_propagation_update", params)
|
|
132
|
+
|
|
133
|
+
async def bug_propagation_generate_todos(self, **params: Any) -> Any:
|
|
134
|
+
"""Generate linked TODO items for every pending propagation of a bug fix."""
|
|
135
|
+
return await self._call("bug_propagation_generate_todos", params)
|
|
136
|
+
|
|
137
|
+
async def bug_fix_propagation_delete(self, **params: Any) -> Any:
|
|
138
|
+
"""Delete a bug fix propagation record: soft by default, hard=true gated by the inbound-reference integrity check, dry_run previews."""
|
|
139
|
+
return await self._call("bug_fix_propagation_delete", params)
|
|
140
|
+
|
|
141
|
+
async def project_dependency_add(self, **params: Any) -> Any:
|
|
142
|
+
"""Create a project dependency edge between two external projects."""
|
|
143
|
+
return await self._call("project_dependency_add", params)
|
|
144
|
+
|
|
145
|
+
async def project_dependency_update(self, **params: Any) -> Any:
|
|
146
|
+
"""Patch the mutable fields of an existing project dependency edge."""
|
|
147
|
+
return await self._call("project_dependency_update", params)
|
|
148
|
+
|
|
149
|
+
async def project_dependency_confirm(self, **params: Any) -> Any:
|
|
150
|
+
"""Move a discovered project dependency edge's confidence off suspected to confirmed."""
|
|
151
|
+
return await self._call("project_dependency_confirm", params)
|
|
152
|
+
|
|
153
|
+
async def project_dependency_remove(self, **params: Any) -> Any:
|
|
154
|
+
"""Soft-delete an existing project dependency edge."""
|
|
155
|
+
return await self._call("project_dependency_remove", params)
|
|
156
|
+
|
|
157
|
+
async def project_dependency_get(self, **params: Any) -> Any:
|
|
158
|
+
"""Read one project dependency edge by its id (parameters passed through; the server validates them)."""
|
|
159
|
+
return await self._call("project_dependency_get", params)
|
|
160
|
+
|
|
161
|
+
async def project_dependency_delete(self, **params: Any) -> Any:
|
|
162
|
+
"""Delete a project dependency edge: mark by default, hard=true removes a marked edge, dry_run previews (parameters passed through; the server validates them)."""
|
|
163
|
+
return await self._call("project_dependency_delete", params)
|
|
164
|
+
|
|
165
|
+
async def project_dependency_list(self, **params: Any) -> Any:
|
|
166
|
+
"""List a paginated page of project dependency edges filtered by dependent/depends-on project and active status."""
|
|
167
|
+
return await self._call("project_dependency_list", params)
|
|
168
|
+
|
|
169
|
+
async def project_dependency_discover(self, **params: Any) -> Any:
|
|
170
|
+
"""Discover the transitive reverse-dependent project set (suspected impact set) for a source project."""
|
|
171
|
+
return await self._call("project_dependency_discover", params)
|
|
172
|
+
|
|
173
|
+
async def project_dependents(self, **params: Any) -> Any:
|
|
174
|
+
"""List the projects that directly depend on a given project (reverse-dependency lookup)."""
|
|
175
|
+
return await self._call("project_dependents", params)
|
|
176
|
+
|
|
177
|
+
async def project_import(self, **params: Any) -> Any:
|
|
178
|
+
"""Import a code-analysis-server project into the registry (the only way a project enters it; idempotent)."""
|
|
179
|
+
return await self._call("project_import", params)
|
|
180
|
+
|
|
181
|
+
async def project_list(self, **params: Any) -> Any:
|
|
182
|
+
"""List the imported projects, filtered by imported_by or imported_by_prefix, with owned and referenced counts."""
|
|
183
|
+
return await self._call("project_list", params)
|
|
184
|
+
|
|
185
|
+
async def project_remove(self, **params: Any) -> Any:
|
|
186
|
+
"""Remove an imported project from the registry; refused while records own or reference it."""
|
|
187
|
+
return await self._call("project_remove", params)
|
|
188
|
+
|
|
189
|
+
async def project_update(self, **params: Any) -> Any:
|
|
190
|
+
"""Change the comment of an imported project in place (parameters passed through; the server validates them)."""
|
|
191
|
+
return await self._call("project_update", params)
|
|
192
|
+
|
|
193
|
+
async def project_sync(self, **params: Any) -> Any:
|
|
194
|
+
"""Sync the imported projects with the code-analysis server: refresh names, delete unreferenced vanished projects (dry_run previews)."""
|
|
195
|
+
return await self._call("project_sync", params)
|
|
196
|
+
|
|
197
|
+
async def project_view(self, **params: Any) -> Any:
|
|
198
|
+
"""Project-centric aggregate view: paginated todos/bugs (plus a comments count) scoped to one project, direct or transitive via bound plans."""
|
|
199
|
+
return await self._call("project_view", params)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
__all__ = ["BugProjectCommandsMixin"]
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"""Context/prompt and gate/version/misc command-family facade mixin.
|
|
2
|
+
|
|
3
|
+
Author: Vasiliy Zdanovskiy
|
|
4
|
+
email: vasilyvz@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ContextGateCommandsMixin:
|
|
14
|
+
"""One method per plan_manager command in the context/prompt and gate/version/misc family.
|
|
15
|
+
|
|
16
|
+
Assumes it is mixed into a class that also inherits
|
|
17
|
+
plan_manager_client.dispatch._CommandDispatchMixin, which supplies the
|
|
18
|
+
coroutine async def _call(self, command: str, params: dict[str, Any] | None = None) -> Any
|
|
19
|
+
used by every method below.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
async def plan_prompt_chain(self, **params: Any) -> Any:
|
|
23
|
+
"""Assemble a paginated page of the deterministic, deduplicated prompt-chain artifact for a gate-green plan scope."""
|
|
24
|
+
return await self._call("plan_prompt_chain", params)
|
|
25
|
+
|
|
26
|
+
async def plan_prompt_create(self, **params: Any) -> Any:
|
|
27
|
+
"""Create the role prompt of a plan (plan, role, prompt_text, changed_by, idempotency_key; passed through).
|
|
28
|
+
|
|
29
|
+
The server answers a missing or invalid argument with the adapter's -32602 violation, not a Python TypeError.
|
|
30
|
+
"""
|
|
31
|
+
return await self._call("plan_prompt_create", params)
|
|
32
|
+
|
|
33
|
+
async def plan_prompt_get(self, **params: Any) -> Any:
|
|
34
|
+
"""Read a role prompt: exactly one of prompt_id, or plan together with role (passed through; a marked one carries deleted_at)."""
|
|
35
|
+
return await self._call("plan_prompt_get", params)
|
|
36
|
+
|
|
37
|
+
async def plan_prompt_list(self, **params: Any) -> Any:
|
|
38
|
+
"""List role prompts without their text (plan, role, include_deleted, limit, offset; passed through)."""
|
|
39
|
+
return await self._call("plan_prompt_list", params)
|
|
40
|
+
|
|
41
|
+
async def plan_prompt_update(self, **params: Any) -> Any:
|
|
42
|
+
"""Change the text of a prompt under expected_revision (prompt_id, prompt_text, changed_by, expected_revision, idempotency_key)."""
|
|
43
|
+
return await self._call("plan_prompt_update", params)
|
|
44
|
+
|
|
45
|
+
async def plan_prompt_delete(self, **params: Any) -> Any:
|
|
46
|
+
"""Delete a prompt: soft (mark) by default, hard=true removes an already marked one that nothing refers to (passed through)."""
|
|
47
|
+
return await self._call("plan_prompt_delete", params)
|
|
48
|
+
|
|
49
|
+
async def attachment_create(self, **params: Any) -> Any:
|
|
50
|
+
"""Create an attachment: owner, owner_type, role, target_kind, target_id, target_sha256 (document|paragraph|chunk) or target_entity_type (entity), fallback_text, changed_by, idempotency_key (passed through)."""
|
|
51
|
+
return await self._call("attachment_create", params)
|
|
52
|
+
|
|
53
|
+
async def attachment_get(self, **params: Any) -> Any:
|
|
54
|
+
"""Read an attachment: exactly one of attachment_id, or owner with role (passed through; a marked one carries deleted_at)."""
|
|
55
|
+
return await self._call("attachment_get", params)
|
|
56
|
+
|
|
57
|
+
async def attachment_list(self, **params: Any) -> Any:
|
|
58
|
+
"""List attachments without the fallback text (owner, role, target_id, target_state, include_deleted, limit, offset; passed through)."""
|
|
59
|
+
return await self._call("attachment_list", params)
|
|
60
|
+
|
|
61
|
+
async def attachment_update(self, **params: Any) -> Any:
|
|
62
|
+
"""Change the reference or the fallback text under expected_revision (attachment_id, expected_revision, changed_by, idempotency_key; passed through)."""
|
|
63
|
+
return await self._call("attachment_update", params)
|
|
64
|
+
|
|
65
|
+
async def attachment_delete(self, **params: Any) -> Any:
|
|
66
|
+
"""Delete an attachment: soft (mark) by default, hard=true removes an already marked one (passed through)."""
|
|
67
|
+
return await self._call("attachment_delete", params)
|
|
68
|
+
|
|
69
|
+
async def report_create(self, **params: Any) -> Any:
|
|
70
|
+
"""Create a Report on an owner (passed through: owner, owner_type, title, text, changed_by, dry_run; no idempotency key)."""
|
|
71
|
+
return await self._call("report_create", params)
|
|
72
|
+
|
|
73
|
+
async def report_get(self, **params: Any) -> Any:
|
|
74
|
+
"""Read one Report (passed through: report_id)."""
|
|
75
|
+
return await self._call("report_get", params)
|
|
76
|
+
|
|
77
|
+
async def report_list(self, **params: Any) -> Any:
|
|
78
|
+
"""List Reports, rows without text (passed through: owner, include_deleted, limit, offset)."""
|
|
79
|
+
return await self._call("report_list", params)
|
|
80
|
+
|
|
81
|
+
async def report_update(self, **params: Any) -> Any:
|
|
82
|
+
"""Change the title or the text of a Report (passed through: report_id, changed_by, title, text, dry_run; no owner, no revision check)."""
|
|
83
|
+
return await self._call("report_update", params)
|
|
84
|
+
|
|
85
|
+
async def report_delete(self, **params: Any) -> Any:
|
|
86
|
+
"""Delete a Report: soft (mark) by default, hard=true removes an already marked one (passed through: report_id, changed_by, hard, recursive, dry_run)."""
|
|
87
|
+
return await self._call("report_delete", params)
|
|
88
|
+
|
|
89
|
+
async def plan_contract_create(self, **params: Any) -> Any:
|
|
90
|
+
"""Declare the external-API contract of a plan: exactly three documents (matrix, relations, results).
|
|
91
|
+
|
|
92
|
+
Parameters are passed through unchanged (plan, documents, changed_by, idempotency_key) so that a missing or
|
|
93
|
+
invalid argument is refused by the server with the adapter's -32602 violation, not by a Python TypeError.
|
|
94
|
+
"""
|
|
95
|
+
return await self._call("plan_contract_create", params)
|
|
96
|
+
|
|
97
|
+
async def plan_contract_get(self, **params: Any) -> Any:
|
|
98
|
+
"""Read a contract declaration: exactly one of contract_id and plan (passed through; a marked one carries deleted_at)."""
|
|
99
|
+
return await self._call("plan_contract_get", params)
|
|
100
|
+
|
|
101
|
+
async def plan_contract_list(self, **params: Any) -> Any:
|
|
102
|
+
"""List contract declarations (plan, project, include_deleted, limit, offset; passed through)."""
|
|
103
|
+
return await self._call("plan_contract_list", params)
|
|
104
|
+
|
|
105
|
+
async def plan_contract_update(self, **params: Any) -> Any:
|
|
106
|
+
"""Replace the three documents of a declaration under expected_contract_revision (parameters passed through)."""
|
|
107
|
+
return await self._call("plan_contract_update", params)
|
|
108
|
+
|
|
109
|
+
async def plan_contract_delete(self, **params: Any) -> Any:
|
|
110
|
+
"""Delete a declaration: soft (mark) by default, hard=true removes an already marked one (parameters passed through)."""
|
|
111
|
+
return await self._call("plan_contract_delete", params)
|
|
112
|
+
|
|
113
|
+
async def matrix_case_get(self, **params: Any) -> Any:
|
|
114
|
+
"""Read one matrix case of a plan by namespace and case_id; a case marked deleted is read with its mark (parameters passed through)."""
|
|
115
|
+
return await self._call("matrix_case_get", params)
|
|
116
|
+
|
|
117
|
+
async def matrix_lint(self, **params: Any) -> Any:
|
|
118
|
+
"""Lint the matrix parts of a plan and page the defects (parameters passed through)."""
|
|
119
|
+
return await self._call("matrix_lint", params)
|
|
120
|
+
|
|
121
|
+
async def matrix_call_upsert(self, **params: Any) -> Any:
|
|
122
|
+
"""Create or replace a hand-authored matrix call (parameters passed through).
|
|
123
|
+
|
|
124
|
+
An int or number argument of call.args[] may carry the optional range {min, max} (numbers or null, at
|
|
125
|
+
least one given, min <= max); lint then reports a case value outside it (CASE_ARG_RANGE).
|
|
126
|
+
"""
|
|
127
|
+
return await self._call("matrix_call_upsert", params)
|
|
128
|
+
|
|
129
|
+
async def matrix_call_delete(self, **params: Any) -> Any:
|
|
130
|
+
"""Delete a matrix call of a namespace (parameters passed through)."""
|
|
131
|
+
return await self._call("matrix_call_delete", params)
|
|
132
|
+
|
|
133
|
+
async def matrix_case_upsert(self, **params: Any) -> Any:
|
|
134
|
+
"""Create or replace a hand-authored matrix case (parameters passed through).
|
|
135
|
+
|
|
136
|
+
An error-expecting case names its defect kind in the optional expect.defect, allowed only with
|
|
137
|
+
expect.error: missing, unknown, type, enum, range, relation or state. expect.error is a domain code or
|
|
138
|
+
the protocol code "-32602" (text). Lint checks that the arguments contain that defect and nothing else.
|
|
139
|
+
"""
|
|
140
|
+
return await self._call("matrix_case_upsert", params)
|
|
141
|
+
|
|
142
|
+
async def matrix_case_delete(self, **params: Any) -> Any:
|
|
143
|
+
"""Delete a matrix case of a namespace (parameters passed through)."""
|
|
144
|
+
return await self._call("matrix_case_delete", params)
|
|
145
|
+
|
|
146
|
+
async def matrix_export(self, **params: Any) -> Any:
|
|
147
|
+
"""Export the matrix of a plan as pipeline_yaml or contract_json (parameters passed through)."""
|
|
148
|
+
return await self._call("matrix_export", params)
|
|
149
|
+
|
|
150
|
+
async def plan_authoring_guide(self, **params: Any) -> Any:
|
|
151
|
+
"""Read the authoring standards of one author type (hrs, mrs, matrix, g, t, a) or the overview (parameters passed through)."""
|
|
152
|
+
return await self._call("plan_authoring_guide", params)
|
|
153
|
+
|
|
154
|
+
async def plan_ref_check(self, **params: Any) -> Any:
|
|
155
|
+
"""Check the references of steps to matrix calls and cases without writing (parameters passed through)."""
|
|
156
|
+
return await self._call("plan_ref_check", params)
|
|
157
|
+
|
|
158
|
+
async def matrix_get(self, **params: Any) -> Any:
|
|
159
|
+
"""Read the matrix of a plan: summary, parts, or a page of calls or cases (parameters passed through)."""
|
|
160
|
+
return await self._call("matrix_get", params)
|
|
161
|
+
|
|
162
|
+
async def plan_contract_check(self, **params: Any) -> Any:
|
|
163
|
+
"""Queue a read-only check of the plan's step texts against its declared contract (passed through)."""
|
|
164
|
+
return await self._call("plan_contract_check", params)
|
|
165
|
+
|
|
166
|
+
async def context_compile(self, **params: Any) -> Any:
|
|
167
|
+
"""Compile a typed context block directly from concept ids."""
|
|
168
|
+
return await self._call("context_compile", params)
|
|
169
|
+
|
|
170
|
+
async def context_common(self, **params: Any) -> Any:
|
|
171
|
+
"""Compile the shared common context block for a parent step (step, a uuid4; omitted: the plan root)."""
|
|
172
|
+
return await self._call("context_common", params)
|
|
173
|
+
|
|
174
|
+
async def context_specific(self, **params: Any) -> Any:
|
|
175
|
+
"""Compile a child-specific delta over a common context block."""
|
|
176
|
+
return await self._call("context_specific", params)
|
|
177
|
+
|
|
178
|
+
async def context_bundle(self, **params: Any) -> Any:
|
|
179
|
+
"""Compile a common context block and child-specific deltas."""
|
|
180
|
+
return await self._call("context_bundle", params)
|
|
181
|
+
|
|
182
|
+
async def block_get(self, **params: Any) -> Any:
|
|
183
|
+
"""Return one stored context block by UUID, its 'blocks'/'content' entries paginated (bounded default 50, max 200 per page; small blocks return unchanged in one call)."""
|
|
184
|
+
return await self._call("block_get", params)
|
|
185
|
+
|
|
186
|
+
async def block_rebuild(self, **params: Any) -> Any:
|
|
187
|
+
"""Rebuild stored context blocks in batch against the current working state and return summary-only rows with a total/limit/offset envelope."""
|
|
188
|
+
return await self._call("block_rebuild", params)
|
|
189
|
+
|
|
190
|
+
async def block_list(self, **params: Any) -> Any:
|
|
191
|
+
"""List a paginated page of stored context block records for a plan."""
|
|
192
|
+
return await self._call("block_list", params)
|
|
193
|
+
|
|
194
|
+
async def branch_dump(self, **params: Any) -> Any:
|
|
195
|
+
"""Write the executor prompt of every branch of the plan under the configured export root as an explicitly non-authoritative derived snapshot."""
|
|
196
|
+
return await self._call("branch_dump", params)
|
|
197
|
+
|
|
198
|
+
async def branch_weak(self, **params: Any) -> Any:
|
|
199
|
+
"""Rank the plan's branches by ascending semantic index, refusing when the plan has not passed the mechanical gate."""
|
|
200
|
+
return await self._call("branch_weak", params)
|
|
201
|
+
|
|
202
|
+
async def branch_readiness(self, **params: Any) -> Any:
|
|
203
|
+
"""Show whether each branch of the plan is ready and the path from its G to its first blocker, from stored readiness flags in one query."""
|
|
204
|
+
return await self._call("branch_readiness", params)
|
|
205
|
+
|
|
206
|
+
async def plan_validate(self, **params: Any) -> Any:
|
|
207
|
+
"""Run the mechanical gate over a plan or one branch and report PASS/FAIL findings."""
|
|
208
|
+
return await self._call("plan_validate", params)
|
|
209
|
+
|
|
210
|
+
async def prompt_validate(self, **params: Any) -> Any:
|
|
211
|
+
"""Run the deterministic prompt contour (16 prompt_integrity checks: 15 engine checks and the plan contract check) over a plan or one branch."""
|
|
212
|
+
return await self._call("prompt_validate", params)
|
|
213
|
+
|
|
214
|
+
async def run_all_checks(self, **params: Any) -> Any:
|
|
215
|
+
"""Run every deterministic check surface (nine) over a plan or one branch and report one verdict."""
|
|
216
|
+
return await self._call("run_all_checks", params)
|
|
217
|
+
|
|
218
|
+
async def plan_score(self, **params: Any) -> Any:
|
|
219
|
+
"""Run the semantic scoring layer over a plan or one branch and return index, trust, and color."""
|
|
220
|
+
return await self._call("plan_score", params)
|
|
221
|
+
|
|
222
|
+
async def plan_unfreeze(self, **params: Any) -> Any:
|
|
223
|
+
"""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."""
|
|
224
|
+
return await self._call("plan_unfreeze", params)
|
|
225
|
+
|
|
226
|
+
async def plan_version_list(self, **params: Any) -> Any:
|
|
227
|
+
"""List the versions of a plan (the database version history), newest first."""
|
|
228
|
+
return await self._call("plan_version_list", params)
|
|
229
|
+
|
|
230
|
+
async def plan_version_diff(self, **params: Any) -> Any:
|
|
231
|
+
"""Compare two versions of a plan chosen by date: added, removed and changed records."""
|
|
232
|
+
return await self._call("plan_version_diff", params)
|
|
233
|
+
|
|
234
|
+
async def plan_rollback(self, **params: Any) -> Any:
|
|
235
|
+
"""Return a plan to its state at a date: the version with the greatest creation date not later than it."""
|
|
236
|
+
return await self._call("plan_rollback", params)
|
|
237
|
+
|
|
238
|
+
async def srt_snapshot_create(self, **params: Any) -> Any:
|
|
239
|
+
"""Create a semantic tree snapshot: the sole write operation of the SRT command surface. Snapshots the plan head."""
|
|
240
|
+
return await self._call("srt_snapshot_create", params)
|
|
241
|
+
|
|
242
|
+
async def srt_snapshot_list(self, **params: Any) -> Any:
|
|
243
|
+
"""List a paginated page of the retained history of semantic tree snapshots for a plan, newest first, metadata only by default (view="summary"); pass view="full" for the complete record including tree_content (read-only)."""
|
|
244
|
+
return await self._call("srt_snapshot_list", params)
|
|
245
|
+
|
|
246
|
+
async def srt_diff(self, **params: Any) -> Any:
|
|
247
|
+
"""Compute the semantic diff between two semantic tree snapshots (read-only)."""
|
|
248
|
+
return await self._call("srt_diff", params)
|
|
249
|
+
|
|
250
|
+
async def info(self, **params: Any) -> Any:
|
|
251
|
+
"""Return the server self-description in pages of at most 16384 bytes: without section a first page (identity, build, runtime, contents with ready refs); with section, subsection, path, limit and offset one page of that node; follow next_offset until has_more is false (read-only)."""
|
|
252
|
+
return await self._call("info", params)
|
|
253
|
+
|
|
254
|
+
async def plan_text_check(self, **params: Any) -> Any:
|
|
255
|
+
"""Check one plan text (form a: text with kind) or every stored text of a plan (form b: plan, with changed, step (the uuid4 of a step), limit and offset); read-only, nothing is written."""
|
|
256
|
+
return await self._call("plan_text_check", params)
|
|
257
|
+
|
|
258
|
+
async def command_catalog_dump(self, **params: Any) -> Any:
|
|
259
|
+
"""Return the complete machine-readable command catalog, generated from the live command inventory."""
|
|
260
|
+
return await self._call("command_catalog_dump", params)
|
|
261
|
+
|
|
262
|
+
async def ops_status(self, **params: Any) -> Any:
|
|
263
|
+
"""Return the deployed version, health state, and applied schema_migration rows in one read-only call."""
|
|
264
|
+
return await self._call("ops_status", params)
|
|
265
|
+
|
|
266
|
+
async def command_timing_stats(self, **params: Any) -> Any:
|
|
267
|
+
"""Aggregate the command_metric store into per-command call counts and p50/p95/max latency percentiles (read-only, paginated)."""
|
|
268
|
+
return await self._call("command_timing_stats", params)
|
|
269
|
+
|
|
270
|
+
async def step_prompt_verify(self, **params: Any) -> Any:
|
|
271
|
+
"""Compare candidate artifact content against a frozen step's content, field, or fenced code block, returning a match verdict (read-only, never mutates)."""
|
|
272
|
+
return await self._call("step_prompt_verify", params)
|
|
273
|
+
|
|
274
|
+
async def audit_list(self, **params: Any) -> Any:
|
|
275
|
+
"""List runtime audit log entries newest-first, filterable by actor, action, entity, and time window (read-only, paginated)."""
|
|
276
|
+
return await self._call("audit_list", params)
|
|
277
|
+
|
|
278
|
+
async def runtime_purge_batch(self, **params: Any) -> Any:
|
|
279
|
+
"""Purge a batch of already soft-deleted rows of one entity type, reporting per-row removals and reference-blocked refusals."""
|
|
280
|
+
return await self._call("runtime_purge_batch", params)
|
|
281
|
+
|
|
282
|
+
async def garbage_find(self, **params: Any) -> Any:
|
|
283
|
+
"""List the lost records (owner, parent or anchor missing from the registry), the surplus records (test leftovers by creator prefix and age) or the registry rows without a record (group registry) that garbage_purge would remove (read-only, paginated)."""
|
|
284
|
+
return await self._call("garbage_find", params)
|
|
285
|
+
|
|
286
|
+
async def garbage_purge(self, **params: Any) -> Any:
|
|
287
|
+
"""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)."""
|
|
288
|
+
return await self._call("garbage_purge", params)
|
|
289
|
+
|
|
290
|
+
async def reference_inspect(self, **params: Any) -> Any:
|
|
291
|
+
"""Inspect the cross-entity reference graph around one entity: which live rows point at it, optionally traversed transitively with cycle detection (read-only, paginated)."""
|
|
292
|
+
return await self._call("reference_inspect", params)
|
|
293
|
+
|
|
294
|
+
async def id_resolve(self, **params: Any) -> Any:
|
|
295
|
+
"""Resolve a partial identifier (any fragment of a UUID) to the full identifier(s) it matches, with each match's entity type and label (read-only, paginated)."""
|
|
296
|
+
return await self._call("id_resolve", params)
|
|
297
|
+
|
|
298
|
+
async def reference_repair(self, **params: Any) -> Any:
|
|
299
|
+
"""Find dangling scalar UUID references (read-only), clear a statically-nullable one, or remove the carrier of one that cannot be cleared (dry_run=true by default for the destructive path)."""
|
|
300
|
+
return await self._call("reference_repair", params)
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
__all__ = ["ContextGateCommandsMixin"]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Entity common operations command-family facade mixin.
|
|
2
|
+
|
|
3
|
+
Author: Vasiliy Zdanovskiy
|
|
4
|
+
email: vasilyvz@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class EntityCommonCommandsMixin:
|
|
13
|
+
"""One method per plan_manager command in the entity common operations family.
|
|
14
|
+
|
|
15
|
+
Assumes it is mixed into a class that also inherits
|
|
16
|
+
plan_manager_client.dispatch._CommandDispatchMixin, which supplies the
|
|
17
|
+
coroutine async def _call(self, command: str, params: dict[str, Any] | None = None) -> Any
|
|
18
|
+
used by every method below.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
async def entity_reparent(self, **params: Any) -> Any:
|
|
22
|
+
"""Reparent an entity to a new parent in the hierarchy."""
|
|
23
|
+
return await self._call("entity_reparent", params)
|
|
24
|
+
|
|
25
|
+
async def entity_copy(self, **params: Any) -> Any:
|
|
26
|
+
"""Copy entities with everything they own under a new owner (new ids, the structure kept)."""
|
|
27
|
+
return await self._call("entity_copy", params)
|
|
28
|
+
|
|
29
|
+
async def entity_restore(self, **params: Any) -> Any:
|
|
30
|
+
"""Clear the deletion mark of entities of any kind; recursive=true also clears the marked records they own."""
|
|
31
|
+
return await self._call("entity_restore", params)
|
|
32
|
+
|
|
33
|
+
async def entity_traversal(self, **params: Any) -> Any:
|
|
34
|
+
"""Traverse the entity hierarchy with filtering and pagination."""
|
|
35
|
+
return await self._call("entity_traversal", params)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
__all__ = ["EntityCommonCommandsMixin"]
|