Repository navigation
feat: lint anchor_drift and anchor_missing from code drift (#147) - #159
Conversation
f7c5948 to
f221569
Compare
uf-divisor
left a comment
There was a problem hiding this comment.
Review Verdict: REQUEST CHANGES
1 HIGH finding blocks this PR. The implementation is solid — the anchor-check logic is well-tested, fail-closed against untrusted input, and both CI checks pass — but the website documentation sync gate (AGENTS.md, Website Documentation Sync) has no tracking issue for this user-facing change.
Summary
Two deterministic lint checks (anchor_missing, anchor_drift) detect staleness of as_of-pinned learnings from code drift via local git, with a fix mode that marks drifted learnings validity: stale-unverified in both the store and the markdown backup. 23 findings from 5 reviewer personas, deduplicated to 18 distinct issues: 1 HIGH, 7 MEDIUM, 10 LOW; no CRITICAL.
Dispatch Provenance
| Run | Agent | Source | Model | Verdict |
|---|---|---|---|---|
| aca2808f | adversary | advisor | enmaas/rits/zai-org/glm-5-3 | APPROVE WITH ADVISORIES |
| 4ddf08d0 | architect | advisor | enmaas/rits/zai-org/glm-5-3 | APPROVE WITH ADVISORIES |
| df372e44 | curator | advisor | enmaas/rits/zai-org/glm-5-3 | REQUEST CHANGES |
| f360c7f3 | guard | advisor | enmaas/rits/zai-org/glm-5-3 | APPROVE WITH ADVISORIES |
| 24077c38 | testing | advisor | enmaas/rits/zai-org/glm-5-3 | APPROVE WITH ADVISORIES |
Correlation ID: 4989a387-0fd7-41d1-ba89-883665459ed9 · CI: build-and-test PASS, MegaLinter PASS
Findings not attached to a diff line
- [MEDIUM] AGENTS.md not updated (architect, curator): the CLI table row for
dewey lintand the Recent Changes section do not mention the anchor checks. AGENTS.md is outside this PR's diff, so this lands as a follow-up commit on this branch. - [LOW] README MCP tools table row for
lint(curator): the tool summary (README.md:130) does not list the new finding types. The line falls outside this PR's hunks; update alongside the AGENTS.md follow-up. - [LOW] Corrupt-properties skip in the check path untested (testing): a learning whose properties fail to parse is silently skipped by
learningAnchors(lint_anchors.go:128); no test covers that skip.
Resolution notes
The HIGH finding resolves by filing docs: sync dewey lint anchor checks documentation in unbound-force/website (docs label), covering the new finding types, skip conditions, fix semantics, and summary counters, referencing content/docs/projects/dewey.md and cross-linking website#380 — the same gate #156 satisfied via website#380.
This review was generated by /uf.review-pr (AI-assisted).
f0ea80c to
198cfcf
Compare
uf-divisor
left a comment
There was a problem hiding this comment.
Review Verdict: APPROVE WITH ADVISORIES
No blocking findings. The prior round's HIGH (website docs sync) is resolved — website#398 (docs) and website#399 (blog) are filed, and commits 23748af + 198cfcf address the earlier findings (anchor_checks outcome, context threading with a 60s pass budget, --no-ext-diff --no-textconv, other-repo pin skip, fix counting store writes with anchor_fix_warnings, shared updateLearningBackup/decodeLearningProperties). Both CI checks pass on the head. This review supersedes the earlier CHANGES_REQUESTED review, which was rendered against the pre-fix commit f221569. 13 findings from 5 reviewer personas, deduplicated to 11 distinct issues: 2 MEDIUM, 9 LOW; no CRITICAL or HIGH.
Summary
Two deterministic lint checks (anchor_missing, anchor_drift) detect staleness of as_of-pinned learnings from local git code drift, with a fail-closed fix that marks drifted learnings validity: stale-unverified in the store and markdown backup without touching tiers. The implementation re-validates evidence limits at the consumption site, threads the request context with per-call (5s) and per-pass (60s) budgets, disables repository-configured diff drivers, and reports every pass outcome as anchor_checks so a skipped pass is never read as clean.
Dispatch Provenance
| Run | Agent | Source | Model | Verdict |
|---|---|---|---|---|
| 6c131429 | adversary | advisor | enmaas/rits/zai-org/glm-5-3 | APPROVE WITH ADVISORIES |
| 41833e2b | architect | advisor | enmaas/rits/zai-org/glm-5-3 | APPROVE WITH ADVISORIES |
| f0c8aa65 | curator | advisor | enmaas/rits/zai-org/glm-5-3 | APPROVE WITH ADVISORIES |
| 81429189 | guard | advisor | enmaas/rits/zai-org/glm-5-3 | APPROVE WITH ADVISORIES |
| 94c86258 | testing | advisor | enmaas/rits/zai-org/glm-5-3 | APPROVE WITH ADVISORIES |
Correlation ID: 809dbb52-8b63-4481-b8de-b530c51fec68 · CI: build-and-test PASS, MegaLinter PASS
Findings not attached to a diff line
- [MEDIUM] lint registry Description and Fix schema stale (companion to the first inline finding): server.go:518 still enumerates only the four original check kinds, and
LintInput.Fix's jsonschema (types/tools.go:340) still says "Auto-repair mechanical issues (missing embeddings)" — both files are outside this PR's diff, so the fix lands as a follow-up commit on this branch.
Resolution notes
The two MEDIUM advisories are a documentation-surface update (server.go Description, Lint GoDoc, Fix jsonschema) and a one-line test-fixture correction; neither blocks merge. The LOW advisories are optional hardening and coverage improvements.
This review was generated by /uf.review-pr (AI-assisted).
|
Review-body findings (not attached to a diff line), all addressed:
Website tracking: docs website#398, blog website#399. |
|
Round-2 review-body finding [MEDIUM] lint registry Description and Fix schema stale: fixed in 6920165, with server.go's |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…orce#147) For learnings pinned with as_of, lint checks each <repo>:<path> evidence locator for the vault's repository against local git: anchor_missing when the path is absent at the pin (or the pin is unknown), anchor_drift when it changed between the pin and HEAD. fix marks drifted learnings validity: stale-unverified; tiers are never changed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
) Port the unbound-force#156 review-council hardening to lint: markStaleUnverified validates the identity with ValidLearningIdentity and decodes properties before writing, so an unsafe identity or unreadable properties fails closed and a JSON null no longer panics. Only hexadecimal as_of pins reach git as a revision. Git subprocess tests are skipped in short mode. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Report every pass as anchor_checks {status, reason}: checked,
skipped (no vault path, not a git repository), or failed (git
error, cancelled request, budget exhausted), so MCP clients can
tell a clean pass from one that never ran.
- Thread the request context through the checker, bound the whole
pass (60s) as well as each git call (5s, now including HEAD), and
re-check store_learning's evidence limits where evidence is read.
- Skip learnings pinned to another repository: the pin's repo must
be the vault's own, not just match its evidence.
- Pass --no-ext-diff --no-textconv to git diff.
- Count a fix once the store write succeeds and report backup
failures in anchor_fix_warnings.
- Share the backup write (updateLearningBackup) and properties
decoder (decodeLearningProperties) with the unbound-force#146 supersession flow.
- Tests: multi-anchor dedup, two-path unknown pin, anchor_missing-only
fix negative, deleted-after-pin, corrupt properties, other-repo
pins, evidence limits, post-failure store and file state,
cancellation, repository diff drivers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Spec and design state the eligibility rule (pin to the vault's own repository, at least one path anchor), the evidence limits, the pass budget, anchor_checks, and the fix warning contract. README MCP tools table and lint section, AGENTS.md CLI table and Recent Changes. Website tracking: docs website#398, blog website#399. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- lint's tool description, Lint GoDoc, and fix schema describe the anchor checks and what fix does to validity - PathChanged passes a literal pathspec, so glob characters or pathspec magic in a file name match only that file - per-call and per-pass bounds are fields so tests can expire them; gitOutput shares the anchor checker's git runner - updateLearningProperties re-reads and rewrites stored properties under one lock, used by fix and the supersession link; fix leaves a learning superseded mid-pass unchanged - tests: escape canary at the real target, path dedup, at-limit evidence, both time bounds, glob-named file, warning attribution, concurrent fix and supersede Co-Authored-By: Claude Opus 5.5 <[email protected]>
Spec, design, proposal, tasks, and README cover literal path comparison, at-limit evidence, the locked properties rewrite, and the tutorial issue website#402. Co-Authored-By: Claude Opus 5.5 <[email protected]>
f949752 to
54642ce
Compare
Closes #147. Part of #153.
Summary
lintgains two deterministic checks that detect staleness from code drift rather than age. They apply to learnings pinned withas_of(added in #146) whose evidence cites<repo>:<path>for the vault's own repository:anchor_missing: the path doesn't exist at theas_ofcommit, or that commit isn't in the repository. An unknown pin produces one finding per learning.anchor_drift: the path changed between the pin andHEAD. Deletion counts as a change.lintwithfix: truemarks drifted learningsvalidity: stale-unverifiedin the store and in their markdown frontmatter. Tiers and content are never changed. The result reportsfixed.anchor_drift. Summary countersanchor_drift/anchor_missingappear only when they're non-zero, so the existing summary shape is unchanged.Only local
gitruns, behind ananchorCheckerinterface with a 5 s timeout per call. The checks are skipped when there's no vault path or the vault isn't a git repo.Not checked:
<repo>#<n>locators: resolving them needs the network, and the constitution requires local-only processing by default.as_of, and learnings markedsupersededorhistorical.A trailing
:<line>[-<line>]suffix on a locator is stripped. The 30-daystale_decisioncheck is unchanged and stays as a secondary signal.Hardening carried over from the #156 council findings:
fixchecks the identity withValidLearningIdentityand decodes properties before writing anything. An unsafe identity or unreadable properties is an error, and the store and markdown file stay as they were. A literal JSONnullno longer panics.as_ofpins reach git as a revision.as_ofcan come from re-ingested frontmatter, so a value like--output=xis skipped rather than treated as a pin.Spec:
openspec/changes/lint-anchor-drift/.Tests
tools/lint_anchors_test.go, using a real temporary git repository:historical/supersededlearnings and unpinned learnings are all skipped;fixfails closed on corrupt properties and unsafe identities, and handlesnulland empty properties;Verification (CI parity)
go build ./...,go vet ./...,gofmt: cleango test -race -count=1 -coverprofile=coverage.out ./...: all passgolangci-lint: no findings in changed filesBefore ready
/uf.review-council(OpenCode)🤖 Generated with Claude Code