Mycelium — Ingest
Resolve bundled skills/ and network/ paths relative to the Mycelium plugin
root—the ancestor containing .codex-plugin/ and .claude-plugin/. Resolve
data and .living/ paths relative to the user's repository.
Pull a new dataset into the analytical framework, ensuring it is properly documented, validated, and registered.
Steps
- Read manifests to understand existing data:
data/DATA_MANIFEST.md— existing datasetsdata/raw/— current raw data directories
- Consult ingestion conventions: Read
skills/core/references/data-ingest-conventions.mdfor the full workflow, metadata requirements, large file handling, and manifest entry checklist.
- Check for domain-specific validation:
- Read
.living/conventions/ACTIVE_CONVENTIONS.yamlto see what's installed. - If a domain convention is installed (e.g.,
bioinformatics,image-analysis), consult its conventions for domain-specific validation requirements (e.g., QC metrics for sequencing data, format validation for images). - Domain conventions may add required metadata fields or validation steps beyond the standard workflow.
- Determine data type, source, and format:
- Ask the user if not already clear: What is the data? Where did it come from? What format is it in?
- For large files (too large for git), plan for
.gitignore+ download documentation.
- Place raw data in
data/raw/[dataset-name]/:
- Each dataset gets its own subdirectory.
- Include a documentation file named in UPPER_SNAKE_CASE of the folder name (e.g.,
PATIENT_COHORT_2024.md). - Raw data is immutable — never modify files after initial placement.
- Generate metadata in
data/metadata/[dataset-name]/:
schema.yaml— column descriptions, types, unitsprovenance.md— full source details, acquisition method, contactsummary_stats.md— row counts, column distributions, missing data summary- Use the templates at
skills/core/templates/schema.yaml,skills/core/templates/provenance.md, andskills/core/templates/summary_stats.mdas starting points. - Required fields: source, date acquired, schema/column descriptions, known issues, access restrictions.
- When the data has samples, write a sample ledger. Write
samples.tsvwith one row per sample: its id, its group, every replication level from coarse to fine (for example line, derivation, preparation, dish, library), and the crossed batch variables (preparation date, sequencing run). Writesamples.ledger.jsonto name those columns, starting fromskills/core/templates/samples.ledger.jsonandsamples.tsv. Pointschema.yaml'ssample_ledger:at the spec. Then run:
python3 "$(cat .mycelium/plugin-root)/skills/core/scripts/data_contract_check.py" --ledger data/metadata/[dataset-name]/samples.ledger.json
The run checks unique sample ids, that each level nests in the one above it, at least two replication units per group, each batch variable against the group, and any declared pairing, including each batch variable against the within-unit contrast (a warning in this release). Fix a block in the ledger or the data, or record it as a known issue. Never loosen the spec to make it pass. A batch variable listed as a replication level at or below the unit is a spec error: nested preparation instances belong in nesting, and calendar batches belong in batch.
- Update
data/DATA_MANIFEST.mdwith a new entry usingskills/core/templates/dataset-manifest-entry.yaml.
- Log decisions: If any choices were made during ingestion (excluding records, choosing formats, handling encoding issues), append to
.living/decisions.md.
- Run the post-action hook protocol after ingestion is complete (see
/mycelium:corefor the full protocol):
- Update
data/DATA_MANIFEST.md(done in step 7) - Update the dataset documentation file
- Log decisions to
.living/decisions.md - Log learnings to
.living/learnings.md. Derivemitigation_typeby the rule inskills/core/templates/learning-entry.md:structuralif a shipped test, assertion, type constraint, frozenset, or schema validation enforces it; otherwiseconventionif a.living/conventions.mdentry covers it; otherwiseambient-awareness. - Run
skills/core/scripts/validate_structure.py