Skip to content

Conventions for data lineage: writes blocks and inputs.yaml - #31

Merged
Marius1311 merged 7 commits into
mainfrom
data-lineages
Nov 18, 2026
Merged

Marius1311 merged 7 commits into
mainfrom
data-lineages

Conversation

@Marius1311

@Marius1311 Marius1311 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Companion to quadbio/analysis-workflow#22 and the PR that follows it (declared inputs and analysis-workflow trace). Merge after both: the docs, the starter notebook and the demo use writes and inputs.yaml, which arrive with analysis-workflow 0.8.

CONVENTIONS.md

  • Data: every write into processed/ sits in a writes block (%%writes <path> in a notebook, with writes(<path>): in a script), which records in the store which task wrote what. Stores only grow. External tools write into the task's own directory. Limitation: only AnnData and SpatialData stores hold such a record. Any other file under data/ has none, so a trace stops at it. The only link to the task that made it is that task's README.
  • Working objects: the write-back example in its %%writes form; in a new dated copy a key may be dropped, and one whose values change gets a new name.
  • New section "What an artifact rests on": inputs.yaml, how a human gets it written (ask an agent to declare the task's inputs), and analysis-workflow trace.

REVIEW_GUIDE.md

  • Flags a write into processed/ outside a block, a shell cp/mv among them, and a key changed under its old name in a dated copy.
  • "Every key committed to a shared object appears in the README" gives way to the store's own record, and to a new check: extract a task's inputs from its code independently and compare with inputs.yaml. In a trial on a test repo with planted errors, a reviewer working from that paragraph alone found all four and raised nothing false.
  • Adding inputs.yaml to a frozen task is not a finding.

Task README: it carries the task's id in its header and loses its Inputs section, in the conventions and the demo; inputs.yaml holds only what a task consumed.

Notebooks: the starter notebook's write-back cell and the demo's save cell start with %%writes; the demo task gets its inputs.yaml and the task template's new guidance comments.

CONVENTIONS.md now opens by saying it is written for humans and applies to their work throughout; it names who acts where it used to say "you". The README points to it at the top. analysis-workflow new is shown without --author, which for a human's task defaults to the git user name (quadbio/analysis-workflow#26, to merge first).

+103 −42 lines.

🤖 Generated with Claude Code

Follows analysis-workflow 0.8: every write into `processed/` sits in a `writes` block, which records in the
store which task wrote what, and each task's `inputs.yaml` lists what its code consumed.

- CONVENTIONS: the `%%writes` form of a write-back; stores only grow; a changed key gets a new name in a dated
  copy; plain files under `data/` carry no record; `inputs.yaml`, how to get it written, and
  `analysis-workflow trace`.
- REVIEW_GUIDE: flag writes outside a block and keys changed under their old name; compare a task's `inputs.yaml`
  with what its code consumes, replacing "every key appears in the README".
- Starter notebook and demo: the write cell starts with `%%writes`; the demo task gets its `inputs.yaml`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T11:12:34.677014Z 34f2be7 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0821352dd7

ℹ️ 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".

Comment on lines +4 to +5
inputs:
- path: data/example_dataset/raw/pbmc3k_raw.h5ad

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Declare the CellTypist model as an input

The demo notebook loads Immune_All_High.pkl with models.Model.load() and passes it to celltypist.annotate(), so the resulting obs["cell_type"] depends on that model as well as the PBMC data. Declaring only the expression dataset leaves this dependency out of the new lineage record, making the promised trace back to inputs incomplete. Add the consumed model file to the declaration, as required by the declared-input checks in REVIEW_GUIDE.md.

AGENTS.md reference: {{cookiecutter.project_name}}/AGENTS.md:L12-L13

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit: the demo declares the model in CellTypist's per-user cache, ~/.celltypist/data/models/Immune_All_High.pkl. The trace and the input check expand ~ in the analysis-workflow PR that adds them.

Marius1311 and others added 5 commits November 17, 2026 15:29
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What a task consumed is in its `inputs.yaml`, so the README section held nothing of its own. The demo's two
entries are already in its `inputs.yaml`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtTJWVCHDBr1Lcg8K1Gaft
Follows the plugin: `analysis-workflow new` writes the id into the README header, and `inputs.yaml` holds only
what the task's code consumed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtTJWVCHDBr1Lcg8K1Gaft
… with its task

A file of another format cannot hold a record of which task made it. In the task's `results/` or `outputs/`,
its location says so.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtTJWVCHDBr1Lcg8K1Gaft
…n for plain files is stated

Only AnnData and SpatialData stores hold a record of the task that wrote them. Another file under `data/` has
none: a trace stops at it, and the task's README is the only link.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtTJWVCHDBr1Lcg8K1Gaft

@Marius1311 Marius1311 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss these before you make changes please.

@@ -2,6 +2,7 @@

**Date:** 2026-01-27
**Author:** ML

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's the author written down here? What does this look like by default for humans and for agents? For humans, it would be nice if one could pass this already when creating the task dir, with a default if left empty.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analysis-workflow new --author writes it: a human passed a name or initials, an agent its model. As agreed, --author becomes optional for a human's task and defaults to the git user name; an agent's task still has to pass its model (quadbio/analysis-workflow#26). The commands here drop the flag (34f2be7).


A task writes into its own directory. An object other tasks will load goes to `processed/` (for an agent, after
sign-off), and the task README records its path.
A task writes into its own directory, and so do the external tools and shell scripts it runs. An object other

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make sure the top level README contains a link to these conventions, so humans actually read what it says here. Also, I feel like it should be clearly marked what's human-relevant, so that humans can quickly get what matters to them, withouth having to read all the agent-specific stuff.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, let's not duplicate anything - rules that hold for agents and humans alike won't be duplicated. What I"m saying is, make sure these conventions are actually human-readable, if we want humans to follow them!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 34f2be7. The README already linked the conventions under "Start Your Analysis"; it now also points to them at the top. CONVENTIONS.md opens by saying it is written for humans and applies to their work throughout, with agents mentioned only where a human needs to know what they do, and the sentences that said "you" now name who acts.

@@ -13,7 +13,7 @@ pixi run analysis-workflow new analysis/<dataset>/<topic>/human_<name>_v1 --auth
```

This creates the task directory with its `README.md` and a starter notebook in `notebooks/`. Open the notebook,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please justify the existence of this file to me in chat - why can't this not live in the central AGENTS.md? Let's discuss this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or is this entire file mean for humans? I need more context.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept, as discussed: it is the one document humans are meant to read, and it is entirely template-owned, so a template update replaces it cleanly, whereas AGENTS.md holds the facts each repo edits.

… points to them first

- CONVENTIONS.md opens by saying it is written for humans and applies to their work throughout; agents are
  mentioned only where a human needs to know what they do. Sentences that addressed the reader as "you" now name
  who acts.
- `analysis-workflow new` no longer needs `--author` for a human's task: the author line takes the git user name.
- README: a pointer to the conventions at the top.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtTJWVCHDBr1Lcg8K1Gaft
@Marius1311
Marius1311 merged commit a75b5f7 into main Nov 18, 2026
1 check passed
@Marius1311
Marius1311 deleted the data-lineages branch November 18, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant