Skip to content

feat(profiles): archive, unarchive and delete agents from the profile pane - #256

Open
kalvinnchau wants to merge 6 commits into
mainfrom
peon/profile-agent-management
Open

kalvinnchau wants to merge 6 commits into
mainfrom
peon/profile-agent-management

Conversation

@kalvinnchau

Copy link
Copy Markdown
Contributor

Change

  • Adds Archive, Unarchive and Delete to the agent profile pane. The copy follows base Buzz.
  • Authority: the actions appear only when authority is verified: an ownership consent credential or a relay owner/admin role. A self-asserted profile claim does not count.
  • Archive and Unarchive publish NIP-IA identity-archive requests. Before Archive can be confirmed, a fresh archive-state read must return the same result the request was expecting.
  • Delete is available only to the verified owner of a single local native record. Deployed remote records get no Delete. Steps, in order:
    1. Remove the agent from every channel the viewer can discover (kind 9001). Each removal is confirmed by a fresh relay-signed roster read for that channel.
    2. Archive the identity and confirm it with a fresh read.
    3. Stop the local process, then remove the native record and the app-owned key.
    • A failure at any step leaves the record in place, so Delete can be retried.
    • Closing the profile stops any new removal, archive or native request from starting. Requests already sent still settle.
  • agent_control_delete is granted to the main webview only. The native guard refuses to delete deployed remote records.
  • Scope matches base Buzz:
    • Delete covers the channels the viewer can discover. Memberships in private channels the viewer can't see may remain.
    • Archive hides the identity; it does not revoke its access.
    • Deleting the key is best-effort. Shared and legacy keys are kept.
  • The pending, failure and stale states are covered in docs/agents.md.

Verification

  • pnpm check: pass.
  • Full Vitest: 3741/3741.
  • Node integration: 133/133.
  • cargo test --workspace: 155 passed / 4 ignored.
  • clippy -D warnings and cargo fmt --check: clean.
  • Fixture regressions cover:
    • authorized and unauthorized paths;
    • the per-channel roster check, including the case where the roster can't be read;
    • a stale cached archive state;
    • hiding Delete for deployed remote records;
    • native-last ordering;
    • cancellation during the archive read and during outbox hydration.
  • Not covered:
    • Delete in a live app talking to a real relay and native backend;
    • process stop and key deletion on a real OS keychain;
    • restart recovery.

peon and others added 6 commits September 24, 2026 20:48
Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Stop the local agent, remove its record and key, remove it from every
known channel with kind 9001, then archive its identity on the relay.
Only the verified owner of a single native record sees the action.

Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Register agent_control_delete in the app manifest and main-webview
capability. Run Delete as confirmed channel removal (target-bound roster
discovery), confirmed archive, then native removal, with cancellation and
target fencing. Report committed native removal even when the follow-up
write or refresh fails. Fall back to relay-admin authority when an owner
credential is outside its time bounds.

Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Confirm each channel removal against its own fresh relay-signed roster
instead of a union with loaded rosters; an unreadable roster stays
unconfirmed. Re-read archive state before Delete trusts it. Expose
deployed remote records from native and offer them no Delete, so relay
effects never precede a guaranteed native refusal.

Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Pass the Delete signal through the archive step: check it after the fresh
archive read and bind any archive request to it. After outbox readiness,
check cancellation and send or retry removals through the outbox
admission gate.

Co-authored-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
@kalvinnchau
kalvinnchau requested review from a team, comp615 and wesbillman as code owners September 25, 2026 05:21
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