lab-kit-cli 1.3.0__tar.gz → 1.3.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.
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/CHANGELOG.md +8 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/PKG-INFO +1 -1
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/docs/model.md +3 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/pyproject.toml +1 -1
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/__init__.py +1 -1
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/history.py +6 -4
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/write.py +1 -1
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_held.py +12 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/.github/workflows/ci.yml +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/.github/workflows/policy.yml +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/.github/workflows/release.yml +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/.gitignore +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/AGENTS.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/CLAUDE.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/CONTRIBUTING.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/LICENSE +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/README.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/agents/reviewer.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/method/METHOD.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/skills/lab-review/SKILL.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/skills/lab-set-up/SKILL.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/skills/lab-talk/SKILL.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/skills/lab-work/SKILL.md +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/checks.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/cli.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/record.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/runs.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/site.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/supervise.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/src/lab_kit/views.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_flow.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_integrity.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_needs.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_order.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_parked.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_refusals.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_site.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_vocabulary.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tests/test_wording.py +0 -0
- {lab_kit_cli-1.3.0 → lab_kit_cli-1.3.1}/tools/import_run.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.1
|
|
4
|
+
|
|
5
|
+
- **A log line's end spaces are not part of it.** `lab log` wrote a line ending in `| ` when the so what was
|
|
6
|
+
empty, which a lab's own whitespace check may refuse, while `lab check` refused the line once the space was
|
|
7
|
+
removed, as a committed line changed. `lab log` now ends a line with no space, and `lab check` compares the
|
|
8
|
+
committed lines of `log.md` with the spaces at their ends left out. Other files of the record are compared as
|
|
9
|
+
they were.
|
|
10
|
+
|
|
3
11
|
## 1.3.0
|
|
4
12
|
|
|
5
13
|
A new page style, and a lock that holds what a plan demands rather than its words. Before, every page of a card
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: lab-kit-cli
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.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
|
|
@@ -698,6 +698,9 @@ anything else is refused when the run is sealed and reported by `lab check`. Its
|
|
|
698
698
|
in UTC. The file holds no other heading, and a line no other `|`. The kinds are `decision`, `agent`, `result`, `stuck` and `doing`. `lab decide` writes the
|
|
699
699
|
`decision` lines, each with the opening of what was decided. A `doing` line holds what the agent is
|
|
700
700
|
starting on and why now. A line written before the kit kept the time has none.
|
|
701
|
+
`lab log` ends a line with no space, even when the so what is empty. Spaces at the end of a log line
|
|
702
|
+
are not part of it: `lab check` compares the committed lines of `log.md` with those spaces left out,
|
|
703
|
+
so removing or adding them changes no committed line.
|
|
701
704
|
|
|
702
705
|
**Worked-out states.** A question is under discussion while the decision it came from is open, then
|
|
703
706
|
open, then yes or no; it is parked while the last settled decision that parks or brings it back parks it; a page calls an open question with nothing under it "not started". A build is in
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
[project]
|
|
6
6
|
dynamic = ["readme"]
|
|
7
7
|
name = "lab-kit-cli"
|
|
8
|
-
version = "1.3.
|
|
8
|
+
version = "1.3.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.3.
|
|
2
|
+
__version__ = "1.3.1"
|
|
@@ -10,7 +10,8 @@ A file is known by the numbers in its path and not by the words, so a folder ren
|
|
|
10
10
|
same place: what was committed under the old name is held under the new one.
|
|
11
11
|
|
|
12
12
|
- A committed `lock.json` is byte for byte its first committed version.
|
|
13
|
-
- `log.md`, `reviews.tsv` and `runs.tsv` only grow: no committed line is removed or changed.
|
|
13
|
+
- `log.md`, `reviews.tsv` and `runs.tsv` only grow: no committed line is removed or changed. Spaces at the end of a
|
|
14
|
+
line of `log.md` are not part of it.
|
|
14
15
|
- A `results.tsv` that a review has passed keeps every committed row. Once a results review that passed is committed
|
|
15
16
|
together with the rows it read, those rows stay, whatever the card and the file say later. Rows committed while
|
|
16
17
|
the last passed review was of other rows, such as a draft row added after it, were never reviewed and are not held.
|
|
@@ -40,11 +41,11 @@ def committed(root):
|
|
|
40
41
|
return git(root, "rev-parse", "--is-inside-work-tree") is not None and git(root, "rev-parse", "HEAD") is not None
|
|
41
42
|
|
|
42
43
|
|
|
43
|
-
def subsequence(old, new):
|
|
44
|
+
def subsequence(old, new, same=lambda a, b: a == b):
|
|
44
45
|
"""The first line of `old` that `new` no longer holds in order, or None."""
|
|
45
46
|
it = iter(new)
|
|
46
47
|
for line in old:
|
|
47
|
-
if not any(line
|
|
48
|
+
if not any(same(line, x) for x in it):
|
|
48
49
|
return line
|
|
49
50
|
return None
|
|
50
51
|
|
|
@@ -204,8 +205,9 @@ def check(lab):
|
|
|
204
205
|
continue
|
|
205
206
|
if name == "results.tsv": # rows may change until a review passes them
|
|
206
207
|
commits = commits[-1:] if mine(commits[-1][1]) in reviewed else []
|
|
208
|
+
same = (lambda a, b: a.rstrip(" ") == b.rstrip(" ")) if name == "log.md" else (lambda a, b: a == b) # a log line's end spaces are not its
|
|
207
209
|
for c, path in reversed(commits):
|
|
208
|
-
lost = subsequence((git(root, "show", f"{c}:./{path}") or "").splitlines(), R.read(os.path.join(root, mine(path))).splitlines())
|
|
210
|
+
lost = subsequence((git(root, "show", f"{c}:./{path}") or "").splitlines(), R.read(os.path.join(root, mine(path))).splitlines(), same)
|
|
209
211
|
if lost is not None:
|
|
210
212
|
bad(mine(path), f"a line committed in {c[:8]}{named(path)} is gone or changed: {lost[:70]!r}")
|
|
211
213
|
break
|
|
@@ -197,7 +197,7 @@ def log(lab, about, kind, what, so="", _by_command=False):
|
|
|
197
197
|
what, so = log_line(lab, about, kind, what, so, _by_command)
|
|
198
198
|
path = os.path.join(lab.root, "log.md")
|
|
199
199
|
text = R.read(path) if os.path.exists(path) else ""
|
|
200
|
-
line = f"- {clock()} | {about} | {kind} | {what} | {so}"
|
|
200
|
+
line = f"- {clock()} | {about} | {kind} | {what} | {so}".rstrip(" ")
|
|
201
201
|
head = "" if re.findall(r"^## (\S+)", text, flags=re.M)[-1:] == [today()] else ("\n" if text.strip() else "") + f"## {today()}\n\n"
|
|
202
202
|
with open(path, "a") as f:
|
|
203
203
|
f.write(("" if not text or text.endswith("\n") else "\n") + head + line + "\n")
|
|
@@ -79,6 +79,18 @@ def test_the_history_that_is_checked_is_the_labs_own_record(tmp_path):
|
|
|
79
79
|
broken(f"{x}/{name}", drop, "a line committed in")
|
|
80
80
|
broken("log.md", lambda full, kept: os.remove(full), "was committed and is gone")
|
|
81
81
|
broken("log.md", drop, "a line committed in")
|
|
82
|
+
# the spaces at the end of a log line are not part of it: stripping or adding them is no change
|
|
83
|
+
log = f"{root}/log.md"
|
|
84
|
+
kept = open(log).read()
|
|
85
|
+
for spaced in ("\n".join(l + " " for l in kept.split("\n")), kept.replace(" \n", "\n")):
|
|
86
|
+
open(log, "w").write(spaced)
|
|
87
|
+
assert "the record is sound" in lab(root, "check", "--no-rederive"), spaced
|
|
88
|
+
open(log, "w").write(kept.replace("- ", "- ", 1)) # a space inside a line is still a change
|
|
89
|
+
assert "history: log.md: a line committed in" in lab(root, "check", "--no-rederive", ok=False)
|
|
90
|
+
open(log, "w").write(kept)
|
|
91
|
+
lab(root, "log", ident, "agent", "a line with no so what")
|
|
92
|
+
assert open(log).read().endswith("| a line with no so what |\n") # `lab log` ends a line with no space
|
|
93
|
+
open(log, "w").write(kept)
|
|
82
94
|
broken(os.path.relpath(glob.glob(f"{root}/decisions/D1-*.md")[0], root), lambda full, kept: os.remove(full), "was committed and is gone")
|
|
83
95
|
assert "the record is sound" in lab(root, "check", "--strict")
|
|
84
96
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|