CONTRACT-1.2: pull prints the honest one-line on-ramp pointer whenever a gate bundle was emitted for the run, keyed on the V1-recorded capture dir — explicitly NOT gated on the exit code (the bypassable no-arch-row C0 advisory path exits 0 yet emits the #1 §10-R9 bundle). Gate path stays I/O-free: a single stdout line, no network/prompt/auto-send. It does not classify (suppression is loop-side at submit). CONTRACT-1.3: scripts/pull.sh --submit-last / --submit <dir> is a distinct top-level verb parsed before the slug/--profile-like requirement. --submit-last re-reads the V1 shared .last marker at submit (the race defense — surfaces the CURRENT bundle, never a silent wrong-bundle). Re-shows bundle identity + the exact already-redacted payload, requires an explicit y before any network, then reuses the shipped F5 dedup.submit (effective_dedup_hash, bounded loop:dedup-<hash> labels, +1-or-open, collision-safe verify, suppression/review-queue) — not reimplemented. gh-less fallback runs post-F2 classification, gated on should_file: should_file=True -> a prefilled public issues/new URL with the loop:dedup-<hash> label and the deterministic title template; review- queued (unknown / correct-refusal) -> the local _review-queue spool path and the no-public-issue line, with NO public issues/new URL. Never raises; degrades to the local spool + printed paste-path. Console is never a submission source — only the redacted artifact is emitted. New scripts/tests/test-submit-pull.sh (mocked gh, zero network): the .last-marker race re-read, the bundle-emitted-but-exit-0 surfacing, F5-reuse, the gh-less should_file branch with no public URL for review- queued, gate-path I/O-free, and leak-hygiene. Full shipped suite green in the CI condition; kv-calc --calibration unchanged at 22/22; safetensors decision path byte-unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
44 lines
2.1 KiB
Bash
Executable File
44 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
#
|
||
# pull.sh — v0.8.0 Pull-Gate orchestrator (PR #147, STEP P4).
|
||
#
|
||
# Derives an HF repo via [A], gates it through the LOCKED 6-stratum abort
|
||
# taxonomy (deriver-errors → --profile-like → [C0] → [C2a] → eligibility →
|
||
# [B]→[C1] → Path-A [D] dry-run), and on a curated, [D]-emittable, gate-
|
||
# passing Path A run hands the validated registry key to the existing #141
|
||
# generator for real emission. Path B (--dry-run / any non-curated slug)
|
||
# prints a §7-caveated verdict and NEVER calls [D] / downloads.
|
||
#
|
||
# Honest by construction (design §1): every non-eligible / non-pass outcome
|
||
# hard-stops with a precise structured reason; only `exact × fits-clean`
|
||
# reaches `proceed` silently (§4.1). `--force-download` is a no-op + notice
|
||
# this phase (download/telemetry deferred to the Loop phase).
|
||
#
|
||
# Usage:
|
||
# scripts/pull.sh <hf-slug> --profile-like <COMPOSE_REGISTRY-key> [opts]
|
||
#
|
||
# # Path A — curated pull-and-emit:
|
||
# scripts/pull.sh Lorbus/Qwen3.6-27B-int4-AutoRound \
|
||
# --profile-like vllm/minimal --out /tmp/qwen.yml
|
||
#
|
||
# # Path B — universal evaluate (never emits/downloads):
|
||
# scripts/pull.sh some-org/Some-Llama-7B --profile-like vllm/minimal --dry-run
|
||
#
|
||
# # Failure on-ramp — submit a captured failed pull (a SEPARATE, consented
|
||
# # verb: the ONLY step that touches the network, and only after an
|
||
# # explicit y; reuses the shipped dedup; needs no slug/--profile-like):
|
||
# scripts/pull.sh --submit-last # the most-recent capture
|
||
# scripts/pull.sh --submit <capture-dir> # an explicit bundle dir
|
||
#
|
||
# Opts: --yes --force-download --experimental-arch --trust-remote-code
|
||
# --hf-home DIR --out FILE (Path A) --hardware SM (override nvidia-smi)
|
||
#
|
||
# All decision logic lives in scripts/lib/profiles/pull.py (this is a thin
|
||
# argv pass-through, matching the generate-compose.sh / diagnose-profile.sh
|
||
# pattern). Exit: 0 = download-eligible / clean verdict; 3 = needs a flag
|
||
# (confirm→proceed / advisory); 2 = honest hard-stop; 64 = usage.
|
||
set -euo pipefail
|
||
|
||
ROOT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
||
exec python3 "${ROOT_DIR}/scripts/lib/profiles/pull.py" "$@"
|