analysis-workflow 0.13.0__tar.gz → 0.13.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 (45) hide show
  1. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/.claude-plugin/plugin.json +1 -1
  2. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/PKG-INFO +1 -1
  3. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/skills/declare-inputs/SKILL.md +5 -3
  4. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/skills/trace-lineage/SKILL.md +1 -1
  5. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/trace.py +7 -1
  6. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/tests/test_trace.py +9 -0
  7. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/.github/workflows/lint.yaml +0 -0
  8. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/.github/workflows/release.yaml +0 -0
  9. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/.github/workflows/test.yaml +0 -0
  10. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/.gitignore +0 -0
  11. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/.pre-commit-config.yaml +0 -0
  12. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/LICENSE +0 -0
  13. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/README.md +0 -0
  14. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/hooks/_repo.py +0 -0
  15. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/hooks/allow_exception.py +0 -0
  16. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/hooks/guard_shared_writes.py +0 -0
  17. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/hooks/guard_task_layout.py +0 -0
  18. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/hooks/guard_task_paths.py +0 -0
  19. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/hooks/guard_worktree_pixi.py +0 -0
  20. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/hooks/hooks.json +0 -0
  21. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/hooks/session_context.md +0 -0
  22. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/hooks/session_start.py +0 -0
  23. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/pyproject.toml +0 -0
  24. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/skills/allow/SKILL.md +0 -0
  25. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/skills/analysis-workflow/SKILL.md +0 -0
  26. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/skills/analysis-workflow/references/repos.md +0 -0
  27. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/skills/analysis-workflow/references/storage.md +0 -0
  28. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/__init__.py +0 -0
  29. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/cli.py +0 -0
  30. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/graph.py +0 -0
  31. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/paths.py +0 -0
  32. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/provenance.py +0 -0
  33. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/size.py +0 -0
  34. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/task_template/README.md +0 -0
  35. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/task_template/scripts/_common.py +0 -0
  36. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/src/analysis_workflow/working.py +0 -0
  37. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/tests/conftest.py +0 -0
  38. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/tests/test_cli.py +0 -0
  39. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/tests/test_hooks.py +0 -0
  40. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/tests/test_paths.py +0 -0
  41. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/tests/test_plugin.py +0 -0
  42. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/tests/test_provenance.py +0 -0
  43. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/tests/test_size.py +0 -0
  44. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/tests/test_working.py +0 -0
  45. {analysis_workflow-0.13.0 → analysis_workflow-0.13.1}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "analysis-workflow",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Conventions for analysis repos where humans and coding agents work side by side: versioned task directories for both, one session, worktree and PR per agent task; worktree-safe output paths; additive write-back to AnnData and SpatialData stores, which record which task wrote what. Ships a skill, guard hooks and the analysis_workflow Python package.",
5
5
  "author": {
6
6
  "name": "quadbio"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: analysis-workflow
3
- Version: 0.13.0
3
+ Version: 0.13.1
4
4
  Summary: Task paths, additive AnnData write-back and layout checks for agent-run analysis repos.
5
5
  Project-URL: Source, https://github.com/quadbio/analysis-workflow
6
6
  Author: quadbio
@@ -26,10 +26,11 @@ Given several, hand each to its own subagent, with this section as its brief.
26
26
  - keys of a shared store: a notebook that reads a whole object and plots two columns used those two. A task
27
27
  that copies a store declares `*`, the whole object, also when the copy drops keys;
28
28
  - files of other tasks: in their `outputs/` or `results/`, and code imported from them;
29
- - data files: under `data/`, or outside the repo by absolute path (`~/...` for a per-user cache, such as a
30
- downloaded model).
29
+ - data files: under `data/`; tracked files under the root `resources/` (such as the figure conventions); or
30
+ outside the repo by absolute path (`~/...` for a per-user cache, such as a downloaded model).
31
31
 
32
- Leave out what the task writes itself, and keys it wrote and then reads back.
32
+ Leave out what the task writes itself, keys it wrote and then reads back, and package code (`src/`, sibling
33
+ packages), which is part of the environment.
33
34
  3. Resolve a path the code builds at run time (a date, a section name, a glob) against what is on disk. Files
34
35
  read from one directory by a loop or a glob are listed once, as that directory.
35
36
  4. Write the list, and nothing else, to `<task>/inputs.yaml`. Paths inside the repo are relative to its root; keys
@@ -42,6 +43,7 @@ Given several, hand each to its own subagent, with this section as its brief.
42
43
  keys: [shapes/cells, tables/table/obs/sample]
43
44
  - path: analysis/<dataset>/<topic>/<other_task>/outputs/<file>
44
45
  - path: data/<dataset>/raw/<file>
46
+ - path: resources/figure_conventions.yaml
45
47
  ```
46
48
 
47
49
  5. `analysis-workflow check inputs <task directory>`, and correct what it reports.
@@ -34,7 +34,7 @@ One artifact per report: a key in a store, or a file.
34
34
  1. <task> (<author>, <date>): from <inputs used>, giving <keys or files written>.
35
35
  2. ...
36
36
 
37
- Source data: <files under raw/ and resources/, or outside the repo>
37
+ Source data: <files under data/<dataset>/raw/, data/<dataset>/resources/ or the root resources/, or outside the repo>
38
38
  No record: <artifacts on the path that no record covers, or "none">
39
39
  ```
40
40
 
@@ -35,6 +35,8 @@ TASK_DIR = re.compile(r".+_v\d+")
35
35
 
36
36
  #: Under `data/<dataset>/`, what arrived from outside the repo: no task made it.
37
37
  SOURCE_DIRS = frozenset({"raw", "resources"})
38
+ #: At the repo root, tracked files kept for every task (such as the figure conventions): no task made them either.
39
+ ROOT_SOURCE_DIR = "resources"
38
40
 
39
41
 
40
42
  def declared(task: Path) -> list[dict] | None:
@@ -140,7 +142,11 @@ class _Walk:
140
142
  return node_id
141
143
 
142
144
  def leaf(self, rel: Path, key: str | None = None) -> str:
143
- outside = rel.is_absolute() or (rel.parts[:1] == ("data",) and bool(SOURCE_DIRS & set(rel.parts[2:3])))
145
+ outside = (
146
+ rel.is_absolute()
147
+ or rel.parts[:1] == (ROOT_SOURCE_DIR,)
148
+ or (rel.parts[:1] == ("data",) and bool(SOURCE_DIRS & set(rel.parts[2:3])))
149
+ )
144
150
  label = f"{rel.name}: {key}" if key else "/".join(rel.parts[-3:])
145
151
  return self.node(f"{rel}#{key}" if key else str(rel), label=label, status="source" if outside else "no record")
146
152
 
@@ -111,6 +111,15 @@ def test_a_task_without_declared_inputs_stops_the_trace(project, monkeypatch):
111
111
  assert result.exit_code == 1 and "analysis/ds/topic/agent_annot_v1" in result.output
112
112
 
113
113
 
114
+ def test_a_tracked_root_resource_is_a_source(project):
115
+ main, tasks = project
116
+ (main / "resources").mkdir()
117
+ (main / "resources" / "figure_conventions.yaml").write_text("colors: {}")
118
+ declare(tasks["human_fig_v1"], [{"path": LABELS}, {"path": "resources/figure_conventions.yaml"}])
119
+ found = trace(main / FIGURE, start=main)
120
+ assert found.nodes["resources/figure_conventions.yaml"]["status"] == "source"
121
+
122
+
114
123
  def test_a_file_in_the_home_directory_is_a_source(project, monkeypatch, tmp_path):
115
124
  main, tasks = project
116
125
  monkeypatch.setenv("HOME", str(tmp_path))