portfolio-lineage
Source Lineage
Track input sources, detect changes, and guide refresh cascades through the portfolio entity chain.
Core Concept
Plugin root resolution. Bash invocations below resolve the plugin root inline as ${CLAUDE_PLUGIN_ROOT:-$(ls -td "$HOME"/.claude/plugins/cache/insight-wave/cogni-portfolio/*/ | head -1)} — the first call works whether or not the harness injects $CLAUDE_PLUGIN_ROOT. Keep the inline form in every call; do not strip it.
Portfolio entities (features, propositions, solutions) are derived from input sources — uploaded documents, web research URLs, and TIPS enrichment. When those sources change (a document is re-uploaded, a URL's content changes), downstream entities become stale. This skill manages the full lineage lifecycle:
- Register sources with fingerprints during ingestion
- Detect when sources have changed
- Trace which entities came from which sources
- Cascade staleness through the dependency chain
- Guide the user through a refresh in the correct order
The source registry (source-registry.json) is the central manifest. It tracks every input source, its SHA-256 fingerprint, and which entities it created. The portfolio-ingest skill creates registry entries automatically; this skill manages the registry lifecycle afterward.