# A complete use of this actor, as an image. Four lines, one of which is a gate.
#
# Compare it with what the hand-written testing actor carried: four hand-copied cards, a sixty-line
# `app.py`, an engine and a handler with the capability spelled into them, and a Dockerfile of
# which two lines were about the capability. All of that is the base image now (ADR-FTA-0001).
#
# The tag is pinned deliberately. A use upgrades by changing this line, which is also how it takes
# a new definition of the cards: `render-cards` below writes them from whatever wheel this image
# carries. The whole ref is one ARG, not just the tag: this repo's own CI builds the base image
# from the checkout and points this line at it, which is how the example is proven to build
# against the version being released rather than against the last one published.
#
# The default names the product registry rather than GHCR, as the implementation actor's example
# does, because it is the copy an in-cluster builder can pull (ADR-FIA-0006's arrangement, copied).
# Override it if you are somewhere else:
#     docker build --build-arg ACTOR_IMAGE=ghcr.io/papeete-hub/foundry-testing-actor:0.2.0 .
ARG ACTOR_IMAGE=papeetefoundry.azurecr.io/foundry/foundry-testing-actor:0.2.0
FROM ${ACTOR_IMAGE}

# THE KNOWLEDGE TOOLS THIS SIDECAR NAMES, and the one thing the base image deliberately does not
# install. A `ground_in:` entry supplies its own `fetch:` argv and the machinery runs whatever argv
# it is given, so which tools exist is the consumer's fact.
#
# This example's `fetch:` argvs are `printf`, so it needs nothing — the line stays, commented, as
# the shape a real use fills in (the base image runs as uid 10001, so a real one switches to root
# for the install and back):
#     USER root
#     RUN pip install --no-cache-dir <tools>
#     USER 10001

# THE BINDING. One file: the capability, its repos, its registry, its components, its grounding.
COPY actor-agentic-context.yaml /actor/

# Render the cards from the definition in the image, then refuse to build if the result does not
# conform. `lint` also checks the SIDECAR, which is hand-written and can be wrong about the
# capability it names — failing here is failing while someone is watching a build, rather than at
# a door with a caller on the other side.
RUN foundry-testing-actor render-cards /actor \
 && foundry-testing-actor lint /actor

# No CMD: the base image's is `foundry-testing-actor serve /actor`, and a use that restates it is a
# use that can get it wrong.
