2026-02-28 16:11:58 -05:00
|
|
|
# ── Timmy Time — Test Runner Image ───────────────────────────────────────────
|
|
|
|
|
#
|
|
|
|
|
# Lean image with test dependencies baked in. Designed to be used with
|
|
|
|
|
# docker-compose.test.yml which bind-mounts src/, tests/, and static/
|
|
|
|
|
# so you never rebuild for code changes — only when deps change.
|
|
|
|
|
#
|
|
|
|
|
# Build: docker compose -f docker-compose.test.yml build
|
|
|
|
|
# Run: docker compose -f docker-compose.test.yml run --rm test
|
|
|
|
|
#
|
|
|
|
|
# The builder stage is shared with the production Dockerfile so
|
|
|
|
|
# dependency layers stay cached across dev ↔ test ↔ prod builds.
|
|
|
|
|
|
|
|
|
|
# ── Stage 1: Builder — export deps via Poetry, install via pip ──────────────
|
|
|
|
|
FROM python:3.12-slim AS builder
|
|
|
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
gcc curl \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir poetry poetry-plugin-export
|
|
|
|
|
|
|
|
|
|
# Copy only dependency files (layer caching — rebuilds only when deps change)
|
|
|
|
|
COPY pyproject.toml poetry.lock ./
|
|
|
|
|
|
|
|
|
|
# Export ALL deps including dev/test extras
|
feat: Phase 1 autonomy upgrades — introspection, heartbeat, source tagging, Discord auto-detect (#101)
UC-01: Live System Introspection Tool
- Add get_task_queue_status(), get_agent_roster(), get_live_system_status()
to timmy/tools_intro with graceful degradation
- Enhanced get_memory_status() with line counts, section headers, vault
directory listing, semantic memory row count, self-coding journal stats
- Register system_status MCP tool (creative/tools/system_status.py)
- Add system_status to Timmy's tool list + Hard Rule #7
UC-02: Fix Offline Status Bug
- Add registry.heartbeat() calls in task_processor run_loop() and
process_single_task() so health endpoint reflects actual agent status
- health.py now consults swarm registry instead of Ollama connectivity
UC-03: Message Source Tagging
- Add source field to Message dataclass (default "browser")
- Tag all message_log.append() calls: browser, api, system
- Include source in /api/chat/history response
UC-04: Discord Token Auto-Detection & Docker Fix
- Add _discord_token_watcher() background coroutine that polls every 30s
for DISCORD_TOKEN in env vars, .env file, or state file
- Add --extras discord to all three Dockerfiles (main, dashboard, test)
All 26 Phase 1 tests pass in Docker (make test-docker).
Full suite: 1889 passed, 77 skipped, 0 failed.
Co-authored-by: Alexander Payne <apayne@MM.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:49:24 -05:00
|
|
|
RUN poetry export --extras swarm --extras telegram --extras discord --extras dev \
|
2026-02-28 16:11:58 -05:00
|
|
|
--with dev --without-hashes \
|
|
|
|
|
-f requirements.txt -o requirements.txt
|
|
|
|
|
|
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
|
|
|
pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ── Stage 2: Test runtime ───────────────────────────────────────────────────
|
|
|
|
|
FROM python:3.12-slim
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
fix: Docker-first test suite, UX improvements, and bug fixes (#100)
Dashboard UX:
- Restructure nav from 22 flat links to 6 core + MORE dropdown
- Add mobile nav section labels (Core, Intelligence, Agents, System, Commerce)
- Defer marked.js and dompurify.js loading, consolidate CDN to jsdelivr
- Optimize font weights (drop unused 300/500), bump style.css cache buster
- Remove duplicate HTMX load triggers from sidebar and health panels
Bug fixes:
- Fix Timmy showing OFFLINE by registering after swarm recovery sweep
- Fix ThinkingEngine await bug with asyncio.run_coroutine_threadsafe
- Fix chat auto-scroll by calling scrollChat() after history partial loads
- Add missing /voice/button page and /voice/command endpoint
- Fix Grok api_key="" treated as falsy falling through to env key
- Fix self_modify PROJECT_ROOT using settings.repo_root instead of __file__
Docker test infrastructure:
- Bind-mount hands/, docker/, Dockerfiles, and compose files into test container
- Add fontconfig + fonts-dejavu-core for creative/assembler TextClip tests
- Initialize minimal git repo in Dockerfile.test for GitSafety compatibility
- Fix introspection and path resolution tests for Docker /app context
All 1863 tests pass in Docker (0 failures, 77 skipped).
Co-authored-by: Alexander Payne <apayne@MM.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:14:37 -05:00
|
|
|
curl git fontconfig fonts-dejavu-core \
|
2026-02-28 16:11:58 -05:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Copy installed packages from builder
|
|
|
|
|
COPY --from=builder /usr/local/lib/python3.12/site-packages \
|
|
|
|
|
/usr/local/lib/python3.12/site-packages
|
|
|
|
|
COPY --from=builder /usr/local/bin /usr/local/bin
|
|
|
|
|
|
|
|
|
|
# Create directories for bind mounts
|
fix: Docker-first test suite, UX improvements, and bug fixes (#100)
Dashboard UX:
- Restructure nav from 22 flat links to 6 core + MORE dropdown
- Add mobile nav section labels (Core, Intelligence, Agents, System, Commerce)
- Defer marked.js and dompurify.js loading, consolidate CDN to jsdelivr
- Optimize font weights (drop unused 300/500), bump style.css cache buster
- Remove duplicate HTMX load triggers from sidebar and health panels
Bug fixes:
- Fix Timmy showing OFFLINE by registering after swarm recovery sweep
- Fix ThinkingEngine await bug with asyncio.run_coroutine_threadsafe
- Fix chat auto-scroll by calling scrollChat() after history partial loads
- Add missing /voice/button page and /voice/command endpoint
- Fix Grok api_key="" treated as falsy falling through to env key
- Fix self_modify PROJECT_ROOT using settings.repo_root instead of __file__
Docker test infrastructure:
- Bind-mount hands/, docker/, Dockerfiles, and compose files into test container
- Add fontconfig + fonts-dejavu-core for creative/assembler TextClip tests
- Initialize minimal git repo in Dockerfile.test for GitSafety compatibility
- Fix introspection and path resolution tests for Docker /app context
All 1863 tests pass in Docker (0 failures, 77 skipped).
Co-authored-by: Alexander Payne <apayne@MM.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:14:37 -05:00
|
|
|
RUN mkdir -p /app/src /app/tests /app/static /app/hands /app/data /app/docker
|
|
|
|
|
|
|
|
|
|
# Initialize a minimal git repo so git-dependent code (GitSafety, repo_root
|
|
|
|
|
# detection) works correctly inside the container.
|
|
|
|
|
RUN git config --global user.email "timmy@test" \
|
|
|
|
|
&& git config --global user.name "Timmy Test" \
|
|
|
|
|
&& git init /app \
|
|
|
|
|
&& git -C /app commit --allow-empty -m "init"
|
2026-02-28 16:11:58 -05:00
|
|
|
|
|
|
|
|
ENV PYTHONPATH=/app/src:/app/tests
|
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
ENV TIMMY_TEST_MODE=1
|
|
|
|
|
|
|
|
|
|
# Default: run pytest (overridable via docker-compose command)
|
|
|
|
|
CMD ["pytest", "tests/", "-q", "--tb=short"]
|