Skip to content

feat(supply): read the supply, and prove Core cannot mint it - #22

Merged
isaacismaelx14 merged 1 commit into
mainfrom
feat/phase-8-supply-read-models
Aug 22, 2026
Merged

feat(supply): read the supply, and prove Core cannot mint it#22
isaacismaelx14 merged 1 commit into
mainfrom
feat/phase-8-supply-read-models

Conversation

@isaacismaelx14

Copy link
Copy Markdown
Member

Phase 8, Core's side. The Central Bank itself is in the private Network repo; nothing about how the supply is created is in this PR, or in this repository.

What Core gets

GET /supply returns three figures the Network publishes: maximum, circulating, reserve. As decimal strings, because JSON numbers are doubles.

That is the whole surface. No service behind the controller, no @kreds/database import: Official KRED is not in Core's ledger, and a service is where somebody eventually adds a write.

Without a Network

404 with a reason, not zero.

OfflineNetworkClient is the default and what most self-hosted instances run forever. Five million KRED existing with none circulating is a different claim from the question not applying here, and answering with confident numbers invites a dashboard that displays them.

Local economies, local currencies, local ledgers and local leaderboards keep working. What is absent is Official KRED, which was never Core's to issue.

The done-when, as a test

The 5M supply exists entirely inside the private ledger and no Core endpoint can mint Official KRED.

supply.controller.test.ts scans every *.controller.ts in the API for @Post/@Put/@Patch/@Delete whose route could mint, and fails if it finds one. Mutation-tested: adding a @Post("mint") turns it red.

Protocol

Bumped to v2 for getSupply(). The Network refuses a mismatched version explicitly rather than deciding against a shape neither side agrees on.

Phase 8's done-when has two halves. The first lives in the private
Network, where the five million exists. This is the second half:

  "no Core endpoint can mint Official KRED"

Core gets a single GET that asks the Network for three numbers and
returns what it said. There is no service behind the controller,
because a service is where a write eventually gets added, and no
database import, because Official KRED is not in Core's ledger.

An instance with no Network answers 404 with a reason, not a supply of
zero. Five million existing with none circulating is a different claim
from the question not applying here, and numbers invite a dashboard.

The done-when itself is a test: it scans every controller in the API
for a write verb whose route could mint, and fails if it finds one. It
is a text scan, which is coarse, and coarse is the point. It will
notice a route added in a hurry by somebody who never read this file.
@isaacismaelx14
isaacismaelx14 merged commit 69cf029 into main Aug 22, 2026
1 check passed
@isaacismaelx14
isaacismaelx14 deleted the feat/phase-8-supply-read-models branch August 22, 2026 16:33
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