Remediation domain implementation
This page describes the implementation reality of the Remediation domain: what code and infrastructure actually exist today, the provisioned topology, the concrete code/infra references, and the open target-design decisions. The domain model describes the implemented contracts and the target design technology-agnostically; this page grounds them in the repository.
Implementation anchors:
boundedctx-remediation/libs/ontinue-ion-remediation/boundedctx-remediation/infrastructure-core/boundedctx-remediation/infrastructure-containers/boundedctx-remediation/service-map.json
Current implementation status
| Capability | Status | Evidence |
|---|---|---|
| Strict Pydantic domain snapshots | Implemented | src/ontinue/ion/remediation/models.py |
| Typed incident, response, and manual actions | Implemented | src/ontinue/ion/remediation/actions.py |
| CloudEvent command and event contracts | Implemented | commands.py, events.py, cloud_event.py |
| Command/event parsers and public Python exports | Implemented | src/ontinue/ion/remediation/__init__.py |
| Cosmos event-store infrastructure | Provisioned in Terraform | infrastructure-core/cosmosdb.tf |
| Service Bus command/event topology | Provisioned in Terraform | infrastructure-core/sbus.tf |
| Signing key vault and validation feature flag | Provisioned/documented | infrastructure-core/key_vault.tf, infrastructure-containers/feature_flags.tf |
| Aggregate transition handlers | Absent | No runtime application code in this context |
| Stream repositories and optimistic append | Absent | No repository implementation |
| Change Feed outbox publisher and projectors | Absent | Lease container exists, processor does not |
| Read models and query API | Absent | No SQL schema, HTTP handlers, or OpenAPI document |
| Deployable container application | Absent | Container Apps environment exists; no app/image resource |
The provisioned events container makes the intended persistence model
event-sourced, but there is not yet runtime code that loads streams, enforces
transitions, or appends events. Current Python classes are validated snapshots and
wire contracts, not executable aggregates.
See event sourcing, event model, and event store for the required runtime patterns.
Contract and target code references
| Model concept | Where it lives |
|---|---|
| Plan and task snapshots | boundedctx-remediation/libs/ontinue-ion-remediation/src/ontinue/ion/remediation/models.py |
| Typed action union | boundedctx-remediation/libs/ontinue-ion-remediation/src/ontinue/ion/remediation/actions.py |
| CloudEvent commands and events | boundedctx-remediation/libs/ontinue-ion-remediation/src/ontinue/ion/remediation/commands.py and events.py |
| Target three-aggregate design | boundedctx-remediation/libs/ontinue-ion-remediation/DATA_MODEL.md |
The target model in
boundedctx-remediation/libs/ontinue-ion-remediation/DATA_MODEL.md is the source for
the three-aggregate RemediationPlan / RemediationTask / ActionExecution design
described in the domain model. It is design intent,
not implemented runtime.
Provisioned topology
Cosmos DB
| Resource | Configuration |
|---|---|
| Account | Serverless, session consistency, managed-identity access |
events container | Partition key /stream_id, consistent indexing |
events-outbox-leases container | Partition key /id; intended Change Feed leases |
Definition: boundedctx-remediation/infrastructure-core/cosmosdb.tf.
Azure Service Bus
| Topic | Subscription | Delivery properties |
|---|---|---|
bcrem-ext-commands | bcrem_int_commands | Sessions required, duplicate detection for five minutes, 14-day TTL, five deliveries |
bcrem-ext-events | bcrem_int_events | Sessions required, duplicate detection for five minutes, 14-day TTL, five deliveries |
Definition: boundedctx-remediation/infrastructure-core/sbus.tf.
Security infrastructure
- A managed identity receives Cosmos data-operator and Service Bus sender/receiver roles.
- Key Vault is provisioned for signing material.
Remediation_CommandSignatureValidationEnabledcontrols intended command signature validation.- Key generation and upload are documented, but validation code is absent.
References:
boundedctx-remediation/infrastructure-core/rbac.tf,
boundedctx-remediation/infrastructure-core/key_vault.tf, and
boundedctx-remediation/docs/README.md.
Open target-design decisions
The target model still records unresolved decisions about:
- expiry of tasks waiting indefinitely for approval;
- whether Conveyor rejection maps to task rejection or failure;
- opening Conveyor’s approve command versus retaining the supersede saga;
- action-specific deduplication windows and revert behavior;
- whether customer authority is attempt-scoped or reusable.
These are not implementation guarantees.