AutoFix missions and governed outbound integrations - #7
Merged
Conversation
…ply" instead to more clearly indicate what they do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3, closes #4, closes #5, closes #6
Summary
This PR lands four interrelated features: the AutoFix mission type, governed outbound integrations (Slack), the Assignment→Supply rename, and Dashboard UI consolidation. 307 files changed, ~43k insertions.
1. AutoFix mission type (#3)
Mission type
AutoFixto theMissionTypeenum inSnapCd.Contracts.AutoFixmissions are configured the same way as other mission types — per Organization, Stack, Namespace, or Module scope.Dispatch
ApplyJobFailedCompetingConsumerandDestroyModuleFailedhandling: when a job fails, checks for anAutoFixmission first. If one exists, it dispatches AutoFix and suppressesAutoDiagnoseas redundant. AutoDiagnose only fires when no AutoFix mission is configured.AutoFixMissionConsumer: receivesAutoFixMissionRequested, locates the agent connection via the AgentHub, and invokes theAutoFixendpoint on the connected agent instance.Agent-side
AutoFixendpoint that the agent's sidecar handles.AutoFixRequestwith the job context, performs diagnosis, and either retries or opens a PR depending on the failure type.auto_fix.mdskill prompt added toAI/Skills/.UI
AutoFixappears in the Mission Type dropdowns across all scope-level mission management components.AgentHarness.razorrenamed toMissionTestBench.razor.2. Governed outbound integrations (#3)
Integration entity
Integrationentity withIntegrationTypeenum (currentlySlack).IntegrationSecretStore. API never exposes raw credentials.IntegrationServicehandles CRUD, test-connection endpoint, and credential encryption/decryption.IntegrationConnectionCache— per-instance in-memory cache (15-min TTL) for connection credentials, invalidated cross-instance via fanout consumer on integration CRUD.Integration supply
IntegrationStackSupply,IntegrationNamespaceSupply,IntegrationModuleSupplyentities.is_supplied_to_all_modulesflag on the Integration entity for org-wide supply.IntegrationSupplyResolverchecks supply coverage before delivering events.IntegrationSupplyServicehandles CRUD for supply resources.Integration events (demand)
OrganizationIntegrationEvent,StackIntegrationEvent,NamespaceIntegrationEvent,ModuleIntegrationEvent.IntegrationEventMatcherwalks all scope levels to find matching subscriptions for a given module/trigger.IntegrationEventServicehandles CRUD with unified scope-based API.IntegrationTemplateRenderer—{{ token }}substitution engine. Built-in default templates per trigger. Tokens:trigger,moduleName,moduleId,jobId,organizationId,jobType,missionType,kind,message,stackName,namespaceName,jobUrl.Delivery
IntegrationDeliveryaudit entity records each attempt (status, error, sink message ID).IntegrationEventDispatchercompeting consumer turns saga/mission events into deliveries; idempotent per (occurrence, subscription).Codecs
IIntegrationCodecinterface for type-specific send logic.SlackCodec— sends messages via Slack Web API using bot token. Supports threading for mission milestone grouping.RBAC
IntegrationCreator,IntegrationContributor,IntegrationReader.Owner,Contributor,Reader,IdentityAccessManagerviaIntegrationRoleAssignment.API
IntegrationController— CRUD + test-connection endpoint.IntegrationEventController— unified scope-based CRUD for events.IntegrationSupplyController— CRUD for supply resources (scope-based).IntegrationRoleAssignmentController— per-integration role management.UI
/Integrationspage with create/edit forms, connection configuration, test-connection button, supply management, and role assignment panel.3. Mission run milestones (#6)
ModuleJobMissionRunMilestoneentity — records progress updates from a running mission (kind, message, timestamp).MissionMilestoneReportedMassTransit event and consumer.ModuleJobMissionRunReadDtoandModuleJobMissionRunMilestoneReadDtoexpose milestones via API.ModuleControllergains aMissionHistoryendpoint returning mission runs and milestones for a module.4. Rename "Assignment" to "Supply" (#4)
Entities and database
*Assignmententities renamed to*Supply:AgentStackAssignment→AgentStackSupply,RunnerNamespaceAssignment→RunnerNamespaceSupply, etc.Repositories and services
*Assignment*to*Supply*.API surface
/assignmentsto/supply.SnapCd.Contractsrenamed:*AssignmentDto→*SupplyDto,*AssignmentCreateDto→*SupplyCreateDto.UI
ManageAgentAssignments→ManageAgentSupply,AssignmentBadge→SupplyBadge, etc.Hub and messaging
Breaking changes
/assignmentsAPI endpoints are now/supply.terraform-provider-snapcd).5. Dashboard UI improvements (#5)
Consolidate configuration into a single "Configure" panel
Replaced the individual top-level icons for Edit, Roles, Missions, Integration Events, Secrets, and Delete with a single Configure icon (Settings gear). Clicking it opens a panel with expansion sub-sections — one for each configuration area. Only one sub-section is open at a time.
Deep-linking via query parameters:
?action=configure§ion=missionsopens Configure with the Missions sub-section expanded.Applied to:
ConfigureStack.razorConfigureNamespace.razorConfigureModule.razor(Variables and Outputs kept as separate top-level icons)Redesign Module status area
Replaced four separate MudPaper cards (State, Queued, Runners, Revision) with a single panel using a CSS grid two-column layout (label | value). Ordered: State, Revision, Queued, Runners. Resource count shown only when
ActualResourceCountis known. Revision and State both show "None" for the initial state.Fix select-all checkbox on /Stacks page
Changed the "Select all Stacks" checkbox from
@bind-ValuetoValue+ValueChangedwith anOnSelectAllChangedhandler.Link and wrapper cleanup
?action=missions,?action=integrationeventsquery parameters across components to?action=configure§ion=...format.ManageModuleIntegrationEvents.razor(spurious/Namespaces/segment).<MudPaper>wrappers from components now hosted inside Configure expansion panels.Migrations
20260608131719_AddMissionRunMilestones— addsModuleJobMissionRunMilestonetable.20260615093401_AddIntegrations— adds Integration, IntegrationDelivery, IntegrationEvent (4 scope tables), IntegrationSupply (3 scope tables), IntegrationRoleAssignment tables.20260620152254_RenameAssignmentsToSupplies— renames all*Assignmenttables/columns/FKs to*Supply.Tests
AgentModuleAssignment_SmokeTests→AgentModuleSupply_SmokeTestsRunnerModuleAssignment_SmokeTests→RunnerModuleSupply_SmokeTestsAgentChain_RoleResolutionTestsandRunnerChain_RoleResolutionTestsupdated for supply naming.