Skip to content

feat(agentic-kit): run log + pi extension kernel — six additive packages (roll-up of #1723–#1728) - #1729

Merged
pyramation merged 6 commits into
mainfrom
feat/agentic-kit-run-log
Aug 14, 2026
Merged

feat(agentic-kit): run log + pi extension kernel — six additive packages (roll-up of #1723–#1728)#1729
pyramation merged 6 commits into
mainfrom
feat/agentic-kit-run-log

Conversation

@pyramation

@pyramation pyramation commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Single merge point for the six additive packages from #1723#1728 (kept open for per-package review; this branch is exactly their six commits). Together they are the M0 kernel from the greenfield design: one pi agent loop, an append-only run log as the source of truth, and placement expressed as configuration.

agentic/run-log                 record types, projectors, store contracts, memory + file stores
agentic/pi-ext-run-log          mirrors pi session entries into the log, verbatim
agentic/pi-ext-metered-model    routes model calls through agentic-server (authoritative metering)
agentic/pi-ext-usage-report     self-reports usage to the gateway's /v1/usage (own-key lane)
agentic/pi-ext-gate             tool-call policy + remote approvals over a DB/API rendezvous
agentic/pi-embed                composes the above into one session
const embedded = await startRun({
  runId, pi, cwd: workspace,
  log: { store },                                                // transcript + resume are projections of this
  metering: { mode: 'gateway', gatewayUrl, identity, models },    // or { mode: 'self-report', … } locally
  gate: { policy, approvals },
  extensions: [createDbTools(host)]
});

Load-bearing properties, in one place:

  • pi entries are stored verbatim under a 4-field wrapper (runId, seq, recordedAt, piSessionVersion) — no re-encoding, so pi's own versioned session migrations keep working and a resumed session is a replay, not a translation.
  • Appends are idempotent by (runId, seq) and the mirror only advances its cursor after a successful append, retrying the whole batch — so a crashed or resumed run cannot lose or duplicate entries.
  • The two metering lanes are mutually exclusive by type. gateway is authoritative (the gateway meters what it proxies); self-report is the own-provider-key lane, documented as reconciliation/visibility rather than tamper-proof billing. Enabling both would double-count.
  • The gate defaults to ask, not to trust — an undeclared tool is not implicitly permitted — and an approval timeout denies.
  • No new transport. The stores are two interfaces (append, read by cursor); the wire stays the existing GraphQL API with agent_event rows as the rendezvous and the cursor read as the poll. No socket, no second envelope loop, no server.
  • Nothing reads process.env and nothing reads a file it was not handed. Endpoints, tokens, identity, model list, policy and stores are all required options, so configuration stays hoisted to the host (@agentic-kit/pi's resolved context locally, injected CONSTRUCTIVE_* vars in a job).

Additive: six new directories, plus the CI package matrix line and the lockfile importers. No existing package, function or UI changes; desktop is untouched. Every package carries README + logo, makage build, and its own jest suite (164 tests across the six); all of #1723#1728 are green.

Link to Devin session: https://app.devin.ai/sessions/450ce6d6659c47759c184ae6ec19a2a8
Requested by: @pyramation

A pi extension that drains pi's append-only session into an
@agentic-kit/run-log store — verbatim, in order, same code locally and in
the cloud (only runId and the store differ).

Draining is index-based because the session is append-only; the read
position is keyed to the session header id so a switch/fork re-mirrors and
the store's idempotency absorbs the duplicates. A drain advances only after
a successful append, and store failures are rethrown into pi's dispatch by
default rather than silently dropping entries.
@pyramation pyramation self-assigned this Aug 14, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation
pyramation merged commit e2ba522 into main Aug 14, 2026
37 checks passed
@pyramation
pyramation deleted the feat/agentic-kit-run-log branch August 14, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant