Semantic index
Four reader questions become a faithful map to the supplied sources.
In / actual Go source
func SemanticIndex(ctx context.Context, env gimbal.Env, corpus string) (Index, error) {
gimbal.Set(ctx, "corpus", corpus)
author := gimbal.NewSession(ctx, gimbal.RoleBulkClassification, env.WorkDir)
index, err := author.Generate[Index](ctx, indexPrompt)
if err != nil {
return Index{}, err
}
if err := ValidateIndex(index); err != nil {
return Index{}, err
}
gimbal.SetJSON(ctx, "candidate", index)
reviewer := gimbal.NewSession(ctx, gimbal.RoleCodeReview, env.WorkDir)
review, err := reviewer.Generate[Review](ctx, indexReview)
if err != nil {
return Index{}, err
}
gimbal.SetJSON(ctx, "review", review)
if len(review.Findings) != 0 {
return Index{}, fmt.Errorf("index review: %v", review.Findings)
}
return index, nil
}Full source, types & prompts
// Package notebook contains two bounded, informational workflow examples.
// They are learning/evaluation material, independent of release or deployment gates.
package notebook
import (
"context"
"fmt"
"github.com/tylergannon/gimbal"
)
//go:generate go tool polytype --validate
// Route connects a reader's question to evidence in the supplied corpus.
type Route struct {
Question string `json:"question"`
Sources []string `json:"sources"`
Answer string `json:"answer"`
}
// Index is a compact question-driven map, not a vector database.
type Index struct {
Routes []Route `json:"routes"`
}
// Task is a bounded delivery outcome with dependencies and acceptance evidence.
type Task struct {
ID string `json:"id"`
Outcome string `json:"outcome"`
DependsOn []string `json:"depends_on"`
Acceptance string `json:"acceptance"`
}
// Sprint is an ordered plan for the supplied goal and constraints.
type Sprint struct {
Goal string `json:"goal"`
Tasks []Task `json:"tasks"`
}
// Review is an independent assessment against the original fixture.
type Review struct {
Findings []string `json:"findings"`
}
// SemanticIndex creates a retrieval map and gives it to a fresh reviewer.
func SemanticIndex(ctx context.Context, env gimbal.Env, corpus string) (Index, error) {
gimbal.Set(ctx, "corpus", corpus)
author := gimbal.NewSession(ctx, gimbal.RoleBulkClassification, env.WorkDir)
index, err := author.Generate[Index](ctx, indexPrompt)
if err != nil {
return Index{}, err
}
if err := ValidateIndex(index); err != nil {
return Index{}, err
}
gimbal.SetJSON(ctx, "candidate", index)
reviewer := gimbal.NewSession(ctx, gimbal.RoleCodeReview, env.WorkDir)
review, err := reviewer.Generate[Review](ctx, indexReview)
if err != nil {
return Index{}, err
}
gimbal.SetJSON(ctx, "review", review)
if len(review.Findings) != 0 {
return Index{}, fmt.Errorf("index review: %v", review.Findings)
}
return index, nil
}
// SprintPlan creates an actionable plan and gives it to a fresh reviewer.
func SprintPlan(ctx context.Context, env gimbal.Env, brief string) (Sprint, error) {
gimbal.Set(ctx, "brief", brief)
planner := gimbal.NewSession(ctx, gimbal.RoleSprintPlanning, env.WorkDir)
plan, err := planner.Generate[Sprint](ctx, sprintPrompt)
if err != nil {
return Sprint{}, err
}
if err := ValidateSprint(plan); err != nil {
return Sprint{}, err
}
gimbal.SetJSON(ctx, "candidate", plan)
reviewer := gimbal.NewSession(ctx, gimbal.RoleCodeReview, env.WorkDir)
review, err := reviewer.Generate[Review](ctx, sprintReview)
if err != nil {
return Sprint{}, err
}
gimbal.SetJSON(ctx, "review", review)
if len(review.Findings) != 0 {
return Sprint{}, fmt.Errorf("sprint review: %v", review.Findings)
}
return plan, nil
}
const indexPrompt = `Build a compact semantic index of the corpus below. Return four question-driven routes: starting a local run, isolation of concurrent app/database stacks, ownership of workflow semantics, and updating a backend while runs are active. Each answer must cite the relevant supplied source IDs, distinguish requirements from demonstrated support, and be useful to a reader choosing what to open next. Do not invent capabilities. Use only the supplied corpus. Make no file changes.`
const indexReview = `Independently inspect the candidate against the original corpus. Check all four requested retrieval questions, exact source attribution, requirements versus proven support, and unsupported promises. Return concrete findings, or an empty findings list when the index is faithful. Make no changes.`
const sprintPrompt = `Turn the supplied brief into a small sprint of three to five tasks. Name bounded outcomes, earlier task dependencies, and observable acceptance evidence. Cover the local baseline, concurrent stack isolation, cancellation and cleanup, and human-legible observation. Respect the budget and exclusions. This is a proposed plan, not completed work. Make no file changes.`
const sprintReview = `Independently inspect the candidate against the original brief. Check complete coverage, feasible ordering, concrete acceptance, budget, and exclusions. Reject claims of completed implementation, universal restartability, or mandatory Docker for basic local workflows. Return concrete findings, or an empty findings list when the plan is actionable. Make no changes.`
Out / recorded result
Four routes. All references resolve to the fixture. Independent review found no material fidelity gaps.
How do I start a representative local run?
Requirement: a representative single-process CLI and GUI workflow must run without containers or network infrastructure. Demonstrated support: none is stated; this fixture explicitly records a requirement, not a passed test. Open [local] to verify implementation evidence, and check any individual tool’s declared network needs.
Sources: localHow are concurrent application/database stacks isolated?
Requirement: a multitier host must own startup, routing, workspace/data isolation, and cleanup so concurrent feature stacks cannot collide or access one another’s services or data. Demonstrated support: no universal mechanism is established. Docker networks are only a candidate; plain processes/systemd and Kubernetes are consumer choices, and the mechanism remains undecided. Open [isolation] for the host contract and unresolved mechanism decision.
Sources: isolationWho owns workflow semantics?
Requirement/design boundary: authored Go owns workflow control flow; Gimbal owns shared agent acceptance, scoped context/lifecycle semantics, and source/event meaning; consumers own compilation, orchestration, worker placement, and storage policy. Demonstrated support: Temporal is one demonstrated target, not mandatory. A named web-app-plus-Postgres profile with explicit app/database handles is only a design candidate, not implemented universal capability. Open [ownership] to determine which layer a proposed change belongs to.
Sources: ownershipHow should a backend be updated while runs are active?
Demonstrated support: same-build Temporal replay has been demonstrated in a bounded consumer. Not demonstrated: arbitrary workflow-version migration or restoration of live agent sessions. Operational requirement/guidance: retain a compatible generated build for active runs or drain those runs before replacement; target maintainers own deployment and update policy. Open [updates] for the bounded replay evidence and rollout constraint.
Sources: updatesStructural checks + fresh agent review. One fixture run is not broad quality, target-portability or infrastructure proof.
e3891e73875eRecorded snapshot · not a live checkInput, run identity & evaluation boundaries
Run: 01M3W0J2K4D9HGD57QHA2W51GF.semantic-index
Exact source revision: e3891e73875eaf0acc1e8041651bcc29b60477d0
Source SHA-256: 95f968a7df3aee6c0d89af8d5ffc2aef3dde57a11e0c226f2c9e32dc4cd61ef8
Runtime base: 83cdbf6efaa204feb221547fec3bd3bd25172b23. Example source lives on a local branch.
Fixture SHA-256: 2bf35441470fc2e68a4ad42cc769b051e9a9ba5cde83570ac821bf36d1825865
bounded fixture; structural checks and independent agent review; informational, not a release gate. A later Gimbal revision requires a fresh run before transferring this result.
[local] Product requirement: a representative single-process CLI and GUI workflow must run without containers or network infrastructure. Individual tools may declare network needs. This fixture states a requirement, not a passed test. [isolation] Product requirement: a multitier host owns startup, routing, workspace/data isolation and cleanup. Two concurrent feature stacks must not collide or access each other's services or data. Docker networks are a candidate; plain process/systemd and Kubernetes may be consumer choices. The mechanism is undecided, not universal support. [ownership] Ordinary authored Go owns workflow control flow. Gimbal supplies shared agent acceptance, scoped context/lifecycle semantics and source/event meaning. Consumers own compilation, orchestration, worker placement and storage policy. Temporal is one demonstrated target, not a mandatory dependency. A named web-app-plus-Postgres profile returning explicit app/database handles is a design candidate, not implemented universal capability. [updates] Same-build Temporal replay has been demonstrated in a bounded consumer. That does not prove arbitrary workflow-version migration or restoration of live agent sessions. Retain a compatible generated build for its active runs, or drain them before replacing it. Target maintainers own deployment/update policy.