feat(box): passkey fetch, agent key-approval flow, unified lookups, tmux agent UX

- box passkey [show|fetch] (+ muse passkey): documents VM-only passkey
  (/srv/box/passkey.txt, fallback /etc/netvm/passkey.txt on 34.139.37.135),
  probes VM over SSH with graceful fallback; --json supported. No secrets on bl.
- approvals: request_key_approval / check_node_key_request; KEY_APPROVAL status
  surfaced in `box approvals check`; allow/deny resolve + audit to box-ctl.jsonl;
  never auto-approved. New `box approvals request-key <node> --reason`.
- box lookup (summary|fleet|threads|unread|approvals|key|docs) and docs-lookup
  engine with lookup_internal/ database (docs_internal symlink).
- muse-tmux: non-TTY attach falls back to scrollback capture; prune NameError fix.
- box/muse passthrough for tmux/muse/docs; thread list/view alias + prefix resolve.
- Docs: AGENTS.md, AGENT-TOOLING.md, BOX-WEB-SURFACE-GUIDE.md, README.
- Tests: key-approval + passkey tests; sync stale sidechat UUIDs and manifest name.
- .gitignore runtime trackers (subagent-sessions, conversation-nudge-tracker).
This commit is contained in:
operator
2026-10-05 20:18:47 +00:00
parent 59c9965791
commit adfcd2e602
38 changed files with 5948 additions and 168 deletions
+47
View File
@@ -0,0 +1,47 @@
# CLI Tools Reference & Grammar
> **Box is the main surface.** All operator work goes through Box (`box.muse-dev.online`). The web UI, `box` CLI, and agents share the same API endpoints. No UI-only powers.
NetVM provides a unified command line toolchain anchored by `box` and `super` (`/usr/local/bin/box` and `/home/super/.local/bin/super`), both pointing to the off-board orchestrator script [`bin/super-cli.py`](file:///home/super/Projects/NetVM/bin/super-cli.py).
---
## 1. Quick Command Summary
```text
box <domain> <action> [options]
super <domain> <action> [options]
```
| Domain | Description | Common Invocation |
|---|---|---|
| `fleet` | Node status, CDP ports, watch | `box fleet status` |
| `approvals` | Browser approvals & input waits | `box approvals check -v` |
| `dm` | Work orders, Acks, log tail | `box dm send --agent 646 --to pip ...` |
| `thread` | Thread listings & message inspection | `box thread list` |
| `job` | Timers, scheduled triggers, logs | `box job run box-http-health` |
| `loop` | Loop health, open loops, nudges | `box loop status` |
| `vars` | Dynamic runtime variables | `box vars set max_nudge_count 3` |
| `tmux` | Headless background tmux workers | `box tmux new worker1 --command "bash"` |
| `deploy` | Spawn subagents & pipelines | `box deploy subagent --agent 646 ...` |
| `docs` | Internal docs, regexes, & surfaces | `box docs surfaces dashboard` |
---
## 2. Using `box docs` for Real-Time Lookup
Autonomous agents should query the `docs` domain whenever they need schema verification, regex passing, or surface selector lookups:
```bash
# Search across all internal databases
box docs search "work order"
# Inspect assistive surfaces on box.muse-dev.online
box docs surfaces jobs
# Look up sentence grammar specifications
box docs sentence result
# Test an utterance through the regex engine
box docs parse "[RESULT 7fce46e0] OK Finished task"
```
+34
View File
@@ -0,0 +1,34 @@
# Fleet Topology & Agent Identities
> **Box is the main surface.** All operator work goes through Box (`box.muse-dev.online`). The web UI, `box` CLI, and agents share the same API endpoints. No UI-only powers.
NetVM manages four primary autonomous browser agents and two development/staging nodes isolated inside Linux network namespaces (`warp-*`) on compute host `bl` (`100.123.153.75`).
---
## 1. Node Inventory
| Node | NetNS | CDP Port | Peer IP | Default Sidechat | Primary Role |
|---|---|---|---|---|---|
| `muse` | `warp-muse` | 9410 | 10.201.35.2 | `muse tasks` | General assistant, UI testing |
| `pip` | `warp-pip` | 9411 | 10.201.35.3 | `646-pip-coord` | Pipeline execution & driver |
| `646` | `warp-646` | 9412 | 10.201.35.4 | `646 tasks` | Operator-646, code & bridge |
| `opm` | `warp-opm` | 9413 | 10.201.35.5 | `heartbeat` | Operator-main supervisor |
| `dev` | `warp-dev` | 9414 | 10.201.35.6 | `dev tasks` | Development sandbox |
| `def` | `warp-def` | 9415 | 10.201.35.7 | `default` | Fallback routing node |
---
## 2. Headless Gateway & CLI Access
Each node has its own isolated Cloudflare WARP egress. To interact with a node:
```bash
# Gateway REPL
muse -a 646 chat
# Direct headless status
box muse 646 status
# Bounce node
box fleet restart 646
```
+77
View File
@@ -0,0 +1,77 @@
# Internal Agent & Operator Documentation (`docs_internal/`)
> **Box is the main surface.** All operator work goes through Box (`box.muse-dev.online`). The web UI, `box` CLI, and agents share the same API endpoints, protocol grammar, and lookup structures.
Welcome to `docs_internal/`. This directory serves as a dual Markdown (`.md`) and structured JSON (`.json`) lookup database for autonomous agents, background daemons, and off-board operators across NetVM.
---
## 1. Directory Structure
```text
docs_internal/
├── manifest.json # Master database manifest and collections schema
├── README.md # This file
├── sentence_structure.json # Agent sentence structures, protocols, and grammar
├── SENTENCE-STRUCTURE.md # Comprehensive guide to agent communication protocols
├── regex_patterns.json # Master regular expression database with test fixtures
├── REGEX-PATTERNS.md # Guide to regex parsing, capture groups, and testing
├── assistive_surfaces.json # UI tabs, DOM selectors, data-testids & REST endpoints for box.muse-dev.online
├── SURFACES.md # Guide to interacting with box.muse-dev.online
├── cli_tools.json # CLI command catalog and syntax database
├── CLI-TOOLS.md # Guide to super, box, and muse CLI tools
├── fleet_nodes.json # Fleet node topology, namespaces, and ports
└── FLEET-NODES.md # Guide to fleet agents and network topology
```
---
## 2. Using the CLI Lookup Engine
You can query this database directly from the shell using `super docs` or `box docs`:
### 2.1 Full-Text Search
```bash
box docs search "work order"
box docs search "cdp"
```
### 2.2 Inspect Assistive Surfaces for `box.muse-dev.online`
```bash
# List all surfaces and views
box docs surfaces
# Inspect a specific surface (e.g. jobs, dms, loops, dashboard)
box docs surfaces jobs
box docs surfaces dms
```
### 2.3 Inspect Agent Sentence Grammar & Protocols
```bash
# List all sentence structures
box docs sentence
# View full structure specification
box docs sentence work_order
box docs sentence result
```
### 2.4 Regex Passing & Testing
```bash
# List available regex patterns
box docs regex
# Test a string against a specific pattern
box docs regex work_order --test "[WO:7fce46e0] [from super] Audit — Check status"
# Parse an agent sentence through all patterns to extract captured tokens
box docs parse "[RESULT 7fce46e0] OK Verified 14 endpoints"
```
### 2.5 Machine-Readable JSON Output
Add `--json` to any command for structured JSON output:
```bash
box docs sentence work_order --json
box docs surfaces dashboard --json
box docs parse "[CLAIM 7fce46e0]" --json
```
+87
View File
@@ -0,0 +1,87 @@
# Master Regex Patterns & Passing Reference
> **Box is the main surface.** All operator work goes through Box (`box.muse-dev.online`). The web UI, `box` CLI, and agents share the same API endpoints and parsing patterns.
This document serves as the canonical reference for regular expressions used across NetVM's orchestrators, harvesters, loop state managers, and agent message parsers.
---
## 1. Quick Pattern Directory
| Pattern Key | Purpose | Match Example |
|---|---|---|
| `work_order` | Parses `[WO:<id>] [from <sender>] ...` | `[WO:7fce46e0] [from super] Audit — Check stats` |
| `ack` | Parses `[ACK:<id>] [from <sender>]` | `[ACK:7fce46e0] [from 646]` |
| `verb` | Matches `[ACK\|CLAIM\|RESULT\|DECLINE\|NO-ACTION <id>]` | `[CLAIM 7fce46e0]` |
| `result` | Parses `[RESULT <id>] <status> <summary>` | `[RESULT 7fce46e0] OK 14 endpoints healthy` |
| `tool_call` | Parses inline `[TOOL <op> <args>]` | `[TOOL followup.create {"in_m": 5}]` |
| `job_tag` | Matches `[JOB <id>]` | `[JOB ml-646-20261005]` |
| `nudge` | Parses followup SLA nudges | `[NUDGE 7fce46e0] [nudge 1/3] Deadline 19:45: ...` |
| `fleet_alert` | Parses alert broadcasts | `[fleet-alert] CRITICAL: VM unreachable x2` |
| `uuid` | RFC 4122 UUID v4 detector | `dc6d72ca-4b02-4217-bf41-7dbca19c5c24` |
| `short_hex` | 6-12 character hex IDs | `7fce46e0` |
| `subagent_update`| Subagent status notices | `[SUBAGENT-UPDATE] Subagent 'audit' (4a2b8e) ...` |
| `swarm_slot` | Swarm worker slot targets | `[JOB swarm-99a/1]` |
---
## 2. Core Patterns & Named Capture Groups
### 2.1 Work Order Pattern (`work_order`)
```python
r"^\[WO:(?P<wo_id>[a-f0-9-]+)\]\s+\[from\s+(?P<sender>[a-zA-Z0-9_-]+)\]\s+(?P<title>[^—\n]+?)\s*—\s*(?P<body>.+)$"
```
* **Flags**: `re.MULTILINE`, `re.DOTALL`
* **Groups**:
- `wo_id`: The unique tracking ID.
- `sender`: Originating identity (`super`, `646`, `pip`, etc.).
- `title`: Short task name preceding the em-dash (`—`).
- `body`: Instruction payload following the em-dash.
### 2.2 Standard Verbs (`verb`)
```python
r"\[(?P<verb>ACK|CLAIM|RESULT|DECLINE|NO-ACTION)\s+(?P<job_id>[A-Za-z0-9_/-]+)\]"
```
* **Groups**:
- `verb`: One of the 5 canonical lifecycle verbs.
- `job_id`: Target job, work order, or swarm slot.
### 2.3 Task Result (`result`)
```python
r"\[RESULT\s+(?P<job_id>[A-Za-z0-9_/-]+)\]\s*(?P<status>OK|FAIL|DECLINE|SUCCESS|ERROR)?\s*(?P<summary>.*?)(?=\[RESULT\s|\Z)"
```
* **Flags**: `re.DOTALL`
* **Groups**:
- `job_id`: Target task ID.
- `status`: Optional explicit status keyword.
- `summary`: Detailed response text.
### 2.4 In-Band Tool Directives (`tool_call`)
```python
r"\[(?P<engine>TOOL|EXEC)\s+(?P<op>[a-zA-Z0-9_.-]+)\s+(?P<args>\{.*?\})\]"
```
* **Groups**:
- `engine`: `TOOL` or `EXEC`.
- `op`: Method name (e.g. `followup.create`, `health.check`).
- `args`: Embedded JSON argument payload.
---
## 3. CLI Pattern Passing & Validation
The unified CLI allows testing strings directly against these patterns:
```bash
# Test a string against a specific pattern
super docs regex result --test "[RESULT 7fce46e0] OK Task complete"
box docs regex work_order --test "[WO:8a12bc44] [from super] Audit — verify 200"
# Parse an agent utterance through ALL registered patterns
super docs parse "[RESULT 7fce46e0] OK Verified 14 endpoints"
box docs parse "[TOOL followup.create {\"in_m\": 5, \"prompt\": \"check\"}]"
# View raw JSON pattern definition
super docs get regex_patterns work_order --json
```
When run with `--json`, the parser outputs structured dictionary mappings suitable for programmatic ingestion by subagents.
+153
View File
@@ -0,0 +1,153 @@
# Agent Sentence Structures & Conversational Grammar
> **Box is the main surface.** All operator work goes through Box (`box.muse-dev.online`). The web UI, `box` CLI, and agents share the same API endpoints and protocol grammar.
This master document defines the standardized sentence structures, bracketed markers, conversational contracts, and grammar rules governing autonomous agent communication across NetVM and Box.
---
## 1. Overview & Protocol Lifecycle
Agent communication relies on structured, machine-parsable prefixes embedded into natural language sentences. This allows human operators and autonomous language models to read the same stream while automation engines (`response-harvester.py`, `followup-sweeper.py`, `self_main_loop.py`) extract telemetry, update loop states, and trigger downstream events.
```mermaid
stateDiagram-v2
[*] --> Dispatched: [WO:id] Work Order
Dispatched --> Acknowledged: [ACK:id]
Dispatched --> Claimed: [CLAIM id]
Acknowledged --> Claimed: [CLAIM id]
Claimed --> Running: [TOOL op args] / execution
Running --> Resolved: [RESULT id] OK <summary>
Claimed --> Declined: [DECLINE id] <reason>
Claimed --> NoAction: [NO-ACTION id] <reason>
Running --> Nudged: [NUDGE id] (SLA warning)
Nudged --> Resolved: [RESULT id]
Resolved --> [*]
Declined --> [*]
NoAction --> [*]
```
---
## 2. Core Sentence Structures
### 2.1 Work Order (`[WO:<id>]`)
* **Purpose**: Tasking dispatched across operators or from the off-board orchestrator. Creates a tracked loop with an SLA deadline.
* **Format**:
```text
[WO:<dm_id>] [from <sender>] <title> — <body>
```
* **Required Components**:
- `dm_id`: Unique identifier (hex string, e.g. `7fce46e0`).
- `sender`: Author identity (`super`, `646`, `pip`, `opm`, `muse`).
- `title`: Short task description.
- `body`: Detailed instructions and acceptance criteria.
* **Example**:
```text
[WO:8a12bc44] [from super] Audit exec.muse-dev.online endpoints — Verify that allowlisted ops respond with 200 OK.
```
### 2.2 Acknowledgement (`[ACK:<id>]`)
* **Purpose**: Confirms delivery and receipt of a Work Order or message, preventing re-dispatch.
* **Format**:
```text
[ACK:<dm_id>] [from <sender>]
```
* **Example**:
```text
[ACK:8a12bc44] [from 646]
```
### 2.3 Task Claim (`[CLAIM <id>]`)
* **Purpose**: Declares exclusive ownership of a task or swarm worker slot.
* **Format**:
```text
[CLAIM <job_id>]
```
* **Example**:
```text
[CLAIM 8a12bc44]
```
### 2.4 Task Completion Result (`[RESULT <id>]`)
* **Purpose**: Delivers final evidence or outcome, closing the active loop and recording success/failure in `job-log.jsonl`.
* **Format**:
```text
[RESULT <job_id>] <status> <summary>
```
*(Status options: `OK`, `FAIL`, `SUCCESS`, `DECLINE`)*
* **Example**:
```text
[RESULT 8a12bc44] OK Verified 14 endpoints; all return valid 200 responses with expected schemas.
```
### 2.5 Task Decline & No-Action
* **Decline Format**:
```text
[DECLINE <job_id>] <reason>
```
* **No-Action Format**:
```text
[NO-ACTION <job_id>] <reason>
```
### 2.6 In-Band Tool Calls (`[TOOL <op> <args>]`)
* **Purpose**: Inline directive parsed by `response-harvester.py` and executed directly on the host or inside a node netns.
* **Format**:
```text
[TOOL <op> <args_json>]
```
* **Example**:
```text
[TOOL followup.create {"in_m": 5, "prompt": "Re-check Cloudflare WARP proxy status"}]
```
### 2.7 Loop Followup Nudge (`[NUDGE <id>]`)
* **Purpose**: Automated escalation sent to an agent when an SLA deadline is approaching or breached.
* **Format**:
```text
[NUDGE <loop_id>] [nudge <count>/<max_nudges>] Deadline <time_utc>: <prompt>
```
* **Example**:
```text
[NUDGE 8a12bc44] [nudge 1/3] Deadline 19:45 UTC: Please confirm status of exec audit.
```
### 2.8 Fleet Alert (`[fleet-alert]`)
* **Purpose**: Infrastructure health broadcasts dispatched to `#lobby` and `#jobs`.
* **Format**:
```text
[fleet-alert] <SEVERITY>: <message>
```
* **Example**:
```text
[fleet-alert] CRITICAL: VM unreachable x2 on port 22
```
---
## 3. Conversational Contract Footer
When issuing prompts to model instances, orchestrators append the **Contract Footer**:
```text
Reply: [ACK id] seen | [CLAIM id] mine | [RESULT id] done | [DECLINE id] | [NO-ACTION id].
```
This forces strict conformance to parsable reply tokens.
---
## 4. Querying from CLI
Agents and operators can look up these sentence structures using the unified CLI:
```bash
# View list of all structures
super docs sentence
box docs sentence
# View specific structure specification
super docs sentence work_order
super docs sentence result
# Validate or parse an utterance
super docs parse "[WO:7fce46e0] [from super] Run audit — check endpoints"
```
+106
View File
@@ -0,0 +1,106 @@
# Assistive Surfaces Reference — box.muse-dev.online
> **Box is the main surface.** All operator work goes through Box (`box.muse-dev.online`). The web UI, `box` CLI, and agents share the same API endpoints. No UI-only powers.
This guide provides autonomous agents and operators with detailed maps of the visual DOM, interactive controls, API backends, and assistive interaction recipes for `box.muse-dev.online`.
---
## 1. Global Layout & Authentication
* **Production URL**: `https://box.muse-dev.online/`
* **Google Cloud VM**: `34.139.37.135`
* **Authoritative Compute Host**: `bl` (`100.123.153.75`)
* **Operator PIN**: `3128` (establishes `ops_session` cookie via `POST /api/ops/login`)
* **Agent Authentication**: Header `Authorization: Bearer <operator-token>` or SSH-keygen signature.
### Layout Wireframe
```text
+----------------------------------------------------------------------------------+
| [BOX] Fleet Console box.muse-dev.online ● [pulse] [</> API] [◐ theme] |
+----------------------------------------------------------------------------------+
| [Fleet Pulse] [DMs & Work Orders (N)] [Timers & Jobs] [Loop & Strategy (N)]|
+----------------------------------------------------------------------------------+
| |
| <Active Pane Content: Cards / Tables / Modals / Curldrawer> |
| |
+----------------------------------------------------------------------------------+
```
---
## 2. Views & Navigation Map
### 2.1 Fleet Pulse (`#tab-dashboard`)
* **Tab Button**: `.tab-btn[data-tab="dashboard"]`
* **Key Selectors**:
- `#fleet-grid`: Grid container for node cards.
- `.node-card`: Card representing an agent (`muse`, `pip`, `646`, `opm`).
- `.node-badge`: Status badge (`UP`, `WARN`, `DOWN`).
- `#fleet-pulse`: Global heartbeat animation.
* **REST API**:
- `GET /api/box/fleet`
- Returns array of `{ node, netns, peer_ip, cdp_port, proc_alive, title, latency_ms }`.
### 2.2 DMs & Work Orders (`#tab-dms`)
* **Tab Button**: `.tab-btn[data-tab="dms"]`
* **Key Selectors**:
- `#dms-table`: Log stream table.
- `#dms-tbody`: Dynamic row container.
- `#filter-search`: Search text filter input.
- `.filter-agent-chip`: Filter by agent (`all`, `super`, `muse`, `pip`, `646`, `opm`).
- `.filter-kind-chip`: Filter by message kind (`all`, `workorder`, `ack`, `chat`).
* **REST API**:
- `GET /api/box/dm/log?limit=50`
- `POST /api/box/dm/send`
### 2.3 Timers & Scheduled Jobs (`#tab-jobs`)
* **Tab Button**: `.tab-btn[data-tab="jobs"]`
* **Key Selectors**:
- `#jobs-table`: Systemd user timer table.
- `.btn-trigger`: Direct hot-trigger button (`▶ Run`).
- `.badge-active`: Active/inactive state indicator.
* **REST API**:
- `GET /api/box/timers`
- `POST /api/box/jobs/{name}/trigger` (Returns `202 Accepted` immediately).
### 2.4 Loop & Strategy Matrix (`#tab-loops`)
* **Tab Button**: `.tab-btn[data-tab="loops"]`
* **Key Selectors**:
- `#loop-health-badge`: Real-time health verdict (e.g. `HEALTHY (89%)`).
- `#loops-grid`: Cards for active open loops and deadlines.
- `#strat-table`: Table of strategy escalation rules.
- `#vars-table`: Interactive table of runtime variables with inline edit buttons.
* **REST API**:
- `GET /api/box/loop/health`
- `GET /api/box/loop/status`
- `GET /api/box/loop/vars`
- `POST /api/box/loop/vars`
---
## 3. Assistive Interaction Recipes
### Recipe A: Querying Fleet Health via CLI
```bash
# High level overview
box fleet
# Directly query docs database for surface selectors
box docs surfaces dashboard
```
### Recipe B: Hot-Triggering a Job via API
```bash
# Asynchronously trigger job
curl -sk -X POST https://box.muse-dev.online/api/box/jobs/box-http-health/trigger
```
### Recipe C: Resolving a Blocked Modal Dialog
```bash
# Check if any agent is held on an approval dialog
box approvals check
# Inspect dialog details
box approvals inspect pip
# Approve request
box approvals allow pip
```
+173
View File
@@ -0,0 +1,173 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Assistive Surfaces for box.muse-dev.online",
"version": "1.0.0",
"host": "box.muse-dev.online",
"origin_vm": "34.139.37.135",
"compute_host": "bl (100.123.153.75)",
"auth": {
"pin": "3128",
"cookie_name": "ops_session",
"login_endpoint": "/api/ops/login",
"agent_header": "Authorization: Bearer <operator-token>",
"signature_mechanism": "SSH-keygen -Y sign via Tailnet identity"
},
"views": {
"dashboard": {
"name": "Fleet Pulse",
"tab_id": "dashboard",
"dom_tab_selector": ".tab-btn[data-tab=\"dashboard\"]",
"dom_pane_selector": "#tab-dashboard",
"key_elements": {
"grid": "#fleet-grid",
"pulse_indicator": "#fleet-pulse",
"node_card": ".node-card",
"node_badge": ".node-badge",
"active_page_title": ".page-title-preview"
},
"api_endpoints": [
{
"method": "GET",
"path": "/api/box/fleet",
"description": "Real-time CDP latency, node status, current page titles, and queue depths across all nodes.",
"curl_example": "curl -sk https://box.muse-dev.online/api/box/fleet"
}
],
"assistive_recipe": "To check fleet health, read /api/box/fleet or inspect #fleet-grid node cards. Green indicator denotes CDP responsive <100ms."
},
"dms": {
"name": "DMs & Work Orders",
"tab_id": "dms",
"dom_tab_selector": ".tab-btn[data-tab=\"dms\"]",
"dom_pane_selector": "#tab-dms",
"key_elements": {
"table": "#dms-table",
"tbody": "#dms-tbody",
"search_input": "#filter-search",
"agent_filter_chips": ".filter-agent-chip",
"kind_filter_chips": ".filter-kind-chip",
"count_badge": "#dms-count-badge"
},
"api_endpoints": [
{
"method": "GET",
"path": "/api/box/dm/log?limit=50",
"description": "Chronological stream of Work Orders, Acks, Results, and inter-operator DMs.",
"curl_example": "curl -sk -b 'ops_session=...' https://box.muse-dev.online/api/box/dm/log?limit=30"
},
{
"method": "POST",
"path": "/api/box/dm/send",
"description": "Dispatch a signed DM or Work Order to a recipient or sidechat target.",
"curl_example": "curl -sk -X POST https://box.muse-dev.online/api/box/dm/send -d '{\"agent\":\"646\",\"to\":\"pip\",\"target\":\"646-pip\",\"message\":\"[WO:...] ...\"}'"
}
],
"assistive_recipe": "Filter by data-agent attribute to isolate node traffic. Search box filters dynamically by text."
},
"jobs": {
"name": "Timers & Jobs",
"tab_id": "jobs",
"dom_tab_selector": ".tab-btn[data-tab=\"jobs\"]",
"dom_pane_selector": "#tab-jobs",
"key_elements": {
"table": "#jobs-table",
"tbody": "#jobs-tbody",
"trigger_button": ".btn-trigger",
"active_badge": ".badge-active",
"unit_name": ".timer-unit-name"
},
"api_endpoints": [
{
"method": "GET",
"path": "/api/box/timers",
"description": "List all active systemd user timer schedules, next run, and last results.",
"curl_example": "curl -sk https://box.muse-dev.online/api/box/timers"
},
{
"method": "POST",
"path": "/api/box/jobs/{name}/trigger",
"description": "Asynchronous hot-trigger calling box-ctl.py job-trigger. Returns 202 Accepted immediately.",
"curl_example": "curl -sk -X POST https://box.muse-dev.online/api/box/jobs/box-http-health/trigger"
}
],
"assistive_recipe": "Clicking ▶ Run invokes hot-trigger without blocking the browser. Button displays Triggering... then Sent."
},
"loops": {
"name": "Loop & Strategy Matrix",
"tab_id": "loops",
"dom_tab_selector": ".tab-btn[data-tab=\"loops\"]",
"dom_pane_selector": "#tab-loops",
"key_elements": {
"health_badge": "#loop-health-badge",
"loops_grid": "#loops-grid",
"strategy_table": "#strat-table",
"vars_table": "#vars-table",
"edit_modal": "#modal-edit-var",
"count_badge": "#loops-count-badge"
},
"api_endpoints": [
{
"method": "GET",
"path": "/api/box/loop/health",
"description": "Fleet loop health ratio (answered+closed vs landed) with health verdicts.",
"curl_example": "curl -sk https://box.muse-dev.online/api/box/loop/health"
},
{
"method": "GET",
"path": "/api/box/loop/status",
"description": "Active open loops, deadlines, and current nudge counters.",
"curl_example": "curl -sk https://box.muse-dev.online/api/box/loop/status"
},
{
"method": "GET",
"path": "/api/box/loop/vars",
"description": "Runtime control variables schema, values, and units.",
"curl_example": "curl -sk https://box.muse-dev.online/api/box/loop/vars"
},
{
"method": "POST",
"path": "/api/box/loop/vars",
"description": "Mutate runtime variable without restarting daemons.",
"curl_example": "curl -sk -X POST https://box.muse-dev.online/api/box/loop/vars -d '{\"name\":\"max_nudge_count\",\"value\":3}'"
}
],
"assistive_recipe": "Use loop health ratio to evaluate fleet velocity. Overdue loops can be nudged directly via box loop nudge."
},
"approvals": {
"name": "Agent Approval Surfaces",
"tab_id": "approvals",
"dom_tab_selector": null,
"dom_pane_selector": ".approval-dialog-container",
"key_elements": {
"dialog": "[data-testid=\"approval-dialog\"]",
"allow_btn": "[data-testid=\"approval-allow\"]",
"deny_btn": "[data-testid=\"approval-deny\"]",
"ip_field": ".approval-requested-ip",
"action_desc": ".approval-description"
},
"api_endpoints": [
{
"method": "GET",
"path": "/api/approvals",
"description": "Query pending approvals across all browser nodes.",
"curl_example": "curl -sk https://box.muse-dev.online/api/approvals"
}
],
"assistive_recipe": "If browser agent is blocked on modal, inspect via 'box approvals check' and approve with 'box approvals allow <node>'."
},
"telemetry_curl": {
"name": "View as curl Drawer",
"tab_id": null,
"dom_tab_selector": "#curl-toggle-btn",
"dom_pane_selector": "#curl-drawer",
"key_elements": {
"toggle_btn": "#curl-toggle-btn",
"drawer": "#curl-drawer",
"display_code": "#curl-display",
"copy_btn": "#curl-copy-btn"
},
"api_endpoints": [],
"assistive_recipe": "Toggles an off-canvas drawer exposing exact curl invocation for the currently active tab and action."
}
}
}
+117
View File
@@ -0,0 +1,117 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "CLI Tools Reference & Grammar",
"version": "1.0.0",
"binaries": {
"super": {
"path": "/home/super/.local/bin/super",
"target": "/home/super/Projects/NetVM/bin/super-cli.py",
"description": "Unified off-board orchestrator CLI for NetVM & Box."
},
"box": {
"path": "/home/super/.local/bin/box",
"target": "/home/super/Projects/NetVM/bin/super-cli.py",
"description": "Agent-facing unified CLI (symlink to super-cli.py)."
},
"muse": {
"path": "/home/super/.local/bin/muse",
"target": "/home/super/Projects/NetVM/bin/muse",
"description": "Direct headless gateway wrapper with isolated per-node WARP netns."
}
},
"domains": {
"fleet": {
"summary": "Node health, CDP status, active tabs, watch, restart",
"subcommands": [
{"cmd": "box fleet status", "desc": "Tabular health status of all 4 browser nodes (CDP latency, tabs, proc)"},
{"cmd": "box fleet watch", "desc": "Live refresh terminal dashboard of fleet nodes"},
{"cmd": "box fleet restart <node>", "desc": "Safely bounce a specific browser netns node"},
{"cmd": "box fleet cdp <node>", "desc": "Inspect open DevTools targets and webSocket URLs"}
]
},
"approvals": {
"summary": "Inspect and handle agent browser & gateway approvals",
"subcommands": [
{"cmd": "box approvals check [-v]", "desc": "Check if any browser agent is waiting on approval dialogs"},
{"cmd": "box approvals inspect <node>", "desc": "Inspect pending approval modal prompt and details"},
{"cmd": "box approvals allow <node>", "desc": "Approve pending request on target node"},
{"cmd": "box approvals deny <node>", "desc": "Reject pending request on target node"}
]
},
"dm": {
"summary": "Inter-agent DMs, work orders ([WO]), acks, live log tail",
"subcommands": [
{"cmd": "box dm send --agent <self> --to <peer> --target <sidechat> \"<msg>\"", "desc": "Send signed DM"},
{"cmd": "box dm wo --agent <self> --to <peer> --target <chat> --title \"<title>\" \"<body>\"", "desc": "Dispatch structured [WO:id]"},
{"cmd": "box dm ack <id> --agent <self>", "desc": "Acknowledge received work order"},
{"cmd": "box dm log [--limit N]", "desc": "Read stream of signed work orders and DMs"},
{"cmd": "box dm tail", "desc": "Live stream incoming DMs"}
]
},
"thread": {
"summary": "Inspect agent main chats, sidechats, and scrollbacks",
"subcommands": [
{"cmd": "box thread list [agent]", "desc": "List active sidechats and message threads"},
{"cmd": "box thread view <agent> <thread_id> [--limit N]", "desc": "Read messages in a specific thread"}
]
},
"job": {
"summary": "Manage scheduled jobs, systemd timers, triggers, logs",
"subcommands": [
{"cmd": "box job list", "desc": "List registered jobs and systemd user timers"},
{"cmd": "box job run <name>", "desc": "Hot-trigger immediate execution of a job"},
{"cmd": "box job status <name>", "desc": "Inspect job execution status and logs"}
]
},
"web": {
"summary": "Probe VM web surfaces (box.muse-dev.online), auth, sync",
"subcommands": [
{"cmd": "box web health", "desc": "Check Google Cloud VM web surface HTTP status"},
{"cmd": "box web test-auth", "desc": "Verify operator auth gating and session token"}
]
},
"loop": {
"summary": "Intrinsic loop strategy, health, break taxonomy, and variables",
"subcommands": [
{"cmd": "box loop status", "desc": "List active open loops, deadlines, and nudge counts"},
{"cmd": "box loop health", "desc": "Show fleet loop health ratio and closure rate"},
{"cmd": "box loop nudge <id>", "desc": "Manually trigger a followup nudge on an open loop"},
{"cmd": "box loop close <id>", "desc": "Close a loop with verdict"}
]
},
"vars": {
"summary": "Inspect and adjust runtime control variables",
"subcommands": [
{"cmd": "box vars list", "desc": "List all dynamic runtime control variables"},
{"cmd": "box vars get <name>", "desc": "Get current value of a variable"},
{"cmd": "box vars set <name> <value>", "desc": "Update runtime variable value"},
{"cmd": "box vars reset <name>", "desc": "Reset variable to canonical default"}
]
},
"tmux": {
"summary": "Manage headless background tmux sessions on /tmp/tmux-muse.sock",
"subcommands": [
{"cmd": "box tmux list", "desc": "List active background agent sessions"},
{"cmd": "box tmux new <session> --command \"<cmd>\"", "desc": "Spawn new logged session"},
{"cmd": "box tmux send <session> \"<keys>\"", "desc": "Send keystrokes to session"},
{"cmd": "box tmux capture <session> [--lines N]", "desc": "Capture session output"}
]
},
"deploy": {
"summary": "Spawn sub-agent session and dispatch task",
"subcommands": [
{"cmd": "box deploy subagent --agent <self> --title \"<title>\" \"<prompt>\"", "desc": "Spawn autonomous subagent"}
]
},
"docs": {
"summary": "Internal documentation, surfaces, sentence grammar, and regex lookup",
"subcommands": [
{"cmd": "box docs search <query>", "desc": "Search internal docs database"},
{"cmd": "box docs surfaces [name]", "desc": "Lookup assistive surfaces for box.muse-dev.online"},
{"cmd": "box docs sentence [name]", "desc": "Lookup agent sentence structures and protocols"},
{"cmd": "box docs regex [name] [--test \"str\"]", "desc": "Lookup or test regex patterns"},
{"cmd": "box docs parse \"<utterance>\"", "desc": "Parse agent utterance through regex engine"}
]
}
}
}
+61
View File
@@ -0,0 +1,61 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Fleet Topology & Agent Identities",
"version": "1.0.0",
"nodes": {
"muse": {
"identity": "muse",
"netns": "warp-muse",
"egress_ip": "Dedicated Stable Colo IP (WARP)",
"cdp_port": 9410,
"peer_ip": "10.201.35.2",
"default_sidechat": "muse tasks",
"role": "General agent, primary chat evaluation"
},
"pip": {
"identity": "pip",
"netns": "warp-pip",
"egress_ip": "Dedicated Stable Colo IP (WARP)",
"cdp_port": 9411,
"peer_ip": "10.201.35.3",
"default_sidechat": "646-pip-coord",
"role": "Pipeline driver, account management"
},
"646": {
"identity": "646",
"netns": "warp-646",
"egress_ip": "Dedicated Stable Colo IP (WARP)",
"cdp_port": 9412,
"peer_ip": "10.201.35.4",
"default_sidechat": "646 tasks",
"role": "Operator-646, code execution, bridge management"
},
"opm": {
"identity": "opm",
"netns": "warp-opm",
"egress_ip": "Dedicated Stable Colo IP (WARP)",
"cdp_port": 9413,
"peer_ip": "10.201.35.5",
"default_sidechat": "heartbeat",
"role": "Operator-main, supervisor, telemetry check"
},
"dev": {
"identity": "dev",
"netns": "warp-dev",
"egress_ip": "Staging WARP egress",
"cdp_port": 9414,
"peer_ip": "10.201.35.6",
"default_sidechat": "dev tasks",
"role": "Development and experimental features"
},
"def": {
"identity": "def",
"netns": "warp-def",
"egress_ip": "Default fallback egress",
"cdp_port": 9415,
"peer_ip": "10.201.35.7",
"default_sidechat": "default",
"role": "Fallback routing node"
}
}
}
+52
View File
@@ -0,0 +1,52 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"name": "docs_internal",
"alias": "lookup_internal",
"version": "1.1.0",
"description": "Internal Agent & Operator Lookup Database for NetVM, Box, and box.muse-dev.online",
"created_at": "2026-10-05T19:16:00Z",
"host": "box.muse-dev.online",
"primary_node": "bl (100.123.153.75)",
"collections": [
{
"id": "sentence_structure",
"name": "Agent Sentence Structures & Protocols",
"json_file": "sentence_structure.json",
"md_file": "SENTENCE-STRUCTURE.md",
"description": "Formal grammar, prefixes, intents, work orders, acks, results, and conversational contracts used by autonomous fleet agents.",
"keys_count": 14
},
{
"id": "regex_patterns",
"name": "Regex Patterns & Passing Engine",
"json_file": "regex_patterns.json",
"md_file": "REGEX-PATTERNS.md",
"description": "Comprehensive regex patterns with capture groups, test fixtures, and passing mechanisms for message harvesting and parsing.",
"keys_count": 16
},
{
"id": "assistive_surfaces",
"name": "Assistive Surfaces for box.muse-dev.online",
"json_file": "assistive_surfaces.json",
"md_file": "SURFACES.md",
"description": "Catalog of UI views, DOM selectors, data-testids, modals, REST endpoints, and automation recipes for box.muse-dev.online.",
"keys_count": 6
},
{
"id": "cli_tools",
"name": "CLI Tools Reference & Grammar",
"json_file": "cli_tools.json",
"md_file": "CLI-TOOLS.md",
"description": "Command syntax, options, and dispatch paths for super, box, muse, and orchestrator utilities.",
"keys_count": 12
},
{
"id": "fleet_nodes",
"name": "Fleet Topology & Agent Identities",
"json_file": "fleet_nodes.json",
"md_file": "FLEET-NODES.md",
"description": "Active fleet agents, network namespaces, WireGuard warp addresses, CDP debugging ports, and task assignments.",
"keys_count": 6
}
]
}
+346
View File
@@ -0,0 +1,346 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Regex Patterns & Passing Engine",
"version": "1.0.0",
"patterns": {
"work_order": {
"name": "Work Order Parser",
"pattern": "^\\[WO:(?P<wo_id>[a-f0-9-]+)\\]\\s+\\[from\\s+(?P<sender>[a-zA-Z0-9_-]+)\\]\\s+(?P<title>[^—\\n]+?)\\s*—\\s*(?P<body>.+)$",
"flags": ["MULTILINE", "DOTALL"],
"description": "Matches canonical Work Order messages, extracting unique ID, sender, title, and body.",
"named_groups": {
"wo_id": "Unique work order identifier (hex or UUID)",
"sender": "Originating agent or operator identity",
"title": "Short title describing the task",
"body": "Full body text and instructions"
},
"test_samples": {
"valid": [
"[WO:7fce46e0] [from super] Audit exec.muse-dev.online endpoints — Run full verification and check 200 codes.",
"[WO:a1b2c3d4-e5f6-7890-abcd-ef1234567890] [from 646] Deploy patch — Apply fix to response-harvester."
],
"invalid": [
"Just sending a regular message without tag",
"[WO:] missing id [from super] title — body",
"[WO:123] missing from tag title — body"
]
},
"usage": "Used by dm.py, super dm, and self_main_loop.py for tracking work orders."
},
"ack": {
"name": "Acknowledgement Parser",
"pattern": "^\\[ACK:(?P<ack_id>[a-f0-9-]+)\\](?:\\s+\\[from\\s+(?P<sender>[a-zA-Z0-9_-]+)\\])?",
"flags": ["MULTILINE"],
"description": "Matches work order acknowledgement tags, capturing referenced ID and optional sender.",
"named_groups": {
"ack_id": "Referenced work order ID being acknowledged",
"sender": "Optional sender acknowledging the message"
},
"test_samples": {
"valid": [
"[ACK:7fce46e0] [from 646]",
"[ACK:a1b2c3d4]"
],
"invalid": [
"ACK: 7fce46e0",
"[ACK:]",
"Acknowledged without brackets"
]
},
"usage": "Used by response-harvester.py and followup-sweeper.py to transition loops to acknowledged."
},
"verb": {
"name": "Standard Agent Verb Marker",
"pattern": "\\[(?P<verb>ACK|CLAIM|RESULT|DECLINE|NO-ACTION)\\s+(?P<job_id>[A-Za-z0-9_/-]+)\\]",
"flags": [],
"description": "Matches all standard conversational contract verbs referencing a job ID.",
"named_groups": {
"verb": "One of ACK, CLAIM, RESULT, DECLINE, NO-ACTION",
"job_id": "Target task or job identifier"
},
"test_samples": {
"valid": [
"[ACK 7fce46e0]",
"[CLAIM job-123]",
"[RESULT swarm-4a/2]",
"[DECLINE audit-01]",
"[NO-ACTION check-99]"
],
"invalid": [
"[DONE 7fce46e0]",
"[RESULT]",
"RESULT 7fce46e0 without brackets"
]
},
"usage": "Primary regex used in response-harvester.py (VERB_RE) for loop state resolution."
},
"result": {
"name": "Task Result & Outcome Parser",
"pattern": "\\[RESULT\\s+(?P<job_id>[A-Za-z0-9_/-]+)\\]\\s*(?P<status>OK|FAIL|DECLINE|SUCCESS|ERROR)?\\s*(?P<summary>.*?)(?=\\[RESULT\\s|\\Z)",
"flags": ["DOTALL"],
"description": "Extracts job ID, optional status flag, and trailing summary for task outcomes.",
"named_groups": {
"job_id": "Target job or swarm slot ID",
"status": "Optional explicit status token (OK, FAIL, etc.)",
"summary": "Outcome description and evidence payload"
},
"test_samples": {
"valid": [
"[RESULT 7fce46e0] OK Verified 14 endpoints successfully.",
"[RESULT test-job] FAIL Connection timed out on port 22",
"[RESULT swarm-1/0] Completed slot tasks."
],
"invalid": [
"Result of job 123 is OK",
"[RESULT] missing job id"
]
},
"usage": "Used in response-harvester.py (RESULT_RE) to harvest results into job-log.jsonl."
},
"tool_call": {
"name": "In-Band Tool Execution Call",
"pattern": "\\[(?P<engine>TOOL|EXEC)\\s+(?P<op>[a-zA-Z0-9_.-]+)\\s+(?P<args>\\{.*?\\})\\]",
"flags": ["DOTALL"],
"description": "Matches synthesized inline tool execution directives with JSON arguments.",
"named_groups": {
"engine": "Either TOOL or EXEC",
"op": "Target operation name (e.g. followup.create, swarm.spawn)",
"args": "Valid JSON string of argument parameters"
},
"test_samples": {
"valid": [
"[TOOL followup.create {\"in_m\": 5, \"prompt\": \"check\"}]",
"[EXEC health.check {\"verbose\": true}]"
],
"invalid": [
"[TOOL followup.create without args]",
"[TOOL invalid args not json]"
]
},
"usage": "Parsed by response-harvester.py and exec-constrained.py for automated in-line actions."
},
"job_tag": {
"name": "Job Tracking Tag",
"pattern": "\\[JOB\\s+(?P<job_id>[A-Za-z0-9_/-]+)\\]",
"flags": [],
"description": "Matches job tag markers embedded in digests, tasks, or swarm slots.",
"named_groups": {
"job_id": "Unique job identifier"
},
"test_samples": {
"valid": [
"[JOB ml-646-20261005-191500]",
"[JOB swarm-4b/1]"
],
"invalid": [
"JOB ml-646 without brackets",
"[JOB]"
]
},
"usage": "Used by self_main_loop.py and job-dispatch.py for tracking."
},
"nudge": {
"name": "Loop Followup Nudge Parser",
"pattern": "\\[NUDGE\\s+(?P<loop_id>[a-f0-9-]+)\\]\\s*(?:\\[nudge\\s+(?P<count>\\d+)/(?P<max_count>\\d+)\\])?\\s*(?:Deadline\\s+(?P<deadline>[^:]+):)?\\s*(?P<prompt>.*)",
"flags": ["MULTILINE"],
"description": "Matches automated followup nudges, extracting loop ID, nudge counters, and deadlines.",
"named_groups": {
"loop_id": "Target loop identifier",
"count": "Current nudge sequence number",
"max_count": "Maximum allowed nudges before escalation",
"deadline": "Deadline timestamp string",
"prompt": "Nudge message instructions"
},
"test_samples": {
"valid": [
"[NUDGE 7fce46e0] [nudge 1/3] Deadline 19:45 UTC: Please confirm status of exec audit.",
"[NUDGE a1b2c3d4] Please review pending pull request."
],
"invalid": [
"Nudge for 7fce46e0",
"[NUDGE]"
]
},
"usage": "Used by followup-sweeper.py for SLA enforcement."
},
"fleet_alert": {
"name": "Fleet Alert Broadcast Parser",
"pattern": "\\[fleet-alert\\]\\s+(?P<severity>CRITICAL|WARN|INFO|RECOVERED):\\s+(?P<message>.+)",
"flags": ["MULTILINE"],
"description": "Matches infrastructure alert broadcasts dispatched into #lobby and #jobs.",
"named_groups": {
"severity": "CRITICAL, WARN, INFO, or RECOVERED",
"message": "Alert message body"
},
"test_samples": {
"valid": [
"[fleet-alert] CRITICAL: VM unreachable x2 on port 22",
"[fleet-alert] RECOVERED: VM 34.139.37.135 responded with 200 OK"
],
"invalid": [
"[alert] CRITICAL: Missing fleet prefix",
"fleet-alert: info"
]
},
"usage": "Used by fleet-alert-check.sh and main-chat-watchdog.py."
},
"directive": {
"name": "Agent Action Directive",
"pattern": "\\[Directive:\\s*(?P<directive>.+?)\\]",
"flags": ["DOTALL"],
"description": "Extracts operational action directives targeting autonomous agents.",
"named_groups": {
"directive": "Actionable directive instruction"
},
"test_samples": {
"valid": [
"[Directive: Take next action or close with [RESULT 7fce46e0] <summary>]",
"[Directive: Run audit on node pip]"
],
"invalid": [
"Directive: without brackets",
"[Directive:]"
]
},
"usage": "Injected into prompts by response-harvester.py and job-dispatch.py."
},
"runtime_context": {
"name": "Runtime Context URL",
"pattern": "\\[Runtime Context:\\s*(?P<url>https?://[^\\s\\]]+)\\]",
"flags": [],
"description": "Extracts assistive web surface or thread URLs from message context.",
"named_groups": {
"url": "HTTP/HTTPS URL"
},
"test_samples": {
"valid": [
"[Runtime Context: https://box.muse-dev.online/thread/7fce46e0]",
"[Runtime Context: https://box.muse-dev.online/api/box/fleet]"
],
"invalid": [
"Runtime Context: not wrapped",
"[Runtime Context: invalid-url]"
]
},
"usage": "Used by assistive surfaces and browser agent navigation routines."
},
"uuid": {
"name": "Canonical UUID Pattern",
"pattern": "\\b(?P<uuid>[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\\b",
"flags": [],
"description": "Standard RFC 4122 UUID v4 detector for threads, messages, and session IDs.",
"named_groups": {
"uuid": "Matched UUID string"
},
"test_samples": {
"valid": [
"dc6d72ca-4b02-4217-bf41-7dbca19c5c24",
"d410b9ad-f667-465f-a103-43fabc0f69fe"
],
"invalid": [
"dc6d72ca-4b02-4217-bf41",
"not-a-uuid"
]
},
"usage": "Thread ID resolution in muse-chat-api.py and super-cli.py."
},
"short_hex": {
"name": "Short Hex Identifier",
"pattern": "\\b(?P<hex>[0-9a-fA-F]{6,12})\\b",
"flags": [],
"description": "Matches 6-12 character hexadecimal hashes used for compact DM IDs and subagent hashes.",
"named_groups": {
"hex": "Hexadecimal string"
},
"test_samples": {
"valid": [
"7fce46e0",
"04af8e15",
"ca56e39199da"
],
"invalid": [
"123",
"abcdefghijk"
]
},
"usage": "Compact ID matching across logs and DM tables."
},
"subagent_update": {
"name": "Subagent Update Notification",
"pattern": "\\[SUBAGENT-UPDATE\\]\\s+Subagent\\s+'(?P<title>[^']+)'\\s+\\((?P<short_id>[0-9a-fA-F]+)\\)\\s+(?P<message>.+)",
"flags": ["MULTILINE"],
"description": "Parses status updates and milestones from background subagent executions.",
"named_groups": {
"title": "Subagent session title",
"short_id": "Hex identifier of the subagent session",
"message": "Progress update message"
},
"test_samples": {
"valid": [
"[SUBAGENT-UPDATE] Subagent 'exec-audit' (4a2b8e) has posted new output.",
"[SUBAGENT-UPDATE] Subagent 'health-check' (12ff4a) completed successfully."
],
"invalid": [
"Subagent update without brackets"
]
},
"usage": "Used by self_main_loop.py subagent monitor."
},
"swarm_slot": {
"name": "Swarm Slot Task Marker",
"pattern": "\\[JOB\\s+(?P<swarm_id>[a-zA-Z0-9_-]+)/(?P<slot>\\d+)\\]",
"flags": [],
"description": "Matches swarm worker slot task assignments.",
"named_groups": {
"swarm_id": "ID of parent swarm execution",
"slot": "Index of worker slot (e.g. 0, 1, 2)"
},
"test_samples": {
"valid": [
"[JOB swarm-99a/0]",
"[JOB swarm-4a2b/3]"
],
"invalid": [
"[JOB swarm-99a]"
]
},
"usage": "Used in response-harvester.py and swarm_worker."
},
"contract_footer": {
"name": "Contract Footer Verifier",
"pattern": "Reply:\\s*\\[ACK\\s+id\\]\\s*seen\\s*\\|\\s*\\[CLAIM\\s+id\\]\\s*mine\\s*\\|\\s*\\[RESULT\\s+id\\]\\s*done\\s*\\|\\s*\\[DECLINE\\s+id\\]\\s*\\|\\s*\\[NO-ACTION\\s+id\\]\\.?",
"flags": ["IGNORECASE"],
"description": "Validates the presence of the standard agent contract footer in prompt envelopes.",
"named_groups": {},
"test_samples": {
"valid": [
"Reply: [ACK id] seen | [CLAIM id] mine | [RESULT id] done | [DECLINE id] | [NO-ACTION id]."
],
"invalid": [
"Please reply when ready"
]
},
"usage": "Enforced in self_main_loop.py CONTRACT_FOOTER."
},
"sender_tag": {
"name": "Sender Identity Tag",
"pattern": "\\[from[:\\s]+(?P<sender>[a-zA-Z0-9_-]+)\\]",
"flags": ["IGNORECASE"],
"description": "Matches agent or operator attribution tags in chat messages.",
"named_groups": {
"sender": "Identity of sender"
},
"test_samples": {
"valid": [
"[from:super]",
"[from 646]",
"[from pip]"
],
"invalid": [
"from super without brackets"
]
},
"usage": "Used in chat-history parsing and loop attribution."
}
}
}
+176
View File
@@ -0,0 +1,176 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Agent Sentence Structures & Protocols",
"version": "1.0.0",
"surface": "box.muse-dev.online",
"structures": {
"work_order": {
"name": "Work Order",
"protocol_tag": "[WO:<id>]",
"template": "[WO:{dm_id}] [from {sender}] {title} — {body}",
"description": "Structured task dispatched between operators or from orchestrator to agent. Initiates a trackable loop.",
"required_fields": ["dm_id", "sender", "title", "body"],
"optional_fields": ["priority", "due"],
"regex_ref": "work_order",
"reply_expectation": "Recipient must reply with [ACK id], [CLAIM id], [RESULT id], [DECLINE id], or [NO-ACTION id].",
"example": "[WO:7fce46e0] [from super] Audit exec.muse-dev.online endpoints — Please run full check on GET /api/stats and post results.",
"lifecycle_transition": "open -> acknowledged -> running -> closed"
},
"ack": {
"name": "Acknowledgement",
"protocol_tag": "[ACK:<id>]",
"template": "[ACK:{dm_id}] [from {sender}]",
"description": "Signals receipt and understanding of a Work Order or message, updating status to acknowledged.",
"required_fields": ["dm_id"],
"optional_fields": ["sender"],
"regex_ref": "ack",
"reply_expectation": "Loop remains open awaiting final [RESULT id].",
"example": "[ACK:7fce46e0] [from 646]",
"lifecycle_transition": "open -> acknowledged"
},
"claim": {
"name": "Task Claim",
"protocol_tag": "[CLAIM <id>]",
"template": "[CLAIM {job_id}]",
"description": "Claims exclusive ownership of an unassigned job or swarm task slot, preventing duplicate worker runs.",
"required_fields": ["job_id"],
"optional_fields": [],
"regex_ref": "verb",
"reply_expectation": "Worker must execute task and post [RESULT id] when complete.",
"example": "[CLAIM 7fce46e0]",
"lifecycle_transition": "acknowledged -> claimed"
},
"result": {
"name": "Task Completion Result",
"protocol_tag": "[RESULT <id>]",
"template": "[RESULT {job_id}] {status} {summary}",
"description": "Delivers the final output, verdict, or evidence of a completed task and closes the tracked loop.",
"required_fields": ["job_id", "summary"],
"optional_fields": ["status"],
"regex_ref": "result",
"reply_expectation": "Closes the loop; no further reply required unless sender issues new work order.",
"example": "[RESULT 7fce46e0] OK Audit complete: 14 allowlisted ops confirmed healthy, 0 errors.",
"lifecycle_transition": "running/claimed -> resolved (closed)"
},
"decline": {
"name": "Task Decline / Refusal",
"protocol_tag": "[DECLINE <id>]",
"template": "[DECLINE {job_id}] {reason}",
"description": "Explicitly declines or rejects a work order with justification (e.g. rate limit, outside domain).",
"required_fields": ["job_id", "reason"],
"optional_fields": [],
"regex_ref": "verb",
"reply_expectation": "Closes loop as declined; triggers orchestrator fallback or re-dispatch.",
"example": "[DECLINE 7fce46e0] Target node warp-dev is currently down for maintenance.",
"lifecycle_transition": "open/claimed -> declined (closed)"
},
"no_action": {
"name": "No Action Warranted",
"protocol_tag": "[NO-ACTION <id>]",
"template": "[NO-ACTION {job_id}] {reason}",
"description": "Acknowledges check but concludes no mutation or action was required (e.g. alert was transient flap).",
"required_fields": ["job_id", "reason"],
"optional_fields": [],
"regex_ref": "verb",
"reply_expectation": "Closes loop as resolved without side-effects.",
"example": "[NO-ACTION 7fce46e0] Transponder probe recovered before grace period expired.",
"lifecycle_transition": "open/claimed -> no-action (closed)"
},
"tool_call": {
"name": "In-Band Tool Execution Call",
"protocol_tag": "[TOOL <op> <args>]",
"template": "[TOOL {op} {args_json}]",
"description": "Synthesized inline tool execution directive parsed by response-harvester and executed on host.",
"required_fields": ["op", "args_json"],
"optional_fields": [],
"regex_ref": "tool_call",
"reply_expectation": "System executes op and posts execution result back into thread.",
"example": "[TOOL followup.create {\"in_m\": 5, \"prompt\": \"Recheck VM reachability\"}]",
"lifecycle_transition": "in-flight execution"
},
"job_marker": {
"name": "Job Tracking Marker",
"protocol_tag": "[JOB <id>]",
"template": "[JOB {job_id}]",
"description": "Identifies an automated task or swarm slot dispatched by scheduler or supervisor.",
"required_fields": ["job_id"],
"optional_fields": ["slot"],
"regex_ref": "job_tag",
"reply_expectation": "Worker replies with [RESULT job_id] upon conclusion.",
"example": "[JOB swarm-4a2b/1] Task for swarm slot 1: Run identity variance audit.",
"lifecycle_transition": "dispatched -> tracked"
},
"nudge": {
"name": "Loop Followup Nudge",
"protocol_tag": "[NUDGE <id>]",
"template": "[NUDGE {loop_id}] [nudge {count}/{max_nudges}] Deadline {deadline_utc}: {prompt}",
"description": "Automated prompt sent to recipient when a work order approaches or exceeds its SLA without an ack/result.",
"required_fields": ["loop_id", "count", "max_nudges", "deadline_utc"],
"optional_fields": ["prompt"],
"regex_ref": "nudge",
"reply_expectation": "Recipient must immediately reply with [ACK id] or [RESULT id].",
"example": "[NUDGE 7fce46e0] [nudge 1/3] Deadline 19:45 UTC: Please confirm status of exec audit.",
"lifecycle_transition": "nudged"
},
"fleet_alert": {
"name": "Fleet Operational Alert",
"protocol_tag": "[fleet-alert]",
"template": "[fleet-alert] {severity}: {message}",
"description": "System or detector broadcast into broadcast sidechats (#lobby, #jobs) regarding infrastructure events.",
"required_fields": ["severity", "message"],
"optional_fields": [],
"regex_ref": "fleet_alert",
"reply_expectation": "Broadcast telemetry; no direct reply required unless work order accompanies it.",
"example": "[fleet-alert] CRITICAL: VM unreachable x2 on port 22",
"lifecycle_transition": "alert -> incident"
},
"contract_footer": {
"name": "Standard Conversational Contract Footer",
"protocol_tag": "Reply: [ACK id] seen ...",
"template": "Reply: [ACK {id}] seen | [CLAIM {id}] mine | [RESULT {id}] done | [DECLINE {id}] | [NO-ACTION {id}].",
"description": "Appended to prompts, digests, and task orders to remind model instances of acceptable parsing grammar.",
"required_fields": ["id"],
"optional_fields": [],
"regex_ref": "contract_footer",
"reply_expectation": "Strictly governs model output to use one of the specified reply prefixes.",
"example": "Reply: [ACK 7fce46e0] seen | [CLAIM 7fce46e0] mine | [RESULT 7fce46e0] done | [DECLINE 7fce46e0] | [NO-ACTION 7fce46e0].",
"lifecycle_transition": "directive"
},
"directive": {
"name": "Agent Action Directive",
"protocol_tag": "[Directive: ...]",
"template": "[Directive: {directive}]",
"description": "Actionable instruction enclosed in square brackets guiding agent forward progression.",
"required_fields": ["directive"],
"optional_fields": [],
"regex_ref": "directive",
"reply_expectation": "Agent must fulfill directive in subsequent conversational turn.",
"example": "[Directive: Take next action or close with [RESULT 7fce46e0] <summary>]",
"lifecycle_transition": "instruction"
},
"runtime_context": {
"name": "Runtime Context URL",
"protocol_tag": "[Runtime Context: ...]",
"template": "[Runtime Context: {url}]",
"description": "Injects thread URL or Web UI surface link for assistive navigation by agent.",
"required_fields": ["url"],
"optional_fields": [],
"regex_ref": "runtime_context",
"reply_expectation": "Provides reference telemetry for browser agent.",
"example": "[Runtime Context: https://box.muse-dev.online/thread/7fce46e0]",
"lifecycle_transition": "telemetry"
},
"subagent_update": {
"name": "Subagent Progress Update",
"protocol_tag": "[SUBAGENT-UPDATE]",
"template": "[SUBAGENT-UPDATE] Subagent '{title}' ({short_id}) has posted new output.",
"description": "Notification relay from background subagent session to parent orchestrator.",
"required_fields": ["title", "short_id"],
"optional_fields": ["details"],
"regex_ref": "subagent_update",
"reply_expectation": "Parent logs progress or incorporates findings into main thread.",
"example": "[SUBAGENT-UPDATE] Subagent 'exec-audit' (4a2b8e) has posted new output.",
"lifecycle_transition": "subagent-relay"
}
}
}