KeiSeiKit-1.0/install
Parfii-bot e01b219291 feat(install): Rust binary acquisition for fresh-clone installs (Path A + Path B)
Pre-fix: install.sh on a fresh clone has no binaries — target/ is gitignored,
copy_prebuilt_substrate_binaries() skips silently with "no pre-built found",
end users get zero kei-fork / kei-ledger / kei-cortex / etc.

New module: install/lib-rust-prebuild.sh (~120 LOC, Constructor Pattern).

  ensure_rust_binaries() — main entry, idempotent
    1. has_prebuilt_substrate_binaries() — quorum check (5+ kit binaries already in
       target/release/ → no-op).
    2. Else Path A: download keisei-${TARGET}.tar.gz from
       https://github.com/KeiSei84/KeiSeiKit-1.0/releases/latest/download/
       Detects target via uname (x86_64/aarch64 × darwin/linux), verifies
       sha256, extracts into target/release/.
    3. Path A fail (404, network, sha mismatch) → Path B fallback:
       cargo build --release --workspace (slow first time, requires Rust).
    4. Path B fail (no cargo) → say + return non-zero.

  Bypass: KEI_SKIP_RUST=1 — skip both paths (markdown-only install).

Wired in install/lib-rust.sh — ensure_rust_binaries() called BEFORE
copy_prebuilt_substrate_binaries() in regenerate_rust_workspace.

Path A activates ONLY after a v* tag is pushed and release.yml uploads
tarballs to github releases. Until then, Path A 404s and Path B kicks in.
This commit lays the wire — release tag is a separate user-driven action.

Verify:
- bash -n install.sh: OK
- bash -n install/lib-rust-prebuild.sh: OK
- detect_rust_target on this host: aarch64-apple-darwin
- has_prebuilt_substrate_binaries: correctly returns false on partial dev
  target (only kei-memory + kei-db-contract built locally today)

Out of scope (not done in this commit):
- Tag v0.X release to populate github tarballs (deploy step, deferred)
- Update keiseikit.dev/install.sh redirect target (downstream wiring)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 19:07:55 +08:00
..
launchd-templates KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-agents.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-args.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-backup.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-bin.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-bridges.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-dev-hub-datasette.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-dev-hub-daytona.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-dev-hub-forgejo-runner.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-dev-hub-forgejo.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-dev-hub-gdrive-import.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-dev-hub-mdbook.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-dev-hub-restic.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-dev-hub-zoekt.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-frustration-bootstrap.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-hooks.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-launchd.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-log.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-menu.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-pathway.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-plan.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-prereqs.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-primitives.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-profile.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-rust-mirror.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-rust-prebuild.sh feat(install): Rust binary acquisition for fresh-clone installs (Path A + Path B) 2026-05-01 19:07:55 +08:00
lib-rust.sh feat(install): Rust binary acquisition for fresh-clone installs (Path A + Path B) 2026-05-01 19:07:55 +08:00
lib-scaffold.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-skills.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-substrate.sh chore(kit): wire kei-db-contract into installer + drop final #[path] hack 2026-05-01 17:55:52 +08:00
lib-summary.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00
lib-wizard.sh KeiSeiKit-public — clean state 2026-05-01 12:09:03 +08:00