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
-
- Object
- CriticCapability
- SpecCriticCapability
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(beadpow-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
rubricover the workbead— 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 bareAgentBrief(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
rubricover the workbead— 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
Allocationfor a spawned process (ADR-0009 D6) — aProcessAllocationdrivingspawn/interpretEventover the transport. A one-shot (StepKind.job) is respawn-or-skip; aStepKind.daemonis 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
eventto aStepSignal(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.artifactDurabilityis durably readable. ReturnsGateOutcome.clearonly when durable,GateOutcome.presentwhen absent, andGateOutcome.probeErrorwhen 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
fenceis 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 isfalse, 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
rubricunderworkspaceDir— 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
completesignal; the returned map is recorded undergrid.result.<nodePath>.*alongside the terminalstate=completewrite (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); readcontextat entry and checkStepArgs.cancelafter 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 fromcontexthere 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.
pkilla detached side-process by token. Defaults to a no-op (the host'sprovider.stopkills 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 fromargs+ its own state.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited