You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Claude Code: official rolling documentation only; proprietary persistence internals remain unknown.
Material correction to the original Issue
The original wording overstates current preservation as “reliably persisted complete outputs.” At the fixed OpenPI revision, several “full” artifacts are exact only relative to an already bounded runtime value, not the backend/provider’s original output.
Direct Subagent
SubagentManager first slices a completed backend answer to 1,024 × 1,024 JavaScript code units:
Only that bounded snapshot.finalText later reaches projectResult(). The SHA-256 artifact is immutable and byte-exact for the manager snapshot, but cannot prove preservation of backend output beyond the manager cap.
persistWorkflowAgentResult() then uses encodeCompleteJson() and fails closed if the already-bounded result cannot fit its 2 MiB/depth/node/string budgets. Thus agent-results/agent-NNNN.json is complete-or-fail for the coordinator value, not for arbitrary child/provider output.
The separate result.json has weaker semantics. It uses safeStringify() and may contain normalized/truncated fields or an entire preview object when over budget. It is not a universal canonical result artifact.
Workflow resultRef values live in an in-memory Map and are valid only in the same run. Persisting the opaque string does not make it resolvable after restart. A run-relative artifact path is provenance, not an automatically authorized child-readable handle.
Direct-child CAS directories explicitly reject symlink components and use private modes. Workflow artifact files are written with 0600, but their recursively created directories do not establish a uniform explicit 0700 contract in this path. Documentation must describe owner-specific controls, not claim universal private artifact directories.
complete: canonical bytes are committed and match the declared owner value; this says nothing about bytes lost before that value was formed.
partial: a known prefix/tail/range exists and omissions are known.
uncertain: execution, side effects, terminal outcome or persistence cannot be proven.
unavailable: no recoverable artifact was published.
delivered: a transport completed; it does not imply any completeness state.
Publication rule: never emit a recovery reference before its target is readable. Spill failure, cap exhaustion, flush timeout, owner loss or missing data must never become empty success.
Identity, revision, liveness and authorization
If trace evidence eventually justifies #157’s thin contract, the smallest useful reference shape is approximately:
This is not a pre-approved API. Resolution remains delegated to the owner extension.
Required behavior:
constrain identifiers and resolve relative to the owner root;
validate containment and real paths;
reject traversal and symlink substitution;
bind Session/run/generation so stale references cannot resolve to replacement owners;
apply Pi Trust and parent/child tool authority independently of possession of the reference;
distinguish forbidden, missing, stale, expired, partial, unavailable and uncertain;
do not use absolute model-supplied paths as authority;
do not introduce bearer-like global references or a process-global registry.
Content digest proves byte identity, not who produced the bytes or whether they cover the original execution stream. Replay fingerprint proves eligibility for reuse, not artifact identity. Live process ID proves liveness, not durable content.
Child, fork, resume, compaction and replay
Direct child continuation uses the native child Pi Session, not its result artifact.
Workflow operator reuse is same-run and in-memory; persisted resultRef tokens do not restore the registry.
A fork or child gets only the history/resources/tools explicitly reconstructed for it; a reference cannot widen child authority.
Workflow replay identity remains separate from artifact identity.
A verified replay hit reuses a persisted result; a missing/malformed journal is a miss, not proof of prior failure.
Compaction summaries and bounded transcripts are derived context. They cannot establish that all execution evidence remains recoverable.
At a9e447a, rollout/thread storage is the primary durable execution-history source used for resume/fork reconstruction. Exec results retain truncation metadata such as original token count and omitted bytes, but the inspected path does not provide a universal stable spill artifact or range/search API for every omitted output.
Knowing that bytes were omitted is stronger than silent truncation, but it is not recovery.
Codex can also transform declared MCP file parameters into provider file IDs/download URLs. Those provider objects have a different authority, retention and identity plane from local execution artifacts.
Official rolling documentation establishes persisted/resumable Sessions, transcript export, tools, MCP resources, background work and subagents. It does not expose enough implementation detail to prove:
a universal canonical artifact store;
exact preservation after tool-output truncation;
provider-file ownership and retention;
a single range/search resource-reference contract;
internal semantic retrieval over execution evidence.
UI labels such as file, result, transcript or download are not sufficient evidence.
Hermes documents large-result spill paths and offset-based read_file recovery, and its SQLite/FTS search returns derived snippets/metadata. In the pinned checkout, imported spill modules were absent from the inspected source tree, so spill atomicity, TTL and all-path authorization must remain unknown rather than inferred from documentation.
Session FTS is an index projection. It does not make snippets canonical evidence.
Grok distinguishes authoritative updates.jsonl from a rebuildable chat-history cache. Background task/subagent records expose live task identity, output path, total bytes and truncation state; output can be fetched on demand, and ordinary files support ranged reads.
Its FTS and optional vector mechanisms are search/memory projections, not universal execution-artifact authority. A generic content-addressed result plane and delivery receipt were not established by the inspected fixed source.
Gemini can mask older tool output from model history while writing the prior content under project-temporary tool-output files and replacing it with size/line/path metadata. This is spill-plus-projection, not immutable content addressing.
Checkpoint files in the inspected path are direct writes rather than a proven transactional artifact set; invalid/missing checkpoint loading can fall back to empty history. Provider content parts remain distinct from local canonical evidence.
OpenCode persists tool calls/results as Session parts and carries truncation/output-path metadata for managed outputs. Attachments may become provider-shaped media/data parts. Compaction can clear old model-visible tool content while retaining Session metadata.
The supplied pinned checkout did not expose enough of the managed truncation implementation to establish exact storage limits, atomicity, cleanup or symlink behavior. No semantic execution-evidence index or universal artifact receipt was proven.
Bounded transcripts must not be vectorized and described as complete execution-evidence retrieval.
Index commit and canonical artifact commit require separate receipts; an index failure cannot retroactively make a durable artifact write fail, and an artifact write cannot be reported searchable before index confirmation.
Retention, deletion and privacy
Retention remains owner-specific. A thin reference may report owner policy and current liveness but must not add global garbage collection.
Documentation must distinguish:
immutable content identity from indefinite retention;
temporary spill lifetime from Session lifetime;
owner-lost artifacts from live handles;
deletion success from reference invalidation;
filesystem mode from per-artifact authorization;
local artifact bytes from provider-hosted file retention;
redaction/secret scanning from truncation.
Unknowns at the fixed revision include a uniform TTL, sensitivity classification, redaction ledger, universal artifact ACL, deletion reason/timestamp, crash durability via file/directory fsync, and cross-owner retention manifest.
Correct relationship to existing Issues
子代理超长结果:保留首尾、持久化完整 final artifact,并支持按需恢复 #64 closed the direct-child head/tail + CAS projection gap, but its “full” wording is bounded by the manager’s upstream 1 Mi-code-unit slice.
Index/search projections are never canonical and receive separate commit/availability receipts.
No global router, artifact store, vector DB, provider-file abstraction, model-facing recovery tool or second storage plane is added without independently measured need.
一句话结论
OMP 把 agent output、artifact、history、issue/PR、skill 等投影为 URI,并让通用
read/grep复用;OpenPI 已能落盘多类 Subagent、Workflow、Background Terminal 产物,但各 owner 的上游截断、完整性、引用格式和恢复生命周期不同。值得研究的是一个 薄的、Pi-native resource reference contract:统一“怎么引用、怎么证明 owner、怎么按需读取”,同时保留各 extension 对生命周期和存储的所有权。不要复制 OMP 的 process-global router。
固定证据
对比固定在:
main@2a69d3f32994da4123f1312b7fa84ef3d6119be1main@7623b960540518bb1291808bbae28332065e9dbaOMP 当前:
agent://、artifact://、history://、issue://、pr://、skill://、xd://等 handler:routerreadschema 接受 local path、internal URI 或 URL:read surfacegrep也理解 internal URL 与 line selector;长工具输出可留下artifact://<id>恢复引用:grep resource handling, recoverable outputOpenPI 当前已经有的优势:
read一个真实 path;但 manager 已先把 backend final 限制为1,024 × 1,024个 JS code units,因此该 artifact 不能证明更早的 backend output 完整性:manager cap, subagent artifact, bounded projection为什么值得讨论
现在模型拿到的恢复入口可能是:
subagent_check/workflow_status/bg_watch才能继续读取的对象。这些都能工作,但跨能力综合时,父模型需要记住多套寻址方式。一个小而稳定的 reference shape 可以让 projection 更短、handoff 更可移植,也能减少为了“读完整产物”新增 workflow-specific model tools 的压力。
关键边界:不要照搬 OMP 的全局路由
OMP 的全局 router 对独立产品合理,但 OpenPI 的 contract 要求 Pi 继续拥有 Session、普通 tools 和 source of truth。建议只研究:
这只是示意,不是预先批准的 API。resolve 必须回到 owner extension 或 Pi 已有 resource seam;不能建立第二个全局存储表。
需要回答的问题
非目标
read;完成条件
与现有 Issue 的关系
2026-09 fixed-source addendum: canonical bytes, bounded projections, recovery, and RAG boundary
Research status
Five independent source workstreams completed without failure, followed by synthesis and a separate adversarial verification pass.
Fixed baselines:
2a69d3f32994da4123f1312b7fa84ef3d6119be1@earendil-works/pi-coding-agent@0.84.3a9e447a69dee4f2789dd8d8c776e314772c1f049cbd8de8ad64530be01efea23b7764d5c37c634edc2ad97f87aea4303b6000a2c22128bc91ee76c9b812f7a2bcf20b6e80e2e50c3c8fa8e26567bc1e88615731d46153dd29b89e205fb55b2cc16205cb0Material correction to the original Issue
The original wording overstates current preservation as “reliably persisted complete outputs.” At the fixed OpenPI revision, several “full” artifacts are exact only relative to an already bounded runtime value, not the backend/provider’s original output.
Direct Subagent
SubagentManagerfirst slices a completed backend answer to1,024 × 1,024JavaScript code units:Only that bounded
snapshot.finalTextlater reachesprojectResult(). The SHA-256 artifact is immutable and byte-exact for the manager snapshot, but cannot prove preservation of backend output beyond the manager cap.Evidence:
Therefore Issue #64’s “完整 final artifact” contract is satisfied only up to the manager cap. This Issue must not repeat it as complete backend output.
Workflow Agent
A Workflow child’s final assistant output is truncated to
64 KiBbefore it is returned to the coordinator:persistWorkflowAgentResult()then usesencodeCompleteJson()and fails closed if the already-bounded result cannot fit its 2 MiB/depth/node/string budgets. Thusagent-results/agent-NNNN.jsonis complete-or-fail for the coordinator value, not for arbitrary child/provider output.Evidence:
encodeCompleteJsoncontractThe separate
result.jsonhas weaker semantics. It usessafeStringify()and may contain normalized/truncated fields or an entire preview object when over budget. It is not a universal canonical result artifact.Evidence:
result.jsonpersistencesafeStringifynormalization/previewWorkflow result references
Workflow
resultRefvalues live in an in-memoryMapand are valid only in the same run. Persisting the opaque string does not make it resolvable after restart. A run-relative artifact path is provenance, not an automatically authorized child-readable handle.Evidence: handoff registry.
Directory/privacy qualification
Direct-child CAS directories explicitly reject symlink components and use private modes. Workflow artifact files are written with
0600, but their recursively created directories do not establish a uniform explicit0700contract in this path. Documentation must describe owner-specific controls, not claim universal private artifact directories.Evidence:
Required taxonomy
Use these terms consistently:
The desired dependency direction is:
The declaration of what is canonical must name its boundary. “Complete” without “complete relative to X” is invalid.
Current OpenPI matrix
wx,0600, collision verificationreadpath; artifact-write failure is explicitagent-results/agent-NNNN.json, fail-closed encodingtranscripts.jsonresult.jsonsafeStringify, 1 MiB outer budget, normalization/preview fallbackjournal.jsonrg/fdcaptureThis matrix exposes two different problems:
A reference cannot recover bytes that its owner discarded before publication.
Lifecycle and receipts
Artifact state must be orthogonal to execution and delivery:
A machine-readable receipt should keep at least:
Definitions:
Publication rule: never emit a recovery reference before its target is readable. Spill failure, cap exhaustion, flush timeout, owner loss or missing data must never become empty success.
Identity, revision, liveness and authorization
If trace evidence eventually justifies #157’s thin contract, the smallest useful reference shape is approximately:
This is not a pre-approved API. Resolution remains delegated to the owner extension.
Required behavior:
forbidden,missing,stale,expired,partial,unavailableanduncertain;Content digest proves byte identity, not who produced the bytes or whether they cover the original execution stream. Replay fingerprint proves eligibility for reuse, not artifact identity. Live process ID proves liveness, not durable content.
Child, fork, resume, compaction and replay
resultReftokens do not restore the registry.Cross-system findings
Codex
At
a9e447a, rollout/thread storage is the primary durable execution-history source used for resume/fork reconstruction. Exec results retain truncation metadata such as original token count and omitted bytes, but the inspected path does not provide a universal stable spill artifact or range/search API for every omitted output.Knowing that bytes were omitted is stronger than silent truncation, but it is not recovery.
Codex can also transform declared MCP file parameters into provider file IDs/download URLs. Those provider objects have a different authority, retention and identity plane from local execution artifacts.
Sources:
Claude Code
Official rolling documentation establishes persisted/resumable Sessions, transcript export, tools, MCP resources, background work and subagents. It does not expose enough implementation detail to prove:
UI labels such as file, result, transcript or download are not sufficient evidence.
Sources:
Hermes
Hermes documents large-result spill paths and offset-based
read_filerecovery, and its SQLite/FTS search returns derived snippets/metadata. In the pinned checkout, imported spill modules were absent from the inspected source tree, so spill atomicity, TTL and all-path authorization must remain unknown rather than inferred from documentation.Session FTS is an index projection. It does not make snippets canonical evidence.
Source: Hermes fixed tree.
Grok Build
Grok distinguishes authoritative
updates.jsonlfrom a rebuildable chat-history cache. Background task/subagent records expose live task identity, output path, total bytes and truncation state; output can be fetched on demand, and ordinary files support ranged reads.Its FTS and optional vector mechanisms are search/memory projections, not universal execution-artifact authority. A generic content-addressed result plane and delivery receipt were not established by the inspected fixed source.
Source: Grok Build fixed tree.
Gemini CLI
Gemini can mask older tool output from model history while writing the prior content under project-temporary tool-output files and replacing it with size/line/path metadata. This is spill-plus-projection, not immutable content addressing.
Checkpoint files in the inspected path are direct writes rather than a proven transactional artifact set; invalid/missing checkpoint loading can fall back to empty history. Provider content parts remain distinct from local canonical evidence.
Sources:
OpenCode
OpenCode persists tool calls/results as Session parts and carries truncation/output-path metadata for managed outputs. Attachments may become provider-shaped media/data parts. Compaction can clear old model-visible tool content while retaining Session metadata.
The supplied pinned checkout did not expose enough of the managed truncation implementation to establish exact storage limits, atomicity, cleanup or symlink behavior. No semantic execution-evidence index or universal artifact receipt was proven.
Sources:
RAG and index boundary
Execution owners may expose stable text references. They must not silently become a semantic-memory subsystem.
readplus ordinary text search remains the default recovery path.Retention, deletion and privacy
Retention remains owner-specific. A thin reference may report owner policy and current liveness but must not add global garbage collection.
Documentation must distinguish:
Unknowns at the fixed revision include a uniform TTL, sensitivity classification, redaction ledger, universal artifact ACL, deletion reason/timestamp, crash durability via file/directory
fsync, and cross-owner retention manifest.Correct relationship to existing Issues
Decision
Do not implement a new artifact runtime now.
read/text search fail materially.Revised acceptance criteria
1,024 × 1,024code-unit cap.agent-results/*.jsonis called complete only relative to the coordinator result and fail-closed encoder.result.json,transcripts.jsonand bounded journal are never called universally canonical.resultRefis not described as restart-resolvable.readand ordinary text search remain the recovery mechanism.