Skip to content

Commit 08bf09b

Browse files
eastriverleeclaude
andcommitted
docs: give every package a front door
Eight packages, no package documentation, so pkg.go.dev would have shown an adopter a list of symbols and nothing else. Each package now says what it is for and what assumption it was built under, which is the part a reader cannot recover by reading signatures. These are package documents, not comments in the code. The style rule holds: names still carry the meaning inside a function, and nothing was annotated line by line. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent f695211 commit 08bf09b

8 files changed

Lines changed: 94 additions & 0 deletions

File tree

agentcontract/doc.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Package agentcontract is the contract a host and a harness compile against.
2+
//
3+
// The port is one method:
4+
//
5+
// type Harness interface {
6+
// RunTurn(context.Context, AgentTurnRequest) (AgentTurnResult, error)
7+
// }
8+
//
9+
// It used to be nine. Routing, addressing, follow-up classification and one-shot
10+
// replies were verbs on the port until it became clear they are host policy
11+
// rather than harness behaviour, so a harness that implements only RunTurn is
12+
// complete.
13+
//
14+
// AgentTurnRequest is how a host tells the harness everything the harness
15+
// refuses to assume: who is asking, what identity the agent answers to, where
16+
// the workspace is, which instructions and skills apply, and what the company
17+
// is. AgentTurnResult carries the answer back with the task state it reached.
18+
package agentcontract

agentcontract/harnesstest/doc.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Package harnesstest is a harness that records what it was asked to do.
2+
//
3+
// It lets a host's tests assert on the turn request it built without running a
4+
// model.
5+
package harnesstest

doc.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Package bluecollar is an agent harness: the loop that takes a request,
2+
// decides what to do, calls tools, and answers.
3+
//
4+
// It is built for work nobody is watching. A request arrives from someone else,
5+
// the person who sent it goes back to their day, and the answer has to be right
6+
// without anyone checking. That assumption is why the loop carries an outcome
7+
// contract agreed before the work starts, a completion gate that will not accept
8+
// the model's own word that it is done, approval as a state a task can sit in
9+
// for days and resume from, a tier ladder that picks the model from the
10+
// difficulty, and failure text written for the person who asked.
11+
//
12+
// The harness owns no tools, no identity, and no storage. A host hands it a
13+
// tool set and a task store and calls RunTurn; every tool call executes back in
14+
// the host, as whoever asked for the work. See [agentcontract] for the port both
15+
// sides compile against.
16+
//
17+
// The harness has no identity or filesystem layout of its own either. The host
18+
// supplies AgentIdentity, the workspace paths, the instruction bundle and the
19+
// company context; given none of them, the agent is "the assistant" and knows
20+
// nothing about where it runs.
21+
package bluecollar

intake/doc.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Package intake decides what an inbound message means before anything runs.
2+
//
3+
// A turn router chooses whether a message becomes a task, a quick reply, or
4+
// nothing at all. A classifier answers the two questions a chat platform forces:
5+
// whether a message in a busy channel is addressed to the agent, and whether it
6+
// continues a task already running.
7+
//
8+
// These are host policy rather than harness behaviour — a host that answers its
9+
// own messenger may bring its own — which is why they live beside the loop
10+
// instead of on the harness port.
11+
package intake

model/doc.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Package model is the port a language model reaches the harness through.
2+
//
3+
// LanguageModelProvider is deliberately small: generate a response, or generate
4+
// one constrained to a schema. Anything satisfying it works, and the provider
5+
// may change between steps of a running turn — the tier ladder relies on that,
6+
// escalating a task from a cheap model to a strong one without restarting it.
7+
//
8+
// There is no provider implementation here. The host brings one.
9+
package model

taskstate/doc.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Package taskstate is the durable record of work.
2+
//
3+
// A TaskRun is one unit of work with one of nine statuses, and its event ledger
4+
// is the append-only sequence of everything that happened to it. Event names
5+
// follow a fixed grammar — tool.<name>.requested, tool.<name>.result,
6+
// approval.pending_call, approval.executed — so a reader can reconstruct a run
7+
// without access to any harness's internal types.
8+
//
9+
// The ledger is what makes a task survive its process. A run is resumed by
10+
// re-driving a turn from what the ledger says, never by attaching to a live one,
11+
// which is why a task can wait days for an approval and continue afterwards.
12+
package taskstate

toolcontract/doc.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Package toolcontract describes tools to a harness and carries their results
2+
// back.
3+
//
4+
// A ToolDescriptor says what a tool is called, what it accepts, and — through
5+
// ApprovalScope and SideEffectClass — what kind of effect running it has. Those
6+
// two fields are how a host decides which calls need a person's approval, so
7+
// that the decision comes from what a tool does rather than from what it is
8+
// named.
9+
//
10+
// ToolSet is the set of tools a particular requester may call this turn. The
11+
// harness chooses from it; the host executes.
12+
package toolcontract

turnstream/doc.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Package turnstream mirrors a turn as it happens, for a caller that wants to
2+
// watch rather than wait.
3+
//
4+
// It is a view, not a control surface: the turn runs the same whether or not
5+
// anyone is reading.
6+
package turnstream

0 commit comments

Comments
 (0)