Documentation
¶
Overview ¶
Package proctest is the integration harness for the shipped base procedures: a real application over temp filesystem stores — real registry, real template values, real embedded procedure entries — with a scripted LLM. Procedure behavior is tested here, at the composition layer that owns the wiring, so no test fakes an application contract; internal/engine tests stay generic over synthetic specs.
Per-procedure suites live in this directory as package proctest_test, one file per procedure, mirroring internal/baseprocedures/entries.
Index ¶
- func LoadEntry(t *testing.T, graphDir, id string) *model.Entry
- func MustTopics(labels ...string) []model.TopicPath
- func RequireStatus(t *testing.T, serve *sdd.WorkflowServe, status string)
- func RequireStep(t *testing.T, serve *sdd.WorkflowServe, step string)
- func WriteEntry(t *testing.T, graphDir string, e *model.Entry)
- func WriteRawEntry(t *testing.T, graphDir, id, content string)
- type GuideFinding
- type LLMScript
- type Option
- type PreflightFinding
- type Session
- func (s *Session) Answer(t *testing.T, instance, chooser, choice string, fields map[string]any, ...) *sdd.WorkflowServe
- func (s *Session) AnswerErr(t *testing.T, instance, chooser, choice string, fields map[string]any, ...) (*sdd.WorkflowServe, error)
- func (s *Session) LogRead(t *testing.T, tool string, full, summary []string)
- func (s *Session) Report(t *testing.T, instance string, fields map[string]any) *sdd.WorkflowServe
- func (s *Session) ReportErr(t *testing.T, instance string, fields map[string]any) (*sdd.WorkflowServe, error)
- func (s *Session) Start(t *testing.T, canonical string, params map[string]any) *sdd.WorkflowServe
- func (s *Session) StartErr(t *testing.T, canonical string, params map[string]any) (*sdd.WorkflowServe, error)
- type World
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustTopics ¶
MustTopics parses topic labels into the typed paths a fixture entry carries; fixtures are static, so a bad label is a programming error.
func RequireStatus ¶
func RequireStatus(t *testing.T, serve *sdd.WorkflowServe, status string)
RequireStatus fails unless the serve carries the status.
func RequireStep ¶
func RequireStep(t *testing.T, serve *sdd.WorkflowServe, step string)
RequireStep fails unless the serve sits at the step.
func WriteEntry ¶
WriteEntry writes one fixture entry into the graph dir at its ID-derived path, rendered by the production serializer exactly as the write handler persists it — usable before NewWorld and mid-test (reads snapshot per call, so later reads see it).
func WriteRawEntry ¶
WriteRawEntry writes entry content verbatim for shapes the Entry struct does not model.
Types ¶
type GuideFinding ¶
type GuideFinding struct {
Reasoning string `json:"reasoning"`
Axis string `json:"axis"`
Quote string `json:"quote"`
Repair string `json:"repair"`
Severity string `json:"severity"`
}
GuideFinding is a scripted writing-guide finding, marshaled in the shape the real guide parser expects.
type LLMScript ¶
type LLMScript struct {
PreflightFindings []PreflightFinding
GuideFindings []GuideFinding
Summary string
// contains filtered or unexported fields
}
LLMScript scripts the runtime's LLM executor per purpose and counts calls, so "the guide ran once" is asserted on real executor invocations instead of a faked op. Fields may be changed between calls; a nil findings slice scripts a clean pass.
type Option ¶
type Option func(*config)
Option configures NewWorld.
func WithBranchDir ¶
WithBranchDir registers an additional branch backed by its own graph dir — for procedures that route reads and writes by branch state (implementation's work branches). The default branch main stays on the world's GraphDir.
func WithEntries ¶
WithEntries writes fixture entries before the stores open.
func WithGraphDir ¶
WithGraphDir uses an existing graph dir instead of a fresh temp dir — e.g. to reopen the same stores as an earlier world (restart scenarios).
func WithParticipant ¶
WithParticipant sets the resolved participant (default Christopher).
type PreflightFinding ¶
type PreflightFinding struct {
Severity string `json:"severity"`
Category string `json:"category"`
Observation string `json:"observation"`
}
PreflightFinding is a scripted pre-flight finding, marshaled in the shape the real pre-flight parser expects.
type Session ¶
type Session struct {
World *World
WF *sdd.WorkflowSession
ID sdd.SessionID
}
Session wraps one workflow session on the world.
func (*Session) Answer ¶
func (s *Session) Answer(t *testing.T, instance, chooser, choice string, fields map[string]any, userWords string) *sdd.WorkflowServe
Answer answers the pending chooser.
func (*Session) AnswerErr ¶
func (s *Session) AnswerErr(t *testing.T, instance, chooser, choice string, fields map[string]any, userWords string) (*sdd.WorkflowServe, error)
AnswerErr is Answer for tests asserting the failure.
func (*Session) LogRead ¶
LogRead records a read into the session ledger, as the host's read tools do.
func (*Session) ReportErr ¶
func (s *Session) ReportErr(t *testing.T, instance string, fields map[string]any) (*sdd.WorkflowServe, error)
ReportErr is Report for tests asserting the failure.
type World ¶
type World struct {
App *sdd.Application
Identity sdd.RequestIdentity
GraphDir string
LLM *LLMScript
}
World is one project: a real application over temp stores with a scripted LLM. GraphDir is the on-disk graph — real writes land there.
func NewWorld ¶
NewWorld builds the world: fixture entries written, filesystem stores over temp dirs, real project runtime, real application.