Skip to content

[Documentation] Governance hardening: ADR system, canonical rule sourcing, template conformance, CI enforcement #64

Closed

Description

@Coldwings

Summary

DART's documentation already functions as the project's constitution for AI-assisted development: AGENTS.md (operational law), docs/README.md (mandatory 8-section template), design-assumptions.md (load-bearing trade-offs), per-package contracts, and CHANGELOG.md. An audit of the current system against "constitution-grade" requirements — unambiguous authority, recorded decisions, machine-enforceable rules — found one structural gap and several drift items. This umbrella issue tracks the hardening work; each landing PR references it.

Findings (verified on main)

  • A. No decision records. Contract-level decisions (e.g. the member-ID alphabet vs. epoch reframe, the shutdown safe-join contract, the minimalist-assumptions principle) live only in issue/PR discussions. Agents editing code later cannot discover why a rule exists, and rejected alternatives get re-proposed.
  • B. Normative rules duplicated across audience files. The verification trio and the docs policy are restated in AGENTS.md, CONTRIBUTING.md, and docs/README.md with no canonical home and no arbitration rule; duplicated text drifts.
  • C. Template conformance drift. docs/registry.md lacks the Concurrency and Stability Contract sections; docs/tracker.md lacks Invariants & Guarantees; docs/dart.md (a cmd doc) has only 5 of 8 sections; docs/observability.md uses a two-package structure the template neither blesses nor forbids. (peer.md's "Wire form" covering Concepts is a reasonable heading variant.)
  • D. Exported-symbol gaps. Eleven exported identifiers are not named in their package docs: cluster LearnPeer/Run/Self, chunk UnitSep/ErrInvalidConfig, fetch DefaultMaxFlight, engine NewMetrics, peer+registry ServeHTTP, tracker JoinRequest, metrics ErrInvalidName. (Test-list tables, by contrast, have zero drift.)
  • E. No enforcement. All of the above were found by one-off scripts; nothing runs them on CI.

Work plan (four sequential PRs)

  1. PR: ADR system — docs/adr/ (process README with trigger list T1–T5, template, lifecycle: accepted-on-merge, supersede-by-new-ADR with Binds audit surface, rejected-kept), three backfilled ADRs (minimalist assumptions as contract; visible-ASCII member IDs; shutdown safe-join), an AGENTS.md clause, index rows, Established by: links in design-assumptions.md.
  2. PR: canonical rule sourcing — each normative rule gets exactly one canonical home; other files link; safety-critical duplicates (wire-protocol prohibitions in AGENTS.md) are kept but marked "verbatim copy — canonical: ..." with an edit-both reminder; a one-line arbitration clause in AGENTS.md and CONTRIBUTING.md.
  3. PR: template conformance + sanctioned variants + symbol gaps — fill the missing sections (registry, tracker, dart), amend docs/README.md to bless machine-readable sanctioned variants (cmd doc, multi-package doc, heading aliases), and document the 11 missing exported symbols.
  4. PR: enforcement — scripts/check-docs.sh (index consistency, test-name existence, exported-symbol naming, required sections incl. variants read from the template, ADR integrity, canonical-copy drift), a docs-governance CI job, a PR template, and one-line tool pointer files (CLAUDE.md etc. → AGENTS.md).

Notes

  • Docs-only campaign; the standard trio still runs on every PR.
  • The ADR trigger list deliberately excludes bug fixes, test additions, and internal refactors — bureaucracy resistance is a design goal.
  • Check 3 (exported-symbol naming) is a floor check: it enforces naming, review keeps enforcing quality. No LLM in CI, by design.

Activity

  1. Coldwings commented on Aug 31, 2026

    @Coldwings
    CollaboratorAuthor

    All four PRs are merged and main's CI (including the new docs governance job) is green. Closing out the campaign.

    What landed

    PR Merged Content
    #65 095cbc5 ADR system: two-layer model (package docs = current law, docs/adr/ = frozen case law), T1–T5 triggers, proposed→accepted→superseded lifecycle, plus backfilled ADR-0001 (minimalist assumptions as contract, #22/#28), ADR-0002 (visible-ASCII member IDs, #21/#44), ADR-0003 (shutdown safe-join, #45/#48) — each with rejected alternatives and Binds audit lists
    #66 1921574 Canonical sourcing: CANONICAL/CANONICAL-COPY marker convention; verify-trio canonically in AGENTS.md (marked copies in CONTRIBUTING.md and docs/README.md); wire-protocol rules canonically in hashring.md §6 / chunk.md §6 (marked copies in AGENTS.md); "Authority and canonical sources" precedence clause
    #67 e22993e Template conformance + sanctioned shapes: registry.md gained Concurrency & Call Permissions + Stability Contract; tracker.md gained Invariants & Guarantees (+ a dangling-reference fix); dart.md gained Concurrency/Stability subsections; DOC-SHAPES machine-readable block (package/cmd/multi shapes + heading aliases); all exported symbols now named in their package docs (verified by go doc -all sweep)
    #68 fbe6917 Enforcement: scripts/check-docs.sh (6 hard-fail floor checks: index↔files, test-name existence, exported-symbol naming, required sections parsed from DOC-SHAPES, ADR integrity, canonical-copy lockstep; + soft link warning), docs-governance CI job, PR template with ADR checklist line, CLAUDE.md/.cursorrules pointers to AGENTS.md

    Findings A–E — status

    Honest residual limits

  2. Coldwings commented on Aug 31, 2026

    @Coldwings
    CollaboratorAuthor

    Campaign complete: all four PRs merged, main CI green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions