feat: add full creative studio + DevOps tools (Pixel, Lyra, Reel personas)
Adds 3 new personas (Pixel, Lyra, Reel) and 5 new tool modules:
- Git/DevOps tools (GitPython): clone, status, diff, log, blame, branch,
add, commit, push, pull, stash — wired to Forge and Helm personas
- Image generation (FLUX via diffusers): text-to-image, storyboards,
variations — Pixel persona
- Music generation (ACE-Step 1.5): full songs with vocals+instrumentals,
instrumental tracks, vocal-only tracks — Lyra persona
- Video generation (Wan 2.1 via diffusers): text-to-video, image-to-video
clips — Reel persona
- Creative Director pipeline: multi-step orchestration that chains
storyboard → music → video → assembly into 3+ minute final videos
- Video assembler (MoviePy + FFmpeg): stitch clips, overlay audio,
title cards, subtitles, final export
Also includes:
- Spark Intelligence tool-level + creative pipeline event capture
- Creative Studio dashboard page (/creative/ui) with 4 tabs
- Config settings for all new models and output directories
- pyproject.toml creative optional extra for GPU dependencies
- 107 new tests covering all modules (624 total, all passing)
https://claude.ai/code/session_01KJm6jQkNi3aA3yoQJn636c
2026-02-24 16:31:47 +00:00
|
|
|
"""Tests for Spark engine tool-level and creative pipeline event capture.
|
|
|
|
|
|
|
|
|
|
Covers the new on_tool_executed() and on_creative_step() methods added
|
|
|
|
|
in Phase 6.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
from spark.engine import SparkEngine
|
2026-03-08 12:50:44 -04:00
|
|
|
from spark.memory import count_events, get_events
|
feat: add full creative studio + DevOps tools (Pixel, Lyra, Reel personas)
Adds 3 new personas (Pixel, Lyra, Reel) and 5 new tool modules:
- Git/DevOps tools (GitPython): clone, status, diff, log, blame, branch,
add, commit, push, pull, stash — wired to Forge and Helm personas
- Image generation (FLUX via diffusers): text-to-image, storyboards,
variations — Pixel persona
- Music generation (ACE-Step 1.5): full songs with vocals+instrumentals,
instrumental tracks, vocal-only tracks — Lyra persona
- Video generation (Wan 2.1 via diffusers): text-to-video, image-to-video
clips — Reel persona
- Creative Director pipeline: multi-step orchestration that chains
storyboard → music → video → assembly into 3+ minute final videos
- Video assembler (MoviePy + FFmpeg): stitch clips, overlay audio,
title cards, subtitles, final export
Also includes:
- Spark Intelligence tool-level + creative pipeline event capture
- Creative Studio dashboard page (/creative/ui) with 4 tabs
- Config settings for all new models and output directories
- pyproject.toml creative optional extra for GPU dependencies
- 107 new tests covering all modules (624 total, all passing)
https://claude.ai/code/session_01KJm6jQkNi3aA3yoQJn636c
2026-02-24 16:31:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
|
def tmp_spark_db(tmp_path, monkeypatch):
|
|
|
|
|
db_path = tmp_path / "spark.db"
|
|
|
|
|
monkeypatch.setattr("spark.memory.DB_PATH", db_path)
|
|
|
|
|
monkeypatch.setattr("spark.eidos.DB_PATH", db_path)
|
|
|
|
|
yield db_path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestOnToolExecuted:
|
|
|
|
|
def test_captures_tool_event(self):
|
|
|
|
|
engine = SparkEngine(enabled=True)
|
|
|
|
|
eid = engine.on_tool_executed("agent-a", "git_commit", task_id="t1")
|
|
|
|
|
assert eid is not None
|
|
|
|
|
events = get_events(event_type="tool_executed")
|
|
|
|
|
assert len(events) == 1
|
|
|
|
|
assert "git_commit" in events[0].description
|
|
|
|
|
|
|
|
|
|
def test_captures_tool_failure(self):
|
|
|
|
|
engine = SparkEngine(enabled=True)
|
|
|
|
|
eid = engine.on_tool_executed("agent-a", "generate_image", success=False)
|
|
|
|
|
assert eid is not None
|
|
|
|
|
events = get_events(event_type="tool_executed")
|
|
|
|
|
assert len(events) == 1
|
|
|
|
|
assert "FAIL" in events[0].description
|
|
|
|
|
|
|
|
|
|
def test_captures_duration(self):
|
|
|
|
|
engine = SparkEngine(enabled=True)
|
|
|
|
|
engine.on_tool_executed("agent-a", "generate_song", duration_ms=5000)
|
|
|
|
|
events = get_events(event_type="tool_executed")
|
|
|
|
|
assert len(events) == 1
|
|
|
|
|
|
|
|
|
|
def test_disabled_returns_none(self):
|
|
|
|
|
engine = SparkEngine(enabled=False)
|
|
|
|
|
result = engine.on_tool_executed("agent-a", "git_push")
|
|
|
|
|
assert result is None
|
|
|
|
|
|
|
|
|
|
def test_multiple_tool_events(self):
|
|
|
|
|
engine = SparkEngine(enabled=True)
|
|
|
|
|
engine.on_tool_executed("agent-a", "git_add")
|
|
|
|
|
engine.on_tool_executed("agent-a", "git_commit")
|
|
|
|
|
engine.on_tool_executed("agent-a", "git_push")
|
|
|
|
|
assert count_events("tool_executed") == 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestOnCreativeStep:
|
|
|
|
|
def test_captures_creative_step(self):
|
|
|
|
|
engine = SparkEngine(enabled=True)
|
|
|
|
|
eid = engine.on_creative_step(
|
|
|
|
|
project_id="proj-1",
|
|
|
|
|
step_name="storyboard",
|
|
|
|
|
agent_id="pixel-001",
|
|
|
|
|
output_path="/data/images/frame.png",
|
|
|
|
|
)
|
|
|
|
|
assert eid is not None
|
|
|
|
|
events = get_events(event_type="creative_step")
|
|
|
|
|
assert len(events) == 1
|
|
|
|
|
assert "storyboard" in events[0].description
|
|
|
|
|
|
|
|
|
|
def test_captures_failed_step(self):
|
|
|
|
|
engine = SparkEngine(enabled=True)
|
|
|
|
|
engine.on_creative_step(
|
|
|
|
|
project_id="proj-1",
|
|
|
|
|
step_name="music",
|
|
|
|
|
agent_id="lyra-001",
|
|
|
|
|
success=False,
|
|
|
|
|
)
|
|
|
|
|
events = get_events(event_type="creative_step")
|
|
|
|
|
assert len(events) == 1
|
|
|
|
|
assert "FAIL" in events[0].description
|
|
|
|
|
|
|
|
|
|
def test_disabled_returns_none(self):
|
|
|
|
|
engine = SparkEngine(enabled=False)
|
|
|
|
|
result = engine.on_creative_step("p1", "storyboard", "pixel-001")
|
|
|
|
|
assert result is None
|
|
|
|
|
|
|
|
|
|
def test_full_pipeline_events(self):
|
|
|
|
|
engine = SparkEngine(enabled=True)
|
|
|
|
|
steps = ["storyboard", "music", "video", "assembly"]
|
|
|
|
|
agents = ["pixel-001", "lyra-001", "reel-001", "reel-001"]
|
ruff (#169)
* polish: streamline nav, extract inline styles, improve tablet UX
- Restructure desktop nav from 8+ flat links + overflow dropdown into
5 grouped dropdowns (Core, Agents, Intel, System, More) matching
the mobile menu structure to reduce decision fatigue
- Extract all inline styles from mission_control.html and base.html
notification elements into mission-control.css with semantic classes
- Replace JS-built innerHTML with secure DOM construction in
notification loader and chat history
- Add CONNECTING state to connection indicator (amber) instead of
showing OFFLINE before WebSocket connects
- Add tablet breakpoint (1024px) with larger touch targets for
Apple Pencil / stylus use and safe-area padding for iPad toolbar
- Add active-link highlighting in desktop dropdown menus
- Rename "Mission Control" page title to "System Overview" to
disambiguate from the chat home page
- Add "Home — Timmy Time" page title to index.html
https://claude.ai/code/session_015uPUoKyYa8M2UAcyk5Gt6h
* fix(security): move auth-gate credentials to environment variables
Hardcoded username, password, and HMAC secret in auth-gate.py replaced
with os.environ lookups. Startup now refuses to run if any variable is
unset. Added AUTH_GATE_SECRET/USER/PASS to .env.example.
https://claude.ai/code/session_015uPUoKyYa8M2UAcyk5Gt6h
* refactor(tooling): migrate from black+isort+bandit to ruff
Replace three separate linting/formatting tools with a single ruff
invocation. Updates tox.ini (lint, format, pre-push, pre-commit envs),
.pre-commit-config.yaml, and CI workflow. Fixes all ruff errors
including unused imports, missing raise-from, and undefined names.
Ruff config maps existing bandit skips to equivalent S-rules.
https://claude.ai/code/session_015uPUoKyYa8M2UAcyk5Gt6h
---------
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-11 12:23:35 -04:00
|
|
|
for step, agent in zip(steps, agents, strict=False):
|
feat: add full creative studio + DevOps tools (Pixel, Lyra, Reel personas)
Adds 3 new personas (Pixel, Lyra, Reel) and 5 new tool modules:
- Git/DevOps tools (GitPython): clone, status, diff, log, blame, branch,
add, commit, push, pull, stash — wired to Forge and Helm personas
- Image generation (FLUX via diffusers): text-to-image, storyboards,
variations — Pixel persona
- Music generation (ACE-Step 1.5): full songs with vocals+instrumentals,
instrumental tracks, vocal-only tracks — Lyra persona
- Video generation (Wan 2.1 via diffusers): text-to-video, image-to-video
clips — Reel persona
- Creative Director pipeline: multi-step orchestration that chains
storyboard → music → video → assembly into 3+ minute final videos
- Video assembler (MoviePy + FFmpeg): stitch clips, overlay audio,
title cards, subtitles, final export
Also includes:
- Spark Intelligence tool-level + creative pipeline event capture
- Creative Studio dashboard page (/creative/ui) with 4 tabs
- Config settings for all new models and output directories
- pyproject.toml creative optional extra for GPU dependencies
- 107 new tests covering all modules (624 total, all passing)
https://claude.ai/code/session_01KJm6jQkNi3aA3yoQJn636c
2026-02-24 16:31:47 +00:00
|
|
|
engine.on_creative_step("proj-1", step, agent)
|
|
|
|
|
assert count_events("creative_step") == 4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestSparkStatusIncludesNewTypes:
|
|
|
|
|
def test_status_includes_tool_executed(self):
|
|
|
|
|
engine = SparkEngine(enabled=True)
|
|
|
|
|
engine.on_tool_executed("a", "git_commit")
|
|
|
|
|
status = engine.status()
|
|
|
|
|
assert "tool_executed" in status["event_types"]
|
|
|
|
|
assert status["event_types"]["tool_executed"] == 1
|
|
|
|
|
|
|
|
|
|
def test_status_includes_creative_step(self):
|
|
|
|
|
engine = SparkEngine(enabled=True)
|
|
|
|
|
engine.on_creative_step("p1", "storyboard", "pixel-001")
|
|
|
|
|
status = engine.status()
|
|
|
|
|
assert "creative_step" in status["event_types"]
|
|
|
|
|
assert status["event_types"]["creative_step"] == 1
|