# Vaultfire Solana Partner No-Value Rehearsal

## Scope and decision

This rehearsal may run today on an isolated workstation or CI runner. It
retains fifteen program source directories but compiles only the six
`supported-candidate` programs in
[`v3-program-dispositions.json`](./v3-program-dispositions.json). It checksums
and preloads those six binaries with **upgrades disabled** in a new loopback-only
`solana-test-validator`. It does not deploy, initialize, sign, airdrop to an
external wallet, use devnet/mainnet, or move partner value.

The other nine sources are not Cargo workspace members: five are permanently
`retired`, and four are `redesign-required`. Generated IDLs, SBF artifacts, or
deployment maps containing any of those nine fail the release gate. All
singleton initializers remain deliberately blocked. Consequently this is
an executable build/load/custody-boundary rehearsal, not a functional launch or
value-lifecycle demonstration. Do not patch `deployment_authorized`, add a
program map, create a deployment keypair, or substitute a public RPC.

The six build candidates are `ai_accountability_bonds`,
`ai_partnership_bonds`, `identity_registry`, `multisig_governance`,
`privacy_guarantees`, and the passive/unverified `vaultfire_adapter`. A
supported-candidate disposition means only that the source may enter this
rehearsal. It is not executable, audit, deployment, or operational evidence,
and no candidate may use protected data to control routing, custody,
eligibility, pricing, slashing, access, settlement, or disputes.

## Pinned environment

`rehearsal-versions.env` is the version contract:

- Anchor CLI `0.32.1`
- Solana/Agave CLI and validator `2.3.0`
- Rust `1.89.0` (Anchor 0.32's minimum for stable IDL builds)
- Node `20.x`
- container image `solanafoundation/anchor:v0.32.1`

`scripts/check-toolchain.sh` rejects version drift. `Cargo.lock` and every
program's exact `anchor-lang = "=0.32.1"` requirement remain mandatory.

## Host preflight

1. Use a fresh checkout of this Solana repository only. Record:

   ```sh
   git rev-parse HEAD
   git status --short
   df -h .
   ```

2. Allow at least 8 GiB free for the container image, Cargo cache, and SBF
   outputs. Stop rather than installing native toolchains if space is tight.
3. Confirm `artifacts/sbf` contains no `.so` files. The build refuses to
   overwrite prior evidence. Preserve an earlier `artifacts/` directory under
   a separately named evidence directory before a new run.
4. Do not provide a wallet, seed phrase, private key, RPC environment variable,
   or cloud signing service. The scripts contain no key generation or airdrop
   command.

## Fast source gate

Node 20 requires no dependency installation for the active tests:

```sh
npm run test:rehearsal
npm run deploy
```

Expected: all tests pass, then `npm run deploy` exits exactly `1` with the
blocked-release message. A zero exit from the deploy command is a stop
condition.

## Complete container rehearsal

With Docker or Podman:

```sh
npm run rehearse:container
```

The wrapper selects Docker or Podman and runs `scripts/ci-rehearsal.sh` in the
pinned image. The container may fetch locked build dependencies, but the
rehearsal scripts permit Solana JSON-RPC only at
`http://127.0.0.1:8899`. They never select devnet or mainnet.

The same sequence runs in `.github/workflows/ci.yml`:

1. verify exact tool versions;
2. verify the canonical fifteen-program disposition manifest, explicit Cargo
   allowlist, prohibited dependencies/CPI, generated-output allowlist, and
   absence of deployment maps; recursively reject wallet/key content and
   validate all packaged documentation/manifests for excluded-program
   activation claims;
3. run the dependency-free source/lifecycle/release tests;
4. require compiler-resolved Cargo metadata to contain exactly the six
   canonical manifest paths, no local path dependency, and exact
   `anchor-lang = "=0.32.1"` requirements;
5. run Rust unit tests for the six supported-candidate workspace members,
   including accounting overflow/underflow,
   stake/withdraw aggregate restoration, participant ordering, and serialized
   layout;
6. let `scripts/verify-artifacts.mjs` itself build only the six allowlisted
   candidates twice from verifier-created target/output directories with
   `cargo build-sbf --locked`, and require byte-identical output before
   retaining either result; no caller-set environment flag can assert this;
7. require exactly six allowlisted non-empty ELF artifacts, delete the six exact
   Agave-generated ephemeral program-keypair files before retaining any output,
   and reject any other signer file or excluded-program IDL/artifact;
8. write SHA-256 checksums and a provenance manifest that binds each binary to
   the exact source commit, canonical program ID/path, source/Cargo hashes,
   lockfile hash, manifest hash, and successful two-build comparison while
   labeling the canonical V3 disposition evidence `source-only`;
   generated IDLs must also match exact canonical instruction names, argument
   names/types, account order/signer/writable metadata, exact ordered PDA seed
   kinds/constant bytes/account paths/account types/optional program seed,
   relationships, account-state and event layouts, and enum/defined types,
   while supported source and structural interfaces must match their pinned
   SHA-256 values. Packaged text claims also reject excluded-program identifiers
   in snake, kebab, spaced/title, PascalCase, camelCase, and separator-free
   forms without substring matching;
9. preload each candidate artifact with
   `solana-test-validator --bpf-program`;
10. query only loopback RPC, follow every upgradeable-loader Program account to
    its ProgramData account, and require Agave's exact all-zero disabled-authority
    sentinel plus valid ELF bytes;
11. record the encoded disabled sentinel and effective `upgradeAuthority: null`
    for every local candidate;
12. prove the deploy wrapper still exits `1`.

## Evidence to retain

- `checksums/sbf-sha256.txt`
- `checksums/sbf-manifest.json`
- `artifacts/rehearsal/local-validator-evidence.json`
- the CI job log
- the exact source commit and clean pre-run status

The manifest is emitted only from an exact, clean committed candidate after two
verifier-owned clean builds compare byte-for-byte. It records both normalized
build invocations and pass hashes, the source commit,
clean-tree assertion, Cargo.lock SHA-256, disposition-manifest SHA-256, combined
supported-source SHA-256, exact source/Cargo paths and hashes, canonical program
IDs, tool versions, artifact byte lengths, artifact SHA-256 values, and the
narrow local-artifact evidence scope. The local validator evidence records its genesis
hash, loopback endpoint, ProgramData addresses, the exact disabled-authority
sentinel, effective null upgrade authorities, zero
generated signer files, zero funded external wallets, and zero external RPC
requests. It is ephemeral local executable-load evidence for six candidates;
the canonical V3 disposition remains source-only and production deployment
evidence remains unavailable.

`MAINNET_READINESS.json` intentionally keeps `asOfCommit` null while it reports
source-only, non-executable readiness. It must not attribute dirty or
pre-commit content to a historical SHA. Clean executable evidence instead binds
the exact verified HEAD in `checksums/sbf-manifest.json`.

The rehearsal itself performs two independent clean builds and byte-compares
every candidate. A separate fresh-runner comparison remains recommended as
additional environment-level reproducibility evidence. Any mismatch is a stop
condition and is not resolved by blessing either artifact.

## Authority and custody assertions

- Agave 2.3's `--bpf-program` uses upgradeable-loader Program and ProgramData
  accounts even though upgrades are disabled. The verifier parses both account
  states and accepts only the exact all-zero authority sentinel, which has no
  usable signer; any other authority fails the run.
- `cargo build-sbf` transiently emits one program-keypair file per supported
  program. The verifier requires the exact six filenames and deletes them
  before copying or checksumming any artifact. No program keypair or
  upgrade-authority key is retained.
- The validator's ledger and internal validator identity are temporary and
  removed on exit. They are not partner wallets or release evidence.
- All protocol singleton accounts remain absent because bootstrap is blocked.
  Therefore the accountability vault cannot accept stake in this rehearsal.
- Static and Rust lifecycle gates enforce that only the accountability program
  has value-moving source, withdrawal returns value to the same signing agent,
  slashing is unavailable, rent is protected, and aggregates fail closed.

## Mission boundary and stop conditions

Behavioral, belief, biometric, flourishing, loyalty, profiling, quality,
reputation, and surveillance data must never control access, custody, disputes,
eligibility, pricing, routing, settlement, slashing, or value transfer. The active tests require
observational/trust programs to have no transfer, CPI, settlement, pricing,
eligibility, access, or slashing instructions. Review every future consumer;
this repository cannot constrain code outside these programs.

Stop immediately if any of the following occurs:

- a non-loopback Solana RPC is requested;
- a wallet, keypair, external address, or non-local funding step is requested;
- a Program or ProgramData account has an unexpected loader, malformed state,
  usable upgrade authority, missing ProgramData account, or non-ELF bytes;
- artifact count is not exactly six, an artifact is not allowlisted, an
  excluded program appears in an IDL/artifact/deployment map, or an
  ELF/checksum check fails;
- two clean builds produce different checksums;
- a bootstrap succeeds;
- bridge, ML-DSA, privacy-compliance, or surveillance-compliance claims become
  accepted without independent verification;
- any prohibited metric influences a control or value path;
- the blocked deploy command succeeds.

## What this does not authorize

Passing does not establish audit completion, production custody, a deployed
program ID, value safety, devnet readiness, mainnet readiness, or partner
approval. Production remains fail-closed under `MAINNET_READINESS.json` and
`V3_SECURITY_RELEASE.json`.
