Skip to content

feat(proof): pin real proof-eval digest and operator topic path - #222

Merged
echobt merged 2 commits into
mainfrom
cursor/proof-eval-digest-lock
Sep 4, 2026
Merged

feat(proof): pin real proof-eval digest and operator topic path#222
echobt merged 2 commits into
mainfrom
cursor/proof-eval-digest-lock

Conversation

@echobt

@echobt echobt commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Rebased onto main after #220 merged (7bb56c3b). #221 could not be reopened: its base branch cursor/proof-emission-2000-8000-payout-modes was deleted with that merge. This is the same work, retargeted at main. Does not touch challenges.toml or the topic schema.

Pins a real scoring image digest from publish-proof-eval-image run 33892650063 (packaging commit 51f937c7). That digest was pulled after push; harvest-PATH + selftest + baked proxy + 12.5 Gbit/s fabric enforcement proved on those bytes. Contract-only image is not pinned.

eval_image        = "ghcr.io/cortexlm/proof-eval"
eval_image_digest = "sha256:78b614a1f51ce5dd80076c4e343a2b31b85d6c36025e02836cb83929867e7009"
proxy_model       = "Qwen/Qwen3.8-0.6B"
proof_git_sha     = "51f937c7818f0eb1e3ed1412972de98b6994952b"

Empty digest remains fail-closed 503 in code (can_rent / EvalImageUnpinned). This pin is a real sha256, not invented.

Operator path: deploy/scripts/proof-operator-path.sh (prints holdout → baseline-on-pinned-image → xtask proof-topic → admin POST /v1/admin/proof/topics). can_score still needs LIUM harvest wired + ≥1 open signed topic + verified holdout + sealed baseline on the host.

Greptile

Every PR is reviewed by Greptile before merge. Config: .greptile/.

  • Greptile has reviewed this PR; findings are fixed or answered
  • If the bot was silent, I commented @greptileai review

Test plan

  • cargo test -p proof-task -p proof-http -p proof-eval -p trustroot
  • cargo fmt --all -- --check
  • committed_pin_is_proof_with_a_real_eval_digest
  • empty_digest_and_unwired_harvest_are_503 (fail-closed path still present)
  • cargo test --workspace not run (pin + eval packaging + operator script)

Risk

Once merged, Proof submits stop 503-ing on empty digest. Remaining 503s: unwired harvest, no open topic, unsealed baseline. 8000 bps still burns until those land on the droplet. No ceremony/key rotation in this PR.

Naming

I did not rename BASE_* environment variables, deployed host paths
(/opt/base, /run/base, …), GHCR baseintelligence/base package names, or
base-*-v1 cryptographic domain tags.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 4, 2026 17:12
Ship a harvest-compatible proof-eval binary at /usr/bin/proof-eval with
PROOF_METRICS=/PROOF_EVAL_OK markers, baked proxy Qwen/Qwen3.8-0.6B, and
12.5 Gbit/s / no-IB / no-NVLink / no-NCCL-fast-fabric enforcement. The
scoring image (CUDA + torch) is what the control plane will pin; the
contract-only digest is not a pin.

Co-authored-by: Mathis <echobt@users.noreply.github.com>
Stack on the 2000/8000 + WTA/discovery control plane. Pin the scoring
image published by run 33892650063 (sha256:78b614a1…, baked proxy
Qwen/Qwen3.8-0.6B). Empty digest still 503s until a real sha256 is
present; this one was pulled and proved after push. Operator script
covers holdout → baseline-on-image → xtask proof-topic → admin POST.
Does not touch challenges.toml or the topic schema.

Co-authored-by: Mathis <echobt@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown

Greptile Summary

This change adds proof evaluator images, scoring logic, baseline generation, and operator documentation. It must not merge yet: throughput claims are measured as holdout inference instead of the submitted workload, failed bandwidth shaping is recorded as successful, and baseline output cannot be consumed by the baseline gate. The prohibited-platform references must also be removed before merging.

Confidence Score: 2/5

Not safe to merge: the scoring path can accept unrelated workload measurements, represent an unenforced network constraint as enforced, and cannot seal the baseline produced by its documented command. The explicit repository naming requirement must also be met before merging.

Three independently executed checks reproduced failures in the workload measurement, fabric enforcement, and baseline-loading paths.

Files Needing Attention: eval/src/proof_eval/harness.py, eval/src/proof_eval/fabric.py, eval/src/proof_eval/cli.py, eval/Dockerfile, eval/Dockerfile.scoring, and eval/README.md

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced proofs for posted P1 findings and connected each to its corresponding review comment.
  • Contract-validation proofs were executed for throughput, runtime behavior, and baseline compatibility checks.
  • During throughput validation, a runtime blocker was captured showing a ModuleNotFoundError: No module named 'torch'.
  • Qdisc-return testing path was mocked to avoid modifying host networking, and the logs show the mocked return handling.
  • Baseline-compatibility checks were documented with producer/consumer paths and CLI outputs.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (3)

  1. General comment

    P1 Throughput payout evidence is derived from holdout inference, not the submitted training recipe

    • Bug
      • For a throughput request, the scoring flow marks the claim reproduced after text inspection, always emits flops_used: 0, then reports tokens_per_sec from labelled next-token holdout forwards. The executed trace contains tokenizer/model loading and model.forward:labels=True, but never invokes the distinctive submitted training recipe token. Thus a throughput claim can be accepted and used downstream without executing or measuring the claimed optimizer/training work.
    • Cause
      • agent.inspect() performs only forbidden-fabric pattern matching and hard-codes flops_used to zero. harness.measure() loads model weights and uses model(**enc, labels=enc["input_ids"]) under torch.no_grad(); its timer surrounds tokenization and inference rather than recipe execution. _score() merges both outputs into the score document.
    • Fix
      • Execute the submitted recipe in an isolated, constrained runner; meter its actual training FLOPs and training-step latency/throughput, reject absent or non-executable recipes, and populate flops_used from measured usage. Keep holdout forward NLL separate from throughput metrics. Avoid truncating sub-second wall time to zero.

    T-Rex Ran code and verified through T-Rex

  2. General comment

    P1 Failed tc qdisc setup is recorded as an applied bandwidth cap

    • Bug
      • When tc qdisc replace fails, the implementation continues and writes applied[f"tc:{dev}"] = f"{kbit}kbit". The executed failure run used return code 1 and still returned normally with recorded_bandwidth_env: "12.5" and recorded_tc_cap: "12500000kbit". A scorer consuming this applied map can accept a result as capped even though qdisc shaping was not installed.
    • Cause
      • subprocess.run(..., check=False, capture_output=True) at lines 100-105 has its return code and stderr ignored; line 106 records success unconditionally.
    • Fix
      • Check CompletedProcess.returncode (or use check=True) and fail closed with ContractError when any required qdisc installation fails. Only add tc:<device> after a zero return code; if shaping is optional by design, do not represent it as applied and ensure scoring rejects an unmet mandatory bandwidth constraint.

    T-Rex Ran code and verified through T-Rex

  3. General comment

    P1 Baseline CLI writes a score document that the operator baseline loader misreads

    • Bug
      • The documented proof-eval baseline --out baseline.json command emits a nested metrics document, but the configured PROOF_BASELINE_FILE loader expects a flat BaselineMeasurement. Serde defaults permit parsing the incompatible document while discarding the nested metrics, producing zero/empty values that cannot satisfy baseline verification and prevent the operator baseline from being sealed.
    • Cause
      • _score(..., baseline=True) changes only the artifact directory at eval/src/proof_eval/cli.py:113-114; it still serializes the agent/harness envelope at lines 118-127. load_baselines at bins/proof-challenge/src/main.rs:260-270 deserializes that body directly as BaselineMeasurement, whose #[serde(default)] fields mask the structural mismatch.
    • Fix
      • For the baseline subcommand, serialize a flat BaselineMeasurement JSON object containing eval_image_digest, topic_id, holdout_commitment, holdout_nll, split_nll, tokens_per_sec, step_latency_ms, and custom_value; alternatively make the loader explicitly unwrap and validate harness before constructing the measurement. Add an end-to-end regression test that feeds baseline CLI output into load_baselines and verifies it seals.

    T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "feat(proof): pin real proof-eval digest ..." | Re-trigger Greptile

Comment on lines +62 to +108
tok = AutoTokenizer.from_pretrained(proxy, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
artifact_dir or proxy,
torch_dtype=torch.bfloat16 if torch.cuda.is_available() else torch.float32,
trust_remote_code=True,
)
except Exception as exc: # noqa: BLE001
raise ContractError(f"no model: {exc}") from exc
model.eval()
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)

split_nll: dict[str, list[float]] = {s: [] for s in SCORED_SPLITS}
texts = []
for rec in request.holdout:
split = str(rec.get("split") or rec.get("task") or "web_ood")
if split not in split_nll:
split = "web_ood"
texts.append((split, _shard_text(rec)))

nlls: list[float] = []
tokens = 0
import time

t0 = time.perf_counter()
with torch.no_grad():
for split, text in texts:
enc = tok(text, return_tensors="pt", truncation=True, max_length=1024)
enc = {k: v.to(device) for k, v in enc.items()}
out = model(**enc, labels=enc["input_ids"])
nll = float(out.loss.detach().cpu())
split_nll[split].append(nll)
nlls.append(nll)
tokens += int(enc["input_ids"].numel())
wall = max(time.perf_counter() - t0, 1e-6)
mean = sum(nlls) / max(len(nlls), 1)
per_split = {
name: (sum(vals) / len(vals) if vals else mean) for name, vals in split_nll.items()
}
tps = tokens / wall if request.family == "throughput" else None
return {
"holdout_nll": mean,
"split_nll": per_split,
"public_nll": None,
"tokens_per_sec": tps,
"step_latency_ms": None,
"wall_s": int(wall) if request.family == "throughput" else None,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Throughput workload is not run

For throughput topics, the scorer only checks the submitted recipe text, then measures a next-token forward pass over the holdout. It reports flops_used as zero and derives wall time and throughput from that inference rather than executing the submitted optimizer or training recipe. An unexecuted workload can therefore pass reproduction and supply the measurements used for emission.

Artifacts

Evidence from the check

  • An authored, self-contained runtime harness invokes the targeted scoring path with observable model-runtime doubles, ending with assertions that distinguish holdout inference from recipe execution.

Command output from the check

  • The evidence script ran successfully and captured the clean zero-FLOPs agent verdict, next-token forward event, positive tokens-per-second result, and zero integer wall time, proving the claim.

Command output from the check

  • The direct scoring-runtime import in the prepared eval virtualenv failed because torch is not installed, showing why an actual model-runtime invocation could not be run there.

Command output from the check

  • A command capture contains the evidence script's SHA-256 checksum and complete source, making the executed test source independently inspectable.

View artifacts

T-Rex Ran code and verified through T-Rex

Comment on lines +100 to +106
subprocess.run( # noqa: S603
[tc, "qdisc", "replace", "dev", dev, "root", "tbf",
"rate", f"{kbit}kbit", "burst", "256kb", "latency", "50ms"],
check=False,
capture_output=True,
)
applied[f"tc:{dev}"] = f"{kbit}kbit"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Failed bandwidth cap is accepted

When tc qdisc replace fails, this code ignores its nonzero result and still records the 12.5-Gbit/s cap as applied. Scoring can then continue with an uncapped network while downstream verification sees a successful cap record, allowing an invalid throughput result to be accepted.

Artifacts

Evidence from the check

  • This source invokes the changed fabric enforcement path with a synthetic interface and mocks tc success or failure without changing host networking, directly exercising the result-handling branch.

Command output from the check

  • The baseline command ran the evidence script with tc return code 0 and recorded the expected 12.5-Gbit/s qdisc cap, establishing the normal comparison case.

Command output from the check

  • The command ran the same evidence script with tc return code 1 yet returned successfully and recorded the 12.5-Gbit/s qdisc cap, proving failures are ignored.

View artifacts

T-Rex Ran code and verified through T-Rex

Comment on lines +113 to +127
if baseline:
artifact_dir = os.environ.get("PROOF_PROXY_MODEL_DIR") or artifact_dir
harness = measure(request, artifact_dir)
if "artifact_fingerprint" in harness:
harness = {k: v for k, v in harness.items() if k != "artifact_fingerprint"}
document = {
"schema_version": PROOF_METRICS_SCHEMA,
"submission_digest": request.submission_digest,
"artifact_digest": request.artifact_digest,
"topic_id": request.topic_id,
"eval_image_digest": request.eval_image_digest,
"holdout_commitment": request.holdout_commitment,
"agent": agent,
"harness": harness,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Baseline file has wrong shape

The baseline command writes a full document with measurements nested under harness, but the configured baseline loader deserializes the entire file as a flat measurement. The nested values are silently defaulted to empty or zero, so required split metrics and the metric commitment cannot verify. The generated baseline cannot be sealed, leaving scoring unavailable.

Artifacts

Evidence from the check

  • A safe fixture invokes the CLI baseline writer and the Rust flat baseline parser, capturing the actual document shapes and parsed metric values; it demonstrates the structural incompatibility.

Command output from the check

  • The documented flat baseline control was parsed by the Rust loader with holdout NLL 2, five split scores, and throughput present, showing the expected operator-file shape.

Command output from the check

  • The actual CLI baseline writer emitted a nested harness document that the Rust flat loader parsed as zero NLL, zero split scores, and no throughput, confirming the operator verification failure.

Command output from the check

  • The proof-eval baseline commitment test passed, confirming that a complete flat metric vector is required and committed.

Command output from the check

  • All eight existing proof-eval Python contract tests passed after the narrow compatibility exercise, showing the fixture did not disturb tracked code.

View artifacts

T-Rex Ran code and verified through T-Rex

Comment thread eval/Dockerfile
#
# docker build -f eval/Dockerfile --build-arg WITH_RUNTIME=0 -t proof-eval:contract .
#
# No secret, holdout item, teacher endpoint, or Modal reference is baked in.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Remove prohibited references

This new comment explicitly names Modal; the same reference also appears in eval/Dockerfile.scoring and eval/README.md. This violates the repository directive prohibiting Modal tokens. The repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@echobt
echobt merged commit 2892227 into main Sep 4, 2026
7 checks passed
@echobt
echobt deleted the cursor/proof-eval-digest-lock branch September 4, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants