lab-kit-cli 1.12.0__tar.gz → 1.13.0__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.12.0 → lab_kit_cli-1.13.0}/CHANGELOG.md +23 -14
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/PKG-INFO +1 -1
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/docs/model.md +37 -35
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/method/METHOD.md +8 -7
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/pyproject.toml +1 -1
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/skills/lab-review/SKILL.md +1 -1
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/skills/lab-set-up/SKILL.md +5 -4
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/skills/lab-talk/SKILL.md +10 -10
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/skills/lab-work/SKILL.md +23 -22
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/__init__.py +1 -1
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/checks.py +3 -3
- lab_kit_cli-1.12.0/src/lab_kit/papers.py → lab_kit_cli-1.13.0/src/lab_kit/storylines.py +38 -36
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/views.py +2 -2
- lab_kit_cli-1.12.0/tests/test_papers.py → lab_kit_cli-1.13.0/tests/test_storylines.py +61 -61
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/.github/workflows/ci.yml +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/.github/workflows/policy.yml +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/.github/workflows/release.yml +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/.gitignore +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/AGENTS.md +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/CLAUDE.md +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/CONTRIBUTING.md +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/LICENSE +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/README.md +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/agents/reviewer.md +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/skills/lab-mission/SKILL.md +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/cli.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/history.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/record.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/runs.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/site.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/supervise.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/src/lab_kit/write.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_drafts.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_flow.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_held.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_integrity.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_mission.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_needs.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_order.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_parked.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_refusals.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_site.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_states.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_vocabulary.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tests/test_wording.py +0 -0
- {lab_kit_cli-1.12.0 → lab_kit_cli-1.13.0}/tools/import_run.py +0 -0
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.13.0
|
|
4
|
+
|
|
5
|
+
- **A scope page is a storyline.** A storyline is one argument the lab is building from its findings, for one
|
|
6
|
+
audience: what a paper, a talk or a report is later written from, never the finished artifact. The table in
|
|
7
|
+
`lab.toml` is `[storylines]`, `lab now` has a Storylines section and a "Serving no active storyline" list, and
|
|
8
|
+
the method, the model and the skills say storyline throughout. 1.12.0's table of the same shape, `[papers]`,
|
|
9
|
+
is no longer read: no lab had turned it on. Run `lab init` in a lab after upgrading.
|
|
10
|
+
|
|
3
11
|
## 1.12.0
|
|
4
12
|
|
|
5
|
-
- **
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
a lab without it is unchanged. With it, each
|
|
13
|
-
`"excluded"` and `"open"`, and `lab check`
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
- **Storylines drive the work; the record names no storyline** (method rule 8, model section 4). A lab keeps one
|
|
14
|
+
overview page of the whole trail and one page per active storyline, written as that argument and opening with
|
|
15
|
+
a scope table: audience, thesis, experiments included, excluded or superseded, and open. The storylines' open
|
|
16
|
+
rows and their reviewers' criticisms say what is proposed, ordered, parked or dropped, and a result revises the
|
|
17
|
+
overview and every storyline it touches. So far gives the current finding, never the story of the bugs on the
|
|
18
|
+
way. Adding, merging or retiring a storyline is direction.
|
|
19
|
+
- **A table in `lab.toml`** (`[papers]` in this release, `[storylines]` from 1.13.0) names the overview and the
|
|
20
|
+
active storyline pages, as library paths. It is optional: a lab without it is unchanged. With it, each
|
|
21
|
+
storyline page marks its scope cells `data-scope="included"`, `"excluded"` and `"open"`, and `lab check`
|
|
22
|
+
refuses an id that is not in the lab, a step under included that is not done or is void, a step under open
|
|
23
|
+
that is finished, a question or goal under open that is done, a parked or dropped question or goal in either,
|
|
24
|
+
and a goal, question or step listed in two rows of one page. It notes a storyline page committed before a
|
|
25
|
+
result about something it lists under included or open.
|
|
26
|
+
- **`lab now` lists the storylines**: each active one with the open work its scope names, then the live steps
|
|
27
|
+
that none lists, by themselves or by their question or goal.
|
|
19
28
|
- The skills `lab-set-up`, `lab-work`, `lab-talk` and `lab-review` and the method changed: run `lab init` in a lab
|
|
20
29
|
after upgrading.
|
|
21
30
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: lab-kit-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.13.0
|
|
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
|
|
@@ -255,7 +255,7 @@ in points. When a named result belongs to a replaced experiment, the page says s
|
|
|
255
255
|
You decide two things: **direction** and **resources**. You decide them in a discussion with the agent,
|
|
256
256
|
not by approving requests.
|
|
257
257
|
|
|
258
|
-
- **Direction.** The goals, the questions, and the
|
|
258
|
+
- **Direction.** The goals, the questions, and the storylines they serve.
|
|
259
259
|
- **Resources.** Everything outside the lab that it may touch: what it may use, how much, and what it
|
|
260
260
|
may do there.
|
|
261
261
|
|
|
@@ -376,35 +376,37 @@ is a resource and a cap, nothing else. A lower cap is the agent's to write. A hi
|
|
|
376
376
|
rule, a new resource or a larger grant comes out of a decision: one that lists that experiment, or
|
|
377
377
|
that resource, under `about:`.
|
|
378
378
|
|
|
379
|
-
**
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
the
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
379
|
+
**Storylines drive the work; the record names no storyline.** A **storyline** is one argument the lab is
|
|
380
|
+
building from its findings, for one audience: what a paper, a talk or a report will later be written from. It is
|
|
381
|
+
the argument, never the finished artifact, and it keeps moving while the work runs. A lab that keeps storylines
|
|
382
|
+
keeps two layers apart. The record (`goals/`, `decisions/`, `runs/`) is the trail: every question, run, failed
|
|
383
|
+
attempt and replaced experiment, so that every number has an origin. No card names a storyline, because
|
|
384
|
+
storylines change, split, merge and are dropped while the record stays as it is and is read by each of them.
|
|
385
|
+
Above the record, the lab's library holds one **overview** page that keeps the whole trail in one place,
|
|
386
|
+
whatever storyline it serves: the words on one running example, the workflow, every related-work row, every
|
|
387
|
+
established finding, every criticism and what answers it. Beside it, each **active storyline** has its own page,
|
|
388
|
+
written as that storyline's technical argument and nothing else: it never talks about the lab or how it works. A
|
|
389
|
+
storyline page opens, under its thesis, with a **scope table** of five rows: the target audience and venues, the
|
|
390
|
+
core thesis, the experiments included (the clean runs each claim rests on), the experiments excluded or
|
|
391
|
+
superseded (a run that hit a harness bug, a subset a full run replaced, work that belongs to another storyline),
|
|
392
|
+
and the open experiments the storyline still needs. Then come its words on one running example, its pipeline,
|
|
393
|
+
its comparison with the published work of its community, its established results citing only included work, the
|
|
394
|
+
criticisms a reviewer in that community will raise with what answers each, and what remains to run. When the
|
|
395
|
+
time comes to write the paper, the talk or the report itself, it is written from this page.
|
|
396
|
+
|
|
397
|
+
The control runs from the storylines to the lab, not the other way. Which questions and experiments are
|
|
398
|
+
proposed, ordered, parked or dropped follows the open rows and the criticisms on the active storyline pages: a
|
|
399
|
+
decision says which storyline row it serves, and a step that serves none is a candidate to park or drop. When
|
|
400
|
+
a result lands, the overview and every storyline it touches are revised; a run that a newer one supersedes
|
|
401
|
+
moves from included to excluded. Adding, merging or retiring a storyline is direction, so it is decided with
|
|
402
|
+
you. A question's or an experiment's So far gives the current finding, not the story of the bugs on the way:
|
|
403
|
+
the replaced experiments and the reasons they were replaced keep that story.
|
|
401
404
|
|
|
402
405
|
A lab opts in by naming the pages in `lab.toml` (section 9). Then `lab check` holds each scope table:
|
|
403
406
|
included lists only finished work that is not void, replaced or dropped, open only work still to do, nothing
|
|
404
|
-
parked or dropped is in either, and a goal, a question or a step sits in one row; a
|
|
405
|
-
before a result about something it lists under included or open is noted. `lab now` lists each
|
|
406
|
-
experiments, and the live steps no
|
|
407
|
-
by their question or goal.
|
|
407
|
+
parked or dropped is in either, and a goal, a question or a step sits in one row; a storyline page committed
|
|
408
|
+
before a result about something it lists under included or open is noted. `lab now` lists each storyline's
|
|
409
|
+
open experiments, and the live steps no storyline lists, by themselves or by their question or goal.
|
|
408
410
|
|
|
409
411
|
## 5. What the agent uses
|
|
410
412
|
|
|
@@ -492,13 +494,13 @@ Eight rules:
|
|
|
492
494
|
6. Record what was decided and why, in the lab's words, and show the operator the text as recorded.
|
|
493
495
|
Never record a decision that was not discussed with them.
|
|
494
496
|
7. Say what you are on. When you start on a card, log what you are doing and why now.
|
|
495
|
-
8.
|
|
496
|
-
propose, order, park or drop, and a result revises the overview and every
|
|
497
|
+
8. Storylines drive the work; the record names no storyline. The storylines' open rows and criticisms say
|
|
498
|
+
what to propose, order, park or drop, and a result revises the overview and every storyline it touches.
|
|
497
499
|
|
|
498
500
|
`lab check` holds what can be held mechanically: ids and links, the goal's vocabulary being terms of the glossary, a title and a description on every
|
|
499
501
|
card, short cards that write only their own front matter, a test on every line, a reason on every
|
|
500
502
|
replacement, unchanged locks, sealed runs, results that still re-derive and were reviewed, use inside
|
|
501
|
-
the resources' amounts, what each
|
|
503
|
+
the resources' amounts, what each storyline's scope table lists when the lab names its storylines, a decision behind every goal, question and metered amount, an experiment
|
|
502
504
|
behind every answer, the method and the skills as the kit installed them, and a history that only
|
|
503
505
|
grows. What it cannot read as this page describes (a mistyped folder, a list written as one value, a
|
|
504
506
|
file that is not text) is a problem it reports; no command stops on it.
|
|
@@ -935,16 +937,16 @@ holds the line `launched`, else next, and `lab check` asks for the status to be
|
|
|
935
937
|
reports a mission that breaks any of this, one whose `carries:` is not a decision, and a current mission whose
|
|
936
938
|
decision is still open.
|
|
937
939
|
|
|
938
|
-
**
|
|
940
|
+
**Storylines.** `lab.toml` names the library's storyline pages in a table, as library paths (the path under
|
|
939
941
|
`content/`, as `see:` writes it):
|
|
940
942
|
|
|
941
943
|
```
|
|
942
|
-
[
|
|
944
|
+
[storylines]
|
|
943
945
|
overview = "entries/where-the-results-stand"
|
|
944
|
-
active = ["entries/
|
|
946
|
+
active = ["entries/storyline-a", "entries/storyline-b"]
|
|
945
947
|
```
|
|
946
948
|
|
|
947
|
-
`overview` is the page that keeps the whole trail; it is never an active
|
|
949
|
+
`overview` is the page that keeps the whole trail; it is never an active storyline. Each page under `active` is
|
|
948
950
|
in the library and marks the three cells of its scope table that list work, `data-scope="included"`,
|
|
949
951
|
`data-scope="excluded"` and `data-scope="open"`, empty when it lists nothing:
|
|
950
952
|
|
|
@@ -960,7 +962,7 @@ a question or a step has one row on a page: where another row needs to mention i
|
|
|
960
962
|
without its link. A question written in one row and a step under it written in another is allowed: the open
|
|
961
963
|
question with its one finished step included is the usual case. A decision may be cited in any row. In
|
|
962
964
|
`lab now` and in the note on a stale page, a goal or a question written under included or open stands for
|
|
963
|
-
every step under it. A lab without `[
|
|
965
|
+
every step under it. A lab without `[storylines]` has none of this.
|
|
964
966
|
|
|
965
967
|
**Worked-out states.** A goal is open until `reached: true` makes it done or `dropped:` drops it. A
|
|
966
968
|
question is waiting while the decision it came from is open, then open, then done with its answer; it
|
|
@@ -32,7 +32,7 @@ judgement. The lab's own `AGENTS.md` adds only what is local.
|
|
|
32
32
|
checks the solver leaves open", not "of 20". *The numbers and the budgets are held by `lab check`; whether a page
|
|
33
33
|
can be read cold is judged, and the reviewer reads for it.*
|
|
34
34
|
5. **Decide everything that is not direction or resources, and never wait idle.** Direction is the
|
|
35
|
-
goals, the questions and the active
|
|
35
|
+
goals, the questions and the active storylines. Resources are what `resources.toml` lists and how much. For those two,
|
|
36
36
|
open a decision that says what was seen, the options and what you recommend, and work on what it
|
|
37
37
|
does not hold. What a decision settled needs no further yes. Everything else is yours: decide,
|
|
38
38
|
record it, go on. A mission (`missions/`) carries out what a settled decision settled across sessions, and approves
|
|
@@ -50,11 +50,12 @@ judgement. The lab's own `AGENTS.md` adds only what is local.
|
|
|
50
50
|
should never have to ask you. When you start on a card or move to another, log it:
|
|
51
51
|
`lab log <id> doing "<what>" "<why now>"`. The line stands on the front page until a result, a
|
|
52
52
|
stuck line or a choice about the same card ends it. *Judged.*
|
|
53
|
-
8. **
|
|
54
|
-
When the lab
|
|
55
|
-
|
|
53
|
+
8. **Storylines drive the work; the record names no storyline.** The record is the trail, and no card names a storyline.
|
|
54
|
+
When the lab keeps storylines (the arguments its papers, talks or reports will be written from), its
|
|
55
|
+
library keeps one overview of the whole trail, and one page per active
|
|
56
|
+
storyline that is that storyline's argument and nothing else. A storyline page opens with its scope table: audience,
|
|
56
57
|
thesis, the experiments included, those excluded or superseded, and those still open. What you propose,
|
|
57
|
-
order, park or drop follows the
|
|
58
|
-
revise the overview and every
|
|
59
|
-
merging or retiring a
|
|
58
|
+
order, park or drop follows the storylines' open rows and their reviewers' criticisms; when a result lands,
|
|
59
|
+
revise the overview and every storyline it touches, and move what a newer run supersedes to excluded. Adding,
|
|
60
|
+
merging or retiring a storyline is direction. *Held by `lab check` when `lab.toml` names the storylines; otherwise
|
|
60
61
|
judged.*
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
[project]
|
|
6
6
|
dynamic = ["readme"]
|
|
7
7
|
name = "lab-kit-cli"
|
|
8
|
-
version = "1.
|
|
8
|
+
version = "1.13.0"
|
|
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" }]
|
|
@@ -44,7 +44,7 @@ A failed plan is fixed by its author and read again.
|
|
|
44
44
|
the first sentence and folds the rest.
|
|
45
45
|
|
|
46
46
|
A failed results review is final for that experiment. Say in the note what a replacement must do
|
|
47
|
-
differently. Its numbers can then be cited nowhere: if a
|
|
47
|
+
differently. Its numbers can then be cited nowhere: if a storyline page lists it under included, `lab check`
|
|
48
48
|
says so, and the author takes it off.
|
|
49
49
|
|
|
50
50
|
When you read a plan, also read the card as someone who was not there. If an arm is named and not
|
|
@@ -43,13 +43,14 @@ You set the lab up in one discussion with the operator, so that everything it se
|
|
|
43
43
|
here first.
|
|
44
44
|
11. The site: the lab's `docs/` folder is a folio library whose charter lists `lab_kit.site` under
|
|
45
45
|
`views:`. Set it up with folio's own skill if it is not there.
|
|
46
|
-
12. If the lab will
|
|
47
|
-
direction, and may stay empty).
|
|
46
|
+
12. If the lab will argue its findings to an audience (a paper, a talk, a report), ask the operator which
|
|
47
|
+
storylines it aims at now, for whom and where (it is direction, and may stay empty). A storyline is the
|
|
48
|
+
argument such an output is written from, not the output itself. Write the overview page (for example `entries/where-the-results-stand`) with folio's
|
|
48
49
|
write skill: the words on one running example, the workflow, the related work, and empty sections for the
|
|
49
|
-
findings and the criticisms. For each
|
|
50
|
+
findings and the criticisms. For each storyline, write `entries/storyline-<slug>`: its thesis, then the scope table
|
|
50
51
|
(target audience and venues, core thesis, experiments included, excluded or superseded, open), with the
|
|
51
52
|
last three cells marked `data-scope="included"`, `"excluded"` and `"open"`. Name them in `lab.toml` under
|
|
52
|
-
`[
|
|
53
|
+
`[storylines]` (`overview`, `active`). No card names a storyline (method rule 8).
|
|
53
54
|
13. Commit. Git is what holds the record: nothing is held before the first commit, and
|
|
54
55
|
`lab check --strict` says so.
|
|
55
56
|
|
|
@@ -33,9 +33,9 @@ from the record, shortest first. A decision is a discussion, not a request for a
|
|
|
33
33
|
comes up, give its definition from `lab define` in a few words. Never use a word in its everyday
|
|
34
34
|
sense when it is also a lab term. Compare items in a table.
|
|
35
35
|
- For "where are we": each goal in a line, each open question with what is known so far, what is
|
|
36
|
-
running, what is next, what there is to discuss. No more than a screen. When the lab names its
|
|
37
|
-
lead with them: each active
|
|
38
|
-
serving no
|
|
36
|
+
running, what is next, what there is to discuss. No more than a screen. When the lab names its storylines,
|
|
37
|
+
lead with them: each active storyline by its title, with what its open row still needs, then the steps
|
|
38
|
+
serving no storyline.
|
|
39
39
|
- `lab brief` is the question's page as text. Give it as it is, cut to what they asked. If what you
|
|
40
40
|
want to say is not in it, the card is missing something: fix the card, then answer.
|
|
41
41
|
- If the record does not say, say so. Never fill a gap from memory.
|
|
@@ -66,14 +66,14 @@ that resource or that experiment under `about:` before it is decided: `lab new d
|
|
|
66
66
|
--about <resource or id>`. What a locked decision is about cannot be changed afterwards, and a
|
|
67
67
|
resource's new amount names the decision in `from`.
|
|
68
68
|
|
|
69
|
-
##
|
|
69
|
+
## Storylines
|
|
70
70
|
|
|
71
|
-
When the lab names its
|
|
72
|
-
their reviewers' criticisms, and an order of work (`order:`) is built from the open rows, the
|
|
73
|
-
operator cares about first. Adding, splitting, merging or retiring a
|
|
74
|
-
`lab new decision "<what it is about>"`, with the
|
|
75
|
-
change the pages and `[
|
|
76
|
-
retired
|
|
71
|
+
When the lab names its storylines, they set the direction: the options you bring follow their open rows and
|
|
72
|
+
their reviewers' criticisms, and an order of work (`order:`) is built from the open rows, the storyline the
|
|
73
|
+
operator cares about first. Adding, splitting, merging or retiring a storyline is a decision like a question's:
|
|
74
|
+
`lab new decision "<what it is about>"`, with the storyline named in Seen and Decided by its page's title. Then
|
|
75
|
+
change the pages and `[storylines]` in `lab.toml` (the lab-work skill, The storylines and the overview). A
|
|
76
|
+
retired storyline's open work is parked or dropped in the same decision, or moved to another storyline's open row.
|
|
77
77
|
|
|
78
78
|
## When they decide something nobody raised
|
|
79
79
|
|
|
@@ -21,10 +21,10 @@ When a decision has set the order of the work, **Yours next** is already in that
|
|
|
21
21
|
decision set it; follow it, and bring a change of order to the operator rather than skipping ahead.
|
|
22
22
|
`lab show <id>` before you touch anything.
|
|
23
23
|
|
|
24
|
-
When the lab names its
|
|
24
|
+
When the lab names its storylines (`lab now` has a **Storylines** section), read each active storyline page's open row
|
|
25
25
|
and its criticisms before you choose what to propose: they say what the lab is for now. A step listed under
|
|
26
|
-
**Serving no active
|
|
27
|
-
or it belongs on a
|
|
26
|
+
**Serving no active storyline** is a candidate to park or drop, which you bring to the operator in a decision,
|
|
27
|
+
or it belongs on a storyline's open row, which you add.
|
|
28
28
|
|
|
29
29
|
When `lab now` lists a current mission and you were started to run it, or the operator asks to save,
|
|
30
30
|
launch or resume one, follow the lab-mission skill: it starts sessions on the steps, and each of them
|
|
@@ -101,33 +101,34 @@ the plan in fixed boxes, then the steps and the record. Write the card for that
|
|
|
101
101
|
- **Options are named in words, never letters.** "Read `sll` apart", not "(a)". A decision's options
|
|
102
102
|
are a list, each item opening with its name in bold.
|
|
103
103
|
|
|
104
|
-
## The
|
|
104
|
+
## The storylines and the overview
|
|
105
105
|
|
|
106
|
-
When `lab.toml` names
|
|
107
|
-
rule 8). The record itself never names a
|
|
106
|
+
When `lab.toml` names storylines (`[storylines]`), the library holds two kinds of page above the record (method
|
|
107
|
+
rule 8). The record itself never names a storyline: no card, no title, no So far says "Storyline A".
|
|
108
108
|
|
|
109
|
-
- **The overview** (`overview`) keeps the whole trail, whatever
|
|
109
|
+
- **The overview** (`overview`) keeps the whole trail, whatever storyline it serves: the words on one running
|
|
110
110
|
example, the workflow, every related-work row, every established finding, every criticism and what answers
|
|
111
|
-
it, and what runs now. Nothing is left off it for being off a
|
|
112
|
-
- **A
|
|
113
|
-
|
|
114
|
-
thesis, with the scope table: target audience and
|
|
115
|
-
excluded or superseded, open experiments. The last
|
|
116
|
-
`"excluded"` and `"open"`, and list ids as links
|
|
117
|
-
on one running example, its pipeline, the published work
|
|
118
|
-
results citing only included work, the criticisms its reviewers
|
|
119
|
-
it, what the record shows, what remains to run), and last what remains
|
|
111
|
+
it, and what runs now. Nothing is left off it for being off a storyline.
|
|
112
|
+
- **A storyline page** (each of `active`) is that storyline's technical argument, in its community's voice: the
|
|
113
|
+
page a paper, a talk or a report is later written from. It never talks about the lab, its method or itself
|
|
114
|
+
("this page shows", "the lab's record"). It opens, under its thesis, with the scope table: target audience and
|
|
115
|
+
venues, core thesis, experiments included, experiments excluded or superseded, open experiments. The last
|
|
116
|
+
three cells carry `data-scope="included"`, `"excluded"` and `"open"`, and list ids as links
|
|
117
|
+
(`<a href="/lab/G1.Q1.4/">G1.Q1.4</a>`). Then: its words on one running example, its pipeline, the published work
|
|
118
|
+
of its community compared, its established results citing only included work, the criticisms its reviewers
|
|
119
|
+
will raise (for each: what is true in it, what the record shows, what remains to run), and last what remains
|
|
120
|
+
to run.
|
|
120
121
|
- **A step or a question has one row on a page.** Where another row needs to mention it (excluded because
|
|
121
122
|
a newer run superseded it), name it in words, without its link. A decision may be cited anywhere.
|
|
122
123
|
|
|
123
|
-
When a result lands: bring the overview's findings up to date, then each
|
|
124
|
+
When a result lands: bring the overview's findings up to date, then each storyline whose argument it touches.
|
|
124
125
|
If it supersedes an included run, move the old one to excluded and cite the new one. If it closes an open
|
|
125
126
|
row, move it to included, or to excluded if it is void or no longer serves the argument. A result's review
|
|
126
127
|
that fails makes the experiment void: take it off every included row. `lab check` refuses what a row may
|
|
127
|
-
not list, and notes a
|
|
128
|
+
not list, and notes a storyline committed before a result about something it lists.
|
|
128
129
|
|
|
129
|
-
Adding, splitting, merging or retiring a
|
|
130
|
-
then change the pages and `[
|
|
130
|
+
Adding, splitting, merging or retiring a storyline is direction: bring it to the operator (the lab-talk skill),
|
|
131
|
+
then change the pages and `[storylines]`. A retired storyline's page leaves `active` and stays in the library.
|
|
131
132
|
|
|
132
133
|
## When to open a decision
|
|
133
134
|
|
|
@@ -143,7 +144,7 @@ parked question, and never take it up because it looks open: it is listed under
|
|
|
143
144
|
1. `lab new decision "<what it is about>" --about <the goals, questions or experiments it concerns>`.
|
|
144
145
|
2. On its card write **Seen** (what was observed, naming results), **Options** (a list of two or
|
|
145
146
|
three, each item an option with what it costs and what it changes) and **Recommendation**. When the
|
|
146
|
-
lab names its
|
|
147
|
+
lab names its storylines, say which storyline's open row or criticism each option serves, by the storyline's exact
|
|
147
148
|
title; an option that serves none says so. Put under `holds:` only the
|
|
148
149
|
experiments that should not start before it is settled.
|
|
149
150
|
3. Keep working on everything it does not hold. The lab-talk skill takes it to the operator and
|
|
@@ -223,7 +224,7 @@ until that decision is settled; after that it needs no further yes.
|
|
|
223
224
|
before a result under it, or one it names. Give each result a label that says what it counts and
|
|
224
225
|
of how many, in a set of cases the lab names once ("of the 20 checks the solver leaves open").
|
|
225
226
|
10. `lab log <experiment> result "<what was found, in a sentence, without numbers>" "<so what>"`.
|
|
226
|
-
11. When the lab names its
|
|
227
|
+
11. When the lab names its storylines, revise them in the same sitting (next section).
|
|
227
228
|
|
|
228
229
|
The outcome is worked out from the lines: you never write it.
|
|
229
230
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""lab-kit: a research lab's record, its method, and the command that keeps both."""
|
|
2
|
-
__version__ = "1.
|
|
2
|
+
__version__ = "1.13.0"
|
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
|
|
4
4
|
import glob, os, re
|
|
5
5
|
|
|
6
|
-
from . import history,
|
|
6
|
+
from . import history, storylines, record as R, runs as runs_, write
|
|
7
7
|
|
|
8
8
|
KEYS = { # what a card's front matter may hold; a state is never among them
|
|
9
9
|
"goal": {"title", "from", "reached", "dropped", "see"},
|
|
@@ -427,8 +427,8 @@ def run(lab, rederive=True):
|
|
|
427
427
|
for t in sorted({t for t in terms if terms.count(t) > 1}):
|
|
428
428
|
bad("glossary", "GLOSSARY.md", f"{t!r} is defined twice")
|
|
429
429
|
|
|
430
|
-
#
|
|
431
|
-
|
|
430
|
+
# storylines: each active storyline's scope lists only what it may
|
|
431
|
+
storylines.check(lab, bad, notes)
|
|
432
432
|
|
|
433
433
|
# clean: the plans and the store stay out of default searches
|
|
434
434
|
ignore = R.read(f"{root}/.ignore") if os.path.exists(f"{root}/.ignore") else ""
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Storylines: the library's pages that each argue one line of the lab's findings, above a record that names no storyline.
|
|
2
2
|
|
|
3
|
-
A
|
|
4
|
-
|
|
3
|
+
A storyline is what a paper, a talk or a report will be written from; it is the argument, not the artifact.
|
|
4
|
+
|
|
5
|
+
A lab opts in with `[storylines]` in `lab.toml`: `overview`, the page that keeps the whole trail, and `active`, the page
|
|
6
|
+
of each storyline being written. Each storyline page opens with a scope table whose cells are marked
|
|
5
7
|
`data-scope="included"`, `"excluded"` and `"open"`; the `/lab/<id>/` links inside a cell are what it lists.
|
|
6
|
-
`lab check` holds what a cell may list, and `lab now` says what each
|
|
7
|
-
serve no
|
|
8
|
+
`lab check` holds what a cell may list, and `lab now` says what each storyline still has open and which live steps
|
|
9
|
+
serve no storyline.
|
|
8
10
|
"""
|
|
9
11
|
from __future__ import annotations
|
|
10
12
|
|
|
@@ -68,33 +70,33 @@ def page_file(lab, path):
|
|
|
68
70
|
|
|
69
71
|
|
|
70
72
|
def config(lab):
|
|
71
|
-
"""(overview, active pages, problems). (None, [], []) when the lab keeps no
|
|
72
|
-
p = lab.cfg.get("
|
|
73
|
+
"""(overview, active pages, problems). (None, [], []) when the lab keeps no storylines."""
|
|
74
|
+
p = lab.cfg.get("storylines")
|
|
73
75
|
if p is None:
|
|
74
76
|
return None, [], []
|
|
75
77
|
if not isinstance(p, dict):
|
|
76
|
-
return None, [], ["`[
|
|
77
|
-
problems = [f"`[
|
|
78
|
+
return None, [], ["`[storylines]` is a table that names `overview` and `active`"]
|
|
79
|
+
problems = [f"`[storylines]` holds `{k}`; it names only `overview` and `active`" for k in sorted(set(p) - {"overview", "active"})]
|
|
78
80
|
overview, active = p.get("overview"), p.get("active", [])
|
|
79
81
|
if not isinstance(overview, str) or not overview.strip():
|
|
80
|
-
problems.append("`[
|
|
82
|
+
problems.append("`[storylines]` names its `overview`: the library page that keeps the whole trail, such as \"entries/where-the-results-stand\"")
|
|
81
83
|
overview = None
|
|
82
84
|
if not isinstance(active, list) or not all(isinstance(a, str) and a.strip() for a in active):
|
|
83
|
-
problems.append("`[
|
|
85
|
+
problems.append("`[storylines]` lists its `active` storyline pages as library paths, such as [\"entries/storyline-a\"]")
|
|
84
86
|
active = []
|
|
85
87
|
active = [a.strip("/") for a in active]
|
|
86
88
|
for path in ([overview] if overview else []) + active:
|
|
87
89
|
if ".." in path.split("/"):
|
|
88
|
-
problems.append(f"`[
|
|
90
|
+
problems.append(f"`[storylines]` names {path}; a page is a path inside the library's content, without `..`")
|
|
89
91
|
for a in sorted({a for a in active if active.count(a) > 1}):
|
|
90
|
-
problems.append(f"`[
|
|
92
|
+
problems.append(f"`[storylines]` lists {a} more than once")
|
|
91
93
|
return (overview.strip("/") if overview else None), list(dict.fromkeys(active)), problems
|
|
92
94
|
|
|
93
95
|
|
|
94
96
|
def read(lab):
|
|
95
|
-
"""Each active
|
|
96
|
-
if getattr(lab, "
|
|
97
|
-
return lab.
|
|
97
|
+
"""Each active storyline page as read: path, title, its cells' ids, the rows it marks; `missing` when not there."""
|
|
98
|
+
if getattr(lab, "_storylines", None) is not None:
|
|
99
|
+
return lab._storylines
|
|
98
100
|
_, active, _ = config(lab)
|
|
99
101
|
out = []
|
|
100
102
|
for path in active:
|
|
@@ -105,7 +107,7 @@ def read(lab):
|
|
|
105
107
|
s = _Scope()
|
|
106
108
|
s.feed(R.read(f))
|
|
107
109
|
out.append({"path": path, "title": " ".join(s.title.split()) or path, "cells": s.cells, "marked": s.marked, "unknown": s.unknown, "missing": False})
|
|
108
|
-
lab.
|
|
110
|
+
lab._storylines = out
|
|
109
111
|
return out
|
|
110
112
|
|
|
111
113
|
|
|
@@ -122,7 +124,7 @@ def _covered(lab, ident):
|
|
|
122
124
|
|
|
123
125
|
|
|
124
126
|
def serving(lab):
|
|
125
|
-
"""The live steps that no active
|
|
127
|
+
"""The live steps that no active storyline lists under included or open, by themselves or by their question or goal."""
|
|
126
128
|
named = set()
|
|
127
129
|
for p in read(lab):
|
|
128
130
|
for row in ("included", "open"):
|
|
@@ -136,54 +138,54 @@ def _say(n):
|
|
|
136
138
|
|
|
137
139
|
|
|
138
140
|
def check(lab, bad, notes):
|
|
139
|
-
"""What `lab check` holds about the
|
|
141
|
+
"""What `lab check` holds about the storylines: the table in `lab.toml`, each page's scope, and what each row lists."""
|
|
140
142
|
overview, active, problems = config(lab)
|
|
141
143
|
for p in problems:
|
|
142
|
-
bad("
|
|
144
|
+
bad("storylines", "lab.toml", p)
|
|
143
145
|
if overview is None and not active:
|
|
144
146
|
return
|
|
145
147
|
if overview and not os.path.exists(page_file(lab, overview)):
|
|
146
|
-
bad("
|
|
148
|
+
bad("storylines", "lab.toml", f"`overview` names {overview}, which is not a page of the library")
|
|
147
149
|
if overview and overview in active:
|
|
148
|
-
bad("
|
|
150
|
+
bad("storylines", "lab.toml", f"{overview} is the overview and an active storyline: the overview keeps the whole trail, a storyline only what it argues")
|
|
149
151
|
for p in read(lab):
|
|
150
152
|
where = lab.rel(page_file(lab, p["path"]))
|
|
151
153
|
if p["missing"]:
|
|
152
|
-
bad("
|
|
154
|
+
bad("storylines", "lab.toml", f"`active` names {p['path']}, which is not a page of the library")
|
|
153
155
|
continue
|
|
154
156
|
for row in ROWS:
|
|
155
157
|
if row not in p["marked"]:
|
|
156
|
-
bad("
|
|
158
|
+
bad("storylines", where, f"has no scope cell marked data-scope=\"{row}\": a storyline page opens with its scope table, and each of included, excluded and open is a marked cell, empty if it lists nothing")
|
|
157
159
|
for row in p["unknown"]:
|
|
158
|
-
bad("
|
|
160
|
+
bad("storylines", where, f"marks a cell data-scope=\"{row}\"; a scope cell is included, excluded or open")
|
|
159
161
|
rows = {row: [lab.folded.get(i, i) for i in p["cells"][row]] for row in ROWS}
|
|
160
162
|
for row, ids in rows.items():
|
|
161
163
|
for i in ids:
|
|
162
164
|
n = lab.nodes.get(i)
|
|
163
165
|
if not n:
|
|
164
|
-
bad("
|
|
166
|
+
bad("storylines", where, f"lists {i} under {row}, which is not a goal, a question, a step or a decision of the lab")
|
|
165
167
|
continue
|
|
166
168
|
if row == "included":
|
|
167
169
|
if n["type"] in R.STEPS and (n["state"] != "done" or n.get("label") == "void"):
|
|
168
170
|
to = "open" if n["state"] in LIVE else "excluded"
|
|
169
|
-
bad("
|
|
171
|
+
bad("storylines", where, f"lists {i} under included, which is {_say(n)}: a storyline includes only finished work that is not void, replaced or dropped; list it under {to}")
|
|
170
172
|
elif n["type"] in ("question", "goal") and n["state"] in ("parked", "dropped"):
|
|
171
|
-
bad("
|
|
173
|
+
bad("storylines", where, f"lists {i} under included, which is {n['state']}: list it under excluded")
|
|
172
174
|
elif row == "open":
|
|
173
175
|
if n["type"] in R.STEPS and n["state"] not in LIVE:
|
|
174
176
|
to = "included or excluded" if n["state"] == "done" and n.get("label") != "void" else "excluded"
|
|
175
|
-
bad("
|
|
177
|
+
bad("storylines", where, f"lists {i} under open, which is {_say(n)}: open holds only work still to do; list it under {to}")
|
|
176
178
|
elif n["type"] in ("question", "goal") and n["state"] in ("done", "parked", "dropped"):
|
|
177
|
-
bad("
|
|
179
|
+
bad("storylines", where, f"lists {i} under open, which is {n['state']}: open holds only work still to do")
|
|
178
180
|
for a, b in (("included", "excluded"), ("included", "open"), ("open", "excluded")):
|
|
179
181
|
for i in sorted(i for i in set(rows[a]) & set(rows[b]) if lab.nodes.get(i, {}).get("type") != "decision"): # a decision may be cited wherever it explains a row
|
|
180
|
-
bad("
|
|
182
|
+
bad("storylines", where, f"lists {i} under both {a} and {b}: a step or a question has one row; where another row needs it, name it in words, without its link")
|
|
181
183
|
for q, step, at in stale(lab):
|
|
182
|
-
notes.append(f"
|
|
184
|
+
notes.append(f"storylines: {q} was last committed before the result of {step} ({at}): bring the storyline's argument up to date with it")
|
|
183
185
|
|
|
184
186
|
|
|
185
187
|
def stale(lab):
|
|
186
|
-
"""[(page, step, when)]: an active
|
|
188
|
+
"""[(page, step, when)]: an active storyline page last committed before the newest `result` line about a step it lists
|
|
187
189
|
under included or open, or under a question or goal it lists there. Nothing where git cannot tell."""
|
|
188
190
|
from . import history
|
|
189
191
|
root, out = lab.root, []
|
|
@@ -209,11 +211,11 @@ def stale(lab):
|
|
|
209
211
|
|
|
210
212
|
|
|
211
213
|
def now_lines(lab):
|
|
212
|
-
"""The lines `lab now` gives the
|
|
214
|
+
"""The lines `lab now` gives the storylines: each active storyline with what it has open, then the steps no storyline serves."""
|
|
213
215
|
_, active, _ = config(lab)
|
|
214
216
|
if not active:
|
|
215
217
|
return []
|
|
216
|
-
out = ["", "
|
|
218
|
+
out = ["", "Storylines (direction comes from their open rows and their criticisms)"]
|
|
217
219
|
for p in read(lab):
|
|
218
220
|
if p["missing"]:
|
|
219
221
|
out.append(f"- {p['path']}: not in the library")
|
|
@@ -223,6 +225,6 @@ def now_lines(lab):
|
|
|
223
225
|
out.append(f"- {p['title']} ({p['path']}): open {todo}")
|
|
224
226
|
idle = serving(lab)
|
|
225
227
|
if idle:
|
|
226
|
-
out += ["", "Serving no active
|
|
228
|
+
out += ["", "Serving no active storyline (add to a storyline's open row, or bring parking or dropping it to the operator)"]
|
|
227
229
|
out += [f"- {x['id']} {x['title']} ({x['state']})" for x in idle]
|
|
228
230
|
return out
|
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
|
|
4
4
|
import os
|
|
5
5
|
|
|
6
|
-
from . import
|
|
6
|
+
from . import storylines, record as R
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def num(x):
|
|
@@ -91,7 +91,7 @@ def _now(lab):
|
|
|
91
91
|
key = x["label"] if x["state"] == "done" and x.get("label") else x["state"]
|
|
92
92
|
counts[key] = counts.get(key, 0) + 1
|
|
93
93
|
out += [f"- {q['id']} ({state(q)}): {q['title']} [{', '.join(f'{n} {k}' for k, n in counts.items()) or 'nothing under it'}]"]
|
|
94
|
-
out +=
|
|
94
|
+
out += storylines.now_lines(lab)
|
|
95
95
|
aside = lab.set_aside()
|
|
96
96
|
if any(aside.values()):
|
|
97
97
|
out += ["", "Set aside"] + [f"- {q['id']} (parked by {lab.parked_by(q['id'])['id']}): {q['title']}" for q in aside["parked"]]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Storylines drive the work: the record names no storyline, and each active storyline's page opens with a scope table whose
|
|
2
2
|
included, excluded and open cells `lab check` holds, and whose open row `lab now` puts before the agent."""
|
|
3
3
|
import os
|
|
4
4
|
|
|
@@ -23,15 +23,15 @@ def links(*ids):
|
|
|
23
23
|
return ", ".join(f'<a href="/lab/{i}/">{i}</a>' for i in ids)
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def page(root, path, title="
|
|
26
|
+
def page(root, path, title="Storyline A: The square-root law", included=(), excluded=(), open_=()):
|
|
27
27
|
d = os.path.join(root, "docs", "content", path)
|
|
28
28
|
os.makedirs(d, exist_ok=True)
|
|
29
29
|
open(f"{d}/index.html", "w").write(PAGE.format(title=title, included=links(*included), excluded=links(*excluded), open=links(*open_)))
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
def
|
|
33
|
-
text = open(f"{root}/lab.toml").read().split("[
|
|
34
|
-
open(f"{root}/lab.toml", "w").write(text + f'[
|
|
32
|
+
def storylines(root, overview="entries/where-the-results-stand", active=("entries/storyline-a",)):
|
|
33
|
+
text = open(f"{root}/lab.toml").read().split("[storylines]")[0]
|
|
34
|
+
open(f"{root}/lab.toml", "w").write(text + f'[storylines]\noverview = "{overview}"\nactive = [{", ".join(chr(34) + a + chr(34) for a in active)}]\n')
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
def two_experiments(root):
|
|
@@ -51,104 +51,104 @@ def two_experiments(root):
|
|
|
51
51
|
return first, void, later
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
def
|
|
54
|
+
def test_a_lab_without_storylines_is_unchanged(tmp_path):
|
|
55
55
|
root = str(tmp_path)
|
|
56
56
|
two_experiments(root)
|
|
57
|
-
assert "
|
|
58
|
-
assert "
|
|
57
|
+
assert "Storylines" not in lab(root, "now")
|
|
58
|
+
assert "storylines:" not in lab(root, "check", "--no-rederive")
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
def
|
|
61
|
+
def test_a_storyline_includes_only_finished_work_and_lists_each_id_once(tmp_path):
|
|
62
62
|
root = str(tmp_path)
|
|
63
63
|
first, void, later = two_experiments(root)
|
|
64
|
-
|
|
65
|
-
page(root, "entries/
|
|
64
|
+
storylines(root)
|
|
65
|
+
page(root, "entries/storyline-a", included=(first, void, later), excluded=(first,), open_=("G1.Q9.1",))
|
|
66
66
|
out = lab(root, "check", "--no-rederive", ok=False)
|
|
67
67
|
assert f"lists {void} under included, which is void" in out and "list it under excluded" in out
|
|
68
68
|
assert f"lists {later} under included, which is open" in out and "list it under open" in out
|
|
69
69
|
assert f"lists {first} under both included and excluded" in out
|
|
70
70
|
assert "lists G1.Q9.1 under open, which is not a goal, a question, a step or a decision of the lab" in out
|
|
71
|
-
page(root, "entries/
|
|
71
|
+
page(root, "entries/storyline-a", included=(first,), excluded=(void,), open_=(first,))
|
|
72
72
|
assert f"lists {first} under open, which is done" in lab(root, "check", "--no-rederive", ok=False)
|
|
73
|
-
page(root, "entries/
|
|
73
|
+
page(root, "entries/storyline-a", included=(first, "D1"), excluded=(void,), open_=(later,))
|
|
74
74
|
assert "the record is sound" in lab(root, "check", "--no-rederive")
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
def
|
|
77
|
+
def test_the_storylines_table_names_pages_that_are_there_each_with_its_scope(tmp_path):
|
|
78
78
|
root = str(tmp_path)
|
|
79
79
|
two_experiments(root)
|
|
80
|
-
|
|
81
|
-
os.makedirs(f"{root}/docs/content/entries/
|
|
82
|
-
open(f"{root}/docs/content/entries/
|
|
80
|
+
storylines(root, active=("entries/storyline-a", "entries/storyline-b", "entries/where-the-results-stand"))
|
|
81
|
+
os.makedirs(f"{root}/docs/content/entries/storyline-a", exist_ok=True)
|
|
82
|
+
open(f"{root}/docs/content/entries/storyline-a/index.html", "w").write("<html><body><td data-scope=\"kept\"></td></body></html>")
|
|
83
83
|
out = lab(root, "check", "--no-rederive", ok=False)
|
|
84
|
-
assert "`active` names entries/
|
|
85
|
-
assert "is the overview and an active
|
|
84
|
+
assert "`active` names entries/storyline-b, which is not a page of the library" in out
|
|
85
|
+
assert "is the overview and an active storyline" in out
|
|
86
86
|
assert 'has no scope cell marked data-scope="included"' in out and 'marks a cell data-scope="kept"' in out
|
|
87
|
-
|
|
87
|
+
storylines(root, overview="entries/nowhere")
|
|
88
88
|
assert "`overview` names entries/nowhere, which is not a page of the library" in lab(root, "check", "--no-rederive", ok=False)
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
def
|
|
91
|
+
def test_a_card_never_names_a_storyline(tmp_path):
|
|
92
92
|
root = str(tmp_path)
|
|
93
93
|
first, _, _ = two_experiments(root)
|
|
94
94
|
from test_flow import folder, front
|
|
95
|
-
front(f"{folder(root, first)}/experiment.md",
|
|
96
|
-
assert "`
|
|
95
|
+
front(f"{folder(root, first)}/experiment.md", storyline="storyline-a")
|
|
96
|
+
assert "`storyline:` is not something a experiment card holds" in lab(root, "check", "--no-rederive", ok=False)
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
def
|
|
99
|
+
def test_now_puts_each_storylines_open_row_first_and_names_what_serves_no_storyline(tmp_path):
|
|
100
100
|
root = str(tmp_path)
|
|
101
101
|
first, void, later = two_experiments(root)
|
|
102
|
-
|
|
103
|
-
page(root, "entries/
|
|
102
|
+
storylines(root)
|
|
103
|
+
page(root, "entries/storyline-a", included=(first,), excluded=(void,))
|
|
104
104
|
now = lab(root, "now")
|
|
105
|
-
assert "
|
|
106
|
-
assert "Serving no active
|
|
107
|
-
page(root, "entries/
|
|
105
|
+
assert "Storyline A: The square-root law (entries/storyline-a): open nothing" in now
|
|
106
|
+
assert "Serving no active storyline" in now and f"- {later} Error at 400 and at 1600 flips (open)" in now
|
|
107
|
+
page(root, "entries/storyline-a", included=(first,), excluded=(void,), open_=(later,))
|
|
108
108
|
now = lab(root, "now")
|
|
109
|
-
assert f"open {later} Error at 400 and at 1600 flips (open)" in now and "Serving no active
|
|
110
|
-
page(root, "entries/
|
|
111
|
-
assert "Serving no active
|
|
109
|
+
assert f"open {later} Error at 400 and at 1600 flips (open)" in now and "Serving no active storyline" not in now
|
|
110
|
+
page(root, "entries/storyline-a", included=(first,), excluded=(void,), open_=("G1.Q1",)) # a question stands for every step under it
|
|
111
|
+
assert "Serving no active storyline" not in lab(root, "now")
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
def
|
|
114
|
+
def test_a_storyline_older_than_a_result_it_lists_is_noted(tmp_path):
|
|
115
115
|
root = str(tmp_path)
|
|
116
116
|
first, void, later = two_experiments(root)
|
|
117
|
-
|
|
118
|
-
page(root, "entries/
|
|
117
|
+
storylines(root)
|
|
118
|
+
page(root, "entries/storyline-a", included=(first,), excluded=(void,), open_=(later,))
|
|
119
119
|
git_env(root, "init", "-q")
|
|
120
120
|
git_env(root, "add", "-A")
|
|
121
|
-
git_env(root, "commit", "-qm", "the
|
|
121
|
+
git_env(root, "commit", "-qm", "the storyline", GIT_AUTHOR_DATE=PAST, GIT_COMMITTER_DATE=PAST)
|
|
122
122
|
lab(root, "log", first, "result", "The error halves.", "It converges as the theory says.")
|
|
123
123
|
commit(root, "the result")
|
|
124
124
|
out = lab(root, "check", "--no-rederive", ok=False) # the question's So far is stale too, which is a problem
|
|
125
|
-
assert f"note:
|
|
126
|
-
assert "
|
|
125
|
+
assert f"note: storylines: entries/storyline-a was last committed before the result of {first}" in out
|
|
126
|
+
assert "storylines:" not in out.split("note: storylines:")[1].split("\n", 1)[1] # a note, never a problem
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
def test_every_rule_on_a_row_and_on_the_table_has_a_refusal(tmp_path):
|
|
130
130
|
root = str(tmp_path)
|
|
131
131
|
first, void, later = two_experiments(root)
|
|
132
|
-
|
|
132
|
+
storylines(root)
|
|
133
133
|
from test_flow import folder, front
|
|
134
134
|
front(f"{folder(root, later)}/experiment.md", dropped="the first comparison answers the question")
|
|
135
135
|
lab(root, "answer", "G1.Q1", "yes", "It halves at 400 flips.")
|
|
136
|
-
page(root, "entries/
|
|
136
|
+
page(root, "entries/storyline-a", included=(first,), excluded=(void,), open_=("G1.Q1",))
|
|
137
137
|
assert "lists G1.Q1 under open, which is done" in lab(root, "check", "--no-rederive", ok=False)
|
|
138
|
-
page(root, "entries/
|
|
138
|
+
page(root, "entries/storyline-a", included=("G1", first), excluded=(void,), open_=("G1",))
|
|
139
139
|
assert "lists G1 under both included and open" in lab(root, "check", "--no-rederive", ok=False)
|
|
140
140
|
# a question written in one row and a step under it in another is allowed
|
|
141
|
-
page(root, "entries/
|
|
142
|
-
assert "
|
|
143
|
-
page(root, "entries/
|
|
144
|
-
assert "
|
|
145
|
-
for table, said in (('
|
|
146
|
-
('[
|
|
147
|
-
('[
|
|
148
|
-
('[
|
|
149
|
-
('[
|
|
150
|
-
('[
|
|
151
|
-
text = open(f"{root}/lab.toml").read().split("[
|
|
141
|
+
page(root, "entries/storyline-a", included=("G1.Q1",), excluded=(void, later), open_=())
|
|
142
|
+
assert "storylines:" not in lab(root, "check", "--no-rederive")
|
|
143
|
+
page(root, "entries/storyline-a", included=(first,), excluded=("G1.Q1", void), open_=())
|
|
144
|
+
assert "storylines:" not in lab(root, "check", "--no-rederive")
|
|
145
|
+
for table, said in (('storylines = "entries/storyline-a"', "`[storylines]` is a table"),
|
|
146
|
+
('[storylines]\noverview = "entries/where-the-results-stand"\nkept = 1', "`[storylines]` holds `kept`"),
|
|
147
|
+
('[storylines]\noverview = 3', "`[storylines]` names its `overview`"),
|
|
148
|
+
('[storylines]\noverview = "entries/where-the-results-stand"\nactive = "entries/storyline-a"', "lists its `active` storyline pages"),
|
|
149
|
+
('[storylines]\noverview = "entries/where-the-results-stand"\nactive = ["entries/storyline-a", "entries/storyline-a/"]', "lists entries/storyline-a more than once"),
|
|
150
|
+
('[storylines]\noverview = "../outside"', "without `..`")):
|
|
151
|
+
text = open(f"{root}/lab.toml").read().split("[storylines]")[0].split("storylines =")[0]
|
|
152
152
|
open(f"{root}/lab.toml", "w").write(text + table + "\n")
|
|
153
153
|
assert said in lab(root, "check", "--no-rederive", ok=False), table
|
|
154
154
|
|
|
@@ -159,30 +159,30 @@ def test_a_parked_or_dropped_question_is_in_neither_included_nor_open(tmp_path):
|
|
|
159
159
|
from test_parked import park
|
|
160
160
|
card, d = park(root, "G1.Q1", "Set the first sizes aside", "")
|
|
161
161
|
lab(root, "decide", d, "--with", "Ada", "Set the first sizes aside until the sampler is fixed.")
|
|
162
|
-
|
|
163
|
-
page(root, "entries/
|
|
162
|
+
storylines(root)
|
|
163
|
+
page(root, "entries/storyline-a", included=("G1.Q1",), excluded=(void,))
|
|
164
164
|
assert "lists G1.Q1 under included, which is parked" in lab(root, "check", "--no-rederive", ok=False)
|
|
165
|
-
page(root, "entries/
|
|
165
|
+
page(root, "entries/storyline-a", excluded=(void,), open_=("G1.Q1",))
|
|
166
166
|
assert "lists G1.Q1 under open, which is parked" in lab(root, "check", "--no-rederive", ok=False)
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
def test_a_cell_left_open_ends_where_the_next_cell_begins(tmp_path):
|
|
170
170
|
root = str(tmp_path)
|
|
171
171
|
first, void, later = two_experiments(root)
|
|
172
|
-
|
|
173
|
-
d = f"{root}/docs/content/entries/
|
|
172
|
+
storylines(root)
|
|
173
|
+
d = f"{root}/docs/content/entries/storyline-a"
|
|
174
174
|
os.makedirs(d, exist_ok=True)
|
|
175
|
-
open(f"{d}/index.html", "w").write(f'<html><head><title>
|
|
175
|
+
open(f"{d}/index.html", "w").write(f'<html><head><title>Storyline A</title></head><body><table><tr><td data-scope="included">{links(first)}'
|
|
176
176
|
f'<tr><td data-scope="excluded">{links(void)}<tr><td data-scope="open">{links(later)}</table></body></html>')
|
|
177
|
-
assert "
|
|
177
|
+
assert "storylines:" not in lab(root, "check", "--no-rederive")
|
|
178
178
|
assert f"open {later} Error at 400 and at 1600 flips (open)" in lab(root, "now")
|
|
179
179
|
|
|
180
180
|
|
|
181
181
|
def test_a_table_inside_a_scope_cell_is_read_as_part_of_it(tmp_path):
|
|
182
182
|
root = str(tmp_path)
|
|
183
183
|
first, void, later = two_experiments(root)
|
|
184
|
-
|
|
185
|
-
d = f"{root}/docs/content/entries/
|
|
184
|
+
storylines(root)
|
|
185
|
+
d = f"{root}/docs/content/entries/storyline-a"
|
|
186
186
|
os.makedirs(d, exist_ok=True)
|
|
187
187
|
open(f"{d}/index.html", "w").write(f'<html><body><table><tr><td data-scope="included"><table><tr><td>{links(first, void)}</td></tr></table></td>'
|
|
188
188
|
f'<td data-scope="excluded"></td><td data-scope="open">{links(later)}</td></tr></table></body></html>')
|
|
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
|