Cosmic Bull

Rendered from docs/DISCOVERY_AND_REUSE.md at commit 6a510c665a53 in the project repository. The committed file is the source of truth; this page is a rendering of it.

Discovery and reuse

This is a gate, not a guideline. It runs before creating or modifying any /p/ or /r/ code, and again before deployment.

It exists because it was once skipped: vault and bounties were built against a curated genesis set and skill references rather than a full chain enumeration. The retroactive review found a RELATED fee-calculation package that could have been imported. Nothing was broken by the miss — but nothing guaranteed that either.


The mandatory gate

  1. Search Cosmic Bull's own catalog — catalog/.
  2. Search all existing Cosmic Bull /p/ and /r/ sources — the working trees in this repository, not just the catalog summaries.
  3. Search on-chain Gno — enumerate the target chain's packages (/p/ and /r/), then inspect the plausible candidates. Enumeration is cheap; guessing is not.
  4. Search the public Gno / GitHub ecosystem — the pinned examples tree and public repositories, where relevant.
  5. Classify every hit.
  6. Reuse where appropriate — prefer composition over new infrastructure.
  7. Document the evidence in a committed DISCOVERY.md.
  8. Repeat before deployment — the chain moves between the start of an application and its deploy.

Classification

Every hit gets exactly one label:

LabelMeaningConsequence
EXACT DUPLICATESame capability, same semanticsDo not build. Use it, or record a specific, concrete blocker.
REUSABLE EXISTING PRIMITIVESolves a component of the problem, importable as-isImport it
RELATED IMPLEMENTATIONOverlapping but materially different in asset, authority model, custody, or scopeCompose or adapt; record the delta
GENUINELY NEWNo relevant implementation found in the searched sourcesBuild it, with the evidence committed

A RELATED hit that is not reused must carry a concrete reason. Acceptable: "takes creator/hunter as string parameters — a designation-forgery shape"; "accounting-only, shows no real-coin custody"; "marked v0 Unaudited". Not acceptable: "different approach", "cleaner to write our own".


Language discipline

Never claim ecosystem-wide uniqueness from a finite search.

Use exactly this phrase:

"No relevant existing implementation was found in the searched sources."

Not "nobody has built this". Not "this is the first". The search is finite, keyword- and path-based, and the chain moves. The phrasing has to carry that.

Every DISCOVERY.md must also state its search-confidence limits — what was enumerated exhaustively, what was sampled, and what was not searched at all.


DISCOVERY.md — required contents

A discovery record is committed alongside the application source. It must record:

service_registry was the first application to ship one — 12 related implementations found and individually classified. It is the model for subsequent applications.


Reuse outcomes in this portfolio

Reused:

(All three lists reconciled 2026-09-23 to the chain-computed consumed_by in catalog/portfolio.json, which C7 re-proves against the chain's own declared imports on every verifier run — replacing a 2026-09-22 hand-grep whose coinio membership had wrongly included the deployed bounties and vault.)

Built new, with recorded reasoning: feeledger, coinio, duebook, permbook. See catalog/primitives.md.

Found and deliberately not reused, with reasons recorded:

OursClosest foundClassification and reason
p/feeledgerp/g1n4pl…/bazaar/fee/v1RELATED — overlaps only FeeFor; feeledger's substance is the stateful ledger with a conservation contract. Had it been found pre-build, the calc could have been imported.
p/coiniop/nt/treasury/v0RELATED — treasury abstracts multi-banker dispatch with canonical-impl checks; coinio is the minimal guard-trio/payout/sweep contract with no state. Inspected pre-build; heavier surface, "v0 Unaudited".
r/vaultr/moul/demo/vault/v2RELATED — different asset (GRC20 vs native), different mechanism (time-lock vs fee-on-deposit), no fee/conservation model.
r/bountiesr/g16m0r7…/bountyboardRELATED — richer workflow, but takes creator/hunter as string parameters (designation-forgery shape) and shows no real-coin custody.
r/fee_splitsplitpayment; moul/splitter/v1RELATED — string-identity with no custody; accounting-only. Neither suitable. 626 packages enumerated at the time.
p/tally (undeployed)r/g1zwf26…/tallyName collision only (a single Bump counter). No relevant existing keyed-score implementation was found in the searched sources.

Stated so that no reader over-reads the results:

Verify every intended import against the target chain, not just against upstream master.