38 lines
2.4 KiB
Markdown
38 lines
2.4 KiB
Markdown
# Codex consumable foundation
|
|
|
|
Code batch, 17 November 2026. Internal modules only; no new public endpoint,
|
|
no automatic grants, no table initialization on application startup, and no
|
|
migration of existing organisation keys or kits in this batch.
|
|
|
|
`codex-proofs.mjs` provides bounded, authenticated instance/revision proofs using
|
|
server-only HMAC-SHA256 keys. The active key issues new proofs; a configured
|
|
verification key ring retains historical verification across rotation. The
|
|
signed environment separates test from production. Signing keys must be supplied
|
|
by trusted server configuration and must remain distinct from encryption keys.
|
|
No rotation UI or persistent key-ring provisioning is enabled by this module.
|
|
A proof is not a private/public SSH key pair and does not convey domain authority.
|
|
|
|
`codex-consumables.mjs` supplies the transactional consumable ledger. A trusted
|
|
server definition must provide issuance authority, use authority and an effect
|
|
handler. Issue identity, recipient, issuer, environment and edition are recorded.
|
|
The unique issue request prevents duplicate issuance; altered retries conflict.
|
|
Use locks the instance, checks domain authority and revision, performs the effect
|
|
and marks consumption in the same transaction. A failed effect rolls everything
|
|
back. Retrying the same completed request returns a replay result without another
|
|
effect. Copied proofs identify the same row and cannot consume it twice.
|
|
External mail/Discord/game delivery must use a transactional outbox, never a
|
|
network side effect inside the effect handler. Production MariaDB integration
|
|
must exercise simultaneous issuance and use before enabling a consuming adapter.
|
|
|
|
This foundation does not yet provide transfers, replacement/revocation, staff
|
|
issuance screens, persistent physical-item custody, recruitment fees or listing
|
|
publication. These require their own domain adapters and audit events. Existing
|
|
organisation key consumption remains authoritative until explicitly migrated;
|
|
no second entitlement is granted here. Persistent items must not use this
|
|
consumable handler.
|
|
|
|
Validation: cryptographic tampering, environment separation and verification-key
|
|
rotation tests; transactional database tests for duplicate use, same-request
|
|
replay, ownership, issuance authority, request conflicts and failed-handler
|
|
rollback. The local SQLite adapter serializes concurrent transactions; it checks
|
|
the service contract but does not establish MariaDB locking behaviour by itself.
|

Staff