Integrations
Brain Town feed
Brain Town is a public, animated town that shows work as it happens: each GAOS product is a hall, each task a person. When you turn the feed on, GAOS sends one HTTP POST to a receiver you name after each committed change. It sends task titles to a third party, so it is off by default and a product is sent as hidden and redacted unless you list it as public.
The four settings
| Setting | Default | Meaning |
|---|---|---|
BRAIN_TOWN_ENABLED | off | true or 1 turns the feed on. Anything else: no listener, no goroutine, no request. |
BRAIN_TOWN_URL | unset | The receiver's full ingest URL, from its back office (for example https://town.example.org/ingest/gaos/<integration-id>). https only; no userinfo, query or fragment; redirects are refused; it may not name the host of the database, ai-manager or the QA tools. |
BRAIN_TOWN_TOKEN_FILE | unset | A file holding the receiver's bearer token (16 to 256 printable characters, no spaces), mode 600. In production it is deploy/stacks/prod.bt-token; an empty file leaves the feed off. A token is never an environment variable, and a gaos_ token or any GAOS API token is refused. |
BRAIN_TOWN_PUBLIC_PRODUCTS | empty | Comma-separated product ids (p-6) sent as public. Every other product is sent as hidden. |
An unusable setting never stops GAOS: the feed stays off, the boot log says why
(brain town: off (…)) and the back office's Integrations view shows the reason.
What is sent
Only committed changes: on the database store an event reaches the feed after its transaction commits.
Each POST carries Authorization: Bearer, Idempotency-Key (the event id) and a JSON
body {id, type, at, product, task, data}.
| GAOS moment | type | data |
|---|---|---|
| A product is created, or is first seen, or its name or visibility changed | product.upserted | |
| A task is planned (or first seen after a restart) | task.created | |
| Any task status change | task.moved | from, to (board columns), agent when the card enters working |
| A turn starts | task.claimed | agent (the task's role; GAOS has no agent id) |
| A review task becomes ready | gate.requested | |
| A review is cleared, or a design is blocked | gate.decided | decision: approved or rejected |
| A task reaches done | task.done | |
| A task fails or is cancelled | task.failed | reason: failed or canceled |
task.qa is not sent: GAOS's QA result event names no task. A send-back moves a
finished design out of done, so a task can send task.done twice; the receiver must
accept a move after done. A failed review is not a verdict, so it sends task.moved and no
gate.decided. The column is GAOS's board column id: backlog,
ready, working, needs-you, review, blocked,
failed, done or canceled.
What a hidden product leaks
Nothing that names it. For a product not in BRAIN_TOWN_PUBLIC_PRODUCTS, GAOS redacts
before sending: visibility is hidden, product.name is
Private product and each task.title is the task id. The product key is the product
id. For a public product the real name and titles are sent, titles cut to 200 characters with control
characters removed; a title that looks like a credential is replaced by the task id. No operator account,
event text or block reason is ever read into a body.
Delivery
- A background worker sends in order. A slow or dead receiver never slows a GAOS action: the hand-off is a non-blocking queue of 2000, and a full queue drops the new event and counts it.
- 3 second timeout. Network errors,
429and5xxare retried after 1 s, 5 s and 30 s with the same id; other4xxare not retried;409means already accepted and is success. After three events in a row give up, each event gets one attempt until one succeeds. - An event that is dropped or given up on makes GAOS announce its task and product again before the next event for them. Events queued at shutdown are not replayed.
- One log line per failed delivery:
brain town: event <id> <type> status <code or class>. Never the URL, the token, a body or a title.
Turn it on
- Create the token file:
install -m 600 /dev/null deploy/stacks/prod.bt-token, then put the receiver's token in it. It must exist beforeup, even empty. - Redeploy with the settings on the line, and repeat them on every redeploy:
BRAIN_TOWN_ENABLED=true BRAIN_TOWN_URL=https://town.example.org/ingest/gaos/<id> BRAIN_TOWN_PUBLIC_PRODUCTS=p-6 ./deploy/rebuild-restart.sh prod deploy --tag vX.Y.Z. - Open the back office's Integrations view: the Brain Town block says enabled, the receiver's host, and the last delivery. Move a card and watch the count.