Learn locally
Lessons and triggers simulate workflows. They do not operate your business systems.
How to use the lab. What the data means. Where it lives.
Source reviewed September 26, 2026 · v1 · Implementation reference, not a live service auditLessons and triggers simulate workflows. They do not operate your business systems.
Repository reports sample source. Every finding needs its scope and revision.
Live coaching, voice and Jev require configured providers. Memory continuity is manual.
Follow a workflow below. Expand only the instructions you need.
Field names match the implementation. Optional fields may be absent; nullable fields may explicitly contain null.
Browser records stay on this device and browser profile. D1 stores counters and voice receipts. It does not currently store repository reports, project briefs or the lesson catalog as shared project memory.
Versioned source code; teaching catalog
Source:lib/studio.ts| Field | Type / rule | Meaning |
|---|---|---|
Project.id / UseCase.id | string | Stable catalog identifier; a use case belongs to a project. |
name / short / mark | string | Display name, compact name and visual initials (short and mark are project fields). |
agent / category / purpose | string | Named assistant, business category and intended purpose. |
repo / website | optional URL string | Reference links; their presence does not establish a live connection. |
evidence | string | What was reviewed and what remains unverified. |
stack / useCases | string[] / UseCase[] | Described technologies and the project’s lesson scenarios. |
request / context / decision | string | Sample request, required information and proposed model reasoning. |
permission / operation | string | Authorization boundary and named sample tool. |
sample / verification / outcome | string | Fictional result, how to check it and intended business result. |
events | string[] | Example event for each of the seven trigger families. |
localStorage: agent-lab-studio-v1 → context; sent to connected coach
Source:lib/lab.ts · app/page.tsx| Field | Type / rule | Meaning |
|---|---|---|
view / scenario | enum | Foundations view: walk, build, triggers. Scenario: lead, quote, renewal. |
index / triggerStep | integer 0–6 | Selected workflow stage and foundations trigger position. |
approved | boolean | null | Learner approval; null means no decision yet. |
discount | number 0–30 | Percentage discount for the fictional margin example. |
selectedTrigger | string | null | Selected trigger family; maximum 30 characters. |
tiles | 7 unique stage IDs | Ordering exercise: ask, pack, model, gate, tool, return, finish. |
frameworkContext | optional string ≤10,000 | Generated coaching brief attached to workspace context. |
studio.sessionId | string ≤80 | Local learning session identifier; not a voice-session record. |
studio.projectId / useCaseId | string ≤60 | Selected catalog project and lesson. |
studio.activeTab | enum | framework, projects, harness, build, triggers, stack, evidence. Reference is a separate route. |
studio.revision | nonnegative integer | Local context change counter, not a Git revision. |
studio.selectedTool / failureStep | string | null / integer | null | Inspected tool and removed-step comparison (0–6). |
studio.simulation | enum | idle, running, paused, waiting, verified, failed, denied, canceled. |
studio.recentActions / learned | string[] | Up to 12 recent labels and 100 comprehension markers. |
studio.follow | boolean | Follow workspace navigation during voice. |
studio.triggerStatus | optional enum | idle, waiting, verified, failed, denied, canceled. |
theme / reading / events | string / string / EvidenceEvent[] | Sibling values alongside context in the saved browser record. |
Browser workspace context and local evidence ledger
Source:lib/lab.ts · lib/execution.ts · lib/studio.ts| Field | Type / rule | Meaning |
|---|---|---|
execution.id / cursor / completed | string / integer / integer[] | Run ID, active position (0–6), completed positions (up to 7). |
execution.receipt | optional object | Returned sample operation and verification record. |
receipt.projectId / useCaseId / operation | string | Identifies which lesson and tool produced the result. |
receipt.result | string | object | Sample text or deterministic margin calculation. |
result.revenue / cost / profit | number | Fictional money inputs and result, in the example’s currency. |
result.margin / discount | number | Percentage values, not fractions. |
receipt.checked | boolean | Local lesson result was checked; no production certification. |
EvidenceEvent.id / runId | string | Event identifier and associated lesson run. |
time | ISO date-time string | Browser-recorded event time. |
stage / status / detail | string | Handoff, outcome label and explanatory evidence. |
projectId / useCaseId / source | string | Lesson identifiers; source is always Scripted lesson. The browser keeps up to 80 events. |
studio.triggerInputs in browser state
Source:lib/lab.ts · lib/studio.ts| Field | Type / rule | Meaning |
|---|---|---|
clock | number 0–100,000 | Simulated hours; time condition is due at 24. |
threshold | number 0–100 | Sample score; condition is met at 80. |
eligible / signal / duplicate | boolean | Business eligibility, lesson signal and duplicate replay condition. |
approved | boolean | null | Trigger-specific learner approval. |
dependency | enum | pending, complete or failed upstream task. |
localStorage: agent-lab-framework:<projectId> → report; no report table
Source:lib/framework.ts · app/api/repo-inspect/route.ts| Field | Type / rule | Meaning |
|---|---|---|
repo | string | Repository URL, local sample label, or saved baseline identity. |
revision | string | Git commit SHA for public inspection; local samples are explicitly unverified. |
inspectedAt | ISO date-time string | When this report was generated, not the repository’s last modification date. |
files / totalFiles | string[] / number | Sampled paths and listed file count. Truncated GitHub trees make totalFiles a lower bound. |
partial | boolean | Signals limited coverage; current inspections are partial. |
findings | Finding[] | Static signals for Interface, Agent, Jev, Triggers, Memory and Harness controls. |
Finding.layer / status | string / enum | Layer name; Observed or Needs review. Observed means a pattern matched. |
Finding.evidence / next | string | Path, line and short excerpt; recommended next verification. |
limits | string[] | Coverage warnings and explicit audit limitations. |
SourceFile.path / content | string | Temporary raw input for inspection; raw file arrays are not saved in browser storage by this workflow. |
Brief inputs in browser; messages in component memory
Source:app/framework-lab.tsx · lib/framework.ts · app/use-coach.ts| Field | Type / rule | Meaning |
|---|---|---|
repo / goal / notes | string | Saved framework inputs. Goal ≤500 characters; notes ≤1,500; repo ≤200. |
report | RepoReport | null | Saved static inventory used to build the brief. |
Message.id / role / content | string / enum / string | Local conversation message; role is user or assistant. |
voice / scripted / streaming / stopped | optional boolean | Message origin and presentation state. |
tool | optional string | Displayed operation receipt. |
portable brief | Markdown string | Goal, review date, source revision, findings, notes and next-session instructions. Copying shares it only where you paste it. |
Current UI state; decision is not saved to a database
Source:app/api/jev/route.ts · app/framework-lab.tsx| Field | Type / rule | Meaning |
|---|---|---|
state | string 10–10,000 | Request task sent to TypeSafe. |
model | string | Provider-returned model identity. Default request model is jev-latest unless configured. |
answers.route.type / choice | choice / enum | Recommended route: code, jev, reasoning or review. |
confidence | number 0–1 | Provider confidence; not proof of correctness. |
probabilities | record of 4 numbers | One 0–1 value per route; sum must be within 0.02 of 1. |
latencyMs | number | Elapsed server time around the provider request. |
mode / executed | shadow / false | No recommended operation is executed. |
policy / thresholdNote | string | Review suggestion and explanation of the illustrative 0.85 threshold. |
usage | optional unknown | Provider payload; no normalized cost calculation is implemented. |
Cloudflare D1; operational counters, not project memory. Guest limits also apply per network and across the public site.
Source:db/schema.ts · lib/server.ts · lib/framework-server.ts| Field | Type / rule | Meaning |
|---|---|---|
id | TEXT primary key | Composite user + request kind + minute bucket; daily IDs include day and a UTC epoch-day bucket. |
count | INTEGER NOT NULL | Incremented request count, including attempts that may later fail. Chat: 15/minute, 200/day. Voice: 3/minute, 20/day. Repo and Jev: each 6/minute, 100/day. Guests additionally have daily network/site limits: chat 40/200, voice 6/20, repo and Jev each 20/100. |
Cloudflare D1; server usage receipts
Source:db/schema.ts · app/api/live-session/route.ts · app/api/live-usage/route.ts| Field | Type / rule | Meaning |
|---|---|---|
id | TEXT primary key | Voice session identifier. |
user_id | TEXT NOT NULL | Authenticated workspace user; usage updates require the same user. |
created_at | INTEGER NOT NULL | Creation timestamp in Unix milliseconds. |
closed_at | nullable INTEGER | Last close-report timestamp in Unix milliseconds. |
usage | nullable TEXT | Serialized JSON receipt; client close reports are labeled client_session_closed and are not billing proof. |
finalized | INTEGER NOT NULL, default 0 | 0 = open/unfinalized; 1 = final. Finalized rows are not updated by the usage endpoint. |
POST endpoints require the same origin, a valid platform identity or signed public lesson session, and service storage. AI and voice also require OpenAI; live Jev requires TypeSafe. Errors return an error message with an HTTP status.
GET /api/ai-statusNo bodySets the signed guest session cookie when public lessons are enabled. Returns sessionReady, accessMode, configuration flags, model labels, missing connections; providerAccess remains unverified.
POST /api/repo-inspect{ repo }Pinned static RepoReport; public GitHub only. Up to 12 files, 10,000 characters per file and 60,000 characters total.
POST /api/jev{ state }Validated shadow recommendation; 12-second provider timeout; no execution.
POST /api/assistant{ context, messages, stream? }Coach response and bounded lesson tools; up to 24 messages of 4,000 characters each.
POST /api/live-session{ sdp, context }OpenAI WebRTC session negotiation; SDP starts with v=0 and is at most 64,000 characters.
POST /api/live-usage{ sessionId, finalized, usage? }{ saved } records whether an owned, unfinalized voice row changed.
Common errors: 400 invalid input · 401 session missing · 403 origin rejected · 413 input too large · 429 limit reached · 502 provider failure · 503 connection missing. Public inspection may return 422 when no readable source is found.