mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 10:35:51 +00:00
26718e70b6
pkg/aicontracts gains the plan-only OrchestratorActionBroker contract: ActionProposal (typed capability reference, no command, host, risk, or approval fields), a read-only ActionCapabilityCatalog with parameter sensitivity, ActionDisposition over the existing safe ActionPlanInfo projection, and an additive Action *ActionReference on InvestigationSession and InvestigationRecord. ProposedFix/ApprovalID are documented as migration-only; OrchestratorDeps gains the ActionBroker seam while CmdExecutor/ApprovalStore are marked legacy pending removal. internal/api/patrol_action_broker.go implements the seam tenant-bound over ResourceHandlers.ActionLifecycle(): fixed pulse_patrol actor, broker-owned ActionOrigin stamped through the service's internal PlanWithOptions (the public plan endpoint cannot claim an origin), plan-only submission even for ApprovalNone capabilities, and refusal of proposals that populate IsSensitive parameters before any persistence. The lifecycle service adds Capabilities (same registry resolution and typed errors as planning) and an OnActionTransition persisted-state callback covering plan, decision, and terminal execution transitions, published only after the store write succeeds, so Patrol can reconcile decisions and outcomes deterministically. ActionAuditRecord carries the new broker-owned Origin, persisted in action_audits.origin_json with a schema migration and round-trip normalization. Contracts updated across api-contracts, ai-runtime, unified-resources, agent-lifecycle, and storage-recovery; proofs added in pkg/aicontracts/contracts_test.go (propose-only method set, command-free wire shape, additive reference), internal/api/contract_test.go (plan-only broker pins), broker behavior tests, lifecycle origin and transition tests, and a SQLite origin round-trip test. Slice 2a of the typed-lifecycle enforcement ratchet: additive core fabric only; enterprise migration and side-door deletion follow.