Repository navigation
feat(git): govern every push and read from a formal model down - #9873
Draft
tlongwell-block wants to merge 45 commits into
Draft
tlongwell-block wants to merge 45 commits into
tlongwell-block wants to merge 45 commits into
Conversation
A community floor no repo can weaken, repo rules, labels and a bind on top of it, signed evidence, and one land that decides every push against current authority in a single Postgres transaction under the repository's row, then leaves a receipt. It implements the contract in VISION_GOVERNANCE.md. The model comes first. docs/spec/GitGovernance.tla states governance as an Allowed predicate over GitRefDB's atomic push. GitGovernanceLand.tla is the row protocol that lands it and refines both models. check.sh runs in the Spec workflow, and every seeded design error must be caught. decide() in buzz-git-gate is the land's gate, and Verus proves it equal to its property (just verify-git-gate, a CI step that fails when nothing was verified). buzz-conformance's git_land checker replays traces from the real land against the protocol. An agent's Git authority is the NIP-OA auth tag it carries, signed by its owner, scoped to one repository or all of them, at read, push or manage level, and bounded in time. The relay judges the tag on every request through one seam, the hook refuses an agent's push without a grant to push, and the land binds the owner, window and floor cap. The swap happens only before the grant's end. The transaction may commit just after it, and a ban is fenced through commit. There is no revoke record: an admin bans the agent's key to stop a grant early. A repository is governed once its community has a floor or the repo has a rules, labels or bind document. Every door that shows a governed repo authorizes the reader, picks what it will show, records an audit row naming the reader and door, and then serves exactly that pick. A refused read records nothing, and a failed record refuses the read. Community documents are readable by every key they govern. A DM is not a place in the community. A push that brings a detected secret is refused and receipted, and nothing it brought is served. A refusal reaches git in its own status report. A new relay adopts an ungoverned push from a relay without the land only when that relay built on the current row. Otherwise it refuses with 409. The CLI adds buzz gov floor|trusted, and buzz repos rules|labels| effective|receipts|bind|grant. Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Co-authored-by: Wren <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@buzz.block.builderlab.xyz> Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Sami <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Two external_infra tests ran git commit-tree under harden_git_env, which clears HOME and global config, without naming a committer. Git falls back to guessing one from the host, which works on a laptop and fails on a CI runner with "Author identity unknown". Pass user.name and user.email the way the neighbouring tests already do. Reproduced with user.useConfigOnly=true: both tests fail before this change and all 18 external_infra tests pass after it. Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
tlongwell-block
force-pushed
the
eva/git-governance-squash
branch
from
November 23, 2026 04:43
3ac62f5 to
5a7b5dc
Compare
…uash * origin/main: Offer image and animated avatars for human profiles (#9724) feat(mobile): add people and agents to a DM (#9153) test(ios): check the navigation glass state often instead of once a second (#9786) Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The same lockfile change as #9877, so this branch's Security job passes. It becomes a no-op once that lands on main. Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…is greater An agent in the repo's channel acts on its own channel role with no grant and no cap from its owner's role. An agent outside it acts through a live grant from its owner, at the grant's level capped by the owner's role. An owner who is not admitted takes both routes away. KeyFacts.granted becomes KeyFacts.grant, the role a grant's level names. Who::UnownedAgent goes: the relay never builds it, and a key without a recorded owner is credited its own role like a person. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
… a grant A member agent acts on its own channel role and needs no grant. A grant lends an agent outside the channel its owner's access, at the grant's level and never beyond the owner's current role. A grant only adds a way in; neither route, no access. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Perci <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Perci <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A key acts with its own channel role; an owned agent may also act under a live grant at min(level, owner's role), taking the higher route. An owner ban ends both. A grant never makes an agent a channel admin. check.sh seeds grant-uncapped, grant-any-repo, grant-level-ignored, owner-ban-ignored and grant-admins-channel, and shows a member agent landing without a grant and a grant-only agent landing. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz>
Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Principal and Person returned None for such an agent, so its receipt named no one; the relay treats it as a person (Who::Person). TypeOK now requires every receipt to name a key, which fails at the parent, and the seeded unowned-agent-unattributed splits the evaluator from the property again. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz>
A mutation sweep of the evaluator found five over-strict changes no check saw: a grant narrowing a member agent, an owner leaving the channel stripping its member agent, an unowned agent credited nothing, an owner ban not reaching channel admin, and a grant-only agent unable to read. Each now fails a check: four new coverage properties, and the owner-ban one is caught by RoleChangesByCurrentAuthority. The authority scenario lets an admin make g a channel admin. Picking the highest of several grants is left unguarded, since the relay sees one tag per request. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz>
* origin/main: (26 commits) chore(deletion): accept the search outbox and backfill tables before they exist (#9871) fix(mobile): apply message edits only from authorized authors (#9887) fix(mobile): name blocked agents clearly, let owners remove their agent from a DM (#9921) fix(mobile): Android push follow-ups from enrollment review (#9892) feat(mobile): handle Android push wakes (#9804) perf(mobile): keep large images in the disk cache (#9906) feat(mobile): resolve push wakes into notifications in Dart (#9558) perf(relay): bound channel- and thread-window aux hops to a day before the oldest target (#9874) Refine mobile Messages sections, Duo navigation, and chat typography (#9885) fix(mobile): keep a legacy chat color when Set changes only the mode (#9898) feat(mobile): time channel opens and relay connection recovery (#9858) Give mobile Solo sessions their own settings and actions (#9888) feat(mobile): name blocking agents, leave agents out of DM names (#9875) refactor(mobile): remove the dead per-signer cache sweep (#9902) refactor(mobile): remove unused CommunityListNotifier.addCommunity (#9896) fix(mobile): keep Light/Dark/System on each device (#9894) Cache recently opened mobile thread replies (#9844) fix(mobile): align the New menu with desktop (#9883) fix(deps): bump url to 2.5.9 for RUSTSEC-2026-0592 (#9877) Remember collapsed sidebar sections on mobile (#9879) ... Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Brings in #9838 (OpenSearch outbox), which ships migrations/0106_search_outbox.sql. This branch's migrations have never been deployed, so they move up past it: 0106_governance_audit_indexes -> 0107, 0107_git_repo_authority -> 0108. Conflicts resolved: migration count/version asserts (108, search_outbox at index 105), the buzz-db store module list (both sides), and Cargo.lock (regenerated from main's lockfile plus this branch's dependencies). Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz>
…greSQL The ignore reason named Postgres and S3, so PostgreSQL test discovery counted it as a Postgres test that needs infrastructure beyond PostgreSQL/Redis. Use the reason string the sibling e2e_git tests use. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz>
Share Git admission across the HTTP read door, governance queries and lands. Pass the relay membership policy through advertisements, fetches and settings. Read-door facts avoid roster row locks; existing land locks are unchanged. Cover nonmember and removed owners, open relays, owner admission, and a concurrent roster writer. The admission regression fails with baseline code. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Ignore repository grants when checking the destination channel's admin role. Keep delegated administration for the source channel and retain its expiry. Cover scoped and wildcard destination grants, delegated source with direct destination consent, and expired grants alongside independent membership. The regression fails before the fix and after reverting the destination guard. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Use the Git request first-owner path before accepting signed governance commands or evidence. Refuse conflicting owners and unavailable writes. Validate the signed community before any owner-link side effect. Cover first OA approval before a Git request, replay, owner-switch refusal, and cross-community evidence leaving the receiving community unchanged. The owner-persistence regression fails with the original handler restored. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Document that a verified first owner survives a later command or evidence refusal, after validating the signed community, matching the Git door. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…approvals Three seeds, each the drift its code fix removes: - read-skips-owner-admission: the read door credits an agent's role without its owner's admission (ReadsAreGovernedAndRecorded). - bind-dest-by-grant: a manage grant from a destination admin stands in for the actor's own admin role there (GovernanceByCurrentAuthority). - evidence-drops-owner: an approval's attestation records no owner, so an agent fills a human slot (LandsUnderCurrentAuthority). The evaluator now knows an agent only by its recorded owner, as the relay does: HumanSlot asks for no recorded owner, and an approval that carries an attestation records it first-mint, under Register's fence. The properties keep the true People set. The assumption that every agent's approval carries its attestation is stated at HumanSlot and asserted in MCGitGovernance; scenario attest exercises it. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…onsent, attested approvals Three journeys against a members-only relay, each with a control: - a member agent clones while its owner is admitted, and is refused once only its owner's admission is missing; - a manage grant whose owner admins the destination cannot rebind there; the agent as direct destination admin can; - an agent's approval carrying its owner tag (its first) does not fill a person review slot; a person's approval does. At 001dafc the three refusals fail and the three controls pass. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The secret scan reads an object in 1 MiB windows and matched each window as if its edges were the object's. A word-bounded pattern could then match a longer, harmless token wherever a window edge cut it, and refuse the push. A match that ends at a cut now waits for the next window, which carries it whole, and a carried tail keeps one byte of left context. The fix refuses no fewer secrets: a real one at the same place is still found. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Classifying a push's ref updates awaited git merge-base with no deadline, after receive-pack's bound and before the scan's, so a stalled Git could hold the push's workspace and leases forever. The checks now share one 300 s bound. A check that does not answer in time is a no, which classifies the update as a rewrite and can only make the decision stricter. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
On a members-only relay, /query admits a governance read through a Git grant's owner, but /events admitted the matching command or evidence only through generic membership. An agent whose admission came from its grant's owner could read a document and could not change it, although the handler would have accepted the grant. Both governance kinds now take the Git door's admission. Every other kind keeps generic admission, and the handler still judges the grant. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
repos bind on a bound repository printed the governed move and then the announcement republish as two JSON results, and exited with an error when the republish failed after the move had committed. The move is now the one result. A republish that fails after it is a warning on stderr, since the binding has already moved. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A Git grant's level is required, never defaulted. The owner and grant docs say what an unverifiable tag and a plain tag beside a token do. The grant duration example is one the command accepts. repos create refuses an id ending in .git, which the relay refuses anyway. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The clone/push/fetch, concurrent-push and partial-push journeys post as a freshly generated owner, which a members-only relay refuses with relay_membership_required. When BUZZ_E2E_GIT_COMMUNITY_ID names the relay's community, admit that owner first; without it nothing changes. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
On a members-only relay the journey stopped before its cases: the outside owner's agent could not link (restricted: not a relay member), and the Git door refuses unadmitted keys with 403 before repository authority. Admit every key to the community. Admission gives no channel role, and the outside owner never joins the repo's channel, so each case still turns on channel membership or grant. Directly admitted agents also make banned-owner refuse for the owner's ban, not for missing admission. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Owner admission at the read door is a members-only property; on an open relay admission is only "not banned", so removing the owner cannot deny the clone and the case reported a false failure. Check that the removed owner is refused at authentication exactly when the relay's exported BUZZ_REQUIRE_RELAY_MEMBERSHIP is true, and run the denial only then. Ban-based owner admission on open relays is membership_or_grant's banned-owner. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…r admission Two Postgres-backed owner tests had no #[ignore], so no CI lane ran them. The land's owner-admission check had no test that failed when it was reverted; an admitted agent whose owner leaves the community now lands with no credited role. The restricted-governance loop resets the owner each iteration, so its arms no longer depend on order. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Preserve the content that passed the size cap instead of expanding omitted optional fields during serialization. A near-limit floor now survives write, body/head reads and replacement with a valid relay signature. The PostgreSQL regression failed on 32a6c71, passed with this change, and failed again when serialization was restored. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Order concurrent role changes before or after the command by retaining admission, announcement, channel membership and channel row locks, plus FOR SHARE on community roles. Match ownership transfer row ordering. Sort multi-channel writers by UUID to match binds. Cascade member removal takes the community Git fence before roster rows to avoid reciprocal-owner lock inversion without changing invite admission. Eight PostgreSQL regressions fail with the old production paths and pass with these changes, including command-first retention until commit. Correct replay documentation and the migration lock-mode comment. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Reserve the name, validate quota and pin, and replace kind 30617 in one transaction. Conflicting concurrent announcements can no longer store a buzz-channel that disagrees with the pin. Duplicate/stale events roll back reservation changes. Keep S3 seeding and its existing compensation outside SQL, passing the fresh-reservation result to preserve seed behavior. Lock order is community deletion admission and Git community fence, repo row, then replacement. Db::replace_parameterized_event_in_transaction owns the only replacement advisory lock; its kind-30617 path adds no membership or channel locks. Fresh names additionally serialize the per-owner quota. The concurrent real-ingest regression fails at 32a6c71, passes with the fix, and fails again after reverting it, recording the mismatched pin and tag. All 21 relay governance PostgreSQL tests pass. Production additions are 138 lines; this commit is independently droppable. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Main added migrations 0107 and 0108 (#9862), so this branch's governance migrations move to 0109 and 0110. * origin/main: feat(search): sign OpenSearch requests with AWS SigV4 (#9947) feat(relay): add percentage-based NIP-FI enforcement rollout in shadow mode (#9758) fix(mobile): keep Active activity unknown after deletions the gap hides (#9951) feat(search): index deletes and edits, backfill stored messages, run several indexer workers (#9862) fix(cli): attach custom emoji tags when editing a message (#9694) fix(pubsub): drop Redis pub/sub sockets that stop answering (#9918) ci: ignore RUSTSEC-2026-0600 (kube's unused openssl-tls connector) (#9969) fix(mobile): end a refused push opt-out in a visible failure with Retry (#9854) fix(mobile): report a push wake claim it stopped waiting for (#9931) fix(push-gateway): keep Android enrollment retryable across replay races and restarts (#9893) Apply a confirmed age restriction to Android push wakes (#9925) feat(mobile): keep the message of Dart programmer errors in reports (#9822) fix(mobile): pass the relay call to the wake resolver's bounded query (#9950) test(mobile): hold a push wake claim past the deadline instead of timing it (#9919) feat(nip-fi): scope disconnects to tokens issued through revoke_through, stored durably (#9917) perf(mobile): derive Active filter activity from the channel list, with no per-channel relay reads (#9832) feat(mobile): tag escaped relay errors with their call and reason class (#9821) fix(relay): persist NIP-FI revocations across restarts and bridge shadow to enforce (#9860) chore(db): accept the activity cache tables before their migration (#9815) Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Under the PostgreSQL lane each test gets a clone of the desired-state schema, so migrating it again fails. Migrate only outside that mode, as the neighbouring fixtures do. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A rules or floor command naming codeowners or group review was accepted, then denied every push its rule covered. Commands now refuse them with a precise reason. A stored head that names one still parses and denies, so reads and existing policy stay fail-closed. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The model's receipt records whom a change was for and the rules in force. The land's receipt named the actor, its role and the repo's authority version, and that version does not move when the floor or trusted checks change. It now adds the recorded owner (or the actor) as `for`, and the floor, trusted, labels and rules heads the decision read. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The default-branch section still described the pre-governance rule (author, maintainer or human owner, judged at admission). It is a land that needs credited admin in the bound channel, judged under the land's locks. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A default-branch change evaluates no ref rules, but the land's authority step reads the floor's grant lifetime cap, which can decide whether a manage grant counts. Record that floor head in the receipt. Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The model now matches the relay on four points from the line-by-line review. Archiving a channel freezes its repos' refs and keeps its roles, so reads and governance go on and a rebind moves a repo out; two new seeded errors, archive-ignored and reads-archived, fail when that guard goes. Publishing a floor, trusted list or labels as an owned agent also needs the owner to be a community admin. The header says the relay refuses code-owner and group rules at authoring and that an owner is a person, read one level deep. VISION_GOVERNANCE.md says that removing an agent from the channel ends only its own role, and that banning its key stops a grant too. check.sh: 138/138 (two added, none removed); gov-review 1,945,941 states. Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The relay takes an approval of any commit naming any tip and binds it only at the decision. The model keeps approvals to a shown commit and the tip of the moment: a free base would let an approval always name the right tip, so target-tip-ignored could not fail, and approving unshown commits multiplies gov-review's states past 27M. Comment only. Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…ttestation Sami's measurement: the ban cascade reads ownership one level deep, and the Git gate refuses an agent for a banned grand-owner only when the agent presents its owner's attestation. Comment only. Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The relay's refusal of code-owner and reviewer-group rules now sits with the rule shape it narrows, and the owner bullet says it is an assumption the relay does not enforce. Comment only. Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
This branch has not been deployed
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 in Buzz gets governance: a community floor no repo can weaken, repo rules on top of it, evidence, and one atomic land that decides, against current authority, every ref change that reaches it, and leaves a receipt. An agent reaches a repo like anyone else, through its own role in the repo's channel, or through a grant its owner signs, capped by the owner's role. It is the contract in VISION_GOVERNANCE.md, built from a formal model down.
docs/spec/GitGovernance.tla,GitGovernanceLand.tla): governance as anAllowedpredicate over GitRefDB's atomic push, plus the row protocol that lands it. Every registered seeded design error must be caught, every registered coverage behavior reached, and the row protocol must refine both models in a bounded context. The relay does not resolve code owners or reviewer groups, so the model's code-owner checks are the design target, not current behavior.check.shruns in the Spec workflow.crates/buzz-git-gate):decide()is the land's gate, verified with Verus (48 obligations,just verify-git-gate, a CI step that fails if nothing was verified).crates/buzz-conformance/src/git_land.rs): replays traces from the real land against the protocol. Fixtures cover a read without its lock, expiry at read, a pointer moved out of band, and a land with no receipt.buzz gov floor|trustedfor community admins;buzz repos rules|labels|effective|receipts|bind|grantfor repo admins and owners.Membership or grant
Every key's role in a repo is its role in the repo's channel. An agent with a recorded owner can also present a grant: the NIP-OA
authtag signed by its owner,repo=<owner-hex>:<name>(or*) andgit=read|push|manage, with optionalcreated_atbounds. A live grant creditsreadas guest,pushas member andmanageas admin, never above the owner's own role in the repo channel. The agent gets the higher of the two routes.buzz repos grantmints the tag offline.Reads
A repo is governed once its community has a floor or the repo has rules, labels or a bind, and governance only grows. Every door that shows a governed repo (info/refs, upload-pack, default branch, effective policy, receipts, rules heads) authorizes the key, picks what it will show, records an audit row naming the reader and door, then serves exactly that pick. A refused read records nothing. A failed record refuses the read.
Limits
docs/git-on-object-storage.mdis the legacy base that governed lands build on. Migration 0109 builds twoaudit_logindexes under a 5 s statement timeout, so large deployments should build them concurrently before upgrading. Rebinds made before deploy are pinned at first touch. A repo name ending in.gitis now refused at announce, and one already stored is reached by no URL; on main its URL and its storage already named different repos.author:repoand no community: where another community has a repo of that author and name and the owner holds a role there, the grant works there, under that community's floor. Binding grants to a community would change the NIP-OA tag. Desktop can't mint grants yet.for(its recorded owner, or itself), the credited role, andheads, the ids of the floor, trusted, labels and rules documents in force. Those ids identify the four governance documents, not a computed per-ref rule list or the legacy announcement rules. A default-branch change names only the floor, whose grant cap can decide whether a grant counts. A refusal before the owner is resolved (a held or archived repo, a bad tag) recordsforandheadsas null, meaning not resolved. A push that fails before the land (authentication, request or subprocess errors, a no-op) writes no land receipt, and hook refusal records are best effort.Readtransition.git-credential-nostrcan't authenticate to a NIP-FI enforce relay. The workaround ishttp.extraHeader.Follow-ups: refusing an owner that is itself owned, a conformance replay step for owner links, a CLI rebind for an admin who did not announce the repo, commit-author tracking for approvals, a pinned-read fast path, a rate bound on hook receipts, GC for unreferenced packs, enforce support in the credential helper, and channel scoping for 30618.
Related issue
None found.
Testing
This round: a line-by-line review by seven reviewers and a live end-to-end run, with fixes on top of
32a6c714e. Main is merged in, so this branch's migrations are now 0109 and 0110.docs/spec/check.sh: 138/138 at the head (e1cfcd68b), two checks added and none removed;gov-reviewexplores 1,945,941 states. Archiving now freezes refs and keeps roles, an owner's community role bounds what its agent may publish, and two new checks fail when their guard is removed (archive-ignored,reads-archived).f735df73e: relay, db and conformance against Postgres 1697/1697; conformance, core and CLI 1136/1136; Git tests against Postgres, Redis and MinIO 19/23, the four failures being local fixtures that hard-code a MinIO port. Clippy-D warningsand fmt are clean. At35b95629b, the workspace: 7224/7231, with the seven failures local only (git 2.51, an OpenSearch-less host, and load flakes that pass alone).2c1e1056a: the default-branch and land-trace tests 6/6.f735df73e, fresh build and database per mode: the e2e Git suite 5/5 on a members-only relay (membership or grant 21/21, owner boundaries 7/7) and 5/5 on an open one (owner boundaries 6 pass, 1 members-only case skipped). All 20 land receipts name their principal, and the rules land names the rules document in force.2c1e1056a, members-only: membership or grant 21/21 and owner boundaries 7/7. Code-owner and UUID-group rules commands are refused with no governance row; a plain review rule is accepted; the previous build accepted both. An agent with no channel role changes the default branch on a manage grant from its owner, and the receipt names the floor that capped the grant. A push grant (403) and a grant over the cap (404) are refused.At
32a6c714e, after three boundary fixes on top of001dafce5(owner admission at the read doors, direct consent for a rebind's destination, approvals that keep their verified owner):docs/spec/check.sh: 136/136, every one with the expected result. Three new seeded faults, one per fix (read-skips-owner-admission,bind-dest-by-grant,evidence-drops-owner), are each caught, and the coverage check that an approval records its owner is reached.-D warningsand fmt are clean. The failure is the git 2.51 test below.001dafce5, passes at the head, and fails again with the fix reverted.001dafce5and pass at the head, and their three controls pass on both.001dafce5.At
001dafce5, after the membership-or-grant change and two merges of main:docs/spec/check.shlocally: 131/131. Each of five seeded "too strict" mutants of the credit rule (a grant that narrows, an owner leaving strips the agent, an unowned agent gets nothing, a channel-admin owner's ban, a grant that gives no read) is now caught by a named coverage check. A min-level mutant survives by design: a request carries one tag.-D warningsand fmt are clean.push_is_published_exactly_when_receive_pack_changed_refsunder git 2.51, and four partition-date tests in buzz-db.4d1095dfb: 4/4, including the eight membership-or-grant cases from the table and an admin-only branch where apushgrant is refused and amanagegrant lands.Earlier, at
8cf933371, before the membership-or-grant change:0f39bb846, an earlier commit of this branch, on a fresh database per stage. Every row matched predictions written before boot: the full lap 83/83 (22 landed, 8 refused, 34 read records, receipt chain intact, the pushed secret absent from every receipt and log line), the members-only login 6/6, the repository door rows 37/37 and the floor reads 22/22. The e2e Git suite passes 4/4 on a fresh ungoverned relay and 4/4 again with the floor in force. The same floor-read script on the build before the DM fix fails exactly its DM row.<name>.git, a member refused on<name>'s main could push it through the URL<name>.git.git, and a governed repo could be forked into refusing every write. Main refuses the same push. Fixed here. One.gitstrip at the URL, a name that still ends in.gitrefused, and every coordinate built from that one name. The test that fails on the old code and passes on the new isa_dot_git_alias_reaches_no_other_repository. Every guard was mutation-tested. A live upgrade, announced on the old binary and attacked on the new one with the same database, matched every predicted row. Upper-case owners, percent-encoded names,/in names and trailing slashes were all refused or reached the same repo.0f39bb846binary: 13/13. A channel archived during a read still serves it; deleted or removed refuses it. A role in another community or only in a DM gives no read.Human test: not yet done.