7Roadmap registry operation executors.
11Expose typed helpers for the roadmap v0.3 operation catalog.
15- Build versioned payloads for roadmap item, version, phase, section, and
17- Require HMAC proof for non-system callers before invoking the registry seam.
18- Keep SQL ownership inside the SQLite backend projection layer.
24 L2 - operation helper lifecycle
25 L3 - payload construction details
26 L4 - preflight validation details
30- Every mutating helper calls Registry.execute_domain_command.
31- The module performs no direct SQL, filesystem, subprocess, or clock work.
35- oc_chat.registry.api (Registry facade)
36- oc_chat.registry.errors (HMAC preflight error)
37- oc_chat.registry.backends.base (OperationLogRow type returned by each helper)
38- oc_diagnostics (structured debug logging via _dbg)
40from __future__
import annotations
42from typing
import Literal, Mapping
44from oc_diagnostics
import _dbg
50_dbg(
"OC_CHAT.MAIN",
"module",
"loaded", 4)
52ActorType = Literal[
"human_operator",
"orchestrator_agent",
"worker_agent"]
53RoadmapStatus = Literal[
"todo",
"in_progress",
"done",
"deferred",
"blocked",
"superseded"]
54RoadmapPriority = Literal[
"critical",
"high",
"medium",
"lower"]
55RoadmapTrackKind = Literal[
"m_phase",
"backlog",
"vision",
"git_workflow",
"pre_m0_era"]
56DependencyKind = Literal[
"blocks",
"enables",
"gates",
"part_of"]
57ContributionKind = Literal[
"full",
"partial",
"context_only"]
66 actor_type: ActorType,
67 track_kind: RoadmapTrackKind =
"m_phase",
68 phase_code: str |
None =
None,
69 phase_label: str |
None =
None,
70 parent_item_id: str |
None =
None,
71 prose: str |
None =
None,
72 prose_path: str |
None =
None,
73 status: RoadmapStatus =
"todo",
74 priority: RoadmapPriority |
None =
None,
76 target_version: str |
None =
None,
77 introduced_in_version_id: str |
None =
None,
78 closed_in_version_id: str |
None =
None,
79 closed_round_no: int |
None =
None,
80 superseded_by_item_id: str |
None =
None,
81 command: str |
None =
None,
82 auth_proof: Mapping[str, object] |
None =
None,
83 system_actor: bool =
False,
85 """Create or upsert a roadmap item through the registry seam."""
87 _require_auth(auth_proof, system_actor, command
or "roadmap_item.create", actor_slot)
88 return registry.execute_domain_command(
89 "roadmap_item.create",
95 "track_kind": track_kind,
96 "phase_code": phase_code,
97 "phase_label": phase_label,
98 "parent_item_id": parent_item_id,
100 "prose_path": prose_path,
102 "priority": priority,
103 "sort_order": sort_order,
104 "target_version": target_version,
105 "introduced_in_version_id": introduced_in_version_id,
106 "closed_in_version_id": closed_in_version_id,
107 "closed_round_no": closed_round_no,
108 "superseded_by_item_id": superseded_by_item_id,
110 actor_type=actor_type,
112 auth_proof=auth_proof,
113 system_actor=system_actor,
121 from_status: RoadmapStatus |
None,
122 to_status: RoadmapStatus,
124 actor_type: ActorType,
125 in_version_id: str |
None =
None,
126 closed_round_no: int |
None =
None,
127 superseded_by_item_id: str |
None =
None,
128 note: str |
None =
None,
129 command: str |
None =
None,
130 auth_proof: Mapping[str, object] |
None =
None,
131 system_actor: bool =
False,
133 """Set a roadmap item status and append a roadmap item event."""
135 _require_auth(auth_proof, system_actor, command
or "roadmap_item.set_status", actor_slot)
136 return registry.execute_domain_command(
137 "roadmap_item.set_status",
142 "from_status": from_status,
143 "to_status": to_status,
144 "in_version_id": in_version_id,
145 "closed_round_no": closed_round_no,
146 "superseded_by_item_id": superseded_by_item_id,
149 actor_type=actor_type,
151 auth_proof=auth_proof,
152 system_actor=system_actor,
162 actor_type: ActorType,
163 kind: DependencyKind =
"gates",
164 in_version_id: str |
None =
None,
165 note: str |
None =
None,
166 command: str |
None =
None,
167 auth_proof: Mapping[str, object] |
None =
None,
168 system_actor: bool =
False,
170 """Create an item-to-item dependency."""
172 if from_item_id == to_item_id:
173 raise ValueError(
"roadmap dependency cannot point to itself")
174 _require_auth(auth_proof, system_actor, command
or "roadmap_item.add_dependency", actor_slot)
175 return registry.execute_domain_command(
176 "roadmap_item.add_dependency",
180 "from_item_id": from_item_id,
181 "to_item_id": to_item_id,
183 "in_version_id": in_version_id,
186 actor_type=actor_type,
188 auth_proof=auth_proof,
189 system_actor=system_actor,
196 from_version_id: str |
None,
199 actor_type: ActorType,
200 bump_kind: Literal[
"patch",
"minor",
"major",
"out_of_round_revision"] =
"patch",
201 era_id: str |
None =
None,
202 status: Literal[
"draft",
"current",
"superseded"] =
"draft",
203 released_at: str |
None =
None,
204 last_updated_at: str |
None =
None,
205 source_round_no: int |
None =
None,
206 notes: str |
None =
None,
207 command: str |
None =
None,
208 auth_proof: Mapping[str, object] |
None =
None,
209 system_actor: bool =
False,
211 """Create a new roadmap version row."""
213 _require_auth(auth_proof, system_actor, command
or "roadmap_version.bump", actor_slot)
214 return registry.execute_domain_command(
215 "roadmap_version.bump",
219 "from_version_id": from_version_id,
220 "to_version_id": to_version_id,
223 "released_at": released_at,
224 "last_updated_at": last_updated_at,
225 "source_round_no": source_round_no,
226 "bump_kind": bump_kind,
229 actor_type=actor_type,
231 auth_proof=auth_proof,
232 system_actor=system_actor,
241 actor_type: ActorType,
242 in_version_id: str |
None =
None,
243 note: str |
None =
None,
244 command: str |
None =
None,
245 auth_proof: Mapping[str, object] |
None =
None,
246 system_actor: bool =
False,
248 """Mark a roadmap phase complete."""
250 _require_auth(auth_proof, system_actor, command
or "roadmap_phase.complete", actor_slot)
251 return registry.execute_domain_command(
252 "roadmap_phase.complete",
256 "phase_code": phase_code,
257 "in_version_id": in_version_id,
260 actor_type=actor_type,
262 auth_proof=auth_proof,
263 system_actor=system_actor,
275 actor_type: ActorType,
276 query_params_json: str |
None =
None,
277 required_min_version: str |
None =
None,
279 command: str |
None =
None,
280 auth_proof: Mapping[str, object] |
None =
None,
281 system_actor: bool =
False,
283 """Upsert roadmap render-section configuration."""
285 _require_auth(auth_proof, system_actor, command
or "roadmap_section.upsert", actor_slot)
286 return registry.execute_domain_command(
287 "roadmap_section.upsert",
291 "file_kind": file_kind,
292 "section_path": section_path,
293 "sort_order": sort_order,
294 "query_kind": query_kind,
295 "query_params_json": query_params_json,
296 "required_min_version": required_min_version,
299 actor_type=actor_type,
301 auth_proof=auth_proof,
302 system_actor=system_actor,
312 actor_type: ActorType,
313 contribution: ContributionKind =
"partial",
314 command: str |
None =
None,
315 auth_proof: Mapping[str, object] |
None =
None,
316 system_actor: bool =
False,
318 """Link a plan to a roadmap item."""
320 _require_auth(auth_proof, system_actor, command
or "roadmap_plan_link.create", actor_slot)
321 return registry.execute_domain_command(
322 "roadmap_plan_link.create",
328 "contribution": contribution,
330 actor_type=actor_type,
332 related_plan_id=plan_id,
333 auth_proof=auth_proof,
334 system_actor=system_actor,
339 auth_proof: Mapping[str, object] |
None,
344 if system_actor
or auth_proof
is not None:
347 attempted_slot=actor_slot,
350 failure_reason=
"missing_auth_proof",
OperationLogRow roadmap_section_upsert(Registry registry, *, str file_kind, str section_path, int sort_order, str query_kind, str actor_slot, ActorType actor_type, str|None query_params_json=None, str|None required_min_version=None, bool active=True, str|None command=None, Mapping[str, object]|None auth_proof=None, bool system_actor=False)
OperationLogRow roadmap_version_bump(Registry registry, *, str|None from_version_id, str to_version_id, str actor_slot, ActorType actor_type, Literal["patch", "minor", "major", "out_of_round_revision"] bump_kind="patch", str|None era_id=None, Literal["draft", "current", "superseded"] status="draft", str|None released_at=None, str|None last_updated_at=None, int|None source_round_no=None, str|None notes=None, str|None command=None, Mapping[str, object]|None auth_proof=None, bool system_actor=False)
OperationLogRow roadmap_item_create(Registry registry, *, str item_id, str title, str actor_slot, ActorType actor_type, RoadmapTrackKind track_kind="m_phase", str|None phase_code=None, str|None phase_label=None, str|None parent_item_id=None, str|None prose=None, str|None prose_path=None, RoadmapStatus status="todo", RoadmapPriority|None priority=None, int sort_order=0, str|None target_version=None, str|None introduced_in_version_id=None, str|None closed_in_version_id=None, int|None closed_round_no=None, str|None superseded_by_item_id=None, str|None command=None, Mapping[str, object]|None auth_proof=None, bool system_actor=False)
OperationLogRow roadmap_item_set_status(Registry registry, *, str item_id, RoadmapStatus|None from_status, RoadmapStatus to_status, str actor_slot, ActorType actor_type, str|None in_version_id=None, int|None closed_round_no=None, str|None superseded_by_item_id=None, str|None note=None, str|None command=None, Mapping[str, object]|None auth_proof=None, bool system_actor=False)
OperationLogRow roadmap_item_add_dependency(Registry registry, *, str from_item_id, str to_item_id, str actor_slot, ActorType actor_type, DependencyKind kind="gates", str|None in_version_id=None, str|None note=None, str|None command=None, Mapping[str, object]|None auth_proof=None, bool system_actor=False)
None _require_auth(Mapping[str, object]|None auth_proof, bool system_actor, str command, str actor_slot)
OperationLogRow roadmap_phase_complete(Registry registry, *, str phase_code, str actor_slot, ActorType actor_type, str|None in_version_id=None, str|None note=None, str|None command=None, Mapping[str, object]|None auth_proof=None, bool system_actor=False)
OperationLogRow roadmap_plan_link_create(Registry registry, *, str plan_id, str item_id, str actor_slot, ActorType actor_type, ContributionKind contribution="partial", str|None command=None, Mapping[str, object]|None auth_proof=None, bool system_actor=False)