Skip to content

Cycle 51: noise profile import/export with schema versioning #1085

Description

@gHashTag

Add Import/Export buttons to the LOGS tab noise-profile sheet so users can back up, share, and load noise-rule profiles as portable JSON.\n\nScope:\n- wrapper with and .\n- writing to .\n- validating schema version, filtering invalid rules, and merging by rule ID.\n- UI Import/Export buttons in with status feedback.\n- XCTest coverage: envelope round-trip, export validity, merge-by-id, unsupported schema rejection, invalid-rule skipping.\n\nVerification:\n- Building canonical Trinity Queen interface...
[0/1] Planning build
Building for debugging...
[0/2] Write swift-version--1AB21518FC5DEDBE.txt
Build of product 'QueenUILib' complete! (0.20s)
Compiling 133 Swift files with SQLCipher...
/Users/playra/BrowserOS/trios/rings/SR-01/SSETransport.swift:83:21: warning: immutable value 'urlError' was never used; consider replacing with '_' or removing it
81 | try await session.bytes(for: request)
82 | }
83 | } catch let urlError as URLError {
| - warning: immutable value 'urlError' was never used; consider replacing with '_' or removing it 84 | throw TransportError.connectionFailed 85 | } catch let retryError as RetryError { /Users/playra/BrowserOS/trios/rings/SR-02/A2ARegistryClient.swift:280:46: warning: no 'async' operations occur within 'await' expression 278 | for try await line in bytes.lines { 279 | if Task.isCancelled { break } 280 | if let message = await self.handleSSELine(line) { | - warning: no 'async' operations occur within 'await' expression
281 | continuation.yield(message)
282 | }

/Users/playra/BrowserOS/trios/rings/SR-02/A2ARegistryClient.swift:380:17: warning: 'let' pattern has no effect; sub-pattern didn't bind any variables
378 | do {
379 | return try await performDataRequest(url: url, request: request)
380 | } catch let A2AError.invalidResponse(403, _) {
| `- warning: 'let' pattern has no effect; sub-pattern didn't bind any variables
381 | await LocalAuthMonitor.shared.record403Retry()
382 | let request = try await makeAuthorizedRequest(

/Users/playra/BrowserOS/trios/rings/SR-02/A2ARegistryClient.swift:393:17: warning: 'let' pattern has no effect; sub-pattern didn't bind any variables
391 | do {
392 | return try await performDataRequest(url: url, request: request)
393 | } catch let A2AError.invalidResponse(403, ) {
| - warning: 'let' pattern has no effect; sub-pattern didn't bind any variables 394 | await LocalAuthMonitor.shared.record403Retry() 395 | let request = await makeAuthorizedGetRequest(url: url, forceRefresh: true) /Users/playra/BrowserOS/trios/rings/SR-02/ChatViewModel.swift:790:13: warning: initialization of immutable value 'preflightSwitched' was never used; consider replacing with assignment to '_' or removing it 788 | // is active we skip this step so we do not silently switch models. 789 | let preflightModel = await runPreflightHealthCheck(generation: generation) 790 | let preflightSwitched = preflightModel != modelStore.selectedModel | - warning: initialization of immutable value 'preflightSwitched' was never used; consider replacing with assignment to '
' or removing it
791 |
792 | // Predictive warmup cache: if a fresh (or recently-stale) background

/Users/playra/BrowserOS/trios/rings/SR-02/ChatViewModel.swift:797:13: warning: variable 'warmupServedStale' was written to, but never read
795 | // refresh for future sends.
796 | var warmupSwitched = false
797 | var warmupServedStale = false
| - warning: variable 'warmupServedStale' was written to, but never read 798 | var warmupCandidate: CrossProviderModelCandidate? 799 | if modelStore.isAdaptiveProviderWarmupEnabled, /Users/playra/BrowserOS/trios/BR-OUTPUT/ChatPanelView.swift:181:14: warning: 'onChange(of:perform:)' was deprecated in macOS 14.0: Use onChangewith a two or zero parameter action closure instead. 179 | updateNearBottom() 180 | } 181 | .onChange(of: scrollManager.scrollRequest) { request in | - warning: 'onChange(of:perform:)' was deprecated in macOS 14.0: Use onChange with a two or zero parameter action closure instead.
182 | guard request.sequence > 0 else { return }
183 | scrollToBottom(

/Users/playra/BrowserOS/trios/BR-OUTPUT/ChatPanelView.swift:188:14: warning: 'onChange(of:perform:)' was deprecated in macOS 14.0: Use onChange with a two or zero parameter action closure instead.
186 | )
187 | }
188 | .onChange(of: viewModel.messages.count) { newCount in
| - warning: 'onChange(of:perform:)' was deprecated in macOS 14.0: Use onChange` with a two or zero parameter action closure instead.
189 | // Scroll only when a brand-new message is appended.
190 | if newCount > previousMessageCount && isNearBottom {

/Users/playra/BrowserOS/trios/BR-OUTPUT/ChatPanelView.swift:195:14: warning: 'onChange(of:perform:)' was deprecated in macOS 14.0: Use onChange with a two or zero parameter action closure instead.
193 | previousMessageCount = newCount
194 | }
195 | .onChange(of: viewModel.messages.last?.content) { newContent in
| - warning: 'onChange(of:perform:)' was deprecated in macOS 14.0: Use onChange` with a two or zero parameter action closure instead.
196 | // Throttled scroll during streaming: react only when the last
197 | // message content actually changed.

/Users/playra/BrowserOS/trios/BR-OUTPUT/ChatPanelView.swift:203:14: warning: 'onChange(of:perform:)' was deprecated in macOS 14.0: Use onChange with a two or zero parameter action closure instead.
201 | previousLastContent = newContent
202 | }
203 | .onChange(of: browserOSVM.messages.count) { newCount in
| - warning: 'onChange(of:perform:)' was deprecated in macOS 14.0: Use onChangewith a two or zero parameter action closure instead. 204 | if newCount > previousBrowserMessageCount && isNearBottom { 205 | scrollManager.requestScroll(animated: true) [OK] Build successful: /Users/playra/BrowserOS/trios/trios_app [OK] Copied and signed .app bundle (bundle ID: com.browseros.trios) Running chat integration tests... Compiling 94 Swift files with SQLCipher... /Users/playra/BrowserOS/trios/rings/SR-01/SSETransport.swift:83:21: warning: immutable value 'urlError' was never used; consider replacing with '_' or removing it 81 | try await session.bytes(for: request) 82 | } 83 | } catch let urlError as URLError { | - warning: immutable value 'urlError' was never used; consider replacing with '_' or removing it
84 | throw TransportError.connectionFailed
85 | } catch let retryError as RetryError {
/Users/playra/BrowserOS/trios/rings/SR-02/A2ARegistryClient.swift:280:46: warning: no 'async' operations occur within 'await' expression
278 | for try await line in bytes.lines {
279 | if Task.isCancelled { break }
280 | if let message = await self.handleSSELine(line) {
| `- warning: no 'async' operations occur within 'await' expression
281 | continuation.yield(message)
282 | }

/Users/playra/BrowserOS/trios/rings/SR-02/A2ARegistryClient.swift:380:17: warning: 'let' pattern has no effect; sub-pattern didn't bind any variables
378 | do {
379 | return try await performDataRequest(url: url, request: request)
380 | } catch let A2AError.invalidResponse(403, _) {
| `- warning: 'let' pattern has no effect; sub-pattern didn't bind any variables
381 | await LocalAuthMonitor.shared.record403Retry()
382 | let request = try await makeAuthorizedRequest(

/Users/playra/BrowserOS/trios/rings/SR-02/A2ARegistryClient.swift:393:17: warning: 'let' pattern has no effect; sub-pattern didn't bind any variables
391 | do {
392 | return try await performDataRequest(url: url, request: request)
393 | } catch let A2AError.invalidResponse(403, ) {
| - warning: 'let' pattern has no effect; sub-pattern didn't bind any variables 394 | await LocalAuthMonitor.shared.record403Retry() 395 | let request = await makeAuthorizedGetRequest(url: url, forceRefresh: true) /Users/playra/BrowserOS/trios/rings/SR-02/ChatViewModel.swift:790:13: warning: initialization of immutable value 'preflightSwitched' was never used; consider replacing with assignment to '_' or removing it 788 | // is active we skip this step so we do not silently switch models. 789 | let preflightModel = await runPreflightHealthCheck(generation: generation) 790 | let preflightSwitched = preflightModel != modelStore.selectedModel | - warning: initialization of immutable value 'preflightSwitched' was never used; consider replacing with assignment to '
' or removing it
791 |
792 | // Predictive warmup cache: if a fresh (or recently-stale) background

/Users/playra/BrowserOS/trios/rings/SR-02/ChatViewModel.swift:797:13: warning: variable 'warmupServedStale' was written to, but never read
795 | // refresh for future sends.
796 | var warmupSwitched = false
797 | var warmupServedStale = false
| `- warning: variable 'warmupServedStale' was written to, but never read
798 | var warmupCandidate: CrossProviderModelCandidate?
799 | if modelStore.isAdaptiveProviderWarmupEnabled,
[OK] Build successful: /tmp/trios_chat_sse_e2e_test
Running /tmp/trios_chat_sse_e2e_test...

Scenario: happy streaming path

ok - messages contains exactly user + assistant
ok - first message is user
ok - user content matches input
ok - last message is assistant
ok - assistant content accumulates text deltas
ok - assistant streaming flag cleared after finish
ok - state machine returned to idle
ok - request body contains user message
ok - request body mode is agent
ok - request body origin is sidepanel
ok - request body conversationId matches
ok - messages array starts with system prompt
ok - messages array ends with current user message
ok - persister stored exactly two messages
ok - stored user content matches
ok - stored assistant content matches

Scenario: cancellation is non-error

ok - state is idle after cancellation
ok - no system error message appended for cancellation
ok - user message remains after cancellation
ok - persister saved user message after cancellation

Scenario: message deduplication

ok - duplicate UUIDs collapse to a single message
ok - first duplicate survives

Scenario: conversation title survives reload

ok - rename normalizes whitespace
ok - custom title survives persister reload
ok - rename leaves message history unchanged
ok - custom title is limited to 80 characters
ok - blank title becomes Untitled
ok - clearing a conversation also clears its custom title

Scenario: durable memory and TODO plan persistence

ok - memory database schema is version 5
ok - memory database uses WAL journal mode for SQLCipher encryption
ok - completed turn is stored as memory
ok - memory records that sensitive values were removed
ok - raw secret is absent from memory
ok - raw goal prose is not copied into memory
ok - goal text is represented by private recall features
ok - raw assistant output is not copied into memory
ok - long PEM payload is redacted before truncation
ok - long PEM redaction is recorded
ok - explicit embedded file payload is rejected
ok - short unmarked pasted content is not stored verbatim
ok - misspelled query finds relevant memory
ok - memory search respects result limit
ok - repeated memory search has deterministic ordering
ok - recall fingerprints cannot be matched without the Keychain key
ok - new plan has three ordered steps
ok - new plan steps have deterministic order
ok - understand starts while the request is prepared
ok - execute remains pending before the stream opens
ok - stream start completes understand
ok - stream start begins execute
ok - successful plan reaches completed state
ok - completed plan reports full progress
ok - plan survives closing and reopening SQLite
ok - memory survives closing and reopening SQLite
ok - parameterized storage round-trips quotes and Unicode
ok - recent memory browsing respects its limit
ok - recent memory browsing is deterministic and newest first
ok - forgetting one durable memory reports a deleted row
ok - forgetting an unknown durable memory is idempotent
ok - forgotten memory is removed from FTS candidates
ok - scoped clear removes current-conversation memories
ok - scoped clear preserves another conversation's memory
ok - memory-only clear preserves the TODO plan
ok - volatile store forgets one memory
ok - volatile forget is idempotent
ok - volatile scoped clear matches durable semantics
ok - cancelled plan reaches cancelled state
ok - cancellation marks the active execute item
ok - cancelled progress derives only from completed items
ok - failed plan reaches failed state
ok - failure marks the active execute item
ok - failed progress derives only from completed items
ok - stream success does not complete user-added tasks
ok - plan stays active while a user-added task remains
ok - conversation deletion removes its plan
ok - conversation deletion removes scoped memories

Scenario: chat recalls memory and advances TODO plan

ok - integration fixture memory is stored
ok - chat creates a plan for the active conversation
ok - successful stream completes the active plan
ok - chat exposes recalled memories to the UI
ok - request labels recalled memory as untrusted
ok - request contains a safe topic summary
ok - request does not expose raw historical goal prose
ok - request does not expose private recall fingerprints
ok - chat confirms individual memory deletion
ok - chat removes a forgotten record from recalled state
ok - chat clears only current-task memory
ok - chat memory clear preserves the execution plan
ok - chat memory clear preserves message history
ok - memory deletion surfaces storage failure

Scenario: stream abort and error update planner

ok - stream abort marks the plan cancelled
ok - stream abort marks execute cancelled
ok - stream error marks the plan failed
ok - stream error marks execute failed
ok - stream error stops the assistant streaming indicator

Scenario: unterminated stream fails closed

ok - unterminated EOF marks the plan failed
ok - unterminated EOF creates no durable memory
ok - unterminated EOF preserves partial chat history
ok - unterminated EOF clears the streaming indicator
ok - unterminated EOF leaves a visible error state

Scenario: empty stream does not reuse prior answer

ok - empty stream stores no memory from an earlier assistant

Scenario: explicit cancellation wins transport error race

ok - explicit stop remains cancelled when transport emits an error
ok - explicit stop does not append a transport error
ok - explicit stop leaves the state machine idle
ok - explicit stop clears the assistant streaming indicator
ok - explicit stop persists the finalized partial response

Scenario: thrown transport error stops streaming UI

ok - thrown transport error clears a partial streaming indicator
ok - thrown transport error remains visible

Scenario: new conversation stops recall before transport

ok - recall gate opened before navigation
ok - cancelled recall never reaches transport
ok - new conversation becomes active
ok - old cancelled plan is not shown in the new conversation
ok - old delayed recall cannot overwrite the new conversation

Scenario: planner storage failure is visible

ok - planner storage failure does not block request planning
ok - planner storage failure is exposed to the UI
ok - failed privacy cleanup keeps the visible plan intact

Scenario: attachment turn is not remembered

ok - successful attachment turn stores no long-term memory
ok - attachment turn still completes its execution plan

Scenario: active deletion blocks reentrant send

ok - successful deletion fixture starts with persisted history
ok - send cannot start while private deletion is pending
ok - active conversation resets only after cleanup succeeds
ok - blocked send remains available for the new conversation
ok - successful deletion leaves no loadable message history
ok - successful deletion removes the persisted conversation record

Scenario: failed active deletion preserves chat history

ok - failed deletion finalizes the retained partial response
ok - failed deletion reloads the chat with its failure receipt

Scenario: immediate new conversation survives initialization

ok - new conversation and persister converge after initialization
ok - late initialization cannot restore the old conversation
ok - late initialization cannot restore old messages

Scenario: memory clear blocks in-flight persistence

ok - cleared in-flight turn cannot recreate memory

Scenario: unrelated memory clear preserves in-flight persistence

ok - clearing another task cannot suppress active-task memory

Scenario: memory clear waits for a started write

ok - memory write starts before the clear request
ok - canonical deletion waits for the started memory write
ok - successful clear leaves no raced memory behind

Scenario: conversation switch preserves completed memory

ok - completed turn starts its durable memory write
ok - navigation reaches the next conversation while save is pending
ok - navigation preserves memory for the completed conversation
ok - navigation preserves completed history for the original conversation

Scenario: scroll policy preserves reader position

ok - bottom anchor inside threshold is near bottom
ok - bottom anchor beyond threshold preserves reader position
ok - short content remains near bottom
ok - forced scroll emits a consumable request
ok - scroll request preserves its animation policy

All ChatSSEEndToEnd tests passed.
[OK] Chat integration tests passed
[SKIP] XCTest not available in this toolchain (install Xcode to run swift test)\n- [CladeBuild] Variant=prod, output=/Users/playra/BrowserOS/trios/trios_app
[CladeBuild] Building QueenUILib at /Users/playra/trinity/apps/queen
[OK] Build successful: /Users/playra/BrowserOS/trios/trios_app
[OK] Copied to .app bundle: /Users/playra/BrowserOS/trios/trios.app (files=133, ports MCP=9105 A2A=9200 MESH=9505 CANARY=9205)\n- /Users/playra/BrowserOS/trios/.trinity/e2e/report_prod_1785203139.md\n- ===========================================================
CLADE-AUDIT: Trinity Self-Critic
Dry run: false | JSON: false

[Check 1/8] Build gate - swiftc + cargo check
[OK] Swift: 0 errors | Rust: 0 errors | 76663ms
[Check 2/8] Security scan - forbidden patterns
[OK] Files scanned: 361 | Findings: 0 | 578ms
[Check 3/8] Shell safety - Process() allowlist
[OK] Files scanned: 244 | Findings: 0 | 100ms
[Check 4/8] Error handling - try!, as!, unhandled try?
[OK] Files scanned: 355 | Findings: 0 | 224ms
[Check 5/8] Concurrency - Swift 6 actor isolation
[OK] Files scanned: 244 | Findings: 0 | 222ms
[Check 6/8] TODO/FIXME inventory - categorized severity
[OK] Files scanned: 523 | Findings: 0 | 188ms
[Check 7/8] Unused code - dead private func/fn heuristic
[OK] Files scanned: 355 | Findings: 0 | 151ms
[Check 8/8] Retain cycles - missing [weak self] in closures
[OK] Files scanned: 244 | Findings: 0 | 200ms\n- ===========================================================
CLADE-SEAL: Trinity Promotion Seal
Dry run: false | Project: /Users/playra/BrowserOS/trios

Running clade-audit...
Running test...
Running clippy...
[SAVE] Seal artifact: /Users/playra/BrowserOS/trios/.trinity/state/seal.json

[OK] SEAL VALID\n-
running 101 tests
test crypto::tests::key_material_is_zeroized ... ok
test crypto::tests::allow_list_basic_operations ... ok
test crypto::tests::allow_list_verify_correct_key ... ok
test crypto::tests::allow_list_rejects_unverified_nodes ... ok
test crypto::tests::hard_cap_refuses_reuse ... ok
test crypto::tests::handshake_and_roundtrip ... ok
test crypto::tests::auto_rekey_at_frame_cap ... ok
test crypto::tests::noise_xx_rejects_wrong_static_key ... ok
test crypto::tests::out_of_order_within_window_ok ... ok
test crypto::tests::ratchet_changes_key ... ok
test crypto::tests::independent_handshakes_do_not_share_a_key ... ok
test crypto::tests::ratchet_resets_counter_and_window ... ok
test daemon::tests::convergence_ci_gate_fail_slow_link ... ok
test daemon::tests::convergence_ci_gate_fail_slow_node ... ok
test daemon::tests::convergence_ci_gate_pass_fast_link ... ok
test daemon::tests::convergence_ci_gate_pass_fast_node ... ok
test crypto::tests::replay_is_rejected ... ok
test crypto::tests::noise_xx_with_allow_list ... ok
test daemon::tests::convergence_emit_json_valid ... ok
test daemon::tests::convergence_metrics_initial_empty ... ok
test crypto::tests::noise_xx_roundtrip ... ok
test daemon::tests::convergence_metrics_records_link_loss ... ok
test daemon::tests::convergence_metrics_records_node_off ... ok
test daemon::tests::node_ci_gate_enforced ... ok
test crypto::tests::tamper_is_rejected ... ok
test daemon::tests::node_tracks_link_loss_detection ... ok
test crypto::tests::wrong_aad_is_rejected ... ok
test daemon::tests::node_tracks_node_off_detection ... ok
test discovery::tests::empty_heard_list_ok ... ok
test crypto::tests::short_frame_is_rejected ... ok
test discovery::tests::hello_roundtrips ... ok
test discovery::tests::fresh_beacon_accepted ... ok
test discovery::tests::authenticated_hello_roundtrip ... ok
test discovery::tests::mac_different_key_fails ... ok
test discovery::tests::old_beacon_rejected ... ok
test discovery::tests::truncated_is_rejected ... ok
test gf16::tests::fma_single_rounding ... ok
test discovery::tests::mac_verifies_authentic_beacon ... ok
test gf16::tests::gf16_scalar_roundtrip ... ok
test gf16::tests::phi_identity_anchor ... ok
test discovery::tests::mac_prevents_false_metric_attack ... ok
test gf16::tests::width_report_is_area_not_accuracy ... ok
test daemon::tests::data_frame_seals_and_opens ... ok
test modem::tests::clean_roundtrip_is_exact ... ok
test daemon::tests::tampered_header_fails_auth ... ok
test modem::tests::frame_is_self_delimiting ... ok
test daemon::tests::unknown_peer_has_no_session ... ok
test modem::tests::phase_inversion_is_resolved ... ok
test modem::tests::pure_noise_finds_no_frame ... ok
test modem::tests::recovers_through_awgn ... ok
test modem::tests::cfo_and_flip_do_not_alias ... ok
test modem::tests::clean_shaped_roundtrip_is_exact ... ok
test modem::tests::rrc_taps_unit_energy_and_symmetric ... ok
test modem::tests::recovers_through_fractional_delay ... ok
test modem::tests::recovers_through_delay_cfo_and_awgn ... ok
test modem::tests::sync_finds_preamble_after_leading_junk ... ok
test crypto::tests::noise_xx_resistant_to_mitm ... ok
test router::tests::addr_roundtrips_in_subnet ... ok
test modem::tests::queued_bursts_recover_in_order ... ok
test modem::tests::recovers_through_cfo_and_awgn ... ok
test router::tests::direct_delivery ... ok
test modem::tests::transport_iq_loopback ... ok
test router::tests::dead_direct_link_reroutes_via_relay ... ok
test router::tests::frame_from_unknown_link_is_dropped ... ok
test router::tests::hello_src_spoof_from_neighbor_is_rejected ... ok
test router::tests::legitimate_hello_from_neighbor_accepted ... ok
test router::tests::multi_hop_data_relay_not_affected_by_src_check ... ok
test router::tests::no_route_is_dropped ... ok
test router::tests::ranked_hops_empty_when_no_links ... ok
test router::tests::hot_swap_on_force_dead ... ok
test modem::tests::send_rejects_oversize_frame ... ok
test router::tests::next_hop_uses_ranked_primary ... ok
test router::tests::ranked_hops_selects_top_two ... ok
test router::tests::ttl_expiry_is_dropped ... ok
test routing::tests::best_next_hop_picks_lowest_finite_etx ... ok
test routing::tests::compute_path_etx_additive ... ok
test router::tests::ranked_hops_ignores_dead_links ... ok
test routing::tests::compute_path_etx_infinite_if_link_dead ... ok
test routing::tests::dead_direction_is_infinite ... ok
test routing::tests::feasibility_check_accepts_better_route ... ok
test routing::tests::feasibility_check_allows_first_route ... ok
test routing::tests::feasibility_check_rejects_equal_route ... ok
test routing::tests::feasibility_check_rejects_worse_route ... ok
test routing::tests::feasibility_prevents_loops ... ok
test router::tests::ranked_hops_single_when_one_link ... ok
test routing::tests::force_dead_marks_link_infinite ... ok
test routing::tests::half_forward_doubles_etx ... ok
test routing::tests::learn_route_rejects_self_route ... ok
test routing::tests::learn_route_uses_cumulative_etx ... ok
test routing::tests::no_neighbors_no_next_hop ... ok
test routing::tests::path_routes_returns_all_learned_routes ... ok
test routing::tests::perfect_link_is_etx_one ... ok
test wire::tests::bad_version_rejected ... ok
test wire::tests::wire_constants_match_spec ... ok
test wire::tests::header_roundtrips ... ok
test wire::tests::wire_predicates_match_spec ... ok
test router::tests::two_hop_relay_with_hop_by_hop_crypto ... ok
test modem::tests::recovers_long_frame_tail_coherent ... ok
test routing::tests::fuzz_100_random_topologies_no_loops ... ok
test daemon::tests::node_completes_reroute_records_metrics ... ok
test modem::tests::shaped_noise_false_alarm_rate_is_bounded ... ok

test result: ok. 101 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.09s

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s\n\nCloses when verification gates pass and report is landed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions