Commit Graph
928 Commits
Author SHA1 Message Date
Dotta dd57bfba21 Revert "Split run progress from liveness disposition"
This reverts commit 55518170ad.
2026-04-29 16:02:22 -05:00
Dotta caf37a355d Revert "PAP-2731 Implement sky explicit-wait UI surfaces"
This reverts commit 08a9e0caf0.
2026-04-29 16:02:11 -05:00
DottaandPaperclip 0a345e9648 Handle liveness escalation blockers as waiting
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-29 14:29:47 -05:00
Dotta 398d85488c Guard liveness recovery by issue creation time 2026-04-29 14:24:30 -05:00
Dotta ba88e86f63 Cancel queued runs for cancelled issues 2026-04-29 14:15:24 -05:00
Dotta 2ba694d10f Clarify explicit waiting posture for plans 2026-04-29 14:02:53 -05:00
DottaandPaperclip 02dd5309b3 Cover live-run polling cap
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-29 14:01:06 -05:00
DottaandPaperclip 33bcaa5a4c Allow recovery owners to cancel stale runs
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-29 14:00:36 -05:00
DottaandPaperclip 326fd2f6fb Allow cancelling question interactions
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-29 11:54:37 -05:00
DottaandPaperclip 2b3a7f683b PAP-2822 Expose canonical executionDisposition on issue payloads
Adds a per-issue read-model resolver that loads the disposition state
vector (active runs, queued wakes, agents, interactions, approvals,
recovery/productivity-review issues, latest run evidence) and runs the
shared classifier. Wires it into issue list, detail, and
heartbeat-context responses, and surfaces it on the shared Issue type
as `executionDisposition` so the board can read execution health
without inferring it from status alone.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-29 10:50:25 -05:00
DottaandPaperclip cbd091b3ef Harden agent issue authz
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-29 10:40:32 -05:00
DottaandPaperclip 04c85b6db6 Integrate canonical recovery dispositions
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-29 10:28:23 -05:00
Dotta d354ecadfa PAP-2820 Enforce issue transition dispositions 2026-04-29 10:26:50 -05:00
DottaandPaperclip 9413f55381 Add canonical issue execution disposition classifier
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-29 10:19:22 -05:00
DottaandPaperclip 229487afef Unify issue activity ledger
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-29 08:49:35 -05:00
DottaandPaperclip 5adbe69381 Harden pending wait recovery gating
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 18:31:24 -05:00
Dotta 7f9ae0adcd Harden recovery wait boundaries 2026-04-28 18:20:46 -05:00
DottaandPaperclip c1fd7521a8 PAP-2729 Handle interaction waiting lifecycle
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 18:13:05 -05:00
DottaandPaperclip 1e68cb9be0 Handle explicit waits in liveness read models
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 18:06:29 -05:00
DottaandPaperclip de4ce9828d PAP-2643 Phase 3: gate run-liveness continuation and scheduled retry promotion under pause holds
Suppress bounded run-liveness continuation wakes when an active pause hold
covers the issue, and cancel due scheduled retries with errorCode `issue_paused`
instead of promoting them only to be cancelled at claim time. Adds regression
coverage for both gates plus the no-pause-hold passthrough invariant.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 16:57:28 -05:00
DottaandPaperclip 3ea2ff4187 Surface invalid-leaf recovery_needed in blockerAttention read model
A blocked parent like PAP-2089 currently reports a generic
needs_attention chain even when its leaf is the productive-run-stopped
shape from PAP-2674's plan. Extend listIssueBlockerAttentionMap to
fetch each candidate leaf's latest issue-linked succeeded run plus its
productivity-review state, classify the leaf as recovery_needed when it
matches the shape, and propagate the leaf identifier, next-action
owner, and CTA hint up to the root. The leaf itself also surfaces
recovery_needed on its own attention so the leaf-level notice can
render when an inbox wake lands directly on it.

Adds two integration cases (productive_run_stopped and
continuation_exhausted) to the embedded-Postgres regression suite.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 15:59:03 -05:00
Dotta 2656a86dae Recover productive stranded runs 2026-04-28 15:30:19 -05:00
DottaandPaperclip 4b309a9e3b Classify runnable liveness follow-up
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 15:27:32 -05:00
Dotta 55518170ad Split run progress from liveness disposition 2026-04-28 15:23:52 -05:00
DottaandPaperclip 45f1bc293b test: encode productive terminal liveness regression
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 13:35:31 -05:00
DottaandPaperclip b0d6ec582d Cover agent issue mutation ownership
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 13:24:03 -05:00
DottaandPaperclip 14a149c79f Harden productivity review request depth
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 13:24:00 -05:00
DottaandPaperclip 9465d04755 Fix subtree resume pause release
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 13:23:56 -05:00
DottaandPaperclip ec2c5537fc Merge origin/master into master
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 13:19:24 -05:00
DottaandPaperclip 889cf660ac Page issues list with scroll offsets
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 12:52:09 -05:00
DottaandPaperclip 647c2c487e Tighten shared project workspace runtime stop/restart auth
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 11:02:27 -05:00
DottaandPaperclip 484d37feb9 Reject prompt templates for new bundled agents
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 09:36:12 -05:00
DottaandPaperclip b779e43272 PAP-2614: Surface productivity review state in issue UI
Adds a productivityReview lookup to single-issue and list responses, plus
a ProductivityReviewBadge component that surfaces the open productivity
review on the source issue's header (with trigger/no-comment-streak
detail in the tooltip), and a compact eye glyph next to the StatusIcon
on IssueRow so operators can spot yellow tasks in any list. The review
issue itself shows a static "Productivity review" pill in the header
when its originKind matches.

Also extends the shared IssueOriginKind union with the recovery-side
kinds (harness_liveness_escalation, issue_productivity_review,
stranded_issue_recovery) so UI checks against issue.originKind type-check.

Wires the new helper through GET /issues/:id, GET /companies/:id/issues
(via issueService.list), and GET /issues/:id/heartbeat-context. Adds a
status-language Storybook story matrix for UX review.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 09:27:16 -05:00
DottaandPaperclip e7d32f19cd Clear legacy prompt templates for bundled agents
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 09:15:53 -05:00
DottaandPaperclip 8b7cf25d59 test: cover first-attempt stranded recovery
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 09:03:08 -05:00
DottaandPaperclip 82a558df86 Implement productivity review reconciler
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 09:00:02 -05:00
DottaandPaperclip 2176de4b48 Separate successful continuations from recovery
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 08:48:55 -05:00
DottaandPaperclip e3869bda4c Allow configurable issue attachment limits
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-28 08:17:52 -05:00
Dotta fcee7e129e convert plans to tasks 2026-04-28 07:37:08 -05:00
Dotta 3f8e2a6a0d paperclip plan skill in access 2026-04-28 07:27:37 -05:00
DottaandPaperclip f88f538e6d Keep manual routine runs visible in the runner inbox (#4615)
## Thinking Path

> - Paperclip coordinates recurring agent work through scheduled and
manual routines.
> - Manual routine runs are board-initiated work and should stay visible
to the human who kicked them off.
> - Routine execution issues are agent-assigned, so they can be filtered
away from a board user's inbox unless the user is recorded as touching
the work.
> - Coalesced or skipped active routine runs have the same visibility
problem because they reuse an existing live issue.
> - This pull request carries the manual runner actor into routine
dispatch and touches the linked issue for that user's inbox.
> - The benefit is that manually triggered routine work stays
discoverable by the operator who started it.

## What Changed

- Passed the board or agent actor from the routine run route into the
routine service.
- Recorded manual board runners as `createdByUserId` on fresh routine
execution issues.
- Touched coalesced or skipped active routine issues for the manual
runner by updating read state and clearing that user's inbox archive.
- Added route and service regressions for manual routine run actor
propagation and inbox visibility.

## Verification

- `pnpm exec vitest run server/src/__tests__/routines-routes.test.ts
server/src/__tests__/routines-service.test.ts`

## Risks

- Low risk: the change is scoped to manual routine runs and only updates
issue attribution/read-state metadata for the initiating actor.
- No migrations.

> 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 coding agent based on GPT-5, tool-enabled local
repository and shell access, Paperclip heartbeat context.

## 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 run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-27 20:03:24 -05:00
Dotta 68c37660f0 Dispatch assigned todo work during recovery sweeps (#4614)
## Thinking Path

> - Paperclip orchestrates AI agents for autonomous companies.
> - Agent assignments must reliably turn into heartbeat work without
board operators manually nudging stuck tasks.
> - The stranded-assignment recovery sweep already handles failed or
lost runs.
> - But assigned `todo` issues with no prior run could sit idle because
there was nothing to retry or recover.
> - This pull request dispatches those never-started assigned todos as
normal assignment wakes.
> - The benefit is that recovery fixes missed initial dispatches without
creating unnecessary recovery issues.

## What Changed

- Added an initial assigned-todo dispatch path to the recovery service
when an assigned `todo` issue has no heartbeat run yet.
- Reused invocation budget hard-stop checks before dispatching or
requeueing recovery work.
- Counted `assignmentDispatched` in startup/scheduled recovery logs.
- Added heartbeat recovery regressions for first dispatch, duplicate
queued wake prevention, budget-blocked skips, and paused-agent skips.

## Verification

- `pnpm exec vitest run
server/src/__tests__/heartbeat-process-recovery.test.ts`

## Risks

- Low to medium risk: this changes liveness recovery behavior for
assigned `todo` issues, but it stays on the existing assignment wake
path and skips paused or budget-blocked agents.
- No migrations.

> 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 coding agent based on GPT-5, tool-enabled local
repository and shell access, Paperclip heartbeat context.

## 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 run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-04-27 20:02:44 -05:00
DottaandPaperclip e670b510d5 Fix budget skip in assigned todo recovery
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-27 15:45:50 -05:00
DottaandPaperclip f20e7fa790 Add assigned todo dispatch backstop
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-27 15:35:51 -05:00
DottaandPaperclip 0c170712e1 Merge origin/master into master
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-27 15:12:02 -05:00
DottaandPaperclip 7a9b3a6037 [codex] Harden recovery issue handling (#4600)
## Thinking Path

> - Paperclip orchestrates AI agents for zero-human companies
> - The control plane must recover stranded agent work without creating
new operational loops
> - Stranded recovery issues can themselves fail, and exposing raw retry
errors in comments can leak sensitive adapter details
> - New local companies also should not force a hire-approval gate
unless operators enable that policy
> - This pull request hardens recovery issue handling, redacts retry
failure details in issue copy, preserves `maxConcurrentRuns: 1`, and
flips new-hire approval to an opt-in default
> - The benefit is safer automatic recovery and smoother default company
setup without hidden migration conflicts

## What Changed

- Added migration `0071_default_hire_approval_off` and updated company
schema/import/export/docs so hire approvals default off and serialize
only when enabled.
- Added migration `0072_large_sandman` with a partial unique index
preventing duplicate active stranded recovery issues for the same source
issue.
- Blocked failed `stranded_issue_recovery` issues in place instead of
creating nested recovery issues.
- Redacted latest retry failure details from recovery issue comments
while still linking reviewers to run evidence.
- Allowed `maxConcurrentRuns: 1` to be honored by heartbeat concurrency
normalization.
- Added focused regression coverage for recovery recursion, redaction,
migration ordering, and concurrency behavior.

## Verification

- `pnpm --filter @paperclipai/db run check:migrations`
- `pnpm exec vitest run --project @paperclipai/server
server/src/__tests__/recovery-classifiers.test.ts`
- `pnpm exec vitest run --project @paperclipai/server
server/src/__tests__/company-portability.test.ts --pool=forks
--poolOptions.forks.isolate=true`
- `pnpm exec vitest run --project @paperclipai/server
server/src/__tests__/agent-permissions-routes.test.ts --pool=forks
--poolOptions.forks.isolate=true`
- `pnpm --filter @paperclipai/server typecheck`
- `pnpm exec vitest run --project @paperclipai/server
server/src/__tests__/heartbeat-process-recovery.test.ts --pool=forks
--poolOptions.forks.isolate=true` exits 0, but this host skipped the
embedded Postgres tests with the existing init guard.
- `pnpm exec vitest run --project @paperclipai/server
server/src/__tests__/heartbeat-dependency-scheduling.test.ts
--pool=forks --poolOptions.forks.isolate=true` exits 0, but this host
skipped the embedded Postgres tests with the existing init guard.

## Risks

- Migration risk is low but this PR intentionally owns both new
migrations to avoid separate PR migration-journal conflicts.
- Recovery comments now require operators to inspect linked run evidence
for details instead of reading raw errors inline.
- The hire approval default changes behavior for newly created/imported
companies only; existing persisted company settings are not changed
except by the SQL default for future rows.

> 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 coding agent, tool-enabled terminal/GitHub
workflow, reasoning mode active. Context window not exposed in this
environment.

## 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 run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-27 15:02:47 -05:00
Dotta 6ccf80bcf2 [codex] Reject stale company skill refreshes (#4601)
## Thinking Path

> - Paperclip orchestrates AI agents for zero-human companies
> - Company skills are part of the reusable agent capability layer
> - Skill inventory refresh work can outlive the company it was
requested for
> - Without an explicit company existence check, stale refreshes can
continue into bundled/local skill cleanup for deleted or missing
companies
> - This pull request makes company-skill listing fail fast when the
company no longer exists
> - The benefit is clearer API behavior and less stale background work
against missing company scope

## What Changed

- Added a company existence check before `companySkillService.list()`
refreshes bundled and local-path skill state.
- Added regression coverage asserting missing companies return `404
Company not found`.

## Verification

- `pnpm exec vitest run --project @paperclipai/server
server/src/__tests__/company-skills-service.test.ts --pool=forks
--poolOptions.forks.isolate=true` exits 0, but this host skipped the
embedded Postgres tests with the existing init guard.

## Risks

- Low risk. Existing callers for valid companies are unchanged.
- Missing-company callers now receive an explicit 404 instead of
continuing refresh work.

> 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 coding agent, tool-enabled terminal/GitHub
workflow, reasoning mode active. Context window not exposed in this
environment.

## 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 run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-04-27 13:19:38 -05:00
DottaandPaperclip 748db32478 Merge origin/master into master
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-27 12:53:30 -05:00
DottaandPaperclip b028c4866b Fix manual routine run inbox visibility
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-27 11:33:57 -05:00
DottaandPaperclip d424ada8d3 Redact recovery failure details from issue copy
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-27 11:18:16 -05:00