feat: serve Executions over A2A with a pre-approved /generate

Increment 7 of .scratch/solution-architect-agent/spec.md.

- app/assembly.py: composition root building the engine from settings
  and the provider bundle (roles, ADK runtime, MCP catalog, Terraform
  tools, checkpointer, recorder).
- app/a2a: a2a-sdk 1.1 JSON-RPC server (v0.3 compatible) mapping tasks to
  Executions; questions, Approvals and permissions pause as
  input-required; Approvals accepted only as structured data; completed
  tasks return the guide and code as artifacts; agent card derived from
  the dependency graph.
- POST /generate runs a pre-approved Execution with the legacy keys.
- Specialist exceptions are relayed to the user; Orchestrator exceptions
  fail the task. Engine accepts a caller-chosen execution id.
- Dockerfile installs checksum-verified Terraform and ships agents,
  providers and skills; add mcp and a2a-sdk requirements.
- 17 new tests; full suite 206 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-16 10:23:24 +01:00
parent ed104e5697
commit ad371b2ec4
19 changed files with 1116 additions and 3 deletions

View File

@@ -12,6 +12,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY requirements.txt ./
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
# Terraform CLI for fmt/validate/plan tools (never apply), verified against HashiCorp's checksums
ARG TERRAFORM_VERSION=1.14.3
RUN apt-get update && apt-get install -y --no-install-recommends unzip \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSLO "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" \
&& curl -fsSLO "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS" \
&& grep "linux_amd64.zip" "terraform_${TERRAFORM_VERSION}_SHA256SUMS" | sha256sum -c - \
&& unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -d /usr/local/bin \
&& rm "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" "terraform_${TERRAFORM_VERSION}_SHA256SUMS"
# Final production image stage
FROM python:3.12-slim
@@ -28,9 +38,13 @@ RUN groupadd -g 10001 appgroup && \
# Copy installed dependencies from builder
COPY --from=builder /install /usr/local
COPY --from=builder /usr/local/bin/terraform /usr/local/bin/terraform
# Copy application source, skills, and configuration
COPY app/ ./app/
COPY agents/ ./agents/
COPY providers/ ./providers/
COPY skills/ ./skills/
COPY eval/ ./eval/
COPY docs/ ./docs/
COPY deliverables/ ./deliverables/
@@ -42,7 +56,9 @@ RUN chown -R appuser:appgroup /app
USER appuser
EXPOSE 8080
# 8080: legacy REST app (removed in increment 9). 8000: A2A server with pre-approved /generate:
# python -m app.a2a.server
EXPOSE 8080 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health')" || exit 1