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 DefaultBase() time.Time
- func HubID(base time.Time) string
- func LoadEntry(t *testing.T, graphDir, id string) *model.Entry
- func MustTopics(labels ...string) []model.TopicPath
- func RealisticGraph(base time.Time, shape GraphShape) []*model.Entry
- 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)
- func WriteWIPMarkers(t *testing.T, graphDir string, base time.Time, shape GraphShape)
- type GraphShape
- 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) Stage(t *testing.T, filename string, content []byte) string
- func (s *Session) Start(t *testing.T, canonical string, params map[string]any) *sdd.WorkflowServe
- func (s *Session) StartChild(t *testing.T, canonical string, params map[string]any, parent string) *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 DefaultBase ¶
DefaultBase anchors generated timestamps near the real clock: entries spread backwards from here, so recency windows (heat exp-14d, by(date)) see a live graph. Capture it once per fixture — every generating call must share one base or IDs drift across a second boundary.
func HubID ¶
HubID returns the generated hub plan's entry ID for a base — the anchor for chain-expansion worst-case walks.
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 RealisticGraph ¶
func RealisticGraph(base time.Time, shape GraphShape) []*model.Entry
RealisticGraph generates the fixture entries for a shape, timestamped backwards from base. Every reference resolves inside the generated set, so the graph loads warning-clean and the health framing lane stays quiet — measured serves reflect content, not fixture damage.
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.
func WriteWIPMarkers ¶
WriteWIPMarkers writes the shape's WIP marker files into the graph's wip/ directory, each pointing at the base's generated hub entry.
Types ¶
type GraphShape ¶
type GraphShape struct {
// Entries is the general population: gaps, pending directives, plans, and
// dones spread over the last weeks, so recency- and heat-ranked lanes
// have real material.
Entries int
// Facts enroll in the retrieval index (the shell's factIndex lane).
Facts int
// Principles are facts under principles/interactive — the shell's
// as-bodies framing lane, which renders full bodies.
Principles int
// Actors and RolesPerActor populate the participants lane.
Actors int
RolesPerActor int
// Focuses with InvolvementsPerFocus targets populate the focus lane.
Focuses int
InvolvementsPerFocus int
// Aspirations and GuidingDirectives populate their framing lanes.
Aspirations int
GuidingDirectives int
// WIPMarkers are marker files under wip/ (groom's sweep, catch-up's lane).
WIPMarkers int
// HubFanOut entries all reference one hub plan — the chain-expansion
// worst case for entryChains (engage, implementation, evaluate).
HubFanOut int
// TopicLabels is the number of distinct topic labels spread across the
// population (capture's topicLabels lane).
TopicLabels int
}
GraphShape sizes the generated realistic graph — one knob per surface that scales an automatic serve (the audit inventory on d-tac-rzi). The door test's old fixture was blind exactly because it populated none of these.
func DefaultShape ¶
func DefaultShape() GraphShape
DefaultShape approximates the SDD repository's own graph where scale matters to a serve: lane populations at their real order of magnitude.
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 runner per purpose and counts calls, so "the guide ran once" is asserted on real runner 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.
func (*Session) Start ¶
Start starts a procedure instance; params may seed declared params and state.
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 NewRealisticWorld ¶
func NewRealisticWorld(t *testing.T, shape GraphShape) (*World, string)
NewRealisticWorld builds a world over a generated realistic graph and returns it with the hub entry's ID.
func NewWorld ¶
NewWorld builds the world: fixture entries written, filesystem stores over temp dirs, real project runtime, real application.