Skip to main content

Module fix

Module fix 

Source
Expand description

Automated remediation and migrations for OKF concepts, bundles, and logs.

Continuous authoring by agents and humans naturally introduces hygiene issues or leaves documents in older specification versions (such as v0.1 timestamp and body # Citations). This module provides deterministic, safe, automated remediation and migration transformations:

  • Frontmatter key ordering (L18): Normalizes frontmatter keys to the canonical PREFERRED_KEY_ORDER.
  • v0.1 timestamp migration (L5): Migrates legacy timestamp into a structured generated: { by, at } block (or removes redundant timestamp).
  • v0.1 # Citations migration (L6): Converts legacy body citations to frontmatter sources entries and turns inline references into footnotes.
  • Missing title (L1): Derives and inserts human-readable title from filename stem.
  • Missing generated (L3): Inserts generated: { by, at } attribution.
  • Missing top heading (L8): Prepends # <title> heading to document body.
  • Computation syntax tagging (L26): Adds language syntax tag to # Computation code blocks.
  • Duplicate log dates (L27): Consolidates duplicate ## YYYY-MM-DD headings in log.md.
  • Index sync (L16): Re-indexes all bundle directories.

Structs§

BundleFixReport
Remediation report for a whole bundle.
FileFixReport
Remediation report for a single file.
FixOptions
Options controlling automated remediation and migration.
Remediation
A single remediation action applied to a document or file.

Enums§

RemediationKind
What kind of remediation or migration was applied.

Functions§

remediate_bundle
Remediates an entire bundle directory tree.
remediate_document
Remediates and migrates a single Document.
remediate_file
Remediates a single file on disk.
remediate_log
Remediates a parsed log.md file (consolidating duplicate date headings).