feat(reporting-governance): wire profile artifacts into contract and orchestrator

This commit is contained in:
Eve
2026-05-08 10:16:29 +08:00
parent 6366f70491
commit 3223feba93
8 changed files with 247 additions and 35 deletions

View File

@@ -1,6 +1,7 @@
import { evaluatePolicies } from './policy-evaluator.mjs';
import { runCompatibilityPreflight } from './compatibility-preflight.mjs';
import { planDecisionExecution } from './decision-runner.mjs';
import { createDeploymentBindingContract } from '../storage/profile-artifact.mjs';
function createBlockedReceipt({ evaluation, preflight }) {
return {
@@ -57,6 +58,7 @@ export function executeGovernanceContract({
context = {},
profile = {},
packageVersion,
repoRootOverride,
} = {}) {
const evaluation = evaluatePolicies({
event,
@@ -81,10 +83,15 @@ export function executeGovernanceContract({
capabilityDescriptor,
});
const deploymentBinding = profile?.spec?.bindings
? createDeploymentBindingContract({ artifact: profile, repoRootOverride })
: null;
return {
evaluation,
preflight,
planning,
deploymentBinding,
contract: {
runtime: capabilityDescriptor?.metadata?.id ?? capabilityDescriptor?.runtime?.name ?? 'unknown-runtime',
policy_id: evaluation.decision.policy_id,