feat(reporting-governance): add minimal runtime integrated slice

This commit is contained in:
Eve
2026-05-08 10:56:30 +08:00
parent 173de01bdb
commit 34f035cfb5
8 changed files with 363 additions and 215 deletions

View File

@@ -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';

View 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',
},
};
}