Skip to content

feat: implement capsule.compose@1 residual and validator - #1263

Merged
Koh0920 merged 19 commits into
nightlyfrom
feat/compose-semantics-v1
Aug 13, 2026
Merged

feat: implement capsule.compose@1 residual and validator#1263
Koh0920 merged 19 commits into
nightlyfrom
feat/compose-semantics-v1

Conversation

@Koh0920

@Koh0920 Koh0920 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • define the canonical JCS CompositeResidual v1 selected by capsule.compose@1, including stable NodeId/Endpoint/Connection types, a 1 MiB bound, BLAKE3 ContentRef derivation, and golden vectors
  • validate residual identity, exact parent exports, endpoint existence, protocol equality, protocol-owned role compatibility, transitive child resolution, and recursive compose closure
  • make capsule.compose@1 explicitly linear and single-binding: one child endpoint may be used by at most one connection or export; fan-out requires an explicit Hub/Router Computation
  • validate untrusted transitive closure with iterative DFS, configurable depth/unique-computation/resolved-byte budgets, and verified Computation/residual caches
  • distinguish validation resource limit exceeded from semantic invalidity and stop before a CAS read that would exceed the aggregate byte budget
  • allow cycles in the communication graph while rejecting recursive Computation reference cycles
  • prove Core closure with a structural Hello World E2E: NameProvider and Greeter are internally connected while only greeting is exposed by one unchanged ComputationObject
  • align the dependency-direction lint with the now-authoritative capsule-core DAG root introduced by refactor(ato): separate computation core from protocol v1 #1262

Scope boundaries

This PR implements canonical residual structure and structural conformance only. BoundaryVisibility::Internal means a connection is hidden from the parent boundary; it does not claim that complementary child actions synchronized or that a tau transition occurred.

This PR does not add or change PortGrant, live PortRef, Evaluator, small-step execution, Trace, Contract, Snapshot, materialization, or the Core ComputationObject shape. Runtime evolution, tau, and resealing remain follow-up work.

Verification

Passed locally at HEAD:

  • cargo test -p capsule-compose --locked (14 tests: 3 codec + 11 structural/integration)
  • 512-level compose closure validation through iterative DFS
  • depth, unique-computation, and aggregate resolved-byte budget rejection tests
  • 100 NodeIds sharing one ComputationRef perform one metadata read and one object open
  • cargo check --workspace --locked
  • cargo fmt --all -- --check
  • cargo clippy -p capsule-compose --all-targets --locked -- -D warnings
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • bash scripts/check-dep-direction.sh

The earlier full cargo test --workspace --no-fail-fast run passed compose, Protocol v1 compatibility, Workspace PTY, Ready-State, and all other completed targets, but exited non-zero on the existing share_interactive_e2e and share_run_e2e fixtures because their committed share.spec.json / share.lock.json pair fails the pre-existing digest check. A serial rerun reproduced that unrelated fixture failure.

cargo clippy --workspace --all-targets --all-features remains blocked by the existing nacelle capsule_sync unresolved import under all-features; default-feature workspace Clippy passes.

@Koh0920
Koh0920 marked this pull request as ready for review August 13, 2026 11:16
@Koh0920
Koh0920 changed the base branch from base/nightly-before-computation-compatibility to nightly August 13, 2026 11:22
@Koh0920
Koh0920 merged commit 11b5931 into nightly Aug 13, 2026
10 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