Files
future-map-OPEN/data/insights-hub/skills/index-future-map-sections/SKILL.md
T
2026-08-19 17:39:51 -06:00

15 KiB

name, description
name description
index-future-map-sections Build and maintain a stable machine-readable index of Future Map core documents, Markdown sections, and presentation slides or chapters; detect corpus changes; preserve document and section identifiers; validate Insights Hub related-document targets; and queue ambiguous renames, removals, or repairs for human review. Use after files under core-docs are added, edited, renamed, moved, or removed, before enrichment batches, or whenever Future Map signal-to-corpus links need validation or repair.

Index Future Map Sections

Skill Shape

  • system: detect corpus changes, extract structure, preserve stable identifiers, enrich changed sections, validate relationship targets, and leave an auditable receipt.
  • Modes: build by default; apply-repairs only with explicit human approval.
  • Trigger: manual for the initial implementation. Do not create or enable a scheduler.

Contract

Create a reliable address book for the Future Map corpus. Make every core document and addressable section discoverable by a stable identifier, and verify that every Insights Hub related_documents relationship points to a real target. Never silently rewrite ambiguous or broken relationships.

Requires

  • Read access to:
    • ../../../../core-docs/
    • ../../../../content-index.json
    • ../../hrecords/
    • ../../schemas/future-map-signal.schema.json
    • The previous section index, change report, repair queue, and receipts when present.
  • Write access under data/insights-hub/ for index artifacts, reports, receipts, and explicitly approved repairs.
  • A tool capable of reading each in-scope format.
  • Explicit repository-owner approval naming the accepted repair mappings before apply-repairs.

Ensures

  • Every current core document has one canonical document_id.
  • Every addressable Markdown section and presentation slide or chapter has one stable section_id within its document.
  • Unchanged targets retain their identifiers across rebuilds.
  • New documents and sections receive collision-free identifiers.
  • Removed identifiers are never reused.
  • Every signal relationship is checked against the current index.
  • Ambiguous renames, removals, splits, merges, and target repairs enter a human-review queue.
  • The index is not rewritten when the corpus fingerprint is unchanged.
  • No core document, source record, commit, push, publication, or schedule is changed without separate authorization.

Inputs

  • Optional mode: build or apply-repairs; default to build.
  • Optional document paths for a bounded rebuild; default to all supported files under core-docs/.
  • For apply-repairs: an approved repair-queue path plus exact accepted repair IDs or mappings.

Outputs

Build mode may create or update:

  • ../../indexes/core-document-sections.json
  • ../../review/section-index-changes.json
  • ../../review/relationship-target-issues.jsonl
  • ../../runtime/receipts/section-index-TIMESTAMP.json

Apply-repairs mode may additionally update affected derivative hrecords through the existing controlled merge or update path and refresh generated Insights Hub outputs.

Do not create scripts, schemas, automation, or extra documentation unless separately authorized.

Canonical Index Shape

Use one index with this logical structure:

{
  "schema_version": "1.0",
  "generated_at": "ISO-8601 timestamp",
  "corpus_fingerprint": "sha256:...",
  "documents": [
    {
      "document_id": "exponential-growth-strategies",
      "title": "Exponential Growth Strategies",
      "path": "core-docs/Exponential-Growth-Strategies.md",
      "format": "markdown",
      "content_hash": "sha256:...",
      "status": "current",
      "sections": [
        {
          "section_id": "automation-autonomous-agents",
          "heading": "Automation & Autonomous Agents",
          "kind": "heading",
          "level": 2,
          "ordinal": 12,
          "locator": "#automation--autonomous-agents",
          "content_hash": "sha256:...",
          "status": "current"
        }
      ]
    }
  ],
  "retired_targets": []
}

An implementation may add section summaries, taxonomy concepts, topics, confidence, and provenance when they materially improve retrieval. Preserve reasoning-derived fields for unchanged sections and regenerate them only for new or materially changed content.

Identifier Rules

Document IDs

  1. Reuse a canonical ID from the previous section index or authoritative content index.
  2. Preserve the ID when a file moves or is renamed but continuity is exact or human-approved.
  3. For a new document, derive a lowercase hyphenated ID from its stable title.
  4. Add the shortest deterministic collision suffix only when necessary.
  5. Never derive a new ID merely because capitalization, punctuation, spacing, or the path changed.
  6. Never reuse a retired ID for different content.

Markdown Section IDs

  1. Index meaningful headings, preserving hierarchy and document order.
  2. Reuse the prior ID when the heading and structural context are unchanged.
  3. Treat a heading rename as a continuity decision, not an automatic new identity.
  4. Use normalized heading text for a new section ID; add a deterministic collision suffix for repeated headings.
  5. Store the rendered Markdown anchor separately because the anchor may change while the stable section ID does not.
  6. Exclude generated tables of contents, empty formatting headings, and image-only artifacts unless they are intentional retrieval targets.

Presentation Section IDs

  1. Inspect every slide in each local presentation.
  2. Index each meaningful slide and, when evident, its enclosing chapter or named section.
  3. Store slide number, slide title, and slide content fingerprint as locators and matching evidence.
  4. On the first build, create a stable ID from the slide title plus the minimum collision suffix.
  5. On later builds, match prior slides using exact fingerprints first, then title, neighboring slides, chapter, and content similarity.
  6. Do not change an established ID because a slide was reordered.
  7. Queue ambiguous slide matches, split slides, merged slides, deleted slides, and conflicting titles for review.
  8. Do not edit or visually restyle presentation files while indexing them.

Workflow

1. Inventory The Corpus

Enumerate supported core files deterministically. Include Markdown and local PowerPoint formats already present in the corpus. Record normalized repository-relative paths, file sizes, modification times as diagnostics, and SHA-256 content hashes.

Do not use timestamps alone to decide whether content changed.

2. Compute The Corpus Fingerprint

Sort entries by normalized repository-relative path. Compute a fingerprint from path, format, and content hash.

If it matches the latest successful receipt and current index:

  • Validate the existing index and relationship targets.
  • Write a no-change receipt.
  • Do not regenerate summaries, identifiers, or the index.

3. Load Previous Identity State

Read the previous index, authoritative content index, prior change reports, repair decisions, and retired targets. Treat this state as the continuity baseline.

If the index is missing, run an explicit first-build bootstrap and report that all identifiers are newly established.

If the index is malformed or its fingerprint conflicts with the receipt, stop and request review rather than replacing it.

4. Extract Structure

For Markdown:

  • Parse heading level, heading text, source order, parent heading, anchor, and bounded section content.
  • Preserve code blocks, escaped headings, and duplicate headings correctly.

For PowerPoint:

  • Read every slide.
  • Extract slide number, title, visible text, speaker-note text when available, and chapter evidence.
  • Generate a content fingerprint that excludes volatile package metadata.
  • Use visual inspection only when structure or title extraction is ambiguous.

Keep extraction deterministic. Use model reasoning only for ambiguous continuity, section summaries, taxonomy annotation, and chapter interpretation.

5. Match Current Structure To Stable IDs

Classify each document and section as:

  • unchanged
  • added
  • modified
  • renamed
  • moved
  • removed
  • split
  • merged
  • ambiguous

Automatically preserve IDs only for exact or high-certainty deterministic continuity, such as unchanged hashes, unchanged structural keys, or a pure path move with identical content.

Queue reasoned or ambiguous continuity proposals with old target, proposed target, evidence, confidence, and human-review-required.

6. Build The Index

Write current documents and sections in deterministic order. Preserve retired target tombstones so identifiers cannot be reassigned and historical references remain explainable.

For each current section, retain enough context to support retrieval:

  • Canonical IDs and display labels.
  • Repository-relative document path.
  • Heading hierarchy or presentation chapter.
  • Markdown anchor or presentation slide locator.
  • Content fingerprint.
  • Current or retired status.
  • Optional summary and taxonomy annotations with reasoning provenance.

7. Validate Relationship Targets

For every public hrecord:

  1. Read each reasoning.related_documents[] entry.
  2. Confirm document_id exists and is current.
  3. If section_id is non-null, confirm it exists under that exact document and is current.
  4. If section_id is null, validate only the document and optionally warn when a more precise target appears available.
  5. Confirm any stored path or locator resolves when the record format includes one.

Use these issue classes:

  • unknown-document
  • unknown-section
  • section-under-wrong-document
  • retired-document
  • retired-section
  • ambiguous-continuity
  • missing-locator
  • imprecise-document-only-target

Write one JSONL issue per affected relationship with signal ID, relationship position, current target, issue class, candidate replacement targets, evidence, confidence, and review status.

8. Stop For Review

Build mode may automatically index straightforward additions and exact continuity. It must not rewrite signal relationships.

Stop and request human review for:

  • Ambiguous document or section continuity.
  • Removed targets with existing inbound relationships.
  • Splits and merges.
  • Competing replacement targets.
  • Any migration that changes an established ID.

9. Apply Approved Repairs

In apply-repairs mode:

  1. Require the approved queue path and exact repair IDs or mappings.
  2. Re-read the current index and detect intervening changes.
  3. Refuse stale, conflicting, unapproved, or low-evidence mappings.
  4. Update only the approved derivative relationships.
  5. Preserve the prior target in repair provenance.
  6. Use the repository's controlled merge or regeneration path; do not hand-edit generated indexes or digests.
  7. Revalidate the entire relationship graph.

Never delete a relationship merely because its target disappeared. Preserve it as unresolved until an approved replacement or explicit removal exists.

Validation

Validate:

  • JSON syntax and required index fields.
  • Unique document IDs.
  • Unique section IDs within each document.
  • Unique active target pairs document_id + section_id.
  • No reuse of retired identifiers.
  • Current paths and locators resolve.
  • Markdown anchors correspond to current headings.
  • Presentation slide locators remain within the slide count.
  • Every relationship issue is reproducible from the current index and hrecord.
  • All valid existing relationships remain valid after a rebuild.
  • The corpus fingerprint matches the indexed source files.

After approved repairs, also run:

python data/insights-hub/scripts/future_map_pipeline.py validate
python -m unittest discover -s data/insights-hub/tests -v
git diff --check

Do not report success when a required check fails.

Receipt

Write a machine-readable receipt containing:

  • workflow: index-future-map-sections
  • mode
  • status: success, partial, or failed
  • started_at and completed_at
  • Previous and current corpus fingerprints
  • Document and section counts by format
  • Added, changed, moved, renamed, removed, split, merged, and ambiguous counts
  • Relationships checked, valid, warned, and invalid
  • Index, report, and queue paths
  • Approved repairs applied
  • Files changed
  • Validation commands and results
  • Warnings, failures, and unresolved decisions
  • Framework provenance: local template version 0.3.1 and files used

A partial or failed run must not become the continuity baseline.

Model And Method Routing

  • Use deterministic processing for inventory, hashing, Markdown parsing, PowerPoint package extraction, ordering, exact matching, ID collision checks, and relationship validation.
  • Use presentation-reading capabilities for complete slide inspection when PowerPoint structure is involved.
  • Use model reasoning for ambiguous continuity, section summaries, chapter inference, taxonomy annotations, and replacement ranking.
  • Use human authority for migrations, destructive changes, split or merge resolution, and relationship repairs.
  • Stop safely when source formats cannot be read, prior identity state is inconsistent, or approval evidence is missing.

Routing Evaluation Cases

  • An unchanged corpus must produce a no-change run and stable IDs.
  • A new Markdown document must receive a new document ID and indexed headings.
  • A renamed Markdown heading with unchanged body and neighbors must retain its ID only when continuity is exact or approved.
  • A moved file with an identical hash must retain its document ID.
  • A reordered presentation slide must retain its ID when matching evidence is unambiguous.
  • A deleted section with inbound relationships must create issues and preserve a tombstone.
  • An invented section_id in a signal must fail relationship validation.
  • A null section_id with a valid document must remain valid but may receive a precision warning.

Edge Cases

  • Disambiguate repeated headings under different parents.
  • Preserve IDs across punctuation, capitalization, and Markdown-anchor changes when identity is clear.
  • Treat wholesale rewrites as possible replacement rather than automatic continuity.
  • Flag duplicate files with different paths.
  • Ignore image and asset folders unless an asset is an intentional indexed document.
  • Preserve source-relative links but do not treat image links as sections.
  • Treat unreadable or password-protected files as blockers for a complete build.
  • Preserve presentation speaker notes as retrieval context without making them separate public sections unless requested.

Anti-Patterns

Do not:

  • Generate IDs solely from current filenames on every run.
  • Renumber slide IDs after slide reordering.
  • Replace ambiguous targets by nearest-title similarity alone.
  • Delete tombstones or historical repair decisions.
  • Load every full document into one reasoning prompt.
  • Rewrite unchanged summaries or taxonomy annotations.
  • Edit core documents while indexing them.
  • Commit, push, publish, or schedule this workflow without separate authorization.

Ratchet Rules

Turn every recurring extraction, continuity, or validation failure into a normalization rule, deterministic check, fixture recommendation, STOP gate, or routing case. Never weaken stable-ID preservation, full-slide coverage, relationship validation, or human approval requirements to make a run pass.

Final Report

Report the corpus fingerprint change, documents and sections indexed, stable IDs preserved, additions and removals, ambiguous continuity decisions, relationship validation totals, issue and repair queues, approved repairs, validation results, receipt path, unresolved blockers, and whether Git, publishing, or scheduling occurred.