Repository navigation
Release notes: v0.10.0, Genkan and the engine
The code in this repository moves ahead of the deployed service. The public endpoint is unchanged: it serves the same four
tools (attest · gate · cascade · calibrate) under contract 1.1.0, and nothing changes for a caller today. The frozen
schemas (schemas/*.json) are byte for byte those of v0.9.0; packages/contracts changes in the comments of its
sources and in its tests (names, messages, one assert.doesNotThrow).
1. Genkan, the order gate (new: apps/genkan)
- The kernel. A program written in Lean 4 (toolchain
leanprover/lean4:v4.32.1, pinned) reads one request on stdin
and writes one answer on stdout. Mode 1 judges an order under a context and answersallowordeny <reason>; mode 2
decodes an order; mode 3 computes a SHA-256. A malformed request, or an input over 1 MiB, exits with code 3. - The rules. A TRANSFER or an APPROVE is always denied. An order must target a listed venue. An EXIT on a listed
venue is allowed whatever the action, the asset and the amount. Any other order needs the action commit, a listed
asset and an amount within its cap; a SWAP also needs a listed output asset andminOutabove 0. - What is proved.
Genkan/Theorems.leanholds 30 theorems, among themrespond_allow_safe: whatever the input, an
allowmeans a mode 1 request that decodes and an order that meets the rules above. - How it is checked. A new blocking CI job,
g3-genkan, audits the sources before any Lean runs, fetches the Lean
release and holds it to its sha256, builds the kernel, replays each module withleanchecker, holds the axiom record
ofmainand of each theorem topropext,Classical.choiceandQuot.sound, and runsnpm run test:genkan: the
82 cases ofkernel/vectors/judge.jsonand the mutants (of the 55 mutants ofGenkan/Judge.lean, 49 are killed by a
case, 6 do not compile, none survives). - What it does not guarantee. The kernel knows no balance, position, price or venue rule; the lists and caps are the
caller's; a cap holds one order, not a total;minOutabove 0 is not a slippage guard; an EXIT must be executed
reduce-only.
2. The harness (apps/harness)
judge. A fifth tool runs the gate on the caller's envelope, then the kernel on the order, under the gate's own
action and the caller's limits. It is in the code and tested against the built kernel; the public endpoint does not
serve it yet.- The paper executor (
src/paper.ts, not served) passes each signal throughjudgeand fills the allowed orders on
paper, in a journal that replays. It places no order on any venue. - Two optional gate inputs.
params.calibration.aci, the online level of a class on the BYO path (a call without it
stays on the split path), andparams.suivi, a cell's tracking evidence, replayed on every call, which can only lower
the budgetB_t. Both are documented inapps/harness/README.md. - Served texts. A refusal of the input schema names at most 100 errors. No message or description of the harness
names an ADR any more (v0.9.0 had 14, among them the refusal of the retired class). - Dependencies.
@modelcontextprotocol/serverand@modelcontextprotocol/core2.0.0 → 2.3.1, both now under
Apache-2.0 (MIT before), and with themzod4.6.1 → 4.6.7;minimatch10.2.6 → 11.0.4 throughoverrides, which
brings@isaacs/nonrecursive-glob-match1.0.3. - End-to-end trace.
fixtures/h5-e2e-trace.jsonstays the recording of v0.9.0, the one the site reads: four tools,
as the public endpoint serves them. Recorded on this code, it differs in three values only: the tool list gains
judge, the digest of that response changes with it, and the refusal of the retired classbtc-dir-15mno longer
cites its decision record. Every structured result is the same.
3. HIKAE (packages/hikae)
- The online level of a class (
src/aci.ts): the update of Gibbs and Candes 2021, replayed from the caller's
evidence, with a bound on the misses that needs no assumption on the scores, delays included. The coverage of the
split path does not carry over to this region. - Online tracking (
src/suivi/,src/pari/): betting tests on the miss labels, computed in exact rationals. - Its one error message that named an ADR no longer does, and the tracker refuses a non-positive step size.
4. Repository
npm run test:genkanruns the Genkan tests and the harness tests that need the built kernel;npm testand
npm run test:mainnow include the Genkan tests that do not.- The lint ratchet ceiling goes from 69 to 44, the count measured on this tree.
- The README gains Genkan: its row in the components table and the component count above it, a section, its commands,
the layout, the language line of the engineering choices and the CI job count. EXPORT-MANIFEST.jsonlists the synthetic data offixtures/kata-quarter/underexcluded_data: its readers do not
ship, so neither does it.- Security updates, for advisories published after v0.9.0:
next16.3.8 → 16.4.6, the version the site declares (with
@next/envand the@next/swc-*binaries),sharp0.35.4 → 0.35.5 andfast-uri3.1.8 → 3.1.9.
5. Known issue
npm audit --audit-level=high (CI job g6-compliance) still fails on one advisory published after v0.9.0,
GHSA-fc5q-39xc-vjpf against picomatch 4.0.7: no fixed version of picomatch is published yet. It is a development
dependency, reached only through the lint tooling (typescript-eslint 8.69.0, then tinyglobby and fdir); the nine
alerts of the audit all come from it.