Skip to content

Latest commit

 

History

History
553 lines (456 loc) · 28.1 KB

REPRODUCE.md

File metadata and controls

553 lines (456 loc) · 28.1 KB

REPRODUCE — ApprenticeOps

This is the reproducibility contract for the paper. Goal: a stranger with Ollama / llama.cpp and a CPU can clone, run, and regenerate every number. This file is written to be lifted verbatim into the standalone paper repo (see ## Extracting the standalone repo).

0. What you need

Requirement Why Notes
Ollama ≥ 0.30 reproduces the committed legacy/paper-era runs and serves LAN/API clients ollama serve on 127.0.0.1:11434 (override OLLAMA_URL)
llama.cpp preferred runtime for future locked thesis experiments Provisioned on home-ai by the homelab llama_cpp Ansible role. Current adapters are llama_cpp (non-interactive llama-completion subprocess) and llama_cpp_server (diagnostic token/logprob/metrics sidecar capture), both for direct local GGUF files.
Python ≥ 3.10 the harness (stdlib only for run.py/baselines.py) no pip deps to run models; claim-bearing analysis is separately locked to Python 3.14.5 and requirements-lock.txt
Linux host for full telemetry run.py reads /proc for RAM/swap macOS/Windows run fine but RAM/swap series will be empty (documented limitation)
~60–120 GB free disk model weights (pulled then freed per model) 95 models, q4
Time CPU inference hours→days for the full R=5 × 94-model run
(judge only) a frontier judge scoring (NOT the system-under-test) default copilot backend = official Copilot CLI (npm i -g @github/copilot, authenticated); or github/anthropic. judge.py is stdlib-only
(energy, optional) Intel RAPL (preferred) or a metered smart plug measured energy-per-task RAPL (Intel): on-die joule counters, auto-used if present (root-only → run.py reads via passwordless sudo; tune RAPL_DOMAIN=psys|package-0, disable with RAPL_DISABLE=1). Plug alt: Home Assistant HA_URL/HA_TOKEN/HA_POWER_ENTITY, or IKEA DIRIGERA DIRIGERA_URL/DIRIGERA_TOKEN/DIRIGERA_DEVICE_ID. LAN/SoC operator telemetry (not a model egress); RAPL wins, then HA, then DIRIGERA
(analysis/release only) locked Python environment notebooks, figures, claims, Croissant, and archival packaging Python 3.14.5 plus all hash-pinned dependencies in requirements-lock.txt; install with pip --require-hashes

0a. Node topology (this homelab's setup)

Two nodes, no laptop in the loop:

Node Role Runs
home-ai (the locked i5-8350U / 24 GB) experiment node Ollama + run.py reproduce committed rows today; llama.cpp is provisioned as the preferred future experiment runtime. All env.* / manifest checks target this node.
homelab (always-on server) control plane the agent/editor, git, the judge (judge.py → frontier API), and orchestration — it SSHes to home-ai to launch sweeps and pulls results back.

A clean reproduction of the committed snapshot needs home-ai + Ollama. The thesis runtime direction is home-ai + llama.cpp, recorded in data/runtime-policy.json; do not mix the two without labelling the runtime. The adapter is INFERENCE_RUNTIME=llama_cpp via a non-interactive llama.cpp subprocess backend, defaulting to llama-completion, for direct local GGUF files. The split separates the graded experiment (offline, locked) from the grading rig (online, frontier judge) — the same offline/online boundary the paper draws. The experiment node is driven over SSH, so nothing depends on a particular workstation.

1. Clone & smoke-test (5 min)

git clone <repo>  apprenticeops && cd apprenticeops
ollama --version                      # >= 0.30
python3 run.py --help                  # flags present
python3 baselines.py --out /tmp/bl.jsonl   # no model needed; sanity = random~0.26 keyword~0.73

2. Pilot run — one model, all scenarios (~5 min)

printf '# bracket: 0-1B\nqwen2.5:0.5b\n' > one.txt
python3 run.py --models one.txt          # pulls, runs 8 scenarios, writes results.jsonl + outputs/

You should see per-scenario det=x/y tok/s wall finish, and results.jsonl with OTel gen_ai.* fields + a RAM/swap samples array (Linux) + progress_trace.

3. Full powered run (hours→days; the paper run)

# Deterministic point estimate (det checks): temp 0, 1 rep
python3 run.py --models models.txt --temp 0 --repeats 1 --out results.det.jsonl

# Variance pass for CIs: temp 0.7, R=5 fixed seeds
python3 run.py --models models.txt --temp 0.7 --repeats 5 --seed-base 1 --out results.var.jsonl

# Thinking models get their OWN profile (separate, fair):
printf '# bracket: think\ndeepseek-r1:1.5b\ndeepseek-r1:7b\nqwen3:4b\n' > think.txt
python3 run.py --models think.txt --think --temp 0.7 --repeats 5 --out results.think.jsonl

# Non-LLM baselines (no model):
python3 baselines.py --out results.baselines.jsonl

3a. Lock the node into a reproducible power state (recommended for the systems pass)

The audit (i5-8350U, intel_pstate active, governor powersave, EPP performance, no TLP / power-profiles-daemon / auto-cpufreq, on AC) showed the only per-run variance is dynamic HWP frequency scaling + turbo. Lock it before the variance run, then restore afterwards:

./node-power.sh setup      # governor=performance, turbo OFF, clock pinned to base
                           # (~1.70 GHz, sustainable), EPB perf, ThinkPad fan_control ON
./node-power.sh status     # verify
# ... variance pass with per-model quiesce (below) ...
./node-power.sh teardown   # restore the node to normal

Per-model quiesce() makes every model start from an identical machine state (all steps env-gated, best-effort, need passwordless sudo):

QUIESCE=1 FAN_MAX=1 COOL_TEMP_C=55 COOL_MAX_S=180 \  # fan to max, wait until ≤55 °C
DROP_CACHES=1 RESET_SWAP=1 \                          # clear page-cache + swap each model
SAMPLE_INTERVAL=0.5 PERF_MEMBW=1 RAPL_DOMAIN=package-0 \
python3 run.py --models models.txt --shuffle --temp 0.7 --repeats 5 \
    --seed-base 1 --out results.var.jsonl

--shuffle randomizes model order (deterministic --order-seed) so any residual carryover is decorrelated from model identity. FAN_MAX needs node-power.sh setup first (it enables fan_control). The deterministic quality pass (§3) is order-insensitive and does not need this; only the systems numbers do.

3b. Reproducibility preflight — guarantee every run matches the locked baseline

run.py now refuses to start unless the node matches the frozen environment lock in data/run-manifest.json. It exists because an earlier controlled run (Turbo off, RAPL package-0) and a later one (Turbo on, RAPL psys/package-0 mixed) silently diverged: the later run was launched without node-power.sh setup, so the prior run's teardown trap had restored Turbo, and RAPL_DOMAIN was left unpinned. None of this was recorded in the data, so the drift stayed invisible until a post-hoc CPU-clock analysis. The guard makes that impossible to repeat:

# After node-power.sh setup, verify the node matches the locked baseline (no run yet):
RAPL_DOMAIN=package-0 PERF_MEMBW=1 PERF_CORE=1 python3 run.py --preflight-only
#   -> "PREFLIGHT: OK — node matches data/run-manifest.json"  (exit 0), or
#   -> "PREFLIGHT: FAIL" + the exact drift (turbo on, wrong RAPL domain, perf blocked,
#      models missing) and exit 3.

The preflight checks: Turbo (intel_pstate/no_turbo=1), governor (performance), min/max_perf_pct=100 (pinned to base), the freq ceiling (≤1750 MHz), RAPL_DOMAIN (package-0), perf_event_paranoid≤2 (so membw/perf.core counters are readable — an unlocked run lost them on ~14 % of rows), num_ctx, the launch protocol + the scenarios.json hash, and — with --no-pull — that every model is already present (no mid-run pull_failed). Any real run now enforces this automatically (default --manifest data/run-manifest.json); a drifted node aborts with exit 3. Use --allow-unlocked only for local/Mac dev runs (downgrades to a warning).

Self-describing data: every result row now carries an env.* fingerprint (env.cpu_no_turbo, env.rapl_domain, env.ollama_version, env.harness_git, env.perf_event_paranoid, …) so the node's power/energy regime is permanently auditable — you can always tell, from the data alone, whether Turbo was on. The volatile fields are re-read before every model (not just at startup), so a multi-day sweep aborts (exit 4) if the node drifts mid-run instead of silently mislabelling rows. node-power.sh setup now also sets perf_event_paranoid=1 (restored on teardown). To pin the Ollama version, fill expected.ollama_version in the manifest from a known-good env.ollama_version.

Stop-and-audit (run a couple models, verify, then commit to the full sweep):

# 1) lock + run just the first 2 models
./scripts/node-power.sh setup
RUN_ID=roster-$(date -u +%Y%m%d-%H%M) LIMIT=2 ./scripts/run-roster.sh
# 2) audit those rows: one regime? matches the manifest? no RAPL mix / pull_failed / missing perf?
python3 scripts/audit-run.py results.${RUN_ID}.jsonl       # must print "AUDIT: PASS"
# 3) only if PASS, launch the full sweep (drop LIMIT; --rm-after + dedup handle the repeats)
RUN_ID=${RUN_ID} nohup ./scripts/run-roster.sh >logs/${RUN_ID}.nohup 2>&1 &

--limit N runs the first N models then stops; audit-run.py exits non-zero if the partial data shows any drift or regime defect, so you spend the multi-day budget only on a node you've verified matches the locked baseline.

3c. Run it from homelab (control) against home-ai (experiment)

The whole sweep is driven from the homelab control node — no workstation in the loop. homelab SSHes to home-ai (its key/cert is trusted there); the node mirrors the exact pinned commit and runs the locked roster.

# on homelab:
LIMIT=2 ./scripts/run-from-homelab.sh        # 1) audit batch: 2 models, locked, collected
python3 scripts/audit-run.py data/collected/<RUN_ID>/results.<RUN_ID>.jsonl   # must say PASS
./scripts/run-from-homelab.sh                 # 2) full 158-model roster (detached on home-ai)
./scripts/run-from-homelab.sh status          # tail the node-side driver log
./scripts/run-from-homelab.sh collect         # pull results + logs + outputs back to homelab

3c.1. AI-only inference cycle (no home judge, no Mac dependency)

When the goal is to prove the experiment node can run by itself, launch the file-backed local-roster worker from ai. This mode performs inference only: it creates run.meta with judge_expected=false, runs the same locked run-roster.sh path, mirrors rows/logs/outputs into data/runs/<RUN_ID>/, and does not call the Copilot judge.

BATCH_ID=ai-local-small-$(date -u +%Y%m%d-%H%M%S)
setsid nohup python3 scripts/run-memory-batch.py launch \
  --batch-id "$BATCH_ID" \
  --model-set ai-local-small-3 \
  --scenario-set strategy-pilot-6 \
  --memory-context none \
  --inference-runtime ollama \
  --runner local-roster \
  >/tmp/${BATCH_ID}.boot 2>&1 </dev/null &

This exercises the model lifecycle we need for long inference runs:

  1. if a model is missing, run.py pulls it;
  2. if the model was already present before the run, it is kept as a prepared local model;
  3. if the run pulled the model, --rm-after removes it after that model's rows are complete;
  4. a relaunch with the same RUN_ID resumes at complete-model granularity.

Interpret the output with:

python3 scripts/report-run-quality.py --strict data/runs/<RUN_ID>
python3 scripts/audit-run.py data/runs/<RUN_ID>/_mirror/results.<RUN_ID>.jsonl \
  --scenarios data/scenario_sets/strategy-pilot-6.json

report-run-quality.py --strict accepts this mode without judged rows because run.meta records judge_expected=false.

The node-side run-roster.sh guarantees per run:

  • Locked + verified: node-power.sh setup, then run.py --preflight-only must pass

3d. Memory-conditioned comparison

The updated experiment can compare the same run matrix with and without a compact homelab memory briefing. This is not vector RAG: the selected markdown file is prepended to every scenario prompt, and its id/path/hash are written to run.meta and every raw row as env.memory_context, env.memory_context_file, and env.memory_context_sha.

Use none as the baseline and homelab-okf-v1 or homelab-okf-3kb-v1 as memory conditions. Keep inference_strategy separate: it controls how the answer is produced, not what background facts are injected.

For the first strategy pilot in CEOps, use:

model_set=strategy-pilot-2
scenario_set=strategy-pilot-6
memory_contexts=none, homelab-okf-3kb-v1
inference_strategy=baseline | single_call_tournament_brief | best_of_3_detcheck

single_call_tournament_brief is the cheap prompt-only ablation. best_of_3_detcheck runs three local samples and selects by deterministic-check score; candidate completions are preserved as sidecar artifacts. Before comparing quality, inspect reliability explicitly:

python3 scripts/report-run-quality.py data/runs/<RUN_ID>

The report prints DNF/stall/length, zero-output stalls, judge-empty rows, and judge-token usage by strategy. A memory or strategy lift that raises DNF is a different result, not a clean win.

The recommended no-UI path is the file-backed experiment-plan controller. It uses data/run-matrix.json as the plan source and writes durable state to data/experiments/<experiment_id>/phase-state.json, with a JSONL phase ledger and per-phase gate reports. The dashboard uses the same controller, so UI and CLI are two faces of the same contract.

# Initialize the phase ledger without starting work.
python3 scripts/experiment-plan.py init \
  --plan-id memory-comparison-v1 \
  --model-set dryrun \
  --scenario-set core-current

# Launch Phase 1. This starts a normal run-e2e.sh run with MEMORY_CONTEXT=none.
python3 scripts/experiment-plan.py launch-phase \
  --experiment-id <experiment_id> \
  --plan-id memory-comparison-v1 \
  --phase-id phase-1-baseline \
  --model-set dryrun \
  --scenario-set core-current

# After the run finishes, run the deterministic gate.
python3 scripts/experiment-plan.py gate \
  --experiment-id <experiment_id> \
  --phase-id phase-1-baseline

# Record adversarial/operator review. Phase 2 is blocked until Phase 1 is PASS.
python3 scripts/experiment-plan.py review \
  --experiment-id <experiment_id> \
  --phase-id phase-1-baseline \
  --verdict PASS \
  --reviewer operator \
  --notes "baseline complete; hashes and judge rows verified"

The raw environment-variable form still works for manual runs:

# Baseline
RUN_ID=core20-none-$(date -u +%Y%m%d-%H%M) \
  MODELS=data/models.dryrun.txt MODEL_SET=dryrun \
  SCENARIOS=data/scenario_sets/core-current.json SCENARIO_SET=core-current \
  MEMORY_CONTEXT=none MEMORY_CONTEXT_FILE= \
  setsid nohup ./scripts/run-e2e.sh >/tmp/e2e.none.boot 2>&1 </dev/null &

# Memory-conditioned twin
RUN_ID=core20-memory-$(date -u +%Y%m%d-%H%M) \
  MODELS=data/models.dryrun.txt MODEL_SET=dryrun \
  SCENARIOS=data/scenario_sets/core-current.json SCENARIO_SET=core-current \
  MEMORY_CONTEXT=homelab-okf-v1 \
  MEMORY_CONTEXT_FILE=data/memory/homelab-okf-v1/context.md \
  setsid nohup ./scripts/run-e2e.sh >/tmp/e2e.memory.boot 2>&1 </dev/null &

For a valid comparison, keep the model set, scenario set, repeats, sampler, judge configuration, and node manifest identical. Change only MEMORY_CONTEXT and MEMORY_CONTEXT_FILE. report.py and dataset.py expose memory_context, so the analysis can group by none vs homelab-okf-v1 without inferring from filenames. (turbo off, governor performance, RAPL package-0, perf readable, protocol + scenarios hash + models). It refuses to run otherwise.

  • Identical start per model (proven, not assumed): between models quiesce() resets the state (fan-max cool to target °C, drop_caches, swapoff/swapon, compact), and the next model stamps reset.* evidence into its rows — reset.cpu_no_turbo, reset.cpu_freq_mhz, reset.cpu_temp_c, reset.swap_used_mb, reset.mem_avail_mb, reset.load1, reset.running_procs, reset.top_proc, reset.perf_event_paranoid, plus reset.ok/reset.warnings. A model that starts dirty is flagged, not silently kept.
  • Server logging: the ollama server log (journalctl -u ollama, or ~/.ollama/logs/server.log) is captured for the whole run, plus ollama list (digests) and the selected CPU library (cpu_avx2/avx/cpu — pin with OLLAMA_LLM_LIBRARY for determinism).

Data convention (collected to homelab:data/collected/<RUN_ID>/, RUN_ID=roster-YYYYMMDD-HHMM):

results.<RUN_ID>.jsonl                    one row per (model,scenario,rep); env.* + reset.* stamped
outputs/<model>__<scenario>__rN.txt       the raw answers
logs/<RUN_ID>/{driver,run,preflight}.log  ollama-server.log  ollama-list.txt
              ollama.meta  ollama-cpu-library.txt  node-power-status.txt  calibration.json

Trust: set up homelab -> home-ai SSH first — homelab's public key (or a CA-signed SSH certificate home-ai trusts) so the orchestrator runs in BatchMode with no prompts. The experiment node mirrors origin/main exactly (tracked files only; gitignored artifacts kept).

4. Judge (on the control node homelab, off the experiment node; frontier reference + scoring)

# Default backend = copilot (the official GitHub Copilot CLI). Find the Claude id:
JUDGE_BACKEND=copilot python3 judge.py --list-models      # -> claude-opus-4.8
export JUDGE_BACKEND=copilot JUDGE_MODEL=claude-opus-4.8   # Claude 4.8 Max
python3 judge.py --reference --out reference.jsonl                       # gold ceiling
python3 judge.py --judge --ensemble copilot:gpt-5.5 \
    --results results.det.jsonl --out judged.jsonl        # 2-family ensemble

Backends: copilot (default, Copilot CLI — needs npm i -g @github/copilot once-authenticated; consumes AI Credits), github (GitHub Models, OpenAI-compat — NO Claude there), anthropic (ANTHROPIC_API_KEY). The judge/reference is eval scaffolding — the system-under-test (the small local model) never calls it. "Offline" describes the deployed system, not the grading rig.

Each new judged row stores the exact requested evaluation_policy and canonical condition hash before judging starts. Resume requires that hash plus the judge backend/model. Historical hashless rows do not suppress work unless --allow-legacy-resume is explicitly supplied and the selected results prove a unique condition match. Rows with incomplete condition provenance are rejected before judge calls begin. Report, dataset, and snapshot exports emit consensus only for a complete requested backend/model ensemble; partial judge failures stay unscored for a later resume.

5. Report

cat results.*.jsonl results.baselines.jsonl > all.jsonl
python3 report.py --results all.jsonl --judged judged.jsonl --out-md RESULTS.md --out-csv results.csv
# ML-ready table (one row per task: features + labels) for sklearn/Kaggle modelling:
python3 dataset.py --results all.jsonl --judged judged.jsonl --out dataset.csv

Canonical judged rows require no compatibility flags. To analyze a frozen historical judged.jsonl that predates condition hashes, add --allow-legacy-judge-join --evaluation-policy '<locked-policy-id>' to report.py or dataset.py; the command still fails if one legacy key can identify multiple conditions. The policy is mandatory because surviving legacy rows cannot prove which judge families were originally requested. RESULTS.md includes: the headline table (det + 95% CI, % frontier, tok/s, swap, DNF), the per-task-taxonomy matrix (model × class), the task-class difficulty table, the paired RAG lift table (within-pair, the clean estimate), and a Statistics section (bootstrap CIs + Friedman with numpy/scipy; judge-ensemble Cohen's κ). The bare closed-book/grounded columns are confounded class means — read the paired table for the retrieval effect. When multiple memory conditions are present, the headline and systems tables are faceted by memory_context; compare rows with the same model and different memory conditions for the memory-context effect.

5a. Reproduce the canonical analysis v1 bundle

Claim-bearing analysis uses Python 3.14.5 (.python-version) and the complete, hash-pinned transitive graph in requirements-lock.txt. requirements.txt and requirements-release.txt are human-edited lock inputs; uv regenerates the lock. From the repository root:

Completed-run promotion boundary

A newly completed experiment is not an analysis source merely because its schedulers stopped. First create and verify a provisional, content-addressed bundle:

python3 scripts/lock-completed-run.py promote \
  --run-dir data/runs/<RUN_ID> \
  --persist-mode git-push \
  --judge copilot:claude-opus-4.6 \
  --judge copilot:gpt-5.4

python3 scripts/lock-completed-run.py verify \
  --bundle data/completed-runs/<RUN_ID>-<FULL_BUNDLE_ID>

Promotion refuses partial rows, missing judge families, competing successful retries, incomplete condition identity, roster/scenario hash drift, paused or canceled runs, and unpushed models. Raw judge attempts remain intact; canonical/judge-retries.jsonl.gz records failed attempts while canonical/judged.jsonl.gz contains exactly one valid row per requested judge. Compressed per-model results, candidate traces, and operational logs are also hash-bound when present. Run python3 scripts/privacy-scan.py after verify; --persist-mode is mandatory and must equal run.meta.persist_mode. For the receipt-backed no-push sensitivity run, pass --persist-mode local-files. integrity verification does not itself certify privacy. The bundle uses analysis schema v1 with source_kind=completed_run and claim_status=provisional; public claims still require a reviewed analysis lock.

Historical schema-v2 dev runs that predate persist_mode and done/committed markers remain fail-closed by default. Audit one only with an explicit exception:

python3 scripts/report-run-quality.py --strict --allow-legacy-persistence \
  --judge copilot:claude-opus-4.6 --judge copilot:gpt-5.4 data/runs/<LEGACY_RUN_ID>

This opt-in relaxes only the historical persistence-marker requirement; exact roster, scenario, repetition, result, and judge domains still apply.

See docs/sdd/completed-run-promotion.md.

Validate archival metadata and build the deterministic frozen-paper package:

python3 scripts/audit-release-metadata.py
python3 scripts/build-release-package.py

The package is written beneath .tmp/release/; no DOI or external upload is created. See docs/ARCHIVAL_RELEASE.md.

python3.14 -m venv .venv
source .venv/bin/activate
python -m pip install --require-hashes -r requirements-lock.txt
python scripts/validate-analysis-environment.py
python scripts/audit-tool-licenses.py
python -m ipykernel install --user --name apprenticeops --display-name "ApprenticeOps (.venv)"

Refresh the lock only after intentionally changing a direct input:

uv pip compile requirements-lock.in --python 3.14.5 \
  --generate-hashes --universal --output-file requirements-lock.txt

Intentionally refresh the correction-locked bundle:

python3 scripts/migrate-analysis-v1.py
scripts/build-analysis-site.sh --update
python3 scripts/audit-paper-data.py
python3 scripts/audit-paper-claims.py

Then prove that all three public notebooks reproduce their cached scientific outputs and that data/site/ plus paper figures regenerate byte-for-byte:

scripts/build-analysis-site.sh --verify

The update path writes two scopes, both under the one analysis schema v1:

  • data/site/models.csv: 94-model quality/safety breadth, no energy field;
  • data/site/controlled_models.csv: 24-model base-clock, Turbo-off, package-0 quality/safety/energy evidence.

The active doctoral run cannot enter this path until completion and its strict data/analysis lock.

6. Exact pinning (for byte-reproducibility in the paper)

Record into ENVIRONMENT.md at run time:

{
  echo "## env $(date -u +%FT%TZ)"
  uname -a
  ollama --version
  python3 --version
  echo "### model digests"; ollama list           # the ID column = the digest you pin
  echo "### cpu"; grep -m1 'model name' /proc/cpuinfo; nproc
  echo "### cpu freq policy"; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor; \
    echo "no_turbo=$(cat /sys/devices/system/cpu/intel_pstate/no_turbo 2>/dev/null)" \
         "perf_pct=$(cat /sys/devices/system/cpu/intel_pstate/min_perf_pct 2>/dev/null)-$(cat /sys/devices/system/cpu/intel_pstate/max_perf_pct 2>/dev/null)"; \
    lscpu | grep -E 'CPU (max|min) MHz'
  echo "### mem"; free -h | awk '/Mem|Swap/'
  echo "### dram speed/channels"; sudo dmidecode -t memory 2>/dev/null | \
    grep -E 'Locator:|Size:|Type:|Configured Memory Speed:' | grep -vE 'No Module|Unknown'
  echo "### disk"; lsblk -d -o NAME,MODEL,SIZE,TRAN | grep -v loop; \
    for d in /sys/class/nvme/nvme*/device; do sudo lspci -vv -s "$(basename "$(readlink -f "$d")")" 2>/dev/null | grep -m1 LnkSta:; done
  echo "### swap"; cat /proc/swaps      # zram (compressed RAM, used first) + disk swapfile (overflow)
  echo "### radios"; for r in /sys/class/rfkill/rfkill*; do echo "$(cat "$r/type")=soft$(cat "$r/soft")"; done 2>/dev/null
} > ENVIRONMENT.md

The prompts are byte-frozen in data/MODEL-PROMPTS.md; seeds are fixed (--seed-base); temps are explicit. Same model digest + same seed + same prompt = same input. (CPU-nondeterminism in float reductions may still vary tokens slightly; that's why we report CIs, not point claims.)

Reproducibility caveats (state in the paper)

  • Telemetry needs Linux (/proc). On other OSes, quality scores still reproduce; the RAM/swap series won't.
  • Energy is optional and regime-bound: the paper's claim-bearing systems evidence uses Intel RAPL package-0 from the 24-model controlled first batch. psys and dynamic-frequency second-batch rows remain descriptive only and are never pooled into that ranking. A smart plug measures wall draw instead. No power source leaves power columns blank; power.source records what was used.
  • CPU nondeterminism: identical seed can still differ token-for-token across CPUs/threads → we publish CIs and bracket-level claims, not exact per-model ranks.
  • Ollama packaging changes: a re-pushed tag can change weights; pin the digest from ollama list, not the tag.
  • Judge drift: frontier models update; record JUDGE_MODEL + date. Release the judge prompts + a human-rated κ subset so others can re-judge.
  • Judge egress / opsec: the off-node judge (GitHub Models → a cloud frontier model) receives the full scenario text, which in this study contains real cluster detail (namespaces, Azure Key Vault, Cloudflare, *.home.domain, restic/NAS). The system-under-test stays sovereign, but grading sends real ops data to a third party. Scrub/anonymize scenarios before public release, and disclose this egress in the paper. Self-hosting the judge removes it.

Extracting the standalone repo (for the paper)

This folder is self-contained and meant to become its own public repo. To lift it:

apprenticeops/                     # new public repo (Apache-2.0)
├── README.md                      # <- README.md (this folder)
├── PAPER.md  PLAN.md  MARKET.md   # design + method + adversarial  (docs/)
├── MODELS.md  models.txt          # model manifest  (docs/ and data/)
├── scenarios.json                 # the benchmark (frozen real incidents)  (data/)
├── MODEL-PROMPTS.md               # byte-frozen prompts  (data/)
├── run.py  baselines.py  judge.py  report.py
├── REPRODUCE.md                   # <- this file
├── LICENSE                        # Apache-2.0 (add on extraction)
└── results/                       # released run data + RESULTS.md + ENVIRONMENT.md

Nothing in the harness hardwires home.home.domain — the scenarios are frozen text (anyone runs them as-is); OLLAMA_URL is the only host knob. The only homelab-specific content is the incident text itself, which is the point (real, uncontaminated tasks). Add a top-level LICENSE and a results/ snapshot on extraction and it's a clean clone-and-run artifact.