Skip to content

refactor(ato): separate computation core from protocol v1 - #1262

Merged
Koh0920 merged 16 commits into
base/nightly-before-computation-compatibilityfrom
agent/computation-compatibility-layer
Aug 13, 2026
Merged

refactor(ato): separate computation core from protocol v1#1262
Koh0920 merged 16 commits into
base/nightly-before-computation-compatibilityfrom
agent/computation-compatibility-layer

Conversation

@Koh0920

@Koh0920 Koh0920 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reduce the protocol-independent Semantic Core to content identity and typed boundaries: ContentRef, ComputationRef, SemanticsId, ProtocolId, PortId, RoleId, PortDef, and ComputationObject { semantics, boundary, residual }.
  • Define ComputationRef as a syntactically valid persistent reference. It may be unresolved or dangling. Only ResolvedComputation proves canonical decoding and exact digest agreement; Semantics-specific validity remains a future layer.
  • Add capsule-core-codec as the single authority for canonical encoding, strict decoding, hashing, resolution, the 1 MiB accepted-object limit, and golden vectors.
  • Keep Protocol v1 State + Connector + Record behind capsule-adapter-state-io-v1. Exact descriptor and Record bytes remain opaque compatibility material addressed through CAS.
  • Keep Session Store v4 identity as origin_computation: ComputationRef; checkpoints, frontiers, replay evidence, and materialization state live only in the nested runtime profile and cannot replace the origin.
  • Model composition as the external capsule.compose@1 Semantics instead of an Atomic | Composite Core variant, with a draft small-step RFC.

Review follow-up

  • Removed the claim that ComputationRef itself is verified. Parsing establishes syntax and the Computation Object v1 reference domain only.
  • Removed the unused generic Evaluator API and registry from this PR. It encoded local paths, environment projections, and v1 AttachmentEndpoint types too early. Runtime routing still uses the existing legacy selector.
  • Renamed the projected v1 surface conceptually to an exposed compatibility boundary. legacy-peer Ports are not generically composable until a v1 role-compatibility rule is defined.
  • Permanently bound the current ComputationRef type to CAPSULE_COMPUTATION_OBJECT_V1. A future incompatible encoding must use a distinct reference domain and type and cannot reinterpret an existing reference.
  • Enforced the 1 MiB limit in direct codec decode/verify paths as well as resolver-based resolution.
  • Removed the public Session upgrade_legacy_origin mutation. Compatibility migration now accepts an opaque value that only the v1 adapter can mint alongside a resolved normalized computation.

Identity and compatibility invariants

canonical ComputationObject v1 bytes
  = { semantics, boundary, residual }
                  |
               BLAKE3
                  |
           ComputationRef
  • Changing the boundary changes computation identity.
  • residual is Semantics-owned opaque content; Core does not interpret config, State, Connectors, Records, children, or composition graphs.
  • CBOR v1, Bundle v1, existing golden bytes, Workspace PTY, Ready-State restore/containment, and replay behavior are unchanged.
  • Protocol members import with bounded 64 KiB copy/hash, validated member size, file and directory fsync, atomic no-clobber persistence, O_NOFOLLOW, and streaming validation of existing CAS objects.
  • ConnectorId == PortId is absent from generic APIs. The compatibility projection remains confined to the v1 adapter.

Scope

Protocol v1 .capsule
  -> state-I/O v1 adapter
  -> canonical ComputationObject v1
  -> ComputationRef / ResolvedComputation
  -> immutable Session origin

Protocol v2, generic interaction history, seal(C), and evaluation of capsule.compose@1 remain deferred. The recommended next PR is the canonical capsule.compose@1 residual, validator, and minimal Hello World E2E; a generic Evaluator API should then be derived from that concrete use case.

Validation

  • cargo fmt --all -- --check
  • cargo check --workspace
  • Core / codec / adapter / Session unit and doc tests
  • cargo test -p capsule --lib protocol_bundle — 24 passed
  • cargo test -p cli --test capsule_session_detached_e2e — 11 passed
  • cargo test -p cli --test capsule_session_ready_state_e2e — 5 passed
  • cargo clippy -p capsule-core -p capsule-core-codec -p capsule-adapter-state-io-v1 -p capsule-session-runtime -p capsule -p cli --all-targets -- -D warnings

@Koh0920 Koh0920 changed the title feat(ato): add computation compatibility layer refactor(ato): separate computation core from protocol v1 Aug 13, 2026
@Koh0920
Koh0920 marked this pull request as ready for review August 13, 2026 08:09
@Koh0920
Koh0920 merged commit 714ad4f into base/nightly-before-computation-compatibility Aug 13, 2026
15 of 16 checks passed
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