100 Commits
Author SHA1 Message Date
Mario Zechner 48dd1e2f0f feat(coding-agent): port the experimental client/server to pi-durable
Session workers now host a durable Harness over a per-session sqlite storage.
The server keeps each session in <sessionDir>/<id>/ with meta.json and
session.sqlite and never opens the storage itself. Workers hold retirement
while the Harness task graph has live tasks and resume interrupted work on
open.

Transcript serves the root conversation's durable view directly, Models
follows the conversation's agent document, and AgentController maps prompt,
steer, follow-up, queue cancellation, abort, and compaction onto the root
conversation, plus waitForPrompt. navigate, nextRun, and resume are dropped
(see experimental/services/README.md TODO). The durable TUI and the worker
share harness-setup.ts.

pi-server exports its own SessionMetadata and no longer depends on
pi-agent-core. Chord accepts readonly JSON types in service contracts without
walking them, which recursive JSON types like pi-ai's made too deep.
2026-10-01 14:45:01 +02:00
Mario Zechner 7fd478a2e8 feat(agent): remove the experimental harness from pi-agent-core
pi-agent-core now contains only Agent, the agent loop, the proxy stream, and
their types. Removed the harness, sessions and session storage, pico3, harness
tools, compaction, skills, prompt templates, telemetry schemas, search types,
and the uuidv7 and pi-telemetry re-exports, plus the ./node, ./harness/* and
./experimental/pico3 subpath exports. Durable sessions live in
@earendil-works/pi-durable.

Also removed packages/session-backends and the experimental mini and micro
coding-agent frontends, with their scripts and build configuration.
2026-10-01 14:45:01 +02:00
Mario Zechner e792ba131e fix(coding-agent): keep one copy of each rendered user message line
The user message's Markdown pads and colors its own background instead of
sitting in a Box that kept a second full-width copy of every line. The output
is identical.
2026-10-01 11:37:01 +02:00
Mario Zechner 54c19a2529 fix(tui): reduce memory retained per rendered message
Markdown holds its parsed tokens weakly: a token tree is about ten times its
source, and every transcript message keeps a Markdown component. The tokens
still survive bursts of re-renders such as theme previews. Markdown, Text, and
Box flatten their cached lines, which V8 otherwise keeps as trees of the
concatenated parts. A long assistant message keeps about a fifth of the heap.
2026-10-01 11:36:51 +02:00
Mario Zechner 70c036211d feat(coding-agent): show the durable TUI's task panel by default 2026-10-01 10:07:19 +02:00
Mario Zechner 5609b0d6c0 feat(coding-agent): experimental TUI coding agent on pi-durable
A small local agent in src/experimental/durable: pi's model runtime, settings,
system prompt, theme, and interactive components over a durable Harness with
SQLite storage. Streaming, tools, steer and follow-up, abort, model and
thinking selection, compaction, --continue with recovery of interrupted turns,
a subagent tool with /agents to switch to and talk to subagents, and a live
/tasks panel from the task graph view. The tsconfig path for
@earendil-works/pi-durable/* resolves subpaths to source.
2026-10-01 09:53:21 +02:00
Mario Zechner 49683a3647 feat(durable): lifecycle conformance and task graph view (Packages 22, 23)
Package 22: runtime.now() and report() throw after the invocation ended; a
migration-only commit is published; a failed Harness.open closes without the
caller's context and rethrows the open error; ConversationWatch alias. Tests
for close joining non-cooperative code, cancelled close, queued operations at
the seal, progress calls and viewers on a paused Harness, the Chord guide, and
the spec's usage examples.

Package 23: Harness.taskGraph() and watchTaskGraph() mount every live task with
its owner edge, committed status, flags, and owned conversations, advanced from
commit publications. Example 24 prints the checkout's tree.
2026-10-01 09:53:21 +02:00
Mario Zechner 5b5ccddfac docs(durable): settle lifecycle wording and specify the task graph view (Packages 22, 23)
Close ends states and watches at its seal, joins non-cooperative code, and a
cancelled close cancels only its wait. Conversation.abort() starts scheduling.
New section 9.5 specifies Harness.taskGraph() and watchTaskGraph(). The Chord
guide uses real imports and documents shutdown order.
2026-10-01 09:53:21 +02:00
Mario Zechner b56702ad34 feat(durable): extensions and per-conversation agents (Package 21)
- Registry of named extensions (tools, sections, hooks, wraps, tasks) with install/uninstall;
  defineExtension, defineTool, section, hook, wrapTool, wrapSection
- pi.agent document (model, thinking level, extensions, tools filter, instructions, cwd),
  configure(), Conversation.agent()/configure(), agent option on root/createConversation/fork,
  task-owned conversations copy their owner's agent
- Harness-wide HarnessSettings read at every use; env function built per use
- Hooks and the agent resolved per task phase; tool calls resolved with the tools filter applied
- ToolRegistration<TParameters, TDetails> types execute() args from parameters
- HarnessOptions.conversationCreated; Tx.submissionByRequest() and Tx.createSubmission()
- FileSystem.id; edit/write serialize per file system id and canonical path
- CodingTools extension (read, write, edit, bash)
- Examples 06-31 on the new API, README and CHANGELOG
2026-10-01 01:28:22 +02:00
Mario Zechner 4bae867759 docs(durable): specify extensions and per-conversation agents (Package 21)
Extensions installed by name, the rewindable pi.agent document with configure(),
Harness-wide live settings, env built per use, typed tool args with defineTool(),
HarnessOptions.conversationCreated, Tx submission methods, FileSystem.id for
edit/write serialization, and tool resolution with the tools filter applied.
2026-10-01 01:28:22 +02:00
Mario Zechner d4d74eb19b Merge PR #10232 follow-up a0feabda7 (already included in ed391c4f0) 2026-09-30 22:32:47 +02:00
Mario Zechner ed391c4f0a fix(durable): harden async SQLite adapter queue and close
- drop AsyncLocalStorage misuse guards from the Node adapter
- run calls immediately when the queue is idle; transactions publish their barrier before the callback starts
- SqliteStorage.close() waits for admitted multi-query reads and shares one close promise
2026-09-30 22:32:34 +02:00
Mario Zechner 8f89293a26 Merge PR #10232: feat(durable): make SQLite storage asynchronous 2026-09-30 21:36:10 +02:00
Mario Zechner ed0d6b91b6 feat(durable): compaction and overflow (Package 20)
Manual compact(), background and blocking threshold compaction, and overflow
compaction with one retry. Summaries are headed pi.compaction entries placed
through the inbox, or appended by a compaction the generation waits on; the
stale rule decides between concurrent summaries.
2026-09-30 18:23:25 +02:00
Mario Zechner b72cf98ec7 docs(durable): specify compaction and overflow (Package 20) 2026-09-30 18:23:25 +02:00
Mario Zechner 37c9d0d200 fix(durable): harden the persistent subagent example
The subagent tool no longer offers wait, is not rerun after a crash (a repeated stop could stop newer work), reports each answer once even when several messages end in it, checks registry names as own properties, and its scenes cannot hang polling.
2026-09-30 14:01:47 +02:00
Mario Zechner 03180653c6 feat(durable): structured concurrency: task ownership, waiting, completing holds, bottom-up abort (Package 19)
Tasks name their owner (conversation or task); a task waits on other tasks with a waiting state (failFast or allSettled) and runtime.outcomes(); a task that finishes while owned work is live holds completing until it drains; abort handlers run bottom-up; only live owners cascade. The generation owns its tool tasks and waits for them in a tools phase, replacing pi.post-tools and after. Adds Conversation.abort({ background: true }), example 24 (checkout with payments), and reworks example 23 into persistent subagents.
2026-09-30 13:50:29 +02:00
Mario Zechner 96377f5c2a docs(durable): specify structured concurrency (Package 19) 2026-09-30 13:50:29 +02:00
Mario Zechner 1b347794e2 fix(durable): cover ownership cancellation races (Package 18) 2026-09-29 22:47:17 +02:00
Mario Zechner 2532a0bef7 feat(durable): conversation abort, ownership cascades, and subagent handles (Package 18) 2026-09-29 22:30:50 +02:00
Mario Zechner 9f1013506f docs(durable): specify ownership and subagents (Package 18) 2026-09-29 22:30:50 +02:00
Mario Zechner c4f5ef9451 docs(durable): rename collapse to compaction 2026-09-29 21:38:50 +02:00
Mario Zechner e5960c483f docs(durable): rewrite README as an experimental usage guide 2026-09-29 21:31:16 +02:00
Mario Zechner dc58677e6b docs(durable): move unreleased changelog entries out of the 0.99.0 section 2026-09-29 21:25:24 +02:00
Mario Zechner 47f65f1a3a feat(durable): inbox, reset, usage, conversation view, and experimental events (Package 17) 2026-09-29 21:24:32 +02:00
Mario Zechner 749e45ae69 docs(durable): specify live UI and product state (Package 17) 2026-09-29 21:24:32 +02:00
Mario Zechner 445770e032 feat(durable): first coding-agent tool turn (Package 16)
Generation offers active registered tools through positional system entries and
hands a tool-calling answer to parallel or sequential pi.tool tasks and a
pi.post-tools task that applies addTools/terminate and continues the run. Tool
tasks validate, run beforeTool/afterTool, record intent with the replay policy,
publish bounded, sanitized, adaptively throttled progress in pi.live.tools, and
write results with a rendered diagnostics block. Hook dispatch with conversation
and subtree scopes, prepareArguments, HarnessOptions.env, and read/bash/edit/write
tools in pi-durable/tools. The env shell now streams raw output and spills past
thresholds; its bounded capture and publisher are removed.
2026-09-29 21:24:32 +02:00
Mario Zechner ba7d5fbedb feat(ai,durable): add lightweight pi-ai/models entry and avoid TypeBox in durable
Durable generation imports retry helpers from pi-ai/utils/retry; examples use
pi-ai/models and pi-ai/providers/faux. Entry graph budgets and an import
footprint test guard the models entry.
2026-09-29 21:24:17 +02:00
Mario Zechner 0a7a4eca68 docs(durable): specify first tool turn (Package 16) 2026-09-29 21:24:04 +02:00
Mario Zechner 837d8a16bd feat(durable): first runnable chat turn (Package 15)
Submissions with request-ID deduplication and handles, the pi.live run
control and presentation document, the built-in pi.generation task
(system prompt preparation, streamed durable partials, retries, deferred
polling, abort), typed entry tokens, stream options and retry policy,
TaskRuntime reads, Tx.settleSubmission, registry conversation setups,
Storage.scanSubmissions, Harness.inspect, and byTaskId attribution.
Waiting calls enable scheduling. The scratch tour is split into
test/examples.
2026-09-29 14:08:28 +02:00
Mario Zechner 034be02d21 docs(durable): specify first chat turn (Package 15)
pi.live turn control and generation presentation, built-in entry kinds,
pi.generation checkpoint and phases, typed entry tokens, built-in tasks in
the registry, TaskRuntime reads, stream options and retry policy config,
Harness hook for scheduler-written outcomes, and createConversation without
input.
2026-09-29 10:05:44 +02:00
Mario Zechner cb7969d212 feat(durable): add durable task runtime
Adds defineTask, registry-resolved phase handlers, and a scheduler that
decides every task transition in one callback on the Session line:
reservation with migration, dependencies, precedence rules in a step
before each phase, handover to replaced definitions, direct-task abort
(mark, signal, join, fresh abort invocation), orphaning of blocked tasks,
open reconciliation, and close that joins invocations without writing
outcomes. runtime.commit() callbacks return the typed next state; Tx no
longer exposes setTask. Adds Harness.resume, getTask, waitForTask,
abortTask, and task-aware waitForIdle; RegistryReader.subscribe wakes
the scheduler.
2026-09-28 23:55:24 +02:00
Mario Zechner 3883fcb1f3 feat(durable): add openable Harness with registry and conversation config
Implements Pico5 Package 13: Harness.open over a Session with an application-owned
registry (tools, tool wrappers, hooks, tasks, system prompt sections; batched
publication, stable keyed order), lazy root creation with init, atomic
create/fork with init, conversation-bound commits, fork-aware entries, model
context derivation, and the built-in ConversationConfig document.

Fixes cached documents skipping migration when accessed with another definition
version. Rewrites the Pico5 spec and handoff to the registry/system-prompt
design and removes the superseded live-registries proposal.
2026-09-28 21:57:41 +02:00
Mario Zechner 11894012dd feat(durable): expose deltas since base to checkpoint predicates
Storage reports replayed deltas after the selected base; Session tracks the
count across adopted writes so checkpoint predicates can bound replay.
Also adds internal reserved-root creation and conversation-bound commit
defaults for the upcoming Harness.
2026-09-28 17:21:20 +02:00
Mario Zechner cd5ff11259 docs: reorder durable harness milestones 2026-09-28 16:47:23 +02:00
Mario Zechner 35180b9df8 feat(durable): add document states and buffered watches 2026-09-28 16:36:31 +02:00
Mario Zechner d6af72e185 docs(durable): clarify scratch examples 2026-09-25 18:05:22 +02:00
Mario Zechner 04b5bad666 feat(durable): add typed IDs and explicit ownership 2026-09-25 17:58:29 +02:00
Mario Zechner 507d7649e9 feat(durable): add conversation document forks 2026-09-25 16:17:53 +02:00
Mario Zechner 5fd446ca18 feat(durable): optimize document replay 2026-09-25 00:09:50 +02:00
Mario Zechner 9e70c3d505 feat(chord): optimize immutable batch application 2026-09-25 00:09:50 +02:00
Mario Zechner 5d4de953ce feat(durable): add checkpoints and document migrations 2026-09-24 23:09:15 +02:00
Mario Zechner 19a0361be8 feat(durable): add transactional sessions and documents
Add typed document definitions, atomic Session transactions, complete commit publication, task/document lifecycle handling, and paginated Tx scans. Share Chord's strict JSON copier across draft placements and durable ownership boundaries.
2026-09-24 22:24:04 +02:00
Mario Zechner 6966636dbe fix(chord): allow promise probes on settled drafts 2026-09-24 19:33:02 +02:00
Mario Zechner d5cba1d97c feat(chord): make immutable delta tracker canonical
Replace the alternate tracker implementations with the optimized immutable overlay, validate draft placements as strict JSON, and document the ownership contract. Consolidate tracker tests and benchmarks around the canonical implementation.
2026-09-24 15:07:12 +02:00
Mario Zechner cbe7cf00be docs(durable): move Pico5 strict-JSON checks to roots and Chord placements 2026-09-24 14:11:10 +02:00
Mario Zechner 481c7232f1 docs(durable): align Pico5 with canonical immutable tracker
Name the Astra-immutable-optimized Chord Delta tracker as the Packages 6-7
prerequisite, include the minimal generic Tx table surface in that
milestone, and revoke drafts at callback settlement. Drop the Chord
prerequisite from Package 11 because the existing replicated-state source
contract already matches. Specify that tool stream() never spills; tools
spill through their execution environment.
2026-09-24 13:50:10 +02:00
Mario Zechner 601437d5a7 fix(durable): test execution environment and fix output truncation metadata
Port and extend the agent environment tests for NodeExecutionEnv, output
capture, adaptive publishing, and truncation, including exact-byte
truncation, flushing, line-reader cancellation, spill backpressure, and
Buffer-free UTF-8 counting.

Fix truncation reporting when bytes and lines are both exceeded, when only
bytes are exceeded at the line cap, and when small limits trim multi-byte
edge characters. Report the full size of oversized newline-terminated tail
lines. Resolve durable test imports from source so tests run unbuilt.

Set Pico tool output defaults to 50 KiB and 2,000 lines.
2026-09-24 13:34:46 +02:00
Mario Zechner 7c696c00f3 docs: revise Pico5 immutable revision design 2026-09-24 11:33:45 +02:00
Mario Zechner b313731b80 feat: add JSONL sidecar reclamation 2026-09-23 09:54:05 +02:00
Mario Zechner 4bc1a2fe53 feat(chord): add optimized delta engine prototypes 2026-09-23 02:23:16 +02:00
Mario Zechner 9a139c62bf feat(chord): consolidate immutable delta tracking 2026-09-23 02:22:52 +02:00
Mario Zechner 898ab80405 feat: add durable JSONL storage backend 2026-09-23 01:33:31 +02:00
Mario Zechner 9672462143 docs: refine Pico5 JSONL publication design 2026-09-23 00:26:05 +02:00
Mario Zechner a32782520f docs: propose Pico5 live extension registries 2026-09-22 23:46:19 +02:00
Mario Zechner 81274f0e18 fix: verify durable browser-safe exports 2026-09-22 17:56:51 +02:00
Mario Zechner 2c2cd636f3 Merge remote-tracking branch 'origin/main' into durable-push-5901c9b9e 2026-09-22 17:47:53 +02:00
Mario Zechner 5901c9b9e5 feat: add durable SQLite storage backend
Add the portable SQLite storage core, Node adapter, versioned migrations, conformance coverage, and storage benchmarks.
2026-09-22 17:46:42 +02:00
Mario Zechner d201760ffe Merge remote-tracking branch 'origin/main' 2026-09-22 13:56:53 +02:00
Mario Zechner 8158b03213 feat(durable): add versioned document storage
Replace persisted inputs with strict input and passive-write submissions. Add atomic document bases, deltas, historical reads, reincarnation, reclamation, and indexed memory queries.
2026-09-22 13:54:50 +02:00
Mario Zechner 466db0fecd feat: add canonical session context boundaries
Make SessionManager projections authoritative for provider requests, add append-only context edits and actionable turn boundaries, and preserve existing queue scheduling during continuation and recovery.
2026-09-21 16:59:20 +02:00
Mario Zechner 10d1ad621f feat: add transactional replicated state 2026-09-21 16:07:59 +02:00
Mario Zechner 36b60d2e89 fix: clean up delta test lint diagnostics 2026-09-19 00:26:08 +02:00
Mario Zechner 58541ee721 fix: reduce delta proxy retention and compact cloned objects
Keep clone and GC regressions plus a standalone traversal benchmark. Archive the discarded graph experiment and baseline comparisons in durable docs, including the remaining transient-memory and traversal-speed costs.
2026-09-19 00:25:44 +02:00
Mario Zechner e80cf14011 docs(durable): simplify document runtime contracts 2026-09-19 00:20:08 +02:00
Mario Zechner 734ab3434f Merge remote-tracking branch 'origin/main' into HEAD 2026-09-18 22:18:01 +02:00
Mario Zechner 0db5659249 fix(durable): index memory storage queries 2026-09-18 22:17:36 +02:00
Mario Zechner a16ccd9be8 feat(durable): refine record and query contracts 2026-09-18 21:01:46 +02:00
Mario Zechner b5ef419d5b docs(agent): restore non-Pico5 documentation 2026-09-18 13:48:19 +02:00
Mario Zechner cf33309117 Merge remote-tracking branch 'origin/main' 2026-09-18 13:39:36 +02:00
Mario Zechner 0801601621 feat(durable): move Pico into dedicated package 2026-09-18 13:39:09 +02:00
Mario Zechner eed5263cdd Merge remote-tracking branch 'origin/main' into HEAD 2026-09-18 12:33:14 +02:00
Mario Zechner cf8d5fac30 feat(agent): add Pico storage foundation 2026-09-18 12:32:00 +02:00
Mario Zechner 2c995acf44 feat(chord): replace delta tracker with operation log 2026-09-17 16:36:37 +02:00
Mario Zechner 7e19507681 feat(coding-agent): add experimental micro agent 2026-09-17 16:33:03 +02:00
Mario Zechner 0e19ac1161 Merge remote-tracking branch 'origin/main' into pico 2026-09-17 16:31:25 +02:00
Mario Zechner 729d5cb74d docs(agent): finalize Pico5 specification set 2026-09-17 14:57:03 +02:00
Mario Zechner 2b04ce27fb docs(agent): refine Pico5 plugin state API 2026-09-17 11:24:54 +02:00
Mario Zechner fde6d778f8 fix(coding-agent): toggle summary entries on click 2026-09-16 18:08:06 +02:00
Mario Zechner 01528e2094 Merge remote-tracking branch 'origin/main' into pico 2026-09-16 17:58:54 +02:00
Mario Zechner b02eef4186 docs(agent): specify Pico5 harness API 2026-09-15 19:27:23 +02:00
Mario Zechner c8e4a5a552 docs(agent): finalize Pico5 architecture and presentation 2026-09-15 17:36:13 +02:00
Mario Zechner ea7f84678c Merge remote-tracking branch 'origin/main' into pico 2026-09-15 17:17:35 +02:00
Mario Zechner 56cd5989ea docs(agent): replace obsolete Pico prototypes with Pico5 design 2026-09-15 11:27:53 +02:00
Mario Zechner 850f83794d Merge remote-tracking branch 'origin/main' into pico 2026-09-14 11:17:49 +02:00
Mario Zechner 46b66c59af feat(agent): add hardened pico3 kernel 2026-09-14 11:17:04 +02:00
Mario Zechner 9b2aff2c5b docs(agent): pico3: forbid AsyncLocalStorage; nested-line detection via Chord context key 2026-09-13 23:02:38 +02:00
Mario Zechner 09b031600d docs(agent): pico3 review decisions: revision, visibility, memos, waiting, reload
- Envelope carries a contiguous per-watch revision; storage Seq stays internal;
  Chord bridge publishes off the line through a bounded ordered adapter
- Namespaces reach the view only through a declared view projection; memos and
  slot working state are never in the view
- memoOnce uses property presence; memos are coordination/evidence, not
  exactly-once; idempotency key before the effect
- Hooks bound to their namespace token; BeforeToolApi.waiting(ctx) is async;
  memo keys are (task, namespace, name)
- Reload: quiescent hold/reload/release, otherwise suspend/reopen; no handler
  withdrawal machinery in v1; Namespace.unregister
- pi.* entry names reject except pi.notice; config reset is an operation;
  generation failures run the final boundary and start successors
2026-09-13 22:49:14 +02:00
Mario Zechner fd3b009d9f docs(agent): add pico3 view/events, plugins and hardening handoff
Canonical pico3 material under packages/agent/docs/pico/v3/:
- hardening-handoff.md: V3 hardening handoff with supersession table
- view-and-events.md: single view document, ops by path, named events,
  commit-by-commit mapping, Codex mapping, watchers and late joiners
- plugins.md: harness registration surface, durable primitives, extension
  points with examples, reload contract, Chord facet layer
- harness-v3.zip: baseline sketch backup (sha256 1c69c5c5...fbe7)
2026-09-13 22:38:07 +02:00
Mario Zechner a9930d2857 docs(agent): correct pico v2 foundation contracts 2026-09-13 04:01:44 +02:00
Mario Zechner 51f3090790 feat(agent): align pico foundation with v2 contract 2026-09-13 04:00:27 +02:00
Mario Zechner 99a3948c4c docs(agent): define pico v2 kernel contract 2026-09-13 02:20:26 +02:00
Mario Zechner df484f2775 feat(agent): add pico memory storage foundation 2026-09-12 22:31:41 +02:00
Mario Zechner 1915b35a9b feat(agent): refine pico core task capabilities 2026-09-12 22:31:16 +02:00
Mario Zechner d11c4b7281 docs(agent): simplify pico scheduling and core task model 2026-09-12 22:31:03 +02:00
Mario Zechner 7a2647f32a docs(agent): define pico state tasks and tool boundaries 2026-09-12 01:20:49 +02:00
Mario Zechner f467cf7068 feat(agent): add pico compile-time foundation 2026-09-12 00:02:58 +02:00
Mario Zechner 4819cc877e docs(agent): add approved pico implementation handoff 2026-09-11 21:49:53 +02:00
Mario Zechner f3c672245d docs(agent): require typed status payloads for pico task writes 2026-09-11 12:57:47 +02:00
Mario Zechner 7b4cfd6eb0 docs(agent): define pico system sections and mutable registries 2026-09-11 11:49:58 +02:00