feat(task-019): add deterministic end-to-end demo stack flow

This commit is contained in:
2026-05-22 01:44:41 +03:00
parent 95fec3ba26
commit 7667819c46
10 changed files with 732 additions and 20 deletions
+19 -5
View File
@@ -4,6 +4,11 @@ from datetime import UTC, datetime
from hashlib import sha256
from uuid import NAMESPACE_URL, UUID, uuid5
from src.application.demo_runtime import (
ensure_demo_bare_repository,
is_demo_mode,
resolve_demo_repository_path,
)
from src.domain.contracts import (
PublishingRules,
Role,
@@ -44,8 +49,9 @@ def seed_reference_data(repository: object) -> None:
updated_at=SEED_TIMESTAMP,
)
repository_url = _repository_url_for_seed()
publishing_rules = PublishingRules(
repository_url="git@github.com:example/site.git",
repository_url=repository_url,
production_branch="main",
content_format="mdx",
content_path_template="content/articles/{slug}.mdx",
@@ -85,15 +91,15 @@ def seed_reference_data(repository: object) -> None:
updated_at=SEED_TIMESTAMP,
)
publishing_yaml = """target: b2b_saas_blog
publishing_yaml = f"""target: b2b_saas_blog
repository:
url: git@github.com:example/site.git
url: {repository_url}
branch: main
content:
format: mdx
path_template: content/articles/{slug}.mdx
path_template: content/articles/{{slug}}.mdx
assets:
path_template: public/articles/{slug}/{filename}
path_template: public/articles/{{slug}}/{{filename}}
"""
transform_script = """export function transformArticle(article) {
return {
@@ -121,6 +127,14 @@ assets:
)
def _repository_url_for_seed() -> str:
if not is_demo_mode():
return "git@github.com:example/site.git"
demo_repo_path = resolve_demo_repository_path()
ensure_demo_bare_repository(demo_repo_path)
return str(demo_repo_path)
def _stable_uuid(value: str) -> UUID:
return uuid5(NAMESPACE_URL, f"ai-content-pipeline:{value}")