Add the activity translation table for lineage raw words (#584) - #586
Merged
Merged
Conversation
rules/activity_map.yaml maps what a lineage line says about its step to an activity of activities.yaml and the role its parent takes. A row's match names source_type and any of the line's other parts (table, raw_activity, the child and parent columns, and the raw data_type the same table's slot evidence gives each), each exact, null, or a list; no two rows may match one line. The loader checks each authored row's activity and role against activities.yaml. Seeding appends one row per unmatched key and never rewrites one; anvil15 gives 229 keys, 198 covered by nine authored rows, 31 left seeded. make review-queue lists them. The lineage is read one catalog at a time, joined only to slot evidence of that catalog. The YAML walk and the write-then-rename seeding step move to yaml_rows, shared with value_map; ReportColumn and md_rows move to summaries. Nothing in a run or in reconcile reads the table yet (#577). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016p3omgkuHduf1UQjLH4K6t
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The domain-specific mappings and corpus-derived lineage joins warrant final human validation.
Review effort: Balanced
Findings: None
What changed in this PR
Adds the activity translation layer required to convert imported lineage evidence into declared activities and parent roles for future reconciliation.
Changes:
- Adds activity-map loading, matching, validation, seeding, and tests.
- Shares YAML-row and report-table utilities with the existing value map.
- Extends review-queue reports and Make targets with lineage activity mappings.
| File | Description |
|---|---|
Makefile |
Adds activity-map seeding commands. |
CLAUDE.md |
Documents the activity-map architecture. |
src/meta_disco/activity_map.py |
Implements activity-map processing. |
src/meta_disco/rules/activity_map.yaml |
Defines authored and seeded mappings. |
src/meta_disco/yaml_rows.py |
Centralizes shared YAML utilities. |
src/meta_disco/value_map.py |
Adopts shared YAML/report utilities. |
src/meta_disco/summaries.py |
Hosts shared report-table helpers. |
scripts/activity_map.py |
Adds the activity-map CLI. |
scripts/generate_review_queue.py |
Adds lineage sections to reports. |
tests/test_activity_map.py |
Tests validation, matching, seeding, and reporting. |
docs/review-queue-report.md |
Publishes the lineage review queue. |
docs/review-queue.html |
Publishes the HTML lineage report. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…#584) A catalog imported beside an older one makes the older history: lineage_paths keeps the catalog holding the newest generation stamp, and keyed_lines joins only that catalog's slot evidence. The module docstring names everything it shares with value_map, and the review-queue help line names lineage steps. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016p3omgkuHduf1UQjLH4K6t
…ataset (#584, #587) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016p3omgkuHduf1UQjLH4K6t
…ty vs absent activity words (#584) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016p3omgkuHduf1UQjLH4K6t
…g is never read (#584) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016p3omgkuHduf1UQjLH4K6t
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the stated acceptance criteria and includes focused coverage for its validation, matching, seeding, and reporting behavior.
Review effort: Balanced
Findings: None
Resolved since last review (1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #584
What changed
src/meta_disco/rules/activity_map.yaml(new) maps what a lineage line says about its step to an activity ofactivities.yamland the role its parent takes. It holds nine authored rows and 31 seeded ones.Indexing,ChecksumandAlignment: STAR.src/meta_disco/activity_map.py(new) holds the loader, row selection,seed()andreview().matchnamessource_typeand any of the other parts:table,raw_activity,child_column,parent_column,child_data_type,parent_data_type.null(the line has none), or a list.activities.yamldoes not declare, and a role that activity does not declare.make seed-activity-mapappends a row for each key no row matches yet. It never rewrites a row.make review-queuegains a lineage section indocs/review-queue-report.mdanddocs/review-queue.html: the unauthored keys by kind of source, with line counts, then the authored rows.src/meta_disco/yaml_rows.pynow holds the YAML walk and the write-then-rename seeding step, used by bothvalue_mapandactivity_map.ReportColumnandmd_rowsmove tosummaries.py.value_map's behaviour is unchanged, and its tests pass as they were.Why
The lineage importer (#583) writes each lineage link in the source's own words:
Indexing, a column pair likechr7_hcvcf_gz/cram, or IGVF's barederived_from. Reconcile (#577) needs to know which activity each one is, and which role the parent plays. That role decides what the parent passes on to the file made from it.Assumptions I made
source_type(repository_metadata), so nothing per source says which key applies. Every row names the parts it cares about instead, and nothing is joined into one string.content_type. It is read as the rawdata_typevalue that the same catalog, dataset, table and kind of source gives each file in the slot evidence (Give the 10 IGVF SHARE-seq files a data_modality from their own evidence #570). The parts are namedchild_data_type/parent_data_type, not after IGVF's column. A file its table gives twodata_typevalues is keyed with none, and lands in the queue.anvil9would sort afteranvil16). An older catalog left on disk is history and is never read, and only slot evidence of the same catalog is joined. Archiving obsolete catalogs is a separate issue.participantorfiletable has the same columns would match those rows without review. An optional dataset scope, where the narrowest row wins, is Let an activity-map row name its dataset, the narrowest row winning #587.nullwhere the line has none. That keeps two seeded rows from ever matching one line. Authoring a row that covers seeded keys means deleting those seeded rows, or the table will not load.anvil_activityrows also nameparent_column: used_file_id.Alignment: STARhas sample parents too (634 lines). All 1,268 of its file parents in anvil15 are FASTQs.seqspec, barcode files) stay seeded, and noconfigurationrole is added yet. Their children's own activity (kallisto output, count matrices) is still undecided.Quantificatioin: salmonstays as AnVIL spells it.How to verify
Run everything from the repository root.
make seed-activity-map. ExpectScanned 16 lineage files, 588,279 lines; added 0 seeded rows: the committed table already holds every key.reason) from a scratch copy, then runuv run python scripts/activity_map.py --table <copy> seedtwice. Expect 31 added on the first run and 0 on the second.activity.checksum's role toreads, then runuv run python -c "from pathlib import Path; from meta_disco.activity_map import load_activity_map; load_activity_map(Path('<copy>'))". Expect aValueErrornamingactivity.checksum, saying thatChecksumActivitydoes not declarereads.make review-queue. Opendocs/review-queue.htmland read the section "Lineage: what each step is". Expect the Repository activity group (Unknown,Sequencing,Track: bedGraphToBigWig, …), then the Submitter group (the IGVF kallisto and count-matrix pairs), then the authored mappings with their line counts (activity.indexingat 223,724).make test. It includestests/test_activity_map.py.Definition of done, from #584:
test_ac2_*)test_ac4_nothing_but_the_review_queue_imports_the_table: nothing but the review-queue script imports the module, and nothing in a run or in reconcile reads the table.🤖 Generated with Claude Code
https://claude.ai/code/session_016p3omgkuHduf1UQjLH4K6t