From 446d1ef2b8e6d020c6326969127d0480a526c1f5 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 6 Mar 2026 13:36:34 -0500 Subject: [PATCH 1/3] TUI v3: tighten action strip + restore/import guidance (SeedPass-57f6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit action_bar.py: - Fix global row broken handlers: Remove Seed → open_profile_management, Backup Data → open_backup_parent_seed, Export/Import Data → open_palette (export/import need a path argument, palette is the right entry point) add.py: - seedplus-hint: mention BIP-85 explicitly, reference Seed+ (C) action - AddEntryScreen success notify: include reveal/copy shortcut hint - SeedPlusScreen: add #seedplus-warning label explaining deterministic derivation and index uniqueness requirement - SeedPlusScreen success notify: mention index and parent seed app.py: - RecoverProfileScreen: set success status before bootstrap fires - CreateProfileScreen: add intent messaging for nostr/backup restore modes with progress description and post-success status grid.py: - Add stored_password to secrets filter kind_map (was missing) tests: - test_tui_v3_parity: add test_v3_action_bar_global_row_uses_correct_handlers - test_tui_v3_smoke: add seedplus-hint BIP-85 check, seedplus-warning label check, recover success-status check Co-Authored-By: Claude Sonnet 4.6 --- src/seedpass/tui_v3/app.py | 17 +++++- src/seedpass/tui_v3/screens/add.py | 11 +++- src/seedpass/tui_v3/widgets/action_bar.py | 4 +- src/seedpass/tui_v3/widgets/grid.py | 1 + src/tests/test_tui_v3_parity.py | 24 ++++++++ src/tests/test_tui_v3_smoke.py | 67 +++++++++++++++++++++++ 6 files changed, 117 insertions(+), 7 deletions(-) diff --git a/src/seedpass/tui_v3/app.py b/src/seedpass/tui_v3/app.py index e200071c..f09df8ca 100644 --- a/src/seedpass/tui_v3/app.py +++ b/src/seedpass/tui_v3/app.py @@ -508,13 +508,17 @@ class CreateProfileScreen(Screen): self._set_status("Enter the seed phrase for Nostr restore.") return self._set_status( - "Attempting Nostr restore for the supplied seed profile..." + "Restoring from Nostr — this replays remote events onto the seed. " + "Your entries will be recovered from the network. This may take a moment..." ) fingerprint = self.app._restore_from_nostr_profile( seed=seed, password=password, continue_without_backup=continue_without_backup, ) + self._set_status( + f"Nostr restore complete ({fingerprint[:12]}) — launching session." + ) elif mode == "backup": if not seed: self._set_status("Enter the seed phrase for backup restore.") @@ -523,13 +527,16 @@ class CreateProfileScreen(Screen): self._set_status("Enter the encrypted backup path for backup mode.") return self._set_status( - "Attempting local backup restore from the supplied path..." + f"Restoring from local backup at {backup_path} — decrypting with your seed and password..." ) fingerprint = self.app._restore_from_backup_profile( seed=seed, password=password, backup_path=backup_path, ) + self._set_status( + f"Backup restore complete ({fingerprint[:12]}) — launching session." + ) else: if not seed: self._set_status("Enter the seed phrase to import.") @@ -538,6 +545,9 @@ class CreateProfileScreen(Screen): seed=seed, password=password, ) + self._set_status( + f"Profile imported ({fingerprint[:12]}) — launching session." + ) self.app._bootstrap_profile_session(fingerprint, password) except Exception as e: self._set_status(f"Profile creation failed: {e}") @@ -750,6 +760,9 @@ class RecoverProfileScreen(Screen): seed=seed, password=password, ) + self._set_status( + f"Recovery successful for {fingerprint[:12]} — launching profile session." + ) self.app._bootstrap_profile_session(fingerprint, password) except Exception as e: self._set_status(f"Recovery failed: {e}") diff --git a/src/seedpass/tui_v3/screens/add.py b/src/seedpass/tui_v3/screens/add.py index d81f4133..59074dad 100644 --- a/src/seedpass/tui_v3/screens/add.py +++ b/src/seedpass/tui_v3/screens/add.py @@ -94,7 +94,7 @@ class AddEntryScreen(Screen): kinds = [(k.value.title(), k.value) for k in supported_kinds] yield Select(kinds, value="password", id="kind-select") yield Label( - "Use `seed-plus` for Seed / Managed Account derivations.", + "Seed and Managed Account entries are BIP-85 deterministic derivations — use Seed+ (C) from the main action bar.", id="seedplus-hint", ) @@ -215,7 +215,7 @@ class AddEntryScreen(Screen): ) return - self.app.notify(f"Added {kind}: {label}") + self.app.notify(f"'{label}' ({kind}) saved — press v to reveal or c to copy.") self.app.action_refresh() self.app.pop_screen() except Exception as e: @@ -263,6 +263,11 @@ class SeedPlusScreen(Screen): yield Header() with Container(id="seed-container"): yield Label("SEED+ / BIP-85 DERIVATION", id="screen-title") + yield Label( + "Each derivation is deterministic — the same parent seed + index always produces the same child. " + "Choose a unique index per derivation. This entry cannot be deleted without losing the derived key.", + id="seedplus-warning", + ) yield Label("Derivation Type", classes="field-label") yield Select( @@ -317,7 +322,7 @@ class SeedPlusScreen(Screen): else: service.add_managed_account(label=label, index=index, tags=tags) - self.app.notify(f"Derived {kind}: {label} (Index {index})") + self.app.notify(f"'{label}' ({kind}) derived at index {index} — reproducible from your parent seed.") self.app.action_refresh() self.app.pop_screen() except Exception as e: diff --git a/src/seedpass/tui_v3/widgets/action_bar.py b/src/seedpass/tui_v3/widgets/action_bar.py index 7ad113f0..00861189 100644 --- a/src/seedpass/tui_v3/widgets/action_bar.py +++ b/src/seedpass/tui_v3/widgets/action_bar.py @@ -46,8 +46,8 @@ class ActionBar(Static): f"[@click='app.toggle_settings'][b]S[/b]ettings[/] [@click='app.add_entry'][b]A[/b]dd New Entry[/] " f"[@click='app.seed_plus'][b]C[/b]reate New Seed[/] " f"[@click='app.open_atlas_wayfinder'][b]W[/b]ayfinder[/] " - f"[@click='app.open_palette'][b]R[/b]emove Seed[/] " - f"[@click='app.action_db_export'][b]E[/b]xport Data[/] [@click='app.action_db_import'][b]I[/b]mport Data[/] [@click='app.open_palette'][b]B[/b]ackup Data[/]{exit_hint}" + f"[@click='app.open_profile_management'][b]R[/b]emove Seed[/] " + f"[@click='app.open_palette'][b]E[/b]xport Data[/] [@click='app.open_palette'][b]I[/b]mport Data[/] [@click='app.open_backup_parent_seed'][b]B[/b]ackup Data[/]{exit_hint}" ) # Context Row (added from previous phase parity) diff --git a/src/seedpass/tui_v3/widgets/grid.py b/src/seedpass/tui_v3/widgets/grid.py index f39dac34..bac12cb2 100644 --- a/src/seedpass/tui_v3/widgets/grid.py +++ b/src/seedpass/tui_v3/widgets/grid.py @@ -145,6 +145,7 @@ class EntryDataTable(DataTable): kind_map = { "secrets": [ "password", + "stored_password", "totp", "ssh", "pgp", diff --git a/src/tests/test_tui_v3_parity.py b/src/tests/test_tui_v3_parity.py index 894050d5..85645bb2 100644 --- a/src/tests/test_tui_v3_parity.py +++ b/src/tests/test_tui_v3_parity.py @@ -281,6 +281,30 @@ async def test_v3_action_bar_labels_include_leading_hotkey_letters() -> None: assert "Backup Data" in rendered +@pytest.mark.anyio +async def test_v3_action_bar_global_row_uses_correct_handlers() -> None: + app = SeedPassTuiV3( + entry_service_factory=lambda: MockEntryService(), + vault_service_factory=lambda: MockVaultService(), + ) + async with app.run_test() as pilot: + await pilot.pause() + bar = app.screen.query_one("#action-bar") + markup = bar.render() + # Backup Data must route to open_backup_parent_seed (has its own screen) + assert "open_backup_parent_seed" in markup + # Remove Seed must route to open_profile_management (not open_palette) + assert "open_profile_management" in markup + # Export/Import Data use open_palette because they need a path argument + # Verify both labels still present + from rich.text import Text + rendered = Text.from_markup(markup).plain + assert "Export Data" in rendered + assert "Import Data" in rendered + assert "Backup Data" in rendered + assert "Remove Seed" in rendered + + @pytest.mark.anyio async def test_v3_action_bar_only_shows_context_actions_for_selected_kind() -> None: app = SeedPassTuiV3( diff --git a/src/tests/test_tui_v3_smoke.py b/src/tests/test_tui_v3_smoke.py index e984d887..8dedd315 100644 --- a/src/tests/test_tui_v3_smoke.py +++ b/src/tests/test_tui_v3_smoke.py @@ -968,6 +968,73 @@ async def test_tui3_word_by_word_seed_entry_feeds_create_profile_screen() -> Non ) +@pytest.mark.anyio +async def test_tui3_recover_profile_sets_success_status_before_bootstrap() -> None: + app = SeedPassTuiV3() + app._list_boot_profiles = lambda: [ + {"fingerprint": "EFBE51E70ED1B53A", "label": "Primary (EFBE51E70ED1B53A)"} + ] + booted: dict[str, str] = {} + status_at_boot: list[str] = [] + + def _recover_profile(*, fingerprint: str, seed: str, password: str) -> None: + pass + + def _bootstrap(fingerprint: str, password: str) -> None: + booted["fingerprint"] = fingerprint + # Capture status text at the moment bootstrap fires + try: + status_at_boot.append( + str(app.screen.query_one("#recover-status").render()) + ) + except Exception: + pass + + app._recover_profile = _recover_profile + app._bootstrap_profile_session = _bootstrap + + async with app.run_test() as pilot: + await pilot.pause() + app.push_screen(RecoverProfileScreen()) + await pilot.pause() + screen = app.screen + screen.query_one("#recover-choice", Input).value = "1" + screen.query_one("#recover-seed", Input).value = ( + "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about" + ) + screen.query_one("#recover-password", Input).value = "hunter2" + await pilot.press("enter") + await pilot.pause() + assert booted.get("fingerprint") == "EFBE51E70ED1B53A" + assert status_at_boot and "Recovery successful" in status_at_boot[0] + + +@pytest.mark.anyio +async def test_tui3_add_entry_screen_seedplus_hint_mentions_bip85() -> None: + app, _entry, _vault, _search = _build_app() + async with app.run_test() as pilot: + await pilot.pause() + app.action_add_entry() + await pilot.pause() + screen = app.screen + hint = str(screen.query_one("#seedplus-hint").render()) + assert "BIP-85" in hint + assert "Seed+" in hint + + +@pytest.mark.anyio +async def test_tui3_seed_plus_screen_shows_deterministic_warning() -> None: + app, _entry, _vault, _search = _build_app() + async with app.run_test() as pilot: + await pilot.pause() + app.action_seed_plus() + await pilot.pause() + screen = app.screen + warning = str(screen.query_one("#seedplus-warning").render()) + assert "deterministic" in warning.lower() + assert "index" in warning.lower() + + @pytest.mark.anyio async def test_tui3_word_entry_flags_invalid_bip39_word() -> None: app = SeedPassTuiV3() From 8dbb8e065c8342524cc5aac64b08ddd16a5cce35 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 6 Mar 2026 13:37:12 -0500 Subject: [PATCH 2/3] mulch: update expertise --- .mulch/expertise/seedpass.jsonl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mulch/expertise/seedpass.jsonl b/.mulch/expertise/seedpass.jsonl index 91ae66b0..b633996a 100644 --- a/.mulch/expertise/seedpass.jsonl +++ b/.mulch/expertise/seedpass.jsonl @@ -8,3 +8,5 @@ {"type":"decision","title":"Codex runtime model source","rationale":"In this environment Overstory v0.7.9 rejects bare gpt-* in config models:, while codex account mode rejects provider-prefixed openai/gpt-* names; the stable path is model mapping in agent-manifest.json.","classification":"tactical","recorded_at":"2026-03-03T21:05:28.553Z","id":"mx-bc6fbc"} {"type":"convention","content":"SeedPass swarm baseline targets canonical branch beta and quality gates should run with .venv/bin prepended to PATH for pytest -q and scripts/run_ci_tests.sh.","classification":"tactical","recorded_at":"2026-03-03T21:05:48.410Z","id":"mx-c35626"} {"type":"pattern","name":"tui-v3-grid-focus-and-query-state","description":"TUI v3 main grid keyboard scrolling depends on explicit focus ownership: focus #entry-data-table on MainScreen mount and restore focus there when closing the command palette. Persist active search query in app state so refresh/filter/sort changes do not silently clear results.","classification":"tactical","recorded_at":"2026-03-06T12:08:49.420Z","id":"mx-4f9056"} +{"type":"pattern","name":"action-bar-click-handlers","description":"Global action bar @click handlers must reference parameterless actions only. Actions requiring arguments (e.g. action_db_export(path)) cannot be triggered from @click markup — use open_palette to let the user supply arguments. Actions with dedicated screens (open_backup_parent_seed, open_profile_management) should be wired directly.","classification":"tactical","recorded_at":"2026-03-06T18:37:01.814Z","evidence":{"commit":"446d1ef"},"outcomes":[{"status":"success","agent":"builder-action-strip"}],"id":"mx-d4f425"} +{"type":"convention","content":"Restore/recover flows (nostr, backup, recover-profile) must set informative status messages both before (intent/progress) and after (success with fingerprint prefix) the operation. Success messages should be set before _bootstrap_profile_session fires so they are visible if bootstrap fails.","classification":"tactical","recorded_at":"2026-03-06T18:37:04.389Z","evidence":{"commit":"446d1ef"},"outcomes":[{"status":"success","agent":"builder-action-strip"}],"id":"mx-363913"} From ea5ad1f093f740e40d76ce4c412ee0d57aafd014 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 6 Mar 2026 13:41:24 -0500 Subject: [PATCH 3/3] Fix managed_account QR exclusion and bare except in action_bar - Remove 'qr' from managed_account context actions (accounts don't expose a QR-scannable key like seeds/nostr do) - Change bare 'except:' to 'except Exception:' on vault manager check - Add test_v3_action_bar_managed_account_excludes_qr in parity tests Co-Authored-By: Claude Sonnet 4.6 --- src/seedpass/tui_v3/widgets/action_bar.py | 3 +-- src/tests/test_tui_v3_parity.py | 27 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/seedpass/tui_v3/widgets/action_bar.py b/src/seedpass/tui_v3/widgets/action_bar.py index 00861189..22ad4c2c 100644 --- a/src/seedpass/tui_v3/widgets/action_bar.py +++ b/src/seedpass/tui_v3/widgets/action_bar.py @@ -34,7 +34,7 @@ class ActionBar(Static): len(getattr(app.services.get("vault")._manager, "profile_stack", [])) > 0 ) - except: + except Exception: pass exit_hint = ( @@ -113,7 +113,6 @@ class ActionBar(Static): ], "managed_account": [ "reveal", - "qr", "edit", "archive", "delete", diff --git a/src/tests/test_tui_v3_parity.py b/src/tests/test_tui_v3_parity.py index 85645bb2..d91378ab 100644 --- a/src/tests/test_tui_v3_parity.py +++ b/src/tests/test_tui_v3_parity.py @@ -336,3 +336,30 @@ async def test_v3_action_bar_only_shows_context_actions_for_selected_kind() -> N assert "Load" in rendered assert "Delete" in rendered assert "Export" not in rendered + + +@pytest.mark.anyio +async def test_v3_action_bar_managed_account_excludes_qr() -> None: + app = SeedPassTuiV3( + entry_service_factory=lambda: MockEntryService(), + vault_service_factory=lambda: MockVaultService(), + ) + # Inject a managed_account entry into the mock service + async with app.run_test() as pilot: + await pilot.pause() + app.services["entry"].entries[99] = { + "id": 99, + "label": "test-managed", + "kind": "managed_account", + "index": 0, + } + bar = app.screen.query_one("#action-bar") + + app.selected_entry_id = 99 + await pilot.pause() + rendered = Text.from_markup(bar.render()).plain.splitlines()[1] + assert "Context (managed_account):" in rendered + assert "Reveal" in rendered + assert "Load" in rendered + assert "Delete" in rendered + assert " QR" not in rendered