Skip to content

Compare every change with an unmodified node before keeping it - #10

Merged
hotpixelgroup merged 6 commits into
masterfrom
lab-hardening
Oct 12, 2026
Merged

hotpixelgroup merged 6 commits into
masterfrom
lab-hardening

Conversation

@hotpixelgroup

Copy link
Copy Markdown
Owner

What this changes

Turns Bitcoin Vibes from "an AI rewrites your node" into a lab that shows what a change does: every proposal is compiled in a sandbox and run beside an unmodified node on a private chain before you are asked to keep it.

  • Two-node lab. A proposal is labelled by what was observed: no difference, local policy only, tightened, loosened, or split, with the block that was refused and the node's reason.
  • Containment. AI-written code is compiled, tested and run inside sandbox-exec (macOS) or bubblewrap (Linux). The agent gets file tools only; the unrestricted mode is gone. A shared request is treated as untrusted input.
  • The real network is a deliberate step. Typed confirmation, no starting a build whose comparison found a consensus difference, wallet and incoming connections off by default, and a plain-words alert when the node has refused a block.
  • Checks the agent cannot grade. Compile before review; Bitcoin Core's unit tests per suite, with failures named as findings; edits to tests reported; applying is a fast-forward of the revision that was built.
  • Ten ready-made experiments with a prediction first, a written explanation with sources, and a follow-up question. None needs an AI; seven need no compiler, and releases now ship the changed nodes for the other three. Ten true-or-false statements are asked before and after.
  • Install and update. Shallow-clone updates work and report truthfully; the installer can be pinned to a release and checks downloads against their SHA-256; the Mac launcher no longer updates by itself; Docker runs unprivileged and keeps saved experiments.
  • CI and releases. CI builds and runs the unit tests, checks src/ against the upstream base, and confirms each ready-made change is refused in the documented direction. Releases are gated on tests, published all-or-nothing, and carry checksums and provenance attestations.
  • Docs rewritten to match, including what the checks do not prove.

Why

A research review of the project found that a lone modified node teaches the opposite of what is true (a loosened rule "works"), that every protection was advisory, and that the checks behind the "verified" label could be written by the agent itself. The full list is in the commit messages.

How it was tested

  • 90 Python tests pass under Python 3.14 and the system Python 3.9, including the ones that drive real nodes inside the macOS sandbox.
  • All ten ready-made experiments were run through the real console; the three source changes were compiled, tested and compared, then rerun from the kept nodes.
  • A consensus change was applied, started on regtest, the reference node rebuilt from a temporary checkout, and the baseline restored.
  • Browser and accessibility checks of the landing page and demo pass in Chrome.

Not tested

  • A live AI session. The agent path was driven with a stand-in program only.
  • Linux. The bubblewrap arguments have never run on a Linux machine; the CI job in this PR is their first real test.
  • Docker, the Mac app, the release workflow, signing and notarisation. None can run locally.
  • Shared networks. Everything ran on regtest; the mainnet rules are covered by unit tests only.
  • Whether it teaches. No learner has used it, and the lessons have not been reviewed by a Bitcoin Core contributor or an educator.

contrib/vibes/QA.md has the detail.

Checklist

  • I ran it
  • python3 -m unittest discover -s contrib/vibes/tests passes
  • UI touched: checked at 320, 390, 768 and 1440 pixels, and by an automated accessibility audit
  • User-facing claims match what the code does
  • src/ is not touched: a fresh install still ships stock Bitcoin Core consensus

Review

  • Someone other than the author has read the diff. An independent AI review is being attached as a comment; it is advice, not approval
  • CI is green on the exact commit being merged

🤖 Generated with Claude Code

hotpixelgroup and others added 6 commits October 12, 2026 11:01
dist/ is build output and is already ignored by .gitignore; the bundle was committed by mistake. The files stay on disk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One node alone proves nothing: on a private chain of one, any rule appears to work. lab_runner.py starts two real nodes on a throwaway regtest chain and reports what each does with the other's blocks and transactions (compare, relay filter, reorganisation, keys, fees, a replay of the BIP 65 soft fork, a rule-breaking miner, and mining-power share).

vibeslib/sandbox.py confines AI-written code with sandbox-exec on macOS and bubblewrap on Linux: no network beyond the lab's own loopback ports, no writes outside the lab folders, no reads of the home folder beyond the source tree. vibeslib/lessons.py holds every explanation the lab shows, written by people, with sources. vibeslib/health.py turns a node's warnings, chain tips and log into plain alerts. experiments/ holds three one-line source changes with known outcomes. UPSTREAM records the Bitcoin Core commit the fork is built on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A proposal is now compiled inside the sandbox, run through Bitcoin Core's unit tests (each suite in its own process, failures reported by name as findings) and compared with an unmodified reference node before the operator is asked to review it. Applying is a fast-forward, so the revision saved is the revision that was built.

The agent gets file tools only: no shell, no network, no operator hooks or MCP servers, a step limit and a time limit. The unrestricted mode is removed. A request imported from someone else is prefaced as untrusted, always waits for review and never starts automatically. Proposals that edit the lab itself are refused, and edits to tests are named.

The real network needs a typed confirmation; builds whose comparison found a consensus difference are not started there; the wallet and incoming connections default to off; and the console reports in plain words when the node has refused a block. The console talks to the node over RPC directly instead of running the bitcoin-cli it built.

Also: ready-made experiments with predictions, lessons, sources and before-and-after statements; ready-made changed nodes; comparison with an outside node program; settings defaults read from the build; restore-the-baseline and private-chain reset; an upstream gap check; a content security policy; and a demo that replays recorded real results instead of simulating.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Updating a shallow clone used a second depth-1 fetch, which git refuses to merge as unrelated histories; the failure was reported as local changes or hidden. The installer now fetches properly and says truthfully which of five cases it met. The Mac launcher no longer updates on every launch: like Bitcoin Core, nothing updates by itself.

The installer can be pinned to a release (PINNED_REF, stamped by the release workflow), checks a ready-made node against its published SHA-256 and unpacks it safely, and asks before running anyone else's installer. The app build script signs and notarises when credentials are supplied. The Docker image runs as an unprivileged user, keeps the working copy in a volume so saved experiments survive rebuilds, and keeps its own Claude Code state instead of mounting the host's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eleases

CI now builds test_bitcoin and runs the whole unit suite, checks that src/ differs from the recorded upstream base in one file, runs the console tests against the node it built (trying the Linux sandbox for real), and applies each ready-made source change to confirm an unmodified node disagrees in the documented direction. Actions are pinned to commit hashes.

Releases are published by one final job only if every platform builds and passes its tests. They carry an installer pinned to the release, the three changed nodes for the ready-made experiments, SHA256SUMS and build provenance attestations, and notes that say what is and is not signed. A separate workflow builds the Docker image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…untested

Rewrites the README introduction, the manual and the security policy to match the two-node lab; removes the dare to run on the real network and marks the comparison table as satire; states the position on Bitcoin Core's AI policy; adds a one-page guide for running a session with learners and a section on reviewing the lessons. QA.md lists what was verified on real nodes and, first, what was not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hotpixelgroup
hotpixelgroup merged commit 5b168ab into master Oct 12, 2026
3 checks passed
@hotpixelgroup
hotpixelgroup deleted the lab-hardening branch October 12, 2026 18:21
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