Skip to content

Phase A: Declarative deploy bundle and walking skeleton#1

Open
dealzguy wants to merge 3 commits into
mainfrom
claude/plan-claude-code-harness-itycz1
Open

Phase A: Declarative deploy bundle and walking skeleton#1
dealzguy wants to merge 3 commits into
mainfrom
claude/plan-claude-code-harness-itycz1

Conversation

@dealzguy

Copy link
Copy Markdown
Owner

Summary

This commit implements the Phase A infrastructure and walking skeleton as specified in the approved Phase A plan. It establishes the declarative deploy bundle (Docker Compose), the harness package structure, and smoke tests demonstrating durable execution through Temporal.

Key Changes

Deploy Bundle

  • deploy/compose.yaml: Four-service declarative manifest (business Postgres + pgvector, Temporal + its own Postgres, Ollama, harness worker)
  • deploy/.env.example: Secrets contract template for environment configuration
  • deploy/postgres/init.sql: pgvector extension initialization (CRM schema deferred to Phase B)
  • deploy/temporal/dynamicconfig/development.yaml: Temporal dynamic config for local dev
  • deploy/README.md: Lay-down, smoke test, and durability demonstration procedures

Harness Package Structure

  • src/harness/worker.py: Temporal worker entry point reading TEMPORAL_ADDRESS, TEMPORAL_TASK_QUEUE, TEMPORAL_NAMESPACE from environment
  • src/harness/operations/workflows/hello.py: Hello-world workflow with workflow.patched() versioning pattern
  • src/harness/operations/activities/hello.py: Hello-world activity with 2-second sleep (enables kill-the-worker durability test)
  • src/harness/contracts/infer.py: Infer contract seam with stub implementation; real Ollama + LiteLLM backend deferred to Phase C
  • src/harness/substrate/ and src/harness/commissioning/: Placeholder directories for Phase B and Phase D respectively

Tests

  • tests/test_hello_workflow.py: In-process workflow test using Temporal's time-skipping test environment (no containers required)
  • tests/test_infer_stub.py: Smoke test through the infer contract stub interface (no model call, no containers)

Project Configuration

  • pyproject.toml: Python 3.12+, temporalio>=1.7.0,<2.0, dev extras for pytest and pip-licenses
  • Dockerfile: Multi-stage build using uv for dependency management; runs harness worker
  • Makefile: Targets for up, down, test, logs, shell, licenses
  • .gitignore: Secrets, Python artifacts, data volumes, editor files
  • docs/ENVIRONMENT.md: Phase A build document recording resolved liquids, dependency pins with license tiers, and host assumptions

Implementation Details

  • Three-way separation enforced: Software (OCI images), Config (bind-mounted :ro), Data (named volumes)
  • Two-Postgres hard rule: Business database and Temporal's internal database are separate services with separate volumes; zero cross-referencing
  • Deterministic workflow pattern: workflow.patched() established in hello-world workflow to support safe versioning of in-flight executions
  • Durability demonstration: 2-second sleep in greet activity enables the kill-the-worker test (gate evidence for exact resume)
  • Stub-only infer contract: infer() raises NotImplementedError; infer_stub() returns canned response for smoke testing
  • Environment-driven configuration: All secrets and addresses read from .env via deploy/.env.example contract
  • No business logic in Phase A: Walking skeleton demonstrates infrastructure only; real workflows and agent code deferred to Phase B+

All dependency pins are recorded in docs/ENVIRONMENT.md with license tiers per Doc 8. Temporal Python SDK 1.28.0 (resolved by uv) is verified against server 1.25.2.

https://claude.ai/code/session_01UmuJ49V2JCWgYpbqrfn8kT

claude added 3 commits June 10, 2026 23:36
Resolves the two repo-init liquids (repo layout; SDK/dependency pins) per
Doc 12 §11 and Doc 13 Phase A, then implements the declarative deploy bundle
and Temporal walking skeleton:

- deploy/compose.yaml: 4-pod provisional compose manifest (persistence,
  orchestration, inference, harness); two Postgres instances with separate
  volumes enforcing the hard two-database rule; three-way software/config/data
  separation throughout; secrets delivered through .env.example contract seam

- src/harness/: Python harness with mode-visible layout (operations/ vs
  commissioning/); infer contract interface + Phase A stub; HelloWorkflow +
  greet_activity demonstrating the determinism boundary; Temporal worker entry
  point reading address/queue/namespace from env

- tests/: 5 in-process tests (no containers) — hello workflow (2), infer
  stub (3); all passing against temporalio 1.28.0 / Python 3.12.3

- docs/ENVIRONMENT.md: confirmed temporalio 1.28.0 pin, all license tiers
  verified green per Doc 8, host assumptions, open liquids recorded

Phase A exit gate: `make test` passes; `deploy/README.md` documents the
kill-the-worker durability procedure and three-way separation inspection.

https://claude.ai/code/session_01UmuJ49V2JCWgYpbqrfn8kT
Docker is not available on the development machine. Revert to
podman compose / podman-compose as the local dev runtime.

- Makefile: `docker compose` → `podman compose`
- deploy/README.md: Podman-native prerequisites; install podman-compose
  via pip; note GPL-2.0 "separate process" status per Doc 8
- docs/ENVIRONMENT.md: update dev tooling row accordingly

compose.yaml syntax is unchanged (standard Docker Compose v3 works
with both runtimes).

https://claude.ai/code/session_01UmuJ49V2JCWgYpbqrfn8kT
Review pass against the approved Phase A plan found six defects, all fixed:

- compose.yaml: remove stale docker-compose/DOCKER_HOST header text;
  drop env_file blanket injection (each pod now receives only its own
  credentials via per-service environment); drop the temporal
  healthcheck (the `temporal` CLI is not guaranteed inside the
  auto-setup image — a failing check would wedge dependents); use
  short-form depends_on throughout for podman-compose compatibility
- worker.py: bounded connection retry (30 x 2s) replaces healthcheck-
  conditioned startup ordering
- workflows/hello.py: activity start-to-close 30s -> 10s so the
  post-kill retry fires quickly in the durability demo
- deploy/README.md: durability demo rewritten around the containerized
  worker (one-paste trigger + podman compose kill); the previous
  procedure started a second host worker on the same task queue, which
  could absorb the workflow and void the demonstration; Temporal CLI
  added to prerequisites; three-way separation inspection now uses
  podman commands
- .dockerignore: keep .git/.venv out of the image build context
- docs/ENVIRONMENT.md: stale Docker host assumptions replaced with
  podman-native ones; Temporal CLI (MIT, green) recorded
- Makefile: add `make ps`
- pyproject.toml: harness license metadata (Proprietary, outbound EULA)

Tests: 5/5 passing.

https://claude.ai/code/session_01UmuJ49V2JCWgYpbqrfn8kT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants