Cosmic Bull

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

Cosmic Bull

An autonomous Gno.land application engineering agent — an application factory.

Cosmic Bull takes an application objective and carries it end to end:

IDEA
  → DISCOVERY        find what already exists; do not rebuild it
  → ARCHITECTURE     decide the state shape and the authority model
  → REUSE            compose existing /p/ and /r/ before creating new
  → GNO CODE         write it, or port/remediate an existing implementation
  → TEST             unit + filetests against a chain-matched toolchain
  → AUDIT            adversarial review, RED / YELLOW / GREEN, evidence-gated
  → PEARL VALIDATION compile and simulate against the live target chain
  → DEPLOYMENT       Pearl-1 only, from verified bytes
  → LIVE VERIFICATION byte-match the deployed source; then attack it
  → DOCUMENTATION    a provenance record that a stranger can re-check

This repository is the canonical source of truth for the Cosmic Bull project itself — its operating rules, methodology, catalogs, and deployment records. It is not the source of truth for the individual applications. Each application lives in its own repository; this repo points at the exact commit that was deployed. See Source-of-truth boundary.


What Cosmic Bull is designed to do

The goal is not maximum code generation. The goal is useful applications produced through maximum appropriate reuse and rigorous verification.


The Gno architecture Cosmic Bull works in

Gno.land runs an interpreted Go-derived VM where source code lives on-chain. Every code unit is a package, and the path prefix is the kind:

/p/ — pure packages

/r/ — realms

Why Cosmic Bull searches /p/ and /r/ before building

Three reasons, in order of weight:

  1. Immutability makes mistakes permanent. A realm you deploy is a realm you live with. Reusing an already-audited, already-live primitive imports its track record along with its code.
  2. Every new line is new audit surface. Duplicated infrastructure doubles the attack surface for zero new capability.
  3. The ecosystem is real and reachable. The chain can be enumerated. Not searching it is a choice to be ignorant, not a constraint.

See docs/DISCOVERY_AND_REUSE.md for the mandatory gate that enforces this.


The application-factory thesis

The longer-term objective: Cosmic Bull accepts an application objective and decides how to satisfy it — choosing among four strategies rather than defaulting to the last one.

#StrategyWhen it applies
1Reuse an existing primitiveA /p/ package already does this correctly. Import it.
2Compose existing realms/packagesThe capability exists across two or more live components. Wire them.
3Adapt an existing implementationSomething close exists but needs porting, remediation, or a different asset/authority model. Port it; do not redesign it.
4Create genuinely new infrastructureOnly after 1–3 are searched and recorded as insufficient — with the evidence committed.

Strategy 4 is the expensive one, and it is the last resort by design. The discovery gate exists to make sure the agent has actually checked before claiming it.

The five pipeline applications are all strategy 3 — existing SillyZir GitHub applications ported onto current Pearl semantics, audited, remediated, and deployed. Four /p/ primitives now exist: feeledger and coinio were extracted from repeated realm code (strategy 4, with recorded reasoning) and are reused by later realms (strategy 1); duebook was written from an objective after discovery eliminated reuse, composition and adaptation (strategy 4 again, arrived at by a different route); permbook is strategy 4 and strategy 1 at once — it was written only against a quoted structural limit in an incumbent Cosmic Bull realm that discovery recorded as otherwise satisfying the objective, and it composes an ecosystem container package rather than writing one.


The portfolio

Live on pearl-1: 4 /p/ primitives · 15 application realms · 5 applications completed through the GitHub → Pearl pipeline · 5 applications built objective-first by the application factory.

(Two additional throwaway realms, cointest and cointest2, exist on-chain as validation helpers. They are not products and are excluded from the count of 15 — see catalog/README.md.)

Reusable /p/ primitives

PackageDeployment txHeightPurpose
p/…/feeledgerfeb4b559aecd184494f4c0786732efce263626811edd4f4bacfb2b9563c1f2a0572441Per-account balance ledger + explicit bps fee pot, with a conservation contract
p/…/coinio31b53d1b763132576eb85fce25fb7d3881b279351d0949e18a72c366167706ae583585Chain-facing coin plumbing: receipt-guarded Receive, Payout, reserve-protected Sweep
p/…/duebook5cd6de9e86a19cbf5633763dbf2536223a559212bdf51239304326e71f1b50bb609571Deferred-action scheduling: consume-then-act Claim makes replay structurally impossible, not merely guarded
p/…/permbook87866042519c18702b5e434c35284e70cfa5a8075c967a43d90382c2f225ccfb612427Named permissions over a consumer-owned Book: per-Book bounds, admin-only mutation, O(log P + log H) queries — holding a permission grants no authority over the book

The five GitHub-pipeline applications

All deployed under the namespace gno.land/r/g1ut6uspuh73e02yauxpmyt8g3wwddaq8utagvm3/… on pearl-1.

#ApplicationRepositoryDeployed SHATxHeightRecord
1fee_splitSillyZir/fee_split819239ad5ddc46cf685f5ff363cabb7290848c1f061c89b1fd34f696396a2ee4e0b39dc7a808cdb0e5916763d39a7afe80c43c16596803§7
2timelock_guardianSillyZir/timelock_guardianbb05e64898967125b900a9275ca84229bff5e0076db3f74c764523f8ea1d82f7cd419639a8bb597494b170a8d2ea56bc8779efbb602213§8
3upgrade_registrySillyZir/upgrade_registry2d5a74870b08d70ff8e56e6e1efbace1803dd3bd532be90ab90521b0d6d4b3f983ede9dd315c8975cf30ad5c8984837f4d57e34d602876§9
4permission_registrySillyZir/permission_registrye3d6aeaf3571ec35c2af68c5fbb756480b76ed03a30c09427173a45553a9befcac38d410aa0e416eb785145942ee5378d6a8c54f604615§10
5service_registrySillyZir/service_registry3c598d2e68f31bcd9697fc702f2f78703c4988c760fc44a47fb8c38ca117609076d13b2dc1e75c407b1d70a70830fecf1fae30ba605546§11

Full per-application records — architecture, reused primitives, discovery classification, audit findings, live verification, and limitations — are in catalog/applications.md. The authoritative transaction-level records are in pearl/DEPLOYMENT.md.

One divergence, recorded rather than hidden. SillyZir/fee_split has since moved to e5aadfebc890c21ade4076e1d75c9c0e0dd77809, a pushed remediation that is not deployed. The live fee_split v1 remains frozen at the bytes derived from 819239a. No fee_split_v2 exists. Do not "reconcile" the two by redeploying.

Earlier portfolio realms (pre-pipeline)

RealmTxHeightComposes
r/…/vault829993dd958f49c13028db79cc12b907d452302d025a1c629357a00ffa5c8fb8572482feeledger
r/…/bounties1e67d09e07266d0a50bda463686fd8338d7b56adad333fdf6869d10685294f86573203feeledger
r/…/coindemo38aa65019a1a5dee3b3e8509498f7d9c52cdfa9b5fcca59bb4a05b5957c6908c583613coinio + feeledger
r/…/grants6093675f15c27702f8c8599309e1a40e5964b96973369547ee11ba301f8a3f60584731coinio + feeledger + sanitize/v0
r/…/market76293576775be9db30ab097944990e9c5836d00e52a84b979d3284b7707f82d9585791coinio + feeledger + avl + sanitize/v0

Application-factory realms (objective-first)

Built from a stated objective rather than ported from an existing repository: discovery decides the strategy, and the five runs so far chose differently.

#RealmTxHeightComposesRecord
1r/…/bounty_panel2c2a8dc883d2a8c4d1318a3a9ec74a8184ec25579b5b3e4b4f28e291fcf33c79608171coinio + feeledger§12
2r/…/duebook_demobbb5fc50464741a40e1d71bf449c67ccd000c41923b896d7c9bdb748b825af56609644duebook§13
3r/…/permbook_demoe98028e1add2ccba033d4538a2b04ea4a958b38a87e4eeb2ae57c1a402593731612731permbook + sanitize/v0§14
4r/…/service_market9f9d9f42b14fae53261f2e81c1862f90783651fbea74cc434702d2be55c37c99628080coinio + feeledger + sanitize/v0§15
5r/…/subscriptions60c23cd2d863e0e49553f936c6efcc52b62aa4b50f452b5feea4768528fd0cad639086coinio + feeledger + sanitize/v0§17

Build #1 reused the existing primitives and subtracted; build #2 found nothing that performed an effect under the consumer's own authority and wrote a new one; build #3 found that Cosmic Bull's own live permission_registry already satisfied the objective, recorded that first, recommended it, left it untouched, and built only against the one property it could not work around — caps that are global, shared and unraisable on an immutable realm. Builds #4 and #5 are pure composition: one new state machine each over the same audited value-handling primitives. All five decisions are argued from enumerated evidence in their respective DISCOVERY.md files.


Security philosophy

Full treatment in docs/SECURITY.md. The load-bearing principles:


Deployment philosophy

Full treatment in docs/DEPLOYMENT.md.

The application-level authorization model

Once an application is explicitly selected for the pipeline, Cosmic Bull may carry it through the full bounded lifecycle without artificial authorization gates at each stage:

DISCOVERY → ARCHITECTURE → REUSE ANALYSIS → PORT / REMEDIATION → TEST
  → AUDIT → GITHUB COMMIT/PUSH → FRESH GITHUB VERIFICATION
  → PEARL VALIDATION → PEARL DEPLOYMENT → LIVE VERIFICATION
  → DEPLOYMENT RECORD

Human approval happens at the application level, not at every stage. A routine, clearly-scoped implementation problem is fixed, retested, re-audited and carried forward.

It must stop and report for unexpected material:

Completing one application never authorizes starting the next.


Authorship

Every commit in every Cosmic Bull repository:

Author:    SillyZir
Committer: SillyZir

No Co-authored-by: Claude. No Co-authored-by: Anthropic. No AI attribution trailer of any kind. Direct commits to main; no pull requests unless explicitly requested; no history rewriting; no force-pushes.

Authorship is verified after every push, and scanned across the full commit history — not just the tip.


Source-of-truth boundary

ThingAuthoritative home
Application source codethat application's own GitHub repository, at the recorded SHA
Deployed bytesthe chain — vm/qfile at the realm path
Deployment facts (tx, height, cost, verification)pearl/DEPLOYMENT.md in this repo
Agent rules, methodology, catalogsthis repo
/p/ primitives and the pre-pipeline realmsthis repo (pearl/p/, pearl/r/) — they were authored here

The pearl/r/<app>/ directories in this repo hold the port + remediation working trees for the pipeline applications. They exist as audit evidence and are deliberately not presented as the applications' source of truth. Where a working tree diverges from the live realm, that divergence is recorded in pearl/INFRASTRUCTURE.md.


Repository layout

README.md                     this file
CLAUDE.md                     permanent operating rules for the agent
docs/
  ARCHITECTURE.md             Gno model, /p/ vs /r/, interrealm semantics
  APPLICATION_FACTORY.md      the four strategies and how one is chosen
  DISCOVERY_AND_REUSE.md      the mandatory discovery gate
  DEPENDENCY_CLOSURE.md       proving tests ran against what the chain executes
  CATALOG.md                  the portfolio manifest, its verifier, and the API reference
  SECURITY.md                 audit methodology + accumulated findings
  DEPLOYMENT.md               deployment process and philosophy
  TOOLCHAIN.md                chain-matched toolchain, reusable gotchas
  CONTRIBUTING.md             authorship, commit rules, working agreements
  ECONOMICS.md                two-track economic architecture (protocol fees +
                              commercial services) — a proposal, nothing
                              deployed; not rendered on the public site
tools/
  verify_depclosure.py        the dependency-closure equivalence checker
  test_verify_depclosure.sh   its test suite (22 tests, 11 negative)
  portfolio_depclosure.sh     every deployed package with committed source in one run
  verify_catalog.py           proves the catalog against the chain and the source
  test_verify_catalog.sh      its test suite (89 tests)
  gen_api_docs.py             generates catalog/api/ from vm/qdoc; --check for drift
  test_gen_api_docs.sh        its test suite (36 tests)
  gen_site.py                 builds the cosmicbull.net static site into site/ (gitignored)
  sitemd.py                   its Markdown renderer, scoped to the measured construct inventory
  test_gen_site.sh            their test suite (193 tests, offline by assertion)
pearl/
  DEPLOYMENT.md               authoritative transaction-level records §1–§17
  INFRASTRUCTURE.md           live infrastructure catalog + known divergences
  p/                          feeledger, coinio, duebook, permbook (authored here)
  r/                          portfolio realms + pipeline working trees
catalog/
  README.md                   how to read the catalog
  applications.md             pipeline + factory application records
  primitives.md               the four /p/ primitives + the realms that use them
  portfolio.json              the same inventory, machine-readable and verified
  api/                        the exported API of every package, generated from the chain
  DISCOVERY.md                discovery record behind the manifest
  DISCOVERY_APIDOCS.md        discovery record behind the API reference
  DISCOVERY_SITE.md           discovery record behind the cosmicbull.net static build
benchmarks/
  README.md                   what has been benchmarked and what it proved
p/tally, r/upvotes            first vertical slice — local only, never deployed

Status

Pipeline applications #1–#5 and factory builds #1–#5 are live, verified, and closed. No application is currently in flight.

These are not assertions from the records. The namespace was enumerated live on pearl-1 (height 640217, block_time 2026-09-23T03:16:51Z) and returns exactly twenty-one packages — the 4 primitives, the 15 application realms, and the 2 validation helpers. fee_split_v2 and snapshot_poll are absent from the chain, and fee_split appears once.

That enumeration is no longer a hand-check. tools/verify_catalog.py re-derives it, compares it in both directions against catalog/portfolio.json, and re-proves every recorded height, transaction, byte hash and import for all twenty-one: VERIFIED — 877 checks, 0 findings on 2026-09-22. See docs/CATALOG.md for what that does and does not cover.

Using the code

Provenance answers are these the right bytes. It does not answer how do I call them. catalog/api/ does: the exported API of all twenty-one packages — signatures, doc comments, types, methods and crossing-function flags — generated from vm/qdoc on the live chain and re-checkable with tools/gen_api_docs.py --check (MATCHES — 22 pages, 372 exported symbols from 21 packages, 2026-09-22).

For realms, gnoweb's live $help view is better still and every page links to it — it carries a generated gnokey maketx call command. For the four /p/ primitives it is not: $help renders exported top-level functions only, so it shows 11 of their 67 exported symbols and none of their methods or types. Deployed bytes are immutable, so that cannot be repaired on chain. The measurement, and the decisions not to build an API service or an on-chain docs realm, are in catalog/DISCOVERY_APIDOCS.md. The site that record deferred has since been built: tools/gen_site.py renders the manifest, the API reference and the committed records into site/ — a gitignored build output, offline and hermetic by construction, serving localhost only. It is not deployed; the discovery record behind it is catalog/DISCOVERY_SITE.md.