Skip to content

feat: CI-enforced doc drift merge gate (#117/#141)#142

Merged
marcusglee11 merged 3 commits into
mainfrom
build/doc-drift-gate-117
Jul 8, 2026
Merged

feat: CI-enforced doc drift merge gate (#117/#141)#142
marcusglee11 merged 3 commits into
mainfrom
build/doc-drift-gate-117

Conversation

@marcusglee11

Copy link
Copy Markdown
Collaborator

Objective

Implements the approved v3 spec from #117 — CI-enforced documentation drift control.

What changed

New files

  • tools/validate_doc_drift_gate.py (719 lines) — Validator that checks PRs against config/docs/authority_registry.yaml:

    • Check A: Canonical doc changes require reconciliation packet or valid exemption (reason: other rejected)
    • Check B: Authority registry transitions require approval evidence (GitHub URL + verdict: approved)
    • Check C: Derived surfaces must be fresh when canonical docs change
    • Check D: Emergency manual repairs need follow-up issue URL (not pending)
  • .github/workflows/doc_drift_gate.yml — GitHub Actions workflow running the validator on PRs/pushes touching docs/** or config/docs/**. Handles both PR and push events.

  • tests/test_doc_drift_gate.py (361 lines) — 12 test cases covering all gate checks + edge cases. All passing.

Parent Hermes fixes (post-EA implementation)

  • classify_file: paths listed as derived_surfaces by any group are classified as derived, not canonical
  • check_derived_freshness: excludes reconciliation packet paths from canonical check
  • check_emergency_repair: derived files updated alongside canonical sources are normal regeneration, not emergency

EA review fixes (AMEND → fixed)

  • Critical: workflow base-ref handles push events where github.base_ref is empty
  • Warning: removed dead has_valid_packet variable
  • Warning: emergency repair check uses per-file source check

Verification

12 passed in 1.82s

EA dispatch evidence

  • Plan: DeepSeek Pro v4, $0.0562, 198s
  • Implement: DeepSeek Flash v4
  • Review: DeepSeek Pro v4, $0.0349, 80s, verdict: AMEND (6 findings, all addressed)
  • Parent verification: GLM-5.2, 12/12 tests passing, diff inspected

Control plane

Non-goals

Implements approved v3 spec from issue #117:
- tools/validate_doc_drift_gate.py: validates PRs against authority registry
  - Check A: canonical doc changes require reconciliation packet or exemption
  - Check B: authority transitions require approval evidence URL
  - Check C: derived surfaces must be fresh when canonical docs change
  - Check D: emergency manual repairs need follow-up issue URL
- .github/workflows/doc_drift_gate.yml: CI workflow running on PRs touching docs/
- tests/test_doc_drift_gate.py: 12 test cases covering all gate checks

Parent Hermes fixes:
- classify_file: paths listed as derived_surfaces classified as derived, not canonical
- check_derived_freshness: exclude reconciliation packet paths from canonical_changed
- check_emergency_repair: derived files updated with canonical sources are normal, not emergency

All 12 tests passing.
- Critical: workflow base-ref handles push events (github.base_ref empty on push)
- Warning: remove dead has_valid_packet variable
- Warning: emergency repair check uses per-file source check instead of global

Tests: 12/12 passing.
@marcusglee11
marcusglee11 merged commit 4fa4fd7 into main Jul 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant