docs: reconcile design docs with shipped code (enums, Sms, per-channel retention, SiteCalls schema, conventions)
PLAN-04 Task 24. Component-Commons: AuditChannel gains SecuredWrite (5), AuditKind full 15-value list (+SecuredWrite*/ReconciliationAbandoned), NotificationType Email/Sms (Teams evaluated+dropped), AuditLogRow persistence-only-projection deviation note. ConfigDB: Type discriminator Email/Sms, data-layer conventions (UTC DateTime + Utc converter, MSSQL- only repos/fixtures, AuditLog clustered-key + P3/P4/P6 tracked follow-ups). SiteCallAudit: schema table rewritten to shipped columns (Channel/Target/AuditStatus-Status/SourceNode/ HttpStatus/IngestedAtUtc; no Kind/TargetSummary/provenance) + stored-vs-tracking-view note. AuditLog: per-channel retention config lists all 5 channels incl SecuredWrite. Also fixed two stale 'Teams planned' refs surfaced by the verification grep (HighLevelReqs, CentralUI).
This commit is contained in:
@@ -32,28 +32,50 @@ central node. Registered as component #22 in the Host role configuration.
|
||||
## The `SiteCalls` Table
|
||||
|
||||
Lives in the central MS SQL configuration database — a sibling of the
|
||||
`Notifications` table. One row per `TrackedOperationId`:
|
||||
`Notifications` table. One row per `TrackedOperationId` (the shipped columns, as
|
||||
mapped by `SiteCallEntityTypeConfiguration` — the source of truth is
|
||||
`Component-ConfigurationDatabase.md` § Site Calls):
|
||||
|
||||
- **TrackedOperationId** — GUID, primary key. Generated site-side at call time.
|
||||
- **SourceSite** — site that issued the call.
|
||||
- **SourceNode** — the cluster node on which the call was issued (`node-a` /
|
||||
`node-b`, qualified by `SourceSite`). Nullable. Stamped site-side at submit
|
||||
time and carried verbatim through the combined `CachedCallTelemetry` packet,
|
||||
reconciliation pulls, and the central upsert.
|
||||
- **Kind** — `TrackedOperationKind` enum: `ExternalCall` or `DatabaseWrite`.
|
||||
- **TargetSummary** — external system + method name for an `ExternalCall`; for a
|
||||
`DatabaseWrite`, just the database connection name — intentionally not the SQL
|
||||
statement or table, a deliberate scoping choice.
|
||||
- **Status** — `Pending`, `Retrying`, `Delivered`, `Parked`, `Failed`, `Discarded`.
|
||||
- **RetryCount** — attempts so far.
|
||||
- **LastError** — most recent error detail, if any.
|
||||
- **Provenance** — source instance / script.
|
||||
- **CreatedAtUtc**, **UpdatedAtUtc**, **TerminalAtUtc** — key timestamps.
|
||||
- **TrackedOperationId** — GUID (`varchar(36)`, "D"-format), primary key. Generated
|
||||
site-side at call time.
|
||||
- **Channel** — `varchar(32)`, the trust-boundary channel that produced the call:
|
||||
`ApiOutbound` (`ExternalSystem.CachedCall()`) or `DbOutbound` (`Database.CachedWrite()`).
|
||||
- **Target** — `varchar(256)`, human-readable target (e.g. `ERP.GetOrder` for an
|
||||
external call, or the database connection name for a cached write — intentionally
|
||||
not the SQL statement or table, a deliberate scoping choice).
|
||||
- **SourceSite** — `varchar(64)`, site that issued the call.
|
||||
- **SourceNode** — `varchar(64)` NULL, the cluster node on which the call was issued
|
||||
(`node-a` / `node-b`, qualified by `SourceSite`). Stamped site-side at submit time
|
||||
and carried verbatim through the combined `CachedCallTelemetry` packet,
|
||||
reconciliation pulls, and the central upsert; NULL for reconciled rows from a
|
||||
retired node.
|
||||
- **Status** — `varchar(32)`, the `AuditStatus` enum name (**not** the tracking-lifecycle
|
||||
names): `Submitted`, `Forwarded`, `Attempted`, `Delivered`, `Failed`, `Parked`,
|
||||
`Discarded`. The lifecycle is monotonic, so out-of-order/at-least-once telemetry is
|
||||
harmless.
|
||||
- **RetryCount** — `int`, attempts so far.
|
||||
- **LastError** — `nvarchar(1024)` NULL, most recent error detail, if any.
|
||||
- **HttpStatus** — `int` NULL, last HTTP status code for API calls.
|
||||
- **CreatedAtUtc**, **UpdatedAtUtc** (`datetime2`), **TerminalAtUtc** (`datetime2` NULL),
|
||||
**IngestedAtUtc** (`datetime2`, central ingest timestamp) — key timestamps.
|
||||
|
||||
There are **no `Kind`, `TargetSummary`, or provenance (instance/script) columns** —
|
||||
those were an earlier design that did not ship; provenance detail for a cached call
|
||||
lives on the site's own tracking store and in the AuditLog rows.
|
||||
|
||||
## Status Lifecycle
|
||||
|
||||
`Pending → Retrying → Delivered / Parked / Failed / Discarded`
|
||||
|
||||
> **Stored vs. tracking view.** This lifecycle is the operator-facing *tracking*
|
||||
> view (what the site's tracking store and `Tracking.Status()` express). The
|
||||
> persisted `SiteCalls.Status` **column** stores the monotonic `AuditStatus`-derived
|
||||
> string (`Submitted` / `Forwarded` / `Attempted` / `Delivered` / `Failed` / `Parked`
|
||||
> / `Discarded`) carried by the combined telemetry packet — the mirror records the
|
||||
> audit-event status, not the tracking enum name. The two agree on the terminal
|
||||
> outcomes; the non-terminal `Submitted`/`Forwarded`/`Attempted` strings are the
|
||||
> ingest-phase equivalents of `Pending`/`Retrying`.
|
||||
|
||||
- **Pending** — non-terminal: buffered after a transient failure, awaiting its
|
||||
first retry.
|
||||
- **Retrying** — non-terminal: undergoing retry attempts.
|
||||
|
||||
Reference in New Issue
Block a user