audit
Audit descriptif d’un bundle OKF — inventaire et diagnostic de conformité.
OKF bundle audit — inventory and conformance diagnostic.
- class okflint.audit.FileReport(path, depth, lines, chars, is_reserved, okf_status, frontmatter, wikilinks, markdown_links, split_candidate, diagnostics=<factory>)[source]
Bases:
objectAnalysis report for a .md file in the bundle.
- diagnostics: list[Diagnostic]
- markdown_links: list[MarkdownLink]
- okflint.audit.analyze_file(file_path, bundle_path, vault_index)[source]
Full analysis of a .md file in the bundle.
- okflint.audit.compute_stats(files, vault_total)[source]
Aggregate global statistics for the report.
Only non-reserved files are counted in by_okf_status.
- okflint.audit.get_okf_status(frontmatter)[source]
Determine the OKF status of a concept from its frontmatter.
- okflint.audit.run_audit(bundle_paths, vault_paths, *, target_filter=None, vault_index=None, manifest=None)[source]
Orchestrate the full audit of one or more OKF bundle roots.
Accepts RootConfig objects (with exclusion patterns), plain Paths, or a mix thereof. Single-value forms are accepted for backward compatibility.
When
vault_indexis provided it is reused directly andvault_pathsis ignored, allowing the caller to build the index union once for a whole vault and then callrun_auditper-bundle without rebuilding.- Parameters:
bundle_paths (
Sequence[RootConfig|Path] |RootConfig|Path) – Root(s) of the bundle(s) to audit. RootConfig carries per-root exclusion patterns; plain Path implies no exclusions.vault_paths (
list[Path] |Path) – Root(s) of the Obsidian vault(s) (for the wikilinks index). Ignored whenvault_indexis supplied.target_filter (
Path|None) – If set, restrict scanning to files under this path. Used when –bundle is combined with –manifest as a sub-filter.vault_index (
dict[str,list[str]] |None) – Pre-built file index (stem → list of relative paths). When provided, vault indexing is skipped entirely.manifest (
Manifest|None) – When provided, each file is validated through the same engine asvalidate(core + profile + hygiene diagnostics). When None, diagnostics are core-only (F001/F002).
- Return type:
- Returns:
Full audit report serialisable as JSON.