feat(reporting-governance): add minimal runtime integrated slice
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
export { evaluatePolicyPack, evaluatePolicies } from './policy-evaluator.mjs';
|
||||
export { planDecisionExecution } from './decision-runner.mjs';
|
||||
export { executeGovernanceContract } from './execute-governance-contract.mjs';
|
||||
export { executeRuntimeIntegratedGovernance } from './runtime-integrated.mjs';
|
||||
export { runCompatibilityPreflight } from './compatibility-preflight.mjs';
|
||||
|
||||
52
plugins/reporting-governance/src/core/runtime-integrated.mjs
Normal file
52
plugins/reporting-governance/src/core/runtime-integrated.mjs
Normal file
@@ -0,0 +1,52 @@
|
||||
import { executeGovernanceContract } from './execute-governance-contract.mjs';
|
||||
import { runOrchestratorAdapter } from '../adapters/orchestrator.mjs';
|
||||
|
||||
export function executeRuntimeIntegratedGovernance({
|
||||
event,
|
||||
evidence = [],
|
||||
capabilityDescriptor = {},
|
||||
policyPacks = [],
|
||||
context = {},
|
||||
profile = {},
|
||||
packageVersion,
|
||||
repoRootOverride,
|
||||
runtime = null,
|
||||
} = {}) {
|
||||
const governance = executeGovernanceContract({
|
||||
event,
|
||||
evidence,
|
||||
capabilityDescriptor,
|
||||
policyPacks,
|
||||
context,
|
||||
profile,
|
||||
packageVersion,
|
||||
repoRootOverride,
|
||||
});
|
||||
|
||||
const shouldRunOrchestrator = Boolean(
|
||||
runtime
|
||||
&& governance.preflight?.status === 'pass'
|
||||
&& governance.deploymentBinding
|
||||
&& governance.contract?.adapter_actions?.includes('notify_operator')
|
||||
);
|
||||
|
||||
const runtimeExecution = shouldRunOrchestrator
|
||||
? runOrchestratorAdapter({
|
||||
profileArtifact: profile,
|
||||
repoRootOverride,
|
||||
...runtime,
|
||||
})
|
||||
: null;
|
||||
|
||||
return {
|
||||
...governance,
|
||||
runtimeExecution,
|
||||
runtimeIntegration: {
|
||||
attempted: shouldRunOrchestrator,
|
||||
adapter: shouldRunOrchestrator ? 'orchestrator' : null,
|
||||
reason: shouldRunOrchestrator
|
||||
? 'deployment binding + notify_operator adapter action routed into orchestrator adapter'
|
||||
: 'runtime execution not attempted',
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user