Commit Graph

37 Commits

Author SHA1 Message Date
Hayt
76ceb42e17 refactor(desktop): split databricks reconcile out of migration.rs
migration.rs is at the desktop 1000-line file-size ratchet's frozen base (1408, pinned on origin/main), so the custom-harness boot-migration wiring cannot add its module registration without tripping the ratchet. Lift the self-contained databricks V1->V2 reconcile pair (reconcile_databricks_v1_to_v2 + its _in_file helper) into a migration/databricks_reconcile.rs submodule and move its tests to the sibling databricks_reconcile_tests.rs, reclaiming headroom.

Pure movement: function bodies are byte-identical; only patch_json_records/canonical_dev_data_dir gain a super:: qualifier, the entry point narrows pub -> pub(super) (its sole caller is the boot call), and the test file's test_support import re-roots to crate::migration::test_support. All 11 databricks reconcile tests stay green.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-13 02:14:33 -04:00
Duncan
de0b4772f8 refactor(desktop): split secret-projection modules to clear file-size ratchet
Complete the module extraction and field wiring left in working-tree state:

- Wire dev_service_migration and secret_projection_tests as modules
- Extract dev keyring secrets migration into dev_service_migration.rs and
  secret_projection tests into secret_projection_tests.rs so both parent
  files stay under the 1000-line desktop ratchet
- Reclaim ratchet lines in the six over-cap files touched by the
  secrets_unavailable field additions (types.rs, migration.rs, agents.rs,
  import.rs, discovery/tests.rs, readiness.rs)

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-10 15:02:41 -04:00
Duncan
a787d83fc4 fix(desktop): add ManagedAgentRecord.secrets_unavailable + spawn refusal + dev secrets migration
Commit the three items that were in working-tree state but not pushed:

- types.rs: add secrets_unavailable: bool field (transient, #[serde(skip)]) to
  ManagedAgentRecord with doc comment explaining load-time semantics

- secret_seam.rs: set record.secrets_unavailable = true when hydration errors
  are present, making the setter actually wire unavailability into the record

- storage.rs: extend spawn_key_refusal to check secrets_unavailable (in addition
  to empty nsec), refuse spawn with a named error message; update comments at
  both load_managed_agents callers to reflect that unavailability is now set
  directly on the record and consulted by spawn_key_refusal

- storage.rs: add migrate_agent_secrets_to_dev_service (v2 marker, separately
  versioned from _dev_migration_v1) covering canonical dev → prod and scoped
  dev → canonical dev, with conflict detection, global:env ref check, and
  collect_global_env_refs helper

- migration.rs: wire migrate_agent_secrets_to_dev_service into the boot path
  (cfg(debug_assertions), after migrate_inline_secrets_to_keyring)

- secret_projection.rs: add test_cancel_before_mark_ordering_protects_in_flight_gen
  covering the cancel-before-mark scenario Paul flagged (step 4 safe: a marked-
  then-referenced gen survives the next boot's delete phase)

- All struct literal sites updated with secrets_unavailable: false

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-10 13:51:05 -04:00
Duncan
936c1009ee feat(desktop): move persisted secrets from JSON into keyring via gen-ref protocol
All three secret tiers (global env vars, per-agent env/auth_tag/
provider_config, definition env vars) now move from plaintext JSON
into the existing SecretStore keyring blob using an immutable
generation-reference protocol:

  - Each write creates a new immutable generation entry under a UUID-
    keyed coordinate (e.g. agent:<pubkey>:env:<gen>). The stripped JSON
    carries a non-secret *_ref field; the atomic JSON write is THE commit
    point.
  - Crash before JSON commit: old ref stays authoritative, orphaned gen
    is swept by GC. Crash after: new ref is authoritative, old gen swept.
  - Empty vs unavailable distinguished by ref presence: no ref = field
    intentionally empty (agent runs); ref present but entry missing =
    unavailable, fail closed (nsec-style refusal).
  - Inline precedence: on keyring write failure (Windows TooLong /
    backend error) value stays inline in 0o600 JSON with a named warning
    and the ref is cleared. Inline is authoritative over any keyring state
    for that boot; extraction retries next boot.
  - Two-cycle GC: sweep 1 marks unreferenced generations as candidates in
    the blob; sweep 2 (next verified boot) deletes still-unreferenced
    candidates. Saves cancel their generation's candidacy before the JSON
    commit. GC is a no-op when either JSON store is absent, unreadable,
    or changes between reference collection and blob mutation.
  - Boot migration runs at the end of run_boot_migrations_inner (after
    materialize_agent_runtimes) so raw-JSON migrations see inline values.
  - OSS keyringless builds are unchanged (inline 0o600 JSON).

Coordinates:
  global:env:<gen>
  agent:<pubkey>:env:<gen>
  agent:<pubkey>:auth_tag:<gen>
  agent:<pubkey>:provider_config:<gen>   (entire BackendKind::Provider.config)
  definition:<id>:env:<gen>

Files changed:
  secret_store.rs              — add remove_keys() for batch blob deletion
  managed_agents/mod.rs        — expose secret_projection module
  managed_agents/secret_projection.rs — new: full gen-ref protocol impl + tests
  managed_agents/types.rs      — add auth_tag_ref, env_vars_ref, provider_config_ref
  managed_agents/global_config — add env_vars_ref, hydrate-on-load/strip-on-save
  managed_agents/storage.rs    — hydrate/strip seam, migration helpers
  migration.rs                 — boot migration + two-cycle GC
  commands/agents.rs           — new ref fields initialised to None
  commands/personas/snapshot/import.rs — same
  commands/team_snapshot.rs    — same

Deferred (noted in PR body, not a separate issue): existing nsec blob
(~2.8 KB) already exceeds the Windows 2,560-byte cap — pre-existing,
same accepted-risk class as the overflow path added here.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-10 11:48:43 -04:00
Will Pfleger
aee6314484 fix(desktop): strip legacy baked team instructions from stored prompts (#3035)
Agents in a team receive two `Team Instructions` blocks per turn, and
the observer feed renders two Team Instructions cards for them.

There are two producers. `with_team()` in `crates/buzz-acp/src/pool.rs`
appends the LIVE `[Team Instructions]` block from the runtime
`TeamRecord` — that one is correct. The second is baked into the stored
`system_prompt` itself: records written before the runtime framing
landed were composed by the now-removed `compose_prompt()` in
`buzz-persona`, which appended `"\n\n---\n# Team Instructions\n"` plus a
frozen copy of the team instructions. So an affected agent is fed a
stale roster ahead of the current one, and the transcript parser —
correctly — reports both.

Fixing this in `parseSystemPromptSections` would hide the symptom while
the agent kept receiving the stale bytes, so the suffix is removed at
rest by a boot migration.

`strip_baked_team_instructions` splits each stored `system_prompt` at
the LAST occurrence of the exact delimiter and keeps the text before it.
Last-occurrence matches the parser's own `lastIndexOf` guard: a persona
body may quote a delimiter-shaped passage, and only the final one is the
producer boundary. The match is byte-exact — a bare `---`, a `# Team
Instructions` heading at a different position, or a single preceding
newline are author content and are left alone. It applies to every
record regardless of `team_id` / `persona_id` / `pubkey`: the key-less
definition records carry the suffix exactly as the instances minted from
them do. A prompt that was nothing but the suffix becomes `None`, not
`Some("")`, matching the absent-prompt convention in
`AgentDefinition::into_agent_record`.

Stripping a definition's prompt changes its `persona_content_hash`,
which is the drift basis behind the Agents-menu "out of date" badge.
Left alone, every linked instance would light up stale for a change the
user never made. The migration therefore advances the pin of instances
whose `persona_source_version` still equals the definition's PRE-strip
hash — the same conditional `refresh_builtin_agent_avatars` already
uses. An instance that had genuinely drifted keeps its stale pin, and
its badge.

The migration runs after `fold_personas_into_agent_store` so definitions
lifted out of the legacy `personas.json` are cleaned in the same boot,
and before `backfill_standalone_agents` so a manufactured definition
never snapshots a suffix about to be removed. It writes only when at
least one record changed, so a second boot is a true no-op, and takes a
create-if-absent backup at
`managed-agents.json.pre-team-suffix-strip.bak` following the
`pre-backfill.bak` contract — a re-run after a partial failure cannot
replace the pristine backup with a half-migrated snapshot. An
unparseable store errors without writing and without taking a backup,
leaving the file for manual recovery.

Pass 5's legacy branch in `agentSessionTranscriptHelpers.ts` is
deliberately untouched: un-migrated installs and snapshot imports still
need it.

---------

Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
2026-07-26 19:33:43 -04:00
klopez4212
396ce6473e Update built-in agent avatars (#2215) 2026-07-21 17:34:07 +02:00
Michael Neale
54638ff4bb mesh: upgrade runtime, enforce membership, add shared compute provider (#1656) 2026-07-15 10:10:29 -04:00
Will Pfleger
448baeef77 feat(teams): unify team model, snapshot sharing, and PNG memory parity (#1846)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-14 17:10:51 -04:00
Will Pfleger
cf97237965 feat(desktop): add Sign Out to Settings to reset and relaunch (#1842)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-14 16:52:57 -04:00
Will Pfleger
e5d215e3c2 fix(desktop): isolate dev keyring from production and make BUZZ_SHARE_IDENTITY keyring-aware (#1680)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-09 17:33:52 -04:00
Will Pfleger
1f2afce29d fix(desktop): migrate Databricks V1→V2 records at boot and fix readiness gate (#1686)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-07-09 17:29:03 -04:00
Wes
3a7e400278 B5: one create path — behavioral quad activation, backfill, menu collapse, legacy dialog deletion (#1667)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-07-09 09:10:22 -07:00
Wes
381c7714fa feat(desktop): fold personas.json into the unified agent store (Phase 1A.2) (#1623)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-07-08 07:13:05 -07:00
Wes
5dce80aff5 feat(desktop): unified AgentRecord groundwork — record-first resolution + runtime materialization (Phase 1A.1) (#1618)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
2026-07-07 20:24:35 -07:00
Will Pfleger
e5f831d2c2 fix(desktop): restrict shared-agent sync to dev data dirs (#1597) 2026-07-07 17:35:15 -04:00
Wes
c5a541ee2d feat(desktop): boot-time reconcile of managed agents to relay events (#1601)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
2026-07-07 13:53:41 -07:00
Will Pfleger
e8adc3383f fix: close cross-process keychain race and namespace dev-build nest (#1409)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-06-30 18:40:02 -04:00
Will Pfleger
d256935c36 feat: publish personas, teams, and managed agents as relay events (#939)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-24 22:28:25 +00:00
Will Pfleger
4be43d7086 feat(desktop): store nsec private keys in the OS keyring (#1172)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-06-24 17:07:34 -04:00
Will Pfleger
2e426b2fdd fix: propagate persona harness edits to live agent instances (#1244)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-06-24 13:41:19 -04:00
Will Pfleger
1011cea268 fix(desktop): ground agent workspace, migrate legacy nest, configurable repos_dir (#1194)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-06-23 18:30:12 -04:00
Will Pfleger
065625bb4f fix(desktop): seed up agent JSON files in sync_shared_agent_data (#1121)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-06-18 17:55:22 -04:00
Will Pfleger
4201311821 fix: make managed-agent spawn and teardown portable to Windows (#1097)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-06-17 18:49:01 -04:00
Will Pfleger
5c2f46e627 fix(desktop): make Windows release compile cleanly (#1029)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-06-13 13:28:55 -04:00
Will Pfleger
df8896f13e fix(desktop): heal stale persona_team_dir paths in release builds (#1003) 2026-06-12 11:48:19 -04:00
Wes
824c55114e Fix Buzz command migration for saved agents (#979) 2026-06-11 11:27:58 -07:00
Wes
8f580f308c Rename desktop app to Buzz (#960)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
2026-06-11 15:06:24 +00:00
Will Pfleger
ba2fdbf697 refactor(desktop): consolidate packs into teams (#852) 2026-06-09 23:22:34 -04:00
Will Pfleger
9a98e60fc2 feat: provider/model selection for personas and runtime-aware env injection (#794) 2026-06-09 20:42:27 +00:00
Wes
15f610dcd5 fix(desktop): re-enable mcp_command reconciliation and harden spawn site (#909)
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
2026-06-08 13:54:42 -07:00
Will Pfleger
0a6067ca1b refactor: rename ACP "provider" to "runtime" across the codebase (#783) 2026-06-07 14:40:59 -04:00
Will Pfleger
5d7c748969 fix(presence): clear on disconnect, fix heartbeat/TTL, drop broken REST path (#877) 2026-06-05 13:28:00 -07:00
Will Pfleger
f1c672fea5 chore: deprecate sprout-mcp — fill CLI gaps, remove crate and all references (#850) 2026-06-05 12:31:52 -04:00
Will Pfleger
fa7febe40f fix(desktop): sync persona pack directory across worktree instances (#782) 2026-05-28 20:41:23 -04:00
Will Pfleger
f42839c740 feat(desktop): worktree agent data sync, retired persona cleanup, mcp_command reconciliation (#728)
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
2026-05-27 16:46:16 -04:00
Wes
ab71ade9e7 fix: prevent agent settings from being silently deleted on channel deletion (#752)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-26 16:09:09 -07:00
Wes
a302aadb34 feat(desktop): migrate legacy data dir and support dev/prod side-by-side (#168) 2026-03-24 16:28:48 -07:00