|
| 1 | +# Adoption On-Ramp (design) |
| 2 | + |
| 3 | +**Status:** DESIGN SPEC — 2026-06-02. **Branch:** `rosalind/adoption-on-ramp` (off `main` `165a6f1`). |
| 4 | +From the reflection audit: the differentiator (the live `plan → enforce → verify` contract) is a |
| 5 | +60-second demo, but it is **unrunnable by strangers** today — no releases/tags/containers, only a |
| 6 | +from-source build behind a C-toolchain gate. Scope (chosen for max tangible value to users + |
| 7 | +forkers): **release core + the `rosalind-budget` GitHub Action**; container deferred. |
| 8 | + |
| 9 | +## 1. Goal |
| 10 | + |
| 11 | +Turn "clone → fight the htslib C-toolchain build" into "**run the memory contract in 60 seconds**," |
| 12 | +and give builders a drop-in way to **enforce the contract in their own CI**. |
| 13 | + |
| 14 | +## 2. Honest constraints (stated up front) |
| 15 | + |
| 16 | +- **CI-only verification.** The release workflow and the Action execute on GitHub runners; the Linux |
| 17 | + **musl-static** build in particular cannot be run-verified locally (cross-compiling htslib's C from |
| 18 | + macOS isn't feasible here). This PR delivers *reviewed* release infrastructure + a **locally-verified |
| 19 | + macOS quickstart**; the Linux build is validated when CI first runs. |
| 20 | +- **The `v0.1.0` tag is the user's trigger.** `release.yml` fires on a `v*` tag push (plus |
| 21 | + `workflow_dispatch` for a manual dry run). Merging this PR releases nothing — cutting the tag (the |
| 22 | + outward-facing step) stays the user's call. |
| 23 | +- **The Action activates after the first release** (it downloads the release binary). Until `v0.1.0` |
| 24 | + exists it is non-functional infrastructure; documented as such. |
| 25 | + |
| 26 | +## 3. Deliverables |
| 27 | + |
| 28 | +### 3a. `.github/workflows/release.yml` |
| 29 | + |
| 30 | +- **Triggers:** `push: tags: ['v*']` and `workflow_dispatch` (manual, for a dry run). |
| 31 | +- **Matrix (native runners, no cross-compile):** |
| 32 | + - `x86_64-unknown-linux-musl` on `ubuntu-latest` — **static** (apt `musl-tools`; `rustup target add`; |
| 33 | + the `-sys` crates build htslib/bzip2/lzma/zlib from bundled C, so static linking should succeed). |
| 34 | + - `aarch64-apple-darwin` on `macos-14` (native arm64). |
| 35 | + - `x86_64-apple-darwin` on `macos-13` (native x86_64). |
| 36 | +- **Bundle** per target: the `rosalind` binary + `examples/data/illumina_toy/` (the contract-demo |
| 37 | + fixtures) + `README.md` + `CONTRACT.md` + `LICENSE-APACHE` + `LICENSE-MIT`, into |
| 38 | + `rosalind-<target>.tar.gz` (+ a `.sha256`). |
| 39 | +- **Publish:** attach the tarballs to the GitHub Release for the tag (via `softprops/action-gh-release@v2`). |
| 40 | + On `workflow_dispatch` (no tag), build + upload as workflow artifacts only (no release). |
| 41 | +- Validate YAML structure locally (`python -c yaml.safe_load` or a manual indentation review); cannot |
| 42 | + run the build here. |
| 43 | + |
| 44 | +### 3b. `install.sh` (curl-pipe one-liner) |
| 45 | + |
| 46 | +Detect `uname -s`/`uname -m` → target triple; download |
| 47 | +`https://github.com/logannye/rosalind/releases/latest/download/rosalind-<target>.tar.gz`; verify the |
| 48 | +`.sha256`; extract to `./rosalind-<version>/`; print the next-step quickstart. Prefer `gh release |
| 49 | +download` when `gh` is available (works even if the repo is private); fall back to `curl`. Fail |
| 50 | +loudly with a clear message on an unsupported OS/arch. Locally testable: the OS/arch-detection + |
| 51 | +error paths (the actual download needs a published release). |
| 52 | + |
| 53 | +### 3c. README "Quickstart (60 seconds)" |
| 54 | + |
| 55 | +A new section near the top: `curl -fsSL …/install.sh | sh` → `cd` → run the bundled |
| 56 | +`plan → variants --enforce → verify` demo on `examples/data/illumina_toy/` (the exact commands already |
| 57 | +verified locally end-to-end). Keep the existing from-source "Install & build" section below it for |
| 58 | +contributors. |
| 59 | + |
| 60 | +### 3d. `rosalind-budget` GitHub Action (`action.yml` at repo root) |
| 61 | + |
| 62 | +A **composite** action: a consumer adds |
| 63 | +```yaml |
| 64 | +- uses: logannye/rosalind-budget@v1 |
| 65 | + with: |
| 66 | + index: ref.idx |
| 67 | + alignments: sorted.bam |
| 68 | + budget-mb: 4096 |
| 69 | + max-depth: 1000 |
| 70 | + max-read-len: 250 |
| 71 | +``` |
| 72 | +Steps: download the Linux release binary (the action runs on the consumer's Linux runner; no |
| 73 | +toolchain needed), run `rosalind variants --index … --alignments … --memory-budget-mb … --enforce |
| 74 | +--max-depth … --max-read-len … -o calls.vcf`, so a budget breach **fails the consumer's CI** (exit 3 |
| 75 | +refuse / exit 4 breach), and upload `calls.vcf.manifest.json` as a build artifact. Inputs: |
| 76 | +`index`, `alignments`, `budget-mb` (required), `max-depth` (default 1000), `max-read-len` |
| 77 | +(default 250), `version` (default `latest`). Ship: |
| 78 | +- `action.yml` (composite). |
| 79 | +- `.github/workflows/example-rosalind-budget.yml` — a self-contained example that builds the binary |
| 80 | + from source (so the example runs in *this* repo's CI before any release exists), builds the bundled |
| 81 | + toy index, and runs the same plan→enforce→verify gate — proving the pattern end-to-end in CI now. |
| 82 | +- A README/`docs` section documenting the Action and the "memory contract in your CI" value. |
| 83 | + |
| 84 | +## 4. Out of scope (follow-up) |
| 85 | + |
| 86 | +- **Container image** (Dockerfile + ghcr publish) — a second channel for the same binary; valuable for |
| 87 | + HPC/Singularity users, deferred. |
| 88 | +- **crates.io publish** — a library-consumer channel; separate. |
| 89 | +- Cutting the actual `v0.1.0` tag/release (the user's trigger). |
| 90 | + |
| 91 | +## 5. Self-review |
| 92 | + |
| 93 | +- **Coverage:** release.yml (3a), install.sh (3b), README quickstart (3c), Action + example + docs |
| 94 | + (3d). ✓ |
| 95 | +- **No placeholders:** the musl-static build and the Action's release-download are concrete; the honest |
| 96 | + caveat is that they run on CI, not locally. ✓ |
| 97 | +- **Verification:** macOS quickstart + install.sh detection + YAML structure are checked locally; the |
| 98 | + Linux build + the release publish + the Action's download are CI-only (stated). ✓ |
| 99 | +- **Boundary:** no tag cut; the example workflow proves the Action's *pattern* in this repo's CI today |
| 100 | + (build-from-source), decoupled from the not-yet-existent release. ✓ |
0 commit comments