MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / audit_coverage

Function audit_coverage

tools/skillgen/gen.py:610–658  ·  view source on GitHub ↗

Assert every heading of THIS host's v8 body single-homes in its render. The audit reads the host's OWN v8 skill body (graphify/skill.md for claude, graphify/skill- .md otherwise) and checks that every v8 heading lands in that host's generated core or in exactly one of its reference

(platform: Platform)

Source from the content-addressed store, hash-verified

608
609
610def audit_coverage(platform: Platform) -> list[str]:
611 """Assert every heading of THIS host's v8 body single-homes in its render.
612
613 The audit reads the host's OWN v8 skill body (graphify/skill.md for claude,
614 graphify/skill-<host>.md otherwise) and checks that every v8 heading lands in
615 that host&#x27;s generated core or in exactly one of its reference fragments. This
616 is the per-host guard: a content drop that only hits one host (the trae native
617 AGENTS.md integration regression that motivated this change) is invisible when
618 every host is checked against claude&#x27;s monolith, so each host is checked
619 against itself.
620
621 v8 headings are exempt and documented as deltas, not holes:
622 - waves 2-3 consolidations (the lean "## What graphify is for" intro and the
623 per-host re-homed step/part headings on the minimal kilo/vscode bodies),
624 tracked in the audit allowlist.
625 Anything NOT exempt and NOT single-homed fails the audit.
626 """
627 if platform.bucket != "split":
628 return [] # monoliths are guarded by the round-trip validator instead.
629
630 problems: list[str] = []
631 baseline_headings = headings(_git_show(_v8_baseline_ref(platform.key)))
632 allowlist = _audit_allowlist(platform.key)
633
634 artifacts = render(platform)
635 by_path = {a.path: a.content for a in artifacts}
636 core_headings = set(headings(by_path[platform.skill_dst]))
637
638 # Map each reference's rendered heading set.
639 ref_headings: dict[str, set[str]] = {}
640 for name in platform.reference_sources():
641 rel = f"{platform.refs_dst}/{name}.md"
642 ref_headings[name] = set(headings(by_path[rel]))
643
644 for h in baseline_headings:
645 # Allowlisted consolidations + the lean intro are intentional deltas.
646 if h in allowlist:
647 continue
648 homes = []
649 if h in core_headings:
650 homes.append("core")
651 for name, hs in ref_headings.items():
652 if h in hs:
653 homes.append(f"references/{name}.md")
654 if not homes:
655 problems.append(f"v8 heading not covered anywhere: {h!r}")
656 elif len(homes) > 1:
657 problems.append(f"v8 heading double-homed in {homes}: {h!r}")
658 return problems
659
660
661def _enum_lines(content: str) -> list[str]:

Callers 1

mainFunction · 0.85

Calls 7

headingsFunction · 0.85
_git_showFunction · 0.85
_v8_baseline_refFunction · 0.85
_audit_allowlistFunction · 0.85
renderFunction · 0.85
reference_sourcesMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected