Documentation index · Agent protocol · Workspaces · State and recovery · Development
Praector is a durable orchestration layer above disposable agent sessions. Its job is to move delegation, dependency tracking, retries, persistence, process lifecycle, workspace state, and acceptance out of model context and into deterministic software.
The central design rule is:
Agents request durable work; they do not own child-agent process lifecycle.
OpenCode is the only harness implementation in the current release, but OpenCode sessions are deliberately treated as disposable execution attempts rather than durable organizational state.
- Task != Attempt != Session.
- A Task is the durable unit of work.
- An Attempt is one execution effort for that Task.
- A Session is one disposable harness process/context.
- The graph is durable and dynamic. Workers can discover new work at runtime.
- Git owns project files. Dolt owns orchestration state.
- The user's original checkout is not an agent workspace. Praector uses dedicated worktrees.
- Delegation crosses the Praector boundary. Native OpenCode subagent/background-task delegation is disabled.
- Only the coordinator has graph-level authority. Workers may request work or coordinator attention, not arbitrarily mutate the graph.
- Read-only profiles are enforced outside the model. Tool permissions are paired with Git mutation detection/rollback.
- Implementation requires independent review. A completed implementation is not acceptable without a completed passing verifier.
- Collection completion is not base-branch acceptance. Acceptance is explicit, validated, and recorded separately.
- Session continuity is never required for correctness. Restarting with a fresh OpenCode invocation must be safe.
Organization future
└── Project current durable scope
└── Collection high-level objective / initiative
└── Task durable unit of work
└── Attempt
└── Session
A long-lived project identity. Praector currently maps one Project to one Git repository.
A Project owns:
- repository/root path;
- base branch;
- harness/model/profile configuration;
- execution limits;
- project memory and decisions;
- Collections.
The repository contains a local .praector/project.toml marker. Global durable state defaults to ~/.praector or $PRAECTOR_HOME.
A Collection is one objective created by praector run.
It owns:
- objective/title;
- evolving task graph;
- integration branch/worktree;
- collection-scoped memory/decisions;
- all Tasks needed to reach a terminal result;
- optional later acceptance records.
The graph is not merely the original plan. It is the durable record of the organization's evolving attempt to accomplish the objective.
A Task is a stable durable identity with fields such as:
- profile;
- objective/reason;
- parent/requester;
- depth/priority;
- status;
- dependency/lineage edges;
- workspace mode/branch/worktree/commit references;
- structured result.
A Task may have multiple Attempts.
One execution effort for a Task. Attempts record:
- attempt number;
- status;
- start/end time;
- exit code;
- OpenCode session identifier if available;
- log path;
- result snapshot.
The log path is persisted before OpenCode launches so a running attempt can be inspected with praector logs ... --tail.
One disposable harness invocation. In the current release this is one opencode run process.
Sessions record harness/process details, but are never the durable source of truth.
CLI / operator
│
▼
DoltStore ◄────────────── Task Envelope compiler
│ │
│ ▼
├────────► Scheduler ───► Harness(OpenCode)
│ │ │
│ ▼ │
└────────► GitWorkspace ◄──────┘
│
▼
Git repository
Responsibilities:
- project/context resolution;
- runtime preflight;
- operator commands;
- task/delegation/result commands exposed to workers;
- acceptance validation and UX;
- status/log output.
The CLI should not own scheduling policy or Git implementation details.
Responsibilities:
- relational durable state;
- task graph edges;
- task/attempt/session transitions;
- memory/decisions/events;
- semantic Dolt commits at meaningful boundaries;
- acceptance audit records;
- invariant repair on bootstrap.
Responsibilities:
- exclusive scheduler ownership;
- stale-session recovery;
- dependency readiness;
- bounded parallel execution;
- claim/retry behavior;
- post-run capability checks;
- checkpoint/integration;
- auto-review policy;
- review-failure repair loop;
- collection terminal-state reconciliation.
Scheduling and retries are deterministic software concerns, not coordinator-model responsibilities.
Every disposable attempt receives the same packaged global engineering contract before its role-specific prompt. This contract is part of Praector's semantic continuity layer: minimal coherent edits, surrounding-impact/inheritance awareness, durable README/AGENTS knowledge preservation, simple/local-style implementation, useful docstrings, and scope restraint survive delegation, retry, and fresh-session boundaries without being copied into every material task objective. Role prompts specialize and enforce this common contract.
Builds PRAECTOR TASK ENVELOPE v1 for every fresh attempt.
It compiles:
- task identity/objective/profile;
- assigned worktree;
- parent result;
- completed dependency results;
- accepted memory;
- active decisions;
- role boundary;
- allowed delegation operations;
- result schema/stop conditions.
See AGENT_PROTOCOL.md.
Owns external code-review publication semantics without moving provider details into the scheduler or Dolt store. Praector currently implements GitHubCLIProvider through the authenticated gh CLI and exposes a small provider protocol for repository lookup, find/view/create/open operations. PR body/title assembly is deterministic from durable Collection/Task results.
Responsibilities:
- collection integration branch/worktree;
- task branches/worktrees;
- checkpoints;
- read-only reset/cleanup;
- inherited-child integration;
- collection-level integration;
- acceptance into a target branch;
- safe cleanup.
See WORKSPACES.md.
The scheduler depends on a generic Harness contract, not on OpenCode internals.
Praector currently implements only OpenCodeHarness.
The adapter is responsible for one disposable run:
- clean inherited parent virtualenv leakage from the worker environment;
- synchronize
$PWDwith the assigned worktree as well as subprocess cwd/--dir; - inject Praector's high-precedence OpenCode permissions;
- strip
PRAECTOR_CDP_URL/PRAECTOR_ARTIFACT_DIRfrom a non-granted attempt's merged environment and add the optionalchrome-devtools-mcpinline server for a browser-granted attempt whennpxresolves, both driven by the scheduler-supplied grant (never read back from the environment); - launch
opencode run --pure --format json --auto --agent build --dir <worktree>; - stream/capture output;
- expose PID/start callback;
- record the durable
browser_cdp=<url|off>audit field in the HARNESS header, derived from the scheduler's browser grant decision; - return process exit/final text/session metadata.
Provider-specific behavior belongs here, not in scheduler/database logic.
Real-browser (CDP) access is a default-off project capability ([capabilities] browser + a top-level [browser] cdp_url, defaulting to the blessed loopback constant http://127.0.0.1:9222) granted only to the research and implement profiles via the single named BrowserProfiles predicate. The scheduler computes the grant once and threads it to all three decision sites — the worker environment injection, the HARNESS browser_cdp header, and the harness's inline config — so a grant can never appear at one site but not another, and the audit header can never disagree with what was injected. A granted attempt also receives PRAECTOR_ARTIFACT_DIR under $PRAECTOR_HOME/artifacts/<task>/attempt-<n>, created strictly outside any worktree so evidence cannot trip the read-only Git-mutation check. Praector owns only the decision, injection, artifact-dir creation, audit field, and the optional inline MCP entry: it runs no CDP client, no container/health/lease/process lifecycle, and never probes or validates cdp_url, which is trusted, loopback-pinned operator configuration. CDP is unauthenticated drift-proofing for models, not a security boundary or host isolation. See OPERATIONS.md.
A normal collection follows this control flow:
praector run "objective"
│
▼
Project resolved + preflight
│
▼
Collection + coordinator Task created durably
│
▼
Scheduler launches fresh coordinator Attempt
│
├── Praector injects explore -> critic preflight; coordinator creates durable plan_review/research/implement/review/advise Tasks
│
└── coordinator submits result and exits
│
▼
Dependencies become READY as prerequisites COMPLETE
│
▼
Worker Attempts run in isolated worktrees
│
▼
Implementation checkpoint + integration
│
▼
Independent review (auto-created if needed)
│
├── pass ──► COMPLETE
│
└── fail ──► repair implement Task ──► fresh durable review Task/context
│
▼
All graph work terminal/successful
│
▼
Collection COMPLETE
│
▼
explicit `praector collection accept`
│
▼
base/target branch contains accepted result
The initial coordinator may seed a graph, but the graph remains appendable throughout execution.
A worker can request a new Task because it discovers:
- a new prerequisite;
- an out-of-scope implementation;
- missing evidence;
- a specialist judgment question;
- a need for independent verification;
- a plan assumption that is false.
Normal workers use praector task request. Graph-level reconsideration uses praector coordinator attention.
Parent RUNNING
├── request Child
└── continue own bounded work
Child may execute concurrently when dependencies permit.
Parent RUNNING
│
├── checkpoint if write-capable
├── create Child
├── dependency is recorded
└── Parent -> WAITING; current Attempt exits
Child COMPLETE
│
▼
Parent -> READY
│
▼
fresh Parent Attempt with child result in the Envelope
No model session is kept alive merely to wait for a dependency.
Repository exploration is a distinct planning phase. For implementation Collections, reconciliation injects a read-only explore task before the initial or acceptance-revision coordinator is allowed to shape material work. Purely local implementation makes the mandatory critic depend on exploration; when planning policy requires current external evidence, fresh research runs in parallel and the critic depends on both. This gives the coordinator an evidence-grounded current-system map, current external truth where material, and an independent planning challenge before it creates implementation contracts. Internal critic-revalidation coordinators do not recursively trigger new exploration; exploration is per operator planning generation, while material-plan fingerprinting covers implementation/research/advice contracts and completed research evidence.
Praector currently uses one runtime contract and a small role-based profile taxonomy:
coordinator— privileged planner and durable graph authority; read-only project files;critic— pre-planning gap/ambiguity/scope/QA critic; read-only;plan_review— practical executability reviewer for the proposed graph; read-only;research— bounded evidence gathering; read-only;implement— bounded project-file mutation;review— independent post-implementation verification; read-only;advise— strategic technical/architecture recommendation; read-only.
The distinction between plan_review and review is intentional: the former asks whether the work graph is executable before write work proceeds; the latter verifies the integrated implementation after write work completes. Domain specialization belongs in task context, not an ever-growing persona taxonomy.
Only the coordinator may directly perform graph repair such as adding dependencies or superseding tasks. Workers can request durable work and coordinator attention. A failed plan_review deterministically blocks the gate, wakes a coordinator for graph repair, and then reruns the same durable plan-review Task in a fresh Attempt.
See PROFILES.md for the built-in role contracts and AGENT_PROTOCOL.md for runtime delegation/result mechanics.
PENDING/READY
│
▼
RUNNING
│
├────────────► WAITING
│ │
│ dependencies complete
│ │
│ ▼
│ READY
│
▼
VERIFYING
│
└────────────► COMPLETE
Error/terminal variants:
FAILED
CANCELLED
SUPERSEDED
VERIFYING is intentionally distinct. A model may submit its result before its OpenCode process exits. Dependents must not be released until deterministic post-processing finishes.
CREATED -> STARTING -> RUNNING -> SUCCEEDED
├-> FAILED
├-> TIMED_OUT
└-> ABORTED
Task state and Attempt state are independent. For example, a concrete Attempt with non-zero process exit is FAILED even if the Task is moved back to READY for another retry.
Automatic retries reuse the same durable Task until its configured Attempt budget is exhausted. An operator-requested retry after terminal failure creates a fresh replacement Task and marks the exhausted Task SUPERSEDED; prior Attempts are never deleted or renumbered. Hard dependents are rewired to the replacement so recovery remains graph-safe and auditable.
Every completed implementation must be independently reviewed.
Implement
│
▼
integrate candidate
│
▼
Review #1
┌─┴─┐
pass fail
│ │
│ └──► Repair(implement)
│ │
│ ▼
│ Fresh Review #2
│ │
│ pass/fail
▼
COMPLETE
A review Task cannot count as complete review evidence unless its structured result contains an explicit verdict: pass or verdict: fail.
Exiting a reviewer session without that structured verdict is a protocol failure, not a substantive fail verdict. Praector retries the same durable review Task first. A genuine verdict=fail is different: the failed review becomes terminal historical evidence, the repair implementation depends on it, and successful repair integration creates a new durable review Task with a fresh context. That fresh reviewer independently re-evaluates the repaired integrated candidate and verifies both the repair implementation and the original implementation it corrected. That verifier linkage is wired deterministically in Scheduler.ensureReview rather than left to the fresh reviewer: the original implementations are resolved regardless of whether the failed review records them via a verifies edge, a parent back-reference, or — for a coordinator-created failed review carrying only depends_on — the failed review's own completed implement dependencies, so the scheduler-created and coordinator-created shapes both converge to COMPLETE instead of leaving the Collection permanently BLOCKED. The carry adds graph edges only (never a coverage-rule relaxation), reuses the same open fresh review across a revision re-run with a stable edge count, and does not participate in the depends_on cycle guard. The failed review is also a hard dependency of the fresh review, so its findings/evidence are carried in the new context rather than forgotten; the fresh reviewer re-checks or refutes each carried finding, and the prior verdict itself is not authoritative. Collection terminal reconciliation therefore requires every completed implementation lineage to end in a completed passing verifier before the Collection may become COMPLETE. When reconciliation still yields BLOCKED, the holding predicate is named rather than inferred: one shared collectionBlockedReason helper projects the reason directly from the same terminal-decision cores (terminalStateForCollection / implementationsMissingPassingReviewFromRows) and emits a COVERAGE_GAP/OPEN_REVISIONS/CRITIC_STALE/DELIVERY_POLICY payload (with the offending implementation ids) into status/collection show and the stuck-floor attention, so an operator reads why the graph is held without a speculative guess or raw Dolt SQL (repair verifies carries are readable via praector graph --edges). Task-tree depth accounting is likewise explicit: max_task_depth is consumed only at the worker/coordinator request-seam delegation checks (Store.RequestTask / Store.RequestCoordinatorAttention, both via one requestSeamTaskDepth definition), while scheduler-staged planning scaffolding flows through CreateTask with an explicit Depth and is deliberately excluded so a late legitimate repair stays creatable; there is no separate depth knob.
Historical failed reviews remain visible for provenance; they do not permanently poison acceptance once a fresh post-repair review proves the corrected lineage. Protocol-broken reviewer replacements still use same-role supersession and preserve prerequisite/verification lineage.
The model-driven gates verify conformance to the contract they were handed; the gate-traceability layer additionally verifies that what that contract already told them to check was actually checked. It adds no table and no schema migration.
- Completed critic/plan-review/advise results are harvested along
depends_onlineage (Store.DirectiveAncestors, mirroringStore.ResearchAncestors) into uniformly-identified inherited directives (<source-task-id>:<kind>:<ordinal>), and the same harvest feeds the Envelope projectioninherited_directives. - Passing reviews and plan reviews must disposition every inherited directive (
satisfied/deferred/explicit_exception, the latter two requiring a durable decision id) and must carry the durableimpact_enumerationsibling-effect sweep with per-site dispositions and a named enumeration method. Both are deterministic pure validators (ValidateDirectiveTraceability,ValidateReviewImpactEnumeration): the directive validator runs at the existing research-consistency seams (submit, claim-time planning barrier, acceptance), while impact enumeration runs at submit and acceptance only. Diff-derived inputs — the candidate introduced-knob list fromGitWorkspace.DeriveConfigCandidates(git diff base...integration, three-dot likeCollectionDiff) — are computed at those seams and passed in as data, so no git access enterspolicy.goand nil-candidate behavior stays byte-identical. Evidence is content-floored (a file path, test name, or command), MUST-level directives (structured level or leadingMUST:/MUST NOT:string prefix) cannot be deferred, and self-reportedintroduced_knobis only a supplement to the derived rule. The enumeration is auditable and falsifiable by a human, never a completeness proof. - An oracle exception in an external-conformance review must name the concrete
probes(scenario, command/test, observed outcome) that replace the missing authoritative oracle. - A
DIRECTIVE_TRACEABILITY_GAPevent is recorded when a completed consumer's dispositions are missing; enforcement itself lives at the submit/claim/acceptance gates, and pre-existing history is exempted only through the documented legacy exception, which must be collection-scoped, name the collection, and carry no task scope (the schema-free operator discriminator).
The original user checkout is not a worker workspace.
Praector creates:
praector/collections/<collection-id> collection integration branch
praector/tasks/<collection-id>/<task-id> implementation task branch
and physical worktrees under:
$PRAECTOR_HOME/worktrees/<project>/<collection>/integration
$PRAECTOR_HOME/worktrees/<project>/<collection>/<task>
Read-only tasks receive detached worktrees. Implement tasks receive task branches.
An inherited implementation child merges back into its parent Task branch; an independent implementation merges into the Collection integration branch.
See WORKSPACES.md.
A COMPLETE Collection is an acceptance-grade reviewed candidate. Publishing that candidate as a pull request and accepting it into a base branch are separate lifecycle actions:
Collection COMPLETE
│
├── praector collection pr ──> external PR delivery record
│ (Collection remains COMPLETE)
│
└── praector collection accept -> acceptance record / target integration
PR delivery always uses the Collection integration branch as the head. Task branches are never the external review boundary. Existing PRs are reused by head branch/provider identity, which lets collection revise update the same open PR after fresh reviewed work.
COMPLETE means the durable work graph finished successfully. It does not mean the result has been accepted into main/master.
Collection COMPLETE
│
├── inspect / diff / dry-run
├── defect found -> `praector collection revise` -> RUNNING -> repaired + freshly reviewed -> COMPLETE
▼
praector collection accept
│
├── require explicit passing reviews
├── require clean integration/target worktrees
├── safe fast-forward by default
├── optional explicit --no-ff merge
└── record acceptance in Dolt
▼
Target branch contains accepted result
PR delivery is stored in collection_pull_requests, while direct acceptance is stored in collection_acceptances; neither overloads scheduler state. Pre-acceptance human revision requests are stored in collection_revisions; an OPEN revision is itself a completion blocker until fresh repaired implementation is independently verified.
This keeps execution status simple and makes acceptance an auditable organizational boundary.
See WORKSPACES.md and OPERATIONS.md.
Praector deliberately uses two versioned stores:
Answers:
- what changed in project files?
- which commit/branch contains the work?
- how do implementation branches integrate?
Answers:
- what work existed?
- who/what requested it?
- what depended on what?
- why did work wait/retry/fail?
- what result/evidence/decision was recorded?
- what PR was published/updated for a Collection?
- what was accepted, when, and into which branch?
Operational SQL changes may happen frequently. Semantic Dolt commits are reserved for meaningful organizational transitions.
A scheduler restart does not rely on OpenCode session recovery.
On startup, running Session rows are treated as orphaned:
- terminate the old process group if still alive;
- mark Session/Attempt
ABORTED; - return affected
RUNNING/VERIFYINGTasks toREADY; - preserve the Git worktree/branch;
- launch a fresh Attempt when runnable.
The durable Task and Git state survive; the Session does not matter.
Praector is currently local/single-machine with bounded parallelism.
The control plane is a native Go executable. Unix and Windows use separate locking/process adapters; Windows worker trees are assigned to Job Objects so cancellation/recovery can terminate descendants without Unix signals.
- Only one scheduler/daemon owns execution at a time via an OS-native exclusive lock (Unix
flock; Windows file locking). - A thread pool executes runnable Tasks up to
max_parallel_tasks. - Dolt mutations are serialized through the store lock.
- Dependency readiness determines which Tasks may run.
- Blocking inherited delegation prevents parent/child concurrent mutation of the same logical code line.
Distributed scheduling is intentionally a future extension.
Operator surfaces include:
praector status
praector graph COL-...
praector task list --collection COL-...
praector task show T-...
praector result show T-...
praector logs T-... --tail 100
praector logs COL-... --tail 100
praector collection show COL-...Dolt also preserves an event stream and semantic commit history. Git preserves code history independently.
The design leaves room for later additions without making them current dependencies. The prioritized sequence is maintained in ../ROADMAP.md. Important attachment points include:
-
MCP is now a live interface over the same durable domain/service/store operations used by the CLI: when enabled and the daemon is running, Praector hosts a loopback-only (127.0.0.1) streamable-HTTP MCP listener as a goroutine decoupled from the reconcile loop and
scheduler.lock. It performs only Store reads and durable enqueues on the same gated paths, never constructs a scheduler, and never launches processes or runs a collection inline. It is disabled by default, binds loopback only by default, and defers auth/identity to the remote boundary. A non-loopback bind is possible only via the explicit, default-offallow_externalopt-in (with a genuinely non-loopback addr), which adds no authentication, prints a loud startup warning, and relaxes only the authority gate to a CSRF/DNS-rebinding-shaped Origin check — never access control. The surface is commandHelp-driven: each CLI command maps to exactly one MCP tool (leaf command) or resource (command namespace / launch-only command) through the sharedserviceOpsregistry, giving command/surface coverage parity (the surfaces cannot drift) rather than a claim of unrestricted behavioral parity. Read-only commands and pass-through queue writes reuse the identical gatedStore/workspace methods; privileged write tools (explicit-root projectinit/registration plus the collection-finalizingcollection pr/accept/cleanup) sit behind a separate, default-offprivilegedopt-in (decisions DEC-1580dff0e0 / DEC-9997d2394f / DEC-28fcd38435 / DEC-aacb7bfc23).pr/acceptonly run the durable acceptance/PR validation and return the plan and never push, merge, or implicitly accept, whilecleanupperforms real worktree/branch removal andinitperforms real project registration. The listener advertises only the single MCP protocol revision it implements and meets a well-formed request naming a non-empty older/newer/unknown revision with a counter-offer — a successful result advertising the implemented revision, never echoing an unsupported one (Invalid-params is reserved for a missing/empty/non-string/malformed version, the missing/empty edge being a documented fail-closed hardening), requires a matchingMCP-Protocol-Versionheader on post-initializerequests (HTTP 400 otherwise), and — because it is loopback-only and unauthenticated — validates each request's Host/Origin as a loopback authority before dispatch (HTTP 403 on a foreign, literalnull, or otherwise-opaque Origin), as DNS-rebinding defense in depth on top of the socket-bind gate. Under theallow_externalforeign mode a reduced CSRF/DNS-rebinding-shaped check applies instead (dispatch a no-Origin request, 403 a literalnullOrigin and an Origin/Host port mismatch), while the protocol-header gate stays enforced; this reduced check is never authorization. MCP operations carry no implicit daemon cwd (a tool inferring a project requires an explicitPRJ-*/COL-*/T-*identifier, and a collection-only context resolves its owning project via a fail-closed store-backed resolver),initrequires an absoluteroot_path, and resources advertise accurate content types (application/jsonfor JSON listings,text/plainfor CLI/help text); the authoritative independent conformance oracle is an official MCP client (Inspector CLI / Tier-1 SDK), with Praector's own in-process Go tests as additional non-authoritative coverage of a live loopback listener.The push surface targets the MCP 2025-06-18 revision (see
docs/STATE_AND_RECOVERY.mdfor the durable event cursor and the SSE replay model, andROADMAP.mdfor the deferred 2026-07-28 subscriptions/listen + MRTR migration). AGET /mcpthat advertisesAccept: text/event-streamopens an observation-only SSE stream carrying onlynotifications/messagelogging frames — never a JSON-RPC response — while aGETthat does not advertise SSE still receives 405 (POST surface byte-for-byte unchanged). AGETis gated identically to POST: the same loopback-authority gate runs above method dispatch, and theMCP-Protocol-Versionheader is required unconditionally before a stream opens (GET has no JSON-RPC body to name a version). Fan-out is strictly non-blocking on the write path: every event writer hands a pending payload to a bounded side-channel, and a single drain goroutine outside the Dolt file lock delivers it; a stalled, slow, or vanished client causes at most a drop plus that client's stream close, never a stall inStore.Event()or the scheduler. All SSE stream/level/replay state lives in the Praector wiring layer (mcp_server.go+mcp_sse.go), never inside the domain-agnosticinternal/praector/mcppackage (decision DEC-17fa4b4aff). -
durable human/executive escalation above Projects/Collections, with blocked work waiting on recorded decisions rather than live session continuity;
-
additional harnesses through the native harness boundary;
-
multi-workspace/multi-repo Projects above the current one-repo mapping;
-
remote/distributed executors behind the scheduler/execution boundary;
-
schedules/events/watches that create/wake Collections;
-
external integrations that create Tasks or consume results;
-
richer memory/search behind the durable context interface;
-
approval/RBAC policy around acceptance and privileged actions;
-
web/desktop UI over the same durable state model.
Do not implement these by weakening Praector's invariants. Extend the relevant boundary instead.
- Runtime agent contract: AGENT_PROTOCOL.md
- CLI: CLI.md
- Git/worktrees/acceptance: WORKSPACES.md
- State/recovery/schema: STATE_AND_RECOVERY.md
- Operations: OPERATIONS.md
- Development: DEVELOPMENT.md
Coordinator discretion is intentionally bounded by a deterministic pre-write policy. internal/praector/policy.go classifies the Collection objective using conservative risk signals. The policy is exposed in Task Envelopes and enforced by the scheduler once pending/ready implementation work exists.
The policy currently recognizes security/authentication/credential-sensitive changes, stateful/rate-limit/concurrency behavior, persistence/schema/migration work, destructive changes, and external API/contract signals. High-risk combinations require critic; risky/stateful work requires plan_review. Missing mandatory gates are inserted before implementation can run, and the resulting plan-review task is added as a hard dependency of pending/ready write tasks.
The risk-derived gates are keyed to the detected risk category rather than the objective's surface verb, so a noun-phrase or passive objective that records a security, external-protocol/contract/integration, or network-boundary risk gets the same external_conformance/threat_model/integration-critic gate as its imperative phrasing; only genuinely implementation-ceremony signals remain verb-gated, and explore is triggered by implementation OR any recorded risk. This keeps one pure classifier while removing the phrasing-dependence that let the same risk go ungated under different wording. The change is forward-scoped by comparing the collection created_at date to a fixed GateCoherenceCutoff: post-cutoff collections derive gates from categories, pre-cutoff collections keep the historical verb-ANDed derivation at every enforcement seam, and the PLANNING_POLICY_ENFORCED event records which derivation applied (gate_derivation). Legacy behavior is preserved exactly by an explicit boolean rather than a persisted marker column, so no schema migration or policy-version field is introduced.
This is deliberately a floor rather than a complete planner: the coordinator can add specialist tasks for other reasons, and the critic/plan reviewer still use model judgment. The deterministic layer only prevents a planner from opting out of independent controls on categories where Praector policy requires them.
The model-based planning gates also enforce acceptance coherence: critic and plan review must treat a task contract that knowingly violates a Collection MUST/MUST NOT, security boundary, or acceptance requirement as a blocker. A plan may not intentionally dispatch known-bad work on the theory that downstream implementation review will repair it. Praector does not yet have a durable fault-injection or human/exec exception authorization mechanism, so no worker may infer such an exception from prose; an intentional contradiction must remain blocked for operator resolution.
A required critic is not valid forever. The initial critic is a preflight over the objective/current graph; when the first final plan-review handoff is created, Praector seals that critic to a stable fingerprint of the material plan. The fingerprint includes non-superseded implement, research, and advise contracts plus meaningful dependencies among them, while excluding status/timestamp churn and orchestration-only coordinator/reviewer edges.
If that fingerprint changes after the seal, claim-time gates refuse both plan_review and implement. After active coordinator mutation settles, Praector creates Revalidate materially changed plan, records the changed fingerprint as that critic's basis, and creates Apply critic revalidation coordinator work that depends on the fresh critic. The final plan review waits for both. If the revalidation coordinator changes the material plan again, the fingerprint changes again and another critic/coordinator round is required. This produces a convergent critic -> coordinator -> critic ... -> plan_review loop without re-running critics for ordinary status changes or for initial incorporation of the first critic's directives.
Final plan-review publication includes the corresponding critic baseline in the same Dolt mutation as the review task and its initial graph edges. This closes the inter-process gap where reconciliation could previously observe a new review with no baseline and incorrectly synthesize compatibility_plan_seal. Human acceptance revisions use revision_plan_seal; automatic stale-plan recovery uses material_revalidation; compatibility_plan_seal is reserved for legacy state.
Mutable workspace Git pointers are explicitly excluded from material-plan identity. base_commit is fingerprint-significant only for inherit workspaces, where it is an explicit delegation checkpoint. Collection/isolated tasks historically received a base SHA lazily when their worktree was prepared; that runtime fill must not invalidate an already-reviewed plan. Praector preserves compatibility with legacy raw-base seals while using the canonical form for new seals.
Planning success is not delivery success. For direct mutation objectives, deterministic delivery_policy requires at least one completed implement task with passing independent review before the Collection may become COMPLETE. If planning terminates without write work, the scheduler creates one bounded Delivery policy repair coordinator. If that coordinator still creates no implementation, the Collection remains BLOCKED rather than looping indefinitely or falsely completing.
Worker environment isolation also separates project runtime from Praector control-plane access. An inherited active Python virtualenv is removed from worker PATH, then a dedicated ~/.praector/control-bin/praector shim points to/copies the native executable and is prepended. This keeps praector task request, praector result submit, and related control commands available without coupling project python/pip to the operator shell.
A requested task is not scheduler-visible until its initial graph contract is durable. Praector writes the task row, initial depends_on edges, spawned_by edge, blocking child-to-parent edge, and parent WAITING transition under one state lock and semantic commit. This prevents a concurrent scheduler from claiming a task in the gap between task creation and dependency attachment. Coordinator-requested plan_review is always a blocking handoff and automatically carries the latest non-superseded critic as a dependency when one exists.
Cross-process orchestration cannot assume several coordinator CLI calls form one transaction. A coordinator may create implementation work and only afterward request plan review. Praector therefore treats deterministic planning policy as a claim-time capability boundary: policy-gated implement tasks cannot be claimed until the latest valid plan review is complete and explicitly gates them, any required critic is incorporated, and no coordinator remains active. Creating a coordinator-requested plan review atomically publishes its edges to existing implementation tasks. To avoid duplicate review gates, deterministic policy does not auto-create a fallback Policy plan review while any coordinator remains active; the fallback is created only after planning terminates without a required gate. A passing final blocking plan review terminalizes the waiting coordinator instead of reopening planning. Here "remains active" means a coordinator still shaping the graph (PENDING/READY/RUNNING/VERIFYING); a WAITING coordinator has already handed control to a blocking child or review under the single-flight handoff rule and therefore does not suppress the fallback.
Independently of that policy classification, the final plan-review claim gate is also an artifact invariant of the graph. For a coherent (post-GateCoherenceCutoff) Collection, an implement is unclaimable until its latest non-cancelled/non-superseded plan_review has reached a terminal passing decision (COMPLETE with verdict: pass), regardless of whether the classifier required a review at all — the store claim floor and the reachable auto-staging path hold and then release the write task so an implementation can never run ahead of a plan-review decision. This closes the classifier blind spot (an objective matching no mutation verb or risk pattern still gets the floor) without touching the classifier itself, without a persisted classification/policy-version column, and without a new profile, state, policy field, capability, or config knob. A floor-held claim is recorded as a dedicated PLAN_REVIEW_FLOOR_HELD event distinct from a policy-held claim, and a COMPLETE verdict=fail review does not release it, because the floor requires the same passing verdict the policy path requires. Pre-cutoff collections keep the exact pre-floor claim behavior.
The exploration/critic preflight mirrors that design as a second artifact floor over the same gate-free coherent mode branch, so write work can never be gated on plan-review evidence alone with zero preflight evidence. For a coherent Collection whose four classifier gates all classified false and which carries write work, Scheduler.enforcePlanningPolicy stages the canonical repository-exploration preflight plus an independent critic (parented to the generation coordinator, the final plan review taking the critic as a prerequisite via the cycle-guard-reject edge path and the single-flight review collapse, so no cycle and no second review generation is created) and emits a dedicated PREFLIGHT_FLOOR_STAGED event, never reusing PLANNING_POLICY_ENFORCED. On the claim side, Store.preflightFloorAllowsClaimLocked is a sibling of planReviewFloorAllowsClaimLocked reached from the same coherent, not-plan_review_required fall-through and ANDed with it, not added as a parallel predicate: the implement releases only when the plan-review decision and this generation's explore AND critic have each reached terminal COMPLETE (terminal completion only — the critic's advisory verdict is deliberately not turned into a gate verdict), held as a PREFLIGHT_FLOOR_HELD event. Both layers agree on "this generation" via a shared title-based generation-coordinator predicate (the latest Initial coordination/Acceptance revision coordinator, so a within-generation Coordinator attention/revalidation/delivery-repair helper never moves the anchor), and staging existence is evaluated per profile to match the claim floor's independent explore/critic requirement: a coordinator that authored both its own preflights takes exactly zero staging mutations, while one that authored only one of the pair has just the missing half backfilled rather than being held permanently, and the floor is gated on gate-free classification so a policy-required coherent collection and every pre-cutoff collection keep their exact existing claim behavior. Because the claim floor is a terminal-COMPLETE-only test, a FAILED generation gate does not self-release it; release runs only through the failed gate's retry-then-coordinator-attention path, the fail-review repair lineage, or an operator collection revision. As with the plan-review floor, no classifier, regex, mutationVerbs list, cycle guard, single-flight collapse, verdict semantics, read-only capability check, config knob, CLI flag, MCP surface, or schema column changed.
The generation-coordinator identity predicate is a single named source of truth: the generation-creating titles (Initial coordination, Acceptance revision) live once in generationCoordinatorTitles, projected to SQL through generationCoordinatorTitlePredicate (used by Store.preflightFloorAllowsClaimLocked's claim-floor clause) and to Go through isGenerationCoordinatorTitle (used by Scheduler.enforcePlanningPolicy's gate-free staging floor and by the stricter selectGenerationCoordinator). Each consuming site keeps its own status conditions and selectGenerationCoordinator stays a deliberately stricter variant (it also requires a stable generation state), so the layers share only the title SET and cannot silently drift from the floors they gate; introducing a new inline "latest/active/generation" query is a review/plan-review blocker.
Because a floor-predicate disagreement could otherwise leave a READY implement permanently held, or a Collection permanently BLOCKED with no active work, while crash recovery (RUNNING attempts) and attempt budgets (FAILED tasks) both stay silent, the scheduler runs a stuck-floor liveness sweep (Scheduler.observeStuckFloors) from reconcileCollection — which the Daemon also runs for BLOCKED Collections. Once a floor-held refusal (labeled PREFLIGHT_FLOOR_HELD / PLAN_REVIEW_FLOOR_HELD) has repeated past an internal constant (stuckFloorRefusalThreshold) with no graph movement — decided via ListEvents on the last floor-held event's (created_at,id) exclusive cursor, excluding the scheduler's own floor/attention labels from the movement definition — it raises exactly ONE non-blocking Coordinator attention, deduplicated on the (task, material-plan fingerprint) graph state so a genuine change re-arms it and an outstanding attention suppresses re-storming. The collection-level twin flags a BLOCKED Collection whose graph has no nonterminal/blocking task. The sweep is gated on gate coherence (pre-cutoff / policy-required collections are byte-identical), is advisory graph-shaping only, never relaxes a floor, the cycle guard, or the independent-passing-review coverage rule, and adds no config/CLI/schema surface; the BLOCKED-with-a-passing-review root cause (the post-repair verifies-edge carry) is closed by the daemon-enforced repair-lineage carry invariant (below) rather than by any coverage-rule change.
The failed review -> repair -> fresh passing review carry is an invariant the daemon enforces, not only a trigger-time action. Scheduler.ensureReview wires it at integration time: for a fresh post-repair review it resolves the original implementation set and adds implement -> review verifies edges (graph edges that bypass the depends_on cycle guard by relation, never part of the dependency DAG). Because a carry could be missing whenever integration and wiring did not happen atomically — an older binary that predates the wiring, or a daemon crash between integration and AddEdge — the same reconcile pass also runs a retroactive backfill sweep (Scheduler.backfillRepairLineageCarryEdges) from reconcileCollection, immediately before the existing UpdateCollectionTerminalState call so a healed collection flips in the same tick. It enumerates COMPLETE verdict=fail reviews, resolves their originals through the single shared resolver extracted from ensureReview (Scheduler.repairOriginalImplementations, so trigger-time and retroactive discovery cannot fork), and adds the missing carries for later COMPLETE verdict=pass reviews that directly depends_on the failed review — exactly the shape ensureReview would have wired. It reaches multi-generation chains via a fixed-point loop mirroring Store.RepairSupersededReviewLineage. Membership is deliberately NOT widened to any passing review whose depends_on prerequisites include implements, so a plain depends_on chain never counts as coverage and Store.ImplementationsMissingPassingReview stays zero-diff (its two load-bearing negatives are unchanged). A strict Go-side existing-edge pre-check (ListEdges key set) makes the sweep a genuine no-op on healthy graphs — AddEdge('verifies') commits even on a zero-row INSERT IGNORE, so an unconditional write would churn Dolt every tick — and the sweep emits exactly one REPAIR_LINEAGE_BACKFILLED audit event per carrying review only when an edge is actually added, so repeated ticks and a simulated daemon restart are byte-idempotent. REPAIR_LINEAGE_BACKFILLED is intentionally kept OUT of stuckFloorNonMovementEvents: a backfill is a real graph mutation, so it counts as movement and suppresses the stuck-floor / acceptance-readiness twins on the next tick. The scheduler-layer placement (not Store.UpdateCollectionTerminalState) keeps the sweep off the acceptance and RunCollection paths, so it performs no git operation and touches no acceptance-readiness or stuck-floor semantics.
All depends_on edges form an acyclic directed graph. The store rejects an edge A -> B when a path already exists from B back to A; task creation validates the whole initial dependency/blocking/gating batch before publishing the task row. This is a control-plane invariant, not a model convention.
plan_review is a pre-write gate over durable implementation contracts. It may wait for prerequisite evidence (explore, critic, research, advise) but must not depend on implement execution or on a coordinator that transitively waits on that review. Reconciliation detects those legacy coordinator/review back-edges, removes the review-side prerequisite, and if repair activity produced multiple unstarted final reviews, supersedes older gates into the newest one. Waiting coordinators and implementations are rewired to that one surviving gate. When it passes, every waiting coordinator whose hard dependencies are satisfied is terminalized instead of being awakened to reshape an already approved graph.
Final plan review is a single-flight control-plane gate. When a coordinator requests plan_review and a non-failed nonterminal final review already exists, the store reuses that task instead of publishing another review row. New critic/research/advice prerequisites, caller blocking, and implementation gates are attached atomically to the existing review. If scheduler strengthening previously made that review depend on the active coordinator, the explicit final handoff atomically deletes coordinator -> plan_review and publishes plan_review -> coordinator in the same transaction.
WAITING coordinators are excluded from plan-review prerequisite strengthening. Waiting means the coordinator has already handed control to another durable task; wiring it back ahead of the same review generation would create a reverse-edge cycle. Only PENDING, READY, RUNNING, or VERIFYING coordinators are considered active graph shapers. The blocking caller itself is also stripped from explicit plan-review prerequisites because the valid handoff edge is plan_review -> coordinator.
Acyclicity applies to persistent upgraded state as well as new mutations. Before normal reconciliation, the store detects cycles and removes only recognized historical pre-write violations (implement -> plan_review and cyclic coordinator -> plan_review). Unrecognized legacy cycles are quarantined at Collection scope. Scheduler fault containment guarantees that one quarantined Collection cannot stop the daemon or consume worker slots; runnable work is collected only from non-quarantined Collections.
Planning policy can classify a Collection as requiring current external evidence, external conformance, and/or threat modeling. For such initial/revision generations the scheduler creates repository explore and fresh external research in parallel, then makes the critic depend on both before coordinator planning. Deterministic research results carry structured source/claim/oracle provenance with stable claim ids, source authority levels, normative strength, and claim-backed planner directives; their result digests participate in the material-plan fingerprint. Completed research claims are projected into downstream Task Envelopes as inherited_research_constraints, so the canonical evidence-derived directive is visible independently of critic paraphrase. Critic, plan-review, and research-aware review results must report a per-claim research_consistency disposition (preserved, strengthened, or explicit_exception) and repeat the exact inherited directive; a normative requirement cannot disappear or reverse without an explicit durable exception decision. Active planning generations created before this stricter contract are revalidated with a fresh critic, while historical completed Collections remain untouched.
For external-conformance work, verification evidence is classified as internal_test, black_box_test, independent_implementation, official_reference_oracle, or live_provider_oracle. A passing final review requires an authoritative independent oracle actually exercised (independent_implementation, official_reference_oracle, or live_provider_oracle) unless a durable exception decision records why such an oracle is unavailable; an implementation-owned black-box client is not promoted merely because it runs out of process.
Read-only specialists can durably escalate an external uncertainty with RESEARCH_REQUIRED. The requesting task waits on bounded research and becomes runnable again afterward. If the project disables current_external_research, Praector blocks the Collection with RESEARCH_CAPABILITY_REQUIRED instead of silently using stale model knowledge. The same escalation works for an uncertainty answerable from the repository itself via EXPLORE_REQUIRED: the task waits on a bounded read-only exploration and resumes afterward. The internal hatch intentionally has no capability gate, because local read-only discovery is always available; only one of research or explore is used for a given uncertainty, and the allow-list plus one-live-child-per-caller dedupe bound any escalation spiral.
Each task attempt records a TASK_INPUT_LINEAGE snapshot containing the material-plan fingerprint and direct prerequisite digest. When an implementation integrates after that lineage changed, its mandatory review becomes a reconciliation review and Praector emits RECONCILIATION_REQUIRED; the completed code is preserved but must be verified against the current accepted evidence/prerequisite state.