feat(deploy): register Engine MCP materialization transition

This commit is contained in:
Codex
2026-07-23 20:37:31 +03:00
parent 4cf3a83ef1
commit 25b12d77e4
4 changed files with 1134 additions and 3 deletions
+486
View File
@@ -573,6 +573,45 @@ ENGINE_MCP_TELEMETRY_CATALOG_TARGET_SHA256 = {
ENGINE_MCP_TELEMETRY_CATALOG_NEW_PATHS = (
ENGINE_MCP_TELEMETRY_CATALOG_DESCRIPTOR_REL,
)
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_DESCRIPTOR_REL = (
"nodedc-source/server/deployTransitions/executionPlanMaterializationV1.json"
)
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_ARTIFACT_ENTRIES = (
"nodedc-source/server/routes/n8n.js",
"nodedc-source/server/routes/engineAgentGateway.js",
"nodedc-source/server/l2ExecutionPlan/catalog.js",
"nodedc-source/server/l2ExecutionPlan/compiler.js",
"nodedc-source/server/l2ExecutionPlan/materializer.js",
"nodedc-source/server/assets/execution-plans/v1/catalog.json",
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_DESCRIPTOR_REL,
ENGINE_NODE_INTELLIGENCE_DESCRIPTOR_REL,
)
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_PREDECESSOR_SHA256 = {
"nodedc-source/server/routes/n8n.js": "903245ae363e9b9ac161498f17988a38876a0e0ac8d80f3fa1b0112ceb7fe906",
"nodedc-source/server/routes/engineAgentGateway.js": "69bfc91e913a3fad04e13aca86efb9d62f73c0c7d1f8f7200907494b29fa9e8d",
ENGINE_NODE_INTELLIGENCE_DESCRIPTOR_REL: "25ed3efd858aaf82c242dba501f0acc0c6c3dc91e8845707a4d3325750eab59f",
}
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_FOUNDATION_SHA256 = {
ENGINE_MCP_EXECUTION_PROFILE_DECODER_DESCRIPTOR_REL: "93e431902e9bcd3b828a82ed6b42b48d939051f21bf8824dafcf2addac8a711c",
ENGINE_MCP_TELEMETRY_CATALOG_DESCRIPTOR_REL: "b25ab8b6e6ad8ac24614c4630cc3635abe453464466d5a72238b05e48a24d882",
}
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_TARGET_SHA256 = {
"nodedc-source/server/routes/n8n.js": "391fc81228fdacd6efc6c0868991a3485f71869708e49ac15819db6ccce1bfce",
"nodedc-source/server/routes/engineAgentGateway.js": "9020cf49a3558c0497fed4ecfd81367cbc11b5b249881804c29fe437900c71f8",
"nodedc-source/server/l2ExecutionPlan/catalog.js": "c35b4c7ad9319aabbf1366a11ff52a6e99d961893bafdfcb4e84fc5f24fc04be",
"nodedc-source/server/l2ExecutionPlan/compiler.js": "beb3f664073f9a372432643936a04d0cb0028cd695f759c68bd053e9cd892fe4",
"nodedc-source/server/l2ExecutionPlan/materializer.js": "ee3bcfd06b3a5fa46800df974a2dedfdd55eeaf662329f837486c011a9bd713e",
"nodedc-source/server/assets/execution-plans/v1/catalog.json": "a153e040e0a592bad4375b98d9a1d83d148923aa0f0fd47d225b92eda281c4e9",
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_DESCRIPTOR_REL: "52c0152cff49c251be5581a9209d2e63ba710c16e815bdd6ece24f7c9dd7e480",
ENGINE_NODE_INTELLIGENCE_DESCRIPTOR_REL: "03b2ba120c3929e9cf99940ddc927082de376ceff762895a84103144202aef42",
}
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_NEW_PATHS = (
"nodedc-source/server/l2ExecutionPlan/catalog.js",
"nodedc-source/server/l2ExecutionPlan/compiler.js",
"nodedc-source/server/l2ExecutionPlan/materializer.js",
"nodedc-source/server/assets/execution-plans/v1/catalog.json",
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_DESCRIPTOR_REL,
)
ENGINE_AGENT_FULL_GRANT_MIGRATION_ARTIFACT_ENTRIES = (
ENGINE_AGENT_FULL_GRANT_MIGRATION_STORE_REL,
)
@@ -3271,6 +3310,7 @@ def validate_engine_node_intelligence_transition(payload_dir, entries):
"const ENGINE_AGENT_MCP_VERSION = '0.6.0'",
"const ENGINE_AGENT_MCP_VERSION = '0.7.0'",
"const ENGINE_AGENT_MCP_VERSION = '0.8.0'",
"const ENGINE_AGENT_MCP_VERSION = '0.9.0'",
)
):
die("Engine node-intelligence gateway MCP version is not registered")
@@ -4422,6 +4462,50 @@ process.stdout.write('engine-mcp-telemetry-catalog:0.8.0:normalized-metadata-onl
}
def accept_engine_mcp_execution_plan_materialization_runtime():
root = component_root("engine")
validate_engine_mcp_execution_plan_materialization_slice(
root,
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_ARTIFACT_ENTRIES,
)
live = run_engine_backend_probe(
(
"node",
"--input-type=module",
"-e",
"""
const fs=await import('node:fs/promises');
const gateway=await import('file:///app/server/routes/engineAgentGateway.js');
const catalogModule=await import('file:///app/server/l2ExecutionPlan/catalog.js');
const materializer=await import('file:///app/server/l2ExecutionPlan/materializer.js');
const catalog=await catalogModule.loadExecutionPlanCatalog();
const plan=gateway.engineAgentTools.find((item)=>item.name==='engine_plan_l2_execution_plan_materialization');
const apply=gateway.engineAgentTools.find((item)=>item.name==='engine_apply_l2_execution_plan_materialization');
const planRequired=plan?.inputSchema?.required||[];
const applyRequired=apply?.inputSchema?.required||[];
const genericSource=(await Promise.all(['/app/server/l2ExecutionPlan/compiler.js','/app/server/l2ExecutionPlan/materializer.js'].map((path)=>fs.readFile(path,'utf8')))).join('\\n');
const unmanaged=materializer.materializationState({source:{},nodes:[{id:'existing'}],edges:[]});
if(gateway.ENGINE_AGENT_MCP_VERSION!=='0.9.0'||!plan||!apply||plan?.inputSchema?.additionalProperties!==false||apply?.inputSchema?.additionalProperties!==false||!planRequired.includes('executionPlan')||!applyRequired.includes('planRef')||!applyRequired.includes('providerAuthRef')||catalog.schemaVersion!=='nodedc.engine.execution-plan-catalog/v1'||catalog.runtime?.graphBlueprintSchemaVersion!=='nodedc.l2-graph-blueprint/v1'||catalog.runtime?.compilerVersions?.join(',')!=='1.1.0'||unmanaged!=='unmanaged_existing'||/gelios|robot2b/i.test(genericSource))process.exit(2);
process.stdout.write('engine-mcp-execution-plan-materialization:0.9.0:provider-package-authority:two-phase:v1');
""".strip(),
),
"Engine MCP execution plan materialization",
container_id=engine_backend_container_id(),
)
expected = (
"engine-mcp-execution-plan-materialization:"
"0.9.0:provider-package-authority:two-phase:v1"
)
if live != expected:
die("Engine MCP execution plan materialization live acceptance mismatch")
return {
"target_sha256": dict(
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_TARGET_SHA256
),
"live": live,
}
def validate_no_lifecycle_scripts(payload_dir, label):
forbidden = ("preinstall", "install", "postinstall", "prepare", "prepack", "postpack")
for package_path in payload_dir.rglob("package.json"):
@@ -5178,6 +5262,135 @@ def validate_engine_mcp_telemetry_catalog_slice(payload_dir, entries):
)
def validate_engine_mcp_execution_plan_materialization_slice(payload_dir, entries):
if tuple(entries) != ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_ARTIFACT_ENTRIES:
die(
"Engine MCP execution plan materialization files.txt exact "
"set/order mismatch"
)
for rel, expected_sha256 in (
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_TARGET_SHA256.items()
):
path = payload_dir / rel
try:
path_stat = path.lstat()
except FileNotFoundError:
die(f"Engine MCP execution plan materialization target is missing: {rel}")
if (
stat.S_ISLNK(path_stat.st_mode)
or not stat.S_ISREG(path_stat.st_mode)
or sha256_file(path) != expected_sha256
):
die(
"Engine MCP execution plan materialization target sha256 "
f"mismatch: {rel}"
)
descriptor = read_strict_json(
payload_dir / ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_DESCRIPTOR_REL,
"Engine MCP execution plan materialization descriptor",
max_bytes=32 * 1024,
)
expected_descriptor = {
"schemaVersion": "nodedc.engine.deploy-transition/v1",
"id": "engine-mcp-l2-execution-plan-materialization-v1",
"component": "engine",
"scope": "external-mcp-l2-authoring",
"mcpVersion": "0.9.0",
"sourcePaths": [
"nodedc-source/server/routes/n8n.js",
"nodedc-source/server/routes/engineAgentGateway.js",
"nodedc-source/server/l2ExecutionPlan/catalog.js",
"nodedc-source/server/l2ExecutionPlan/compiler.js",
"nodedc-source/server/l2ExecutionPlan/materializer.js",
"nodedc-source/server/assets/execution-plans/v1/catalog.json",
],
"plan": {
"tool": "engine_plan_l2_execution_plan_materialization",
"readOnly": True,
"returnsPlanRef": True,
},
"apply": {
"tool": "engine_apply_l2_execution_plan_materialization",
"accepts": [
"planRef",
"providerAuthRef",
"confirmation",
"changeRef",
],
"rejectsCallerGraphOperations": True,
"revalidatesTargetRevisionAndScope": True,
},
"providerLogicAuthority": "trusted-provider-package",
"unmanagedGraphPolicy": "explicit-adoption-required",
"embeddedCodexChanged": False,
}
if descriptor != expected_descriptor:
die("Engine MCP execution plan materialization descriptor contract mismatch")
gateway_source = (
payload_dir / "nodedc-source/server/routes/engineAgentGateway.js"
).read_text(encoding="utf-8")
if any(
marker not in gateway_source
for marker in (
"const ENGINE_AGENT_MCP_VERSION = '0.9.0'",
"name: 'engine_plan_l2_execution_plan_materialization'",
"name: 'engine_apply_l2_execution_plan_materialization'",
"'execution-plan.apply'",
"assertExactToolArguments(args, [",
)
):
die("Engine MCP execution plan materialization gateway contract mismatch")
materializer_source = (
payload_dir / "nodedc-source/server/l2ExecutionPlan/materializer.js"
).read_text(encoding="utf-8")
compiler_source = (
payload_dir / "nodedc-source/server/l2ExecutionPlan/compiler.js"
).read_text(encoding="utf-8")
if any(
marker not in materializer_source
for marker in (
"status: 'adoption_required'",
"type: 'replaceGraph'",
"assignCredentialBindingInternal",
"execution_plan_materialization_equality_failed",
)
):
die("Engine MCP execution plan materializer contract mismatch")
if any(
marker not in compiler_source
for marker in (
"compileExecutionPlanGraph",
"materializedGraphEqualityDigest",
"ndc.semantic-mapping",
"providerPackage.publisher.nodeType",
)
):
die("Engine MCP execution plan compiler contract mismatch")
if re.search(r"gelios|robot2b", materializer_source, re.IGNORECASE) or re.search(
r"gelios|robot2b",
compiler_source,
re.IGNORECASE,
):
die("Engine MCP execution plan runtime contains provider hardcode")
node_intelligence_descriptor = read_engine_node_intelligence_descriptor(
payload_dir / ENGINE_NODE_INTELLIGENCE_DESCRIPTOR_REL,
"Engine MCP execution plan materialization node-intelligence descriptor",
)
if (
node_intelligence_descriptor.get("action") != "activate"
or node_intelligence_descriptor.get("releaseId")
!= ENGINE_NODE_INTELLIGENCE_RELEASE_ID
or node_intelligence_descriptor.get("source", {}).get("gatewaySha256")
!= ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_TARGET_SHA256[
ENGINE_NODE_INTELLIGENCE_GATEWAY_REL
]
):
die(
"Engine MCP execution plan materialization node-intelligence "
"attestation contract mismatch"
)
def validate_engine_agent_full_grant_migration_slice(payload_dir, entries):
if tuple(entries) != ENGINE_AGENT_FULL_GRANT_MIGRATION_ARTIFACT_ENTRIES:
die("Engine agent full grant migration files.txt exact set/order mismatch")
@@ -5601,6 +5814,10 @@ def load_artifact(artifact, work_dir):
manifest["component"],
entries,
)
and not is_engine_mcp_execution_plan_materialization_slice(
manifest["component"],
entries,
)
and not is_engine_provider_authority_diagnostics_slice(
manifest["component"],
entries,
@@ -5634,6 +5851,14 @@ def load_artifact(artifact, work_dir):
validate_engine_mcp_execution_profile_decoder_slice(payload_dir, entries)
if is_engine_mcp_telemetry_catalog_slice(manifest["component"], entries):
validate_engine_mcp_telemetry_catalog_slice(payload_dir, entries)
if is_engine_mcp_execution_plan_materialization_slice(
manifest["component"],
entries,
):
validate_engine_mcp_execution_plan_materialization_slice(
payload_dir,
entries,
)
if is_engine_provider_security_catalog_slice(manifest["component"], entries):
validate_engine_provider_security_catalog_payload(payload_dir, entries)
if touches_engine_credential_sink(manifest["component"], entries):
@@ -5655,6 +5880,10 @@ def load_artifact(artifact, work_dir):
manifest["component"],
entries,
)
and not is_engine_mcp_execution_plan_materialization_slice(
manifest["component"],
entries,
)
and (
touches_engine_data_product_publish_grant(entries)
or ENGINE_DATA_PRODUCT_PUBLISH_GRANT_OVERRIDE_REL in entries
@@ -5849,6 +6078,15 @@ def is_engine_mcp_telemetry_catalog_slice(component, entries):
)
def is_engine_mcp_execution_plan_materialization_slice(component, entries):
return (
component == "engine"
and entries is not None
and tuple(entries)
== ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_ARTIFACT_ENTRIES
)
def is_engine_agent_full_grant_migration_slice(component, entries):
return (
component == "engine"
@@ -6377,6 +6615,80 @@ def preflight_engine_mcp_telemetry_catalog_predecessor():
}
def preflight_engine_mcp_execution_plan_materialization_predecessor():
root = component_root("engine")
actual = {}
for rel, expected_sha256 in (
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_PREDECESSOR_SHA256.items()
):
path = root / rel
try:
path_stat = path.lstat()
except FileNotFoundError:
die(
"Engine MCP execution plan materialization predecessor is "
f"missing: {rel}"
)
if stat.S_ISLNK(path_stat.st_mode) or not stat.S_ISREG(path_stat.st_mode):
die(
"Engine MCP execution plan materialization predecessor is "
f"unsafe: {rel}"
)
actual_sha256 = sha256_file(path)
if actual_sha256 != expected_sha256:
die(
"Engine MCP execution plan materialization predecessor drift "
f"detected: path={rel} expected={expected_sha256} "
f"actual={actual_sha256}"
)
actual[rel] = actual_sha256
foundation = {}
for rel, expected_sha256 in (
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_FOUNDATION_SHA256.items()
):
path = root / rel
try:
path_stat = path.lstat()
except FileNotFoundError:
die(
"Engine MCP execution plan materialization foundation is "
f"missing: {rel}"
)
if (
stat.S_ISLNK(path_stat.st_mode)
or not stat.S_ISREG(path_stat.st_mode)
or sha256_file(path) != expected_sha256
):
die(
"Engine MCP execution plan materialization foundation drift "
f"detected: {rel}"
)
foundation[rel] = expected_sha256
for rel in ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_NEW_PATHS:
path = root / rel
if path.exists() or path.is_symlink():
die(
"Engine MCP execution plan materialization new path already "
f"exists: {rel}"
)
backend = preflight_engine_credential_backend_runtime()
if backend["mode"] != "verified-derived-retry":
die(
"Engine MCP execution plan materialization requires the active "
"immutable backend"
)
return {
"mode": "telemetry-catalog-v1-to-execution-plan-materialization-v1",
"predecessor_sha256": actual,
"foundation_sha256": foundation,
"target_sha256": dict(
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_TARGET_SHA256
),
"new_paths": tuple(ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_NEW_PATHS),
"backend_mode": backend["mode"],
}
def preflight_engine_agent_full_grant_migration_predecessor():
root = component_root("engine")
store_path = root / ENGINE_AGENT_FULL_GRANT_MIGRATION_STORE_REL
@@ -6432,6 +6744,7 @@ def component_services(component, entries=None):
or is_engine_provider_target_host_policy_slice(component, entries)
or is_engine_mcp_execution_profile_decoder_slice(component, entries)
or is_engine_mcp_telemetry_catalog_slice(component, entries)
or is_engine_mcp_execution_plan_materialization_slice(component, entries)
or is_engine_provider_security_catalog_slice(component, entries)
):
# This slice updates only the existing Engine backend control plane.
@@ -8642,6 +8955,7 @@ def plan_artifact(artifact):
provider_target_host_policy_preflight = None
mcp_execution_profile_decoder_preflight = None
mcp_telemetry_catalog_preflight = None
mcp_execution_plan_materialization_preflight = None
provider_catalog_preflight = None
with tempfile.TemporaryDirectory(prefix="plan-", dir=TMP_DIR) as tmp:
manifest, entries, payload_dir = load_artifact(artifact, Path(tmp))
@@ -8707,6 +9021,13 @@ def plan_artifact(artifact):
mcp_telemetry_catalog_preflight = (
preflight_engine_mcp_telemetry_catalog_predecessor()
)
if is_engine_mcp_execution_plan_materialization_slice(
manifest["component"],
entries,
):
mcp_execution_plan_materialization_preflight = (
preflight_engine_mcp_execution_plan_materialization_predecessor()
)
if is_engine_provider_security_catalog_slice(manifest["component"], entries):
provider_catalog_preflight = preflight_engine_provider_security_catalog_predecessor()
@@ -8749,6 +9070,12 @@ def plan_artifact(artifact):
component,
entries,
)
touches_mcp_execution_plan_materialization = (
is_engine_mcp_execution_plan_materialization_slice(
component,
entries,
)
)
touches_agent_grant_migration = is_engine_agent_full_grant_migration_slice(
component,
entries,
@@ -8766,6 +9093,7 @@ def plan_artifact(artifact):
or touches_provider_target_host_policy
or touches_mcp_execution_profile_decoder
or touches_mcp_telemetry_catalog
or touches_mcp_execution_plan_materialization
or touches_agent_grant_migration
):
credential_backend_preflight = preflight_engine_credential_backend_runtime()
@@ -8816,6 +9144,14 @@ def plan_artifact(artifact):
"Engine MCP telemetry catalog requires the active immutable "
"credential backend"
)
if touches_mcp_execution_plan_materialization:
if mcp_execution_plan_materialization_preflight is None:
die("Engine MCP execution plan materialization preflight is missing")
if credential_backend_preflight["mode"] != "verified-derived-retry":
die(
"Engine MCP execution plan materialization requires the active "
"immutable credential backend"
)
if touches_agent_grant_migration:
agent_grant_migration_predecessor_sha256 = (
preflight_engine_agent_full_grant_migration_predecessor()
@@ -9182,6 +9518,82 @@ def plan_artifact(artifact):
print("engine_databases=untouched")
print("mcp_nginx=untouched")
print("embedded_ai_workspace=untouched")
if mcp_execution_plan_materialization_preflight:
print(
"engine_mcp_authoring_transition="
f"{mcp_execution_plan_materialization_preflight['mode']}"
)
print("engine_mcp_version=0.9.0")
print("engine_mcp_surface=external-codex")
print(
"engine_mcp_tool="
"engine_plan_l2_execution_plan_materialization"
)
print(
"engine_mcp_tool="
"engine_apply_l2_execution_plan_materialization"
)
print("engine_mcp_provider_logic_authority=trusted-provider-package")
print("engine_mcp_unmanaged_graph_policy=explicit-adoption-required")
print("engine_mcp_plan_phase=read-only")
print("engine_mcp_apply_phase=opaque-plan-ref-only")
print("node_intelligence_descriptor=attested-gateway-successor")
print("node_intelligence_release=2.33.2-974a9fb3492f")
print("node_intelligence_image=preserved")
for foundation_path, foundation_sha256 in (
mcp_execution_plan_materialization_preflight[
"foundation_sha256"
].items()
):
print(
"engine_mcp_execution_plan_materialization_foundation_sha256"
f"[{foundation_path}]={foundation_sha256}"
)
for changed_path in (
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_ARTIFACT_ENTRIES
):
print(
"engine_mcp_execution_plan_materialization_changed_path="
f"{changed_path}"
)
if changed_path in mcp_execution_plan_materialization_preflight[
"predecessor_sha256"
]:
print(
"engine_mcp_execution_plan_materialization_predecessor_sha256"
f"[{changed_path}]="
f"{mcp_execution_plan_materialization_preflight['predecessor_sha256'][changed_path]}"
)
elif changed_path in mcp_execution_plan_materialization_preflight[
"new_paths"
]:
print(
"engine_mcp_execution_plan_materialization_predecessor_state"
f"[{changed_path}]=absent"
)
else:
die(
"Engine MCP execution plan materialization plan has no "
f"predecessor state: {changed_path}"
)
print(
"engine_mcp_execution_plan_materialization_target_sha256"
f"[{changed_path}]="
f"{mcp_execution_plan_materialization_preflight['target_sha256'][changed_path]}"
)
print(
"backend_current_barrier="
f"{mcp_execution_plan_materialization_preflight['backend_mode']}"
)
print("backend_force_recreate=yes")
print("backend_pull=never")
print("l2_graph=untouched")
print("n8n_l1=untouched")
print("engine_ui=untouched")
print("engine_databases=untouched")
print("credentials=preserved")
print("mcp_nginx=untouched")
print("embedded_ai_workspace=untouched")
if transition_descriptor:
print(f"n8n_transition={transition_descriptor['action']}")
print(f"n8n_version={transition_descriptor['n8nVersion']}")
@@ -10300,6 +10712,10 @@ def component_healthchecks(component, entries=None, services=None):
or is_engine_provider_target_host_policy_slice(component, entries)
or is_engine_mcp_execution_profile_decoder_slice(component, entries)
or is_engine_mcp_telemetry_catalog_slice(component, entries)
or is_engine_mcp_execution_plan_materialization_slice(
component,
entries,
)
or is_engine_agent_full_grant_migration_slice(component, entries)
or is_engine_mcp_control_plane_slice(component, entries)
or is_engine_mcp_ontology_sdk_slice(component, entries)
@@ -10717,6 +11133,12 @@ def run_healthchecks(component, entries=None, services=None):
component,
entries,
)
touches_mcp_execution_plan_materialization = (
is_engine_mcp_execution_plan_materialization_slice(
component,
entries,
)
)
touches_agent_grant_migration = is_engine_agent_full_grant_migration_slice(
component,
entries,
@@ -10735,6 +11157,7 @@ def run_healthchecks(component, entries=None, services=None):
or touches_provider_target_host_policy
or touches_mcp_execution_profile_decoder
or touches_mcp_telemetry_catalog
or touches_mcp_execution_plan_materialization
or touches_agent_grant_migration
or touches_mcp_control_plane
or touches_mcp_ontology_sdk
@@ -10757,6 +11180,7 @@ def run_healthchecks(component, entries=None, services=None):
or touches_provider_target_host_policy
or touches_mcp_execution_profile_decoder
or touches_mcp_telemetry_catalog
or touches_mcp_execution_plan_materialization
or touches_agent_grant_migration
or touches_mcp_control_plane
or touches_mcp_ontology_sdk
@@ -10902,6 +11326,48 @@ def run_healthchecks(component, entries=None, services=None):
"Engine MCP telemetry catalog installed state is neither target "
"nor rollback predecessor"
)
if touches_mcp_execution_plan_materialization:
root = component_root("engine")
target_state = all(
(root / rel).is_file()
and not (root / rel).is_symlink()
and sha256_file(root / rel) == expected
for rel, expected in (
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_TARGET_SHA256.items()
)
) and all(
(root / rel).is_file()
and not (root / rel).is_symlink()
and sha256_file(root / rel) == expected
for rel, expected in (
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_FOUNDATION_SHA256.items()
)
)
predecessor_state = all(
(root / rel).is_file()
and not (root / rel).is_symlink()
and sha256_file(root / rel) == expected
for rel, expected in (
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_PREDECESSOR_SHA256.items()
)
) and all(
(root / rel).is_file()
and not (root / rel).is_symlink()
and sha256_file(root / rel) == expected
for rel, expected in (
ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_FOUNDATION_SHA256.items()
)
) and all(
not (root / rel).exists() and not (root / rel).is_symlink()
for rel in ENGINE_MCP_EXECUTION_PLAN_MATERIALIZATION_NEW_PATHS
)
if target_state:
accept_engine_mcp_execution_plan_materialization_runtime()
elif not predecessor_state:
die(
"Engine MCP execution plan materialization installed state is "
"neither target nor rollback predecessor"
)
container_name = COMPONENTS[component].get("health_container")
if container_name:
healthcheck_container(container_name)
@@ -11019,6 +11485,22 @@ def apply_artifact(artifact):
"Engine MCP telemetry catalog requires the active "
"immutable credential backend"
)
if is_engine_mcp_execution_plan_materialization_slice(
component,
entries,
):
preflight_engine_mcp_execution_plan_materialization_predecessor()
execution_plan_materialization_backend_preflight = (
preflight_engine_credential_backend_runtime()
)
if (
execution_plan_materialization_backend_preflight["mode"]
!= "verified-derived-retry"
):
die(
"Engine MCP execution plan materialization requires "
"the active immutable credential backend"
)
if is_engine_agent_full_grant_migration_slice(component, entries):
preflight_engine_agent_full_grant_migration_predecessor()
migration_backend_preflight = preflight_engine_credential_backend_runtime()
@@ -11276,6 +11758,10 @@ def apply_artifact(artifact):
entries,
)
or is_engine_mcp_telemetry_catalog_slice(component, entries)
or is_engine_mcp_execution_plan_materialization_slice(
component,
entries,
)
or is_engine_agent_full_grant_migration_slice(component, entries)
or is_engine_mcp_control_plane_slice(component, entries)
or is_engine_mcp_ontology_sdk_slice(component, entries)