Repository navigation
feat(signals): complete phase 2b state, observability adapters, and dependency graph - #25
Conversation
Add SQLAlchemy 2.0 ORM models and Alembic migrations for runs, playbooks, and scenario_results matching architecture §2.12. Enforce append-only immutability on the runs table using PostgreSQL rules (runs_no_update and runs_no_delete). Provide PostgresRunStore, PostgresPlaybookStore (with pgvector HNSW cosine similarity search), and PostgresEvalStore conforming to the store protocol interfaces. Add live integration tests asserting UPDATE and DELETE queries against runs are no-ops, and provide full unit tests maintaining 100% line and branch coverage. Implements build-plan step B2.1.
…rt fallback Implement PagerDuty webhook receiver on port 9108 with HMAC-SHA256 signature verification, AlertSource protocol implementation, ust tunnel command with cloudflared/ngrok/fake support, and ust alert inject synthetic fallback command. Implements build-plan step B2.2.
Add PrometheusClient, LokiClient, and PrometheusLokiAdapter implementing ObservabilityAdapter for real telemetry ingestion across production and twin namespaces. Telemetry ingestion is required to capture pre- and post-incident performance metrics and log errors during tournament evaluation and incident diagnosis. Log messages are normalized (hiding timestamps, UUIDs, IPs, and numbers) and fingerprinted via SHA-256 to aggregate recurring error signatures. Metrics query p99 latency, request count, and error rates directly from Prometheus with label-agnostic fallbacks. Also add ust signals context CLI command to retrieve structured incident context. Implements build-plan step B2.3.
Implement the DeployHistory protocol for GitHub to query commit history, map commits to container image digests, and detect schema migrations across commit boundaries for Invariant K3. Implements build-plan step B2.4.
Implement Datadog metrics and log telemetry query adapter adhering to the ObservabilityAdapter protocol, supporting p99 latency, error rates, and log signature extractions. Implements build-plan step B2.5.
Construct service dependency DAG from dependencies.yaml, cross-check against observed Prometheus traffic rates, and calculate candidate blast radius using graph centrality and request share formulas. Implements build-plan step B2.6.
Expose ust graph show CLI command for inspecting the dependency DAG and cross-check verification status against Prometheus traffic, and connect graph context into ust signals context. Mark completed steps in CHECKLIST.md. Completes Checkpoint B2.
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 37235456 | Triggered | Authentication Tuple | f194966 | tests/unit/graph/test_service_graph.py | View secret |
| 37235457 | Triggered | Authentication Tuple | f194966 | tests/unit/graph/test_service_graph.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
A /code-review pass surfaced 15 confirmed bugs across the signals adapters, dependency graph, blast-radius calculator, CLI, and Postgres store; separately, the branch's first CI run was failing because a test hit a real network call instead of mocking the observability adapter. - pagerduty: fail fast when no webhook secret is configured, fix substring-based service-name normalization, detect webhook server bind failures/timeouts instead of returning silently - scenarios: normalize synthetic alert service names like real webhooks - datadog: fix p99 unit-conversion heuristic (was under-reporting severe latency by 1000x), add missing namespace filter to service_health() - prometheus/api: tighten service-health matching to avoid false-positive substring matches, add `until` param consistently across ObservabilityAdapter and both adapters - github: paginate commit history fetches instead of truncating at 100 - graph: cross_check() now catches declared edges/services that are never observed in traffic, not just the reverse; simplify format_chains() (its old subpath filter was provably dead code once fixed to check genuine subsequences) - calculator: fix zero-baseline degradation thresholds so a fresh error spike from a clean baseline is correctly flagged - cli: log (instead of silently swallowing) fallback failures in `signals context` - store: add claim_run(), an atomic advisory-lock-backed claim primitive for the K5 single-writer contract, without wiring it into the not-yet-built kernel/shadow-mode - tests: fix test_cli_signals_context_fallback_graph to mock the observability adapter instead of hitting the network Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012rnk8jvArFB9hormE9WbAD
|
Build-Plan Step Implemented
store/models, migrations, RunStore / PlaybookStore / EvalStore, append-only rulesust tunnel, synthetic-alert fallbackObservabilityAdapter, namespace-parameterisedDeployHistorywith image digests and migration detection (Invariant K3 boundary)ObservabilityAdapterprotocolgraph/: DAG fromdependencies.yaml, cross-check against observed Prometheus traffic, andBlastRadiusCalculatorCheckpoint Execution & Output
Checkpoint B2:
ust signals deploys --limit 5ust signals contextust graph showtest_run_store_append_onlycheckpoint: unverified (PagerDuty account requires corporate email domain; synthetic fallback on port 9108 fully verified per docs/06-demo.md §6.7)make check: 610 passed in 10.19s, 100.00% statement and branch coverage (6,344 statements, 1,604 branches), cleanmypy --strict, cleanruffformat/lint, cleanscripts/check_mocks.py, and 5/5 import-linter contracts kept.ADRs Relied On
ust-prod,ust-twin-*).ObservabilityAdapter,DeployHistory,DependencyGraph,RunStore).Mock Registry Disclosures
None. No
# MOCKED:markers added or modified;scripts/check_mocks.pypassed clean.Documentation Updates
CHECKLIST.md— Marked B2.1 through B2.6 and verified Checkpoint B2 items.Definition of Done
make checkgreen (ruff, mypy --strict, import-linter, pytest)# MOCKED:marker without a row in docs/MOCKS.md