Commit Graph

146 Commits

Author SHA1 Message Date
Joseph Doherty
39a3ca3347 docs(audit): expand M2-M8 to full TDD-detail tasks
Per user request: every milestone now carries bite-sized TDD tasks
(write failing test -> run failing -> implement -> run passing -> commit),
matching M1's density. Each task lists exact file paths, numbered steps,
and a commit message.

Task counts per milestone:
- M1 Foundation: 11
- M2 Site pipeline (sync-only): 12
- M3 Cached operations + dual-write (inlines #22 + cached-call tracking): 18
- M4 Remaining boundary emission: 12
- M5 Payload + redaction policy: 10
- M6 Reconciliation, purge, partition maintenance, metrics: 12
- M7 Central UI: 16
- M8 CLI: 9
Total: ~100 bite-sized tasks.

The roadmap remains the contract; per-milestone execution still goes
through brainstorm -> writing-plans -> subagent-driven-development to
produce a milestone-specific .tasks.json. Tasks in this roadmap will
shift slightly as M1 reveals codebase realities; treat them as the
intended shape rather than immutable IDs.
2026-05-20 09:32:59 -04:00
Joseph Doherty
d3d4a5b13d docs(audit): add 8-milestone code implementation roadmap
Roadmap covering Audit Log (#23) code implementation across 8 milestones
(M1 Foundation → M8 CLI). Reflects the actual state of the codebase —
all 22 prior components have source + tests, but Site Call Audit (#22)
and cached-call tracking are design-only despite being on main; their
minimum surface is inlined into M3.

M1 is laid out at full TDD-level task detail (11 bite-sized tasks).
M2–M8 are at milestone-shape detail (goals, files, task headlines,
acceptance criteria, risk callouts). Per-milestone bite-sized plans
will be generated by brainstorm + writing-plans when each milestone is
about to execute — locking 80 task cards now would mostly be stale by
M5 as M1 reveals codebase realities.

Critical path: M1 → M2 → (M3 ∥ M4 ∥ M5) → M6 → (M7 ∥ M8).

Spec: docs/requirements/Component-AuditLog.md + alog.md (commit
fec0bb1).
2026-05-20 09:22:18 -04:00
Joseph Doherty
c929562e41 docs(audit): apply cross-bundle review fixes before merge
Final cross-bundle reviewer identified 7 inconsistencies that the per-bundle
reviewers couldn't see; all fixed in one logical commit.

Critical:
- HighLevelReqs AL-3: drop 'then upsert-on-newer-status' — AuditLog is
  strictly append-only (correct for SiteCalls/Notifications, wrong for
  the immutable AuditLog shadow).
- Component-AuditLog Error rate KPI: align with HealthMonitoring's
  exclusion list (Success/Delivered/Enqueued) rather than just non-Success;
  otherwise every Delivered notification or Enqueued cached call would be
  counted as an error.

Important:
- Component-AuditLog line 154: ISiteAuditWriter -> IAuditWriter (canonical
  name per Commons and the rest of this doc).
- Component-AuditLog Central direct-write paragraph: convert remaining
  slash notation (ApiInbound/Completed, Notification/Attempt,
  Notification/Terminal) to dot notation used everywhere else.
- Component-ClusterInfrastructure: scope SiteCallAuditActor to
  reconciliation + KPIs + Retry/Discard relay; cached-telemetry ingest is
  AuditLogIngestActor's role per Combined Telemetry contract.
- Component-CentralUI Audit Log page: state the OperationalAudit read
  permission and the read-vs-export split (matching CLI doc).
- Component-NotificationOutbox: add never-fail-the-action invariant for
  dispatcher audit writes.

Minor:
- Component-InboundAPI: 'Non-blocking semantics' was ambiguous (could be
  read as async); reword to 'Fail-soft' — the write is still synchronous
  before flush, but failures are caught and don't change the response.
- Component-CLI: realign audit-query/audit-export flags to actually match
  the Central UI Audit Log filter set (channel, kind, status, site,
  instance, target, actor, correlation-id, errors-only); drop --user and
  --entity-id which are IAuditService concepts, not Audit Log columns.
- Component-AuditLog KPI tile names: 'Volume/Error rate/Backlog' ->
  'Audit volume/Audit error rate/Audit backlog' (matches Central UI and
  Health Monitoring); drop the two orphan KPIs (Top inbound callers, Top
  outbound 5xx) that were never surfaced anywhere.
- Component-AuditLog Interactions: re-attribute DbOutbound emissions to
  ESG (where Database.* lives) with a note that Site Runtime is the API
  surface for scripts.
- HighLevelReqs AL-12: drop 'and reconciliation operations' (CLI has no
  reconcile command; reconciliation is an internal self-healing pull).
  Add note that verify-chain becomes operational once AL-11's hash chain
  ships.
2026-05-20 09:00:11 -04:00
Joseph Doherty
34ea97bae9 docs(audit): cross-reference cleanup — drop stray § symbols, use prose anchors 2026-05-20 08:47:59 -04:00
Joseph Doherty
e6e450a257 docs(audit): add Centralized Audit Log requirements (AL-1..AL-12) to HighLevelReqs 2026-05-20 08:42:04 -04:00
Joseph Doherty
f205746894 docs(audit): disambiguate Config DB refs to 'audit log viewer' post-rename
Task 10's reviewer noted that Component-CentralUI.md renamed the
IAuditService page from 'Audit Log Viewer' to 'Configuration Audit Log
Viewer' to avoid collision with the new operational Audit Log page (#23).
Two stale lowercased refs in Component-ConfigurationDatabase.md needed
the same disambiguation.
2026-05-20 08:39:13 -04:00
Joseph Doherty
8d922391b8 docs(audit): add Audit nav group, Audit Log page, drill-ins, and KPI tiles to Central UI 2026-05-20 08:34:28 -04:00
Joseph Doherty
72388a7616 docs(audit): fix Audit error rate semantics and CLI permission split
Bundle D code-review feedback on 0ae1a25 and e6f7a7f:

- Audit error rate (HealthMonitoring tile) was described as a combined
  view of CentralAuditWriteFailures + AuditRedactionFailure (writer
  health). Per alog.md §10.3 / §14.1 it is the operational error rate
  of audited operations: % of central AuditLog rows with Status not
  in (Success/Delivered/Enqueued) over a rolling 5-min window. Audit
  writer issues surface separately via the dedicated metrics.

- Audit volume description gains the spec-mandated 'events/min, global
  + per-site sparkline' shape.

- CLI: scadalink audit was claiming all three subcommands need both
  OperationalAudit and AuditExport. Per alog.md §11.2 / §15.1, read
  (query, verify-chain) needs OperationalAudit; bulk export
  additionally requires AuditExport. Restored the spec's split.
2026-05-20 08:30:42 -04:00
Joseph Doherty
e6f7a7ff79 docs(audit): add scadalink audit command group to CLI 2026-05-20 08:26:40 -04:00
Joseph Doherty
0ae1a254d7 docs(audit): add Audit Log health metrics and dashboard tiles 2026-05-20 08:26:03 -04:00
Joseph Doherty
61ec4161bf docs(audit): emit ApiInbound.Completed audit row per request 2026-05-20 08:25:14 -04:00
Joseph Doherty
c7ddfc7140 docs(audit): central direct-write of notification dispatch events to AuditLog 2026-05-20 08:20:44 -04:00
Joseph Doherty
8a3e61c670 docs(audit): note shared cached-operation telemetry with Audit Log 2026-05-20 08:20:06 -04:00
Joseph Doherty
2039b1ddca docs(audit): emit AuditLog rows from External System Gateway call paths 2026-05-20 08:06:12 -04:00
Joseph Doherty
117fa39d35 docs(audit): note IAuditWriter hook and site SQLite in Site Runtime 2026-05-20 08:05:31 -04:00
Joseph Doherty
1517b9a03f docs(audit): fix cross-ref to use prose anchor in Component-AuditLog.md
Reviewer flag on 1bbfad3: "per Component-AuditLog.md, §6.2" pointed at
alog.md numbering, not at any anchor in Component-AuditLog.md (which uses
prose subsection titles). Switch to the prose anchor (Ingestion Paths →
Telemetry forward) so the link resolves.
2026-05-20 08:03:50 -04:00
Joseph Doherty
1bbfad3fcd docs(audit): register AuditLog singletons in Cluster Infrastructure 2026-05-20 07:59:13 -04:00
Joseph Doherty
36a598840f docs(audit): add AuditLog table, partitioning, and DB roles to Config DB 2026-05-20 07:58:27 -04:00
Joseph Doherty
acb160ecce docs(audit): fix plan reference to existing CachedCallTelemetry message
Task 2's spec reviewer flagged that the plan used a non-existent name
'CachedOperationTelemetry' when describing the additively-evolved cached
telemetry message. The existing message is 'CachedCallTelemetry'; renaming
would violate Commons REQ-COM-5a (additive-only). Plan now reflects the
in-place additive evolution and warns against rename.
2026-05-20 07:53:23 -04:00
Joseph Doherty
0daa63076d docs(audit): register AuditEvent, IAuditWriter, AuditTelemetry types in Commons 2026-05-20 07:48:36 -04:00
Joseph Doherty
08ccd72365 docs(audit): fix Ingestion Paths count and Purpose conjunction wording
Code-review feedback on c334de0:
- Ingestion Paths intro said 'Three write paths' but the section has four
  subsections (site hot-path append + 3 central writers). Reword to 'Four
  paths feed the central AuditLog -- one site originator and three central
  writers'.
- Purpose: 'dashboards plus drilldowns plus filter queries' read awkwardly;
  switch to standard comma list.
2026-05-20 07:44:54 -04:00
Joseph Doherty
c334de03f4 docs(audit): add Component-AuditLog (#23) design document 2026-05-20 07:36:35 -04:00
Joseph Doherty
d93ca4c56e docs(audit): add implementation plan for centralized audit log
See docs/plans/2026-05-20-centralized-audit-log.md and peer .tasks.json.
17 tasks covering Component-AuditLog.md plus cross-references across
11 affected component docs, README, HighLevelReqs, and CLAUDE.md.
Spec is alog.md at commit fec0bb1.
2026-05-20 07:32:47 -04:00
Joseph Doherty
ec82027bd2 docs(requirements): register Site Call Audit in the Host component matrix 2026-05-19 12:09:01 -04:00
Joseph Doherty
d8d47821e3 docs(requirements): reconcile cross-references for Site Call Audit 2026-05-19 12:06:02 -04:00
Joseph Doherty
c2cd62e72a docs(requirements): note shared TrackedOperationId model in notification docs 2026-05-19 12:00:45 -04:00
Joseph Doherty
e681a1f0e1 docs(requirements): add Site Call Audit KPIs to Health Monitoring 2026-05-19 11:58:46 -04:00
Joseph Doherty
7589ea8da9 docs(requirements): list Site Call Audit KPI tiles on the Central UI health dashboard 2026-05-19 11:57:59 -04:00
Joseph Doherty
e471a5a855 docs(requirements): add Site Calls page to Central UI 2026-05-19 11:56:02 -04:00
Joseph Doherty
77cc4865c5 docs(requirements): add SiteCalls table and purge to Configuration Database 2026-05-19 11:53:54 -04:00
Joseph Doherty
d46cb56934 docs(requirements): correct cached-call telemetry lifecycle states in Communication 2026-05-19 11:52:34 -04:00
Joseph Doherty
d43d43d795 docs(requirements): add cached-call telemetry pattern to Communication 2026-05-19 11:50:55 -04:00
Joseph Doherty
00ec265980 docs(requirements): add Tracking.Status and cached-call handles to Script Runtime API 2026-05-19 11:48:45 -04:00
Joseph Doherty
f839f6ce45 docs(requirements): make cached-write and cached-call docs symmetric 2026-05-19 11:47:30 -04:00
Joseph Doherty
354314dfe0 docs(requirements): cached calls return TrackedOperationId in ESG 2026-05-19 11:45:41 -04:00
Joseph Doherty
320e4d7479 docs(requirements): document Failed terminal state for permanent cached-call failures 2026-05-19 11:44:23 -04:00
Joseph Doherty
17ef5f85de docs(requirements): add site-local tracking table and telemetry to Store-and-Forward 2026-05-19 11:42:20 -04:00
Joseph Doherty
5efbb9a985 docs(requirements): name TrackedOperationKind enum and clarify status-enum relationships 2026-05-19 11:40:18 -04:00
Joseph Doherty
397498c120 docs(requirements): add TrackedOperationId and cached-call contracts to Commons 2026-05-19 11:37:04 -04:00
Joseph Doherty
e0026c6da7 docs(requirements): clarify Site Call Audit lifecycle states and actionability 2026-05-19 11:34:44 -04:00
Joseph Doherty
627c48c458 docs(requirements): add Site Call Audit component (#22) 2026-05-19 11:32:00 -04:00
Joseph Doherty
a08ad09514 docs(plans): add cached-call tracking implementation plan 2026-05-19 11:30:21 -04:00
Joseph Doherty
e7ed858920 docs(plans): design cached-call tracking with trackable IDs
Add TrackedOperationId handles to CachedCall/CachedWrite under a unified tracking model. New site-local tracking table is the status source of truth; new central Site Call Audit component (#22) mirrors status via telemetry, exposes KPIs and a Site Calls UI page with central->site Retry/Discard.
2026-05-19 11:26:37 -04:00
Joseph Doherty
7ecf6448e3 docs(plans): mark Notifications nav group tasks complete 2026-05-19 06:31:23 -04:00
Joseph Doherty
0904401f1e docs(plans): implementation plan for Notifications nav group 2026-05-19 05:08:52 -04:00
Joseph Doherty
113f00a6fa docs(plans): design for Notifications nav group 2026-05-19 05:01:58 -04:00
Joseph Doherty
b88c75c116 docs(plans): track Task 19 follow-ups (site DI cleanup, sandbox API, SourceScript) 2026-05-19 02:35:47 -04:00
Joseph Doherty
435c853dce docs(plans): track SMTP-helper deduplication follow-up 2026-05-19 01:33:21 -04:00
Joseph Doherty
dff9e0aa76 docs(plans): code implementation plan for the notification outbox
26 TDD tasks across six phases — data layer, message contracts, the new
ScadaLink.NotificationOutbox project (actor, dispatcher, Email adapter),
site S&F retarget and central wiring, Central UI, and verification.
2026-05-19 00:39:10 -04:00
Joseph Doherty
f2513a4ef4 docs(notification-outbox): fix stale message-pattern count and tree alignment 2026-05-18 23:52:10 -04:00