Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
harnesses
What it is
Belongs to agent sessions: registration for user-run agent harnesses (macrod). Owns device-code pairing (create, approve, claim), the harness list the settings UI renders, revocation, and the bound-agent listing the daemon reconciles its webhook feed from.
Start here
src/domain/service.rs: pairing, listing, revocation logic.src/domain/tokens.rs: harness token minting/verification (constant_time_eqcomparison — don't swap in a non-constant-time check).src/domain/ports.rs+src/domain/models.rs: repo port and harness model.src/inbound/axum_router.rs: the HTTP surface.src/outbound/pg_harness_repo.rs: the Postgres adapter.
Scope
- Owns: harness registration, pairing, and the agent-binding list.
- Not here: running an agent session or the ACP protocol itself →
crates/agent_session,coding_agent_worker.
Boundaries
- Depends on:
harness_id,harness_token,bot_id,macro_authorization. - Used by:
coding_agent_worker.
Recipes
- Add a registration field or state:
src/domain/models.rs→src/domain/service.rs→src/outbound/pg_harness_repo.rs→src/inbound/axum_router.rs. - Change token scope/verification:
src/domain/tokens.rs→ its callers insrc/domain/service.rs.
Checks
cargo test -p harnesses(SQLX_OFFLINEunset).
Gotchas
Harness.connectedreadsharness_runtime_connection: true while a row has an unexpired lease.agent_harness_servicewrites those rows per connection. With no rows at all it falls back tolast_connected_at > last_disconnected_at, for connections held by replicas older than the rows; remove that once none remain.GET /harnesses/melogsharness_presence_disagreementwhen the daemon sendsRUNTIME_CONNECTED_HEADERand the harness reads offline (infra/stacks/monitoring/monitors/harness-presence.tsalerts on it).
Related
- Rules:
.agents/rules/rust/architecture.md,.agents/rules/rust/security.md - Skill:
cloud-storage-hexagonal-architecture