SpecCriticCapability class

One SPEC critic, in isolation — the spec committee's LLM lane. Subclasses CriticCapability to inherit the ENTIRE verdict-transport stack unchanged (canonical file → round-fresh stray → result-envelope → fail-closed F, each with the nodePath + round freshness stamps and a named transport; plus the FT-2 usage merge): one transport stack serves both committees, so a hardening landed for the code critics (gate-integrity #3/#4, tg-291) automatically holds here. Only the SPAWN differs — it declares the MID tier (AgentTier.mid), like its superclass, so absent an override it grades on kMidModelDefault (sonnet); and a spec critic is always an agent (there is no sh -c validation-runner flavor; the spec gate is SpecValidationCapability) and its prompt is buildSpecCriticPrompt: the review subject is the bead's SPEC, never a pinned diff (no code exists yet).

Inheritance

Constructors

SpecCriticCapability({RubricSource? rubrics, String verdictTextReader(File verdict)?, String decisionRunner = kDefaultOverlayRunner, String? decisionGridHome})
Creates the spec critic, optionally over a rubric source (D-9 wires the Packaged-AI-Asset loader; absent ⇒ an inline placeholder so the circuit is testable with no real assets).
const

Properties

completionContract → CompletionContract
This capability's declared CompletionContract — what a FINISHED turn of it leaves behind, and so whether the engine may PROVE an INFERRED completion (a detached vanish) before advancing the circuit.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
requiresVerdictOwner → bool
The SPEC family IS held to the owner column (bead pow-hxme, ADR-0000 A37): its route decides on ownership, and buildSpecCriticPrompt teaches it below.
no setteroverride
rubricSource → RubricSource?
The injected rubric source (D-9) — exposed for subclasses: the spec-readiness committee's SpecCriticCapability (bead pow-6ao) embeds prose from the SAME source into its own prompt shape.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildCriticPrompt(Bead bead, String rubric, String nodePath, String workspaceDir, {required int round}) → String
Assembles the LLM critic's prompt for rubric over the work bead — names ONLY its own rubric (anti-anchoring: a critic must not see the other lanes' concerns or grades), carries the full bead, and instructs a single A–F grade written as a verdict JSON. Rides the harness as a bare AgentBrief(task: …) (no working agreement, no context blocks — so the rendered brief IS this prompt, byte-identical).
inherited
buildSpecCriticPrompt(Bead bead, String rubric, String nodePath, String workspaceDir, {required int round}) → String
Assembles the spec critic's prompt for rubric over the work bead — names ONLY its own rubric (anti-anchoring), carries the full bead (whose Acceptance criteria + Design fields ARE the spec under review), and instructs a single A–F grade written as a verdict JSON.
createAllocation(AllocationInputs inputs) → Allocation
The default Allocation for a spawned process (ADR-0009 D6) — a ProcessAllocation driving spawn/interpretEvent over the transport. A one-shot (StepKind.job) is respawn-or-skip; a StepKind.daemon is adopt-or-respawn + detach-capable. Override only for a bespoke process effect.
inherited
createSession({required RuntimeProvider runtime, required String name, required String attemptId, required String instanceFence, required TreeContext context, required StepArgs args}) → ProcessSession?
Creates a protocol session for this incarnation, or null for one-turn I/O.
inherited
criticRepairInstruction({required String workspaceDir, required String rubric, required String nodePath, required int round}) → String
Returns a corrective instruction when the canonical artifact from a prior failed attempt violated the verdict contract. Engine supervision restarts the failed process lane under supervisionPolicy's invalid-result budget; the restarted spawn appends this instruction without replacing the lease-vended allocation. The instruction carries the SAME bounded receipt the engine was handed (_InvalidVerdictFailure), so the repairing critic reads exactly what the operator does.
inherited
interpretEvent(RuntimeEvent event) → StepSignal
Maps a runtime event to a StepSignal (a job's clean exit → complete; a daemon's up-signal → ready; a crash → failed; anything else → none). The host writes the resulting cursor state through the chokepoint.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
probeCompletionArtifact(TreeContext context, StepArgs args) → Future<GateOutcome>
Proves the artifact promised by CompletionContract.artifactDurability is durably readable. Returns GateOutcome.clear only when durable, GateOutcome.present when absent, and GateOutcome.probeError when the read cannot decide. Must be idempotent and side-effect-free beyond reading the declared artifact.
inherited
proveFreshness(AdoptFence fence, TreeContext context, StepArgs args) → Future<bool>
Proves a prior incarnation at fence is STILL the live effect this capability manages — the daemon adopt-freshness half (ADR-0009 D4: "pgid alive ∧ token echoed over its endpoint"). The engine supplies the pgid-alive half (the injected liveness seam); this supplies the domain-specific half (a daemon probes its endpoint and checks the token echoes). No-adopt-on-faith: the default is false, so a job — or a daemon that cannot prove it — is respawned fresh, never adopted blind. MUST be side-effect-free beyond the read.
inherited
recordCriticIncarnation({required String workspaceDir, required String rubric}) → void
Stamps THIS incarnation's spawn instant for rubric under workspaceDir — the marker restampVerdictRound reads as its freshness proof.
inherited
result(TreeContext context, StepArgs args) → Future<Map<String, String>?>
An optional result payload this process step contributes on a clean completion (e.g. a critic's grade). Called by the host on a complete signal; the returned map is recorded under grid.result.<nodePath>.* alongside the terminal state=complete write (one atomic chokepoint update). Defaults to null (no result). MUST be idempotent + side-effect-free beyond reading its inputs (e.g. a file the spawned process wrote); read context at entry and check StepArgs.cancel after any await.
inherited
spawn(TreeContext context, StepArgs args) → RuntimeConfig
Describes the process to spawn — PURE; the host owns the actual provider.start (and layers the per-incarnation env over the config). Called synchronously at kick (the branch is mounted): read ambient values from context here with the effect verb.
override
supervisionPolicy(StepArgs args) → SupervisionPolicy
Gives an invalid critic artifact one repair restart before a visible gate.
inherited
teardown(StepArgs args) → Future<void>
Idempotent belt-and-braces cleanup on unmount (TEARDOWN-11/12) — e.g. pkill a detached side-process by token. Defaults to a no-op (the host's provider.stop kills the managed group). Runs on the dispose path, where the branch may already be unmounted — so it receives NO tree context (a lookup there would throw); it works from args + its own state.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited