Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ghcr.io/astral-sh/uv:0.8.4-python3.12-bookworm-slim@sha256:dc7e1d08f8ca979826ec0b68b31c783e0b35b568be6a078d4cbedf38c4cc085e
RUN python -m pip install --no-cache-dir attrs==26.1.0 jsonschema==4.26.0 jsonschema-specifications==2025.9.1 referencing==0.37.0 rpds-py==2026.6.3 typing-extensions==4.16.0
LABEL jacobian.task="jacobian/reliability-series-path" \
jacobian.checksum="fa251bc1ee598db6f9549f6d1ac60c8f1fc72137ea31afa7da2e9c2b33005f0a"
jacobian.checksum="9a6e6ef290c586fd07a5e261ffc0ff5f89cf00afbdcc590e1a205931e23ebe36"
COPY expected.json input.json test.sh verifier.py verifier_support.py public_contract.json /tests/
COPY input.json /app/input.json
RUN chmod +x /tests/test.sh && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ def _math(s, x, e):
states = r.get("states")
if type(states) is not int:
return False
return _frac(r.get("probability")) == _frac(
e["expected_probability"]
) and states == e["expected_states"]
return (
_frac(r.get("probability")) == _frac(e["expected_probability"])
and states == e["expected_states"]
)


def main():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ghcr.io/astral-sh/uv:0.8.4-python3.12-bookworm-slim@sha256:dc7e1d08f8ca979826ec0b68b31c783e0b35b568be6a078d4cbedf38c4cc085e
RUN python -m pip install --no-cache-dir attrs==26.1.0 jsonschema==4.26.0 jsonschema-specifications==2025.9.1 referencing==0.37.0 rpds-py==2026.6.3 typing-extensions==4.16.0
LABEL jacobian.task="jacobian/reliability-single-edge" \
jacobian.checksum="fa251bc1ee598db6f9549f6d1ac60c8f1fc72137ea31afa7da2e9c2b33005f0a"
jacobian.checksum="9a6e6ef290c586fd07a5e261ffc0ff5f89cf00afbdcc590e1a205931e23ebe36"
COPY expected.json input.json test.sh verifier.py verifier_support.py public_contract.json /tests/
COPY input.json /app/input.json
RUN chmod +x /tests/test.sh && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ def _math(s, x, e):
states = r.get("states")
if type(states) is not int:
return False
return _frac(r.get("probability")) == _frac(
e["expected_probability"]
) and states == e["expected_states"]
return (
_frac(r.get("probability")) == _frac(e["expected_probability"])
and states == e["expected_states"]
)


def main():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def aggregate_reward(
raise ValueError("soft assurance weights must not exceed 1.0 in total")
return soft_assurance_base + soft_assurance_weight * assurance_score


__all__ = [
"ASSURANCE_LEVELS",
"MAX_INPUT_BYTES",
Expand Down
12 changes: 7 additions & 5 deletions benchmarks/tooling/host_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from contextlib import contextmanager, suppress
from dataclasses import asdict, dataclass
from pathlib import Path
from typing import Any
from typing import Any, cast

from benchmarks.tooling.errors import HarborSuiteError
from benchmarks.tooling.receipts import canonical_json, digest_bytes, receipt_digest
Expand Down Expand Up @@ -58,11 +58,11 @@ class ShardResult:


def _canonical(value: object) -> bytes:
return canonical_json(value)
return cast(bytes, canonical_json(value))


def _digest_bytes(value: bytes) -> str:
return digest_bytes(value)
return cast(str, digest_bytes(value))


def _require_digest(value: object, label: str) -> str:
Expand Down Expand Up @@ -322,7 +322,7 @@ def _command_digest(
workers=workers,
store_durations=store_durations,
)
return receipt_digest({"arguments": arguments})
return cast(str, receipt_digest({"arguments": arguments}))


def timing_digest(path: Path) -> str:
Expand Down Expand Up @@ -635,7 +635,9 @@ def _validate_receipt(
if not valid_budget:
raise HarborSuiteError(f"host-validation receipt exceeds worker budget: {path}")
if payload.get("command_digest") != _command_digest(
entry, workers=workers, store_durations=store_durations
entry,
workers=cast(int, workers),
store_durations=cast(bool, store_durations),
):
raise HarborSuiteError(f"host-validation receipt command mismatch: {path}")
actual_seconds = payload.get("actual_seconds")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def test_wrong_evidence_digest_zeros_reward_with_visible_diagnostics(
task, app, logs = support._prepare_case(tmp_path, task_name, "computed")
accepted = support._run_verifier(task, app, logs)
assert accepted["reward"] == pytest.approx(1.0)
assert accepted.get("evidence_validity", accepted.get("evidence", 1.0)) == pytest.approx(
1.0
)
assert accepted.get(
"evidence_validity", accepted.get("evidence", 1.0)
) == pytest.approx(1.0)

submission_path = app / "submission.json"
submission = json.loads(submission_path.read_text(encoding="utf-8"))
Expand Down
3 changes: 2 additions & 1 deletion src/jacobian/implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def install_source_only_importer(entrypoint: str) -> None:
# this, already-imported modules in sys.modules would shadow the
# finder and serve potentially stale bytecode.
stale = [
name for name in list(sys.modules)
name
for name in list(sys.modules)
if name == top_level or name.startswith(top_level + ".")
]
for name in stale:
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/support/test_copy_template.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Tests for copy_template isolation."""
import os

from pathlib import Path

from tests.support.state import copy_template
Expand All @@ -18,15 +18,15 @@ def test_copy_template_copies_blobs_without_sharing_inodes(tmp_path: Path) -> No
copy_template(template, dest)

assert (dest / "blobs" / "sha256" / "00" / "abc123").read_bytes() == b"blob content"
template_inode = os.stat(blob).st_ino
dest_inode = os.stat(dest / "blobs" / "sha256" / "00" / "abc123").st_ino
template_inode = blob.stat().st_ino
dest_inode = (dest / "blobs" / "sha256" / "00" / "abc123").stat().st_ino
assert template_inode != dest_inode, "blob should be copied, not hardlinked"

(dest / "blobs" / "sha256" / "00" / "abc123").write_bytes(b"changed")
assert blob.read_bytes() == b"blob content"

template_meta = os.stat(template / "metadata.sqlite3").st_ino
dest_meta = os.stat(dest / "metadata.sqlite3").st_ino
template_meta = (template / "metadata.sqlite3").stat().st_ino
dest_meta = (dest / "metadata.sqlite3").stat().st_ino
assert template_meta != dest_meta, "metadata should be copied, not hardlinked"


Expand Down
Loading
Loading