askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
danq9
signup: the person chooses the password and name on the confirm page
83c7aa6
2 weeks, 5 days ago
History
agent_registry.json · 5.8 KB · 39 lines
| 1 | { |
| 2 | "name": "agent_registry", |
| 3 | "title": "Agents", |
| 4 | "version": 1, |
| 5 | "description": "Who is operating this server right now, what they are for, and whether they are still alive. THE TEST THIS COLLECTION HAD TO PASS BEFORE IT WAS ALLOWED TO EXIST: every field here must be something NOT derivable from data the box already keeps. What an agent has DONE is record_changes -- every write on this box already carries an actor, and app-activity already renders per-actor history, so duplicating any of it here would be two truths that drift (the same argument wallets.balance_minor loses to wallet_entries). WHO an agent is, is object_identity: an agent IS a user, provisioned by create_user and holding an API key, not a second identity concept -- agent_id is a pointer, never a copy. What survives that test is exactly three things. LIVENESS, because a heartbeat is not a last-write: an agent reasoning for ten minutes writes nothing at all and is perfectly alive, so 'when did it last change a record' cannot answer 'is it still there', and no fold over the change log ever will. PURPOSE AND CAPABILITY, because nothing anywhere records what an agent is FOR or what it can do -- and capabilities are what turn this registry into the routing table a federated worker needs (plan/federated-workers-spec.md: a peer advertises gpu, ffmpeg, whisper, triposr and claims only matching work). SPEND CAP, which became meaningful the day app-runner shipped holds: an agent that can queue a template run can spend real money at a provider, and plan/vocabulary/25-agents-spec.md filed a cap as a placeholder precisely because no spend-control mechanism existed then. One does now. Deliberately NOT here, each named so it reads as a decision: a task queue (tasks and template_runs already exist, and claiming is update_record with expected_rev rather than a bespoke verb); a message channel (feed_posts in app-collab already IS the coordination feed, with claim and release in its kind enum since before this package existed); and any counter of work done, which is a fold over the change log.", |
| 6 | "fields": [ |
| 7 | {"name": "id"}, |
| 8 | {"name": "agent_id", "type": "text", "required": true, "label": "Agent", |
| 9 | "help": "The user_id this agent authenticates as. A POINTER into object_identity, never a copy of it: an agent is provisioned with create_user like any other principal, holds an API key (object_api_keys), and every write it makes already carries this as the actor. Roles, status and display name live there and are not restated here."}, |
| 10 | {"name": "label", "type": "text", "label": "Label", |
| 11 | "help": "What a human calls it -- 'server agent', 'scroll app agent', 'mac studio worker'. For the board, so an operator reading a feed of claims knows who is talking."}, |
| 12 | {"name": "purpose", "type": "textarea", "label": "Purpose", |
| 13 | "help": "What this agent is for, in a sentence. The field that answers 'why is this thing writing to my server', which no amount of change history will tell you."}, |
| 14 | {"name": "capabilities", "type": "text", "label": "Capabilities", |
| 15 | "validation": {"max_length": 400}, |
| 16 | "help": "Comma-separated tags this agent will accept work for -- gpu, ffmpeg, whisper, triposr, notary. Free text rather than an enum, matching templates.handler's convention, so a new capability is a new tag and never a schema migration on every install. OPT-IN AND EMPTY BY DEFAULT: a registration that advertises nothing accepts nothing, because nobody's laptop should join a compute pool by accident (plan/federated-workers-spec.md)."}, |
| 17 | {"name": "endpoint", "type": "text", "label": "Endpoint", |
| 18 | "help": "Where this agent can be reached, when it is itself an object server rather than a process polling us. Blank for an ordinary agent -- the overwhelming case. This is the seam plan/federated-workers-spec.md grows a peer relationship out of; recorded now so the shape is not designed away later."}, |
| 19 | {"name": "status", "type": "enum", "default": "active", "label": "Status", |
| 20 | "enum": ["active", "paused", "suspended", "retired"], |
| 21 | "help": "active: working. paused: an operator stopped it. suspended: a guardrail stopped it -- what a spend cap being hit should set. retired: gone, kept for the history its writes are attached to. Never deleted: an agent row is what makes months of change-log actors legible."}, |
| 22 | {"name": "heartbeat_at", "type": "datetime", "label": "Heartbeat", |
| 23 | "help": "THE field this collection exists for. An agent says 'still here' on its own schedule; liveness is this compared against now, and nothing else on the box can answer it. Deliberately NOT a rollup of the agent's last write, which would report a thinking agent as dead and a crashed one as alive right up until its last write aged out."}, |
| 24 | {"name": "spend_cap_minor", "type": "integer", "default": "0", |
| 25 | "label": "Spend Cap", |
| 26 | "help": "Most this agent may commit, in integer minor units (docs/logic-decisions.md #10), counted as the sum of its holds and debits. 0 means NO CAP, matching billing.wallet.overdraft_minor's convention of zero-as-default rather than zero-as-prohibition. Meaningful only since app-runner made an agent able to spend: a queued template run places a real hold against a real provider bill."}, |
| 27 | {"name": "registered_at", "type": "datetime", "label": "Registered"}, |
| 28 | {"name": "notes", "type": "textarea", "label": "Notes"}, |
| 29 | {"name": "owner_id", "type": "text", "label": "Owner"}, |
| 30 | {"name": "created_at", "type": "datetime", "read_only": true, "label": "Created"} |
| 31 | ], |
| 32 | "search": {"fields": ["agent_id", "label", "purpose", "capabilities"]}, |
| 33 | "forms": {"default": {"fields": ["agent_id", "label", "purpose", "capabilities", |
| 34 | "endpoint", "status", "spend_cap_minor", "notes"]}}, |
| 35 | "views": {"list_mode": "table", |
| 36 | "list_fields": ["label", "agent_id", "capabilities", "status", |
| 37 | "heartbeat_at"], |
| 38 | "filter_fields": ["status"]} |
| 39 | } |