Repository navigation
Workflow engines, store promotion, ports, and a task layout of only what is used; release 0.13.0 - #36
Conversation
- `workflow/` is part of a task's layout, for a workflow engine's files; it is reserved, not created. - `analysis-workflow new --ported-from <repo>:<path>@<commit>` records a port's origin in the README header and keeps the old version, which must be above every version beside it. - Session rule 1: a port takes the lane the repo's `CONVENTIONS.md` gives it. - A store a batch job built in the task's `outputs/` enters shared storage by a move inside a `writes` block, which records the task (tested); `declare-inputs` reads `workflow/` too. Closes #35. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89503ec785
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 1. Read every script and notebook of the task, `scripts/_common.py` and the workflow files in `workflow/` included. | ||
| Follow calls into the repo's own package and into sibling packages far enough to see which keys a called | ||
| function uses, its defaults included. |
There was a problem hiding this comment.
Include workflow files in input-declaration staleness checks
Now that workflow/ can contain code that determines a task's inputs, changes there also need to invalidate its input declaration. changed_since_declared() in src/analysis_workflow/trace.py still checks only scripts/ and notebooks/: after committing an inputs.yaml, changing a Snakefile to consume a different raw file returns False for both uncommitted and committed changes. Consequently, check inputs can report clean while tracing continues to use the obsolete input list. Include workflow/ in both the history and working-tree checks.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2d7a499: changed_since_declared checks workflow/ along with scripts/ and notebooks/, with a test.
…tidy` `tidy <task>`, at the task's end, removes its reserved directories left empty or holding only unchanged task template files, in the checkout and, for the untracked ones, in the main checkout. `new` makes `notebooks/` only with `--notebook`. `workflow/` is one more reserved name, with nothing of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 758b6d843d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if file.is_dir() or NON_TASK_DIRS & set(file.parts): # a `__pycache__` is no use of the directory | ||
| return True |
There was a problem hiding this comment.
Preserve experiment artifacts when tidying task directories
When a task stores its experiment runs under logs/wandb/ or outputs/wandb/, this predicate treats every file in those runs as unchanged because wandb belongs to NON_TASK_DIRS. If the enclosing directory contains nothing else, tidy then recursively deletes it, including metrics and model checkpoints. I reproduced this with logs/wandb/run-20261126/files/model.ckpt: unused_dirs() classified logs as unused, and the deletion loop removed the checkpoint. Names excluded from task discovery are not necessarily disposable caches; preserve non-template experiment files rather than applying the entire NON_TASK_DIRS set here.
Useful? React with 👍 / 👎.
…ke every reserved directory Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…plate files never changed README.md and inputs.yaml always stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1186c72cad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| template = TASK_TEMPLATE / file.relative_to(task) if file.is_relative_to(task) else None | ||
| return template is not None and template.is_file() and template.read_bytes() == file.read_bytes() |
There was a problem hiding this comment.
Preserve unchanged template helpers that notebooks still import
When a task's notebooks import PATHS or the output-directory constants from the template's scripts/_common.py, that helper can remain byte-for-byte unchanged while still being required. This predicate marks it disposable, so tidy removes scripts/ even though the notebooks remain, and rerunning them fails with ModuleNotFoundError: No module named '_common'. I reproduced this with an unchanged template helper and a notebook importing it. Preserve the helper when retained task code depends on it rather than treating template equality as proof that it is unused.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2d7a499 by dropping the template-file rule: tidy removes empty directories only, so an unchanged _common.py stays.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ae7315ec1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| elif child.is_dir(): | ||
| found += topmost(child, root) |
There was a problem hiding this comment.
Stop tidy traversal at directory symlinks
When a task contains a directory symlink, is_dir() follows it and this recursion scans outside the task. I reproduced this with outputs/shared pointing to an external directory containing data.txt and empty/: unused() selected outputs/shared/empty, and the deletion loop removed the external directory. A symlink cycle can also make discovery fail with a recursion error. Treat directory symlinks as retained entries rather than descending into them so tidying a task cannot modify shared targets.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2d7a499: a symlink is never followed and never removed, with a test of a link to an outside directory holding an empty one.
…k inputs` sees changes in `workflow/` Template files are no longer removed: a notebook may import an unchanged `scripts/_common.py`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #35. The matching
CONVENTIONS.mdtext: quadbio/analysis_template#34; merge this one first.Decisions on the proposals
workflow/, one fixed name (Q2). Snakemake findsworkflow/Snakefileandworkflow/profiles/default/by itself; run with--directoryset to the task'soutputs/, its results and.snakemake/land there (checked with Snakemake 9.27).outputs/; once reviewed, each store it built is moved intoprocessed/inside awritesblock, which recordsthe creating task. Nothing half-written reaches shared storage, a rerun cannot delete a shared store, and the store
is reviewed before any task reads it (Q1). A test pins the move.
inputs.yamllists the raw data; a tracethrough a symlinked
raw/was checked.declare-inputsnow readsworkflow/too.analysis-workflow new --ported-from <repo>:<path>@<commit>writes a**Ported from:**header line andkeeps the old version, which must be above every version beside it; without the option
newstill takes onlythe next. Lane and author follow the originator (template text); session rule 1 points there.
Task layout: clean up at the end
newandPATHS.ensure()lay a task out as before. At the task's end (skill, Finish 4),analysis-workflow tidy <task>removes every directory it left empty, at any depth, in the task's checkout and in the main checkout. Itdeletes no file and follows no symlink. One rule for every directory; pruning at the end sees what was used,
whichever tool made it.
check inputsalso notices changes inworkflow/afterinputs.yamlwas written.Line delta: +148 / −23, tests included.
🤖 Generated with Claude Code