gunk-dev/the-valley
the-valley:oc-ca0a8c1outcomeopen

The host admits reviews under a grant scoped by project and review name

State
free to start
Created
2026-10-20 by contributor
Source
2026-10-20, split after brief critiques
Blocked by

Body

Split (2026-10-20 critique): the review grant scoped by project and review name across the identity schema, compiler, declared host options and hook; review-only credentials (restricted admission) or an explicit deferral; withdrawal authorisation defined; the hook validates appends with the record library's validator. Critique in comments.

Comments

  1. contributor2026-10-20 12:04 UTC
    Critique of the first review-records brief (Codex, 2026-10-20):
    
    The slice establishes durable, authenticated feedback before adding policy enforcement. Reusing the existing record and hook patterns gives it a credible implementation path.
    
    Project scope is missing. Both oc-b670b6c and the design comments require grants scoped by project and review name; the brief specifies only review name. Existing grants collapse to boundary kinds (identity/render.go:165), and the hook reads two-field, host-wide grants (valleyhook/grants.go:23). Fix: specify project/name scope across schema, compiler, declared options and hook, with cross-project refusal tests.
    
    The referenced design also requires review-only credentials. Copying restack requires git-push admission, which permits topic writes and change creation (identity/render.go:106; valleyhook/policy.go:140; valleyhook/record.go:200). Fix: include restricted admission and adversarial non-review pushes, or explicitly defer that design requirement and avoid claiming reviewer containment.
    
    Withdrawal authorization contradicts itself: every append requires review authority, withdrawal allows a request holder, and the final sentence says request grants nothing. Fix: define withdrawal as an explicit exception, state whether the original reviewer needs a current grant, and test both authorized withdrawal paths plus wrong-reviewer refusal.
    
    Delta binding lacks reproducible inputs. Versions store no base (change/record.go:109); the existing comparison freezes a target tip and computes a unique merge base (status/compare.go:32). Fix: record the target tip/base, define ambiguous-base behavior, and explicitly require the hook to recompute the digest and reject mismatches.
    
    Calling delta.Between directly would introduce unbounded object reads into admission: it reads both trees and allocates from object sizes without a context or size budget (delta/tree.go:45, 93, 140). The JSON’s 64 KiB cap does not address this. Fix: require bounded traversal, bytes and execution time, with hostile-object tests.
    
    The append contract omits retention and authenticated-history linkage. Copying report.go’s sole-parent layout would leave referenced change records unretained after their permitted deletion (valleyhook/record.go:194). Merely parsing a supplied record commit also does not prove the hook admitted it. Fix: specify validated retention parents, membership in accepted change history, unique review IDs, and withdrawal lookup within that history.
    
    The new package needs explicit build wiring. valleyhook’s Nix source includes only note, change and knot (nix/packages.nix:285); valleyhook-unit does not run dependency packages’ tests. Fix: add local-module dependencies and source closure, plus a dedicated review test derivation/check. Existing protect-e2e has no Go compiler if fixtures need a helper; package that helper separately.
    
    The documentation deliverable omits AGENTS.md’s required claim-to-code checklist and claim classifications. Fix: require both in the brief/change description, with verified HEAD citations outside the docs.
    
    With scoped authority, restricted admission and bounded validation included, this is too large for one reliable agent run. The single most useful change is to split at a fully specified record/storage contract with parser and binding tests; implement schema/compiler/host/hook admission in the next slice against that fixed contract.