5.1 KiB
5.1 KiB
Findings Ledger ?? AGENTS.md
Working directory
- Primary path:
src/Findings/StellaOps.Findings.Ledger(and sibling test project undersrc/Findings/__Testswhen exercising tests). - Do not touch other modules unless the sprint explicitly permits cross-module edits; Orchestrator/AirGap/Attestor integration work must land behind feature flags and be coordinated via their sprints.
Roles covered
- Backend engineer: .NET 10/C# for ledger services, projections, provenance links, Merkle anchoring.
- QA / determinism: replay harness, property/integration tests, load testing at ???5M findings/tenant.
- Observability / DevOps: metrics, logs, dashboards, alert wiring, deployment/backup/offline kits.
Required reading before DOING
- Global:
docs/README.md,docs/07_HIGH_LEVEL_ARCHITECTURE.md,docs/modules/platform/architecture-overview.md. - Ledger module:
docs/modules/findings-ledger/observability.mddocs/modules/findings-ledger/replay-harness.mddocs/modules/findings-ledger/deployment.mddocs/modules/findings-ledger/implementation_plan.mddocs/modules/findings-ledger/airgap-provenance.mddocs/modules/findings-ledger/schema.md(sealed-mode and Merkle root structure)docs/modules/findings-ledger/workflow-inference.md(projection rules)
- Observability policy:
docs/modules/telemetry/guides/policy.md. - Triage & Unknowns (Alerts/Decisions):
docs-archived/implplan/SPRINT_3602_0001_0001_evidence_decision_apis.md.
Triage Alerts & Decisions (SPRINT_3602)
- REST endpoints live in
src/Findings/StellaOps.Findings.Ledger.WebService/Program.csand must remain deterministic and tenant-scoped:GET /v1/alerts(filters + pagination)GET /v1/alerts/{alertId}(summary)POST /v1/alerts/{alertId}/decisions(append-only decision event)GET /v1/alerts/{alertId}/audit(decision timeline)GET /v1/alerts/{alertId}/bundle+POST /v1/alerts/{alertId}/bundle/verify(portable evidence bundle download + offline verification)
- Contracts/DTOs are defined under
src/Findings/StellaOps.Findings.Ledger.WebService/Contracts/AlertContracts.cs(snake_case JSON). - Decision domain model lives under
src/Findings/StellaOps.Findings.Ledger/Domain/DecisionModels.cs. - Decision invariants:
- Decisions are append-only (corrections are new events).
- Every decision MUST include a
replay_token(content-addressed reproduce key). - Evidence hashes captured at decision time must be stable and ordered deterministically.
Execution rules
- Update sprint
Delivery Trackerstatus when you start/stop/finish: TODO ??? DOING ??? DONE/BLOCKED. - If a contract/design decision is missing, mark the task BLOCKED in the sprint, add the decision needed under Decisions & Risks, then continue with other unblocked tasks.
- Keep outputs deterministic: UTC ISO-8601 timestamps, stable ordering, seeded property tests, repeatable replay runs.
Coding & data guidelines
- Target .NET 10; prefer latest C# preview features allowed by repo tooling.
- Logging: structured
Ledger.*logs; no PII; includetenant,chain,policy,status,anchorlabels where applicable. - Metrics: emit only metric names/labels listed in
observability.md; new series require Observability Guild approval. - Storage: follow schema in
schema.md; preserve Merkle invariants and provenance pointers (orchestrator job IDs, bundle IDs, DSSE/attestation IDs). - Feature flags: gate Orchestrator/AirGap/Attestor integrations; defaults must be safe for air-gapped/offline mode.
Testing
- Mandatory: unit + property tests for ledger state/merkle roots; integration tests for projections and provenance pointers.
- Replay/determinism: use the harness in
replay-harness.md(5M findings/tenant scenario); produce signed harness report (DSSE) for LEDGER-29-008. - Load tests should record CPU/memory budgets as part of run artifacts; keep seeds and fixtures under version control.
Observability & operations
- Metrics/logs/traces via OpenTelemetry ??? OTLP ??? Prometheus/Tempo/Loki; respect
observability.enabledflag. - Dashboards: include Grafana JSON exports under
offline/telemetry/dashboards/ledger. - Alerts: wire as documented in
observability.md; for air-gap emit to syslog + CLI incident scripts. - Deployments: follow
deployment.mdfor Helm/Compose overlays, migrations, backup/restore, and offline kits.
Offline/air-gap
- Never assume external network; rely on mirrored feeds and bundled assets.
- Record bundle provenance (
bundle_id,merkle_root,time_anchor) when importing advisories/VEX/policies as perairgap-provenance.md. - Exports that become stale beyond documented thresholds must be blocked with remediation messaging.
Acceptance checklist for changes
- Tests updated/added and passing locally (
dotnet testwithin module scope). - Metrics/logs follow approved names and labels; dashboards/alerts updated if schemas change.
- Replay harness run (or planned) for determinism-impacting changes; attach/report results.
- Docs updated when contracts or workflows change (module docs, observability policy, sprint Decisions & Risks).