summaryrefslogtreecommitdiff
path: root/Docs/ARCHITECTURE.md
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-08-02 15:29:31 -0500
committerChristian Cleberg <[email protected]>2026-08-02 15:35:31 -0500
commitfe83ff502ffcaa59c7a22471c634d565972e7644 (patch)
treefd17e5bc79d79973209ef712d44ede00b3a009e4 /Docs/ARCHITECTURE.md
parenta6ed5c3546300994ab4d8b9840445d384b0083ed (diff)
downloaddomain-dig-main.tar.gz
domain-dig-main.tar.bz2
domain-dig-main.zip
convert readme to nfo; convert docs to txt; relicense to 0bsdHEADmain
Diffstat (limited to 'Docs/ARCHITECTURE.md')
-rw-r--r--Docs/ARCHITECTURE.md102
1 files changed, 0 insertions, 102 deletions
diff --git a/Docs/ARCHITECTURE.md b/Docs/ARCHITECTURE.md
deleted file mode 100644
index d0d2108..0000000
--- a/Docs/ARCHITECTURE.md
+++ /dev/null
@@ -1,102 +0,0 @@
-# DomainDig Architecture
-
-## Overview
-
-DomainDig is a local-first inspection and audit app built around one canonical output model: `DomainReport`.
-
-Inspection flow:
-
-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 the internal persistence shape for raw inspection state. `DomainReport` is the stable presentation/export contract.
-
-## App Layers
-
-- 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, JSON, Markdown, and PDF output for app and local API use.
-- `DomainViewModel`: coordinates SwiftUI state, persistence, audit sessions, monitoring, workflows, batch operations, imports, and exports. Its surface is split by concern across `DomainViewModel+Audit`, `+Monitoring`, `+Export`, `+Workflows`, `+History`, and `+Widget` extensions; the core type keeps the stored state and the inspection pipeline.
-- SwiftUI views: render screens and invoke view-model actions. The largest view file was decomposed too — Settings screens live in `SettingsViews.swift` and the result detail sections in `ResultSectionViews.swift`.
-
-## 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
-
-`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:
-
-- `DomainInspectionService`
-- `DomainReportBuilder`
-- `DomainReportExporter`
-- `LocalAPIModels`
-
-`v5.0.0` stabilized this contract: `LocalAPIContract` is the single source of truth for the `v1` wire version and JSON encoder, the response envelope and payloads are documented, and the shape is regression-locked by `LocalAPIContractTests`. See [local-api.md](local-api.md) for the endpoint and compatibility reference, and [data-migration.md](data-migration.md) for how the persisted store is versioned across app updates.
-
-## Testing
-
-Two test targets run from the `DomainDig` scheme's test action:
-
-- `DomainDigTests` — unit coverage of the deterministic core: `DomainReportBuilder`, `DomainReportExporter`, `DiffService`, `DomainDataPortabilityService` (merge/replace dedup), the store-migration runner, and the Local API contract. `SnapshotFixture` builds the deep `LookupSnapshot`/`DomainReport` models through the real builder so tests construct inputs without wiring every field.
-- `DomainDigUITests` — Apple's `performAccessibilityAudit()` over every primary screen at default and largest Dynamic Type, plus metadata and screenshot assertions. See [ACCESSIBILITY.md](ACCESSIBILITY.md).
-
-A plain `xcodebuild test` (and CI) runs both. The unit net went in first in `v5.0.0` and is what made the god-file decomposition safe to attempt.
-
-## Xcode Project Structure
-
-`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
-
-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 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.