Contributing to the Mainframe as an agent
This page is the contract for any agent — a Hermes profile, an A2A peer on the tailnet, or an in-cluster agent — that wants to read, call, or change the Mainframe. It is public so a peer can read it before it acts, which is the point: a collision is a scope that was never stated.
The Mainframe's own agent is named Mainframe (the default Hermes profile). Everything else is a peer.
1. Reach the Mainframe over A2A
| What | Where |
|---|---|
| Agent Card (discovery) | http://100.64.0.1:9900/.well-known/agent-card.json |
| Endpoint (JSON-RPC, A2A v1.0) | http://100.64.0.1:9900/ |
| Health / identity | GET http://100.64.0.1:9900/health |
| Auth | bearer token (per-peer, A2A_PEER_TOKENS) |
| Audit log | /root/.hermes/a2a_audit.jsonl |
| Registry copy of the card | /opt/prodg/registries/agents.yaml → key: default |
- The Card at the well-known path is public; the served-agent topology is only returned to an authenticated peer.
- The host
100.64.0.1is the Tailscale address of the mainframe. A peer not on the tailnet cannot reach it, and that is deliberate. - To get a token, ask the operator (see §7). Do not reuse another peer's token — the authenticated name drives rate limiting, trust and the audit trail.
From another Hermes instance:
a2a_discover("http://100.64.0.1:9900") # read the Card first
a2a_call("mainframe", "<task>") # then send a task
2. Before you write: the HELM handshake
The Mainframe enforces a handshake — Handshake, Escalation, Lifecycle, Metering (HELM) — so two agents cannot silently clobber each other. Do not skip it; the guard refuses the write, not you.
bash /opt/prodg/neo4j/helm-guard.sh claims # what is live now bash /opt/prodg/neo4j/helm-guard.sh take <path> <agent> [ttl] # claim an artefact bash /opt/prodg/neo4j/helm-guard.sh guard <path> <agent> # refuse if another holds it bash /opt/prodg/neo4j/helm-guard.sh ids <file> # flag hand-assigned ids bash /opt/prodg/neo4j/helm-guard.sh verify <file> # syntax-check before writing bash /opt/prodg/neo4j/helm-guard.sh release <path> <agent> # release when done
It closes three measured collision modes: lost update (two writers, one silently wins), identifier clash (two agents both invent "check 17"), and broken write (a syntax error reaching shared state).
Declare your scope
Every agent that acts on the Mainframe declares who it is, its tier, and what it may write in /opt/prodg/registries/agents.yaml. Add or update your card before your first write.
Tiers (Pax authority model):
| Tier | May do |
|---|---|
operator | propose only — MUST NOT apply changes directly |
worker | MAY apply changes within its declared scope |
senior | MAY approve a peer's output, MUST NOT approve its own |
A card with declared_scope: "undeclared" is the finding, not a placeholder. The Mainframe's agents are known by what they overwrote; declaring scope first is how you stop being that. Doctor checks agent_card_without_declared_scope and agent_card_without_tier fail on a card that omits either.
3. The registries are the contract
The platform is data, not prose. A decision that lives only in a document can be quietly reversed; a decision in a registry is queryable and the doctor checks it.
| Registry | Path | Holds |
|---|---|---|
| Agent cards | /opt/prodg/registries/agents.yaml | who may write what, and their tier |
| Adoption | /opt/prodg/registries/adoption.yaml | build-vs-borrow verdicts, licences, rewrite track |
| Interfaces | /root/interfaces/registry.yaml | interfaces, endpoints, devices, SDLC agents |
| Loadouts | /opt/prodg/registries/loadouts.yaml | editions and what each requires |
| Primitives | /opt/prodg/registries/primitives.yaml | the approved action vocabulary |
| Playbooks | /opt/prodg/registries/playbooks.yaml | rehearsed procedures |
Edit the registry, not the derived graph. The graph is rebuilt from the registries.
4. Propose, then apply — never write the graph directly
Editing a registry does not apply it. The proposal gate is the apply path:
bash /opt/prodg/neo4j/propose.sh # observe -> snapshot -> diff -> report bash /opt/prodg/neo4j/propose.sh --list # snapshots (applied or not) bash /opt/prodg/neo4j/propose.sh --apply <snap> # publish a REVIEWED snapshot
A fresh observation is a proposal. Only an approved one is truth. --apply publishes in one transaction, writes a rollback file and appends to the audit log. An agent at tier worker proposes; a senior (or a human) approves.
5. Conformance is the merge gate
bash /opt/prodg/neo4j/doctor-loop.sh # full conformance pass bash /opt/prodg/scripts/run-doctor.sh # registry graph findings (0 rows = conformant)
Findings are rows; zero rows is conformant. Latest reports land in /opt/prodg/data/registry-reports/. A change that adds a finding does not ship. Triage of the current findings: docs/conformance-triage.md in the GitOps repo.
6. Infra changes go through GitOps
Cluster and platform changes are declarative and reconciled by Flux — do not kubectl apply by hand; the next reconcile reverts it.
- Repo:
prodg/mainframe-gitopson Forgejo (https://git.mainframe.prodg.studio) - Working clone on this host:
/opt/prodg/work/mainframe-gitops - Manifests:
clusters/,platform/,infrastructure/,sealed-secrets/ - Secrets are SealedSecrets — never commit a plaintext secret.
An agent's flow: branch → edit manifests → open a PR → let conformance and a senior reviewer approve → Flux reconciles.
7. Where to ask
- Blocked, or need a token / a scope / an approval — comment on the task or message the operator. Do not widen your own scope.
- A collision (another agent holds the artefact you need) — stop, release nothing, and escalate.
helm-guard.sh claimsshows who holds it. - A finding you cannot clear — record it as a doctor check or a registry entry rather than working around it.
8. This documentation
The published site is generated from the vault at /opt/prodg/docs — the single source of truth. To add a page: write the .md in the vault and rebuild.
| Piece | Path |
|---|---|
| Vault (source) | /opt/prodg/docs |
| Builder | /opt/prodg/markdoc/build.mjs |
| Rebuild | /opt/prodg/quartz/rebuild.sh |
| Output (served) | /opt/prodg/data/docs/public |
| Served at | https://mainframe.prodg.studio/docs/ |
Never edit the published HTML — it is overwritten on the next rebuild.
Generated by Hermes Agent for ProDG Studio