Documentation
¶
Overview ¶
Package seniordev is senior-dev: an autonomous coding agent codeaf carries and runs, and nothing else can. It takes one brief, works in the folder it is handed — on the branch codeaf cut for it there when the folder is a git repository (internal/session's programfolder.go) — under a model it reaches only through codeaf, submits a frozen candidate, checks it with the project's own build and tests, and ends with one record that keeps what its model claimed apart from what it saw (internal/seniordev/app; its own account of the run is ARCHITECTURE.md in the repository it came from, swe-pro-go at the tag codeaf-absorb).
IT HAS NO ENTRY POINT OF ITS OWN. What codeaf needs of it is a delegate.Delegate value, and its one command's body takes a delegate.Host, which only codeaf makes: `/senior-dev <brief>` in the chat, and `codeaf senior-dev <brief>` at a shell. There is no binary, no key it reads and no stdout it writes to but the host's records.
ON WINDOWS IT IS ABSENT. Its engine leans on process groups, file locks and a bash shell it has never had a Windows form of, so every runnable file under this tree carries a !windows constraint and the build's list carries nothing there (internal/delegate/builtin/carried_windows.go). The guide lives outside this Unix-only tree so the prefix gate can weigh it anywhere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Program = delegate.Delegate{ Name: "senior-dev", Summary: "an autonomous agent for one large, well-specified code change", Guide: programguide.SeniorDev, Lands: delegate.LandsTree, PlainFolder: []string{"--in-place"}, Notes: ".senior-dev", Listens: true, CrewFlags: crewFlags, StageWords: stageWords, Present: presentActions, Default: "run", Page: "senior-dev", Commands: []delegate.Command{runCommand}, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
This file is where the run's records go: the stage and step records the run reports to codeaf, and the run's own log of every record and bus payload for the tests that read one.
|
This file is where the run's records go: the stage and step records the run reports to codeaf, and the run's own log of every record and bus payload for the tests that read one. |
|
Package baked embeds the agent document the run executes.
|
Package baked embeds the agent document the run executes. |
|
Package bus is the in-process event bus.
|
Package bus is the in-process event bus. |
|
Package config is the configuration layer: project config files, the SENIOR_DEV_* environment surface and their merge.
|
Package config is the configuration layer: project config files, the SENIOR_DEV_* environment surface and their merge. |
|
Application filesystem.
|
Application filesystem. |
|
engine
|
|
|
calc
Package calc holds the pure token and cost arithmetic that runs between an OpenRouter response and a persisted assistant message: it normalises the provider usage block, prices a call from the model catalog, and derives the compaction budget and its watermarks from the model limits and the compaction config.
|
Package calc holds the pure token and cost arithmetic that runs between an OpenRouter response and a persisted assistant message: it normalises the provider usage block, prices a call from the model catalog, and derives the compaction budget and its watermarks from the model limits and the compaction config. |
|
msgmodel
Cursor encoding: a pagination cursor is `{id, time}` encoded as unpadded RFC 4648 URL-safe base64.
|
Cursor encoding: a pagination cursor is `{id, time}` encoded as unpadded RFC 4648 URL-safe base64. |
|
orclient
Package orclient is the OpenRouter streaming client: it assembles the chat-completions request body and headers, decodes the SSE response into stream parts (text, reasoning, tool calls, usage, finish), validates and repairs tool calls against the registered tool set, and registers the outcome of each call with the adaptive router.
|
Package orclient is the OpenRouter streaming client: it assembles the chat-completions request body and headers, decodes the SSE response into stream parts (text, reasoning, tool calls, usage, finish), validates and repairs tool calls against the registered tool set, and registers the outcome of each call with the adaptive router. |
|
retrysched
Package retrysched classifies the errors a model call can end in: the parsed Err shape, the timeout and context-overflow predicates the step loop consults, and the StatusError a failed provider response becomes.
|
Package retrysched classifies the errors a model call can end in: the parsed Err shape, the timeout and context-overflow predicates the step loop consults, and the StatusError a failed provider response becomes. |
|
steploop
Package steploop drives one turn of the agent.
|
Package steploop drives one turn of the agent. |
|
Formatter service
|
Formatter service |
|
Package id generates prefixed, time-ordered identifiers.
|
Package id generates prefixed, time-ordered identifiers. |
|
Package jsonutil wraps encoding/json for the two encodings senior-dev uses everywhere: compact and two-space indented, both without HTML escaping so that `<`, `>` and `&` inside model-visible text stay readable.
|
Package jsonutil wraps encoding/json for the two encodings senior-dev uses everywhere: compact and two-space indented, both without HTML escaping so that `<`, `>` and `&` inside model-visible text stay readable. |
|
Package modelsdev loads the models.dev provider/model catalog used to price and describe models.
|
Package modelsdev loads the models.dev provider/model catalog used to price and describe models. |
|
Package netpolicy makes senior-dev aware of runs where agent-initiated network access is unavailable, so agents stop wasting cycles attempting it.
|
Package netpolicy makes senior-dev aware of runs where agent-initiated network access is unavailable, so agents stop wasting cycles attempting it. |
|
Package patch implements the apply_patch format: the patch parser, fuzzy chunk matching, direct filesystem application, and detection of apply_patch invocations inside shell commands.
|
Package patch implements the apply_patch format: the patch parser, fuzzy chunk matching, direct filesystem application, and detection of apply_patch invocations inside shell commands. |
|
Package permission evaluates tool permission rules.
|
Package permission evaluates tool permission rules. |
|
Package project resolves the directory and project a tool call runs against.
|
Package project resolves the directory and project a tool call runs against. |
|
Question lifecycle service
|
Question lifecycle service |
|
router
|
|
|
adaptive
Package adaptive is the adaptive model router: it picks a model for each call from the configured pool for the caller's tier (high, low, frontier) by sampling a score from each candidate's recorded reliability, speed, price and current load, and it learns from every registered outcome (latency, throughput, rate limits and other failures, each with its own cooldown).
|
Package adaptive is the adaptive model router: it picks a model for each call from the configured pool for the caller's tier (high, low, frontier) by sampling a score from each candidate's recorded reliability, speed, price and current load, and it learns from every registered outcome (latency, throughput, rate limits and other failures, each with its own cooldown). |
|
state
Package state holds the process-wide adaptive router singleton and the route-event fan-out: every route decision is written to stderr as one `[router] <json>` NDJSON line and delivered to the process-local subscribers.
|
Package state holds the process-wide adaptive router singleton and the route-event fan-out: every route decision is written to stderr as one `[router] <json>` NDJSON line and delivered to the process-local subscribers. |
|
session
|
|
|
compaction
Controller adapts the compaction service to the step-loop task seam.
|
Controller adapts the compaction service to the step-loop task seam. |
|
evidenceharvest
Package evidenceharvest extracts the lines worth preserving from tool output before a compaction: command outcomes, exact error signatures and paths referenced across messages.
|
Package evidenceharvest extracts the lines worth preserving from tool output before a compaction: command outcomes, exact error signatures and paths referenced across messages. |
|
fullverification
Package fullverification discovers the project-wide build and test entrypoints that form the session-end machine verification floor.
|
Package fullverification discovers the project-wide build and test entrypoints that form the session-end machine verification floor. |
|
instruction
Package instruction discovers the project's instruction files (AGENTS.md and the files named in config, local or remote) and tracks which ones a session has already loaded, so each is injected into the prompt once.
|
Package instruction discovers the project's instruction files (AGENTS.md and the files named in config, local or remote) and tracks which ones a session has already loaded, so each is injected into the prompt once. |
|
llmcall
Package llmcall resolves adaptive-router choices and assembles one OpenRouter call.
|
Package llmcall resolves adaptive-router choices and assembles one OpenRouter call. |
|
loopguard
Package loopguard is a pure repetition and budget guard for agent action loops: it stops a run that repeats the same action, cycles through a short sequence of actions, or exceeds a cost or action budget, and warns once before a budget runs out.
|
Package loopguard is a pure repetition and budget guard for agent action loops: it stops a run that repeats the same action, cycles through a short sequence of actions, or exceeds a cost or action budget, and warns once before a budget runs out. |
|
outputoffload
Package outputoffload keeps large tool outputs out of the context window: the full text is written to a file under .senior-dev/tool-output and the model sees a bounded extract (head, tail and diagnostic-looking lines) plus the path.
|
Package outputoffload keeps large tool outputs out of the context window: the full text is written to a file under .senior-dev/tool-output and the model sees a bounded extract (head, tail and diagnostic-looking lines) plus the path. |
|
overflow
Package overflow is the session-layer view of the compaction budget.
|
Package overflow is the session-layer view of the compaction budget. |
|
projectors
The SQLite cold-start retry policy.
|
The SQLite cold-start retry policy. |
|
runbudget
Package runbudget resolves the optional run-level cost and wall-clock budget from flags and environment and tracks spend against it.
|
Package runbudget resolves the optional run-level cost and wall-clock budget from flags and environment and tracks spend against it. |
|
sessioncore
Package sessioncore owns the durable session lifecycle: sessions, messages and parts are written to the flat JSON storage and every change is published on the bus.
|
Package sessioncore owns the durable session lifecycle: sessions, messages and parts are written to the flat JSON storage and every change is published on the bus. |
|
system
Package system builds the environment block of a turn's system prompt: the model in use, the working directory and the date.
|
Package system builds the environment block of a turn's system prompt: the model in use, the working directory and the date. |
|
Package storage is the flat-file JSON store.
|
Package storage is the flat-file JSON store. |
|
The apply_patch tool: a multi-file patch envelope (add, update, move, delete) validated up front and applied after one permission check that covers every file it touches.
|
The apply_patch tool: a multi-file patch envelope (add, update, move, delete) validated up front and applied after one permission check that covers every file it touches. |
|
Error formatting
|
Error formatting |