Repository navigation
feat(compute): MVP-A inference execution contract (mbongo-infer:v1, kaayu-cv-extract:v1) - #151
Conversation
…aayu-cv-extract:v1) Freezes what a ComputeTask means when it asks for the MVP inference, as an off-chain convention on the opaque execution_spec of RFC 0005 (§2.10, §2.12): a fixed 47-byte layout "mbongo-infer:v1" || BLAKE3 job-spec digest (domain mbongo:infer-job-spec:v1), a constrained canonical JSON with every rule local and tested, InferenceJobSpecV1 (exact field set, identity rules, generation and limit bounds), and the frozen kaayu-cv-extract:v1 profile: llama.cpp llama-server v0.7.0 @ 620d2225 (MIT), Qwen3-4B-Instruct-2507 GGUF Q4_K_M pinned by SHA-256 (Apache-2.0, unsloth repository revision a06e946b), a verbatim system-prompt template and an identity-free output JSON Schema both pinned by digest, temperature 0 / top_p 1.0 / seed 42 / max 400 tokens, 10,000-byte input and 8,000-byte output limits. The worker gate is executable: preflight (parse spec, resolve and re-hash the job spec, validate it, runtime tag and commit, model digest, input commitment, input contract) and finish (JSON, schema, canonical bytes, output_commitment). Seventeen error codes, none consensus. Golden vector and negative vectors in test-vectors/inference/; the committed job-spec document in docs/product/inference/kaayu-cv-extract-v1/; test group inference_contract (A01–A24 + three negative controls) with CI step "Mbongo MVP Inference Contract"; .gitattributes keeps the digest-pinned artifacts byte-stable on every checkout. No model runs here. No ComputeTask, receipt, RPC or SDK wire change; the reference worker, conformance suite, J, K and the SNP adapter are untouched. Refs #150, #148 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Validation at source
|
| Check | Result |
|---|---|
cargo fmt --all -- --check |
clean |
cargo clippy --workspace --all-targets --all-features -- -D warnings |
clean (exit 0) |
cargo test --workspace |
all suites ok, 0 failed (ignored: 2 baseline + the SEV-SNP live test) |
Mbongo MVP Inference Contract (inference_contract) |
25 passed / 0 failed / 0 ignored — A01–A24 + negative controls (digest-blind, version-blind, model-digest-blind caught) |
| Mbongo Compute Provider Policy | 41/41 |
| Mbongo Compute Conformance | PASS 38/38 |
| Mbongo Compute Confidential Authorization | CONFIDENTIAL AUTHORIZATION: PASS (6/6 test group) |
| Mbongo Compute Hardware Attestation | 18 passed / 1 ignored (live test, never counted as pass) |
| reference harness | REFERENCE COMPUTE FLOW: PASS |
| replay harness | DETERMINISTIC REPLAY: PASS |
| SDK | 153 tests, 153 pass, 0 fail (no SDK source touched) |
| docs | 79 relative links and anchors resolve across the contract document, INDEX, vectors README and the scope document; 67 section citations; typos (CI's checker, 1.49.0) clean on every touched path; git diff --check clean; 0 CR bytes in any touched file; ci.yml parses (js-yaml) |
| golden vector | job_spec_digest = be9ae960…fe0e; execution_spec = 6d626f6e676f2d696e6665723a7631 ‖ digest (47 bytes); committed job-spec.json is byte-identical to the canonical bytes (A20) |
| protected surfaces | 62 paths (RFC 0005, RFC 0002, RECEIPT_SPEC, PROTOCOL_LOCK_v0.4, rpc_v0.3, consensus and node sources, SDK wire and sources, reference worker core, conformance, J, K, SNP adapter, protocol vectors, SNP fixtures, MVP_v0.1.md) resolve to the same blob ids at 38445ef2 and at this source: expected 62, found 62, identical |
Change surface: .gitattributes (+2), ci.yml (+6, one named step), lib.rs (+1 module line), docs/INDEX.md (+1 row), and new files only — the inference module (5 files), the test group, the contract document, three profile artifacts, six vector files. Nothing deleted, nothing else modified.
The devnet image copies only Cargo manifests and crates/ (Dockerfile, .dockerignore), so include_str! of files under docs/ failed the Docker Devnet Bootstrap job. The prompt template, output schema and committed job-spec document move to crates/mbongo-compute/profiles/kaayu-cv-extract-v1/ unchanged (same bytes, same digests, golden vector unchanged); every reference follows. Refs #150 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Addendum — source
|
MVP-A — AI Inference Execution Contract (
mbongo-infer:v1)First implementation gate on the frozen MVP v0.1 path (
docs/product/MVP_v0.1.md§11, #148). Baseline38445ef278894ec31ac30b12660c6afe5d738f62. Tracks #150.What it freezes. Exactly what a
ComputeTaskmeans when it asks for the MVP inference, without touching the v0.4 protocol:execution_spec="mbongo-infer:v1"(15 bytes) ‖job_spec_digest(32 bytes) — fixed 47 bytes inside the 1,024-byte RFC 0005 bound; family prefix, then version, then length are checked in that order.job_spec_digest = BLAKE3("mbongo:infer-job-spec:v1" ‖ canonical job spec); constrained canonical JSON (sorted keys, no whitespace, integers only, defined escapes; no floats, booleans or nulls) shared by job spec, input object and result.InferenceJobSpecV1: runtimellama.cpp/llama-serverv0.7.0 @ 620d2225 (MIT, verified at that commit); model Qwen3-4B-Instruct-2507 GGUF Q4_K_M,artifact_sha256 = 3605803b…e597from the Hugging Face LFS metadata ofunsloth/Qwen3-4B-Instruct-2507-GGUF@a06e946b(Apache-2.0), to be recomputed from the downloaded bytes in MVP-B set-up — not fabricated, not downloaded here; the digest is authoritative, names are not; the GGUF embeds the tokenizer and chat template, so no separate tokenizer id.kaayu-cv-extract:v1: input{"contract":"kaayu-cv-extract-input:v1","cv_text":…}≤ 10,000 bytes; prompt = template file verbatim as the system message + CV text as the user message (template SHA-256 pinned in the job spec); outputkaayu-cv-profile:v1JSON Schema (identity-free: no name or contact field exists;additionalProperties:false, enums, bounds; only keywords llama.cpp's grammar converter supports), schema SHA-256 pinned; generation temperature 0 / top_p 1.0 / seed 42 / max_tokens 400 with frozen ranges.output_commitment. Whitespace and key order never change a commitment.preflight(8 ordered steps, fail-closed, no execution/result/receipt on any failure) andfinish; 17 application error codes; retry keeps the job spec immutable by construction; model/runtime drift fails closed at start-up and per task.Evidence. Named group
inference_contract: 25 tests (A01–A24 + negative controls: digest-blind, version-blind, model-digest-blind each accept what the strict gate refuses), golden vector byte-exact (A20) and the committedjob-spec.jsonidentical to the canonical bytes; wire shapes ofComputeTaskandReceiptasserted unchanged (A18, A19). Full validation in the PR thread. 62 protected paths (RFC 0005, RFC 0002, RECEIPT_SPEC, lock v0.4, rpc_v0.3, consensus, SDK wire/source, reference worker core, conformance, J, K, SNP adapter, protocol vectors,MVP_v0.1.md) byte-identical to the baseline.Not in this PR. No llama.cpp execution, HTTP front, CLI, GPU, pricing, metering, MBO, SDK change (helpers deferred to MVP-C, which must reproduce the golden vector).
Refs #150, #148, #144, #52.
🤖 Generated with Claude Code