mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Addresses all 6 blocking findings from Thufir pass 2:
1. [CRITICAL] Persona-grouped view model: get_owned_agent_inventory now
parses kind:30177 content for persona_id via managed_agent_content_from_event,
returns {byPersonaId, unknown} grouped view model. OwnedAgentInstance gains
personaId: Option<String> field. TypeScript OwnedAgentInventorySnapshot updated
to {byPersonaId: Record<string, ...>, unknown: [...]}.
2. [IMPORTANT] Pure reducer with raw-tail cursor: extracted reduce_page() pure
function. Cursor advances from raw page tail only (last event before dedup).
Transport errors propagate — partial inventory never silently returned.
Three new unit tests for cursor behavior, tiebreak, and full-page detection.
3. [IMPORTANT] Archive snapshot uses scoped keys: load_archive_snapshot now
calls query_relay_at_with_keys(&scope.keys) for NIP-98 auth. Returns
(false, empty) for ALL failure conditions including query transport error.
4. [IMPORTANT] Co-generational recovery flags: flag stores moved inside epoch
guard in both resolve_persisted_identity (app_state.rs) and
commit_imported_identity (commands/identity.rs). SeqCst ordering throughout.
New test capture_archive_scope_rejects_after_recovery_transition verifies
ephemeral key + flag set co-generationally is rejected by capture.
5. [IMPORTANT] Expired-bound test hardened: result.expect(...) now asserts relay
accepted the archive. Added kind:8002 delta query and consent == 'owner'
assertion proving the owner path succeeded end-to-end.
6. [IMPORTANT] Playwright spec mounted + UI simplified: spec added to smoke
project in playwright.config.ts. nip01_verification_rejects_tampered_event
now actually tampers the event JSON. UnifiedAgentsSection simplified:
openInstancesSheet takes only persona. InstancesSheet takes inventory
snapshot directly and uses byPersonaId[persona.id] for filtering.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>