Skip to content

docs(skill): guide testnet and mainnet funding - #34

Merged
nijoe1 merged 10 commits into
mainfrom
docs/network-funding-guides
Sep 1, 2026
Merged

docs(skill): guide testnet and mainnet funding#34
nijoe1 merged 10 commits into
mainfrom
docs/network-funding-guides

Conversation

@snissn

@snissn snissn commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a deterministic Calibration funding guide that preserves the user funding choice and rechecks balances after faucet attempts.
  • Keep tFIL, wallet tUSDFC, and Filecoin Pay funds distinct.
  • Quote existing Filecoin Pay coverage before selecting Calibration funding; request wallet tUSDFC only for an uncovered deposit shortfall.
  • Run the combined Calibration faucet only when both assets are required; partially funded wallets use only the matching asset-specific browser handoff.
  • Treat zero balances after a combined faucet claim as unconfirmed until a delayed recheck, preventing duplicate claims.
  • Add safe browser handoffs for documented faucets without inferred APIs, CAPTCHA bypasses, parallel claims, or blind retries.
  • Expand the mainnet path to quote the planned size, runway, copies, and CDN setting; preserve the estimate caveat, pass the same options to upload, request only initial FIL or USDFC shortfalls, and skip covered deposits.

Review convergence

The initial internal review found three issues: an unsafe mint fallback for auto wallets, a possible duplicate claim after an uncertain zero balance, and a repeated funding-owner question. All were fixed and re-reviewed cleanly.

Codex findings were resolved in successive rounds. Both network flows now check existing payment-account funds before requesting wallet USDFC. The Calibration flow avoids combined claims for partially funded wallets and treats any zero after a combined claim as unconfirmed until rechecked. The mainnet flow skips wallet deposit when depositNeeded is zero, labels wallet costs as an initial estimate, and carries the quoted copy/CDN settings into upload. All threads are resolved.

Validation

  • bun run test: 203 passed, 500 assertions
  • bunx biome check src tests
  • bunx tsc --noEmit
  • bun run build

Scope

Documentation and skill routing only. No CLI behavior changes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T05:34:20.857977Z ff44b20 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 60c2bcd6d2

ℹ️ 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 thread skills/foc-cli/references/mainnet-funding.md Outdated

@snissn snissn left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Codex review — changes required before merge

Reviewed on exact head 60c2bcd6d2187824dc7fc1a875b706d6fca8f361.

The funding sequence can unnecessarily require additional USDFC and overfund an existing account. Both guides should establish the actual upload size/runway/copies, inspect wallet and Filecoin Pay state, and run wallet costs before requiring wallet USDFC. alreadyCovered and depositNeeded are the authoritative answer about whether more payment funding is needed.

Concretely:

  • On mainnet, do not require both assets to “arrive” when availableFunds already covers the quoted upload; request only missing FIL for gas and any USDFC shortfall actually identified by the quote.
  • Apply the same rule to Calibration. The current “After wallet tFIL and tUSDFC are present” gate still blocks a wallet whose Filecoin Pay account is already sufficiently funded.
  • Keep wallet USDFC, total Pay funds, available Pay funds, and required deposit distinct in the final decision, not only in the displayed balance summary.

The existing unresolved inline thread identifies the mainnet instance correctly. The documented faucet URLs match the current official Filecoin resources; I found no link blocker.

GitHub does not permit a reviewer authenticated as the PR author to submit a formal REQUEST_CHANGES review, so this is posted as a blocking comment review.

@snissn

snissn commented Aug 31, 2026

Copy link
Copy Markdown
Member 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: caa77ee750

ℹ️ 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 thread skills/foc-cli/references/testnet-funding.md Outdated
@snissn

snissn commented Aug 31, 2026

Copy link
Copy Markdown
Member 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: c3aa5519e6

ℹ️ 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 thread skills/foc-cli/references/testnet-funding.md Outdated
@snissn

snissn commented Aug 31, 2026

Copy link
Copy Markdown
Member 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: 08faf2af4d

ℹ️ 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 thread skills/foc-cli/references/mainnet-funding.md Outdated
@snissn

snissn commented Aug 31, 2026

Copy link
Copy Markdown
Member 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: 0933bc234a

ℹ️ 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 thread skills/foc-cli/references/testnet-funding.md Outdated
@snissn

snissn commented Aug 31, 2026

Copy link
Copy Markdown
Member 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: 1c4f786730

ℹ️ 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 thread skills/foc-cli/references/mainnet-funding.md Outdated
Comment thread skills/foc-cli/references/mainnet-funding.md Outdated
@snissn

snissn commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 15a4da51bb

ℹ️ 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".

@snissn

snissn commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Resolved on current head 15a4da51bbf575df9f15062e371da3e6f5ad0b5b (the GPT Pro review covered 60c2bcd6d2187824dc7fc1a875b706d6fca8f361).

  • Mainnet now inspects wallet and Filecoin Pay balances, runs wallet costs for the actual upload settings, and requests only missing gas plus the reported depositNeeded shortfall.
  • Calibration follows the same order and no longer requires wallet tUSDFC when existing Filecoin Pay funds cover the upload.
  • Wallet USDFC, Filecoin Pay funds, and depositNeeded remain distinct throughout the guides.

All three requested changes are present on the current PR head. No merge performed.

@snissn
snissn requested a review from nijoe1 September 1, 2026 02:55
@nijoe1

nijoe1 commented Sep 1, 2026

Copy link
Copy Markdown
Member

Merge #35 before this. It replaces FUND_FAILED with per-asset funded / missing / unconfirmed statuses, and step 4 of testnet-funding.md still describes the old behavior. After #35 lands, rewrite step 4 to read those status fields instead of inferring outcomes from raw balances. Everything else looks good.

Copilot AI lite review requested due to automatic review settings September 1, 2026 05:31
@snissn

snissn commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

@nijoe1 ready for re-review on exact head ff44b201a444ddd9eff5134fe8ca557fbe25672f.

  • fix(wallet): report per-asset faucet outcomes #35 is merged into main and this branch now includes its per-asset wallet fund contract.
  • Calibration funding step 4 now reads fil.status and usdfc.status independently: funded stops duplicate requests, missing permits only the matching fallback, and unconfirmed requires checking the transaction/balance and stopping before any retry.
  • The top-level status is explicitly treated as summary-only.
  • docs(skill): guide wallet setup from environment #36 is also merged and incorporated cleanly.

Validation on this combined head: bun run test (212 tests / 533 assertions), Biome, TypeScript, build, and exact-head GitHub CI all pass. #34 remains open and unmerged.

Copilot AI 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.

Pull request overview

This PR updates the foc-cli “skill” documentation to provide clearer, deterministic funding guidance for both Calibration testnet and mainnet, emphasizing balance checks, separation of wallet vs Filecoin Pay funds, and safe faucet/browser handoffs.

Changes:

  • Updates the main SKILL guide to point to a dedicated Calibration funding reference with balance-checking guidance.
  • Adds a new Calibration (testnet) funding workflow describing when to use wallet fund vs browser-based faucet fallbacks and how to interpret per-asset statuses.
  • Expands the mainnet funding reference with an explicit agent workflow (balance → costs → shortfall-only acquisition guidance → confirm → deposit/upload gating).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
skills/foc-cli/SKILL.md Updates funding section to link to the new testnet funding reference and clarify mainnet workflow reference.
skills/foc-cli/references/testnet-funding.md New Calibration funding guide with balance-first workflow and safe faucet fallback ladder.
skills/foc-cli/references/mainnet-funding.md Adds a step-by-step mainnet workflow emphasizing shortfall-only funding guidance and conditional deposit/upload steps.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nijoe1 nijoe1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@nijoe1
nijoe1 merged commit 25f905e into main Sep 1, 2026
2 checks passed
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.

3 participants