Skip to content

feat(ci): verify-ledger GitHub Action — verify AI work as a CI gate#102

Merged
New1Direction merged 1 commit into
mainfrom
feat/verify-ledger-action
Jun 6, 2026
Merged

feat(ci): verify-ledger GitHub Action — verify AI work as a CI gate#102
New1Direction merged 1 commit into
mainfrom
feat/verify-ledger-action

Conversation

@New1Direction

Copy link
Copy Markdown
Owner

Turns the verifiable-cognition moat into a one-line CI check any repo can adopt: recompute a korgex receipt/journal's hash-chain (+ causal DAG + Ed25519 signature) and fail the build if anything was tampered — zero trust in the tool that produced the ledger.

- uses: New1Direction/korgex/.github/actions/verify-ledger@main
  with:
    path: ".korg/journal.json"          # or "**/*.korgreceipt.json"
    pubkey: ${{ vars.KORG_SIGNER_PUBKEY }}   # optional: pin the signer

How it works

  • verify_ledger.py resolves a verifier — KORG_VERIFY_BIN override · npx @korgg/ledger-verify (JS) · korg-verify from crates.io (default, installed if absent). All three implementations emit the same --json verdict, so parsing is uniform. Globs the path, verifies each file, writes a markdown verdict table to $GITHUB_STEP_SUMMARY.
  • Exit codes: 0 all valid · 1 any invalid (the gate) · 2 setup error. A no-match fails loudly — no silent pass with nothing verified.
  • action.yml is a composite action (caches the korg-verify binary).

Why here / why now

Placed in-repo (uses: …/korgex/.github/actions/verify-ledger@…) so there's no new repo to stand up; it can be promoted to a standalone Marketplace action later. It directly leverages everything just shipped: korg-verify (crates.io), the receipt format, and the three independent verifiers.

Verification

  • Self-test workflow proves it on real GitHub CI: an intact frozen conformance vector passes the gate; a tampered one fails it (asserted via steps.*.outcome).
  • Locally validated with the real korg-verify binary against the committed vectors: intact → exit 0, tampered → exit 1 (exact seq error), missing → exit 2, glob handled, step-summary table rendered.
  • Additive only — new files under .github/, no existing code touched.

A reusable composite Action that recomputes a korgex receipt/journal's hash-chain
(+ causal DAG + Ed25519 signature) in CI and FAILS the build if anything was
tampered — zero trust in the tool that produced the ledger. Turns the verifiable-
cognition moat into a one-line check any repo can adopt:

    - uses: New1Direction/korgex/.github/actions/verify-ledger@main
      with: { path: '.korg/journal.json' }   # or '**/*.korgreceipt.json'

- verify_ledger.py: resolves a verifier (KORG_VERIFY_BIN override · npx
  @korgg/ledger-verify · cargo-installed korg-verify [default]) — all three impls
  emit the same --json verdict — globs the path, verifies each, writes a markdown
  verdict to . Exit 0 all-valid / 1 any-invalid / 2 setup error.
  No-match fails loudly (no silent pass with nothing verified). Optional --pubkey
  pins the signer.
- action.yml: composite; caches the korg-verify binary.
- Self-test workflow proves it on real CI: an intact frozen vector passes the gate,
  a tampered one fails it (asserted).

Logic LIVE-validated locally against the committed conformance vectors with the real
korg-verify binary: intact->exit0, tampered->exit1 (exact seq error), missing->exit2,
glob handled, step-summary table rendered.
@New1Direction New1Direction merged commit 0baabf7 into main Jun 6, 2026
2 checks passed
@New1Direction New1Direction deleted the feat/verify-ledger-action branch June 6, 2026 15:07
New1Direction added a commit that referenced this pull request Jun 6, 2026
The verify-ledger Action (#102) is the adoption vector for verifiable cognition, but
an unadvertised action won't get used. Add a 'Gate it in CI' snippet next to the
receipt section so the agent -> ledger -> CI-verify loop is discoverable.

Co-authored-by: ares <285551516+New1Direction@users.noreply.github.com>
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