Documentation
¶
Overview ¶
Package procedure is the wiring half of procedure learning and certification: epic memql#5402 (design record docs/superpowers/specs/2026-09-13-app-session-recording-and-learning-program-design.md, section 4 epic C; decisions D6, D13, D14, D24) and epic memql#5408 (epic D; D3, D4, D15, D16). It backs the builtins declared in dsl/procedure/builtins.memql:
integration.procedure.learnFromRun -- mine the corpus a finished run belongs to, and lift it integration.procedure.mineCorpus -- the scheduled sweep, per owner and goal signature integration.procedure.step -- the statement every rendered step is integration.procedure.replay -- serve a goal from a learned procedure integration.procedure.ladderSweep -- the ladder's demotion and retirement sweeps integration.procedure.decidePromotion -- apply a person's promotion decision
THE DIVISION OF LABOUR IS THE DESIGN, and it is the same one the work spine draws. Every DECISION is a pure function in component/procedure or component/work -- what a symbol is, what recurs, what a hole means, what an abstraction is worth, where a procedure stands on the ladder -- so the epic's headline claims are properties of values, provable with no engine and no database. This package is responsible only for what a pure module cannot do: reading rows under the right actor, rendering the winner as MemQL, writing it, and making the ONE bounded model call D6 allows -- whose answer it hands straight back to the module to check.
Index ¶
- Constants
- func DecodePreconditions(v any) (proc.Preconditions, error)
- type AppFallback
- type CompileGate
- type CompletedStep
- type Deriver
- type DispatchRequest
- type DispatchResult
- type Dispatcher
- type Engine
- type FallbackOutcome
- type FallbackRequest
- type Guidance
- type Integration
- func (i *Integration) Capabilities() []memql.IntegrationCapability
- func (i *Integration) CompileGateInstalled() bool
- func (i *Integration) DecidePromotion(ctx context.Context, approvalId string) (work.Transition, error)
- func (i *Integration) IntegrationName() string
- func (i *Integration) LadderLockInstalled() bool
- func (i *Integration) LearnFromRun(ctx context.Context, runId string) (LearnResult, error)
- func (i *Integration) Replay(ctx context.Context, req ReplayRequest) (ReplayOutcome, error)
- func (i *Integration) ReplaySeamsInstalled() (workbench, machine, prober, fallback bool)
- func (i *Integration) ReuseSweep(ctx context.Context, dryRun bool) (ReuseSweepResult, error)
- func (i *Integration) SetAppFallback(f AppFallback)
- func (i *Integration) SetCompiler(c CompileGate)
- func (i *Integration) SetDeriver(d Deriver)
- func (i *Integration) SetDispatcher(target work.ReplayTarget, d Dispatcher)
- func (i *Integration) SetLadderLockDB(db func() *bun.DB)
- func (i *Integration) SetNow(f func() time.Time)
- func (i *Integration) SetParams(p proc.Params)
- func (i *Integration) SetProber(p Prober)
- func (i *Integration) ShadowCompare(ctx context.Context, recordingRunId string) ([]ReplayOutcome, error)
- func (i *Integration) Sweep(ctx context.Context, sweep string, now time.Time) (SweepResult, error)
- type LearnResult
- type Level
- type LiftOutcome
- type Preconditions
- type Prober
- type Procedure
- type ProcedureHints
- type ProcedureStep
- type RecordedFrom
- type ReplayMode
- type ReplayOutcome
- type ReplayRequest
- type ReuseSweepResult
- type SectionCatalogResult
- type SectionNotCatalogued
- type SweepResult
Constants ¶
const ( SweepDemotion = "demotion" SweepRetirement = "retirement" )
SweepDemotion and SweepRetirement are the two sweeps.
Variables ¶
This section is empty.
Functions ¶
func DecodePreconditions ¶
func DecodePreconditions(v any) (proc.Preconditions, error)
DecodePreconditions reads construct.preconditions back. An absent value is the empty set -- nothing was learned -- and not an error.
Types ¶
type AppFallback ¶
type AppFallback interface {
Handover(ctx context.Context, req FallbackRequest) (FallbackOutcome, error)
}
AppFallback hands the goal back to the app when a replay cannot serve it: the preconditions did not hold, a parameter could not be bound, or a step diverged. The guidance is the partial trace and the diagnosis (D16): repair, not resample.
type CompileGate ¶
type CompileGate interface {
CompileBundle(constructs []memql.SandboxConstruct) memql.SandboxReport
}
CompileGate is Gate 1: the isolated compile + bind of a candidate bundle (gap G7). A learned procedure whose source this does not compile is not re-runnable, keeps no goal signature, and enters the ladder as a candidate.
It is a SEAM installed from app/ rather than something the plug-in finds on its engine, because the engine it is handed (*memql.MemQLEngine) has no such method -- the compile is a function of the engine that app's CognitionEngineAdapter wraps. A type assertion on the engine was how this used to find it, and it failed on every node: Gate 1 never ran, no procedure was ever recorded as re-runnable, and none was ever findable by its goal.
type CompletedStep ¶
type CompletedStep struct {
Index int
Tool string
IdempotencyKey string
Summary string
SideEffect bool
// MayHaveRun: the step was sent and whether it ran is unknown -- its
// target stopped answering, or the node running the replay died before
// its receipt was written. The app is told to check before repeating it,
// never that it did not run.
MayHaveRun bool
}
CompletedStep is one step a replay ran before it stopped.
type Deriver ¶
type Deriver interface {
// ProposeDerivation returns a derivation expression for one unexplained
// hole, or "" when it has nothing to propose. Whatever it returns is
// handed straight to component/procedure.CheckDerivation: this seam
// cannot decide that a proposal is good, only that one was made.
ProposeDerivation(ctx context.Context, h proc.Hole, instances [][]proc.Action) (string, error)
}
Deriver makes the one bounded model call of D6. It is an interface so that the pipeline can be driven with NO deriver at all -- which is the ordinary case, and the case the zero-provider-call test asserts.
type DispatchRequest ¶
type DispatchRequest struct {
Target work.ReplayTarget
OwnerUserId string
// RunId is the REPLAY run. On the workbench it keys the workspace, so a
// shadow replay never sees the app's files and two replays never share
// a directory.
RunId string
StepKey string
IdempotencyKey string
// Tool is the recorded action: exec, fs_write, fs_read, fetch, mcp.
Tool string
// Args are the step's arguments in the APP's own spelling (Claude
// Code's {command} / {file_path, content} / {file_path, old_string,
// new_string}; Codex's argv vectors), materialized from the template.
// Translating them to an executor's actions is the dispatcher's job.
Args map[string]any
// Sandbox marks a shadow replay: never the person's machine, never a
// write to a MemQL row, never a delivery outside the workbench. The
// workbench itself has full egress, so a command that may send something
// out of it (network.go: a POST, a push, a publish, a cloud CLI) is never
// dispatched in shadow at all -- it is compared dry. A script such a step
// runs can still reach the network; nothing reading the command line can
// see into it.
Sandbox bool
// AgentId is the agent the machine dispatch runs under (its standing
// computer-use scope is the consent). Empty on the workbench.
AgentId string
// Timeout is the longest the recordings let this step run -- the app's
// own per-call timeout, kept beside the template rather than in it,
// because the model picks a different one on every call and a value
// that varies is not a parameter anybody supplies. Zero is the
// executor's default.
Timeout time.Duration
}
DispatchRequest is one step, fully bound.
type DispatchResult ¶
type DispatchResult struct {
Observation work.StepObservation
// Output is the executor's own result, kept for the step's receipt and
// for a later step's data-flow hole.
Output any
// Delivered reports that a side effect reached something outside the
// replay's own workspace (a machine file, a mail, an HTTP write).
Delivered bool
// reason that says nothing about the procedure: the machine's stream
// dropped, a forward failed, no workbench peer answered. The step may or
// may not have run, so a caller treats its effects as unknown -- and the
// ladder does not count it against the procedure.
Unavailable bool
}
DispatchResult is what the step did.
type Dispatcher ¶
type Dispatcher interface {
Dispatch(ctx context.Context, req DispatchRequest) (DispatchResult, error)
}
Dispatcher runs one materialized step on its target and reports what it did in the executor-independent terms component/work.Compare reads. The cockpit's result digest is NOT one of them: it digests the app's own tool output, which no other executor reproduces byte for byte.
type Engine ¶
type Engine interface {
Execute(ctx context.Context, query string) (*memqlengine.ExecuteResult, error)
}
Engine is the executor seam.
type FallbackOutcome ¶
type FallbackOutcome struct {
// ChildRunId is the session's recording run -- the repaired run, which
// the learner reads as a new recording.
ChildRunId string
Content string
SessionId string
}
FallbackOutcome is what the app's session produced.
type FallbackRequest ¶
type FallbackRequest struct {
OwnerUserId string
GoalId string
// RunId is the run the goal is being served in; StepId is the CANONICAL
// journal step id of the replay statement (<bareRunId>-<key>), which is
// what the app session's recording stamps childRunId onto.
RunId string
StepId string
// App is the app the procedure was recorded from ("claude-code"), and
// Level the level the fallback asks for.
App string
Level string
AgentId string
Statement string
Guidance Guidance
}
FallbackRequest is one goal handed back.
type Guidance ¶
type Guidance struct {
Procedure string
// Diagnosis is one paragraph: what diverged, where, and why.
Diagnosis string
// Completed are the steps that already ran, with their idempotency
// keys. The app must not redo them -- this is what keeps a divergence
// from delivering a side effect twice.
Completed []CompletedStep
Alignment []proc.Move
// DescriptionGuidance is the owner's earlier dislikes on this goal's
// signature, framed as one message (epic memql#5414, D23), or "" when
// there are none. The app taking the goal back is a model genuinely used
// for that goal, which is when they reach one; the replay itself never
// reads them.
DescriptionGuidance string
// Prompt is the rendered guidance appended to the goal statement.
Prompt string
}
Guidance is what the app is told before it starts.
type Integration ¶
type Integration struct {
// contains filtered or unexported fields
}
Integration exposes the procedure capabilities.
func (*Integration) Capabilities ¶
func (i *Integration) Capabilities() []memql.IntegrationCapability
Capabilities are the builtins dsl/procedure/builtins.memql declares. A capability the DSL names and the registry lacks is a BOOT failure on every node type, so every one is registered here -- and every one is a real executor: a capability that merely resolved and refused by name would pass the boot audit with the certification ladder inert.
func (*Integration) CompileGateInstalled ¶
func (i *Integration) CompileGateInstalled() bool
CompileGateInstalled reports whether Gate 1 is wired, for the wiring test that holds app/ to it -- a plug-in with an unwired setter is green in every test and inert in the cluster.
func (*Integration) DecidePromotion ¶
func (i *Integration) DecidePromotion(ctx context.Context, approvalId string) (work.Transition, error)
DecidePromotion applies a decided procedurePromotion approval to the ladder -- the handler behind onProcedurePromotionDecided, run by the cluster's maintenance principal (the approval names its construct before anybody knows whose it is).
IT APPLIES A DECISION, IT NEVER MAKES ONE, and it is IDEMPOTENT: it acts only when the construct is still in shadow and still waiting on THIS approval -- whose id rides in the ladder state Advance reads -- and, for a yes, only when the construct is still the version the person approved. A second delivery finds the approval id cleared and changes nothing; a decision on an approval a re-lift superseded changes nothing either.
func (*Integration) IntegrationName ¶
func (i *Integration) IntegrationName() string
IntegrationName is the plug-in name.
func (*Integration) LadderLockInstalled ¶
func (i *Integration) LadderLockInstalled() bool
LadderLockInstalled reports whether the ladder's lock has a database handle to be taken on, for the wiring test that holds the node to it: with none, every ladder move runs unlocked, green in every test and racy in the cluster.
func (*Integration) LearnFromRun ¶
func (i *Integration) LearnFromRun(ctx context.Context, runId string) (LearnResult, error)
LearnFromRun mines the corpus a finished run belongs to and lifts what it finds, at the action level -- the exported form of the learnFromRun builtin, for the proving driver and for Go callers. The caller must be the run's OWNER (a person, or server-side Go that borrowed them): the run is read through the owned read, and a procedure is filed in its owner's catalog.
It does NOT run the shadow comparison the builtin runs after an unchanged lift: a Go caller compares with ShadowCompare, and a lift that compared as well would count the same recording twice.
func (*Integration) Replay ¶
func (i *Integration) Replay(ctx context.Context, req ReplayRequest) (ReplayOutcome, error)
Replay runs one replay. An error means it could not be attempted at all -- a construct its owner cannot read, one that holds no procedure, a malformed request. Everything that goes wrong once it is attempted is an OUTCOME, written on the replay run and, for a goal, handed to the app.
func (*Integration) ReplaySeamsInstalled ¶
func (i *Integration) ReplaySeamsInstalled() (workbench, machine, prober, fallback bool)
ReplaySeamsInstalled reports which seams app/ wired, for the wiring tests.
func (*Integration) ReuseSweep ¶
func (i *Integration) ReuseSweep(ctx context.Context, dryRun bool) (ReuseSweepResult, error)
ReuseSweep decides every owner's construct labels.
func (*Integration) SetAppFallback ¶
func (i *Integration) SetAppFallback(f AppFallback)
SetAppFallback installs the hand-back to the app. Absent, a replay that cannot serve its goal fails the run with procedure_fallback_unavailable, naming why -- never a silent success.
func (*Integration) SetCompiler ¶
func (i *Integration) SetCompiler(c CompileGate)
SetCompiler installs Gate 1 (gap G7). app/ calls it on the REGISTERED instance on every node type, because the plug-in registers everywhere and a lift can run wherever a run succeeds. A nil gate is ignored rather than installed: "no gate" must stay distinguishable from "a gate that refuses".
func (*Integration) SetDeriver ¶
func (i *Integration) SetDeriver(d Deriver)
SetDeriver installs the one bounded model call. Called once, from the node that holds a router. Absent, every unexplained hole simply stays free -- which is a correct procedure with one more parameter, never a failure.
func (*Integration) SetDispatcher ¶
func (i *Integration) SetDispatcher(target work.ReplayTarget, d Dispatcher)
SetDispatcher installs the dispatcher for one replay target. app/ installs the workbench's on every node that can reach a workbench, and the machine's on agent nodes only (the worker stream lives there). A nil dispatcher is ignored, for SetCompiler's reason.
func (*Integration) SetLadderLockDB ¶
func (i *Integration) SetLadderLockDB(db func() *bun.DB)
SetLadderLockDB installs the database handle the ladder's per-construct advisory lock is taken on. The plug-in factory installs the direct endpoint on every node; a test installs its own. A nil getter is ignored, for SetCompiler's reason.
func (*Integration) SetNow ¶
func (i *Integration) SetNow(f func() time.Time)
SetNow injects a clock. Tests only.
func (*Integration) SetParams ¶
func (i *Integration) SetParams(p proc.Params)
SetParams overrides the pipeline knobs. The design record's cross-cutting rule makes the budget, support, gap and argument ceiling values rather than constants; this is where an operator's row reaches them.
func (*Integration) SetProber ¶
func (i *Integration) SetProber(p Prober)
SetProber installs the environment prober the preconditions are checked against. Absent, a procedure that learned any precondition cannot start: an unmeasured precondition does not hold (D16).
func (*Integration) ShadowCompare ¶
func (i *Integration) ShadowCompare(ctx context.Context, recordingRunId string) ([]ReplayOutcome, error)
ShadowCompare compares a succeeded recording against every learned procedure in shadow for its goal, and answers one outcome per procedure compared. The caller is gated as LearnFromRun's is: the run's OWNER, whose owned read is the only way the recording is read -- there is no cluster-wide variant, and the completion trigger borrows the owner before it compares.
func (*Integration) Sweep ¶
func (i *Integration) Sweep(ctx context.Context, sweep string, now time.Time) (SweepResult, error)
Sweep runs one of the ladder's two sweeps at now.
type LearnResult ¶
type LearnResult struct {
// RunId is the run the pass was asked about; empty for a corpus sweep.
RunId string
OwnerUserId string
GoalSignature string
Level Level
Sequences int
Candidates int
// ConstructId is the lifted construct, empty when nothing cleared the
// floor. An empty id with no error is the ORDINARY answer -- D14's floor
// is two uses, and a corpus of one session is expected to yield nothing.
ConstructId string
Accepted bool
// Reason names why nothing was accepted, when nothing was. A sweep that
// learned nothing and a sweep that could not read anything must not look
// the same in a log.
Reason string
// Lift is what the lift did; ProcedureHash is the version it computed and
// Rung the construct's rung after it -- written, or kept when unchanged.
// A shadow comparison of the recording that triggered this pass is
// meaningful only against an UNCHANGED version: a recording that changed
// the procedure is part of the new version's corpus, not evidence about it.
Lift LiftOutcome
ProcedureHash string
Rung work.Rung
}
LearnResult is what one mining pass produced.
type Level ¶
type Level int
Level names which of D24's two corpus levels to mine. The pipeline below is identical for both, which is why the level is a PARAMETER rather than two functions: a second copy is a copy that drifts, and the record's claim that "the one pipeline lifts repeated automation sequences into higher automations by the same compression rule" is only true if it is literally the same pipeline.
type LiftOutcome ¶
type LiftOutcome string
LiftOutcome says what a lift did to the owner's catalog.
const ( // LiftNone: nothing cleared the floor, so nothing was lifted. LiftNone LiftOutcome = "" // LiftCreated: a new construct, entering the certification ladder. LiftCreated LiftOutcome = "created" // LiftRelifted: the owner's construct of that name learned a DIFFERENT // procedure -- a new version, written in place and put back on the // ladder's entry rung, because a person's approval was for the old one // (D15: "a later change of the construct is a new candidate"). LiftRelifted LiftOutcome = "relifted" // LiftUnchanged: the same version as the one stored. Nothing is written // and every ladder counter is kept -- which is what lets a shadow streak // grow while the recordings it is measured on keep arriving. LiftUnchanged LiftOutcome = "unchanged" )
type Preconditions ¶
type Preconditions = proc.Preconditions
Preconditions is component/procedure's learned initiation set -- what a Prober is handed and answers -- named here so a node that implements the seam from app/ needs no direct import of the pure module for its one type.
type Prober ¶
type Prober interface {
Probe(ctx context.Context, target work.ReplayTarget, ownerUserId, runId string, learned proc.Preconditions) (proc.Preconditions, error)
}
Prober measures, on the target, the predicates a procedure learned. It answers only what it measured: a learned predicate it could not measure is ABSENT from the observation, and CheckPreconditions turns absent into "unmeasured, does not hold" -- never into a match.
type Procedure ¶
type Procedure struct {
V int `json:"v"`
// Level is the CORPUS level the procedure was mined at: 1 for the actions
// inside recorded app sessions, 2 for automation invocations (design
// D24). It is not an AI level -- the steps of a level-2 procedure are
// automation calls, which no action dispatcher runs.
Level int `json:"level"`
// Title is the goal statement the recordings served, read from the
// oldest recording's goal; empty when none could be read.
Title string `json:"title"`
// GoalSignature is component/work.GoalSignature of that goal, and
// InputKeys are its sorted input names -- the two things the signature
// was computed over.
GoalSignature string `json:"goalSignature"`
InputKeys []string `json:"inputKeys"`
// Steps are the template's steps; Holes classify every open position.
Steps []ProcedureStep `json:"steps"`
Holes []proc.Hole `json:"holes"`
// Expect holds one expectation per step: what every recording of that
// step agreed on, in executor-independent terms. A content path is
// relative to the recording's workspace when the file was inside it.
Expect []work.StepExpectation `json:"expect"`
// InputMap maps a FREE hole id to the goal input key that supplied it in
// every recording (component/procedure.LearnInputMap); FreeParameters are
// every free hole id, sorted. A free hole with no input key cannot be
// bound from a goal, and a replay refuses to start without it.
InputMap map[string]string `json:"inputMap"`
FreeParameters []string `json:"freeParameters"`
// Footprint is the union of every recorded action's footprint, measured
// against its recording's workspace; Target is where it replays (D4).
Footprint work.Footprint `json:"footprint"`
Target string `json:"target"`
// Symbols are one per step (id s<i>, the step's template), and Model is
// the procedure's own process model: the sequence of those symbols. A
// replay's live trace is checked against Model with
// component/procedure.PrefixFits.
Symbols []proc.Symbol `json:"symbols"`
Model *proc.ProcessTree `json:"model"`
// RecordedFrom is D9's provenance. It is NOT hashed; see the file header.
RecordedFrom RecordedFrom `json:"recordedFrom"`
// Hints are what a dispatcher is told beside a step's template. NOT
// hashed; see the file header.
Hints *ProcedureHints `json:"hints,omitempty"`
}
Procedure is construct.procedure. Its JSON keys are the contract a replay, the OS and the proving driver read:
{v, level, title, goalSignature, inputKeys, steps: [{tool, args, symbol}],
holes, expect, inputMap, freeParameters, footprint, target,
symbols: [{id, tool, template}], model,
recordedFrom: {app, model, effort, sessionIds, runIds, workspaces},
hints: {timeoutsMs}}
func DecodeProcedure ¶
DecodeProcedure reads construct.procedure back from a row, in whichever shape it arrives: a decoded object (what a query answers), raw JSON, or the Go value itself. Every node and tree is CHECKED on the way in -- an unknown kind, form or operator is refused rather than read as something close to it -- because the caller is about to execute what this returns.
type ProcedureHints ¶
type ProcedureHints struct {
// TimeoutsMs is, per step, the LONGEST per-call timeout any recording of
// that step asked for, in milliseconds; 0 where none recorded one.
TimeoutsMs []int `json:"timeoutsMs,omitempty"`
}
ProcedureHints are values the recordings varied in that no goal input supplies and no replay's behaviour is judged by, kept beside the template rather than in it.
type ProcedureStep ¶
type ProcedureStep struct {
Tool string `json:"tool"`
Args *proc.Node `json:"args"`
Symbol string `json:"symbol"`
}
ProcedureStep is one step: the tool, its argument template, and its symbol.
type RecordedFrom ¶
type RecordedFrom struct {
App string `json:"app,omitempty"`
Model string `json:"model,omitempty"`
Effort string `json:"effort,omitempty"`
SessionIds []string `json:"sessionIds"`
RunIds []string `json:"runIds"`
Workspaces []string `json:"workspaces,omitempty"`
}
RecordedFrom is where a procedure came from. App, Model and Effort are what every recording agreed on and are ABSENT when the recordings disagreed or the app reported nothing -- a value borrowed from one recording would claim something about the others. RunIds are the recordings the version was generalized from, which is also what keeps a recording from being compared with a version it taught (shadow.go). Workspaces are the recordings' working directories, and they are PROVENANCE ONLY: no dispatcher reads them. The corpus loader rewrites every path inside a recording's workspace relative to it before anything is learned (relativize.go), so a replay's steps name paths relative to the replay's own workspace and nothing is left to rebase.
type ReplayMode ¶
type ReplayMode string
ReplayMode is what a replay is for.
const ( // ReplayShadow compares the procedure beside the app, which served. ReplayShadow ReplayMode = "shadow" // ReplayCanary serves the goal with the app standing by. ReplayCanary ReplayMode = "canary" // ReplayTrusted serves the goal with no model. ReplayTrusted ReplayMode = "trusted" )
type ReplayOutcome ¶
type ReplayOutcome struct {
// Served (canary, trusted): the goal was answered by the procedure.
Served bool
// Match (shadow): every step compared equal to what the app did.
Match bool
// Diverged: a step differed, or could not be run, after the start.
Diverged bool
// DivergedStep is the index of the step that diverged; -1 when none did.
DivergedStep int
// Diagnosis is one paragraph: what diverged or refused, where, and why.
Diagnosis string
// StartRefused: nothing ran -- the rung, a step no dispatcher runs, the
// target, a parameter the goal cannot bind, or a precondition.
StartRefused bool
// Insufficient: diverged although every precondition held (D16).
Insufficient bool
// Completed are the steps that ran and matched, with their idempotency
// keys -- what the app is told never to repeat -- and, flagged
// MayHaveRun, a step that was sent and whose running is unknown (its
// target stopped answering, or its node died with it in flight), which
// the app is told to check before repeating.
Completed []CompletedStep
Fitness proc.FitnessResult
Alignment proc.Alignment
// FellBack: the goal was handed to the app, and Fallback is what came
// back -- its ChildRunId is the repaired run, a new recording.
FellBack bool
Fallback FallbackOutcome
// ReplayRunId is the replay run; empty when the replay was refused
// before one was opened.
ReplayRunId string
// ModelCalls is always 0: the replay itself reaches no model. What a
// fallback spends is the app's, journaled on the app's run.
ModelCalls int
// Transition is how the ladder moved; the zero value when it did not.
Transition work.Transition
// Rung is the rung the replay found the procedure on.
Rung work.Rung
// Code is the replay run's errorCode when it did not serve or match:
// procedure_not_servable, procedure_start_refused, procedure_mismatch,
// procedure_diverged, procedure_version_replaced, and -- none of which the
// ladder counts -- procedure_target_unavailable, no_machine_dispatcher,
// no_workbench_dispatcher, no_prober; or, when nothing could take the goal
// over, procedure_fallback_unavailable or procedure_fallback_failed.
Code string
// Preconditions is the start check, when one was made.
Preconditions proc.PreconditionReport
// ApprovalId is the procedurePromotion approval this replay raised, when
// the ladder proposed one.
ApprovalId string
// AlreadyDone: the replay run had already finished, and this call ran,
// counted and handed over nothing that had been done.
AlreadyDone bool
// Interrupted: a resumed replay found a step that was in flight when its
// node died and could have reached beyond its workspace; it was not sent
// again, the goal went to the app naming it as one that MAY HAVE RUN, and
// the ladder did not count it.
Interrupted bool
// that says nothing about the procedure, so the replay stopped there and
// the ladder did not count it.
TargetUnavailable bool
// VersionReplaced: the construct was re-lifted to another version while
// this replay ran, so the ladder did not count it.
VersionReplaced bool
// NotCompared (shadow): the comparison was not made ON THIS NODE -- no
// workbench dispatcher is installed here, or the sandbox refused the
// first step -- so nothing was recorded and the ladder did not move. A
// run's completion event reaches whichever replica claims it, and a
// streak must not depend on which one that was.
NotCompared bool
}
ReplayOutcome is what one replay did.
type ReplayRequest ¶
type ReplayRequest struct {
OwnerUserId string
ConstructId string
// Mode is shadow, or -- for serving a goal -- canary or trusted. For the
// two serving modes the CURRENT rung decides which one runs: a request
// to serve is re-decided at execution, never trusted from compile.
Mode ReplayMode
// GoalRunId is, for canary and trusted, the goal's run the replay serves;
// for shadow, the recording run the replay is compared against. It is
// the replay run's parent.
GoalRunId string
// Input is the goal's input (canary, trusted): each free parameter is
// bound from it through the procedure's inputMap.
Input map[string]any
// Bindings are, for shadow, every hole's value as the app's own actions
// bound it (component/procedure.BindInstance).
Bindings map[string]string
// AppActions are, for shadow, what the app's action at each template step
// reported -- the reference CompareShadow holds the replay to.
AppActions []work.StepObservation
// AppArgs are, for shadow, the app's own arguments at each template step,
// written relative to its workspace. A machine-local procedure's shadow
// runs DRY -- nothing is dispatched on anybody's machine -- and compares
// the calls it would have made with these.
AppArgs []map[string]any
// Unfit is, for shadow, why the recording is NOT an instance of the
// procedure -- no run of its actions carries the procedure's steps, or
// one does and a value the procedure holds differs. Set, the comparison
// is a MISMATCH, recorded like any other, and nothing is replayed.
Unfit string
// UnfitStep is the first template step the recording lacked, with Unfit.
UnfitStep int
// StepKey is the goal run's step that asked for the replay (the
// replayLearnedProcedure statement). It keys the replay run, so a resumed
// goal run finds the replay it already started, and it names the step the
// app fallback's session hangs off.
StepKey string
// GoalId and Statement are the goal being served, when the caller has
// them; otherwise they are read off GoalRunId when the goal has to be
// handed back.
GoalId string
Statement string
}
ReplayRequest is one replay.
type ReuseSweepResult ¶
type ReuseSweepResult struct {
Owners int
// Constructs is every construct the sweep labelled.
Constructs int
// Changed are the constructs whose label or evidence changed: written,
// or -- on a dry run -- that a real sweep would write.
Changed []string
// Errors counts owners or constructs the sweep could not read or write;
// one failure never stops the rest.
Errors int
DryRun bool
}
ReuseSweepResult is what one reuse sweep did.
type SectionCatalogResult ¶
type SectionCatalogResult struct {
RunId string
// Catalogued are the constructs written into the owner's catalog.
Catalogued []string
// Skipped is why the run's sections were not looked at, when they were
// not.
Skipped string
// NotCatalogued are the section automations looked at and left out, each
// with why.
NotCatalogued []SectionNotCatalogued
}
SectionCatalogResult is what one pass over a succeeded run catalogued.
type SectionNotCatalogued ¶
SectionNotCatalogued is one section automation left out of the catalog.
type SweepResult ¶
type SweepResult struct {
Sweep string
Owners int
// Procedures is every learned procedure read; Examined those on a rung.
Procedures int
Examined int
Demoted int
Retired int
// Changed are the constructs written.
Changed []string
// Errors counts owners or rows the sweep could not read or write; one
// failure never stops the rest.
Errors int
}
SweepResult is what one sweep did.