feat: initial harness spec v1.0.0 + reference template

Adds the normative contract every platform agent must conform to, plus a
working reference template under template/ that ticks every box out of
the box.

Spec is derived from the production agents shipped in
cjot-backstage-az/agents/ on branch sandbox/jonathan:
  - agent-registry, agent-factory, decomposer, discovery-agent,
    golden-path, modernization-factory, modernization-factory-v2,
    policy-transformer, scaffold-agent, support-intake-agent, the-watcher

Contents:
  - SPEC.md          normative contract (13 sections + conformance checklist)
  - CHANGELOG.md     spec versioning (1.0.0)
  - docs/
      registration.md   self-registration with the agent-gateway
      observability.md  OTel logs/metrics/traces wiring
      manifest.md       /.well-known/agent.json schema + AgentSkill
                        serialisation (pydantic vs protobuf)
      kubernetes.md     k8s deployment shape, mandatory cross-refs,
                        per-namespace agents, resource sizing
      deployment.md     .image-version, ACR build, deploy scripts, rollback
      deviations.md     tracked debts against the spec
  - template/
      .env.local.example, .gitignore, .image-version (0.1.0),
      Dockerfile (python:3.12-slim, non-root UID 1001, HEALTHCHECK),
      requirements.txt (harness floor + optional LLM stack),
      app/agent.py (Starlette entry, lifespan + self-registration,
                    defensive _skill_dict for pydantic vs protobuf),
      app/logging_setup.py (canonical OTel log bridge — copy verbatim),
      app/metrics.py (meter + example counter/histogram),
      app/skills.py (AGENT_CONFIG + AgentSkill list),
      k8s/configmap.yaml + deployment.yaml (Deployment + Service,
                                            OTel annotations + 6-var env block,
                                            agents-sa + agents-kv-spc bindings),
      scripts/deploy.sh (auto-bump + az acr build + apply + rollout),
      scripts/full-deploy.sh (preflight + deploy + post-deploy smoke),
      scripts/deploy-local.sh (docker/podman + .env.local)
This commit is contained in:
2026-06-09 15:54:18 +01:00
parent c87dd3fa55
commit e6f10ba8c9
25 changed files with 1933 additions and 1 deletions

40
template/app/skills.py Normal file
View File

@@ -0,0 +1,40 @@
"""A2A skill definitions + agent config for <agent-name>.
See docs/manifest.md for the manifest schema this feeds into.
"""
from __future__ import annotations
from a2a.types import AgentSkill
# ─── Agent identity ─────────────────────────────────────────────────────
# The version here MUST match the contents of ../.image-version and the
# `service.version` token in OTEL_RESOURCE_ATTRIBUTES.
AGENT_CONFIG: dict = {
"name": "<AgentName>",
"version": "0.1.0",
"description": (
"One- to three-sentence description of what this agent does, "
"phrased for a non-engineering audience."
),
"capabilities": {
"streaming": False,
"conversational": False,
"direct_api": True,
},
}
# ─── Skills ─────────────────────────────────────────────────────────────
AGENT_SKILLS: list[AgentSkill] = [
AgentSkill(
id="echo",
name="Echo",
description=(
"A trivial skill that returns the request payload verbatim. "
"Replace with your real skills."
),
tags=["example", "echo"],
examples=[
"Echo: hello world",
],
),
]