Repository navigation
feat: git is the source of record for page trust tiers (#203) - #208
Merged
jflowers merged 2 commits intoNov 15, 2026
Conversation
…#203) Trust tiers for compiled/ and knowledge/ pages now derive from git at every index: validated requires a canonical tier: validated frontmatter claim AND file-blob equality with the locally fetched <remote>/<default-branch> ref (new gitref/ package, offline resolution, one ref resolution + one batch ls-tree per run). Lowering (tier: draft or validity stale-unverified/superseded/historical) is honored from anywhere and outranks the grant; learnings clamp to draft on every route; a missing ref or non-git vault withholds the grant fail-safe (fixes unbound-force#204 — regenerated articles read as draft until merged). promote is now a frontmatter file edit on the current branch (transactional, path/symlink-validated, compiled/ + knowledge/ only) — the PR diff is the promotion artifact, the merge is the vouch, and the DB tier is a cache recomputed on the next index; two servers with the same fetched ref converge on the same tiers. The v1→v2 migration no longer resets compiled pages to draft; PromotePagesTiers removed. dewey doctor gained a Trust Tiers section (ref resolution with fix hints, differing files) and dewey status reports the trust object. vault.DeriveEffectiveTier is the pure decision function; vault.TierBlobResolver is the optional nil-safe seam wired at every ingestion route.
jflowers
force-pushed
the
opsx/git-is-the-source-of-record-for-page-trust-tiers
branch
from
November 14, 2026 23:05
889e62e to
27eb04c
Compare
jflowers
enabled auto-merge (rebase)
November 14, 2026 23:08
Decompose indexSourceDocuments (complexity 25, CRAP 63.5) into focused helpers — computeSourceStats, indexSourceDocument, scanSourceDocument, rejectedByStrictMode, mergeSanitizeFindings, buildSourcePropsJSON, upsertSourcePage — dropping every piece under the CRAP threshold (max 8.2). Behavior is unchanged: statements, log messages, error strings, and control-flow outcomes (strict-reject skip, soft upsert skip, hard persist errors) are preserved verbatim. Add three tests covering the previously uncovered sanitize wiring on the source-indexing path (warn-mode finding merge, strict-mode rejection, document-properties fallback), which also raises the vault package coverage from 84.5% to 86.0%. Local CI-equivalent verification: go build, go vet, go test -race -count=1 all pass; gaze gate CRAPload 47/48 PASS (was 48/48 borderline locally, 49/48 FAIL in CI), GazeCRAPload 5/45 PASS locally (vault cognitive complexity total reduced 6059 -> 6038, so the fully computed CI GazeCRAPload cannot regress).
uf-divisor
approved these changes
Nov 15, 2026
uf-divisor
left a comment
There was a problem hiding this comment.
Council Review: APPROVE
4 of 5 dispatched reviewers returned APPROVE with zero findings against the 8,100-line diff (40 files) at head 74964a0b. The fifth reviewer (divisor-curator) failed on an infrastructure timeout after two bounded recovery attempts; it reported no findings or proposals before failing, and the documentation surface it covers is carried by the in-PR OpenSpec artifacts and the AGENTS.md/README.md updates.
Reviewer Verdicts
| Reviewer | Verdict | Findings |
|---|---|---|
| divisor-adversary (security) | APPROVE | 0 |
| divisor-architect (structure) | APPROVE | 0 |
| divisor-guard (intent/constitution) | APPROVE | 0 |
| divisor-testing (test quality) | APPROVE | 0 |
| divisor-curator (docs) | FAILED — infra timeout | 0 |
What was reviewed
- CI: build-and-test and MegaLinter pass on the head commit.
- Trust-tier derivation: the new
gitref/package resolves<remote>/<default-branch>offline with flag-injection guards and derivesvalidatedfrom a canonicaltier: validatedfrontmatter claim plus file-blob equality; lowering is honored everywhere and learnings clamp to draft (GTS-FR-001..005). - Ingestion pipeline: tier derivation runs at every ingestion route with batch ls-tree blob mapping; the v1→v2 migration no longer resets compiled pages to draft (IP-FR-001..004).
- Promotion workflow:
promoteperforms a transactional frontmatter file edit with vault-containment, symlink, and TOCTOU guards, and writes no DB tier (PW-FR-001..004). - Acceptance criteria: issue #203's six acceptance cases and #204's three cases raised no findings.
This review was generated by /uf.review-pr (AI-assisted).
jflowers
deleted the
opsx/git-is-the-source-of-record-for-page-trust-tiers
branch
November 15, 2026 20:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Git is the source of record for page trust tiers (dewey #203, part of epic #153 Phase 5; fixes #204 as a documented side effect).
Trust tiers for
compiled/andknowledge/pages now derive from git at every index instead of a per-server database value:validatedrequires a canonicaltier: validatedfrontmatter claim AND file-blob equality with the locally fetched<remote>/<default-branch>ref (new offlinegitref/package — one precedence chain for ref config, flag-injection-guarded git plumbing, one batchls-treeper index run, pure-Go blob hashing). Lowering (tier: draftorvalidityinstale-unverified/superseded/historical) is honored from anywhere and outranks the grant; learnings clamp todrafton every route; a missing ref or non-git vault withholdsvalidatedfail-safe.promotebecame a transactional frontmatter file edit on the current branch (path/symlink-validated, atomic, all-or-nothing batch) — the PR diff is the promotion artifact, the merge is the vouch, and the DB tier is a cache recomputed at the next index. Two servers with the same fetched ref converge on the same tiers.The v1→v2 migration no longer resets compiled pages to
draft.dewey doctorgained a Trust Tiers section (ref resolution with fix hints, per-file blob comparison) anddewey statusreports a trust object (text + JSON). Docs updated (README, AGENTS.md); website sync issue filed: unbound-force/website#414.Closes #203
Fixes #204 as side effect — regenerated articles read as
draftuntil merged.How to Test
CI parity — all green on
27eb04c(rebased):Focused trust-tier suites:
End-to-end acceptance (six scenarios, all covered by tests):
Diagnostics in a real vault:
Promote round-trip:
dewey promote --vault <vault> compiled/<tag>edits the file's frontmatter on the current branch (DB tier untouched);dewey indexre-derives; tier settles atvalidatedonly after the PR merges and the ref is fetched.Test results:
go test -race -v -count=1 ./...— all 18 packages ok, 1940 test functions pass, 0 failures (60+ new tests acrossgitref,vault,tools, root).go vetclean,gofmtclean. Gaze: CRAPload 48/48 PASS, GazeCRAPload 5/45 PASS. Review council: 5/5 APPROVE, 0 findings (e94f732f-12dd-46b3-a521-963b79ea736b). Spec review: APPROVE iteration 3 (e4727e7c-cfa4-4287-a75b-4a1d10706aae).How to Demo
upstream/main:dewey status --json --vault <vault>— observetrustobject: ref, resolution status, sha, counts.dewey doctor --vault <vault>— Trust Tiers section with ref status and fix hints;-vlists differing files.dewey promote --vault <vault> compiled/<tag>(orknowledge/<store>/<page>) edits frontmatter on the current branch; verify file diff; rundewey index; tier remainsdraftuntil PR merges and ref is fetched, then re-index showsvalidated.validatedpage totier: draftorvalidity: stale-unverified— re-index shows it honored even if blob still matches.validated(all trust tiers downgrade todraftfail-safe).Trivial fix — no demo required outside the above.
Key Files Changed
40 files, +6822/−440 (commit
889e62e):gitref/(new package) — offline default-branch ref resolution (precedence: vault config → global config →DEWEY_DEFAULT_BRANCH_REF→ git configdewey.defaultBranchRef→origin/main), flag-injection guards, batchls-tree, pure-Go blob hashing (blobs.go,gitref.go,validate.go)vault/tier.go+vault/tier_wiring_test.go—DeriveEffectiveTierpure decision function,TierBlobResolverseam wired at every ingestion routevault/vault.go,vault/index_documents.go,vault/vault_store.go— integrate tier derivation at scan, source indexing, re-ingestiontools/promote.go+tools/promote_file.go— transactional frontmatter file edit (path/symlink-validated, atomic, batch all-or-nothing),compiled/+knowledge/onlystore/migrate.go,store/store.go— v1→v2 no longer resets compiled pages;PromotePagesTiersremovedcli.go,main.go,gate.go—dewey doctorTrust Tiers section,dewey statustrust object,promotewiringREADME.md,AGENTS.md— trust-tier docs,gitref/architecture, doctor/status docsopenspec/changes/git-is-the-source-of-record-for-page-trust-tiers/— proposal, design, specs (git-trust-source,ingest-pipeline,promotion-workflow), tasks;design.mdandspecs/git-trust-sourceinclude full rationale and six acceptance scenariosFull diff: 220 files changed, +37710/−3017 vs merge-base
1f26d82(includes priorexplicit-supersession-in-compilehistory accumulated on the branch).Known Issues
None. Review council: 5/5 APPROVE, 0 findings (Adversary/heavy, Architect, Curator, Guard, Testing). Spec review: APPROVE iteration 3. Gaze gates pass. Pre-existing lint only (SSA warnings, SA1019/QF in untouched files, verified at merge-base).
This PR was generated by /uf.finale (AI-assisted).