Skip to content

feat: add V-PROGRAM message type support (phase 1) - #1220

Merged
odesenfans merged 15 commits into
mainfrom
od/vprogram-support
Jul 10, 2026
Merged

feat: add V-PROGRAM message type support (phase 1)#1220
odesenfans merged 15 commits into
mainfrom
od/vprogram-support

Conversation

@odesenfans

Copy link
Copy Markdown
Collaborator

What

Phase-1 CCN support for the new V-PROGRAM message type (SEV-SNP verifiable programs, VerifiableProgramContent from aleph-im/aleph-message#158): parse, price, store, and display.

  • Parsing: PendingVProgramMessage, CONTENT_TYPE_MAP entry, tag extraction from content.metadata.tags.
  • API: VProgramMessage response model wired into MESSAGE_CLS_DICT, the AlephMessage discriminated union, and the headers content format, so V-PROGRAM rows render in every /messages endpoint (list filters, single message, pending, rejected, websocket).
  • Pricing: V-Programs are priced on the existing instance_confidential tier (compute units + declared extra volumes; the runtime bundle and workload are STORE-paid artifacts and deliberately carry no execution-volume cost). Cost-estimation schemas and both price endpoints (GET /api/v0/price/{item_hash}, POST /api/v0/price/estimate) support the type.
  • Processing: dedicated VProgramMessageHandler validates the credit balance (V-Programs are credit-only by schema) and persists cost rows; recurring credit billing picks the rows up generically. process/forget keep no side tables in phase 1: the message row is the source of truth.

No DB migration is needed (the message type column is a plain varchar).

Phase-1 scope (deliberate)

  • No measurement validation and no runtime/workload ref checks (phase 2 will add CCN-side measurement recomputation per the confidential VM protocol design).
  • No vms table rows, no VmType member: v-programs do not appear in vms accessors yet, and forgetting a STORE file referenced by a v-program workload is not blocked.
  • No amend/replaces chain validation.

Merge gate

pyproject.toml pins aleph-message to the head commit of aleph-im/aleph-message#158. Swap it for the released version once that PR ships in a release, and re-run the type checks, before merging.

Tests

13 new tests (schema round-trips with the canonical cross-SDK fixture, cost tier selection, end-to-end pipeline processing/rejection against Postgres, price and display endpoints). Full suite: 871 passed, 10 skipped, 0 failed; black/ruff/isort clean; mypy clean.

🤖 Generated with Claude Code

Bump the aleph-message pin to 08898ecd6 (verifiability-first schema
tightening). Verified volumes replace classic machine volumes on
V-PROGRAM content and are not costed, since they are STORE-paid
artifacts like the workload rather than execution volumes. The
environment no longer carries aleph_api. The canonical test fixture
and its item hash were regenerated for the new content shape.
The removed-messages machinery (#1219) is type-generic; prove a
V-PROGRAM rides it: REMOVING -> REMOVED in one GC pass (no file-pin
gate), billing metadata (owner, credit payment type) copied onto the
removal record, messages row deleted.
@odesenfans
odesenfans force-pushed the od/vprogram-support branch from eb41eb0 to 34eeb4d Compare July 10, 2026 13:54
@odesenfans
odesenfans marked this pull request as ready for review July 10, 2026 21:59

@foxpatch-aleph foxpatch-aleph left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-structured phase-1 implementation for V-PROGRAM support. The handler, cost service, schemas, and controllers all follow existing patterns correctly. V-Programs are priced on the INSTANCE_CONFIDENTIAL tier with VerifiedVolume entries correctly excluded from execution-volume costs. The credit-only payment enforcement is explicit. 13 new tests provide thorough coverage of parsing, pricing, pipeline processing, API display, and GC removal. The only merge gate is swapping the aleph-message git pin for a released version, which is already documented in the PR description.

pyproject.toml (line 33): Merge gate: this git pin to aleph-message#158 must be swapped for a released PyPI version before merging, as noted in the PR description.

@odesenfans
odesenfans merged commit 09862b4 into main Jul 10, 2026
4 checks passed
@odesenfans
odesenfans deleted the od/vprogram-support branch July 10, 2026 22:09
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.

2 participants