Skip to content

feat(git): govern every push and read from a formal model down - #9873

Draft
tlongwell-block wants to merge 45 commits into
mainfrom
eva/git-governance-squash
Draft

tlongwell-block wants to merge 45 commits into
mainfrom
eva/git-governance-squash

Conversation

@tlongwell-block

@tlongwell-block tlongwell-block commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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.

channel role / owner grant ──► request  ──► door (read: authorize, record, serve its pick)
                                         └► receive-pack ──► hook (role, grant level)
                                                         └► land: one Postgres tx under the repo row
                                                              decide() ── Verus-proved
                                                              swap ref pointer, write receipt
                                                              trace ──► git_land conformance checker
  • Model (docs/spec/GitGovernance.tla, GitGovernanceLand.tla): governance as an Allowed predicate 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.sh runs in the Spec workflow.
  • Decision (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).
  • Conformance (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.
  • Relay: the land, the floor/rules/labels/bind documents, evidence, receipts, secret scan, membership-or-grant authority, read records for governed repos, and adoption of ungoverned pushes from pre-land relays.
  • CLI: buzz gov floor|trusted for community admins; buzz repos rules|labels|effective|receipts|bind|grant for 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 auth tag signed by its owner, repo=<owner-hex>:<name> (or *) and git=read|push|manage, with optional created_at bounds. A live grant credits read as guest, push as member and manage as admin, never above the owner's own role in the repo channel. The agent gets the higher of the two routes.

In the repo channel Live grant, owner in the channel Credited role
yes no its own role
no yes grant level, capped by the owner's role
yes yes the higher of the two
no no none
  • A grant only adds. It never narrows what the agent's own key holds, and a tag that fails to verify as a Git grant is ignored rather than refused. A NIP-FI owner that differs from the grant's signer is still an error.
  • A grant reaches the repo, not the channel's messages, and never makes the agent a channel admin. Rebinding a repo into a channel takes an admin of that channel in their own right; a grant can't consent for it.
  • Admission comes first. A banned key gets nothing, and a banned owner, or one outside a members-only community, takes away both routes from its agents, at every read door and at the land.
  • When the floor caps grant lifetime, both bounds are required and the window must fit. The relay checks the tag on every request, and the hook receives the grant's level. The land binds owner, window and cap at the commit point, and ties its deadline to the grant's end only when the grant is what authorizes the push.
  • There is no revoke record. Removing an agent from the channel ends its membership route only: a live grant still works while its owner keeps the role it needs. Banning the agent's key ends both routes, and banning the owner reaches the agent too. buzz repos grant mints the tag offline.
  • An agent with no recorded owner is judged as a person, by its own role.

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

  • Rollout: drain relays without the land before new ones take Git writes. A new relay adopts an old relay's push to an ungoverned repo only when the old relay built on the current row. That push was checked by the old relay when it took it, not by the land, so it writes no receipt; the new relay logs a warning. When a governed repo's pointer was written outside the land (not a cache one land behind), writes to it are refused with 409 until an operator reconciles it, and there is no repair tool yet. The pointer-only read and push protocol in docs/git-on-object-storage.md is the legacy base that governed lands build on. Migration 0109 builds two audit_log indexes 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 .git is now refused at announce, and one already stored is reached by no URL; on main its URL and its storage already named different repos.
  • Agents: a Git tag at REST or NIP-42 login proves no owner. The relay knows an agent by its recorded owner, which the first verified OA tag on a Git request, governance command or approval records, and which closes the agent's unowned connections. An agent key that never presents one is treated as a person, including for a human review slot. NIP-FI token callers see a fixed 403. A grant names author:repo and 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.
  • Time: NIP-98 allows ±120 s at the door, and a land authorized by a grant cuts off at the grant's end. Receive-pack, pack preparation, the secret scan and the ancestry checks each run under their own bound before the land, so there is no single end-to-end bound on a push. The land does not re-check a NIP-FI assertion: a push admitted under one can land after the issuer's assertion expires. To cut off a key at once, an operator bans it and drops its connections.
  • Pushes: packs from refused pushes are not garbage-collected. A deleted announcement hides the repo until it is re-announced. A client without report-status gets a bare 403.
  • Receipts: a land receipt names the actor, for (its recorded owner, or itself), the credited role, and heads, 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) records for and heads as 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.
  • Approvals: the pusher never approves its own push, but authors of the pushed commits are not tracked yet, so an earlier author can approve them. Receipts list the evidence offered to each decision, not only the evidence that met a rule.
  • Smart HTTP reads: authorization, manifest selection and the audit append are separate operations, not one atomic snapshot. A ban, membership removal or rebind can commit after authorization and before the selected state is recorded and served. A governed read still fails if its record fails, but this path does not implement the model's atomic Read transition.
  • Secret scan: a fixed pattern list. Encoded secrets and secrets in ref names are not scanned.
  • Read records: one row per request, so a clone writes several, and a push's receive-pack advertisement counts as a fetch read. In a synthetic database benchmark at eight clients, a record cost 1.3 ms at p50 and 1.9 ms at p99, and an estimated 477 B before WAL and replicas. A row proves an authorized attempt, not delivery. A floor makes every repo in the community governed.
  • Evidence: there is no evidence read endpoint. Evidence shows only through the land and receipts. Filing evidence takes repo read authorization, from channel membership or a valid grant; filing is not the model's evidence read. Tests prove that upload-pack serves nothing a refused push brought.
  • Code owners and reviewer groups are not resolved yet. A new command naming either is refused when it is authored; a stored document naming one still parses and denies at the decision. The model keeps code owners as the design target.
  • Archived channels: archiving a repo's channel freezes its lands and the hook. Reads and governance commands continue, so a rebind can move the repo out.
  • Owner chains: the model assumes an owner is a person. The relay does not refuse an owner that is itself an owned agent, and its ban cascade reads one level, as it did before this PR. Measured on open and members-only relays: with P owning O and O owning A, banning P leaves A's relay standing (events, queries) and its Git standing through the read door and the land. The Git door refuses A only when A presents O's attestation. Refusing such links is a follow-up.
  • Owner registration (a first-wins owner link, including one recorded by a refused command) is checked by the model, not by the conformance replay.
  • NIP-34 events (30617/30618/1617) stay global and are not governed doors.
  • Pre-existing: git-credential-nostr can't authenticate to a NIP-FI enforce relay. The workaround is http.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.

  • Fixes: a secret split across a scan chunk edge is still found; the ancestry checks before a land are bounded; HTTP governance commands and evidence are admitted like their reads; a command signs the exact bytes it validated; command authority locks are held through commit; an announcement and its channel pin persist atomically; the CLI reports a rebind's governed move as its result; authoring refuses requirements the land can't satisfy; a land receipt names its principal and the governance heads in force. Each has a regression test that fails with the fix reverted.
  • Test coverage: two owner-admission tests that ran in no CI lane now run in the Postgres lane, and the land's owner-admission check now has a test that fails without it. That was the only mutant in the review that no test caught.
  • docs/spec/check.sh: 138/138 at the head (e1cfcd68b), two checks added and none removed; gov-review explores 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).
  • At 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 warnings and fmt are clean. At 35b95629b, the workspace: 7224/7231, with the seven failures local only (git 2.51, an OpenSearch-less host, and load flakes that pass alone).
  • At 2c1e1056a: the default-branch and land-trace tests 6/6.
  • Live relay at 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.
  • Live relay at 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.
  • Verus is unchanged: the gate crate is untouched.

At 32a6c714e, after three boundary fixes on top of 001dafce5 (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.
  • Relay lib: 1802/1803. Relay Git and governance suites against Postgres: 56/56; db governance: 3/3. Clippy -D warnings and fmt are clean. The failure is the git 2.51 test below.
  • Each fix has a regression test that fails at 001dafce5, passes at the head, and fails again with the fix reverted.
  • Live relay, members-only, rebuilt per run: an agent whose owner is not admitted can't clone, a manage grant can't rebind into a channel the agent doesn't administer, and an approval carrying an owner tag doesn't fill a human slot. All three fail at 001dafce5 and pass at the head, and their three controls pass on both.
  • Verus is unchanged: the gate crate is untouched since 001dafce5.

At 001dafce5, after the membership-or-grant change and two merges of main:

  • CI: every check passes or is skipped, including the TLA+ model check (131) and Verus (48 verified, 0 errors).
  • docs/spec/check.sh locally: 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.
  • Relay lib: 1802/1803. Relay Git, governance, thread window, bridge, search and deletion suites against Postgres: 203/203. buzz-db and buzz-git-gate: 281/281. buzz-db against Postgres: 908/912. Clippy -D warnings and fmt are clean.
  • The failures are pre-existing and fail the same way at the merge base: push_is_published_exactly_when_receive_pack_changed_refs under git 2.51, and four partition-date tests in buzz-db.
  • A regression test for owner admission fails before the fix and passes after it.
  • Live relay, e2e Git suite at 4d1095dfb: 4/4, including the eight membership-or-grant cases from the table and an admin-only branch where a push grant is refused and a manage grant lands.

Earlier, at 8cf933371, before the membership-or-grant change:

  • buzz-git-gate, buzz-conformance, buzz-cli, buzz-sdk and buzz-core: 1490/1490. Relay Git, governance, land and bridge suites against Postgres, Redis and MinIO: 475/476 (the git 2.51 test). buzz-audit: 25/25.
  • Each named injected safety check was mutation-tested: weakening it makes a named test fail.
  • Live relay: the release binary of 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.
  • Red team, four probes, each with predictions frozen before the relay booted and a control for every attack row.
    • Repository-name spelling found a regression this PR introduced: once an owner had announced <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 .git strip at the URL, a name that still ends in .git refused, and every coordinate built from that one name. The test that fails on the old code and passes on the new is a_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.
    • Floor reads, on the 0f39bb846 binary: 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.
    • Grant replay: 40/40. A read grant does not push or govern. A grant for one repo reaches no other door or repo. The owner cannot present the agent's grant. The community scope is stated in Limits.
    • The land and adoption held against concurrent governance writers.

Human test: not yet done.

tlongwell-block and others added 2 commits November 22, 2026 22:19
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
tlongwell-block force-pushed the eva/git-governance-squash branch from 3ac62f5 to 5a7b5dc Compare November 23, 2026 04:43
tlongwell-block and others added 27 commits November 23, 2026 09:47
…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>
tlongwell-block and others added 16 commits November 25, 2026 17:18
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant