Repository navigation
feat: Mochi's sealed note via NEAR AI private inference, behind VITE_SEALED_NOTE_ENABLED - #5
Merged
Merged
Conversation
…E_SEALED_NOTE_ENABLED
…ys cannot pass checks
…laiming plain notes
…gnatures retryable
…d announce the outcome
…relay step Check the daily, hourly and global allowances before charging any, bound register reads, the completion and the signature lookup from the request start, and match the invite copy to the one-note-per-harbor behaviour.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
After an accepted return, Mochi can write a short note through NEAR AI Cloud private inference (
z-ai/glm-5.3-flash, Intel TDX and NVIDIA TEE).@nearai/inference-sdk0.3.0, requiring GPU evidence and one shared Ed25519 key.signature_kindisprovider_tee, the signed text equals<model>:sha256(request):sha256(response), and the signature verifies against the attested key. Otherwise the note is Not sealed (with the reason), Seal not recorded yet (retryable, not stored) or broken (no text shown).POST /api/v1/privy/note, under the existing Privy origin, JWT, size and quota checks.max_tokens≤ 120, two ciphertext messages, canonical JSON, 8 KB cap.familiar-game.testnet.NEAR_AI_API_KEY, and never decodes or logs content.thinking_token_budgetvsenable_thinking).Flag
VITE_SEALED_NOTE_ENABLEDreaches the production build only whenVERCEL_ENV=production, a Privy app ID is set, and the value is exactlytrue. Previews never get it, so production is unchanged after merge until the flag is set.Verified locally
bun run test: 264 pass.cargo test --workspace: 130 pass.make build,bun run build:release,make browser(Chromium and WebKit) andmake evidencepass.provider_teesignatures that verified:daa6b158…(Bun),20d3c9c6…(Chromium) andd8b367f5…(WebKit), using the real browser code.Not verified (production-only after merge)
To switch on (David)
NEAR_AI_API_KEYis already in Production.VITE_SEALED_NOTE_ENABLED=truefor Production and redeploy.