Repository navigation
feat(runtime): project committed agent events as graph records - #1442
Conversation
|
After thinking through the stream-graph boundary more carefully, I think three changes are needed before merging. The first two are blockers. [P1] Keep the stable source ordering; do not turn its snapshot rank into record timeThe projection already has a viable deterministic comparator for a single-host runtime. The problem is assigning For example, the first read may contain only On the current single-machine runtime, the simplest honest model is to keep the immutable absolute Please add an incremental regression test: project A, then project A+B where B has an earlier timestamp, assert A is byte-for-byte unchanged, and verify replay/dedup across observations does not conflict. [P1] Do not derive graph-level
|
|
The three issues from my previous review are addressed correctly: records now keep immutable event time plus a stable source order key, supervisor attention no longer mutates graph lifecycle, and Session reads enforce the session-inline boundary. The new regression coverage looks good. One replay identity blocker remains: [P1] Preserve the one-to-one Session ↔ operator binding across merged observations
Two independently valid observations of the same Please maintain a reverse Once this is fixed, I do not see another merge blocker. |
Summary
This is the first implementation slice of #1341.
AgentRunas an activation.RuntimeEventinto one reference-only graph record with a stable record ID, immutableeventTime, a deterministic sourceorderKey, activation-local predecessor lineage, and bounded semantic facets.partial: trueevent from graph input. The source ordinal counts committed events only, so legacy partial-row retention cannot renumber committed facts.running; only terminal RuntimeEvents derivecompleted/failed/aborted/cancelled.Authority and supervision boundary
This PR deliberately keeps the graph read-only.
The original
RuntimeEventremains authoritative. Graph records and supervisor meta-records contain source identity and lifecycle metadata but do not copy message text, tool arguments/results, or other large payloads. The supervisor projection reuses the same graphrecordIdand RuntimeEvent source reference, so it is a routing/read projection rather than a second fact.The main-agent supervisor is structurally present beside the graph and observes every record without becoming a serial data-path gate. Attention signals identify facts that require semantic supervision; later auditable scheduler control records will carry the resulting intervention.
The adapter fails closed when immutable event reads are unavailable, identities are ambiguous, records conflict, source ordering is invalid, or an activation contains committed facts after its terminal record.
Deliberate non-goals
completedpredicate. Observed child terminals cannot prove that topology and admission are closed; that requires a later explicit closing protocol.agent_spawn/agent_swarmbehavior.This addresses the first architectural tensions raised on #1341: projection remains honest while it is read-only, downstream graph inputs are committed facts only, records remain stable as concurrent observations arrive, and the always-on supervisor is visible without importing human-interaction wait states into graph lifecycle.
Validation
npm run typecheck/usr/localexecutable-root ordering assertionrgunable to load PCRE2 inside the operation-scoped Seatbelt sandboxgit diff --checkRefs #1341
中文说明
这是 #1341 的第一个实现切片。
AgentRun投影为一次 activation。RuntimeEvent转换为一条只保存引用的 graph record,包含稳定 record ID、不可变eventTime、确定性 sourceorderKey、activation 内 predecessor lineage,以及有界语义 facets。partial: true事件都不会进入 graph input;source ordinal 只计算 committed events,历史 partial row 是否保留不会导致 committed facts 重编号。running;只有 terminal RuntimeEvent 才产生completed/failed/aborted/cancelled。本 PR 刻意保持 graph 只读。原始
RuntimeEvent仍是权威事实;graph record 与 supervisor meta-record 不复制消息正文、工具参数/结果或大块 payload。Supervisor projection 复用同一个 graphrecordId与 RuntimeEvent source reference,因此它是 routing/read projection,而不是第二套事实。主 Agent supervisor 在结构上始终位于 graph 旁边,观察每条 record,但不会成为串行数据路径门禁。Attention signal 标记需要语义监督的事实;后续可审计 scheduler control record 再承载 supervisor 的干预结果。
本切片仍不执行 graph,不修改 topology,不做 admission/cancel/retry,不引入 resource scheduler,也暂不建立 supervisor control-record authority 或 graph-wide
completed协议。