Data-Flow Foundation F1+F2 — PR3: Azure repository + ESLint guard#132
Merged
Conversation
Adds AzureHubRepository implementing HubRepository from @variscout/core/persistence. Dispatch short-circuits HUB_PERSIST_SNAPSHOT to saveProcessHubToIndexedDB (bootstrap); all other action kinds throw explicit P5.2/P5.3 not-yet-implemented error. Read APIs wire against existing Azure Dexie tables (processHubs, evidenceSources, evidenceSnapshots, evidenceSourceCursors); F3-pending entities (investigations, findings, questions, causalLinks, suspectedCauses) are stubbed. Module-scoped azureHubRepository singleton mirrors PWA composition-root pattern. apps/azure/CLAUDE.md updated with persistence-boundary invariant documenting R12+R13 exceptions. Co-Authored-By: ruflo <ruv@ruv.net>
…-hub outcomes test + dispatch error test
- hubs.list() now filters h.deletedAt === null; hubs.get stays unscoped (comment added)
- outcomes.get has O(n hubs) comment noting F3 normalization will remove the scan
- AzureHubRepository.read.test: hubs.list tombstone test + multi-hub outcomes.get test
- AzureHubRepository.test: HUB_PERSIST_SNAPSHOT error propagation test
- Fix 4: corrected misleading fake-indexeddb comment ("kept at line 1" → "must be the first import statement")
Co-Authored-By: ruflo <ruv@ruv.net>
Adds cascadeArchiveDescendants(parentKind, parentId, archivedAt) in apps/azure/src/persistence/cascadeArchive.ts. Uses transitiveCascade() from @variscout/core/persistence; wraps all Dexie writes in a single 'rw' transaction covering evidenceSnapshots, evidenceSources, evidenceSourceCursors, and processHubs. Per-kind stubs with F3 comments for investigation/finding/question/causalLink/suspectedCause/rowProvenance/ canvasState (no Azure tables today). Outcome cascade explicitly deferred to P5.3 per-action handler (hub blob mutation). Evidence source cursor hub-range query uses compound PK [hubId+sourceId] between(). 10 new tests covering: evidenceSource→cursor cascade, hub multi-table cascade, investigation no-op, rollback, idempotency, empty-descendants. Barrel updated to re-export the helper. Co-Authored-By: ruflo <ruv@ruv.net>
… fan-out test - Fix 1: add ## Atomic call pattern (P5.3+) section to cascadeArchiveDescendants JSDoc prescribing the outer-transaction wrapping pattern P5.3 must use to keep parent-row update + descendant cascade atomic; explains Dexie 4 zone reuse. - Fix 2: replace hedge comment in rollback test with confident pass-confirmation statement — rollback path verified green at P5.2 baseline (1098 tests). - Fix 3: add cursor2 for src2 in the hub multi-table cascade test to cover the fan-out path (hub → both evidenceSource cursors via compound key-range scan). Co-Authored-By: ruflo <ruv@ruv.net>
Implements all HubAction handlers in a new applyAction.ts module (Option B): - Hub-blob mutations (HUB_UPDATE_GOAL, HUB_UPDATE_PRIMARY_SCOPE_DIMENSIONS, OUTCOME_ADD, OUTCOME_UPDATE, OUTCOME_ARCHIVE) — read-modify-write via saveProcessHubToIndexedDB. - Direct Dexie table writes (EVIDENCE_ADD_SNAPSHOT, EVIDENCE_ARCHIVE_SNAPSHOT, EVIDENCE_SOURCE_ADD, EVIDENCE_SOURCE_UPDATE_CURSOR, EVIDENCE_SOURCE_REMOVE). - EVIDENCE_SOURCE_REMOVE atomically wraps cascade + parent soft-delete in a single db.transaction; outer table list is a superset of cascadeArchiveDescendants' internal transaction to satisfy Dexie zone propagation. - Session-only kinds (INVESTIGATION_*, FINDING_*, QUESTION_*, CAUSAL_LINK_*, SUSPECTED_CAUSE_*) — documented no-ops with F3 comment. - Canvas kinds — documented no-ops with HUB_PERSIST_SNAPSHOT-flow comment. - TypeScript exhaustiveness via assertNever() ensures compile-time completeness. AzureHubRepository.dispatch now delegates to applyAction after the HUB_PERSIST_SNAPSHOT short-circuit. Adds 73 new tests (1098 → 1171). Adds sustainment-deferral note to apps/azure/CLAUDE.md Invariants section. Co-Authored-By: ruflo <ruv@ruv.net>
…ernal barrel + idempotency notes Co-Authored-By: ruflo <ruv@ruv.net>
…cade + cursor sync)
Migration A: replace saveProcessHubToIndexedDB, saveEvidenceSourceToIndexedDB,
saveEvidenceSnapshotToIndexedDB in the three StorageProvider save methods with
azureHubRepository.dispatch(HUB_PERSIST_SNAPSHOT | EVIDENCE_SOURCE_ADD |
EVIDENCE_ADD_SNAPSHOT). Cloud-sync blocks unchanged. List/cache paths (lines 548,
595, 642) intentionally kept on direct localDb helpers (read-sync only).
Bootstrap save in listProcessHubs (line 548) left on direct call — it syncs cloud
→ local cache, not a hub-write dispatch path.
Migration B: replace db.evidenceSourceCursors.{get,put} in useEvidenceSourceSync
with azureHubRepository.evidenceSources.getCursor (Option B-1) and
dispatch(EVIDENCE_SOURCE_UPDATE_CURSOR). No direct Dexie usage remains in the file.
Tests: storage.test.ts — added db.processHubs mock for ensureDefaultProcessHubInIndexedDB;
added persistence mock for azureHubRepository.dispatch; added saveProcessHub /
saveEvidenceSource / saveEvidenceSnapshot tests asserting dispatch called with correct
action shapes. useEvidenceSourceSync.test.ts — replaced db.evidenceSourceCursors mock
with azureHubRepository mock; updated markSeen test to assert dispatch call shape.
Tests: 1173 → 1178 ✓ (5 new). Build: clean.
Co-Authored-By: ruflo <ruv@ruv.net>
…ence paths Add hoisted mocks + vi.mock factory entries for all six evidence-blob functions (listBlobEvidenceSnapshots, saveBlobEvidenceSnapshot, updateBlobEvidenceSnapshots, listBlobEvidenceSources, saveBlobEvidenceSource, updateBlobEvidenceSources). Previously the saveEvidenceSnapshotToCloud path called undefined blob functions which were silently swallowed, letting the cloud-sync assertion pass without the blob calls ever firing. Tighten the existing snapshot online test to assert exact dispatch shape (provenance: []) + blob function calls. Add parallel online + cloud-sync test for saveEvidenceSource covering dispatch shape and blob function calls. Tests: 1178→1179. Co-Authored-By: ruflo <ruv@ruv.net>
- P7.1: Update packages/stores, apps/pwa, apps/azure CLAUDE.md files to explicitly state the dispatch-only invariant (domain stores never import dexie directly; access via HubRepository / pwaHubRepository.dispatch / azureHubRepository.dispatch). Update "will add" references to past tense now that P7.2 delivers the rule. Enumerate R12+R13 exceptions clearly in each file. - P7.2: Add ESLint no-restricted-imports rule in eslint.config.js blocking dexie package imports and **/db/schema glob imports outside the documented allow-list (persistence/, db/, wallLayoutStore.ts, azure services/storage + localDb + cloudSync + lib/persistence, test files). Smoke-tested: rule fires on ProcessHubEvidencePanel.tsx with clear actionable message; passes cleanly against current codebase (0 errors). - P7.3: Confirmed pnpm lint is already a step in pr-ready-check.sh (no script change needed). pr-ready-check passes end-to-end. Co-Authored-By: ruflo <ruv@ruv.net>
…ered - Minor #1: add bootstrap cache-fill comment above storage.ts:548 for-loop - Minor #2: R12 self-document comment on wallLayoutStore Dexie import - Minor #3: fix plan frontmatter category (implementation-plan/audit → implementation) - decision-log: F1+F2 closeout entry (what/why/deltas) + session backlog row - spec: 2026-05-06-data-flow-foundation-design.md status active → delivered Co-Authored-By: ruflo <ruv@ruv.net>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jukka-matti
added a commit
that referenced
this pull request
May 6, 2026
PR3 (Azure repository + ESLint guard) merged at 2490fc8, completing F1+F2 across all three squash commits on origin/main: - d2822ea PR #130 (F1 types) - 7fc1a36 PR #131 (F2 PWA) - 2490fc8 PR #132 (F2 Azure + ESLint guard) Plan updated with F1+F2 SHIPPED block + Session 3 closeout (P5-P8 delivered, plan-reality deltas, F-series forward, watchlist). Original Session 2 closeout preserved as PR2 history. Spec already flipped status: active → delivered as part of PR3 P8.2. Co-Authored-By: ruflo <ruv@ruv.net>
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dexiepackage imports and**/db/schemaimports outside R12+R13 allow-list; CLAUDE.md files updated in packages/stores, apps/pwa, apps/azure.Plan-reality deltas (documented in decision-log)
**/db/schemaimports (broader regression guard).--chromewalk deferred to user pre-merge (mirrors PR2 precedent).Final review (P8.1 Opus)
Ready to merge. 0 Critical, 0 Important, 3 Minor doc polish — bundled into P8.3 closeout commit.
Test plan
bash scripts/pr-ready-check.shgreen (verified pre-push)claude --chromewalk in Azure (sign in, paste CSV, evidence sources flow, archive cascade, multi-hub isolation) before squash-merge🤖 Generated with ruflo