Skip to content

Add testing readiness review and action plan - #2

Merged
Chris0Jeky merged 1 commit into
mainfrom
codex/review-documents-and-improve-testing-strategy
Nov 18, 2025
Merged

Add testing readiness review and action plan#2
Chris0Jeky merged 1 commit into
mainfrom
codex/review-documents-and-improve-testing-strategy

Conversation

@Chris0Jeky

Copy link
Copy Markdown
Owner

Summary

  • add TESTING_READINESS.md outlining current testing posture
  • document quickstart smoke steps and prioritized testing actions
  • propose medium-term CI and quality gate improvements

Testing

  • not run (documentation-only change)

Codex Task

@Chris0Jeky
Chris0Jeky merged commit cfabdd8 into main Nov 18, 2025
@Chris0Jeky
Chris0Jeky deleted the codex/review-documents-and-improve-testing-strategy branch November 18, 2025 03:44
Chris0Jeky added a commit that referenced this pull request Feb 16, 2026
…ove-testing-strategy

Add testing readiness review and action plan
Chris0Jeky added a commit that referenced this pull request Apr 9, 2026
TryConsumeAtomicAsync now includes ExpiresAt > now in the WHERE clause
to close the TOCTOU race window between application-level expiry check
and SQL execution.

DeleteExpiredAsync now uses raw SQL instead of loading all rows into
memory (DoS prevention). Also deletes consumed codes to prevent
unbounded table growth.

Uses EF Core SQLite DateTimeOffset format for correct string comparison.

Addresses findings #2 (CRITICAL), #4 (HIGH), #6 (HIGH), #13 (LOW).
Chris0Jeky added a commit that referenced this pull request Apr 22, 2026
- Fix config path: WorkerSettings:MaxBatchSize -> Workers:MaxBatchSize
- Document queue backlog threshold divergence from HealthController's
  dynamic formula Math.Max(MaxBatchSize * 20, 100)
- Fix PromQL examples: metrics are Histograms, not gauges -- use
  _sum/_count series with appropriate caveats
- Add threshold reconciliation section explaining differences with
  CLOUD_REFERENCE_ARCHITECTURE.md alarm stubs
- Fix Known Gap #2: use exact default (30s) instead of approximate (~30s)
  and show the full Math.Max formula
Chris0Jeky added a commit that referenced this pull request Apr 22, 2026
* docs: define monitoring and alerting rules (OPS-30)

Add docs/ops/ALERTING_RULES.md with 10 alert rules covering API error
rate, latency, worker heartbeat, disk, memory, queue backlog, database
connectivity, health endpoint, CPU, and Redis backplane. Each rule
specifies metric source, threshold, evaluation window, priority (P1/P2),
runbook steps, and escalation triggers.

Includes integration guidance for Grafana, AWS CloudWatch, PagerDuty,
and external uptime monitoring with example PromQL queries and Terraform
alarm definitions.

Closes #868

* docs: add ALERTING_RULES.md to ops README index

Cross-reference the new alerting rules document from the ops directory
index alongside the existing observability docs.

* docs: update OBSERVABILITY_BASELINE alert thresholds and cross-reference

Update the alert threshold baseline section to match the authoritative
thresholds in ALERTING_RULES.md and add a callout directing operators
to the comprehensive alerting rules document.

* docs: add known gaps section to alerting rules

Document three known gaps found during adversarial review:
1. OutboundWebhookDeliveryWorker not monitored by health endpoint
2. Health endpoint staleness thresholds differ from alert thresholds
3. No dedicated LLM provider error rate alert

Also clarify that Alert 3 applies to workers with OTLP metric emission
(LlmQueueToProposalWorker and ProposalHousekeepingWorker only).

* fix: correct alerting rules accuracy issues from adversarial review

- Fix config path: WorkerSettings:MaxBatchSize -> Workers:MaxBatchSize
- Document queue backlog threshold divergence from HealthController's
  dynamic formula Math.Max(MaxBatchSize * 20, 100)
- Fix PromQL examples: metrics are Histograms, not gauges -- use
  _sum/_count series with appropriate caveats
- Add threshold reconciliation section explaining differences with
  CLOUD_REFERENCE_ARCHITECTURE.md alarm stubs
- Fix Known Gap #2: use exact default (30s) instead of approximate (~30s)
  and show the full Math.Max formula
Chris0Jeky added a commit that referenced this pull request Jul 18, 2026
…eals (#1397 / #1414 P2 round)

P2 #1 (server-authoritative expiry): isProposalExpired now ORs in the DTO's
server `isExpired` flag alongside the client 60s clock, so a proposal the
server has already expired (client clock lagging/skewed) is classified
read-only and presents the stored preview instead of firing a live /diff that
400s. Scoped to the PendingReview/Approved branch only — the backend flag is
time-based and status-AGNOSTIC (IsExpired => UtcNow > ExpiresAt), so a
top-level OR would misclassify terminal (Applied/Rejected/Failed) proposals
whose expiry later passed as "Expired", regressing visibleProposals (force-
showing completed items), status labels, and the expired notice. One canonical
isProposalExpired feeds every consumer, so the fix moves all sites atomically;
the dormant defaultIsProposalExpired is aligned to the same status-scoped rule.

P2 #2 (re-authorize stored-preview reveal): revealing the cached diffPreview
locally skipped the /diff call that re-ran AuthorizeProposalAsync. Reveal-then-
verify: render the stored preview synchronously (the #1397 no-network-gate
invariant), then probe access via GET proposal (200 for a still-readable
terminal/expired proposal — unlike /diff it does not 400 on expiry). ONLY a
genuine 403/404 retracts the preview + warns; a transient error keeps the
inspectable local preview, and the refreshed DTO is not rendered (keep the
decision-time artifact). Guarded by requestId + proposal id so a late response
for a toggled-off/switched proposal can't tear down the wrong pane. Applied in
both shells (Paper presentStoredPreview + read-only watcher; Legacy
presentStoredPreview) and new isAccessDeniedError helper.

Comprehensive pre-fix sweep (2 fresh reviewer lenses over the whole #1414 diff)
drove the status-scoping and reveal-then-verify shapes; no CRITICAL/HIGH beyond
these two once the authority boundary is accounted for.

Tests: server-expired-but-client-lagging PendingReview/Approved → stored
preview, no /diff; terminal + isExpired:true stays non-expired (boundary);
revoked-access (403) retracts the preview in both shells; transient 500 keeps it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant