Skip to content

feat(jobs)!: deliver job results through object storage - #211

Merged
Kahtaf merged 16 commits into
mainfrom
feat/job-result-handles
Sep 14, 2026
Merged

Kahtaf merged 16 commits into
mainfrom
feat/job-result-handles

Conversation

@Kahtaf

@Kahtaf Kahtaf commented Sep 4, 2026

Copy link
Copy Markdown
Member

Why

Enclave job results are capped at MAX_INLINE_RESULT_BYTES (1 MiB) because the ciphertext rides inline in the job row. Vercel caps a function request or response body at 4.5 MB, so the inline path can never carry the 20-50 MB scopes we need. The pre-enclave direct read had no ceiling at all, so this cap is a regression, not a carried-over bound. It currently fails a real read: a ChatGPT-conversations scope returns job state: failed, surfaced to the user as an empty result.

Decision and rationale: personal-server-ts/docs/260904-result-delivery-plan.md.

What

fix(jobs): surface real job failures from readRawreadRaw called openResult on any terminal job without checking state or failureReason, so a failed job surfaced as a generic "missing inline ciphertext" error. Independent of the change below and worth landing regardless.

feat(jobs)!: use object storage for results — breaking protocol change:

  • Removes MAX_INLINE_RESULT_BYTES and resultCiphertext entirely.
  • Adds ResultHandle { objectKey, url, size, hash, expiresAt }.
  • CompleteRequest becomes { fencingToken, resultHash, resultSize, resultObjectKey }.
  • JobStatus carries one result?: ResultHandle, present only when completed.
  • openResult fetches the object publicly, verifies sha256 and size, then ECIES-decrypts raw bytes. No base64.

readRaw's public signature is unchanged, so builders see nothing beyond the version bump.

Notes

The removed fields shipped in 3.23.0 but nothing is in production, so removing them now is free and after the first builder depends on them it is a deprecation cycle.

Companion PRs: vana-storage #24, data-gateway #100, personal-server-ts #245, unity-surfaces #987, and lorebook #1.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PxPMhmcBptiGgaJBoVyH1

Moksha release integration

The packaged chain-14800 anchors now trust the existing Moksha worker app/KMS identity, so production Web/Account builds can verify enclave identities without preview overrides. Mainnet anchors remain empty. The controller is excluded from the owner-key app allowlist.

Includes the existing SDK #186 withdrawal API to preserve Account dev compatibility when consumers replace their older SDK prerelease. This is a dependency integration; no withdrawal behavior was redesigned.

Published and registry-installed: @opendatalabs/vana-sdk@3.23.0-pr.211.36da1d8 (pr-211). Node and browser package entry points both verify a real Moksha public identity signature chain and retain the withdrawal API. All 1,376 tests pass (one skipped), full validation/build and autoreview pass, and GitHub Node20/22 plus key-scan checks are green. Fresh attestation admission remains a deployment responsibility; the saved signature-chain fixture does not claim fresh DCAP verification.

BREAKING CHANGE: completed jobs now expose ResultHandle and completion requests require resultObjectKey; inline result ciphertext fields and MAX_INLINE_RESULT_BYTES are removed.
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
vana-console Ignored Ignored Sep 9, 2026 7:57pm UTC
vana-rbac-auditor Ignored Ignored Sep 9, 2026 7:57pm UTC
vana-vibes-demo Ignored Ignored Sep 9, 2026 7:57pm UTC

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c767d5bd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

);
}
const actualHash = bytesToHex(sha256(bytes));
if (actualHash.toLowerCase() !== handle.hash.toLowerCase()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate result handles before using their hashes

When a completed Gateway response contains a truthy but malformed result object—for example, one with a missing or non-string hashrequireStatus accepts the external JSON without validating the new handle fields, and readRaw passes it here. This call then throws a raw TypeError from handle.hash.toLowerCase() rather than the documented JobRejectedError, preventing callers from reliably handling malformed or rolling-version Gateway responses. Validate every ResultHandle field at the response boundary before fetching or hashing it.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T19:05:03.775559Z 7c767d5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Kahtaf
Kahtaf force-pushed the feat/job-result-handles branch from b1c154d to 36da1d8 Compare September 9, 2026 19:56
github-actions Bot pushed a commit to vana-com/vana-cli that referenced this pull request Sep 10, 2026
## [0.19.0](v0.18.0...v0.19.0) (2026-09-10)

### Features

* **cli:** the read loop - vana app read, escrow balance and fund, onchain ([a241c0a](a241c0a)), closes [vana-sdk#211](vana-com/vana-sdk#211)

### Reverts

* **cli:** drop vana mcp --http ([2c9a79c](2c9a79c))
@Kahtaf
Kahtaf merged commit 51dc5de into main Sep 14, 2026
9 checks passed
@Kahtaf
Kahtaf deleted the feat/job-result-handles branch September 14, 2026 20:01
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant