Skip to content

feat(plugin): serving_provenance on openai.exchange.v1 terminal event (stacked on #1437) - #1

Open
StevenMih wants to merge 2 commits into
mesh1331-lifecycle-hooksfrom
feat/serving-provenance
Open

feat(plugin): serving_provenance on openai.exchange.v1 terminal event (stacked on #1437)#1
StevenMih wants to merge 2 commits into
mesh1331-lifecycle-hooksfrom
feat/serving-provenance

Conversation

@StevenMih

Copy link
Copy Markdown
Owner

What

Surface the maximum inference provenance the host actually knows at serve time onto the openai.exchange.v1 terminal event — the stranger-promise / proof-of-inference metadata a downstream capsule attests over (advances Mesh-LLM#1233's digest advertisement): what ran, at what fidelity, on whose hardware, served by which node.

One new ServingProvenance struct, attached to the existing OpenAiExchangeEnvelope via a with_serving_provenance builder, populated at the raw-proxy dispatch callsite (network/openai/ingress.rs) from state the local mesh::Node already holds:

  • Model fidelity (ServedModelMetadata): quantization, architecture, context_length, parameter_size, layer_count.
  • Model identity (ServedModelIdentity): model_identity_hash (a digest of the model identity, not a hash of the name string), model_canonical_ref, model_revision.
  • Hardware (node startup hardware survey): gpu, vram_bytes, is_soc, hostname.
  • Topology: served_by_node_id (real serving iroh node id).

Honesty contract

Every field is Option + skip_serializing_if: a fact the host genuinely does not know is omitted, never fabricated. On a synthetic plugin-served endpoint with no loaded GGUF, hardware fields populate (host-wide survey) while model-fidelity fields are correctly absent. No raw prompt/response text — provenance only.

Stacking

Stacked on Mesh-LLM#1437 (mesh1331-lifecycle-hooks) — must land first; this PR targets that branch as its base. Clean addition: one struct + a builder + a small publish_raw_proxy_terminal helper, no refactor.

Tests

cargo build/test/clippy green on mesh-llm-host-runtime. New unit tests cover envelope carries-provenance / omits-unknown / effective-has-none. Proven end-to-end against a real mesh-llm serve on macOS (real gpu: Apple M4 Max, vram, soc, hostname, node id), captured into a signed capsule that agent-action-capsule verify --store accepts.

🤖 Generated with Claude Code

Surface the maximum inference provenance the host actually knows at serve
time onto the raw-proxy path's terminal event: what ran (model identity
hash, canonical ref, revision), at what fidelity (quantization,
architecture, context length, parameter size, layer count), on whose
hardware (gpu, vram_bytes, is_soc, hostname), served by which node.

All values are read from state the local mesh::Node already holds -- the
served-model descriptor (ServedModelMetadata / ServedModelIdentity) and the
node's startup hardware survey. Every field is a real value or omitted
(serde skip_serializing_if); nothing the host does not know is fabricated.
No raw prompt/response text is carried -- provenance only.

Stacked on the Mesh-LLM#1331 lifecycle-hooks terminal-broadcast wiring (Mesh-LLM#1437 must
land first). One new ServingProvenance struct wired onto the existing
OpenAiExchangeEnvelope via a with_serving_provenance builder, plus a small
publish_raw_proxy_terminal helper at the ingress callsite -- no refactor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: stevenmih <stevenmih88@gmail.com>
@StevenMih

Copy link
Copy Markdown
Owner Author

Pushed a cargo fmt fix (96ce5ec) — the Quality lane's rustfmt check was red on one line in openai_exchange.rs (a call rustfmt collapses to one line). No behavior change.

Verified locally (fork CI can't show the Linux/Quality lanes — private Docker image; see Mesh-LLM#1437): head 96ce5ec

  • ✅ rustfmt
  • ✅ repo-consistency:no-console-print
  • ✅ repo-consistency:publish-crates
  • ✅ repo-consistency:test-all-rust-crate-coverage

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.

1 participant