chore(db): drop Phase-A NIP-FI relay-side authority ledger - #7221
Merged
Conversation
OSS Buzz is stateless for identity (Will+Tyler, 2026-09-01: "Buzz speaks Nostr, nothing else"). NIP-FI spec v2 merged on main (#7214, d4420eb) requires the nostr_pubkey claim + NIP-42 proof unconditionally. The relay-side authority ledger introduced by migrations 0041 and 0042 is dead code. Migration 0044 drops the fifteen NIP-FI ledger tables and their trigger functions (using CASCADE to handle the circular deferred FK between identity_bindings and identity_lifecycle_history), and restores community_write_fence_excluded_table to its pre-0041 body so the deletion catalog no longer references the removed relations. Also removes the require_attested_key knob from buzz-auth IssuerPolicy: the false-branch (allowing absent nostr_pubkey claim) is unreachable by design under spec v2. parse_nostr_pubkey_claim now rejects a missing claim unconditionally. Verified: fresh-DB migration and populated-0041/0042-DB migration both pass the live Postgres tests. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
wpfleger96
had a problem deploying
to
codex-review
September 2, 2026 02:03 — with
GitHub Actions
Error
…aim regression test Remove the per-issuer require_attested_key knob (NIP-FI v2): the nostr_pubkey claim is now unconditionally required. This changes a non-field-encoded verifier semantic, so VERIFIER_CONTRACT_VERSION must advance from 1 to 2 so that AssertionPolicyIds derived under the old knobless rule are invalidated. Add mint_no_pubkey helper and absent_nostr_pubkey_claim_denies test: the standard mint_signed_by helper always injects nostr_pubkey via or_insert, so there was no test path that could remove the None => Err arm from parse_nostr_pubkey_claim and turn the suite red. The new helper intentionally omits the claim; the test asserts ClaimRejected at the exact production arm. Update docs/nips/NIP-FI.md: remove two stale require_attested_key / follow-on paragraphs that described the knob as a not-yet-integrated enforcement primitive; the unconditional enforcement is live in this PR. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
🔐 Codex Security Review
Review SummaryOverall Risk: NONE
FindingsNo concrete security, correctness, or reliability findings were identified. Notes
Generated by Codex Security Review | |
kalvinnchau
approved these changes
Sep 2, 2026
wpfleger96
added a commit
that referenced
this pull request
Sep 2, 2026
… comments S2 (PR #7221) removed the per-issuer `require_attested_key` parameter from `IssuerPolicy::new`. Update the three sites in the S3 branch that referenced it: - `nip_fi_config.rs`: drop the now-invalid 10th positional argument (`true`) from the `IssuerPolicy::new` call and remove the surrounding block comment that described the rationale for hard-wiring it. - `nip_fi_config.rs` doc comment: replace "silently ignored by serde" phrasing with accurate wording — the field is simply not part of the schema. - `connection.rs` doc comment: update "S2 deletes" to past tense "S2 deleted". No logic change; S3's structural enforcement of key pairing is unchanged. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
pushed a commit
that referenced
this pull request
Sep 2, 2026
* origin/main: feat(agents): harness-agnostic effort write path and spawn bridge (#4625) chore(db): drop Phase-A NIP-FI relay-side authority ledger (#7221) fix(acp): replace real user name in base prompt mention example (#7250) ci: split CI into reusable workflows (#7168) fix(desktop): retain automatic mentions only in threads (#7144) feat: add databricks fable 5.1 model capabilities (#7213) docs(nip-fi): rewrite NIP-FI as stateless OSS Buzz spec v2 (#7214) feat(relay): add detailed readiness metrics (#7149) feat(desktop): add Pi agent preset (#7208) Signed-off-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz> # Conflicts: # desktop/src-tauri/src/commands/agent_models_update.rs # desktop/src-tauri/src/commands/agents_deploy.rs # desktop/src-tauri/src/managed_agents/types/requests.rs # desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx # desktop/src/shared/api/types.ts
wpfleger96
added a commit
that referenced
this pull request
Sep 2, 2026
… comments S2 (PR #7221) removed the per-issuer `require_attested_key` parameter from `IssuerPolicy::new`. Update the three sites in the S3 branch that referenced it: - `nip_fi_config.rs`: drop the now-invalid 10th positional argument (`true`) from the `IssuerPolicy::new` call and remove the surrounding block comment that described the rationale for hard-wiring it. - `nip_fi_config.rs` doc comment: replace "silently ignored by serde" phrasing with accurate wording — the field is simply not part of the schema. - `connection.rs` doc comment: update "S2 deletes" to past tense "S2 deleted". No logic change; S3's structural enforcement of key pairing is unchanged. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
pushed a commit
that referenced
this pull request
Sep 2, 2026
…agent-edit * origin/main: feat(desktop): add persistent Bestie experience (#7223) fix(desktop): harden profile batch and thread-reply fetches against relay slowness (#7188) docs(nip-fi): adopt deny-until-TTL and extend enforcement to HTTP ingress (#7254) fix(composer): align wrapped inline chip fragments (#7242) Add operation-aware database pool acquisition metrics (#7195) fix(desktop): keep explicit agent profiles bound to their exact key (#7131) fix(desktop): discover authenticated owned relay agents (#7122) feat(agents): harness-agnostic effort write path and spawn bridge (#4625) chore(db): drop Phase-A NIP-FI relay-side authority ledger (#7221) fix(acp): replace real user name in base prompt mention example (#7250) ci: split CI into reusable workflows (#7168) fix(desktop): retain automatic mentions only in threads (#7144) feat: add databricks fable 5.1 model capabilities (#7213) docs(nip-fi): rewrite NIP-FI as stateless OSS Buzz spec v2 (#7214) feat(relay): add detailed readiness metrics (#7149) feat(desktop): add Pi agent preset (#7208) Signed-off-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz> # Conflicts: # desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx # desktop/src/features/agents/ui/agentInstanceEditPinning.test.mjs
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.
Removes the dead relay-side authority ledger introduced by migrations 0041 and 0042, and the dead
require_attested_keyverifier knob frombuzz-auth. Both are unreachable by design under NIP-FI spec v2 (#7214, squashd4420eb47), which makes OSS Buzz stateless for identity: the relay neither stores nor verifies an authority chain.What changes
migrations/0044_drop_nip_fi_ledger.sqlDrops all fifteen NIP-FI ledger tables and their trigger functions using
CASCADEto resolve the circular deferred FK betweenidentity_bindingsandidentity_lifecycle_history. Drops proceed in FK dependency order: selectors → history/bindings → enrollment_policies/receipts → parallel drop of auth tables. Restorescommunity_write_fence_excluded_tableto its pre-0041 body (removes NIP-FI table names from the exclusion array).schema/schema.sqlRemoves the NIP-FI section (~1885 lines of tables, functions, and triggers) and updates
community_write_fence_excluded_tableto match.crates/buzz-db/src/runtime/migration.rsembedded_migrator_contains_consolidated_initial_schemasanity check: count 43→44, adds 0044 assertion block (verifiesDROP TABLEstatements and absence of NIP-FI names fromschema.sql).#[tokio::test] #[ignore = "requires Postgres"]from the 0041/0042 behavioral coverage).extract_excluded_table_arraydrift check (0042 body no longer matchesschema.sqlby design).migration_0044_drops_populated_nip_fi_ledger_cleanly: runs migrations to 0042, seeds rows inauthorization_operation_receiptsandauthorization_invalidation_domains, then runs to 0044 and verifies all fifteen NIP-FI tables are absent.crates/buzz-auth/src/nip_fi/config.rsRemoves
require_attested_key: boolfromIssuerPolicy— field, constructor parameter, accessor, and its contribution toderive_assertion_policy_id.crates/buzz-auth/src/nip_fi/verifier.rsparse_nostr_pubkey_claimno longer takes apolicyparameter. TheNone(absent claim) arm now returnsErr(VerifierError::ClaimRejected)unconditionally instead of conditionally onpolicy.require_attested_key().crates/buzz-auth/src/nip_fi/verifier/tests.rsmissing_nostr_pubkey_denies_under_attested_key_policy(the solerequire_attested_key: truecall site).false,from all elevenIssuerPolicy::newcall sites.nostr_pubkeyby default inmint_signed_by(spec v2 requires it unconditionally).valid_access_token_verifiesto assertasserted_key().is_some().crates/buzz-auth/src/nip_fi/startup/tests.rs+jwks/tests.rsRemoves
false,from allIssuerPolicy::newcall sites and addsnostr_pubkeyto all token-minting helpers.Verification
Closes the dead-code inventory item from the spec-v2 cleanup plan (channel
48374f48). Follows #7214.