Skip to content

Commit b95b278

Browse files
committed
release: propagate pinned CKB checkout to tx measure
1 parent 470688d commit b95b278

6 files changed

Lines changed: 82 additions & 8 deletions

File tree

‎AGENTS.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,11 @@ Existing command families to be aware of:
294294
- `proposals/novaseal` is a submodule (`NovaSeal.git`, branch `main`). Same
295295
for `proposals/evolving-dob/evolving-dob-profile-v1`.
296296
- `tools/ckb-tx-measure` depends on `../ckb/util/jsonrpc-types` and
297-
`../ckb/util/types`; the gate builds the helper with CellScript's pinned
298-
Rust 1.97.1 toolchain so its declared `rust-version` remains enforceable.
297+
`../ckb/util/types`; when release validation receives `--ckb-repo`, the gate
298+
stages the helper's tracked workspace under `target/` so those same relative
299+
paths resolve to the explicit checkout. The gate builds the helper with
300+
CellScript's pinned Rust 1.97.1 toolchain so its declared `rust-version`
301+
remains enforceable.
299302
- `--primitive-strict 0.16` is the current production assurance gate; the
300303
README mentions it and the policy lives in `docs/`.
301304

‎CHANGELOG.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
longer breaks CI through an obsolete exact-string comparison. Let the full
1313
backend stateful audit use an explicit isolated pinned CKB checkout through
1414
`CELLSCRIPT_CKB_REPO`, avoiding any need to modify an unrelated sibling CKB
15-
worktree during release validation.
15+
worktree during release validation. Propagate the release gate's existing
16+
`--ckb-repo` selection to its independent `ckb-tx-measure` workspace as
17+
well, so every CKB-dependent release check resolves against the same pin.
1618
- Turn the browser Playground into a recoverable Cell-oriented workbench.
1719
Browser-local workspace snapshots now retain source files, entry selection,
1820
active panels, and an honest saved/dirty state across refreshes. Failed

‎crates/cellscript-tools/src/tooling_release.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,19 @@ pub fn run(root: &Path) -> Result<()> {
454454
!tx_measure_gate.contains("RUSTUP_TOOLCHAIN"),
455455
"CKB transaction measure tooling must use CellScript's pinned Rust toolchain",
456456
)?;
457+
for token in [
458+
"release_ckb_repo_from_args() {",
459+
"staging_dir=\"$(mktemp -d \"$ROOT_DIR/target/cellscript-ckb-tx-measure.XXXXXX\")\"",
460+
"cp tools/ckb-tx-measure/Cargo.toml tools/ckb-tx-measure/Cargo.lock",
461+
"cp src/bin/ckb_tx_measure.rs",
462+
"ln -s \"$ckb_repo\" \"$staging_dir/ckb\"",
463+
] {
464+
require(gate_script.contains(token), format!("release CKB checkout propagation is missing '{token}'"))?;
465+
}
466+
require(
467+
gate_script.matches("run_release_auxiliary_checks \"$ckb_repo\"").count() == 2,
468+
"release and release-quick must both propagate the selected CKB checkout to auxiliary checks",
469+
)?;
457470
require(
458471
gate_script.contains("--root \"$ROOT_DIR\" workspace-version"),
459472
"release source identity must read the root package version from Cargo.toml",

‎docs/CELLSCRIPT_GATE_POLICY.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ the stateful wrapper forwards it as the acceptance harness's `--ckb-repo`.
130130
This avoids modifying or stashing an unrelated CKB worktree during release
131131
validation.
132132

133+
For `release` and `release-quick`, pass the same checkout with `--ckb-repo`.
134+
The release gate stages the independent `ckb-tx-measure` workspace under
135+
`target/` with its tracked manifest, lockfile, and source so its relative CKB
136+
dependencies resolve against that explicit checkout too. The default remains
137+
the sibling `../ckb`; the tracked lockfile remains bound to the release pin.
138+
133139
The transaction matrix is produced by the native Rust acceptance harness and
134140
is intentionally labelled as recipe-replayer evidence, not generated-builder
135141
output. Separately, the gate runs the public `cellc action build` and

‎docs/releases/CELLSCRIPT_0_23_RELEASE_NOTES.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,12 @@ CELLSCRIPT_CKB_REPO=/path/to/pinned/ckb ./scripts/cellscript_gate.sh backend
352352
Production release evidence:
353353

354354
```bash
355-
./scripts/cellscript_gate.sh release
355+
./scripts/cellscript_gate.sh release --ckb-repo /path/to/pinned/ckb
356356
```
357357

358+
The explicit checkout is used both by production acceptance and by the staged
359+
`ckb-tx-measure` workspace. Omitting it retains the sibling `../ckb` default.
360+
358361
The `backend` stateful portion and both release modes require a clean tree and
359362
their documented external dependencies. A passing lighter gate must not be
360363
reported as release evidence.

‎scripts/cellscript_gate.sh‎

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,50 @@ check_wasm_release_bundle() {
432432
fi
433433
}
434434

435+
release_ckb_repo_from_args() {
436+
local ckb_repo="$ROOT_DIR/../ckb"
437+
while (($# > 0)); do
438+
case "$1" in
439+
--ckb-repo)
440+
if (($# < 2)); then
441+
printf 'missing value for --ckb-repo\n' >&2
442+
return 2
443+
fi
444+
ckb_repo="$2"
445+
shift 2
446+
;;
447+
*)
448+
shift
449+
;;
450+
esac
451+
done
452+
printf '%s\n' "$ckb_repo"
453+
}
454+
435455
check_ckb_tx_measure_tool() {
436-
run cargo test --manifest-path tools/ckb-tx-measure/Cargo.toml --locked
456+
local ckb_repo="$1"
457+
local default_ckb_repo="$ROOT_DIR/../ckb"
458+
if [[ ! -d "$ckb_repo" ]]; then
459+
printf 'CKB checkout does not exist: %s\n' "$ckb_repo" >&2
460+
return 1
461+
fi
462+
ckb_repo="$(cd "$ckb_repo" && pwd -P)"
463+
if [[ -d "$default_ckb_repo" ]]; then
464+
default_ckb_repo="$(cd "$default_ckb_repo" && pwd -P)"
465+
if [[ "$ckb_repo" == "$default_ckb_repo" ]]; then
466+
run cargo test --manifest-path tools/ckb-tx-measure/Cargo.toml --locked
467+
return
468+
fi
469+
fi
470+
471+
local staging_dir
472+
staging_dir="$(mktemp -d "$ROOT_DIR/target/cellscript-ckb-tx-measure.XXXXXX")"
473+
mkdir -p "$staging_dir/cellscript/tools/ckb-tx-measure" "$staging_dir/cellscript/src/bin"
474+
cp tools/ckb-tx-measure/Cargo.toml tools/ckb-tx-measure/Cargo.lock \
475+
"$staging_dir/cellscript/tools/ckb-tx-measure/"
476+
cp src/bin/ckb_tx_measure.rs "$staging_dir/cellscript/src/bin/"
477+
ln -s "$ckb_repo" "$staging_dir/ckb"
478+
run cargo test --manifest-path "$staging_dir/cellscript/tools/ckb-tx-measure/Cargo.toml" --locked
437479
}
438480

439481
check_novaseal_rust_tooling() {
@@ -541,6 +583,7 @@ run_backend_gate() {
541583
}
542584

543585
run_release_auxiliary_checks() {
586+
local ckb_repo="$1"
544587
require_cmd npm
545588

546589
run cargo run --quiet --locked -p cellscript-tools --bin cellscript-tools -- \
@@ -549,7 +592,7 @@ run_release_auxiliary_checks() {
549592
check_ckb_release_docs
550593
check_ckb_acceptance_boundaries
551594
check_novaseal_acceptance_boundaries
552-
check_ckb_tx_measure_tool
595+
check_ckb_tx_measure_tool "$ckb_repo"
553596
check_novaseal_rust_tooling
554597
check_novaseal_verifier_pinning
555598
check_wasm_release_bundle
@@ -561,18 +604,22 @@ run_release_auxiliary_checks() {
561604
}
562605

563606
run_release_quick_gate() {
607+
local ckb_repo
608+
ckb_repo="$(release_ckb_repo_from_args "$@")"
564609
check_release_source_identity
565610
run_ci_gate
566-
run_release_auxiliary_checks
611+
run_release_auxiliary_checks "$ckb_repo"
567612
run ./scripts/ckb_cellscript_acceptance.sh --compile-only --production "$@"
568613
printf '\nCellScript backend shape report: %s\n' "$CELLSCRIPT_BACKEND_SHAPE_REPORT"
569614
printf 'CellScript Molecule schema manifest report: %s\n' "$CELLSCRIPT_MOLECULE_SCHEMA_MANIFEST_REPORT"
570615
}
571616

572617
run_release_gate() {
618+
local ckb_repo
619+
ckb_repo="$(release_ckb_repo_from_args "$@")"
573620
check_release_source_identity
574621
run_ci_gate
575-
run_release_auxiliary_checks
622+
run_release_auxiliary_checks "$ckb_repo"
576623
run ./scripts/ckb_cellscript_acceptance.sh --production --stateful-scenarios "$@"
577624
printf '\nCellScript backend shape report: %s\n' "$CELLSCRIPT_BACKEND_SHAPE_REPORT"
578625
printf 'CellScript Molecule schema manifest report: %s\n' "$CELLSCRIPT_MOLECULE_SCHEMA_MANIFEST_REPORT"

0 commit comments

Comments
 (0)