Skip to content

Add Gonka Compute Witness pilot adapter - #218

Draft
safal207 wants to merge 15 commits into
mainfrom
feat/gonka-compute-witness-pilot
Draft

Add Gonka Compute Witness pilot adapter#218
safal207 wants to merge 15 commits into
mainfrom
feat/gonka-compute-witness-pilot

Conversation

@safal207

@safal207 safal207 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

What changed

  • added a dependency-free OpenAI-compatible Gonka execution adapter for ProofPath Compute Witness;
  • added canonical request, prompt, complete provider-response, raw-output, final-output, and receipt hashing;
  • added bounded replicas, timeouts, optional explicit fallback, and final-output agreement scoring;
  • added machine-readable verdicts: CONSENSUS, DIVERGENT, DEGRADED, and NO_SUCCESSFUL_EXECUTION;
  • added HTTPS enforcement for external endpoints and secret-free receipts;
  • added safe MiniMax <think>...</think> handling: complete reasoning blocks are excluded from final agreement scoring, while unclosed or malformed blocks are rejected;
  • added nine isolated unit tests and a no-secrets GitHub Actions workflow;
  • documented the trust boundary and integration path for TRACE, LiminalDB, and Temporal Market Intelligence.

Why

ProofPath already has a static Compute Witness contract. This pilot adds a live provider boundary without overstating what is proven. It records provider-returned evidence and local hashes while explicitly stating that GPU identity, routing independence, settlement, and scientific correctness remain unproven.

A live Dahl/Gonka test on 2026-08-03 confirmed API-key authentication and OpenAI-style compatibility for:

  • endpoint: https://inference.dahl.global/v1/chat/completions
  • model: MiniMaxAI/MiniMax-M2.7
  • HTTP status: 200
  • provider request id: devshard-44246-782

The live response exposed a compatibility edge case: MiniMax returned reasoning inside <think>...</think> in message.content. The adapter now hashes the complete response and raw output, but uses only the safely extracted final answer for output_hash and agreement scoring. Reasoning text is never copied into the portable receipt.

Developer impact

The adapter is optional and does not change the current gateway, Rust workspace, conformance fixtures, or payment guard. It uses only the Python standard library and reads live credentials from environment variables.

Validation

  • python3 scripts/test_gonka_adapter.py
  • nine tests passed locally:
    • ordinary consensus and secret exclusion;
    • closed MiniMax reasoning-block extraction;
    • truncated/unclosed reasoning rejection;
    • reasoning-without-final-answer rejection;
    • divergence detection;
    • degraded execution;
    • explicit fallback;
    • external HTTPS enforcement;
    • localhost HTTP allowance.

Safety notes

  • no real secrets are committed;
  • no token, wallet, custody, settlement, or financial operation is implemented;
  • the CI workflow performs no live Gonka request;
  • raw reasoning is represented only by hashes and a non-sensitive markup status;
  • the PR remains a draft until the updated CI checks are green and a multi-replica non-sensitive broker pilot validates routing assumptions.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a5847850-ed41-4498-8285-20f94d7562e9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

safal207 commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Live Dahl/Gonka compatibility evidence — 2026-08-03

A real request from Android/Linux completed successfully against:

  • endpoint: https://inference.dahl.global/v1/chat/completions
  • model: MiniMaxAI/MiniMax-M2.7
  • HTTP status: 200
  • provider request id: devshard-44246-782
  • finish reason: stop

Observed response behavior: MiniMax returned internal reasoning inside <think>...</think> in choices[0].message.content, followed by the final answer ProofPath OK, even though the system prompt requested no reasoning tags.

Before this draft is ready to merge, the adapter should:

  1. preserve the hash of the complete raw provider response;
  2. extract a separate normalized final answer for agreement scoring and output_hash;
  3. record that reasoning markup was present, without storing the reasoning text in the portable receipt;
  4. add fixtures for closed <think> blocks, truncated/unclosed reasoning blocks, and ordinary responses without reasoning markup.

This confirms API-key authentication, endpoint compatibility, model availability, and the OpenAI-style response shape. It does not yet prove independent routing, GPU identity, or on-chain settlement.

safal207 commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

MiniMax reasoning-markup fix validated

Commit 0ad478e3e55966ed75f98fa5168c864ff45a09a6 adds safe final-answer extraction for provider responses containing <think>...</think>.

Validation is green:

  • Gonka Adapter Tests — success (9 tests)
  • Compute Witness Conformance — success
  • Rust — success, including formatting, clippy, unit tests, Compute Witness CLI fixture, action-boundary metrics, reusable GitHub Action, Personal Agent Guard, and Agent Payment Guard demos
  • CodeRabbit — success; no unresolved review threads

Security/evidence behavior:

  • complete provider JSON is represented by response_hash;
  • raw message content is represented by raw_output_hash;
  • only the extracted final answer is used for output_hash and agreement scoring;
  • closed reasoning blocks are recorded as reasoning_markup: closed without copying reasoning text into receipts;
  • unclosed, malformed, or reasoning-only responses are rejected as unsuccessful executions.

safal207 commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Live three-replica result: consensus observed, independence not observed

The Android/Linux pilot completed successfully at the execution layer:

  • claim: dahl-live-pilot-20260803T203620Z
  • requested/successful replicas: 3/3
  • output verdict: CONSENSUS
  • agreement score: 1.0
  • receipt hash: sha256:35b9c3eb2e67e88bd20ecc620e49f8b718c080e213ef0973a3b6a9af756804eb

However, all three successful responses returned the same provider request ID:

devshard-44246-1001
devshard-44246-1001
devshard-44246-1001

Interpretation: three client-side attempts and exact answer agreement are observed, but independent routing is not observed or proven. The duplicate ID could reflect caching, deduplication, shared upstream execution, or provider-specific ID semantics; this evidence cannot distinguish those cases.

The branch now separates output agreement from routing evidence:

  • CONSENSUS continues to describe the final answers;
  • duplicate IDs are classified as DUPLICATE_PROVIDER_REQUEST_IDS;
  • the strict live runner exits non-zero for duplicate or missing IDs;
  • even distinct IDs are labeled DISTINCT_PROVIDER_REQUEST_IDS_NOT_INDEPENDENCE_PROOF;
  • independent_routing_proven is always false because request IDs alone cannot establish machine, validator, or GPU independence.

Added four dependency-free tests for duplicate, missing, distinct, and non-consensus cases, plus a durable evidence note at docs/DAHL_LIVE_PILOT_EVIDENCE_2026-08-03.md. No API key or reasoning text was recorded.

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