Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ use (
./labs/18-settle/settle
./labs/20-deltawire
./labs/21-interlock/interlock
./labs/22-yield/yield
./labs/21-interlock/integrations/pitot
)
71 changes: 71 additions & 0 deletions labs/22-yield/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Lab 22 — Yield

Programmable skills for coding agents. **Turn `SKILL.md` workflows into
resumable programs.**

> The skill yields the next typed operation. The coding agent performs it
> and resumes the skill.

A skill keeps its thin `SKILL.md` (so it works wherever skills work today)
and moves its control flow — order, branching, retries, approval, state,
completion — into a deterministic Go program. The model keeps reasoning,
exploration, editing, and judgment. No daemon, no new agent loop, no host
integration: the agent only runs a CLI and follows envelopes.

## Execution model

Deterministic re-execution (no resumable coroutines needed): on every
run/resume, `yskill` re-executes the skill program from the top, feeding
recorded responses back in order. At the first unanswered operation the
SDK emits a `yield.v1` request envelope and exits. A replayed step that
produces a different operation than the journal recorded is a divergence
and fails the run loudly — it never silently forks.

Two processes:

- **`yskill` (supervisor)** — owns the append-only run log
(`.yield/runs/<id>.jsonl`), sequence and digest binding, response
validation, and every refusal. `run_command` operations are executed by
yskill itself, so command results enter the log as observed fact rather
than the agent's transcription.
- **skill program (subprocess)** — an ordinary Go `main` using
`yield/sdk/yield`; every side effect crosses a yielded primitive
(`AskUser`, `AgentTask`, `RunCommand`, `Require`, `Complete`, plus the
`Blocked`/`Refused` terminals).

## Layout

```
yield/
├── cmd/yskill/ init · run · resume · inspect · replay · test
├── internal/protocol/ yield.v1 envelopes, digests, schema validation
├── internal/runlog/ append-only JSONL event log
├── internal/guard/ every refusal: stale/dup/wrong-run/schema/digest/unproven
├── internal/engine/ supervisor: subprocess execution, command evidence, terminals
├── sdk/yield/ the skill-program SDK (deterministic replay context)
├── examples/investigate the reference skill (bounded hypothesis loop)
└── docs/locus* certified lifecycle models + verdicts
```

## Try it

```
go build -o /tmp/yskill ./yield/cmd/yskill
/tmp/yskill test yield/examples/investigate # scripted fixture run to completion
/tmp/yskill run yield/examples/investigate # prints the first operation envelope
```

## Formal grounding

The run lifecycle was designed against Locus verdicts
(`yield/docs/locus-yield.md`): protocol integrity is supervisable
(controllable, no violations), every run reaches an honest terminal
(nonblocking — the `--accept-new-digest` migrate verb is load-bearing),
and portable mode is provably non-diagnosable for off-protocol agent
action — which is stated as a non-guarantee rather than papered over. A
correlated host adapter is the certified post-V1 answer to that gap.

Out of V1 (deliberately): prose-to-program compilation, a hosted runtime,
a workflow DSL, a marketplace, a multi-agent orchestrator, a security
sandbox, any canonical IR. Working name `Yield`/`yskill` pending a
collision scan before any public projection.
1 change: 1 addition & 0 deletions labs/22-yield/yield/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.yield/
Loading
Loading