Docs & rules

earendil-works/piGitHub

This is a public, read-only report. Striff reads this repository's docs, turns each sentence that makes a claim about the code into a rule, and checks the rule against the code on the default branch. How this works

main96abe9aLast read 8h ago

Is this yours? Install to manage it

Once installed, Striff checks every pull request.

Documents
Rules
106
106
5
5
28
28
38
36
3
13
11
9
2
2
2
2
2
2
1
1
4
4
10
10
18
18
43 docs
earendil-works/piOpen repository

earendil-works/pi — documented rules

106 of 106 rules, printed October 12, 2026.

The sentence in your docs
Read Oct 11
The mode can be set globally via toolExecution in the agent config, or per-tool via executionMode on AgentTool.
AgentTool has executionMode
HoldsPR #10067 · Sep 27
Read Oct 11
Agent.subscribe() listeners are awaited in registration order.
Agent has a subscribe method
HoldsPR #10067 · Sep 27
Read Oct 11
agent_end means no more loop events will be emitted, but await agent.waitForIdle() and await agent.prompt(...) only settle after awaited agent_end listeners finish.
2 rules from this sentence
Agent has a waitForIdle method
Holds
Agent has a prompt method
Holds
Read Oct 11
Access state via agent.state.
Agent has state
Holds
Read Oct 11
On a provider, getModels() returns chat models and the optional getAllModels() returns every type;
Provider has a getModels method
Holds
Read Oct 11
Provider login, ApiKeyAuth.check, ApiKeyAuth.resolve, and OAuthAuth.refresh implementations always receive a concrete signal and must honor it for blocking work.
2 rules from this sentence
ApiKeyAuth has check
checks “ApiKeyAuth.check”
Holds
ApiKeyAuth has resolve
checks “ApiKeyAuth.resolve”
Holds
Read Oct 11
Models.stream(), complete(), streamSimple(), and completeSimple() accept a Models-only transformHeaders option.
4 rules from this sentence
Models has a stream method
checks “Models.stream()”
Holds
Models has a complete method
checks “Models.stream(), complete(), streamSimple()”
Holds
Models has a streamSimple method
checks “Models.stream(), complete(), streamSimple()”
Holds
Models has a completeSimple method
checks “and completeSimple() accept a Models-only transformHeaders option.”
Holds
Read Oct 11
read(providerId), list() for non-secret { providerId, type } metadata, modify(providerId, fn) (the only write path — a serialized read-modify-write), and delete(providerId).
4 rules from this sentence
CredentialStore has a read method
checks “read(providerId)”
Holds
CredentialStore has a list method
checks “list()”
Holds
CredentialStore has a modify method
checks “modify(providerId, fn)”
Holds
CredentialStore has a delete method
checks “delete(providerId)”
Holds
Read Oct 11
They are typed ImageModel with type: "image" and are used through generateImages(), a one-shot API that waits for the provider response and returns the final AssistantImages result.
ImageModel has type
Holds
Read Oct 11
ClassifierOptions.temperature divides the answer logits by the given value before they are normalized;
ClassifierOptions has temperature
Holds
Read Oct 11
ClassifierContext.images holds image blocks ({ type: "image", data, mimeType }) judged together with the state.
ClassifierContext has images
Holds
Read Oct 11
Its read, write, and delete operations accept optional cancellation, and Models binds those waits to the provider refresh signal.
3 rules from this sentence
ModelsStore has a read method
Holds
ModelsStore has a write method
Holds
ModelsStore has a delete method
Holds
Read Oct 11
Handwritten Provider.refreshModels() implementations receive the read-only context.stored snapshot and publish through context.publish({ persist?, update? }).
Provider has a refreshModels method
Holds
Read Oct 11
ModelsStoreEntry.models contains models of every type.
ModelsStoreEntry has models
Holds
Read Oct 11
Context.systemPrompt and Context.tools are shorthand for a leading system message.
2 rules from this sentence
Context has systemPrompt
checks “Context.systemPrompt”
Holds
Context has tools
checks “Context.tools”
Holds
Read Oct 11
The public entry points (Models.stream(), streamSimple(), complete(), completeSimple()) accept a Context and call normalizeContext() once;
Models depends on Context
Holds
Read Oct 11
Each of these providers carries an OAuthAuth on provider.auth.oauth with three operations: login(interaction) uses the provider-neutral AuthInteraction.prompt()/notify() protocol and returns a credential, refresh(credential, signal) refreshes expiring credentials when applicable, and toAuth(credential) derives request auth (GitHub Copilot's per-account base URL comes from here).
4 rules from this sentence
OAuthAuth has a login method
checks “login(interaction)”
Holds
OAuthAuth has a refresh method
checks “refresh(credential, signal)”
Holds
OAuthAuth has a toAuth method
checks “toAuth(credential)”
Holds
OAuthAuth depends on AuthInteraction
checks “login(interaction) uses the provider-neutral AuthInteraction.prompt()/notify() protocol”
Holds
Read Oct 11
An options interface extending StreamOptions (for example BedrockOptions)
2 rules from this sentence
BedrockOptions is a contract
Holds
BedrockOptions extends StreamOptions
Holds
Read Oct 11
Save CompactionEntry with summary and firstKeptEntryId
CompactionEntry has firstKeptEntryId
Holds
Read Oct 11
Extensions can store any JSON-serializable data in details.
CompactionEntry has details
Holds
Read Oct 11
Same as compaction, extensions can store custom data in details.
BranchSummaryEntry has details
Holds
Read Oct 11
Capability Observe or modify lifecycle behavior, Main API pi.on()
ExtensionAPI has an on method
Holds
Read Oct 11
Capability Add a model-callable operation, Main API pi.registerTool()
ExtensionAPI has a registerTool method
Holds
Read Oct 11
Capability Add a / command, Main API pi.registerCommand()
ExtensionAPI has a registerCommand method
Holds
Read Oct 11
Capability Add a shortcut or CLI flag, Main API pi.registerShortcut() or pi.registerFlag()
2 rules from this sentence
ExtensionAPI has a registerShortcut method
Holds
ExtensionAPI has a registerFlag method
Holds
Read Oct 11
Capability Send user or custom messages, Main API pi.sendUserMessage() or pi.sendMessage()
2 rules from this sentence
ExtensionAPI has a sendUserMessage method
Holds
ExtensionAPI has a sendMessage method
Holds
Read Oct 11
Capability Persist non-context session data, Main API pi.appendEntry()
ExtensionAPI has an appendEntry method
Holds
Read Oct 11
Capability Add a model provider, Main API pi.registerProvider()
ExtensionAPI has a registerProvider method
Holds
Read Oct 11
Capability Add an MCP server, Main API pi.registerMcpServer()
ExtensionAPI has a registerMcpServer method
Holds
Read Oct 11
Capability Route each request to a model, Main API pi.registerVirtualModel()
ExtensionAPI has a registerVirtualModel method
Holds
Read Oct 11
Capability Communicate with another extension, Main API pi.events
ExtensionAPI has events
Holds
Read Oct 11
ExtensionContext provides the working directory, mode, UI, session manager, model runtime, abort signal, context usage, and controls for compaction and shutdown.
ExtensionContext depends on ContextUsage
Holds
Read Oct 11
Read current state through session.messages, session.model, session.thinkingLevel, session.systemPrompt, and session.getActiveToolNames().
5 rules from this sentence
AgentSession has messages
checks “session.messages”
Holds
AgentSession has model
checks “session.model”
Holds
AgentSession has thinkingLevel
checks “session.thinkingLevel”
Holds
AgentSession has systemPrompt
checks “session.systemPrompt”
Holds
AgentSession has a getActiveToolNames method
checks “session.getActiveToolNames()”
Holds
Read Oct 11
session.dispose() aborts active work, invalidates extension contexts, disconnects from the agent, and removes event listeners.
AgentSession has a dispose method
Holds
Read Oct 11
AgentSessionRuntime adds newSession(), switchSession(), fork(), and importFromJsonl().
4 rules from this sentence
AgentSessionRuntime has a newSession method
checks “AgentSessionRuntime adds newSession(), switchSession(), fork()”
Holds
AgentSessionRuntime has a switchSession method
checks “AgentSessionRuntime adds newSession(), switchSession(), fork()”
Holds
AgentSessionRuntime has a fork method
checks “AgentSessionRuntime adds newSession(), switchSession(), fork()”
Holds
AgentSessionRuntime has an importFromJsonl method
Holds
Read Oct 11
The MCP extension connects its servers on session_start, so call session.bindExtensions().
AgentSession has a bindExtensions method
Holds
Read Oct 11
A message entry stores an AgentMessage.
SessionMessageEntry has message
Holds
Read Oct 11
kind is an arbitrary string identifying the operation;
UsageEntry has kind
Holds
Read Oct 11
firstKeptEntryId is required.
CompactionEntry has firstKeptEntryId
Holds
Read Oct 11
replacement: null omits the target from model context.
ContextEditEntry has replacement
Holds
Read Oct 11
parentId is the entry from which the new branch continues.
BranchSummaryEntry has parentId
Holds
Read Oct 11
fromId is the previous leaf whose abandoned path was summarized.
BranchSummaryEntry has fromId
Holds
Read Oct 11
Use customType to identify your extension's entries on reload.
CustomEntry has customType
Holds
Read Oct 11
Pi stores virtual model router state as custom entries with customType pi.virtual-model-state and data { provider, modelId, state }.
CustomEntry has data
Holds
Read Oct 11
Set label to undefined to clear a label.
LabelEntry has label
Holds
Read Oct 11
ServerServiceSource.connection and SessionServiceSource.attachment are implemented local control states.
2 rules from this sentence
ServerServiceSource has connection
checks “ServerServiceSource.connection”
Holds
SessionServiceSource has attachment
checks “SessionServiceSource.attachment”
Holds
Read Oct 11
Harness.open() opens a Session over a storage backend.
Harness depends on Session
Holds
Read Oct 11
The exception is a host RegistryReader whose snapshot() throws: the Harness cannot schedule without it, so it fails the Harness like a storage error.
RegistryReader has a snapshot method
Holds
Read Oct 11
Inject McpOAuthStateStore into McpOAuthProvider for durable credentials.
McpOAuthProvider depends on McpOAuthStateStore
Holds
Read Oct 11
RoutedServerServiceHost.attachClient() creates one connection-scoped server service endpoint with narrow attachment-management capabilities.
RoutedServerServiceHost has an attachClient method
Holds
Read Oct 11
RoutedSessionHandle.attachClient() returns a presentation-scoped Session capability.
RoutedSessionHandle has an attachClient method
Holds
Read Oct 11
SessionMetadata only requires an id;
SessionMetadata has id
Holds
Read Oct 11
Server composes transports through ServerListener;
Server depends on ServerListener
Holds
Read Oct 11
startSpan() owns settlement and keeps the span open until the callback's value or promise settles.
TelemetryContext has a startSpan method
HoldsPR #8158 · Sep 28
Read Oct 11
getSpans() returns detached snapshots in span-start order.
InMemoryTelemetryContext has a getSpans method
HoldsPR #8158 · Sep 28
Read Oct 11
@earendil-works/pi-ai accepts and propagates telemetryContext in provider request options but owns no telemetry schema;
ProviderRequestOptions has telemetryContext
Holds
Read Oct 11
Export TelemetryContext, Purpose Starts callback-managed child spans
TelemetryContext is exported
Holds
Read Oct 11
Export TelemetrySpan, Purpose Records attributes, events, and status also acts as a child context
TelemetrySpan is exported
Holds
Read Oct 11
Export SpanOptions, Purpose Span name and optional start attributes
SpanOptions is exported
Holds
Read Oct 11
Export SpanAttributes / AttributeValue, Purpose Open adapter-level attribute bag and supported values
SpanAttributes is exported
Holds
Read Oct 11
Export InMemoryTelemetryContext, Purpose Reference adapter with deterministic process-local recording
InMemoryTelemetryContext is exported
Holds
Read Oct 11
Export RecordedTelemetrySpan, Purpose Normalized captured span snapshot
RecordedTelemetrySpan is exported
Holds
Read Oct 11
Export RecordedTelemetryEvent, Purpose Normalized captured event snapshot
RecordedTelemetryEvent is exported
Holds
Read Oct 11
TUI is the shared interface for component management, focus, overlays, input, lifecycle, terminal queries, and rendering.
TUI is a contract
HoldsPR #8158 · Sep 28
Read Oct 11
TuiAltScreenOptions.searchMatchStyle and searchCurrentMatchStyle customize match highlighting, while searchNavigationButtonStyle styles each arrow button and receives its hover state.
3 rules from this sentence
TuiAltScreenOptions has searchMatchStyle
checks “TuiAltScreenOptions.searchMatchStyle”
Holds
TuiAltScreenOptions has searchCurrentMatchStyle
checks “TuiAltScreenOptions.searchMatchStyle and searchCurrentMatchStyle customize match highlighting,”
Holds
TuiAltScreenOptions has searchNavigationButtonStyle
Holds
Read Oct 11
TuiAltScreenOptions.scrollToEndIndicator renders a clickable label centered on the last row of a follow: "end" primary scroll view while it is scrolled away from the end;
TuiAltScreenOptions has scrollToEndIndicator
HoldsPR #8158 · Sep 28
Read Oct 11
Method render(width), Description Returns an array of strings, one per line Each line must not exceed width or the TUI will error Use truncateToWidth() or manual wrapping to ensure this
Component has a render method
Holds
Read Oct 11
Method handleInput?(data), Description Called when the component has focus and receives keyboard input The data string contains raw terminal input (may include ANSI escape sequences)
Component has a handleInput method
Holds
Read Oct 11
Method handleMouse?(event), Description Called by TuiAltScreen for normalized pointer input targeted at the component
Component has a handleMouse method
Holds
Read Oct 11
Method invalidate(), Description Required Clear any cached render state so the next render() starts from scratch Components without cached render state can use an empty implementation
Component has an invalidate method
Holds
Read Oct 11
The Editor and Input built-in components already implement this interface.
2 rules from this sentence
Editor implements Focusable
Holds
Input implements Focusable
Holds
Read Oct 11
Extends Loader with Escape key handling and an AbortSignal for cancelling async operations.
CancellableLoader extends Loader
Holds
Read Oct 11
signal: AbortSignal - Aborted when user presses Escape
CancellableLoader has signal
Holds
Read Oct 11
aborted: boolean - Whether the loader was aborted
CancellableLoader has aborted
Holds
Read Oct 11
onAbort?: () => void - Callback when user presses Escape
CancellableLoader has onAbort
Holds
Read Oct 11
The TUI works with any object implementing the Terminal interface:
2 rules from this sentence
Terminal is a contract
checks “implementing the Terminal interface”
Holds
TUI depends on Terminal
Holds
Read Oct 11
Built-in implementations: ProcessTerminal - Uses process.stdin/stdout
ProcessTerminal implements Terminal
Holds
106 rules from 12 docs

See these where the change is. The browser extension puts a pull request's doc findings, and a diagram of what it changed, on the GitHub page itself, so the code and what your docs say about it are side by side.