forgo.cloud
Sign in
Repo workspace

forkjoin-ai/gnosis

Arena merge gate (Phase 8)

docs/ARENA_MERGE_GATE.md
forkjoin-ai/gnosis

Arena merge gate (Phase 8)

This document names the single TypeScript evaluation point for merge promotion when multiple Arena 5 controls apply together:

  1. Verification bundle — deterministic verifyBundle closure (src/verify-bundle.ts).
  2. Cooling — optional block while CoolingState.mode === 'cooling' (src/cooling-policy.ts).
  3. Rollback replay — optional replay of a metric window on a fresh RollbackController; any rollback decision blocks merge.

Public API: @a0n/gnosis/arena-merge-gateevaluateArenaMergeGate(input).

Merge-bot / CI CLI: pnpm exec tsx ./scripts/evaluate-arena-merge-gate.ts path/to/gate-input.json (or - for stdin). JSON must include verificationBundle; optional cooling, rollbackReplay (same shape as ArenaMergeGateInput). Example: fixtures/arena-merge-gate.valid.json. Convenience: pnpm run evaluate:arena-merge-gate in this package runs the fixture. Root: pnpm run evaluate:arena-merge-gate.

No network, no side effects. Callers supply JSON-shaped inputs from CI or a merge bot; this module returns { ok: true } or { ok: false, reasons }.

Validation: pnpm run validate:arena-stack in open-source/gnosis exercises Lean SocioTechnicalSandbox via lean-minimal lake build ArenaSocioMinimal (no Mathlib), bundle + ecology CLIs, and gnode tests including src/__tests__/formal-ledger-basis.test.ts (families/primitives contract lock), src/__tests__/arena-merge-gate.test.ts, and related arena tests. pnpm run validate:formal-ledger-basis runs only the basis lock.

Repo daemon: scripts/start-formal-ledger-perpetual-machine.sh runs this gate before each non-dry-run agent cycle unless PERPETUAL_ARENA_STACK_GATE=0 (see .agent/workflows/formal-ledger-perpetual-machine.md). Use PERPETUAL_ARENA_STACK_FAST=1 to run validate:arena-stack-ts only (skips Lean lake build).

CI: GitHub Actions workflow .github/workflows/gnosis-arena-stack.yml runs the full validate:arena-stack on PRs/pushes that touch the arena slice.

See also