Skip to content

feat(run-log): @agentic-kit/run-log — append-only agent run log, pi entries verbatim - #1723

Merged
pyramation merged 1 commit into
mainfrom
feat/agentic-run-log
Aug 14, 2026
Merged

feat(run-log): @agentic-kit/run-log — append-only agent run log, pi entries verbatim#1723
pyramation merged 1 commit into
mainfrom
feat/agentic-run-log

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

First package of the agent-kernel plan (planning#1655, #1657): the append-only run log that both placements (local pi, cloud pi job) write to and every surface reads from. Purely additive — no existing package touched, no new transport: the store is two interfaces, and the wire stays the GraphQL API / agent_event rows (durable Postgres impl lands later in constructive-db).

The load-bearing decision is no envelope re-encoding. pi entries are stored verbatim under a 4-field wrapper, so pi's own versioning/migrations keep working and a resumable session is just a projection:

{ runId, seq, recordedAt, piSessionVersion, entry /* untouched pi entry */ }

Everything else is a fold over RunEventRecord[]:

projector output
projectParts renderable transcript (text/thinking/tool/bash/custom/summary, unknown types preserved as unknown parts)
projectUsage totals + per-provider/model breakdown from assistant usage.cost (observed usage for reconciliation, not billing authority)
projectToolState tool lifecycle + pending approvals, where an approval is a pi custom message (constructive.approval.request/resolution) so it survives reconnects
projectSession pi session JSONL → resume locally or in a restarted job

Read side is the polling contract the long-running FBP job needs — cursor in, page out, with an optional injected wakeup so LISTEN/NOTIFY can be dropped in later without touching consumers:

for await (const batch of follow(store, runId, { after: cursorAfter(seq), waitForChange, signal })) 

Bundling boundary is enforced by a test: src/index.ts and everything it reaches import no Node built-ins (browser/renderer safe); FileRunLogStore lives in src/file-store.ts and is imported explicitly.

Malformed input throws rather than degrading — assertRunEventRecord / assertOrdered reject mixed runs, non-increasing seq, mixed piSessionVersion, and truncated JSONL lines.

60 jest tests; agentic/run-log added to the agentic CI batch.

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

@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

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