Skip to content

feat(independent): gate one verified miner axon announcement - #150

Merged
wallscaler merged 4 commits into
mainfrom
codex/miner-axon-announce-20260828
Aug 28, 2026
Merged

wallscaler merged 4 commits into
mainfrom
codex/miner-axon-announce-20260828

Conversation

@wallscaler

@wallscaler wallscaler commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Outcome target

Make one already-registered Cathedral miner eligible to appear as a serving SN39 axon without joining rent, registration, server startup, or weight submission.

The default operation creates an immutable no-chain-write review packet for the exact pinned miner at one globally routable IPv4 address on HTTPS port 8081. The live operation remains behind the reviewed SHA256, explicit confirmation, an all-other-announcers-stopped assertion, fresh TDX/QVL and canonical SAT evidence, and a durable no-retry journal. Success means the endpoint is present in a finalized SN39 readback. Any uncertain result becomes AMBIGUOUS_DO_NOT_RETRY.

This PR is stacked on #148 and must not merge first.

Exact launch invariant

  • Network: Finney, netuid 39.
  • Miner hotkey: 5CJTD6znKPfsQFjPQtTvRiHHcLtpXJr7P16dF4VuEtx9qn7G.
  • Owning Cathedral coldkey: 5G6mgvL59o6AM8rFRYbbUpbzjjGwcVLUidpQ1vsz5UkZyw2o.
  • Evidence collector: Cathedral UID30 hotkey 5FF6FtDUhn7XdPYmEdH5XjLAmLfmwLTCNVBgcrj3A4sstwaw.
  • Endpoint: one canonical globally routable IPv4 address, exact port 8081, HTTPS.
  • Permitted call: at most one SubtensorModule.serve_axon attempt with finalization requested.
  • Forbidden here: rent, miner registration, server startup, registration burn, weight construction, and weight submission.
  • Downstream weight target remains separate: one verified miner at exact u16 [65535], 100% verified miner and 0% burn.

Acceptance targets

  • Refuse unless the pinned miner is registered exactly once on finalized SN39 and its row carries the pinned Cathedral coldkey.
  • Refuse noncanonical, private, reserved, IPv6, or otherwise nonglobal addresses and any port other than 8081.
  • Require verifier SHA256 35bb55f89f411d5dcf5f72be90488e999ee68c41dfc0429a0dcb8cc2b448b6bb.
  • Require a fresh UID30-attributed nonce, TDX REPORT_DATA/QVL PASS for the miner hotkey and observed TLS SPKI, and positive canonical SAT from the same SPKI.
  • Re-read finalized registration and axon state before and after evidence collection. Refuse UID, owner, endpoint, or finalized-head drift.
  • Write canonical JSON and detached SHA256 as new owner-controlled mode-0600 files. Never overwrite a prior review artifact.
  • Require exact reviewed bytes, detached digest, canonical runtime root, pinned signing wallet, process lock, explicit exclusivity assertion, and explicit confirmation before serve_axon.
  • Persist intent before the SDK call. Wait for inclusion and finalization. Require exact finalized IP, port, serving flag, miner hotkey, coldkey, and UID readback.
  • On uncertainty, preserve a no-retry fence. Recovery reads finalized state and never resubmits.

Trust boundaries

The IP-literal HttpsEvidenceTransport observes the self-signed leaf SPKI. Authentication comes from fresh TDX REPORT_DATA/QVL binding that SPKI, followed by canonical SAT over the same SPKI. The ordinary CA and hostname-validated miner client remains incompatible.

QVL PASS verifies the quote and requested REPORT_DATA under the pinned verifier. It does not prove the OCI image digest. Image provenance and the immutable digest remain separate evidence.

The local process lock is enforced. A remote duplicate announcer is not detectable through local flock. The all-other-hosts-stopped assertion remains an operator responsibility and is recorded in the journal.

Verification

  • Root focused recheck: 36 passed in tests/thin/test_miner_axon_announce.py.
  • Full focused plus existing independent-validator set: 640 passed.
  • Ruff check and format check passed for 128 files.
  • Compile-all passed.
  • Wheel and sdist build passed. The wheel contains both axon modules and the cathedral-independent-miner-announce entry point.
  • git diff --check passed.
  • No endpoint, wallet signature, paid resource, registration, announcement, or weight write was exercised.

Deployment target

  1. Merge and publish the reviewed Sandbox audit-miner image and record its immutable public digest.
  2. Deploy the corrected Polaris SN39 provisioning path with the same digest. Prove TDX guest state, public TCP 8081, exact firewall cleanup, and both evidence contracts.
  3. Register the pinned miner through a separate reviewed mainnet action and record its finalized UID and Cathedral coldkey ownership.
  4. Stop every other process able to announce this miner.
  5. Create and review the no-write axon packet.
  6. Perform one explicit announcement attempt. Preserve the journal and finalized readback.
  7. Only then create the separate UID30 100% verified-miner, 0% burn weight preview.

Rollback and failure behavior

  • Before intent is journaled, failures are no-chain-write refusals. Fix the prerequisite and create a new artifact at a new path.
  • After intent is journaled, never rerun announce. Use read-only recover with the same preview and digest.
  • A code revert after a finalized announcement does not revert the on-chain axon row. Replacing or removing it is a new reviewed chain action.
  • Do not delete an ambiguity journal to manufacture another attempt.

Known risks

  • The pinned miner is not yet registered. Preview must refuse until registration finalizes.
  • Public port 8081 must stay closed until the Sandbox admission fix and exact image are reviewed.
  • The OCI digest is not bound by this artifact or the current quote contract.
  • A remote duplicate announcer remains an external operational risk.
  • A network or RPC failure after signed intent can remain ambiguous. The safe outcome is no retry.
  • This PR does not estimate the serve_axon fee. Registration and total spend remain separately bounded by the approved $20 cap.

Next gate

Present one no-write packet containing the reviewed image digest and provenance, Polaris receipt and projected total cost, finalized registration UID and ownership, public TCP 8081 evidence, fresh QVL and same-SPKI SAT proof, owner-only preview plus detached digest, and confirmation all other announcers are stopped. Only that packet clears one serve_axon attempt. Finalized axon readback then clears the separate UID30 weight preview. It does not authorize weight submission by itself.


Note

High Risk
Live announce submits a single finalized serve_axon extrinsic for a pinned hotkey; ambiguous post-submit failures require manual recovery and block automatic retries, so operational mistakes can strand announcement state on mainnet.

Overview
Adds a digest-authorized SN39 miner axon announcement path for one pinned Cathedral miner on Finney netuid 39, deliberately excluding rent, registration, server startup, and weights.

preview builds an immutable owner-only JSON review packet (plus detached SHA256) from finalized metagraph state, global IPv4 HTTPS :8081, and fresh TDX/QVL + canonical SAT evidence bound to the observed TLS SPKI—without signing or submitting anything.

announce loads an exact reviewed digest, re-checks registration/coldkey/axon drift, recollects matching endpoint proof, then allows at most one serve_axon behind file locks and a durable ambiguity journal with retry_allowed: false. Uncertain SDK outcomes surface as AMBIGUOUS_DO_NOT_RETRY; recover read-only reconciles from finalized chain readback without resubmitting.

Registers console entry cathedral-independent-miner-announce and a large pytest suite covering preview validation, no-retry semantics, and Bittensor 10.5 serve_axon contract binding.

Reviewed by Cursor Bugbot for commit 8f6cdf6. Bugbot is set up for automated code reviews on this repo. Configure here.

@wallscaler
wallscaler requested a review from ai-hpc August 28, 2026 11:28
@wallscaler

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 51934fa6d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1387 to +1389
mev_protection=False,
period=ANNOUNCEMENT_PERIOD_BLOCKS,
raise_error=True,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass only supported arguments to serve_axon

With the repository-pinned Bittensor 10.5.0 runtime, Subtensor.serve_axon accepts netuid, axon, the two wait flags, and an optional certificate; it does not accept mev_protection, period, or raise_error. The real live call therefore raises TypeError before submitting anything, but the broad exception handler treats that as an uncertain submission and leaves a permanent no-retry journal, so the intended announcement cannot succeed. The injected **kwargs test double does not exercise this SDK contract.

Useful? React with 👍 / 👎.

@wallscaler

Copy link
Copy Markdown
Contributor Author

Exact-head repair outcome

Commit: a063388

Outcome target

An incompatible local Bittensor serve_axon call contract must fail before any durable no-retry intent exists. Once the exact SDK call begins, every exception remains ambiguous, preserves the journal, and forbids automatic retry until finalized read-only recovery resolves the endpoint.

Finding dispositions

  • Claimed Bittensor 10.5.0 argument mismatch: falsified against the installed release. Subtensor.serve_axon accepts mev_protection, period, raise_error, wait_for_inclusion, and wait_for_finalization. An exact installed-SDK regression now binds the production keyword set without invoking the method.
  • Permanent journal after a provable pre-call signature failure: fixed. inspect.signature(call).bind(**kwargs) runs before _journal_for_attempt and _write_state. Unsupported keyword contracts now produce a retryable, journal-free refusal and zero call attempts.
  • Post-call ambiguity behavior: preserved. The journal is still durable before entering serve_axon, and every exception after entry still routes through finalized readback with retry_allowed: false.

Verification

  • Focused exact-head suite: 38 passed.
  • Required publisher plus integration/reward-boundary slice: 270 passed, 4 skipped.
  • Ruff check and format check: 128 files passed.
  • Compile-all, git diff --check, and diff secret-pattern scan passed.
  • Claude Fable exact-patch merge review: PASS. It confirmed pre-journal binding, unchanged submitted kwargs, preserved post-journal ambiguity, and safe failure behavior.

Local environment boundary

A broad macOS run reached 1882 passed before 21 pre-existing platform/install failures and 4 skips. Failures were macOS date/sed behavior, missing /usr/bin/python3.12, the known errno-name assertion, and the unavailable installed cathedral distribution. The all-extras install also observed upstream GitHub archive bytes hashing to 02b95787... while the repository currently pins 559dd8e3.... Exact-head GitHub CI is the merge gate for this external drift.

Next gate

Keep this PR draft and stacked on #148. Require exact-head GitHub CI plus review, then merge after #148 and before #149. No wallet access, signing, axon announcement, deploy, or CyberGym change occurred.

@wallscaler

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a063388b0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1081 to +1082
state = state_loader(subtensor)
if not _same_endpoint(state, ip=ip, port=port):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bind finalized readback to the reviewed UID

If the miner is deregistered and re-registered at a different UID between preview and readback, this check accepts the new row whenever its endpoint matches, because finalized_miner_state() pins the hotkey/coldkey but _finalized_readback() never compares state.uid with the preview or journal UID. Submission and recovery can consequently record finalized_proven/finalized_recovered with a readback for a different UID than the journal identity; pass the reviewed UID into this function and reject any mismatch (and enforce the same check in the already-announced shortcut).

Useful? React with 👍 / 👎.

Port only the already-registered Cathedral miner announcement path onto the PR148 base, without rent, registration, server startup, or weight composition.

Default to an owner-only QVL and canonical-SAT preview. Require its reviewed digest, the pinned miner and Cathedral coldkey, the canonical runtime root, fresh attested-SPKI evidence, and an explicit exclusive-announcer assertion before the sole serve_axon call.

Persist the signed-intent boundary and exact finalized readback so an uncertain outcome is fenced as AMBIGUOUS_DO_NOT_RETRY and can be reconciled without resubmission.
Bind the exact Bittensor serve_axon keyword contract before the durable no-retry journal exists. This turns a provable local SDK signature mismatch into a safe pre-submission refusal while preserving ambiguity fencing for every exception after the call begins. Add regressions for incompatible callables and the installed Bittensor contract.
@wallscaler
wallscaler force-pushed the codex/miner-axon-announce-20260828 branch from a063388 to b045ce3 Compare August 28, 2026 13:21
@wallscaler
wallscaler changed the base branch from cursor/independent-v1-composer-ddda to main August 28, 2026 13:21
@wallscaler

Copy link
Copy Markdown
Contributor Author

@codex review

Refreshed-main merge gate

Exact head: b045ce35b3ae93cff10a94b8205bfd4f3685a101
Base: main at merged PR #148 commit 0350dcd8025c99ed3d788d14fe773ce0f92de613

Outcome target

An incompatible local Bittensor serve_axon call contract must fail before any durable no-retry intent exists. Once the exact SDK call begins, every exception remains ambiguous, preserves the journal, and forbids automatic retry until finalized read-only recovery resolves the endpoint.

Rebase proof

The two reviewed commits were replayed without conflict. Their stable patch IDs are unchanged:

  • Axon announcement feature: ec6fbe025da40de550ba118cdf513ae2faf259d0
  • Pre-intent SDK validation repair: 1dea0ec9a631bd4d3681a745a416c2784646d02a

Local verification on the rebased head

  • Focused axon suite: 38 passed.
  • Shared publisher plus integration/reward-boundary slice: 270 passed, 4 skipped.
  • Ruff check passed across the 129-file validator review scope.
  • All three changed Python files pass Ruff format.
  • Compile-all, git diff --check, and diff secret-pattern scan passed.
  • The wider format scope reports only scaffold/validator_thin.py, inherited unchanged from refreshed main; it is outside this PR diff.

Merge gate

Keep draft until exact-head GitHub CI, this exact-head Codex review, and the scoped Claude Fable review complete. No wallet access, signing, axon announcement, broadcast, deployment, or CyberGym change occurred.

@wallscaler

Copy link
Copy Markdown
Contributor Author

PM after #148 merge. Base is now main @ 0350dcd, head b045ce3. Keep draft. Exact-head CI in progress — do not merge until green + Fable. No serve_axon, no wallet, no broadcast.

Pin the published GHCR index digest next (same pin PolarIS #1163 must use):
ghcr.io/cathedralai/cathedral-sn39-audit-miner@sha256:afdc51a931dec1433981166033cffcebecb8fc3d432b65a6500063bd6a06b032

#149 waits. CyberGym #146/#147 stay held. Did not ping Astro.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b045ce35b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1431 to +1432
receipt = _receipt_fields(response)
if getattr(response, "success", None) is not True:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Treat response parsing failures as ambiguous

If serve_axon returns a malformed or partially populated SDK response—for example, a receipt with an invalid hash/block number or a property that raises—_receipt_fields(response) throws after the call may already have signed or broadcast. Because this statement is outside the post-call exception handling, the CLI reports REFUSED_NO_CHAIN_WRITE rather than AMBIGUOUS_DO_NOT_RETRY, even though the no-retry journal already exists and the chain outcome is unknown. Route response inspection failures through the same ambiguous readback/persistence path as call exceptions.

Useful? React with 👍 / 👎.

Treat every response-inspection failure after serve_axon entry as ambiguous because the announcement may already be on chain. Preserve the durable no-retry journal, prove the exact Bittensor 10.5.0 response contract, and cover unreadable receipt and success properties.
@wallscaler

Copy link
Copy Markdown
Contributor Author

@codex review

Post-call ambiguity repair

Exact head: 8a60f8919354031ac2960560b75f988fcfabccd5

Outcome target

After serve_axon begins, no SDK exception or response-inspection failure may be labeled a pre-chain refusal. The code must either prove the authorized endpoint from finalized chain state or preserve a durable submission_ambiguous journal with retry_allowed: false.

Review dispositions

  • P1 post-call receipt parsing outside the ambiguity fence: fixed. _receipt_fields(response), including .success and .extrinsic_receipt access, now runs behind the durable post-call recovery fence. Any parsing or property failure routes through finalized readback as SDK_RESPONSE_UNPROVEN.
  • Adversarial coverage: added for raising extrinsic_receipt and success properties. Both cases make exactly one serve_axon call, journal submission_ambiguous, retain retry_allowed: false, and refuse a second call.
  • P2 SDK response-shape concern: falsified against the locked and installed Bittensor 10.5.0. Subtensor.serve_axon returns ExtrinsicResponse, whose dataclass defines .success and .extrinsic_receipt. The installed-contract test now asserts the pinned version and those fields directly.

Verification

  • Focused axon suite: 40 passed.
  • Shared publisher plus integration/reward-boundary slice: 270 passed, 4 skipped.
  • Changed-file Ruff and format checks, compile-all, git diff --check, and diff secret-pattern scan passed.
  • Exact-head GitHub CI, Codex review, and Claude Fable re-review are the remaining merge gates.

No wallet access, signing, axon announcement, broadcast, deployment, or CyberGym change occurred.

Prove the locked Bittensor 10.5.0 serve_axon return annotation is ExtrinsicResponse and the response and receipt contracts expose every field consumed by the announcement fence.
@wallscaler

wallscaler commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Exact installed-SDK evidence gate

Exact head: 8f6cdf65fd44ccabcc9b23aa70cfe775b24d7640

The remaining Fable P2 test-evidence gap is closed against the locked runtime itself:

  • typing.get_type_hints(bt.Subtensor.serve_axon)["return"] is ExtrinsicResponse.
  • The ExtrinsicResponse dataclass exposes success and extrinsic_receipt.
  • The installed concrete ExtrinsicReceipt constructor exposes extrinsic_hash, block_hash, and block_number, the exact fields production parsing consumes.
  • Locked and installed Bittensor version remains 10.5.0.

Focused axon suite remains 40 passed; Ruff and format checks pass on the touched test. The source-level post-call ambiguity repair remains unchanged from 8a60f89 and its Fable review found no P0/P1 issue. Exact-head GitHub CI, Codex, and Fable review remain required before ready/merge.

No wallet access, signing, axon announcement, broadcast, deployment, or CyberGym change occurred.

@wallscaler

Copy link
Copy Markdown
Contributor Author

Final review disposition

Exact head 8f6cdf65fd44ccabcc9b23aa70cfe775b24d7640 is merge-ready.

  • The source repair at 8a60f89 routes every post-serve_axon response-inspection exception through finalized readback or a durable ambiguous no-retry journal. Fable found no surviving P0/P1 in the repair.
  • The test-only follow-up at 8f6cdf6 binds the exact installed Bittensor 10.5.0 return and receipt contracts. Exact-patch Fable verdict: PASS.
  • GitHub Codex independently identified the same post-call P1 on the prior head; the repair and adversarial raising-property tests directly close its failure path.
  • Exact-head CI: Python 3.11 PASS, Python 3.12 PASS, Publisher suite PASS, Integration lane PASS.
  • Local: focused 40 passed; shared 270 passed, 4 skipped; scoped Ruff, format, compile, diff, and secret-pattern checks pass.

Trust boundary: this is source and test proof only. No wallet access, signing, axon announcement, broadcast, deployment, or CyberGym change occurred. Live finalized chain state remains a later operator-gated proof.

@wallscaler
wallscaler marked this pull request as ready for review August 28, 2026 13:34
@cursor

cursor Bot commented Aug 28, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_94b79247-b17c-4d8c-aa38-d8620d25900d)

@wallscaler
wallscaler merged commit b4cbe46 into main Aug 28, 2026
7 checks passed
@wallscaler

Copy link
Copy Markdown
Contributor Author

PM note after merge: this is source/test proof only (b4cbe46 on main). Live cathedral.computer catalog unchanged; no site deploy chase. No wallet / serve_axon / broadcast from this PR.

Next gates remain external: PolarIS #1163 digest pin + bounded TDX worker, finalized miner registration under Cathedral coldkey, no-write axon packet, then one announce. #149 UID30 100/0 stays draft until rebased onto this head and CI-green. Did not ping Astro.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f6cdf65fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +847 to +848
_write_exclusive_owner_only(target, payload)
_write_exclusive_owner_only(digest_path, (digest + "\n").encode("ascii"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make preview and digest creation recoverable

If the detached-digest path already exists, or its creation fails after the JSON write (for example due to quota exhaustion), this second call raises but leaves the newly created preview behind. A retry with the same --output then fails on the first exclusive write, so a transient failure or stale .sha256 file permanently strands that output path without a complete review packet. Check both destinations before writing or remove the newly created preview when detached-digest creation fails.

Useful? React with 👍 / 👎.

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