Skip to content

Variance declarations + a compliance self-check (repokit lint) #16

Description

@PBNZ

Retrospective finding — refs #10.

Context

Repos drift from the standard file set silently, and each deviation is discoverable only by
reading that repo end-to-end — or not at all. Observed (anonymised):

  • Canonical agent file present, loader shim missing — the file the tooling reads doesn't
    exist, so the canonical one may never load.
  • ADR directory absent, replaced by a root-level decisions file — the substitution is only
    partially documented (one aspect of the deviation recorded, the rest not).
  • Changelog living at a nested path that the repo's own agent file never names.
  • One repo replaces the checkpoint with a README-status contract — documented and honoured. This
    is the good case, and it proves variants are fine when declared.
  • Retro-adopted repos snap to clean conventions at the adoption commit, but nothing marks the
    pre-standard history as exempt, so any future audit re-flags it forever.

The standard tolerates variants by design (ceremony scales by tier); what's missing is the rule
that a variant must be declared, and a cheap machine check that the declared structure
actually exists.

Proposal

  1. Variance-declaration rule: any deviation from the tier's file set (substitute file,
    relocated file, omitted component) must have a row in the START-HERE map saying what replaces
    what. Undeclared deviation = non-compliance; declared deviation = a variant.
  2. Self-check script (scripts/ + optional CI), checking mechanically:
    • canonical agent file + thin shim both present, shim actually imports the canonical file;
    • every START-HERE row's path resolves to an existing file/dir;
    • changelog exists at the declared location;
    • ADR dir (or declared substitute) exists;
    • resume-state artifact (or declared substitute) exists — ties into the resume-state issue.
  3. Adoption marker: a one-line convention for retro-adopted repos (e.g. noted in the agent
    file or the adoption commit) defining the compliance horizon, so audits stop re-flagging
    pre-standard history.

Tasks

  • Add the variance-declaration rule to the standard's core doc.
  • Implement the self-check script; ship as part of the scaffold, retrofittable.
  • Document the adoption-marker convention.

Acceptance criteria

  • Every deviation in a compliant repo is visible from the START-HERE map alone.
  • The self-check passes on a fresh scaffold, fails on each of the drift cases above, and runs in
    seconds locally.

— 🤖 Claude, on behalf of @PBNZ

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions