feat(supply): read the supply, and prove Core cannot mint it - #22
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 /supplyreturns 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/databaseimport: 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.
OfflineNetworkClientis 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
supply.controller.test.tsscans every*.controller.tsin the API for@Post/@Put/@Patch/@Deletewhose 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.