Commit Graph
2951 Commits
Author SHA1 Message Date
DottaandPaperclip 0cb21925bf Merge qualified recovery grouping and prerequisites
Co-Authored-By: Paperclip <noreply@paperclip.ing>

* commit '6e8119550dc3dccafa165d5aebed21bd43bb4ee3':
  Preserve native receipt grouping within each bounded worker pass
2026-10-31 00:06:47 -05:00
DottaandPaperclip 6e8119550d Preserve native receipt grouping within each bounded worker pass
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-31 00:06:19 -05:00
Dotta 499afce285 Merge commit 'a0f5caa00241e9f2653992f47106bbe38fec130f' into codex/sleep-final-qualified-18401
* commit 'a0f5caa00241e9f2653992f47106bbe38fec130f':
  test: align deferred recovery clocks with real execution
  Keep recovery acceptance timers on their owning clock
  test: measure retention page fairness on a controlled clock
  fix(heartbeat): resume saved chat work on feature enablement
  test: await resolved interaction execution before outcome assertions
  Wake saved conversation assignments when Agent Chat becomes enabled

# Conflicts:
#	server/src/services/instance-settings.ts
2026-10-30 23:26:43 -05:00
DottaandPaperclip a0f5caa002 Merge qualified issue recovery and test prerequisites
Co-Authored-By: Paperclip <noreply@paperclip.ing>

* commit '5c1ef3b5f4a49e2e45d915e66bd280ad34e0b863':
  Keep recovery acceptance timers on their owning clock
  test: measure retention page fairness on a controlled clock
  test: await resolved interaction execution before outcome assertions
  Wake saved conversation assignments when Agent Chat becomes enabled
2026-10-30 23:24:40 -05:00
DottaandPaperclip e6deb559ad test: align deferred recovery clocks with real execution
Keep manual receipt cursor progress when chat is disabled. Follow saved cleanup deadlines after actual child-process and PostgreSQL work settles, and preserve the exact failure-backoff boundary.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 23:24:40 -05:00
Dotta 5c1ef3b5f4 Merge commit '3466bcdada87c9fec474014e441a78bae6af35fd' into codex/sleep-chat-recovery-flag-integrated-a3466
* commit '3466bcdada87c9fec474014e441a78bae6af35fd':
  test: measure retention page fairness on a controlled clock
  test: await resolved interaction execution before outcome assertions
2026-10-30 23:23:03 -05:00
DottaandPaperclip 005310cd0d Keep recovery acceptance timers on their owning clock
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 23:20:31 -05:00
DottaandPaperclip 3466bcdada Merge qualified continuation and fairness fixtures into dispatch scheduling
Co-Authored-By: Paperclip <noreply@paperclip.ing>

* commit '21aed2b3e490d396554189766410a50816b921e4':
  test: measure retention page fairness on a controlled clock
  test: await resolved interaction execution before outcome assertions
2026-10-30 23:09:12 -05:00
DottaandPaperclip 09a70c3bef fix(server): recheck reactive sources after status summary commit
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 22:55:58 -05:00
DottaandPaperclip 21aed2b3e4 test: measure retention page fairness on a controlled clock
Keep virtual time fixed while actual filesystem and database work settles, then advance the coordinator deadline. Preserve the three-second page-gap limit and snapshot grace assertions; starvation mutation remains detected.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 22:54:06 -05:00
DottaandPaperclip 8d027fd2b6 fix(heartbeat): resume saved chat work on feature enablement
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 22:47:56 -05:00
DottaandPaperclip 97dcec4226 test: await resolved interaction execution before outcome assertions
Observe the target adapter-start event, then await its existing run-specific completion barrier. Preserve succeeded, execution-count and review-promotion assertions, including deliberately slow completion beyond the old terminal poll.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 22:42:23 -05:00
DottaandPaperclip e43163bfaf Wake saved conversation assignments when Agent Chat becomes enabled
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 22:36:47 -05:00
Dotta d287074fba Merge verified sleep prerequisites into 07
Co-Authored-By: Paperclip <noreply@paperclip.ing>

* commit '78bd3560a886c7fd3eea03baccb6cf49f6e8499a':
  Remove unused aggregate watchdog diagnostics
  test: settle delegated chat completion before plan assertions
  test: settle saved retry cleanup before idle assertion
  fix: wake retry scheduling only when retry state changes

# Conflicts:
#	server/src/services/heartbeat/retries.ts
2026-10-30 22:12:31 -05:00
DottaandPaperclip 78bd3560a8 Merge verified sleep prerequisites into c1
Co-Authored-By: Paperclip <noreply@paperclip.ing>

* commit '08e27cfe096a2f1bad63cd344f525c6b76008647':
  Remove unused aggregate watchdog diagnostics
  test: settle delegated chat completion before plan assertions
2026-10-30 22:12:08 -05:00
DottaandPaperclip 08e27cfe09 Remove unused aggregate watchdog diagnostics
The deadline worker retains its incomplete-subtree error and classifier tests. Remove the obsolete reporter and its two isolated tests after its aggregate callers were removed.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 22:12:07 -05:00
DottaandPaperclip 6ee17aae1c test: settle saved retry cleanup before idle assertion
Observe the specific succeeded retry before closing its task and draining all execution. Once execution has settled, advance bounded fake cleanup time while joining worker passes; retain the existing timeout, exact retry identity, output and zero-SQL assertions.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 21:55:27 -05:00
DottaandPaperclip 822b173281 test: preserve retry producer boundaries in receipt recovery
Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix/sleep-forward-02b-security:
  fix: wake retry scheduling only when retry state changes
2026-10-30 21:51:11 -05:00
Dotta 63c922a193 Merge commit 'c2ff3eb92113fb16713b270e34932636956ff16b' into fix/sleep-forward-02b-security
* commit 'c2ff3eb92113fb16713b270e34932636956ff16b':
  fix: wake retry scheduling only when retry state changes
2026-10-30 21:50:49 -05:00
DottaandPaperclip c2ff3eb921 fix: wake retry scheduling only when retry state changes
Separate retry-schedule notifications from ordinary queued-run eligibility. Preserve exact deadlines and prove native producer commit/rollback behavior without global retry scans on ordinary agent or issue edits.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 21:49:38 -05:00
DottaandPaperclip 5e1a5974a7 Merge commit 'af7b7d3316c86cdefc0845dc90f26b7cb436b9d1' into codex/sleep-status-card-evaluation
* commit 'af7b7d3316c86cdefc0845dc90f26b7cb436b9d1':
  fix: park unchanged project budget execution waits

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 21:18:22 -05:00
DottaandPaperclip def5a23997 fix(server): fence status card refresh decisions and retry debt
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 21:18:05 -05:00
DottaandPaperclip af7b7d3316 fix: park unchanged project budget execution waits
Lock and re-read project pause eligibility before publishing budget intent. Cover actual project Retry parking/release and concurrent pause admission without no-op hints.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 21:13:42 -05:00
DottaandPaperclip 11e92e3875 merge: preserve typed admission refusals and status-card source signals
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 20:51:04 -05:00
Dotta c0fe0feffb Merge commit '19a97bbe57d1ebd3691c70dd822488efe7e5d3e1' into codex/sleep-stack-c1
* commit '19a97bbe57d1ebd3691c70dd822488efe7e5d3e1':
  fix(server): park persisted deferred admission refusals
2026-10-30 20:50:39 -05:00
DottaandPaperclip 19a97bbe57 fix(server): park persisted deferred admission refusals
Distinguish a budget or agent refusal saved on the existing receipt from genuine recovery failure. Preserve HTTP409 messages and details, grant each new wait reason its existing finite grace, and retain failure backoff for unsaved or unexpected errors. Prove actual Retry admission,25-minute SQL quiet, independent warm producer-to-process release, missing/cancelled receipts and real PostgreSQL write failure.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 20:35:57 -05:00
DottaandPaperclip 9b4beff72b merge: preserve status-card and recovery producers in the review stack
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 20:24:40 -05:00
DottaandPaperclip 290d12cf4b merge: rehearse issue-recovery predecessor for saved receipts
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 20:24:05 -05:00
DottaandPaperclip dee5296b8a merge: rehearse current dispatch predecessor for issue recovery
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 20:23:55 -05:00
DottaandPaperclip fcc107739c merge: rehearse current master and UI prerequisite for dispatch
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 20:23:37 -05:00
DottaandPaperclip dff6c00468 Join receipt acceptance passes before advancing saved deadlines
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 19:50:27 -05:00
Dotta 0adba98c10 Merge commit 'e3fff84b6f81448c730dd165253a1a673f8d19b3' into codex/sleep-deferred-execution-receipts
* commit 'e3fff84b6f81448c730dd165253a1a673f8d19b3':
  fix: scope comment-triggered recovery to the affected issue
  test: await issue recovery dispatch and cancellation settlement
2026-10-30 19:45:15 -05:00
DottaandPaperclip c74f5f12ba Retain moved receipt deadlines and wake released execution gates
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 19:45:15 -05:00
DottaandPaperclip 6469daec07 fix: bound status-card active-hours calculation work
Reuse bounded timezone formatters and upcoming openings only within their exact searched closed ranges. Short-circuit empty windows while preserving the existing cold DST search and precise instant eligibility. Verify cost bounds, cache eviction, timezone transitions and twenty-card ordinary source delivery.

Co-Authored-By: Paperclip <paperclip@paperclip.ing>
2026-10-30 19:41:19 -05:00
DottaandPaperclip e3fff84b6f fix: scope comment-triggered recovery to the affected issue
Preserve company reconstruction for graph, run and eligibility changes. A real PostgreSQL producer regression verifies one assignment check among1000 open tasks, with broader eligibility reconstruction still intact.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 19:39:21 -05:00
DottaandPaperclip 7bb1af657a test: await issue recovery dispatch and cancellation settlement
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 19:38:27 -05:00
DottaandPaperclip ac6c5191ee Drive saved execution receipts from committed work and deadlines
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 19:22:39 -05:00
Dotta f201195a92 test: await committed recovery and adapter admission outcomes 2026-10-30 19:20:10 -05:00
Devin FoleyandPaperclip 87ae20ae65 fix(server): reconcile failed sandbox cleanup with signed absence (#18407)
Reconcile failed ephemeral Cloud leases through a signed cleanup-only absence observation when local historical inspection is unavailable. Preserve failure outcomes, exact resource bindings, retention and row-version fences; grant no run-continuation authority.

All 54 current-head checks/statuses passed. Greptile is 5/5, Medium, with no findings or unresolved threads. The 38 focused tests pass; both new reconciliation cases fail without the fallback. Isolated baseline and branch idle suites each pass all 225 cases. The original broader local teardown timeout is retained in the PR, and the full local run remains in progress.

Cloud protocol support is already serving in staging. Exact candidate composition and hosted provider sleep/wake qualification follow this merge. Production has not been changed.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 17:04:04 -07:00
Dotta 32044a63e1 fix: scope status-card deletion notifications to its company 2026-10-30 19:00:51 -05:00
Dotta 0fe6e038c2 Restore independent recovery duties and bound committed-source work 2026-10-30 18:58:39 -05:00
DottaandPaperclip cd4caaab26 fix: batch status-card source notifications
Coalesce committed company hints in a fixed one-second window without flooring real deadlines. Verify one hundred ordinary issue/comment writes, company isolation, deadline preemption, retained hints and settled SQL quietness. Await actual evaluation I/O in fake-clock acceptance instead of jumping across connection timers.

Co-Authored-By: Paperclip <paperclip@paperclip.ing>
2026-10-30 18:49:20 -05:00
Nicky Leach 9e904ee519 perf(server): overlap independent heartbeat preparation reads (#18372) 2026-10-30 16:49:20 -07:00
DottaandPaperclip 91261d5a03 fix(server): preserve budget history for deleted resources (#18389)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Budget views show saved policies, incidents and spend for each
company.
> - A policy can remain after its agent or project has been deleted.
> - The overview currently stops when it cannot resolve that old
resource.
> - A current agent's budget then becomes unreadable during normal
setup.
> - This pull request preserves the historical row in display summaries.
> - Admission and policy changes still require a real company-owned
resource.

## Linked Issues or Issue Description

**What happened?**

The budget overview throws `Agent not found` when a saved policy
references a deleted agent. One old resource prevents the company from
reading its current budgets. The same problem affects historical project
policies and incident summaries.

**Expected behavior**

The overview should retain historical policy and incident IDs and spend.
It should display `Deleted agent` or `Deleted project` for a missing
resource. Read access must not grant permission to execute work or
change a budget for that resource.

**Steps to reproduce**

1. Create an agent and a budget policy for it.
2. Permanently delete the agent after its other dependencies have been
cleared.
3. Read the company's budget overview. The existing service throws
instead of returning its remaining current and historical rows.

**Paperclip version or commit**

The isolated repair starts from merged commit
`d9354bbfc35ef74333e90e596ce21dc8e59149b9` and integrates the exact
merged baseline test fix `8595efc20bda3ce20a9fbbf34a5d156a6fcf6d57`. It
also integrates the actual merged Antigravity auth fix
`18b1637b6371a6a6adade857e2a73654ee626fef` (#18254). The diff against
the selected merged parent remains two budget files.

**Related work**

Earlier reports and implementations: #11058 and #4333. This extracts the
product prerequisite from #18351 so it can qualify independently of that
journey's other dependencies. The change contains only the budget
service repair and four database regression cases.

## What Changed

- Resolve deleted agent and project scopes only when building display
summaries. Preserve their original IDs, policies, incidents and
accounting records.
- Reject a saved policy or incident that resolves to another company's
resource. Propagate other read failures.
- Keep missing-company resolution, work admission and policy changes
strict. Validate company, policy and incident scope bindings before
either incident action. A budget raise requires a live company-owned
resource. Historical dismissal may proceed only for a genuinely deleted
owned agent/project, and must reject live foreign or mismatched scopes.
- Add four canonical PostgreSQL regression cases: deleted agent history,
deleted project history, missing-scope admission and budget raises with
safe historical dismissal, and foreign/mismatched references. The
history cases also verify current ledger spend and unchanged stored
rows.

## Verification

- Real-service RED/GREEN against official PGlite with every canonical
migration: the original overview throws for deleted history; the repair
returns the historical IDs, incidents and spend while retaining current
budgets.
- Mutation regression RED/GREEN: missing-resource budget raises must
reject before writes; owned deleted-scope dismissal must reject its
linked pending approval, retain policy/agent/ledger data and incident
history, and remove the incident from the active list. Live foreign and
mismatched scopes reject both actions without mutations.
- Current integrated head `b3434f5ad05fd3067379352700c36bfe826179c4`:
all four canonical PostgreSQL regressions pass in [server
2/12](https://github.com/paperclipai/paperclip/actions/runs/41142588583/job/124361194077),
and all five existing budget-service tests pass in [server
7/12](https://github.com/paperclipai/paperclip/actions/runs/41142588583/job/124361194080).
Both use the CI merge against selected parent `18b1637`.
- Clean-build declaration typing passes in the current CI typecheck
gate. The earlier local source-alias no-emit check also passed,
including the canonical actor argument. The local worktree borrows
compiled dependencies from a sibling checkout; a later real-service
import was blocked by its stale `sandboxCreationOperations` export, so
clean-build CI is authoritative for the final integration. No production
workaround was made.
- `git diff --check` passes. Broad repository typecheck, tests and build
run in current-head CI rather than repeated locally. Native local
PostgreSQL could not start because this host exhausted its semaphore
pool; no global IPC settings or unrelated processes were changed.
- One unchanged Runner lane retry was authorized after a probable
intermittent close-settlement fixture failure. The [original
failure](https://github.com/paperclipai/paperclip/actions/runs/41142588583/job/124360234111)
occurred in `omitted-context` cleanup. A [fresh passing Linux
lane](https://github.com/paperclipai/paperclip/actions/runs/41142552195/job/124360110386)
passed the same case and all 1,998 tests with byte-identical entire
Runner and adapter-utils trees, lockfile, root package, scripts and
workflows, against the same merged base. The fixture has a five-second
close allowance with a 2.5-second suspension reserve; a host stall is
not proven. No budget path or changed close input was found. The [single
targeted
retry](https://github.com/paperclipai/paperclip/actions/runs/41142588583/job/124365812609)
passed the same case in 1,034 ms and all 1,998 lane tests; dependent
verification also passed. All 57 current PR checks are terminal and
green.
- The product helper requires all current CI and clean review before
merge. Actual QA budget-overview proof will run on the combined final
app before hiring qualification. No deployed success is claimed. The
older `b4863dd` artifact was never deployed; selected parent `18b1637`
adds sandbox/lifecycle changes and migration 0418, so whole-app identity
is not claimed. The budget module and relevant budget contracts remain
unchanged, and final hiring requires the combined final app with
explicit source identities.

## Risks

Budget summaries now return historical rows whose resources have been
deleted. These rows use explicit display names and preserve their
accounting data. They do not create a resource or relax work admission,
authorization or budget grants. Historical incident dismissal changes
only that incident and its linked approval; it does not resume work or
raise a budget. Cross-company references still fail closed. There is no
schema migration and no new background work.

## Model Used

OpenAI Codex, GPT-6 family. The session does not expose a more specific
backend model ID or fixed context window. Used reasoning, repository
tools, TypeScript and database test 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 (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 (the
PR description documents the display-only history and strict-mutation
contract)
- [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-30 18:36:36 -05:00
Dotta 9eee45ed2d Merge branch 'codex/sleep-run-task-recovery' into codex/sleep-issue-state-recovery
* codex/sleep-run-task-recovery:
  fix: normalize run dispatch hints to company identity

# Conflicts:
#	server/src/services/run-dispatch-notifications.ts
2026-10-30 18:28:44 -05:00
DottaandPaperclip 2ee5c7d6dc fix: preserve status-card deadline ownership through restart
Use a dedicated advisory-lock connection so a one-slot write pool can finish evaluation and result writeback. Record internal deadline provenance so startup recovers lost membership hints without advancing saved policy or retry debt.

Co-Authored-By: Paperclip <paperclip@paperclip.ing>
2026-10-30 18:28:40 -05:00
DottaandPaperclip 972fbc0760 fix: normalize run dispatch hints to company identity
Wider interaction and execution objects must coalesce into one company dispatch scope.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-30 18:24:45 -05:00
Dotta ab5108611d Run recovery producer acceptance on isolated PostgreSQL fixtures 2026-10-30 18:15:23 -05:00
Dotta ff5586cb74 Merge branch 'codex/sleep-run-task-recovery' into codex/sleep-issue-state-recovery
* codex/sleep-run-task-recovery:
  fix(environments): persist sandbox ownership before creation (#18357)
  fix(server): bound failed lifecycle verification (#18383)
2026-10-30 18:10:01 -05:00
Dotta dc4456c76b Drive issue recovery from scoped source writes and saved deadlines 2026-10-30 18:10:00 -05:00