Skip to content

feat: add scoped diagnosis discovery and evidence core - #243

Closed
Atom-oh wants to merge 4 commits into
feat/trace-instance-observations-20261106from
feat/discovery-evidence-core-20261106
Closed

Atom-oh wants to merge 4 commits into
feat/trace-instance-observations-20261106from
feat/discovery-evidence-core-20261106

Conversation

@Atom-oh

@Atom-oh Atom-oh commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Diagnosis needs scoped, code-owned evidence before a model can assess selected resources. Add bounded inventory and graph discovery, evidence admission, verified account clients, workload identity checks, deadline budgets and measured EC2 memory coverage. Preserve missing-source and ambiguous-identity gaps, redact model-bound facts and retain the existing sizing guards.

Add worker configuration and task-role permissions behind the default-off diagnosis_evidence_loop_enabled and diagnosis_network_evidence_enabled flags. Member reads require registered account credentials and an exact role allowlist. Collection remains analysis-only; activation requires a separately reviewed operator rollout.

Depends on #242; the base branch is feat/trace-instance-observations-20261106. This PR contains the discovery/evidence foundation, with network collectors and the six-pillar model loop submitted separately.

Validation at HEAD 394bbaa347f13ae9340c1525dbdcb56211f17b56:

  • Eight targeted diagnosis unit suites: 259 passed; worker redaction suite: 18 passed.
  • terraform fmt -check passed for the three changed Terraform files.
  • git diff --check passed for this stacked scope.
  • PostgreSQL integration and the full required CI were not run in this PR-creation check. Automatic AI Code Review, Merge Verify and Terraform PR workflows target main/dev; this feature-base PR needs a fresh review and required CI on its final dev scope before integration.

Atom-oh and others added 2 commits November 6, 2026 10:47
Bounded scoped discovery, evidence admission index, workload identities,
measured EC2 memory metrics, scoped member clients and report budget for
the diagnosis worker, plus redaction updates, the RDS read-replica source
column in the inventory sync and default-off worker IAM/env flags
(diagnosis_evidence_loop_enabled, diagnosis_network_evidence_enabled).
Nothing in the report path consumes these modules yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Atom-oh and others added 2 commits November 6, 2026 21:13
* feat: bound trace observation caches and tighten agent tool contracts

Bounded TTL cache for the web DNS/NFM query layers, trace instance
observations in the graph, and read-only tool-contract and prompt rules
for the network, cost, CloudWatch, Flow Monitor and Tempo agent tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: NFM/DNS status routes retry on transient reads; storage capacity is not I/O evidence

The NFM and DNS-log menu-gate routes return a retryable 503 (no internal message)
for cache saturation/deadline or SDK request timeouts instead of the 200
'not onboarded' payload, matching the query routes. Compute Optimizer
EBSVolumeStorageSpaceUtilization no longer counts as I/O pressure evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: retry transient cache reads on every observation route path; runnable cache benchmark

The DNS analytics data read, the CoreDNS group read and the NFM top-contributors
read now map cache saturation/deadline or SDK timeouts to the retryable 503 used
by the lookups (no internal message, no fabricated empty result).
CacheUnavailableError declares its field explicitly so Node's type stripping can
import bounded-cache.ts, and web/lib/CLAUDE.md names the benchmark command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: classify throttled/5xx reads as transient and abort timed-out cache loaders

- isTransientRead covers throttling, 429 and 5xx; allow-list lookups return a
  retryable 503 only for transient errors and a non-retryable 502 otherwise
- BoundedTtlCache passes an AbortSignal to loaders, aborts it at the deadline and
  holds the in-flight slot until the loader settles; NFM/DNS loaders thread it
  into SDK sends and polling sleeps and stop server-side queries on abort
- document trace edge instance observation fields and the SQL view exclusion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…e-core-20261106

# Conflicts:
#	agent/lambda/aws_finops_mcp.py
#	agent/lambda/test_aws_finops_mcp.py
#	web/app/api/dns-logs/analytics/route.test.ts
#	web/app/api/dns-logs/analytics/route.ts
#	web/app/api/nfm/query/route.test.ts
#	web/app/api/nfm/query/route.ts
#	web/lib/CLAUDE.md
#	web/lib/bounded-cache.test.ts
#	web/lib/bounded-cache.ts
#	web/lib/dns-logs.ts
#	web/lib/nfm.ts
@Atom-oh

Atom-oh commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #246 (same head, base retargeted to dev after #242 merged, so the required AI review runs).

@Atom-oh Atom-oh closed this Nov 6, 2026

This branch had an error being deployed

1 failed deployment
ci-review-auto — fcb856ab Deployed Nov 6, 2026 by Atom-oh via AI Code Review #947
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant