Merge master and reconcile Dot with the released MCP gateway

Reuse scoped browser and device consent, verified client metadata, signed event admissions and warm-standby gates. Preserve the dedicated agent resource and Runner authority. Regenerate the Dot-only migration after the merged gateway history and cover issuer, company, viewer and token isolation.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-06 17:47:24 -05:00
commit 1be3f69703
1212 files changed
+142427 -60490

No files matched your search

+101 -3
View File
@@ -188,6 +188,18 @@ Invariants:
Invariant: plaintext key shown once at creation; only hash stored.
### Agent cryptographic identity
Each agent also has one Ed25519 identity in `agent_identity_keys`, separate from
API bearer keys and company secrets. New-agent creation provisions it atomically;
existing agents provision lazily before their first managed run. The schema-only
migration and public reads never provision existing agents. Private PKCS#8 PEM
material uses `local_encrypted`; public SPKI PEM and its SHA-256 key ID are readable
through `GET /api/agents/:id/identity` and the agent Identity section. Managed
processes receive the pair through runtime-only environment fields. See
[Agent cryptographic identity](AGENT-IDENTITY.md) for storage, runtime, and copy
semantics.
## 7.4 `goals`
- `id` uuid pk
@@ -548,7 +560,7 @@ V1 non-terminal liveness rule:
- recovery-action ownership is separate from source-task ownership: automatic repair and board escalation preserve both source assignee fields; reassignment requires an explicit board decision or a policy-defined serious failure
- source-scoped recovery routing is cause-keyed: bounded continuity and disposition repair may retry only the original agent; provider-quota failures create/reuse a scheduled wait-recovery monitor; every other exhausted or unsafe path creates/reuses a board-owned recovery action with `routingPolicy: board_escalation_no_takeover_v1` and no substitute-agent wake
- legacy active agent-owned recovery actions remain readable, resolvable, and API-compatible after upgrade, but reconciliation does not enqueue another takeover wake for them
- active-run output silence is an informational board UI signal at one hour (`suspicious`) and four hours (`critical`); it does not create or update issues or recovery actions, comment on or block source work, change assignments, or wake an agent
- active-run output silence is an informational board UI signal at five minutes (`suspicious`) and fifteen minutes (`critical`); it does not create or update issues or recovery actions, comment on or block source work, change assignments, or wake an agent
- board snooze and continue decisions suppress the run signal until their stored re-arm time; a false-positive decision suppresses it permanently for that run; open legacy evaluation issues remain readable and manually resolvable without automatic refresh
Detailed ownership, execution, blocker, active-run watchdog, crash-recovery, and non-terminal liveness semantics are documented in `doc/execution-semantics.md`.
@@ -572,6 +584,18 @@ conversation lifecycles, and protection against replaying superseded requests.
- Board has full read/write across all companies in deployment
- Every board mutation writes to `activity_log`
Human invitations default to the Operator role. Its default grants allow agent
creation and configuration, skill editing, environment management, invitations,
task assignment, pipeline editing, connection and tool management/use, and tool
and agent-action audit views. Operators do not receive `joins:approve` or
`users:manage_permissions`. Explicit invitation grants remain authoritative.
Creating a human invitation also requires any of these two membership powers
included in its selected role. Operators can invite Operators and Viewers;
inviting an Admin requires join approval, and inviting an Owner also requires
member-permission management.
This preset change adds no database migration; existing role-default seeding
continues to insert missing grants without replacing custom scopes.
## 9.2 Agent Auth
- Bearer API key mapped to one agent and company
@@ -592,7 +616,7 @@ conversation lifecycles, and protection against replaying superseded requests.
| Action | Board | Agent |
|---|---|---|
| Create company | yes | no |
| Hire/create agent | yes (direct) | request via approval |
| Hire/create agent | yes (direct) | new standard agents: direct via `canCreateAgents`; low-trust policy or approval gates can restrict |
| Pause/resume agent | yes | pause: no; resume: direct `agents:configure` grant only |
| Create/update task | yes | yes |
| Force reassign task | yes | limited |
@@ -611,6 +635,14 @@ access does not bypass that decision, and `agents:suggest-changes` alone cannot
apply the lifecycle change. Pause, clear-error, terminate, approval, and
key-management routes remain board-only.
An ordinary standard agent receives a direct `agents:configure` grant on
creation. Existing agents keep their current permissions; no backfill runs.
Low-trust and managed built-in agents do not receive this default. See
[agent permission defaults](agent-permission-defaults.md) for the full inventory.
Agent-authenticated changes cannot set or restore host-executed process adapter
configuration, including commands and environment values. Agent-authenticated
rollbacks cannot restore host-executed workspace commands either.
### 9.3.1 Shared default-open issue writes
For standard-trust agents, issue comments, issue field/status updates, child
@@ -1502,6 +1534,13 @@ Required UX behaviors:
- conflict toasts on atomic checkout failure
- no silent background failures; every failed run visible in UI
Regular task chats and Agent Chat keep unanswered questions as compact,
reopenable entries at their original position in the feed. Dismissing a question
or sending a newer message clears its form from the composer without resolving
the saved question. Questions do not contribute to composer pending counts.
Dismissal persists locally for the person and task across reloads; reopening
restores the original form and draft. Approval and permission gates are unchanged.
## 15. Operational Requirements
## 15.1 Environment
@@ -1702,12 +1741,18 @@ Confirmed project creation appears as a durable card in the shared task transcri
### User continuation after execution recovery stops
An authenticated user message or an exact failed-run Retry can start a fresh
An authenticated user message, a validated undelivered native message queue, or an exact failed-run Retry can start a fresh
native or legacy conversation turn once the prior execution is confirmed stopped. Retain the source history and uncertain
action outcomes; do not replay tool calls or reset the failed incident's automatic
retry budget. Existing pause, approval, budget, ownership, and dependency gates
remain in effect. See `doc/execution-semantics.md` for admission and stop-proof
requirements.
The task recovery notice offers Retry for eligible failures and verified native
startup cancellations, with failed attempts explained inline. Preparing native
turns keep the Steer label. Steer and Interrupt immediately move the submitted
messages from the composer queue into the conversation while delivery proceeds.
Provider acknowledgement remains authoritative; failed delivery restores the
latest queue with an inline error. Neither action produces a toast.
### Managed AI authentication
@@ -1720,6 +1765,13 @@ Legacy agents retain their authentication until validated adoption. See
[AI Connections](connections/AI-CONNECTIONS.md) for company isolation, compatible
methods, lifecycle, runtime enforcement, and migration details.
Missing personal AI credentials detected before adapter dispatch also produce
the inline connection card. Every missing binding must belong to the same
compatible AI provider. The responsible user connects their own account and
explicitly adopts Connections; another user's onboarding key is never reused.
Acceptance resumes only the matching configuration-blocked task through durable
continuation delivery. Unrelated configuration gaps retain operator recovery.
The selected AI connection supports an on-demand usage probe through the common
connection service, independent of legacy/native execution. The board usage
endpoint rechecks company membership and the credential's human audience before
@@ -1905,3 +1957,49 @@ See [Public MCP](public-mcp.md) for the implemented instance-side boundary,
configuration, plugin packages and outstanding hosted release gates. The
[delivery plan](plans/2026-09-30-paperclip-public-mcp-and-plugins.md) separates
external agent participation and granted third-party tools into later releases.
The experimental OpenAI Dot Runner provider uses a separate `/mcp/runner`
agent OAuth resource. It reuses the public gateway's browser/device consent,
client metadata verification and signed event delivery, but requires one-use
agent pairing and normal run admission. Personal grants cannot authorize
Runner operations. See [OpenAI Dot Runner](openai-dot-runner.md) for the
self-hosted release boundary and remaining account qualification.
### Experimental AI connection routing
Opt-in plugin routers may represent a pool as an AI runtime binding. Core keeps
company and credential authorization, atomically records task/agent affinity and
a pool cursor, and persists concrete native recovery evidence. The full contract
is in [AI-CONNECTION-ROUTERS.md](connections/AI-CONNECTION-ROUTERS.md). Disabled
routing cannot allocate new tasks; already admitted native runs remain recoverable.
### Connection instructions
Connections can store optional, versioned agent instructions independently of
provider and transport. Catalog templates control editor visibility; saved
settings and runtime delivery also support connections without a template.
The server includes instructions only when the connection and at least one
action are available to the run's agent and responsible identity. An immutable
per-turn snapshot participates in session compatibility, so subsequent turns
remove stale instructions after edits or access revocation. See
[Connection instructions](connections/CONNECTION-INSTRUCTIONS.md) for contracts,
UI conventions, custom adapter integration, and initial memory templates.
### Native provider capacity retry
Committed, run-bound Codex `serverOverloaded` terminal failures display the model
capacity error directly and schedule at most two automatic retries, after one
and two minutes. Retries share the execution failure budget, retain task history,
and honor current ownership, review, governance, pause, dependency, budget, and
cleanup gates. Restart or duplicate finalization must not create another
successor. Permanent model/auth incompatibility and usage-limit exhaustion retain
their existing operator recovery requirements.
## Internal agent commentary
`agent_commentary` stores company-scoped, attributed complaints and suggestions
as free-form text in the instance database. Legacy agents use the default
`complain` and `suggestion-box` runtime skills; native runs use dedicated tools
in standard, ask, and planning modes. Submission never changes task disposition
or routes feedback externally. See [Agent commentary](agent-commentary.md) for
authentication, replay, document-sized limits, inspection, and deletion semantics.