Files
loki/scripts/solon
4b08e2f099 feat(solon): Loki's voting edge — signed votes from this box, doorbell receiver, reserved proposer action (#199)
FC1 of the Solon v1 plan (Solon spine live at solon.orangecat.ch; OrangeCat's
decision edge in oc#657). FleetCrown becomes a governance participant with
its own key and its own crypto:

- src/lib/integrations/solon-message.ts: Bitcoin signed-message signing for
  exactly one key (LOKI_SOLON_PRIVKEY) + the canonical Solon vote message.
  Pinned to Solon's signer by a fixed vector — RFC6979 is deterministic, so
  the unit test asserts byte-identical signatures; drift breaks CI, not
  Loki's votes.
- scripts/solon/cast-vote.ts: operator-run vote cast (fetch nothing, sign
  locally, POST; the key never leaves the environment). A future autonomous
  path stays behind the approval queue — no auto-approve, ever — and reuses
  this as its executed step.
- src/app/api/solon/events: HMAC doorbell receiver mirroring the
  /api/orangecat/events shape (env-gated 503, timing-safe verify via the new
  solon-webhook.ts, zod-parsed, unknown-but-authentic events acknowledged).
  v1 records decision.finalized to debug-logs and nothing more: FleetCrown
  has no Solon-governed artifact yet, and when one lands the receiver grows
  the fetch-and-re-verify shape OrangeCat's decision-verify implements.
- RESERVED_ACTION_PROPOSE_SOLON_CHANGE constant: the name is stable now;
  nothing dispatches it in v1.

Unit test (auto-discovered scripts/test/solon-message.ts): address
derivation, canonical message, exact signature vector, webhook verification
accept/reject matrix. verify exit 0.

Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 22:37:44 +00:00
..