paperclip/packages
Dotta 300b7f4b7e
Add deterministic capability control plane (#12355)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Semantic operations need a control plane that owns authorization and
state changes
> - Conformance tests need this authority without a live server or
database
> - The existing in-memory port covers transport facts but not
capability-governed domains
> - This pull request adds a deterministic capability-aware control
plane for tests
> - It keeps the implementation behind the package testing entry point
> - The benefit is repeatable authorization and mutation tests before
production wiring lands

## Linked Issues or Issue Description

**Subsystem affected**

packages/paperclip-runner testing and semantic capability contracts

**Problem or motivation**

Later semantic action slices need deterministic company, actor, task,
governance, workspace, secret, budget, routine, and audit state. A live
Paperclip server would make those tests slow and environment-dependent.

**Proposed solution**

Add serializable capability fixture types and an in-memory control-plane
adapter. Enforce company scope, claims, roles, idempotency, redaction,
faults, and audit records. Export the adapter only from the testing
entry point.

**Alternatives considered**

The tests could mock each action separately. That would duplicate
authorization rules and would not verify state transitions across
multiple actions.

**Roadmap alignment**

This supports the existing experimental Paperclip Runner rollout. It
does not enable production semantic operations or change app execution.

## What Changed

- Add deterministic capability fixture types and seed state.
- Add an in-memory capability control-plane adapter.
- Enforce run, company, actor, claim, role, and idempotency boundaries.
- Model governed task, document, interaction, workspace, secret,
routine, and audit changes.
- Add deterministic tests and testing-entry-point exports.

## Verification

- `pnpm --filter @paperclipai/paperclip-runner test:typescript`
- `pnpm --filter @paperclipai/paperclip-runner typecheck:typescript`
- `pnpm -r typecheck`
- `pnpm build`
- The branch changes 5 files relative to its declared base.

## Risks

The main risk is a permissive mock that hides a production authorization
error. The adapter fails closed for missing claims, wrong roles,
cross-company access, duplicate mutations, invalid state, and restricted
secret access. Tests cover each fixture domain and serialized restore
behavior.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

OpenAI Codex, `gpt-5`, with agentic reasoning, tool use, and code
execution.

## 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 linked an existing public issue or described the
issue in-PR
- [x] I have not referenced internal or instance-local Paperclip issues
or links
- [x] My branch name describes the change and contains no internal
Paperclip ticket id
- [x] I have run tests locally and they pass
- [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
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-08-29 22:54:30 -05:00
..
adapter-utils feat(connections): add self-serve intent runtime (#12345) 2026-08-29 12:08:34 -05:00
adapters feat(connections): add self-serve intent runtime (#12345) 2026-08-29 12:08:34 -05:00
db feat(connections): add managed external MCP connectors (#12346) 2026-08-29 12:08:34 -05:00
google-sheets-mcp-server
…
kv-demo-mcp-server
…
mcp-server feat(connections): add self-serve intent runtime (#12345) 2026-08-29 12:08:34 -05:00
paperclip-runner Add deterministic capability control plane (#12355) 2026-08-29 22:54:30 -05:00
plugins feat(connections): add self-serve intent runtime (#12345) 2026-08-29 12:08:34 -05:00
shared feat(runner): project native runs into task threads (#12321) 2026-08-29 19:26:20 -05:00
skills-catalog
…
tailscale-https-broker
…
teams-catalog
…