--- name: process-future-map-insights description: Prepare, enrich, validate, review, and publish Future Map Insights Hub records as corpus-grounded public signal artifacts. Use when an agent must process exact-tag Future Map source JSON, reason about a signal against the curated Future Map corpus, classify it, link it to core documents, update pending or stale enrichment records, validate connected media and links, or operate the contained data/insights-hub workflow. --- # Process Future Map Insights ## Skill Shape - `system`: coordinate deterministic preparation with corpus-grounded reasoning and validated publication. ## Contract Preserve source facts, distinguish reasoning from source content, enrich each signal against the Future Map corpus, publish connected files under the repository owner's declared policy, and leave schema-valid outputs and a durable receipt. ## Requires - Read access to the private source hrecords and files for deterministic preparation. - Read access to `content-index.json` and relevant files under `core-docs/` for enrichment. - Write access only within `data/insights-hub/` unless separately authorized. - Human authority for changing publication policy, taxonomy, schema, or core documents. ## Ensures - Source JSON remains unchanged. - Public hrecords conform to `../../schemas/future-map-signal.schema.json`. - Original summary and normalized notes remain labeled as source content. - Analysis, implications, claims, classifications, and relationships remain labeled as reasoning. - Pending, stale, failed, and complete states remain explicit. - Connected files and links remain attached when available. - Validation and a run receipt complete before reporting success. ## Inputs - Exact-tag source records selected by deterministic scripts. - `review/pending.jsonl` or user-selected record IDs. - Repository `content-index.json` and relevant core documents. - `references/reasoning-rubric.md` and `references/publication-policy.md`. ## Outputs - Enrichment patch JSON for each processed record. - Updated derivative hrecord through `scripts/future_map_pipeline.py apply-reasoning`. - Refreshed digest, indexes, review queue, manifest, and receipt. ## Capabilities And State - Use deterministic scripts for selection, extraction, copying, merging, rendering, and validation. - Use model reasoning only for interpretation and cross-corpus relationships. - Use project-scoped state under `data/insights-hub/`. - Do not publish, commit, push, edit private source data, or modify `core-docs/` without separate authorization. ## Workflow ### 1. Ingest And Sanitize Run: ```text python data/insights-hub/scripts/future_map_pipeline.py sync ``` Confirm the exact `Future Map` tag filter, source availability, copied media, pending/stale counts, and validation result. Stop if source folders are unavailable or deterministic validation fails. ### 2. Select A Bounded Batch Read `review/pending.jsonl`. Process a small explicit batch. Do not load all records and all core documents into one prompt. ### 3. Retrieve Corpus Context Read repository `content-index.json`. Always consider foundational methodologies when relevant, then load only core documents whose titles, descriptions, concepts, or sections plausibly relate to the signal. Record which documents were consulted. ### 4. Enrich Follow `references/reasoning-rubric.md`. Create a patch matching `../../schemas/reasoning-patch.schema.json`. Keep these boundaries: - `summary` and `notes` are source-derived. - `analysis`, `implications`, `claims`, `classification`, `related_documents`, and `related_signals` are reasoned. - Related-signal links must name an existing `fm-signal-*` record and describe whether it supports, challenges, updates, illustrates, warns about, contradicts, or supersedes the current signal. - Never invent source, rights, dates, authors, publishers, URLs, or media provenance. - Use `unknown`, an empty list, or a lower confidence when evidence is insufficient. ### 5. Apply And Validate Apply each patch through the deterministic merge command: ```text python data/insights-hub/scripts/future_map_pipeline.py apply-reasoning --record-id fm-signal-ID --patch PATH ``` Then run: ```text python data/insights-hub/scripts/future_map_pipeline.py validate ``` Do not hand-edit generated indexes, queues, manifest, or digest. ### 6. Review And Publish Inspect validation warnings and the affected Markdown entry. Publication means writing local generated artifacts only. Git commit, push, external publication, and core-document promotion require separate authorization. Write a receipt under `runtime/receipts/` using `../../templates/run-receipt.json` as the shape. Do not include private absolute source paths, credentials, or raw protected content in receipts. ## Test Surface - Static: skill validation and unresolved-placeholder scan. - Schema: public signals, reasoning patches, manifest, and receipt. - Invariants: exact tag, stable ID, source hash, source/reasoning separation, local media existence. - Fixtures: missing title, HTML notes, remote links, duplicate media, stale reasoning, malformed JSON. - Behavioral: use deterministic merging; report uncertainty; never overwrite source facts with inference. - Routing: deterministic preparation first, model reasoning only for enrichment, human authority for publication-policy and core-document changes. ## Edge Cases - Preserve complete reasoning when the source fingerprint is unchanged. - Mark reasoning `stale` when source JSON or connected media changes. - Keep missing media as a warning and explicit media status. - Normalize legacy control characters without changing the private source file. - Treat absent rights data as `unknown`; apply the declared publish-with-attribution policy without inventing permission. - Exclude raw contact identifiers from public output; retain only a deterministic reference count. ## Anti-Patterns Do not: - Copy raw source JSON into public hrecords. - Treat source notes as AI analysis. - Replace original summaries with generated summaries. - Infer redistribution rights from payment, access, or availability. - classify a record without consulting relevant corpus context. - edit generated output indexes manually. - call a model from the unattended daily deterministic task. ## Ratchet And Regression Rules Convert every important failure into a fixture, validator, schema rule, routing case, or explicit STOP gate. Rerun deterministic tests and skill validation after changing a guardrail. ## Validation Before finishing: 1. Run the pipeline test suite. 2. Validate the skill folder. 3. Run pipeline validation. 4. Run the repository audit and `git diff --check`. 5. Report pending/stale/complete counts and anything not tested. ## Final Report Report records prepared or enriched, files copied or missing, validation results, receipts written, unresolved review items, and whether Git or external publication occurred.