lab-kit-cli 1.11.0__tar.gz → 1.11.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/CHANGELOG.md +9 -0
  2. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/PKG-INFO +1 -1
  3. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/docs/model.md +4 -1
  4. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/pyproject.toml +1 -1
  5. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/__init__.py +1 -1
  6. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/checks.py +21 -1
  7. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_integrity.py +8 -0
  8. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/.github/workflows/ci.yml +0 -0
  9. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/.github/workflows/policy.yml +0 -0
  10. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/.github/workflows/release.yml +0 -0
  11. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/.gitignore +0 -0
  12. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/AGENTS.md +0 -0
  13. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/CLAUDE.md +0 -0
  14. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/CONTRIBUTING.md +0 -0
  15. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/LICENSE +0 -0
  16. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/README.md +0 -0
  17. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/agents/reviewer.md +0 -0
  18. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/method/METHOD.md +0 -0
  19. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/skills/lab-mission/SKILL.md +0 -0
  20. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/skills/lab-review/SKILL.md +0 -0
  21. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/skills/lab-set-up/SKILL.md +0 -0
  22. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/skills/lab-talk/SKILL.md +0 -0
  23. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/skills/lab-work/SKILL.md +0 -0
  24. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/cli.py +0 -0
  25. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/history.py +0 -0
  26. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/record.py +0 -0
  27. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/runs.py +0 -0
  28. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/site.py +0 -0
  29. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/supervise.py +0 -0
  30. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/views.py +0 -0
  31. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/src/lab_kit/write.py +0 -0
  32. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_drafts.py +0 -0
  33. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_flow.py +0 -0
  34. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_held.py +0 -0
  35. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_mission.py +0 -0
  36. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_needs.py +0 -0
  37. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_order.py +0 -0
  38. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_parked.py +0 -0
  39. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_refusals.py +0 -0
  40. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_site.py +0 -0
  41. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_states.py +0 -0
  42. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_vocabulary.py +0 -0
  43. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tests/test_wording.py +0 -0
  44. {lab_kit_cli-1.11.0 → lab_kit_cli-1.11.1}/tools/import_run.py +0 -0
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.11.1
4
+
5
+ - **A run in progress in another checkout no longer fails `lab check`.** A run stays in the `.lab/running` of the
6
+ checkout that started it until it ends, so every other checkout of the same lab saw a run listed as started and
7
+ not in the store, and `lab check` failed there with "a run is never removed": with several sessions running
8
+ experiments in their own worktrees, the gate was red everywhere but in each run's own checkout. A run listed as
9
+ started and not ended, whose folder is in the `.lab/running` of another git worktree of the lab on this machine,
10
+ is now a note. A run listed as started whose folder is nowhere is still a problem, the prompt to declare it lost.
11
+
3
12
  ## 1.11.0
4
13
 
5
14
  - **An ended run that did not record what it used can be amended.** A run stopped before its machines' files came
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lab-kit-cli
3
- Version: 1.11.0
3
+ Version: 1.11.1
4
4
  Summary: A research lab's record, its method, and the command that keeps both.
5
5
  Project-URL: Homepage, https://github.com/pierg/lab-kit
6
6
  Project-URL: Issues, https://github.com/pierg/lab-kit/issues
@@ -173,7 +173,10 @@ Each arrow is a command that refuses when the step before it is missing. You see
173
173
  git: one row when a run or a trial starts, and one when it ends, with how it ended and its seal.
174
174
  Rows are only added. `lab run` reads that list as well as the store, so a clone without the store
175
175
  still knows what ran. `lab check` asks that every listed run is in the store with the seal that
176
- was listed, and that every run in the store is listed. Where the store is not mounted the check
176
+ was listed, and that every run in the store is listed. A run in progress is in the `.lab/running`
177
+ of the checkout that started it until it ends: one listed as started and not ended whose folder is
178
+ there in another git worktree of the lab on this machine is running, and the check notes it
179
+ instead of asking for it in the store. Where the store is not mounted the check
177
180
  says so and checks no run.
178
181
  **A run that is lost.** A run can start and never report back: the machine dies with its folder on
179
182
  it. Its `started` row stays. `lab runs lost <run> "<why>"` adds a row that says so, with the reason
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
  [project]
6
6
  dynamic = ["readme"]
7
7
  name = "lab-kit-cli"
8
- version = "1.11.0"
8
+ version = "1.11.1"
9
9
  description = "A research lab's record, its method, and the command that keeps both."
10
10
  license = "MIT"
11
11
  authors = [{ name = "Piergiuseppe Mallozzi" }]
@@ -1,2 +1,2 @@
1
1
  """lab-kit: a research lab's record, its method, and the command that keeps both."""
2
- __version__ = "1.11.0"
2
+ __version__ = "1.11.1"
@@ -32,6 +32,22 @@ def run(lab, rederive=True):
32
32
  if lab.held.get("error"): # what locks a decision is read from git; without it a lock could be edited away unseen
33
33
  bad("history", "git", f"what locks a decision could not be read from the lab's history: {lab.held['error']}")
34
34
 
35
+ elsewhere, others = [], [] # runs runs.tsv lists as started and not ended whose folder is in another checkout's .lab/running
36
+
37
+ def running_elsewhere():
38
+ """The runs whose folder is in the .lab/running of another git worktree of this lab, on this machine."""
39
+ if not others:
40
+ top = history.git(root, "rev-parse", "--show-toplevel")
41
+ sub = os.path.relpath(root, top.strip()) if top else "."
42
+ trees = [l[len("worktree "):] for l in (history.git(root, "worktree", "list", "--porcelain") or "").splitlines() if l.startswith("worktree ")]
43
+ found = set()
44
+ for t in trees:
45
+ folder = os.path.join(t, sub, ".lab", "running")
46
+ if os.path.realpath(os.path.join(t, sub)) != os.path.realpath(root) and os.path.isdir(folder):
47
+ found.update(os.listdir(folder))
48
+ others.append(found)
49
+ return others[0]
50
+
35
51
  absent = {} # the libraries the charter names whose folder is not on this machine
36
52
 
37
53
  def see(where, page, who=""):
@@ -243,7 +259,9 @@ def run(lab, rederive=True):
243
259
  where = f"{r['dir']}"
244
260
  listed = x["listed"].get(r["id"])
245
261
  if r["missing"]: # runs.tsv is in git and the store is not: a run the ledger lists stays where it was sealed
246
- if here and not r["lost"]:
262
+ if here and not r["lost"] and r["state"] == "running" and r["id"] in running_elsewhere(): # it runs in another checkout here
263
+ elsewhere.append(r["id"])
264
+ elif here and not r["lost"]:
247
265
  bad("runs", where, f"is listed in {x['dir']}/runs.tsv and is not in the store: a run is never removed. If it started and its folder is gone for good, `lab runs lost {r['id']} \"<why>\"` records that")
248
266
  continue
249
267
  if listed and listed["lost"]:
@@ -425,6 +443,8 @@ def run(lab, rederive=True):
425
443
  waiting = [r for r in lab.runs if r["local"] and r["state"] != "running"]
426
444
  if waiting:
427
445
  notes.append(f"{len(waiting)} ended run(s) are still on this machine, not in the store: `lab runs publish`")
446
+ if elsewhere: # its own checkout checks it; it is held here once runs.tsv says it ended
447
+ notes.append(f"{len(elsewhere)} run(s) still running in another checkout on this machine, checked once they end: {', '.join(elsewhere)}")
428
448
  found, said = history.check(lab)
429
449
  said += history.uncommitted(lab) # not held by git yet: a note, and a failure when the check is strict
430
450
  problems += found
@@ -516,6 +516,14 @@ def test_a_run_that_never_reports_back_is_declared_lost(tmp_path):
516
516
  assert f"lab runs lost {gone}" in lab(root, "run", ident, "--wait", "--", *command, ok=False)
517
517
  assert f"lab runs lost {gone}" in lab(root, "runs", "close", gone, "the machine is gone", ok=False)
518
518
  assert f"lab runs lost {gone}" in lab(root, "check", "--no-rederive", ok=False)
519
+ # while its folder is in another checkout's .lab/running on this machine, it is running there: a note, not a problem
520
+ other = str(tmp_path) + "-other"
521
+ subprocess.run(["git", "-C", root, "worktree", "add", "-q", "--detach", other], check=True, capture_output=True)
522
+ os.makedirs(f"{other}/.lab/running/{gone}")
523
+ out = lab(root, "check", "--no-rederive")
524
+ assert "the record is sound" in out and f"still running in another checkout on this machine, checked once they end: {gone}" in out
525
+ shutil.rmtree(f"{other}/.lab/running/{gone}")
526
+ assert f"lab runs lost {gone}" in lab(root, "check", "--no-rederive", ok=False)
519
527
  assert "no run 20260102-0931_G1.Q1.1_zzzz is listed" in lab(root, "runs", "lost", "20260102-0931_G1.Q1.1_zzzz", "gone", ok=False)
520
528
  assert "say why" in lab(root, "runs", "lost", gone, " ", ok=False)
521
529
  assert "--used laptop=1" in lab(root, "runs", "lost", gone, "The machine was deleted.", "--used", "laptop=1", ok=False)
File without changes
File without changes
File without changes
File without changes
File without changes