Skip to content

docs: add spark-regtest skill - #2008

Open
jvsena42 wants to merge 12 commits into
masterfrom
docs/spark-regtest-skill
Open

jvsena42 wants to merge 12 commits into
masterfrom
docs/spark-regtest-skill

Conversation

@jvsena42

@jvsena42 jvsena42 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Twin: synonymdev/bitkit-ios#1403

Related: #1814, synonymdev/bitkit-docker#42

Description

  • Adds the spark-regtest plugin and skill (docs: update docs and agent skills for the Blocktank sunset and Spark #1814, Part B). It covers only what a reader can't get from the docs and script headers: which Spark regtest to pick, that neither shares a chain with Blocktank's staging regtest, the build settings and ports, the E2E=true gate on the local stack, funding, and mining with ./spark. Details are left to bitkit-docker/docs/spark-regtest.md and the headers of scripts/spark-regtest-esplora.py and scripts/spark-regtest-fund.py.
  • Registers the plugin in marketplace.json and both README plugin lists.

Out of Scope

  • The manual channel skill, the Spark exit inspection skill, docs/spark.md, the emergency exit doc and the AGENTS.md, docs/transfer.md and docs/receive-liquidity.md rewrites (docs: update docs and agent skills for the Blocktank sunset and Spark #1814, Part B).
  • A Synonym-hosted Spark regtest peered with staging: Host a Spark regtest network in the staging deployment bitkit-docker#42.
  • With the local stack, Android turns off Transfer to Spending and exit fees paid from Savings (Env.sparkSharesNodeChain is false whenever local Spark settings are set). iOS allows both when its URLs match the fixture (Env.sharesLocalSparkChain). The skill documents Android's behaviour. Whether Android should match iOS is a code question for a separate PR.
  • bitkit-docker docs/spark-regtest.md leaves out E2E=true from the Android build line, and on iOS it suggests SIMCTL_CHILD_ launch variables, which don't work. The skill is correct on both, but the doc itself is unchanged here.

Design

N/A — no UI changes.

Preview

N/A

QA Notes

Setup

N/A — documentation only.

Journeys

N/A — no user-visible behaviour change.

Manual Tests

N/A

Automated Checks

N/A

Evidence

  • claude plugin validate .claude/plugins passes. Its only warning is the missing /plugin install line, which blocktank-api also lacks.

  • An independent review checked each claim against the sources. These findings are fixed in 4a7d080:

    • the local-stack build needs E2E=true;
    • the hosted regtest claims after 3 confirmations, not 1;
    • Android's local-stack funding limits;
    • phone hosts for the local stack;
    • the proxy's 3 h stop and the ESPLORA_URL sources;
    • mainnet key content removed.
  • I checked each claim against origin/master at 2c70a74 and its siblings:

    • ESPLORA_URL, SPARK_LOCAL_CONFIG_B64, SPARK_LOCAL_CHAIN_URL and BREEZ_API_KEY in app/build.gradle.kts;
    • iOS Env.localSparkSettings;
    • the script usage lines;
    • bitkit-docker main docs/spark-regtest.md;
    • bitkit-e2e-tests main README.md and scripts/run-spark-e2e.sh.
  • Round 2 (4dce3c3), from ovi-reviewer's comments and an independent review:

    • the local build blanks a saved ESPLORA_URL and sets E2E_BACKEND=local;
    • the skill names the argument each ./spark funding command takes;
    • hosted step 5 covers a payment between two devices;
    • uninstall or Reset To Default for an existing dev install, which saves the old Electrum default (ported from the iOS review);
    • the sibling-checkout and worktree paths, and where ./spark runs.
  • Proof for the ESPLORA_URL fix: with -PESPLORA_URL=http://saved:3999, generateDevDebugBuildConfig writes ESPLORA_URL = "http://saved:3999". With ESPLORA_URL= added, it writes "".

  • Round 3 (51b4a95), from piotr-iohk's QA review: on Android, Reset To Default only fills the Electrum form. The skill now says to tap Connect To Host after it. iOS connects on reset, so the twin is unchanged.

Gaps

  • I did not run the skill's steps end to end on a device for this PR.

Models used

  • Planning/scoping: Claude Opus 5.5 (reasoning: Not exposed)
  • Implementation: Claude Opus 5.5 (reasoning: Not exposed)
  • Review: Claude Opus 5.5 (reasoning: Not exposed)
  • Review rounds: 3

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 6e84867 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jvsena42
jvsena42 marked this pull request as ready for review November 24, 2026 12:45
@jvsena42
jvsena42 requested review from a team, ovitrif and piotr-iohk and removed request for a team November 24, 2026 12:45

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No findings. Adds a spark-regtest Claude Code plugin (marketplace entry, plugin.json, README, SKILL.md) and lists it in README. Reviewed 4a7d080, light tier (docs only), static: nothing to build.

What I checked, and 1 candidate I ruled out

Claims checked against code on the PR head

  • ESPLORA_URL is read through localProp (env, Gradle property, local.properties, keychain), the same sources as BREEZ_API_KEY, and Env.regtestEsploraUrl applies it only on regtest, i.e. the dev flavor.
  • Env.sparkSharesNodeChain is network != REGTEST || (localSpark == null && regtestEsploraUrl != null): hosted regtest without ESPLORA_URL shows Transfer Unavailable, and the local stack turns Transfer to Spending off, as the skill says.
  • Env.localSparkSettings needs isDebug && isLocalE2eBackend && network == REGTEST; E2E defaults to false and E2E_BACKEND to local in build.gradle.kts, so E2E=true is the one switch. ElectrumServers.REGTEST.LOCAL is tcp://${e2eLocalHost}:60001, default host 10.0.2.2.
  • scripts/spark-regtest-esplora.py: --port, --bind, --max-seconds with default 10800 (3 h). scripts/spark-regtest-fund.py: SPARK_REGTEST_MNEMONIC and uv run usage match.
  • The adb reverse port list matches bitkit-docker/docs/spark-regtest.md; SPARK_PUBLIC_HOST exists there.
  • .claude/install-plugins.sh installs every dir with a .claude-plugin/plugin.json, so the new plugin is picked up.
  • The iOS line ("allows both when its URLs match the fixture") matches Env.sharesLocalSparkChain in bitkit-ios.

Ruled out

  • Red build check: the Require build, unit tests, and Compose UI tests gate of run 45396445003, which was cancelled and superseded by run 45396542193 on the same head (build-and-test, lint and detekt green there, Compose UI tests still running).

Merge confidence: 5/5, a docs change no test applies to, its references checked against the code.

Reviewer model: claude-opus-5-5
Reasoning effort: Unknown (the reviewing session's run metadata does not report an effort setting)

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA review

Scope: full PR diff against its merge base, at 4a7d080.

No new actionable code findings.

All technical claims, Gradle/build-config flags, ports, UI navigation paths, and plugin registration entries in the new spark-regtest plugin and README.md match the pinned Android source (app/build.gradle.kts, Env.kt, LightningService.kt, SparkService.kt, SparkRepo.kt, SparkExitRepo.kt, ContentView.kt, scripts/spark-regtest-esplora.py, scripts/spark-regtest-fund.py, and .claude/install-plugins.sh), synonymdev/bitkit-docker main at ad995c1, and synonymdev/bitkit-e2e-tests main at 991bbfb.

Compared against twin synonymdev/bitkit-ios#1403 at 9321951: both skills stay aligned on shared Spark regtest behaviour while accurately reflecting platform differences (Android's ESPLORA_URL proxy support, Android disabling Transfer to Spending and Savings-paid exit fees on the local stack via Env.sparkSharesNodeChain versus iOS enabling both via Env.sharesLocalSparkChain, and each repository's skill/plugin layout).

Validation and limitations: verified git diff --check (clean) and JSON syntax of .claude/plugins/.claude-plugin/marketplace.json and .claude/plugins/spark-regtest/.claude-plugin/plugin.json locally; claude CLI is unavailable in this environment, so claude plugin validate .claude/plugins was not independently re-run (the author reports it passed). On CI for 4a7d080, compose-ui / ui-tests in run 45396542193 was still in progress at inspection time. No open or unresolved prior review threads exist on the PR.

Device testing: not performed in this review (no runtime app code changed; documentation and Claude Code plugin files only).

Reviewer model: gemini-4-neon
Reasoning effort: high

@jvsena42
jvsena42 enabled auto-merge (squash) November 24, 2026 13:15
@jvsena42
jvsena42 disabled auto-merge November 24, 2026 13:20
@jvsena42
jvsena42 enabled auto-merge November 24, 2026 13:20

@ovi-reviewer ovi-reviewer 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.

Verdict: ✅ Approve

Findings:

  • LOW .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md:60 — A saved ESPLORA_URL keeps Savings on the hosted proxy when switching Spark to the local fixture. Clear the override in the local build command. Chain source selection
  • LOW .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md:62 — ./spark pay takes a BOLT11 invoice. Spell out which funding command takes the deposit address. Fixture commands
  • LOW .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md:19 — The hosted recipe stops at funding. Add the Spending invoice step for the two-device payment in Part B. Docs scope, prior device evidence

QA for 4a7d080:

Install the Spark regtest plugin from the repository ✅ The installer enabled the plugin and copied the skill into Claude Code's plugin cache.

Ran ./.claude/install-plugins.sh in a fresh Claude Code profile, verified the enabled plugin with claude plugin list --json, and compared the installed skill with the PR file.

git diff --check passed. claude plugin validate .claude/plugins passed with metadata and README advice. CI for 4a7d080 also passed.

Device testing was skipped because the diff only changes the plugin and documentation. The full review from 2c70a74 to 4a7d080 covered registration, build flags, fixture ports, funding commands, and both Spark backends. The hosted and local wallet flows were checked against the source and the existing Android QA review.

Twin synonymdev/bitkit-ios#1403 matches the backend guidance and shares the missing hosted payment step. Its local build enables Transfer to Spending and Savings-paid exit fees when its Spark and Electrum endpoints match the fixture.


Reviewed by gpt-6.2-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@jvsena42
jvsena42 marked this pull request as draft November 24, 2026 14:44
auto-merge was automatically disabled November 24, 2026 14:44

Pull request was converted to draft

jvsena42 and others added 5 commits November 24, 2026 11:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jvsena42
jvsena42 marked this pull request as ready for review November 24, 2026 14:49
@jvsena42
jvsena42 enabled auto-merge November 24, 2026 14:49
@jvsena42
jvsena42 requested a review from ovitrif November 24, 2026 14:50

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA review

Scope: changes since 4a7d080, including affected code paths and prior findings, at 4dce3c3. Baseline: QA review.

1 actionable finding — resolve or provide an evidence-backed rebuttal.

The new local-stack note tells an existing dev install to tap Reset To Default. That control fills the Electrum form. Connect To Host is what saves the server, so Savings stays on the previously saved server until that second tap. Uninstall still clears it.

The three threads on the earlier review are resolved, and the fixes hold at this head. An empty ESPLORA_URL overrides a saved Gradle property and local.properties under Gradle 9.9.0, including on a warm daemon. ./spark send <address> <sats> and ./spark pay <invoice> [sats] match bitkit-docker spark at ad995c1. Hosted step 5 matches Receive › Spending and a regtest Spark Lightning payment.

Compared the changed guidance with bitkit-ios#1403 at e2d7e1d, only for this skill. That is not a review of the iOS pull request. On iOS, Reset To Default connects and saves. On Android, Reset To Default fills the form and Connect To Host saves.

Device testing: not performed in this review. This delta is the skill text.

Suggested additional test cases:

  • Android, an existing dev install that already opened a non-E2E dev build, then the local ./spark build from the skill. Open Settings › Advanced › Electrum Server and tap Reset To Default. The connected server stays the previous one. Tap Connect To Host and it becomes E2E_LOCAL_HOST:60001.

Findings

  • [LOW] Tell the local-stack steps to tap Connect To Host — inline at .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md:66.

Reviewer model: grok-4.7
Reasoning effort: xhigh

@jvsena42
jvsena42 enabled auto-merge November 24, 2026 15:24
@jvsena42
jvsena42 requested a review from piotr-iohk November 24, 2026 15:24

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA review

Scope: changes since 4dce3c33, including affected code paths, at 51b4a95. Baseline: previous QA review.

No new actionable code findings.

The new sentence matches the app: Reset To Default fills host, port, and protocol from Env.electrumServerUrl (tcp://<E2E_LOCAL_HOST>:60001 on a local E2E regtest build) and leaves the saved server in place. Connect To Host is enabled when that form differs from the saved server, and a successful restart persists the URL. On bitkit-ios#1403 at e2d7e1d0, Reset To Default connects immediately, and that skill still stops at Reset. Only this Electrum step was compared, not a full review of the twin.

Inherited from the baseline: plugin registration, the hosted-regtest steps, the unchanged local-stack guidance, and the unchanged remainder of the previous skill follow-up (sibling checkout, two-device payment, the local build line, uninstall, and ./spark arguments). Device testing: not performed in this review. The follow-up is documentation only; git diff --check on the delta reported no whitespace errors. No app runtime check is needed for this wording, which is fixed by the current Electrum screen and restart path.

Earlier findings reconciled at this revision: 1 verified fixed.

Reviewer model: grok-4.7
Reasoning effort: xhigh

@ovi-reviewer ovi-reviewer 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.

Verdict: ✅ Approve

Findings:

  • LOW .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md:58 — From a nested worktree, the documented command can invoke Gradle with an empty Spark config and produce a build that cannot connect to the local Spark fixture. Resolve the bitkit-docker path and check config generation before invoking Gradle. Local Spark configuration check

QA for 51b4a95:

Install the Spark regtest plugin from the repository ✅ The installer enabled the plugin and copied the updated skill byte for byte.

Ran the repository installer in an isolated Claude Code profile, checked the enabled plugin entry, and compared the installed skill with the PR file. Marketplace validation passed with metadata warnings.

git diff --check passed. The delta from 4a7d080 to 51b4a95 and four prior fixes were reviewed. Device runs were skipped because the app is unchanged and the PR lists no device cases. Electrum persistence was checked against source. The hosted payment guidance also matches the earlier two-device result in synonymdev/bitkit-android#1697. Electrum QA review

Twin synonymdev/bitkit-ios#1403 matches the hosted payment and fixture funding guidance. Its Reset To Default action connects and saves in one step.



Reviewed by gpt-6.2-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@jvsena42
jvsena42 marked this pull request as draft November 24, 2026 17:11
auto-merge was automatically disabled November 24, 2026 17:11

Pull request was converted to draft

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jvsena42
jvsena42 marked this pull request as ready for review November 24, 2026 17:12
@jvsena42
jvsena42 enabled auto-merge November 24, 2026 17:12

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA review

Scope: changes since 51b4a95, including affected code paths and prior findings, at 9f9197b. Baseline: previous QA review.

No new actionable code findings.

No new actionable code findings in the follow-up.

The local-stack build line now saves spark config --base64 into CFG and runs Gradle only if that succeeds. A bash 5.1 probe confirmed the old behavior: the inline form ran the command with an empty value and exit status 0. The new form stops with the substitution's exit status. zsh was not available here, so it was not probed; the author reports the same result in zsh. At bitkit-docker ad995c1, ./spark config exits 1 when its config file is missing, so the guard triggers there. A wrong script path also stops the build. The new note's explanation also matches the app: an empty config plus a chain URL makes LocalSparkSettings.isComplete false, so configureLocalSpark throws (SparkService.kt L103-L110). One small point: the config file stays in place after ./spark down until ./spark reset, so "stack not up" is approximate, but the guard still stops the build in the cases that matter.

The twin bitkit-ios#1403 at 39466ad has the same CFG=… && guard. Only this build line was compared, not a full review of the twin.

Prior concerns at this revision: the ovi-reviewer thread asking to stop the build when config generation fails is fixed and verified at this head. Its main-checkout-sibling advice was already in the skill. The earlier QA finding about tapping Connect To Host after Reset To Default stays fixed; that text did not change in the delta.

Inherited from the baseline: the Electrum Reset/Connect wording, plugin registration, the hosted-regtest steps, the unchanged local-stack guidance, and the unchanged remainder of the earlier skill follow-up, except the build line, which was reassessed here. git diff --check on the delta reported no errors. Device testing: not performed in this review. This is a docs-only change, and the app is unchanged, so no runtime check is needed.

Reviewer model: claude-opus-5-5
Reasoning effort: high

@ovi-reviewer ovi-reviewer 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.

Verdict: ✅ Approve

Findings:

  • LOW .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md:58 — The guard skips Gradle when config generation fails, but the full block still runs adb reverse. If the last mapping succeeds, the block returns 0 without building an APK. An agent can then proceed with a stale build. Run the port-forwarding loop only after Gradle succeeds.

QA for 9f9197b:

Stop the local Spark build when config generation fails ✅ Gradle was skipped when the fixture path or generated config was missing.

Ran the build lines in Bash and zsh with the fixture's spark config command and a Gradle stub. With the config present, Gradle received the expected local settings. In a separate probe of the complete block, successful adb reverse stubs masked the failure exit status described above. Earlier QA review of the build guard

Install the Spark regtest plugin from the repository ✅ The installer enabled the plugin and installed the updated skill byte for byte.

Ran the repository installer in an isolated Claude Code profile and compared the installed skill with the PR file. Marketplace validation passed with metadata warnings.

git diff --check passed. Device testing was skipped because the PR changes only the plugin and documentation and lists no device cases. The delta from 51b4a95 to 9f9197b covers the local build recipe and fixes the earlier incomplete-config build. Prior finding

Twin synonymdev/bitkit-ios#1403 uses the same config guard and also gates simulator installation on a successful build.


Reviewed by gpt-6.2-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the updated Spark regtest guide at 9f9197b1. All required checks passed. I verified with stub commands that a missing config skips Gradle. The open recipe thread covers the remaining edge case: the port-forwarding loop still runs and can return success without building an APK.

Nonblocking wording suggestion: replace “ask the user” with “Ask the developer to set SPARK_REGTEST_MNEMONIC locally, or use the web faucet. Keep the mnemonic out of chat.”

@jvsena42
jvsena42 marked this pull request as draft November 25, 2026 08:34
auto-merge was automatically disabled November 25, 2026 08:34

Pull request was converted to draft

jvsena42 and others added 3 commits November 25, 2026 05:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jvsena42

Copy link
Copy Markdown
Member Author

@piotr-iohk Applied your wording suggestion in 0a740d9 (and bitkit-ios#1403 in 34011269a): "The mnemonic is a GitHub secret. Ask the developer to set it locally, or use the web faucet. Keep it out of chat."

@jvsena42
jvsena42 marked this pull request as ready for review November 25, 2026 08:35
@jvsena42
jvsena42 enabled auto-merge November 25, 2026 08:35
@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The documentation and plugin registration appear safe to merge.

Summary

Adds the spark-regtest Claude Code plugin and documents hosted and local Spark development.

  • Developers can find the Spark regtest skill and pick a network.
  • Hosted Spark regtest builds use Lightspark's chain.
  • Local Spark builds connect to bitkit-docker's ./spark stack.

Reviews (1) · Last reviewed commit: "docs: stop the local spark build when sp..." · Reviewed by Greptile

@ovi-reviewer ovi-reviewer 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.

Verdict: ✅ Approve

Findings:

  • LOW .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md:58 — The added unqualified spark up resets a previously configured LAN host to loopback. Following the LAN-phone instructions and then this build recipe regenerates operator and SSP URLs pointing at the phone itself. Keep SPARK_PUBLIC_HOST set for the chained startup. Verified by running the fixture's real initialization script twice against the same isolated config directory. Compose host default, config generation

QA for 6e84867:

Stop before stale config after fixture startup fails ✅ Both Bash and zsh skipped config generation, Gradle, and port forwarding.

Replayed the recipe at 6e84867 with the real spark helper and a failing Docker stub, leaving an old config file present. Both shells preserved exit 23.

Stop before Gradle when config generation fails ✅ Both shells preserved failure and skipped Gradle and port forwarding.

With startup stubbed successful, the guarded config command returned early: the real config command returned 1 for a missing config file. A missing fixture path returned 127. Neither path invoked Gradle or adb.

Skip port forwarding when Gradle fails ✅ Both shells returned the build failure without calling adb.

A Gradle stub returned 31; the complete recipe returned 31 and made no port-forwarding calls. This confirms the prior finding is fixed.

Pass local settings and forward ports after a successful build ✅ Both shells passed the documented settings and then forwarded all six ports.

Replaying the build and port mappings, a successful Gradle stub received assembleDevDebug, the generated synthetic config, blank ESPLORA_URL, E2E=true, E2E_BACKEND=local, and the chain URL. The adb stub then received the six documented mappings in order. These are command-level probes; no APK was built or installed.

git diff --check passed. Marketplace validation passed with existing metadata warnings. The unchanged plugin installation mechanism is covered by the previous review.

Reviewed the delta 9f9197b..6e84867 and the prior port-forwarding finding. The mnemonic guidance matches the funding script's environment input. Device testing and an app build were skipped: this is documentation-only, the app is unchanged, and the PR lists no device cases. The shell probes do not verify live fixture readiness or wallet flows.

Twin synonymdev/bitkit-ios#1403 at 3401126 matches the startup/build failure guards and revised mnemonic guidance; only those skill sections were compared.


Reviewed by gpt-6.1-sol-high

it, the build silently stays on the hosted regtest.

```bash
../bitkit-docker/spark up && \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LOW: Preserve the public host on the chained Spark startup.

The LAN-phone instructions below start the fixture with SPARK_PUBLIC_HOST=<LAN IP> ./spark up, then apply LAN overrides to the build. That inline variable is gone when this newly added, unqualified spark up runs. Compose defaults PUBLIC_HOST to 127.0.0.1, and its init script rewrites the existing operator and SSP URLs, so the resulting phone build points Spark at the phone's own loopback. I reproduced that rewrite with the fixture's real init script. Export SPARK_PUBLIC_HOST for the whole recipe, or tell the LAN instructions to set it on this chained startup. Compose default, config generation.

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA review

Scope: changes since 9f9197b, including affected code paths and prior findings, at 6e84867. Baseline: QA review.

1 actionable finding — resolve or provide an evidence-backed rebuttal.

The local build block now starts with an unqualified spark up. After the LAN steps set SPARK_PUBLIC_HOST, that second startup rewrites operator and SSP URLs to 127.0.0.1 before Gradle bakes the config in.

The port-forwarding thread (discussion) is fixed at this head. In bash 5.2.21, dash, and zsh 5.9, a failed spark up, spark config, or Gradle skips adb reverse and keeps the failing status. The hosted mnemonic line now says to set the secret locally or use the web faucet and to keep it out of chat. scripts/spark-regtest-fund.py reads SPARK_REGTEST_MNEMONIC from the environment and does not print it. On bitkit-ios#1403 at 3401126, only the startup guard and mnemonic wording were compared, not a full review. That skill uses the same guard and has no LAN public-host step.

git diff --check on the delta was clean. Device testing was not performed. The app is unchanged. Docker was not run; the rewrite follows init.sh and Compose's up contract, and a probe of the same URL builder showed a LAN host replaced by 127.0.0.1. No open issue matched this mechanism.

Suggested additional test cases:

  • Android, local ./spark stack already started with SPARK_PUBLIC_HOST=<LAN IP> ./spark up. Run the skill block's unqualified ../bitkit-docker/spark up, then ../bitkit-docker/spark config. Operator and SSP URLs should still use the LAN IP.

Findings

  • [MEDIUM] Pass the LAN host into the chained spark up — inline at .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md:58.

Reviewer model: grok-4.7
Reasoning effort: xhigh

it, the build silently stays on the hosted regtest.

```bash
../bitkit-docker/spark up && \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[MEDIUM] Pass the LAN host into the chained spark up

After the LAN phone steps start the fixture with SPARK_PUBLIC_HOST=<LAN IP> ./spark up, running the local build block rewrites that host to loopback and bakes it into the app.

The LAN note (SKILL.md:78-80) sets SPARK_PUBLIC_HOST only on that one ./spark up, then says to build with the LAN IP in E2E_LOCAL_HOST and SPARK_LOCAL_CHAIN_URL. The build block now begins with an unqualified ../bitkit-docker/spark up (SKILL.md:58). The prefix does not carry into that later command. spark runs docker compose --profile spark up -d with no --no-recreate (spark:9 and spark:75 at bitkit-docker ad995c1a07567cd06139cbacbbad73e458527fdd). Root docker-compose.yml includes spark-regtest/compose.yml, where spark-init sets PUBLIC_HOST from ${SPARK_PUBLIC_HOST:-127.0.0.1} (compose.yml:105). Compose recreates a service when that configuration changes. init.sh:102-106 and init.sh:137-139 write spark-config.json on every run, with operator URLs http://$PUBLIC_HOST:23535 (and 23536, 23537) and the SSP at http://$PUBLIC_HOST:23049. The next line of the block reads that file into SPARK_LOCAL_CONFIG_B64, and SparkService.configureLocalSpark passes it to the SDK as sparkConfig (SparkService.kt:107).

A phone on the LAN then dials the operators and the SSP at its own loopback, so Spark does not connect. Starting again with SPARK_PUBLIC_HOST set and rebuilding restores the URLs.

The chained spark up should receive the same SPARK_PUBLIC_HOST, or the LAN steps should say to set it on that command.

Evidence basis: source analysis of the skill, spark, the Compose include, and init.sh at ad995c1a07567cd06139cbacbbad73e458527fdd. A bash/jq probe of the same URL construction wrote http://192.168.1.50:23535, :23536, :23537, and SSP http://192.168.1.50:23049, then http://127.0.0.1 for those ports when the host was 127.0.0.1. Docker's compose up documentation says existing containers are recreated when the service configuration changes. This review did not run the Docker daemon. The same mechanism is in discussion. No matching GitHub issue was found.

This branch has not been deployed

No deployments
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.

4 participants