Skip to content

feat: git is the source of record for page trust tiers #203

Closed

Description

@jflowers

Part of #153. Replaces the promotion-manifest approach that #193 and #194 originally described.

Problem

Each teammate runs their own Dewey MCP server. Today the trust tier lives only in that server's local database:

Result, measured on unbound-force main on 2026-11-13: 38 of 39 compiled articles say tier: validated in git (reviewed 2026-10-25), and every Dewey server that ingests them shows them as draft. No learning has ever been promoted.

Rule

Git is the source of record, and the default branch's protection is the trust boundary.

  1. A merged, human-approved PR is the vouch. A compiled or curated page is validated only when its file says tier: validated and the file's blob equals the blob at <remote>/<default-branch> (fetched ref). Every server derives this locally from git, offline; no shared service.
  2. Raising trust comes only from the default branch. A working-tree edit, an unmerged branch, or a stale fetch never raises a tier. When a file differs from the default-branch blob, it reads as draft.
  3. Lowering trust comes from anywhere. stale, superseded, and validity fields lower trust only, so they're honored from any file, branch or local edit (fail-safe).
  4. promote becomes a file edit. It sets tier: validated in the page's frontmatter on a branch, for a PR. It no longer writes the database's tier directly. The database tier becomes a cache of rule 1.
  5. Learnings stay draft forever. At about 500 new learnings a week, per-learning review isn't feasible. Humans vouch for compiled articles; learnings are raw material that compile cites.
  6. Not a git repo, or no default-branch ref: everything reads as draft, as it does today.

The enforcement half lives in each knowledge repo: CODEOWNERS plus required code-owner review on the page paths (#194). Consumer: #193 (unattended distill). Without it, a bot approval plus auto-merge could promote.

Notes

  • This fixes fix: regenerated compiled article keeps the validated tier of the content it replaced #204 as a side effect: a regenerated article's blob no longer matches the merged one, so it reads as draft until a human merges it.
  • Remove or invert the compiled-page backfill in store/migrate.go; remove the "ignoring non-draft tier" special case for compiled pages (keep it for learnings, per rule 5).
  • Cost: one git cat-file/ls-tree per indexed page at ingest, or one ls-tree -r per source per index run.

Acceptance

Tests for each case:

  • Validated file identical to the default branch: validated.
  • Same file, modified in the working tree or only on a branch: draft.
  • validated on the default branch but stale in the working tree: stale (lowering is honored).
  • Learning file claiming validated, even on the default branch: draft.
  • Two servers with different local databases, same fetched default branch: same tiers.
  • promote changes the file, not the database tier, and a branch-only promotion stays draft.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions