Skip to content

feat(korg-verify): standalone Rust verifier for korg receipts & journals#1

Merged
New1Direction merged 6 commits into
mainfrom
feat/korg-verify
Jun 4, 2026
Merged

feat(korg-verify): standalone Rust verifier for korg receipts & journals#1
New1Direction merged 6 commits into
mainfrom
feat/korg-verify

Conversation

@New1Direction

Copy link
Copy Markdown
Owner

What

A new dependency-light binary crate, korg-verify, that verifies a korgex receipt or a korg-ledger journal — no network, no Python:

korg-verify <receipt.json | journal.jsonl> [--key <str>] [--pubkey <hex>] [--json]
# exit 0 VALID · 1 INVALID/tampered · 2 usage/parse

Checks: hash chain + causal DAG (reusing korg-registry's conformance-tested verify_chain/verify_dag), the receipt's tip matches the chain head, and — if signed — the Ed25519 tip signature, with an optional --pubkey signer pin (rejects any key but the trusted one).

Why

It's the third independent implementation of korg-ledger@v1 — Python (korgex receipt verify), JS (the self-verifying HTML), and now Rust — all checked against the same frozen conformance vectors. That turns "verify a sealed deliverable without trusting the tool that produced it" from a claim into something you can run as one small binary, in CI or by hand.

Tests (11, all green)

  • All five shared vectors in crates/korg-registry/tests/conformance: basic-intact, hmac-intact (valid only with the key), nonbmp-intact (astral-plane code points), tampered-content (flags seq 2), tampered-deletion (flags seq 3).
  • A real receipt minted by korgex receipt --sign (fixture, fixed key) → VALID — cross-implementation proof that Rust re-derives the chain and verifies the Python Ed25519 signature; plus tamper, forged-signature, and signer-pin cases.

Notes

  • CI: the existing ci.yml runs cargo test / clippy -D correctness / fmt --check workspace-wide, so the new crate is covered automatically — no CI change. korg-verify is fmt-clean and clippy-clean (pre-existing korg-registry warnings are unrelated).
  • Reuses korg-registry rather than re-implementing canonicalization, so chain parity is inherited from its conformance suite; the only new surface is the receipt envelope + Ed25519, both covered by the fixture tests.
  • Build a release binary: cargo build --release -p korg-verify.

New1Direction and others added 6 commits May 31, 2026 15:31
…fix doc-drift

korg-server bound 0.0.0.0:8080, exposing the (mostly unauthenticated) control/telemetry routes to the local network. It now binds 127.0.0.1:8080 by default (both run_web_* entry points), with KORG_SERVER_ADDR to opt into other interfaces on purpose. wasm_js_handler/wasm_bytes_handler served empty 200s for a frontend that isn't bundled — now 404. Corrected the module + index_handler docs that claimed a 'glassmorphism SPA dashboard' (it serves a static landing page). TDD: resolve_bind_addr (loopback default + explicit override) and wasm routes 404; 11 korg-server tests green. (Minor follow-up: the startup log/auto-open still print localhost:8080 — accurate for the default, cosmetically stale only under an override.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tory & revert theater

korg-tui rendered fabricated data as if it were real. Removed it: default() no longer seeds fake persona scores [0.92,..], lock latencies, sparkline histories, rubric pass/fail, or velocity/risk (empty/zero until a real TuiUpdate arrives); deleted the 'demo heartbeat' that animated a fake entropy gauge; load_git_commits now shows REAL author/date (git log --pretty) and never fabricates 3 commits when git is empty; the git-revert handlers report real success/failure instead of 'Simulated...success'/'Bypassed...' on failure (and no longer imply per-commit time-travel — they reset the working tree to HEAD); removed the dead update_from_leader no-op. The live TuiUpdate wire (already honest) is untouched. TDD: parse_git_log + default()-honesty; 12 korg-tui tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…efore committing

The rewind overlay now shows, per candidate, a Surgical/Strategic scope badge and an honest 'will discard N steps (seq a-b)' line derived from the candidate's REAL invalidates list — so the operator sees the blast radius before choosing a recovery point. No reordering (recovery emits surgical-first), so the cursor->action mapping is unchanged: the highlighted candidate is exactly the one acted on. TDD: format_invalidation (empty/one/range) + scope_badge; 9 korg-tui tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ark it verified)

A GOAL band atop the Observability tab derives the goal's true state from real signals (current_verdict + rubric_status + progress): Awaiting / In progress / Claimed-not-verified / Verified. Honesty rule: a completion CLAIM never renders as done — only every acceptance rubric passing marks it Verified; any failing criterion shows 'Claimed - not verified'. Plus the M/N criteria tally and progress%. Real data only; no wire changes. TDD derive_goal_state (one test per branch) + goal_state_label; 14 korg-tui tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cle signal)

Adds a structured TuiUpdate::WorkerState{node_id,persona,state,elapsed_ms} + WorkerLifecycle enum (tui_bridge.rs), emitted by workers.rs at the REAL spawn/ok/crash/timeout/spawn-error lifecycle points (alongside the existing Trace log; real elapsed via per-node spawn instants). korg-tui upserts them into workers: Vec<WorkerRow> (apply_worker_state keyed by node_id, no dup) and renders a leader->worker tree on the Swarm Console with per-worker status glyphs (crashed/timed-out tagged 'queued for recovery'); empty until real signals arrive. Also fixes the goal band's progress (app.progress is already 0-100; dropped a stray *100). Real data only. TDD apply_worker_state upsert; korg-runtime 103 + korg-tui 15 + korg-registry 26 (conformance intact) green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A dependency-light binary that verifies a korgex receipt or a korg-ledger journal:
hash chain + causal DAG (reusing korg-registry's conformance-tested primitives) plus
an Ed25519 tip-signature check, with an optional --pubkey signer pin. No network, no
Python — the third independent korg-ledger@v1 implementation (Python, JS-in-browser,
now Rust), so "verify without trusting the tool that produced it" is provable, not
asserted.

  korg-verify <receipt.json|journal.jsonl> [--key <str>] [--pubkey <hex>] [--json]
  exit 0 VALID · 1 INVALID/tampered · 2 usage/parse

Tests (11): all five shared frozen vectors (basic/hmac/nonbmp/tampered-content/
tampered-deletion) + a REAL receipt minted by `korgex receipt --sign` — cross-impl
proof that Rust re-derives the chain AND verifies the Python Ed25519 signature — plus
tamper, forged-sig, and signer-pin cases. fmt clean, clippy-clean.
@New1Direction New1Direction merged commit c535791 into main Jun 4, 2026
1 of 2 checks passed
@New1Direction New1Direction deleted the feat/korg-verify branch June 4, 2026 03:02
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