Files
PaperClipAI/maps/agent-access-map/companies.md
T
DottaandPaperclip b81b870732 Add QA smoke journeys and OpenCode run traces (#18098)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Product E2E journeys verify saved application behavior across
deployments.
> - Task creation and questions need reusable smoke selections and exact
run attribution.
> - Operators also need to inspect the OpenCode execution behind a
measured question.
> - Company observability does not currently support native OpenCode.
> - This change adds the journeys and a bounded projection of normalized
OpenCode run events.
> - The projection follows the configured capture policy and retains the
current run identity across warm reuse.

## Linked Issues or Issue Description

Related foundation: #17262. Related alternative: #17989 exports metadata
from OpenCode's native OTLP stream. This change uses normalized run
events to support the existing content switches and per-run linkage. It
does not forward the native stream. The two PRs overlap in launch
registration and must be reconciled before both land.

**What existing behavior does this improve?**

Reusable Product E2E smoke selections and company observability for
native OpenCode.

**Current behavior**

The journey catalog lacks reusable task creation and attached-agent
question checks. Native OpenCode is marked unsupported for company
observability, so a successful destination connection test does not
prove that agent traces will appear.

**Proposed behavior**

Add explicit task-create and ask-question selections. Verify saved state
and exact company, issue, agent, model, environment and successful run
attribution. Export normalized OpenCode turns, tools and usage to the
configured OTLP destination. Honor each capture switch and redact known
secrets.

**Reason and benefit**

CI can run a small measured smoke selection, retain its screenshots and
checks, and link results to traces belonging to the same run.

**Breaking changes**

Existing selectors remain unchanged. OpenCode export is opt-in through
existing company settings. Legacy OpenCode stays unsupported.

## What Changed

- Add reusable task creation and question journeys, configured-agent
capability, owned-fixture checkpoints and strict evidence validation.
- Add an OpenCode-owned projection of normalized run events. No provider
SDK or raw payload schema enters heartbeat coordination.
- Extend the private launch union and reserved environment allowlist for
native OpenCode. With export disabled, no receiver request runs.
- Keep destination headers in the parent wrapper and out of the actual
provider child environment and configuration.
- Bound each turn to 64 tool and 64 usage entries, 8 KiB per text field
and a 1 MiB request. Use a three-second request deadline, four
concurrent exports, and no retries or idle worker.
- Pass the rotated runner authority to each proxy turn. A retained
process no longer attributes later turns to its original launch run.
- Update settings copy, observability documentation and capability maps.

## Verification

- `pnpm -r typecheck` and `pnpm build` passed after the implementation
changes.
- Adapter launch/redaction: 9 tests passed. Projection and actual proxy:
12 tests passed before the review fix; the expanded projection suite
passed all 12 cases after the fix. The proxy test exercises two runs in
one process against a real local HTTP receiver and a fake provider.
- Full OpenCode driver/projection suite: 72 passed, one existing
response_wake test timed out at five seconds. A focused check then
passed both existing omitted-continuation cases and the new trace export
case. The timeout cause remains unconfirmed.
- Runner package TypeScript and Rust `cargo check` passed. Map and UI
token checks passed.
- Prior journey validation: 273 tests across 12 files and the journey
TypeScript check passed.
- Broad local `pnpm test:run` encountered native-runtime integration
failures with repeated embedded PostgreSQL initialization failures and
was stopped. All 16 failing cases passed in an isolated run outside the
filesystem sandbox (961 unrelated cases unselected). The broad local run
is not a clean acceptance result. A later focused database-backed
chat/heartbeat run passed all six selected observability cases,
including native OpenCode launch and successful allocation (1,809
unrelated cases were unselected).
- All CI gates passed for `21085f880d8babc9efeb22d0623db99613d33093`,
including packaged-runner, clean-install, browser and build checks:
https://github.com/paperclipai/paperclip/actions/runs/40884658995 .
Greptile reviewed the same commit at 5/5 with no unresolved findings.
- Verified OTLP JSON acceptance and indexing with an explicitly
synthetic transport marker. No live OpenCode model trace or deployed
smoke acceptance is claimed yet.

## Risks

Export is best effort. Abrupt termination, recovered in-flight turns
without a new submitted event, limits or receiver failure can lose
traces. Export failure does not change task success. The projection
represents observed normalized events, not raw native model spans or
hidden reasoning. Known-secret redaction is not an OS isolation
boundary. UI changes can break journey locators. Deployment adapters
retain credential, ownership and cleanup responsibility. Both the
controller and native runner bundle must be updated before live
qualification.

## Model Used

OpenAI Codex, GPT-6, with reasoning, code execution and browser tools.
The exact serving model ID and context size are not exposed to this
session.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass (targeted suites; broad
local limitation documented above)
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-10-29 08:57:12 -05:00

10 KiB

Companies and portability — agent access

Product map: Companies and portability.

Feature ID: companies.

Review date: 2026-10-12. Source commit: 58e16dbddfc9c8d0cf60867f9d9847f0feda055b. Native REST transport reconciled in this change; see the shared transport contract.

This is a source-reviewed baseline of representative operations and known gaps. Each capability needs operation-level review before its entire scope can be qualified. No live agent execution is claimed. Follow the map contract for format, permission checks, evidence and maintenance.

selection

Capability ID: companies/selection.

Review: baseline.

API: present — representative operation IDs:

  • GET /api/companies/{companyId}.
  • GET /api/companies.
  • POST /api/companies.

Agent access: partial — Agent reads its bound company; CLI context chooses it; board lists/creates companies.

Policy: Same-company CEO or board for identity/import operations; list/create/archive convenience endpoint is board-gated.

Evidence: source-only — implementation at the reviewed commit above.

Verification: not-run — exercise a listed permitted operation with actual agent credentials/run context; inspect its result and applicable persistence/attribution. Assert the relevant denied actor, owner, company or mode from Policy. Review the remaining operations before qualifying the whole capability.

Gaps: A worker cannot enumerate/create companies via its company agent key. Browser selection is local state.

identity

Capability ID: companies/identity.

Review: baseline.

API: present — representative operation IDs:

  • PATCH /api/companies/{companyId}.
  • PATCH /api/companies/{companyId}/branding.

Agent access: available — Same-company CEO REST / native call_api / CLI company.

Policy: Same-company CEO or board for identity/import operations; list/create/archive convenience endpoint is board-gated.

Evidence: source-only — implementation at the reviewed commit above.

Verification: not-run — exercise a listed permitted operation with actual agent credentials/run context; inspect its result and applicable persistence/attribution. Assert the relevant denied actor, owner, company or mode from Policy. Review the remaining operations before qualifying the whole capability.

Gaps: The CEO restriction is a real policy, not a missing API; ordinary employees need denial evidence.

archive

Capability ID: companies/archive.

Review: baseline.

API: present — representative operation IDs:

  • POST /api/companies/{companyId}/archive.
  • PATCH /api/companies/{companyId}.

Agent access: partial — Board archive endpoint; CEO company PATCH can express status changes.

Policy: Same-company CEO or board for identity/import operations; list/create/archive convenience endpoint is board-gated.

Evidence: source-only — implementation at the reviewed commit above.

Verification: not-run — exercise a listed permitted operation with actual agent credentials/run context; inspect its result and applicable persistence/attribution. Assert the relevant denied actor, owner, company or mode from Policy. Review the remaining operations before qualifying the whole capability.

Gaps: Convenience archive and general company PATCH have different authorization. Review equivalence rather than declaring all archival human-only.

portability

Capability ID: companies/portability.

Review: baseline.

API: present — representative operation IDs:

  • POST /api/companies/{companyId}/exports.
  • POST /api/companies/{companyId}/imports/preview.
  • POST /api/companies/{companyId}/imports/apply.

Agent access: partial — Same-company CEO REST / native call_api / CLI exports and eligible same-company imports.

Policy: Same-company CEO or board for identity/import operations; list/create/archive convenience endpoint is board-gated.

Evidence: source-only — implementation at the reviewed commit above.

Verification: not-run — exercise a listed permitted operation with actual agent credentials/run context; inspect its result and applicable persistence/attribution. Assert the relevant denied actor, owner, company or mode from Policy. Review the remaining operations before qualifying the whole capability.

Gaps: Exports use inline credential delivery and encrypted mutation receipts. New-company/ZIP import flows retain their board and transport constraints.

decision-models

Capability ID: companies/decision-models.

Review: baseline.

API: present — GET and PUT /api/companies/{companyId}/decision-model; POST /api/companies/{companyId}/decision-model/test; GET /api/companies/{companyId}/decision-model/availability; GET /api/companies/{companyId}/decision-model/history.

Agent access: partial — same-company REST and admitted native call_api availability/history reads where policy allows. Settings and the fixed Test action require board identity. Native rollout/run gates follow the shared transport contract.

Policy: Settings access requires board and company access; non-managers receive no settings or choices. Configuration and tests additionally require connection management authority (owner/admin, instance admin, or tools:manage_connections). History requires company_scope:read and redacts task/run links without issue:read. Background sponsorship and budget admission remain separate service checks.

Evidence: source-only — reviewed on 2026-10-13 at 60bc0d5fee9a6e48db08fc016521fee3d9f57d67: routes, service, and connection authority.

Verification: not-run — read history with an allowed company actor and an actor without task access; check link redaction. Reject agent configuration/tests and board mutations without connection-management permission. Verify settings and bounded test receipts with an owned simulated provider.

Gaps: No agent settings/test path; permitted history does not delegate management. Live native and agent-credential reads remain unverified.

fast-responses

Capability ID: companies/fast-responses.

Review: baseline.

API: present — GET and PUT /api/companies/{companyId}/fast-response; GET /api/companies/{companyId}/fast-response/models; GET /api/companies/{companyId}/fast-response/availability; POST /api/companies/{companyId}/fast-response/test; GET /api/companies/{companyId}/fast-response/history.

Agent access: partial — same-company REST and admitted native call_api history reads where policy allows, subject to the shared transport contract. Settings, model selection, availability and test controls require board identity.

Policy: Board and company access gate configuration surfaces. Updates, models and tests additionally require connection-management authority. History requires company_scope:read; task/run links require issue:read. The experiment, provider account, sponsorship and budget controls still gate actual acknowledgements.

Evidence: source-only — reviewed on 2026-10-13 at 60bc0d5fee9a6e48db08fc016521fee3d9f57d67: routes, service, and connection authority.

Verification: not-run — inspect history and redacted task links as an allowed company actor. Reject agent settings/models/availability/tests and unauthorized board mutations. Use a simulated provider to inspect a saved configuration, success receipt, timeout and recorded usage.

Gaps: No agent configuration/test path. An acknowledgement is not completed task work. Live native, provider and agent access remain unverified.

agent-observability

Capability ID: companies/agent-observability.

Review: baseline.

API: present — representative operation IDs:

  • GET /api/companies/{companyId}/observability.
  • PUT /api/companies/{companyId}/observability.
  • DELETE /api/companies/{companyId}/observability.
  • POST /api/companies/{companyId}/observability/test.

Agent access: operator-only — configuration and tests require board context.

Policy: Company access and Manage connections permission; non-managing board readers receive no settings. Credentials are write-only and stored through company secret bindings. Native OpenCode's parent exports a bounded projection of normalized run events under these settings. The destination headers stay out of the actual OpenCode child environment and configuration.

Evidence: source-only — routes.

Verification: not-run — exercise board management, restricted board, agent denial, and cross-company denial.

Gaps: Direct agent management and independent personal harness enrollment are outside v1.

prompt-injection-prevention

Capability ID: companies/prompt-injection-prevention.

Review: baseline.

API: present — GET/PUT /api/companies/{companyId}/prompt-injection-prevention, GET /api/companies/{companyId}/prompt-injection-prevention/models, and POST /api/companies/{companyId}/prompt-injection-prevention/test.

Agent access: restricted — management is board-only. Admitted gateway tool results use saved configuration through an internal service, not an agent API.

Policy: Company access, connection-management permission, shared OpenRouter API keys, credential audience, installation, and budgets remain enforced. Identified users cannot become sponsored callers after a denial. See routes and service.

Evidence: source-only — service tests and gateway tests exercise permissions, billing, fallback, and persisted evidence; execution results belong in the change's PR.

Verification: not-run — Reject agent management and foreign-company requests. Assert model verdicts at admitted result boundaries and the original regex on dependency failure.

Gaps: No agent-facing mechanism to request a board configuration change is added.