You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace ad hoc local arrays with a versioned, validated, concurrency-safe subsystem for decision history, trusted policy, diagnostics, export, retention, deletion, and migration, with privacy documentation matching executable behavior.
Audit evidence and problem
src/lib/history.ts persists destination, asset, score, decision, tier, and exact timestamp.
PRIVACY.md incorrectly says nothing is written to Chrome/local storage.
readHistory() trusts any array and recordDecision() uses a race-prone read-modify-write.
background.ts records only scores[0], even when another or multiple targets drove the warning.
Records omit network, adapter, digest, provenance, coverage, policy version, and terminal reason; UI recomputes historical tier under current code.
Storage errors are swallowed.
storageHelper.ts stores unbounded arbitrary trusted strings without validation, network/type scope, provenance, expiry, or schema version.
The trusted manager is disconnected: production never adds addresses and signing never consults them.
No complete data inventory, export, clear-all, migration, or retention workflow exists.
Non-negotiable invariants
Policy/docs enumerate every persisted field, purpose, retention, and deletion path.
Concurrent writes cannot silently lose records or policy changes.
Stored data is untrusted and schema-validated.
Historical records retain their original evidence/policy meaning.
Multi-target decisions are never reduced to a misleading first target.
Trust is network/type-aware and cannot make unassessed semantics safe.
Per-class clearing is isolated; clear-all deletes every documented class.
Corruption cannot grant trust, inject UI, or crash the extension.
Export is explicit, bounded, versioned, and privacy-labeled.
Storage failure never changes the actual signing outcome.
Required scope
A. Governance and storage boundary
Inventory ephemeral state, history, trust, cache, diagnostics, and configuration. Define sensitivity, retention, migration, deletion, and export. Implement one versioned storage boundary with runtime schemas, revisions, typed errors, corruption handling, and bounded reads/writes.
B. Faithful audit records
Use Epic 3’s canonical review schema to retain the actual reviewed targets/findings, network, adapter, evidence provenance/freshness, displayed state, policy version, decision, and terminal reason while deliberately minimizing identifiers and time precision.
C. Trusted-target policy
Define whether trust adds context or alters assessment; validate target types, scope by network/type, support labels/provenance/expiry, and never suppress opaque/admin/authority/unavailable findings. Integrate it or remove the misleading surface until implemented.
D. Retention/export/deletion
Provide per-class counts, retention controls, separate exports and clears, clear-all, sensitivity notices, and storage failure UI. Do not bundle diagnostics with transaction history by default.
E. Restart-safe migration
Migrate legacy arrays idempotently without inventing missing network/provenance. Define rollback/recovery across worker termination and interrupted upgrades.
Deliverables
Data-governance ADR, inventory, corrected privacy policy, and data-management UI.
Versioned schemas/repository and concurrency-safe mutations.
Legacy migrations and corruption handling.
Faithful multi-target audit schema.
Network-aware trusted-target policy.
Retention, export, per-class clear, and clear-all workflows.
Migration, concurrency, privacy, accessibility, and large-data tests.
Acceptance criteria
Policy/UI enumerate every production key, field category, purpose, retention, and deletion control.
Fifty concurrent record writes preserve all accepted records up to the limit.
Privacy correction and storage foundation can begin now. Final records depend on Epic 2 evidence and Epic 3 review schemas; trust uses Epic 3 typed targets; diagnostics uses Epic 4 taxonomy.
Complexity
Very High
Impact
High — current state can lose records, misstate multi-target reviews, apply unscoped trust, and contradict published privacy claims.
Outcome
Replace ad hoc local arrays with a versioned, validated, concurrency-safe subsystem for decision history, trusted policy, diagnostics, export, retention, deletion, and migration, with privacy documentation matching executable behavior.
Audit evidence and problem
src/lib/history.tspersists destination, asset, score, decision, tier, and exact timestamp.PRIVACY.mdincorrectly says nothing is written to Chrome/local storage.readHistory()trusts any array andrecordDecision()uses a race-prone read-modify-write.background.tsrecords onlyscores[0], even when another or multiple targets drove the warning.storageHelper.tsstores unbounded arbitrary trusted strings without validation, network/type scope, provenance, expiry, or schema version.Non-negotiable invariants
Required scope
A. Governance and storage boundary
Inventory ephemeral state, history, trust, cache, diagnostics, and configuration. Define sensitivity, retention, migration, deletion, and export. Implement one versioned storage boundary with runtime schemas, revisions, typed errors, corruption handling, and bounded reads/writes.
B. Faithful audit records
Use Epic 3’s canonical review schema to retain the actual reviewed targets/findings, network, adapter, evidence provenance/freshness, displayed state, policy version, decision, and terminal reason while deliberately minimizing identifiers and time precision.
C. Trusted-target policy
Define whether trust adds context or alters assessment; validate target types, scope by network/type, support labels/provenance/expiry, and never suppress opaque/admin/authority/unavailable findings. Integrate it or remove the misleading surface until implemented.
D. Retention/export/deletion
Provide per-class counts, retention controls, separate exports and clears, clear-all, sensitivity notices, and storage failure UI. Do not bundle diagnostics with transaction history by default.
E. Restart-safe migration
Migrate legacy arrays idempotently without inventing missing network/provenance. Define rollback/recovery across worker termination and interrupted upgrades.
Deliverables
Acceptance criteria
Required verification
Adversarial schema tests, property-based migration/retention tests, deterministic interleaving tests, worker-restart migration tests, real Chrome storage integration, documentation-to-key privacy checks, export redaction/round-trip tests, large-data performance, accessibility, and trusted-policy security review. Simple mocked one-record tests are insufficient.
Out of scope
Cloud sync, remote telemetry/upload, blockchain settlement history, uninstall recovery, and pending-request state.
Dependencies and sequencing
Privacy correction and storage foundation can begin now. Final records depend on Epic 2 evidence and Epic 3 review schemas; trust uses Epic 3 typed targets; diagnostics uses Epic 4 taxonomy.
Complexity
Very High
Impact
High — current state can lose records, misstate multi-target reviews, apply unscoped trust, and contradict published privacy claims.
Suggested labels
epicprivacydata-integritystoragesecuritymigrationux-correctness