Skip to content

mia-data: per-round harness source snapshots - #41

Merged
krokicki merged 3 commits into
mainfrom
harness-snapshots
Oct 13, 2026
Merged

krokicki merged 3 commits into
mainfrom
harness-snapshots

Conversation

@krokicki

@krokicki krokicki commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Issue mia-workflow-data#54 passed match, test crops and review, then was refused at production with PinMoved: the harness.dir checkout is also the working clone, and it had three commits (API, CI, README; CLAUDE.md) between admission and approval. The environment was identical (pixi.lock digest unchanged), only the source commit had moved. Spec §6 had a ponytail note anticipating this.

Change

  • harness_snapshot(cfg, commit) extracts harness/src at the admitted commit from the checkout into work_root/_harness/<commit>/src, read-only, flock-serialised, once per commit, the same way snippets are snapshotted. admit calls it, so the source is frozen the moment the pin is taken; _spec calls it too, idempotently.
  • Every job spec writes a bin/harness wrapper into the workspace and puts it first on PATH: PYTHONPATH=<snapshot>/src <env>/bin/python -P -c 'from mia_harness.cli import main; …'. PYTHONPATH precedes the env's editable install of the checkout's own source, verified against the real environment (imports resolve to the snapshot). -P keeps the job cwd off sys.path. The old commit from issue 54 snapshots fine too.
  • assert_pin compares only the pixi.lock digest. HEAD may move; a changed lock still refuses, since the env is shared.
  • md check looks for the env's python instead of the harness entry script.
  • Spec §6 Pinning rewritten; handoff note line updated.

Not done: one environment per lock digest. Lock changes are rare and human, so they wait for in-flight rounds; the ponytail note in §6 now says that.

Tests: new cases for a HEAD move not touching an admitted round and for unknown commits; fixtures grew a harness/src. 325 pass.

🤖 Generated with Claude Code

…y pixi.lock alone

Issue 54 was refused at production (PinMoved) because the harness checkout, which is also the working clone,
had three commits since admission, even though the environment was identical. Now admission snapshots
`harness/src` at the admitted commit into work_root/_harness/<commit>/ (read-only, flock, once per commit),
and every job runs the pinned env's python on that snapshot through a `bin/harness` wrapper written into the
workspace (PYTHONPATH ahead of the env's editable install). assert_pin compares only the pixi.lock digest.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
krokicki and others added 2 commits October 13, 2026 10:01
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Re-applies the per-round harness snapshot on the renamed, formatted code:
harness_snapshot and the bin/harness wrapper in jobspec, the snapshot
call in admit, harness_env in md check, and the jobspec tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@krokicki
krokicki merged commit d9935e9 into main Oct 13, 2026
1 check passed
@krokicki
krokicki deleted the harness-snapshots branch October 13, 2026 14:08
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.

1 participant