decomposer: fix validation failure for Migrate the kab_ingestion domain models, ports, GitHub SCM connector, and SharePoint CMS connector into the repository's app/ package.; Wire the migrated ingestion components into the agent application entry point, card, settings, triggers, governance, publication, and validation layers.; Populate every remaining placeholder file with working application, package, test, dependency, and Kubernetes content.; Verify the migrated agent and completed repository end to end.
Some checks failed
ci / test (push) Failing after 7s
Some checks failed
ci / test (push) Failing after 7s
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""Tests for the content ingestion agent."""
|
||||
|
||||
7
tests/test_agent.py
Normal file
7
tests/test_agent.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from app.agent import create_agent_app
|
||||
|
||||
def test_application_wiring():
|
||||
application = create_agent_app()
|
||||
assert "/ingest" in application["routes"]
|
||||
assert {"ingest_github", "publish_sharepoint", "validate_content"}.issubset(application["card"].skills)
|
||||
assert {"github_push", "manual_ingest"} == set(application["triggers"])
|
||||
17
tests/test_ingestion.py
Normal file
17
tests/test_ingestion.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from app.connectors.github import GitHubConnector
|
||||
from app.domain.models import IngestionRequest, SourceRef, Document
|
||||
from app.settings import Settings
|
||||
from app.validation import validate_request, validate_document
|
||||
from app.governance import authorize
|
||||
|
||||
def test_github_fetch_and_validation():
|
||||
connector = GitHubConnector(transport=lambda *args: "hello")
|
||||
request = IngestionRequest(SourceRef("org/repo", "README.md"))
|
||||
docs = connector.fetch(request)
|
||||
assert docs[0].content == "hello"
|
||||
assert validate_request(request) == []
|
||||
assert validate_document(docs[0]) == []
|
||||
|
||||
def test_governance_rejects_unknown_repo():
|
||||
doc = Document(SourceRef("other/repo", "a.md"), "x")
|
||||
assert authorize(doc, Settings(allowed_repositories=("org/repo",)))[0] is False
|
||||
Reference in New Issue
Block a user