decsr

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildProjectReviewSeed

func BuildProjectReviewSeed(root string) string

BuildProjectReviewSeed reads the key .decsr artifacts (curated files plus recent task memory) and produces a task-input string that instructs the PM to comb the existing planning files, compare them against the current repository state, and plan ONLY the work that remains. Returns "" when no artifacts are present.

func HasReviewableArtifacts

func HasReviewableArtifacts(root string) bool

HasReviewableArtifacts reports whether the project's .decsr workspace holds any planning artifacts the PM could use to resume the project. This includes the curated top-level files AND the persistent task memory under .decsr/memory/ (which is what survives after a completed/failed run).

Types

type DoneTask

type DoneTask struct {
	ID    string
	Title string
}

DoneTask is a completed top-level decsr task (history entry).

func DoneTasks

func DoneTasks(ctx context.Context, root string) []DoneTask

DoneTasks returns completed decsr tasks for the project, newest first as reported by beads. Returns nil when bd is unavailable or there are none.

type PipelineState

type PipelineState string

PipelineState represents the current phase of the pipeline.

const (
	PipelineIdle        PipelineState = "idle"
	PipelinePM          PipelineState = "pm"
	PipelineCompacting  PipelineState = "compacting"
	PipelineNegotiating PipelineState = "negotiating"
	PipelineResearch    PipelineState = "research"
	PipelinePlanning    PipelineState = "planning"
	PipelineCoding      PipelineState = "coder"
	PipelinePoC         PipelineState = "poc"
	PipelineQATests     PipelineState = "qa_tests"
	PipelineQAReview    PipelineState = "qa_review"
	PipelineUXReviewing PipelineState = "ux_reviewer"
	PipelineSecurity    PipelineState = "security"
	PipelineDone        PipelineState = "done"
	PipelineGate        PipelineState = "human_gate"
	PipelineRateLimited PipelineState = "rate_limited"
)

type ResumableTask

type ResumableTask struct {
	TopBeadID string
	Title     string
}

ResumableTask describes an interrupted run that can be resumed.

func Resumable

func Resumable(ctx context.Context, root string) (ResumableTask, bool)

Resumable reports whether root has an interrupted decsr task that can be resumed: an in_progress top-level decsr-task bead whose id matches the run-state sidecar, with the spec and sub-task plan still present. Returns (task, true) when resumable. Beads is the source of truth; the sidecars are a cross-check.

type TaskRunner

type TaskRunner struct {
	// contains filtered or unexported fields
}

TaskRunner is the unified decsr that treats everything as a task. All work flows through: negotiate → decompose → per-bead (QA tests → coder) → quality review → PM arbitrate → done.

func NewTaskRunner

func NewTaskRunner(
	b *bus.Bus,
	agents map[bus.AgentRole]agent.Agent,
	cfg config.Config,
	ws artifacts.Workspace,
	root string,
) *TaskRunner

NewTaskRunner creates a TaskRunner with all agent dependencies.

func (*TaskRunner) AgentDurations

func (tr *TaskRunner) AgentDurations() map[bus.AgentRole]time.Duration

AgentDurations returns cumulative wall-clock time each agent has spent running.

func (*TaskRunner) Approve

func (tr *TaskRunner) Approve()

Approve unblocks the task spec approval gate.

func (*TaskRunner) CodingStarted

func (tr *TaskRunner) CodingStarted() time.Time

CodingStarted returns the timestamp when the coder was first invoked.

func (*TaskRunner) CurrentState

func (tr *TaskRunner) CurrentState() PipelineState

CurrentState returns the current pipeline state.

func (*TaskRunner) Regenerate

func (tr *TaskRunner) Regenerate()

Regenerate signals the TaskRunner to re-negotiate.

func (*TaskRunner) Resume

func (tr *TaskRunner) Resume(ctx context.Context) error

Resume continues an interrupted task: it loads the top-level bead, spec and sub-task plan from the workspace, skips negotiate/decompose, and finishes the remaining (open or interrupted) sub-tasks. Use Resumable() to check first.

func (*TaskRunner) ResumeBuildFix

func (tr *TaskRunner) ResumeBuildFix(ctx context.Context) error

ResumeBuildFix re-runs the coder's build-and-fix loop using the current project files on disk. Use after a build-fix failure to give the coder another round of attempts without restarting the whole task pipeline.

func (*TaskRunner) Run

func (tr *TaskRunner) Run(ctx context.Context, taskInput string) error

Run executes the full task lifecycle: 1. Negotiate with PM (human in the loop) 2. PM plans execution strategy (autonomous) 3. Execute: code → quality gate (fully autonomous)

func (*TaskRunner) SendHumanReply

func (tr *TaskRunner) SendHumanReply(msg string)

SendHumanReply delivers a user message during the negotiation phase.

func (*TaskRunner) SetInteractive

func (tr *TaskRunner) SetInteractive(v bool)

SetInteractive controls whether human gates block for approval. Plain mode sets this to false so the context pack is auto-approved and the supplied task description is used without prompting.

type TaskScope

type TaskScope = string

TaskScope describes the magnitude of a task, influencing the execution strategy. Kept here as convenience aliases — canonical types are in the agent package.

const (
	ScopeGreenfield TaskScope = "greenfield"
	ScopeFeature    TaskScope = "feature"
	ScopeBugfix     TaskScope = "bugfix"
	ScopeRefactor   TaskScope = "refactor"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL