From d8195992e519343d6d8ff7fb17aa98358800d913 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 16 Jul 2026 23:48:10 -0500 Subject: DomainDig v4.4.1: Consolidate Audit Mode and remove the CLI target - Make DomainDig/DomainDig/Audit* the single active Audit Mode implementation (models, views, exporter) with an Audit tab and session/export UI - Include audit sessions in backup/restore lifecycle counts, summaries, and merge behavior via DomainDataPortabilityService - Remove the DomainDigCLI target, source file, scheme, and all project references; keep the shared inspection/report pipeline for the app - Align AppVersion.current to 4.4.1 and refresh README/architecture docs - Add RELEASE_ROADMAP.md --- Docs/ARCHITECTURE.md | 101 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 73 insertions(+), 28 deletions(-) (limited to 'Docs') diff --git a/Docs/ARCHITECTURE.md b/Docs/ARCHITECTURE.md index 0d364d6..c006b40 100644 --- a/Docs/ARCHITECTURE.md +++ b/Docs/ARCHITECTURE.md @@ -1,48 +1,93 @@ -# DomainDig v3.0.0 Architecture +# DomainDig v4.4.1 Architecture ## Overview -DomainDig is a local-first inspection platform built around one canonical output model: `DomainReport`. +DomainDig is a local-first inspection and audit app built around one canonical output model: `DomainReport`. Inspection flow: -1. `DomainInspectionService.inspect(domain:)` gathers live and cached section data into `LookupSnapshot`. -2. `DomainReportBuilder` converts the snapshot into a canonical `DomainReport`. -3. UI, exports, and CLI rendering derive from `DomainReport`. +1. `LookupRuntime` coordinates the section services that gather DNS, web, TLS, ownership, reachability, redirect, email, port, and enrichment data. +2. `DomainInspectionService` normalizes live and cached results into `LookupSnapshot`. +3. `DomainReportBuilder` converts each snapshot into the canonical `DomainReport`. +4. SwiftUI screens, exports, and the local API render from `DomainReport` or data derived from it. -`LookupSnapshot` remains an internal collection and persistence shape. `DomainReport` is the stable presentation and export contract. +`LookupSnapshot` remains the internal persistence shape for raw inspection state. `DomainReport` is the stable presentation/export contract. -## Canonical Report Lifecycle +## App Layers -- `LookupRuntime` coordinates section services. -- `DomainInspectionService` normalizes failures, provenance, cache state, and section metadata. -- `DomainReportBuilder` adds summaries, insights, risk scoring, change analysis, workflow context, and report metadata. -- `DomainReportExporter` renders TXT, CSV, and JSON from the same report payload. -- `DomainDigCLI` prints exporter output directly so CLI output matches the app. +- Section services: network collection and local normalization only. +- `LookupRuntime`: orchestrates section services for a single inspection. +- `DomainInspectionService`: builds inspection snapshots with provenance, cache state, and failure metadata. +- `DomainReportBuilder`: assembles summaries, insights, risk scoring, workflow context, and report metadata. +- `DomainReportExporter`: renders TXT, CSV, and JSON output for app and local API use. +- `DomainViewModel`: coordinates SwiftUI state, persistence, audit sessions, monitoring, workflows, batch operations, imports, and exports. +- SwiftUI views: render screens and invoke view-model actions. + +## Audit Mode + +The app has one active Audit Mode implementation: + +- Models live in `DomainDig/DomainDig/AuditModels.swift`. +- UI lives in `DomainDig/DomainDig/AuditViews.swift`. +- Export rendering lives in `DomainDig/DomainDig/AuditExporter.swift`. +- Persistence is owned by `DomainViewModel` through `DomainDataPortabilityService`. + +An audit session captures: + +- Domain and reviewer metadata +- Session status +- Point-in-time `HistoryEntry` and `DomainReport` +- Historical snapshot context +- Evidence asset references +- Checklist progress +- Findings with severity, status, evidence references, notes, and checklist areas +- Reviewer notes + +Audit sessions are stored under the same local portability service as the rest of app data and are included in full backup/restore flows. + +The older standalone prototype files, `DomainDig/AuditMode.swift` and `DomainDig/AuditModeView.swift`, are preserved in the repository for reference but excluded from synchronized target membership. They are not the release audit path. + +## Data Portability + +`DomainDataPortabilityService` owns backup, import, validation, lifecycle counts, and merge/replace behavior for: + +- Tracked domains +- History snapshots +- Audit sessions +- Workflows +- Monitoring settings and logs +- App settings +- Local feature metadata + +Backup imports support merge and replace modes. Merge mode deduplicates by stable IDs or normalized domain keys, keeps local data where appropriate, and merges audit-session reviewer notes when the same audit session appears in multiple backups. ## Feature Tiers -The app now uses `FeatureAccessService` as the single feature gating surface. +`FeatureAccessService`, `PremiumAccessService`, `PurchaseService`, and `UsageCreditService` provide the app's feature-gating surfaces. + +The app remains local-first. Purchase and entitlement code is local app infrastructure and does not introduce a hosted DomainDig backend. + +## Local API + +`LocalAPIService` is an automation surface over the same inspection/reporting pipeline: -- `Free`: single lookup, basic history, limited tracking -- `Pro`: workflows, batch operations, advanced exports -- `Data+`: future historical datasets and extended enrichment +- `DomainInspectionService` +- `DomainReportBuilder` +- `DomainReportExporter` +- `LocalAPIModels` -Current release behavior is static scaffolding only. There are no purchases, backend checks, or remote entitlements. +The major-version roadmap calls for a stronger compatibility promise around this local API contract in `v5.0.0`. -## Data Boundaries +## Xcode Project Structure -- Inspection services: network collection only -- `DomainReportBuilder`: canonical model assembly -- `FeatureAccessService`: tier and capability checks -- `DomainViewModel`: UI orchestration, persistence, batch coordination -- Views: rendering and interaction only +`DomainDig.xcodeproj` uses filesystem-synchronized groups for the `DomainDig` folder. Target membership exclusions are therefore important release metadata. Files that should remain in the tree but not compile, such as retired prototypes, must be listed in the appropriate synchronized build file exception set. -## Adding a New Data Source +## Adding A New Data Source -1. Add the raw collection call to `LookupRuntime`. +1. Add the raw collection call to `LookupRuntime` or an existing section service. 2. Integrate it in `DomainInspectionService` with provenance, cache source, and normalized failures. 3. Extend `LookupSnapshot` only if the raw result must persist. -4. Add the summarized representation to `DomainReportBuilder`. -5. Expose it through `DomainReportExporter` if it should appear in TXT, CSV, JSON, or CLI. -6. Render the new summary in SwiftUI using `DomainReport` fields. +4. Add summarized representation to `DomainReportBuilder`. +5. Expose it through `DomainReportExporter` or `LocalAPIModels` when it is part of the external contract. +6. Render it in SwiftUI from `DomainReport` fields or view-model state. +7. Update backup/restore only when the data is user-authored state or long-lived app state. -- cgit v1.2.3