refactor: strip doc and issue narration from code comments
Remove PRD/doc paths, bead IDs, phase notes and deleted-test references from comments; drop test-only hooks left by the test deletion. Includes in-progress archied bootstrap, gateway and query changes.
This commit is contained in:
269 files changed
+1201
-2609
No files matched your search
@@ -6,7 +6,7 @@ import "context"
|
||||
// back while waiting. It is the consumer-owned contract the workflow engine
|
||||
// holds (the same shape as Store), satisfied by *staterpc.Client for an
|
||||
// agent-container run: the callee is a first-class task the State Store
|
||||
// derives from the caller's row (docs/prds/workflow-calls.md).
|
||||
// derives from the caller's row.
|
||||
type Caller interface {
|
||||
// StartCall enqueues the callee task for callerTaskID's workflow.call
|
||||
// step: org, workspace, identity, owner, repo and issue number are
|
||||
@@ -14,11 +14,9 @@ type Caller interface {
|
||||
// and the callee's depth is the caller's + 1. The store refuses a
|
||||
// caller that is not running and a call past the depth limit.
|
||||
StartCall(ctx context.Context, callerTaskID int64, workflow string, inputs map[string]any) (*Task, error)
|
||||
// CallStatus reads one call's callee: its status, latest transition
|
||||
// detail and written outputs (decoded from the callee's row;
|
||||
// docs/prds/workflow-call-outputs.md, "Storage and wire" — the callee
|
||||
// writes them and the caller only receives them). A store only answers
|
||||
// for a task whose call_parent_task_id is callerTaskID, so a caller
|
||||
// reads only its own callees.
|
||||
// CallStatus reads one call's callee: its status, latest transition detail
|
||||
// and written outputs. A store only answers for a task whose
|
||||
// call_parent_task_id is callerTaskID, so a caller reads only its own
|
||||
// callees.
|
||||
CallStatus(ctx context.Context, callerTaskID, callTaskID int64) (status, detail string, outputs map[string]any, err error)
|
||||
}
|
||||
@@ -34,7 +34,7 @@ type InputSpec struct {
|
||||
|
||||
// OutputSpec declares one workflow output: the same type vocabulary an
|
||||
// input uses. A required output the run never writes parks it before any
|
||||
// terminal state (docs/prds/workflow-call-outputs.md, "Failure rules");
|
||||
// terminal state;
|
||||
// required defaults to false.
|
||||
type OutputSpec struct {
|
||||
Type string `yaml:"type" json:"type"`
|
||||
@@ -49,7 +49,7 @@ type WorkflowInterface struct {
|
||||
Inputs map[string]InputSpec `yaml:"inputs,omitempty" json:"inputs,omitempty"`
|
||||
Repository RepositoryMode `yaml:"repository,omitempty" json:"repository,omitempty"`
|
||||
// Outputs declares the named, typed structured results a run writes
|
||||
// once each (docs/prds/workflow-call-outputs.md). A wait:true caller
|
||||
// once each. A wait:true caller
|
||||
// reads them through WorkflowCallStatus; a call step publishes one as
|
||||
// one of the caller's own outputs.
|
||||
Outputs map[string]OutputSpec `yaml:"outputs,omitempty" json:"outputs,omitempty"`
|
||||
@@ -64,10 +64,9 @@ type WorkflowInterface struct {
|
||||
|
||||
// Needs reports the harness requirements the interface carries: the declared
|
||||
// needs, plus the captures a declared output forces, because an output is
|
||||
// written through a capture tool (docs/prds/workflow-call-outputs.md, "How a
|
||||
// run writes one"). Profile selection reads this rather than DeclaredNeeds,
|
||||
// so a workflow that declares outputs cannot name a Kit profile whose harness
|
||||
// serves no capture tools (docs/prds/external-agent-harness.md, "Contract").
|
||||
// written through a capture tool. Profile selection reads this rather than
|
||||
// DeclaredNeeds, so a workflow that declares outputs cannot name a Kit profile
|
||||
// whose harness serves no capture tools.
|
||||
func (w WorkflowInterface) Needs() WorkflowNeeds {
|
||||
needs := w.DeclaredNeeds
|
||||
if len(w.Outputs) > 0 {
|
||||
@@ -163,8 +162,8 @@ func (w WorkflowInterface) CheckInputs(values map[string]any) error {
|
||||
|
||||
// CheckOutputs rejects declared-output values that do not satisfy the
|
||||
// declared outputs: the same rules CheckInputs applies to inputs (required,
|
||||
// undeclared, wrong type), read from the other side of the interface
|
||||
// (docs/prds/workflow-call-outputs.md, "Failure rules"). A written null
|
||||
// undeclared, wrong type), read from the other side of the interface.
|
||||
// A written null
|
||||
// counts as not written, as CheckInputs treats a null input; an unwritten
|
||||
// optional output leaves its key absent rather than null.
|
||||
func (w WorkflowInterface) CheckOutputs(values map[string]any) error {
|
||||
@@ -240,9 +239,8 @@ func DecodeInputs(s string) (map[string]any, error) {
|
||||
return inputs, nil
|
||||
}
|
||||
|
||||
// EncodeOutputs is the stored and wire form of a task's written outputs: a
|
||||
// JSON object, or empty for none (docs/prds/workflow-call-outputs.md,
|
||||
// "Storage and wire").
|
||||
// EncodeOutputs is the stored and wire form of a task's written outputs: a JSON
|
||||
// object, or empty for none.
|
||||
func EncodeOutputs(outputs map[string]any) (string, error) {
|
||||
if len(outputs) == 0 {
|
||||
return "", nil
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
// ReviewGate is the operator-approval gate's whole conversation with the
|
||||
// operator, encoded on the task's review_gate column
|
||||
// (docs/prds/pr-review-operator-response.md).
|
||||
//
|
||||
// It lives with the task record it encodes, the way EncodeInputs does, for the
|
||||
// same reason: the dashboard process renders and answers a gate, and it must
|
||||
@@ -48,8 +47,7 @@ type ReviewGate struct {
|
||||
// Selection is the finding keys an approve posts. Empty means all of the
|
||||
// offered findings.
|
||||
Selection []string `json:"selection,omitempty"`
|
||||
// Instructions is what the operator asked a re-review to focus on. The
|
||||
// PRD requires it for a re-review; the lens and reviewer missions read it.
|
||||
// Instructions is what the operator asked a re-review to focus on.
|
||||
Instructions string `json:"instructions,omitempty"`
|
||||
}
|
||||
|
||||
@@ -71,7 +69,7 @@ const (
|
||||
)
|
||||
|
||||
// MaxRereviewRounds bounds how many operator re-reviews one review gate
|
||||
// grants, per the PRD's Decision 2. It is a constant in the domain, not a
|
||||
// grants. It is a constant in the domain, not a
|
||||
// config knob, and the guarded store write enforces it in the row so two
|
||||
// simultaneous re-reviews cannot spend a round the cap forbids.
|
||||
const MaxRereviewRounds = 2
|
||||
|
||||
@@ -6,10 +6,8 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/taskstate"
|
||||
)
|
||||
|
||||
// The step-execution vocabulary of docs/prds/execution-tree-state-machine.md:
|
||||
// one stage run, or one agent or workflow.call step an execution's tree
|
||||
// records, started and finished through the State Store under the run's own
|
||||
// credential.
|
||||
// Step records: one stage run, agent call or workflow.call, started and
|
||||
// finished through the State Store under the run's own credential.
|
||||
|
||||
// Step kinds. `stage` is what workflow.Run records for every stage it runs;
|
||||
// `agent` is what the agent runtime records for one agent call; `call` is the
|
||||
@@ -69,9 +67,7 @@ type StepFinish struct {
|
||||
}
|
||||
|
||||
// StepExecution is one recorded step: ListSteps' read, the dashboard run
|
||||
// detail's authoritative source (docs/prds/execution-tree-state-machine.md;
|
||||
// replaces folding stage_start/stage_finish events, which tasks.stage used to
|
||||
// back). ParentID is 0 for a stage at the tree's root.
|
||||
// detail's authoritative source. ParentID is 0 for a stage at the tree's root.
|
||||
type StepExecution struct {
|
||||
ID int64
|
||||
ExecutionID int64
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package task is the task-execution vocabulary of the workflow domain:
|
||||
// the Task record, its lifecycle statuses, and the narrow Store contract
|
||||
// workflow stages call mid-run. It split out of package workflow
|
||||
// (archie-core-8cda.5.6) so the UI process can hold the vocabulary without
|
||||
// so the UI process can hold the vocabulary without
|
||||
// linking the pipeline engine there -- which drags in agentexec, skill and
|
||||
// tools. package workflow keeps aliases, so daemon-side callers are
|
||||
// unaffected.
|
||||
@@ -96,14 +96,14 @@ type Task struct {
|
||||
// one identity cannot control another's chat-spawned tasks.
|
||||
Identity string `json:"identity"`
|
||||
// Org is the org the task belongs to. The State Store derives it from
|
||||
// the task's identity when the row is written
|
||||
// (docs/prds/orgs-and-access.md, "Events and task identity"); a task
|
||||
// the task's identity when the row is written;
|
||||
// a task
|
||||
// of a single-operator install belongs to the default org.
|
||||
Org org.OrgID `json:"org,omitempty"`
|
||||
// BindingID and BindingVersion are stamped when a task was created
|
||||
// from a playbook binding dispatch (t2db.4 Phase B). They record
|
||||
// provenance: which binding fired this task and at what version, so
|
||||
// later edits to the binding cannot silently rewrite history.
|
||||
// BindingID and BindingVersion are stamped when a task was created from a
|
||||
// playbook binding dispatch. They record provenance: which binding fired
|
||||
// this task and at what version, so later edits to the binding cannot
|
||||
// silently rewrite history.
|
||||
BindingID string `json:"binding_id"`
|
||||
BindingVersion int `json:"binding_version"`
|
||||
// Inputs are the workflow inputs the binding assigned, checked against
|
||||
@@ -111,18 +111,17 @@ type Task struct {
|
||||
// structured data, never as body text.
|
||||
Inputs map[string]any `json:"inputs,omitempty"`
|
||||
// Outputs are the structured results this run wrote to the workflow's
|
||||
// declared outputs (docs/prds/workflow-call-outputs.md). The set is
|
||||
// declared outputs. The set is
|
||||
// attempt-scoped: a claim starts the next attempt with an empty set and
|
||||
// the finish write replaces the row's set wholesale. Callers read these
|
||||
// only from a successful terminal state, through WorkflowCallStatus.
|
||||
Outputs map[string]any `json:"outputs,omitempty"`
|
||||
// ReviewPayload is the JSON-encoded review unit (the forge review's
|
||||
// actionable comments) the remediate workflow's current run must
|
||||
// address. The daemon's reaction consumer injects it before queuing a
|
||||
// remediation run, so the run is recoverable from the task record
|
||||
// itself rather than only from a prompt (docs/prds/pr-review-remediation.md
|
||||
// decision 4). Empty outside a remediation run. RetryCount doubles as
|
||||
// the remediation round counter for this same task, bounded by the
|
||||
// actionable comments) the remediate workflow's current run must address.
|
||||
// The daemon's reaction consumer injects it before queuing a remediation
|
||||
// run, so the run is recoverable from the task record itself rather than
|
||||
// only from a prompt. Empty outside a remediation run. RetryCount doubles
|
||||
// as the remediation round counter for this same task, bounded by the
|
||||
// repo's existing max_retries (decision 5's round cap).
|
||||
ReviewPayload string `json:"review_payload"`
|
||||
// ParkClass is the producer-recorded answer to "what kind of
|
||||
@@ -136,21 +135,20 @@ type Task struct {
|
||||
// budget: one shared counter made N operator retries eat the
|
||||
// review-remediation budget and vice versa.
|
||||
RemediationRounds int `json:"remediation_rounds"`
|
||||
// ReviewGate is the operator-approval gate's whole conversation with
|
||||
// the operator, persisted as one JSON document (prreview.EncodeReviewGate):
|
||||
// the offer the gate writes before it waits for an operator -- the scored
|
||||
// ReviewGate is the operator-approval gate's whole conversation with the
|
||||
// operator, persisted as one JSON document (prreview.EncodeReviewGate): the
|
||||
// offer the gate writes before it waits for an operator -- the scored
|
||||
// findings, the head SHA, the pull request's identity and the workflow the
|
||||
// wait resumes -- and the answer the response path fills in -- the outcome,
|
||||
// the selected findings' keys for an approve and the instructions for a
|
||||
// re-review. Without it, "post the selected findings" cannot mean the
|
||||
// findings the operator saw: the resumed run recomputes them with agent
|
||||
// calls (docs/prds/pr-review-operator-response.md, "The review the operator
|
||||
// answers"). Empty for a task that never reached the gate.
|
||||
// calls. Empty for a task that never reached the gate.
|
||||
ReviewGate string `json:"review_gate"`
|
||||
// RereviewRounds counts how many operator re-reviews the pr-review gate
|
||||
// granted, incremented in the same guarded write that requeues the
|
||||
// re-review and capped at prreview.MaxRereviewRounds
|
||||
// (docs/prds/pr-review-operator-response.md, Decision 2). Deliberately
|
||||
// re-review and capped at prreview.MaxRereviewRounds.
|
||||
// Deliberately
|
||||
// separate from both RetryCount and RemediationRounds -- one shared
|
||||
// counter made unrelated retries draw another phase's budget down.
|
||||
RereviewRounds int `json:"rereview_rounds"`
|
||||
@@ -220,8 +218,8 @@ type Store interface {
|
||||
Update(ctx context.Context, t *Task) error
|
||||
Transition(ctx context.Context, taskID int64, from, to, detail string) error
|
||||
InsertEvent(ctx context.Context, e events.Event) (int64, error)
|
||||
// StartStep records a StepExecution entering running
|
||||
// (docs/prds/execution-tree-state-machine.md): the store creates the row,
|
||||
// StartStep records a StepExecution entering running:
|
||||
// the store creates the row,
|
||||
// enforces the step transition table and the execution's own status, and
|
||||
// writes the transition's stage_start event in the same transaction. It
|
||||
// returns the step's id and the persisted event, which the caller publishes
|
||||
|
||||
Reference in new issue
Block a user