Skip to content

CEID Phase 2: AgentMesh adapter — episode, weave, capsule #32

@Haserjian

Description

@Haserjian

Summary

CEID adoption for AgentMesh. Episode, weave, and capsule artifacts are natural non-CDE evidence carriers. Only evaluated verdicts (task state transitions, orchestration decisions) become CDEs.

Parent spec: ccio/docs/SPEC-0001-canonical-decision-envelope-and-ceid.md
Golden corpus: ccio/tests/fixtures/ceid_golden_corpus.pyAGENTMESH_TYPE_MAP

First Lane

Artifact Type Code Is CDE Rationale
Episode epi Yes Episode lifecycle is a decision boundary
Capsule cap No SBAR context bundle — evidence, not decision
WeaveEvent wev No Hash-chained provenance — evidence, not decision

Second Lane (Deferred — Do Not Deliver in First Lane)

Artifact Type Code Is CDE Rationale
Task state transition dec Yes Only transitions encoding evaluated verdict/selection

Task state transitions are NOT part of the first lane deliverable. They require a prior decision on which transitions qualify as decisions vs mechanical state propagation. That classification must be written and tested before any task transition emits a CDE.

Promotion criteria for second lane:

  • Written classification: which TaskState transitions are decisions, which are mechanical
  • At least 3 concrete examples of each category documented in test fixtures
  • First lane fully green (episode, capsule, weave all CEID-addressable)

Key Constraint: Not Every Task Transition Is a Decision

Only upgrade transitions that encode an evaluated verdict or selection:

  • Accepted/rejected execution plan
  • Selected route/provider/tool
  • Explicit orchestration approval/hold/deny

Mechanical state propagation (RUNNING after spawn, etc.) is NOT a decision.

Target Files

Production

File Change
src/agentmesh/ceid.py (new, vendored) Vendored copy of ccio's ceid.py
src/agentmesh/episodes.py Add CEID + universal header to episode creation
src/agentmesh/capsules.py Add CEID + universal header to capsule creation
src/agentmesh/weaver.py Add CEID + universal header to weave event creation
src/agentmesh/assay_bridge.py CEID propagation for proof-pack references

Tests

File What It Validates
tests/test_ceid_artifacts.py (new) CEID presence, header, type-code for all migrated artifacts
tests/test_vendored_ceid.py (new) Vendored ceid.py matches CCIO golden corpus

What NOT To Change

  • Hash-chain semantics in weaver.pyprev_hashevent_hash chain unchanged
  • Event log append logic in events.py — CEID annotates, does not replace event_id or seq
  • Capsule SBAR structure — CEID is header metadata, not part of SBAR content
  • Episode start/end lifecycle — CEID is identity, not lifecycle control
  • Witness signing payload — CEID is not included in Ed25519-signed canonical JSON
  • Spawner subprocess logic — no CEID in hot spawn path

Acceptance Criteria

  • One episode artifact is CEID-addressable with full universal header
  • One capsule artifact is CEID-addressable with artifact_type="capsule", NOT CDE
  • One weave event is CEID-addressable with artifact_type="weave_event", NOT CDE
  • Hash-chain and weave invariants preserved — CEID annotates, does not replace provenance
  • No task state transition emits a CDE in this lane (deferred to second lane)
  • Vendored ceid.py passes conformance against golden corpus
  • Vendored GOLDEN_CORPUS_VERSION matches CCIO source
  • Existing episode/weave/capsule tests unchanged

Guardrails

  • Anti-promotion: Require explicit "decision contract" criteria before any artifact becomes CDE
  • Hash-chain preservation: CEID header annotates the artifact, does not replace hash linkage
  • Weave integrity: prev_hashevent_hash chain unchanged by CEID addition
  • Task transition gate: Second lane blocked until classification + fixture examples exist

Dependencies

  • CCIO CEID library (150 conformance tests green)
  • Golden corpus AGENTMESH_TYPE_MAP registered

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions