fix: files manually
Some checks failed
quality-gates / verify (push) Failing after 7s

This commit is contained in:
2026-09-01 17:21:58 +01:00
parent 56c9eaa459
commit d8a4b6b3c1
36 changed files with 656 additions and 216 deletions

View File

@@ -0,0 +1,41 @@
from __future__ import annotations
from typing import Any
from kab_ingestion.models import IngestionResult
from ..publication import publish_document
from ..states.ingestion_state import IngestionState
from ..validation import validate_document
def deployment_node(
state: IngestionState,
cms: Any = None,
publish_enabled: bool = False,
require_governance_approval: bool = True,
) -> dict[str, Any]:
"""Deployment Phase: Review governance, enforce tenant ACL isolation, and publish documents."""
documents = state.get("fetched_documents", [])
results: list[IngestionResult] = []
for doc in documents:
report = validate_document(doc)
if not report.valid:
results.append(IngestionResult(doc, False, "invalid", "; ".join(report.errors)))
continue
res = publish_document(doc, cms, publish_enabled, require_governance_approval)
results.append(res)
accepted_count = sum(1 for r in results if r.accepted)
final_output = {
"total": len(results),
"accepted": accepted_count,
"results": results,
"status": "completed" if not state.get("has_errors") else "completed_with_errors",
}
return {
"published_results": results,
"final_output": final_output,
"current_step": "deployment",
"next_step": "END",
}