Commit Graph
1520 Commits
Author SHA1 Message Date
DottaandCodex 4479d24130 Integrate reviewed Boat credentials and workspace fixes
Co-authored-by: Codex <noreply@openai.com>

* codex/boat-environment-core:
  Carry explicit existing-branch intent in workspace realization
  Preserve Boat credentials and explicit workspace strategies
  Carry explicit existing-branch intent in workspace realization
  Fix runtime prerequisite home, workspace, and integrity boundaries
2026-10-11 08:01:02 -05:00
DottaandPaperclip c9ae885fd9 Preserve Boat credentials and explicit workspace strategies
Keep candidate config, credential bindings, computer attachment and activation in one transaction so a rejected key preserves committed authority. Honor configured worktree bases and attach exact existing branches without creating, resetting or replacing dirty work.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-11 07:59:37 -05:00
DottaandPaperclip 6ce1d17e96 Carry explicit existing-branch intent in workspace realization
Keep requested branch attachment separate from ownership established by realization, and round-trip the optional intent through the shared request contract.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-11 07:59:23 -05:00
DottaandCodex 6e5411ce47 Integrate Boat lifecycle fixture qualification
Co-authored-by: Codex <noreply@openai.com>

* codex/boat-environment-core:
  Complete computer lifecycle in warm identity fixtures
2026-10-11 07:40:01 -05:00
DottaandPaperclip 7634c65d22 Complete computer lifecycle in warm identity fixtures
Give the shared target identity regressions a typed computer target and validate retention and retirement when integrated with Boat lifecycle handling.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-11 07:39:31 -05:00
DottaandPaperclip 9e7abda1d0 Integrate reviewed Boat prerequisite stack
Co-Authored-By: Paperclip <noreply@paperclip.ing>

* codex/boat-environment-core:
  Harden persistent runner transports and provider restoration
  Stabilize task lifecycle browser fixtures
2026-10-11 07:34:20 -05:00
DottaandPaperclip 8ecad0f359 Merge shared runtime prerequisites into Boat integration
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-11 07:33:39 -05:00
DottaandPaperclip 1525c4ef27 Harden persistent runner transports and provider restoration
Assemble the shared runtime prerequisite from the frozen Boat implementation, including its owning tests and the minimal computer target identity dependency.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-11 07:32:05 -05:00
DottaandPaperclip e318850909 Stabilize task lifecycle browser fixtures
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-11 07:17:23 -05:00
Dotta add1bea3ad Merge branch 'codex/boat-environment-core' into codex/boat-environment
* codex/boat-environment-core:
  perf(chat): stop polling provider action and session sync queues (#15822)
  refactor(heartbeat): extract environment selection (#15825)
  perf(runner): compile the TypeScript surface once per build (#15853)
2026-10-11 07:12:45 -05:00
DottaandPaperclip 0eac0a26e9 Merge pinned upstream environment selection into Boat feature
Integrate e733bddc45 while preserving Boat admission deferral and ownership fences. Verify agent and instance Boat selection without acquiring a lease.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-11 07:12:16 -05:00
DottaandPaperclip e733bddc45 perf(chat): stop polling provider action and session sync queues (#15822)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Chat stores pending provider actions in durable database rows.
> - Three action queues still scan every second when empty.
> - These scans keep idle databases active.
> - This pull request wakes those queues after a commit or at their next
deadline.
> - Empty queues stop querying while existing recovery rules remain in
place.

## Linked Issues or Issue Description

Refs #15808, #15802, #15625. Related sleep work: #15750, #15757.

**What existing behavior does this improve?**

Provider messages and notices, accepted GitHub webhook receipts, and
Slack session status synchronization.

**Current behavior**

Chat maintenance scans these three queues every second. It also rechecks
paused Slack sync rows every 30 seconds.

**Proposed behavior**

Reuse the transaction-aware action workers and existing chat_actions
rows. Wake after commits. Restore unfinished work on startup. Use stored
retry and stale-claim deadlines. Stop scanning when empty. Park paused
Slack sync rows until an endpoint change.

## What Changed

- Add three topics to the existing action worker registration. No
tables, migrations, triggers, or external services.
- Signal producers, claims, retry updates, terminal settlements, and
operator resolution inside their owning transaction. Provider I/O
remains outside transactions.
- Share pending-state and deadline predicates between dispatch and
scheduling. Exclude terminal history and uncertain provider sends.
- Preserve GitHub receipt attempt fences and provider-send quarantine.
Preserve Slack's 30-minute refresh while a session is processing.
- Remove these workers from periodic app maintenance. Update the sleep
inventory and add regression coverage.

## Verification

- Passed: 13 focused tests across scheduler, app wiring, and real
PostgreSQL integration. Covers actual commit wakes with deferred fast
paths disabled, GitHub retries and startup recovery, stale-send
quarantine, Slack publication-to-sync delivery, paused deadlines, and
idle queues.
- Passed: pnpm typecheck.
- Passed: full chat integration and related coordinator suites, **1,274
tests across five files**.
- Passed: pnpm build.
- Greptile: **5/5**, no actionable findings, completed on
`dc284cd275e5f6df624d60b27954421f2bcdbee2`.
- Hosted CI: **54 checks passed**, two intentionally skipped Storybook
checks, no failures or pending checks on
`dc284cd275e5f6df624d60b27954421f2bcdbee2`.

Provider responses are simulated. PostgreSQL, transactions, service
dispatch, and scheduling are real. No live Slack or GitHub App was used.

## Risks

- Writers must emit the existing process-local transaction signal.
Independent database clients and direct SQL still need explicit
integration or startup recovery.
- Accepted GitHub receipts are covered. Finding callbacks GitHub never
delivered still uses the separate provider recovery lane.
- Other chat maintenance and persistent transports still run. This does
not establish whole-instance sleep.
- Existing claim, revision, credential, and authorization checks remain
authoritative during concurrent foreground and scheduled dispatch.

## Model Used

OpenAI Codex (GPT-6), with repository inspection, code execution, and
automated tests.

## 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
- [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-11 06:08:05 -05:00
DottaandPaperclip 30e338fba6 refactor(heartbeat): extract environment selection (#15825)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Heartbeat execution selects an environment before it prepares a
workspace and starts an agent.
> - Workspace preparation now has its own module, but its selection
policy still occupies the executor.
> - Environment defaults, recovery bindings, chat isolation, and
workspace contention must retain their order.
> - This pull request moves that selection phase behind one typed
function.
> - The executor keeps dispatch gates and lease cleanup. Tests cover the
public path and the new boundary.

## Linked Issues or Issue Description

Refs #15807. This continues the heartbeat extraction series after
workspace preparation.

**Current behavior**

The 5,599-line heartbeat service contains a 301-line environment
selection phase inside run execution.

**Proposed behavior**

Move that phase to `heartbeat/environment-selection.ts`. Keep the same
policy, statement order, errors, and public exports.

**Reason and benefit**

Readers can find selection policy in one module and follow the
executor's phases without reading each policy branch.

## What Changed

- Add `selectHeartbeatEnvironment` with typed run, task, policy,
configuration, and service inputs. Return the values needed by
configuration and workspace preparation.
- Preserve native recovery bindings, environment precedence, managed
sandbox enforcement, Kubernetes provisioning, native chat isolation, and
shared workspace contention.
- Reduce `heartbeat.ts` from 5,599 lines / 234,599 bytes to 5,314 lines
/ 220,784 bytes. The new module is 402 lines / 18,215 bytes.
- Add six public-path characterization cases before moving production
code and six boundary cases. Repair plugin-test teardown to drain active
execution and call the database cleanup helper.
- Assert the selected local environment in the browser fixture's real
worker and document the new boundary.

## Verification

- Before the move: 71 tests passed, including all six new public-path
cases. Three plugin tests skipped when the host could not start their
database probe.
- After the move: all 112 focused tests passed across eight files, with
no skips. These cover environment policy, local and plugin execution,
contention, recovery bindings, workspace preparation, chat isolation,
and low-trust directories.
- Passed `pnpm -r typecheck` and `pnpm build`.
- A normalized TypeScript AST comparison confirms the 301 moved lines
and remaining executor statements are unchanged, apart from the new call
and imports.
- Browser acceptance: the task UI recovered automatically and the worker
verified its selected local environment, preserved uncommitted files,
and completed the task. The persistent-failure case passed in isolation:
three total runs, then a blocked task that remained blocked after
reload.
- The first persistent-failure browser attempt missed the retry banner
within five seconds, despite a persisted scheduled retry. Its unchanged
isolated rerun passed. The trace is retained; the intermittent UI
failure is not yet attributed to a root cause. No assertion or timeout
was relaxed.
- Greptile reviewed `20953dd164decb565bc8d85081aad31a23fd33e5`: 5/5, no
actionable findings.
- Hosted CI passed on `20953dd164decb565bc8d85081aad31a23fd33e5`: 52
successful checks and two intentionally skipped Storybook checks, with
no pending or failing checks. This includes all general and serialized
test groups, Runner verification, eight browser shards, typecheck, and
build.
- The duplicate local `pnpm test:run` was interrupted after hosted CI
completed. It is not reported as a local full-suite pass. Local
completed checks are the 112 focused tests, typecheck, build, and
browser cases described above.

## Risks

- This selection phase enforces execution restrictions. A wrong input or
import could select the wrong environment or change retry behavior.
Public-path tests cover refusal, redirect, contention, and dispatch;
boundary tests cover recovery and isolation.
- The helper can provision a managed environment row and add concurrency
notes to the supplied task context. It acquires no execution lease. The
executor retains its catch/finally boundaries and resource ownership.
- Kubernetes selection is tested with real database state and bootstrap
settings. These checks do not claim execution against a live Kubernetes
cluster or hosted sandbox provider.
- No schema, migration, API contract, or intended behavior change.

## Model Used

OpenAI Codex (GPT-6), with repository inspection, code editing, compiler
checks, database integration tests, and browser automation. The exact
serving model ID and context-window size are not exposed in 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
- [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-11 06:04:31 -05:00
Dotta d983582fd7 Merge branch 'codex/boat-environment-core' into codex/boat-environment
* codex/boat-environment-core:
  Diagnose artifact upload phases with opt-in bounded records
2026-10-11 03:28:13 -05:00
Dotta 4e489a1014 Diagnose artifact upload phases with opt-in bounded records 2026-10-11 03:27:30 -05:00
Dotta 2a5eca4220 Merge branch 'codex/boat-environment-core' into codex/boat-environment
* codex/boat-environment-core:
  fix: expose computer retirement grace through module boundary
2026-10-11 03:08:47 -05:00
Dotta 086a9dbbd8 fix: expose computer retirement grace through module boundary 2026-10-11 03:08:05 -05:00
Dotta e2c390dd04 Merge branch 'codex/boat-environment-core' into codex/boat-environment
* codex/boat-environment-core:
  fix: preserve authoritative warm computers during orphan lease sweep
  fix: share Boat upload capacity before command admission
2026-10-11 03:01:30 -05:00
Dotta d14578ad13 fix: preserve authoritative warm computers during orphan lease sweep 2026-10-11 03:00:55 -05:00
Dotta 8198c9a571 fix: share Boat upload capacity before command admission 2026-10-11 02:59:57 -05:00
Dotta 26542bb9d0 Merge branch 'codex/boat-environment-core' into codex/boat-environment
* codex/boat-environment-core:
  Avoid duplicate diagnostics for immediate native session close failure
2026-10-11 01:45:08 -05:00
Dotta b1030f6233 Avoid duplicate diagnostics for immediate native session close failure 2026-10-11 01:45:01 -05:00
Dotta a7425b8d0c Merge commit '3812ccfebb43836656d3fb7375d73d85fd5fe9e9' into codex/boat-environment
* commit '3812ccfebb43836656d3fb7375d73d85fd5fe9e9':
  Record scoped warm retirement failure diagnostics
2026-10-11 01:29:46 -05:00
Dotta 3812ccfebb Record scoped warm retirement failure diagnostics 2026-10-11 01:29:37 -05:00
Dotta 0421a3b8c0 Merge reviewed Boat core with compatible canonical migration numbering
* commit 'd7d7808302f3bd8045ee3d7afff55a066635f463': (27 commits)
  Bind Copilot profile v18 to admission diagnostics
  Synchronize admission diagnostic tests with runtime entry
  fix(server): permit verified question-delivery history to sleep (#15851)
  Preserve safe ACPX admission stages on startup timeout
  fix: preserve admitted user turns across legacy recovery sweeps
  perf(ci): prefetch the consumer image and Grok binary during package staging (#15849)
  fix: classify pinned sidecar admission failures safely
  fix: preserve pre-provider recovery after verification outages
  fix: preserve Stop through computer admission retry races
  fix: allow bounded cold verification of persistent computer packs
  fix: resume new input after paused computer admission retries
  fix: align workspace CI partition with upstream contract
  fix: support upstream workspace CI partition
  fix: distinguish provider cache mismatches from unavailable verification
  fix: preserve Boat wait ownership and honor Stop across retries
  perf(ci): run the db project as its own workspaces-c lane (#15831)
  fix: defer Boat admission while provider stop is pending
  Preserve controller-owned provider pack authority across cold resume
  Keep Boat reconnect unavailable until attachment succeeds
  Validate retained packages against the active provider contract
  ...
2026-10-10 23:58:56 -05:00
Dotta d7d7808302 Merge upstream and regenerate Boat migration as 0333 2026-10-10 23:57:20 -05:00
Devin FoleyandPaperclip b36960b758 fix(server): permit verified question-delivery history to sleep (#15851)
Treat completed question-response deliveries as history only after their exact same-company handoff finishes. Preserve missing evidence, retries, accounting debt, and idle-sleep fences.

Add a concurrent all-state question history index with interrupted-build repair. Keep migrations serialized without waiting snapshots that deadlock concurrent index builds.

Validated by 118 focused sleep tests, six migration/snapshot tests, full repository typecheck, all CI gates, and Apex 5/5.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-10 21:47:55 -07:00
Dotta b68c68566c fix: preserve admitted user turns across legacy recovery sweeps 2026-10-10 23:21:47 -05:00
Dotta 9a31fa2746 fix: preserve admitted user turns across legacy recovery sweeps 2026-10-10 23:21:25 -05:00
Dotta 121ec12299 fix: preserve pre-provider recovery after verification outages 2026-10-10 23:05:39 -05:00
Dotta 3e90f36fa7 fix: preserve pre-provider recovery after verification outages 2026-10-10 23:04:31 -05:00
Dotta 87694c9c3f fix: preserve Stop through computer admission retry races 2026-10-10 23:02:38 -05:00
Dotta 280bad9d15 fix: preserve Stop through computer admission retry races 2026-10-10 23:01:52 -05:00
Dotta c4fd4d8c1a fix: allow bounded cold verification of persistent computer packs 2026-10-10 22:53:15 -05:00
Dotta c1273036d5 fix: allow bounded cold verification of persistent computer packs 2026-10-10 22:50:03 -05:00
Dotta 956f32fe23 fix: resume new input after paused computer admission retries 2026-10-10 22:48:25 -05:00
Dotta a5cc05d2c3 fix: resume new input after paused computer admission retries 2026-10-10 22:48:08 -05:00
Dotta 2f03982a47 fix: distinguish provider cache mismatches from unavailable verification 2026-10-10 22:36:50 -05:00
Dotta fd3ec56106 fix: distinguish provider cache mismatches from unavailable verification 2026-10-10 22:36:14 -05:00
Dotta 3bd413a9b3 fix: preserve Boat wait ownership and honor Stop across retries 2026-10-10 22:28:14 -05:00
Dotta 11ccf7b1a2 fix: preserve Boat wait ownership and honor Stop across retries 2026-10-10 22:27:53 -05:00
Dotta 04ce7eb2a8 fix: defer Boat admission while provider stop is pending 2026-10-10 22:07:06 -05:00
Dotta a4c864a062 fix: defer Boat admission while provider stop is pending 2026-10-10 22:06:55 -05:00
Dotta 44b1b52362 Preserve controller-owned provider pack authority across cold resume 2026-10-10 21:19:44 -05:00
Dotta 29e2aa95d1 Preserve controller-owned provider pack authority across cold resume 2026-10-10 21:19:34 -05:00
Dotta 193c2baeee Validate retained packages against the active provider contract 2026-10-10 21:02:56 -05:00
Dotta 80decfdc10 Validate retained packages against the active provider contract 2026-10-10 21:02:41 -05:00
Dotta 66ac692e44 fix(boat): retain verified ACPX provider packs across deployments 2026-10-10 20:44:45 -05:00
Dotta 21deac0abf fix(boat): retain verified ACPX provider packs across deployments 2026-10-10 20:44:17 -05:00
Dotta 9b44e0db22 diagnostics: record native completion cancellation source 2026-10-10 20:37:39 -05:00