Commit Graph
5778 Commits
Author SHA1 Message Date
DottaandPaperclip a989d03d0e Merge updated parent into sleep-08-decision-archive-delivery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:50:14 -05:00
DottaandPaperclip 622220dde4 Scope tool review projection recovery to linked company changes
Preserve startup reconstruction and legacy linked cards while keeping ordinary confirmations quiet. Integrate the verified parent startup fixture repair.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:50:13 -05:00
DottaandPaperclip ac9624d3ca Merge updated parent into sleep-06-interrupted-tool-recovery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:38:04 -05:00
DottaandPaperclip e937d89aa0 Merge updated parent into sleep-05-approved-tool-recovery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:38:04 -05:00
DottaandPaperclip 1ff4b95644 Merge updated parent into sleep-04-tool-review-expiry
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:38:04 -05:00
DottaandPaperclip f5f5a157d2 Merge updated parent into sleep-03-gateway-credential-expiry
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:38:04 -05:00
DottaandPaperclip b754e72720 test(server): prove secret expiry startup loads scoped deadlines
Record registration failures instead of discarding their evidence; use the current expiry service contract and assert successful deadline reconstruction.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:38:03 -05:00
DottaandPaperclip 42eb946588 Merge updated parent into sleep-08-decision-archive-delivery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:22:05 -05:00
DottaandPaperclip b2d69dc66b test(server): include company in saved review outcome signal
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:22:04 -05:00
DottaandPaperclip 0bb940250e Merge company-scoped review work into projection recovery
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:21:39 -05:00
DottaandPaperclip 800d00bc22 Merge scoped tool review notifications into interrupted recovery
Preserve execution ownership and register company-scoped work before settlement writes inside the existing transaction.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:21:12 -05:00
DottaandPaperclip b04548e345 fix(server): scope approved review recovery to affected companies
Keep startup reconstruction and paginated recovery in the existing owner. Preserve per-company retry deadlines across notifications and let healthy companies progress independently.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:20:18 -05:00
DottaandPaperclip 069eb3ca4a Merge company-scoped review notifications into approval recovery
Keep rate admission, locked history reconciliation, and formal approval parking while carrying company identity through every approval producer.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:12:32 -05:00
DottaandPaperclip b1bb59e286 fix(server): scope pending tool review expiry to company changes
Require company hints at existing review-write boundaries, refresh saved company deadlines, and drain bounded due batches without scanning unrelated companies.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 18:11:01 -05:00
DottaandPaperclip dd8aea0c6b Merge updated parent into sleep-08-decision-archive-delivery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:40:36 -05:00
DottaandPaperclip fa504d68e1 Merge updated parent into sleep-07-tool-review-projection
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:40:35 -05:00
DottaandPaperclip cb20460a2c Merge updated parent into sleep-06-interrupted-tool-recovery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:40:35 -05:00
DottaandPaperclip 35a912b1bb Merge updated parent into sleep-05-approved-tool-recovery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:40:35 -05:00
DottaandPaperclip a9f26387f5 Merge updated parent into sleep-03-gateway-credential-expiry
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:40:34 -05:00
DottaandPaperclip bad22d99b1 fix(server): scope secret expiry to committed company changes
Preserve saved deadlines, bounded company expiry, independent retry backoffs, and deletion invalidation. Move shared deadline dispatch earlier in the stack so expiry and later workers use one owner.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:40:34 -05:00
DottaandPaperclip ea99a4fe0f Merge updated parent into sleep-04-tool-review-expiry
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:40:34 -05:00
DottaandPaperclip bf96768960 Merge updated parent into sleep-08-decision-archive-delivery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:05:40 -05:00
DottaandPaperclip b2eb8fdcef Merge updated parent into sleep-07-tool-review-projection
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:05:39 -05:00
DottaandPaperclip 4ea9db1440 Preserve saved cancelled tool outcomes during recovery
Treat cancelled invocations as terminal evidence instead of overwriting their recorded outcome with unknown-execution failure. The regression fails before the fix and all 14 interrupted-review worker cases pass.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 17:05:39 -05:00
DottaandPaperclip 3405971db9 Merge updated parent into sleep-08-decision-archive-delivery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:55:33 -05:00
DottaandPaperclip dd7463ebb1 Merge updated parent into sleep-07-tool-review-projection
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:55:33 -05:00
DottaandPaperclip 4eec699943 Merge approved-review repairs into interrupted-review recovery
Keep the shared test fixture introduced by this slice and carry forward its optional rate-limit policy.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:55:32 -05:00
DottaandPaperclip cd516fdc2b Settle invalid approved reviews and park pending formal decisions
Reconcile durable invocation history under the claim locks before dispatch, retain retries for configuration and dependency failures, and wake formal approval waits only from committed decisions.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:54:57 -05:00
DottaandPaperclip fb7e906a27 Retain admitted rate slots while tool actions await approval
Reuse the durable admission only for the same bound invocation and unchanged rate rule. Keep approval, current permissions, policy changes, and execution claims with their existing owners. Cover agent and Test-tab foreground/recovery paths, approval-policy preservation, and invalid invocation states. All 139 gateway/policy cases and server typechecking pass.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:41:07 -05:00
DottaandPaperclip a9e1f28bb5 Merge updated parent into sleep-08-decision-archive-delivery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:12:33 -05:00
DottaandPaperclip 8860c8c15c Merge updated parent into sleep-07-tool-review-projection
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:12:33 -05:00
DottaandPaperclip fd331d99f3 Merge updated parent into sleep-03-gateway-credential-expiry
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:12:32 -05:00
DottaandPaperclip 3962c5cbaa Merge updated parent into sleep-04-tool-review-expiry
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:12:32 -05:00
DottaandPaperclip 0a6571b8d7 Merge updated parent into sleep-06-interrupted-tool-recovery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:12:32 -05:00
DottaandPaperclip d8ae842246 Merge updated parent into sleep-05-approved-tool-recovery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:12:32 -05:00
DottaandPaperclip a5be42b19f Merge deadline precision repair into shared expiry scheduling
Keep the shared deadline owner introduced here and apply the parent fix to it. Custom-image, secret-proposal, and startup regression suites pass: 122 tests.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:12:31 -05:00
DottaandPaperclip 27548b33b7 Honor saved custom-image deadlines inside the retry window
Clear retry gating after successfully reading a future deadline or an empty queue. Preserve backoff for failed and still-overdue work. Verify startup precision, earlier notifications, failure spacing, and real committed expiry.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 16:11:30 -05:00
DottaandPaperclip a50422e03a Merge updated parent into sleep-08-decision-archive-delivery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 15:17:47 -05:00
DottaandPaperclip abc6c0b6aa Merge updated parent into sleep-07-tool-review-projection
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 15:17:47 -05:00
DottaandPaperclip d9ce743b88 Merge updated parent into sleep-06-interrupted-tool-recovery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 15:17:46 -05:00
DottaandPaperclip 7a4920dd12 Merge updated parent into sleep-05-approved-tool-recovery
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 15:17:45 -05:00
DottaandPaperclip 2ef7f2e848 Merge updated parent into sleep-04-tool-review-expiry
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 15:17:44 -05:00
DottaandPaperclip 13cfb36d8a Merge updated parent into sleep-03-gateway-credential-expiry
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 15:17:43 -05:00
DottaandPaperclip 969f5ce24d Merge updated parent into sleep-02-secret-proposal-expiry
Preserve the existing PR boundary while integrating master through the sleep migration stack.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 15:17:42 -05:00
DottaandPaperclip 120cffc00f Merge master into sleep migration stack
Preserve both custom-image cleanup scheduling and the workspace recovery registration added on master.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 15:17:16 -05:00
DottaandPaperclip 507dc70be2 fix(evals): bind hosted controller admission to the first attempt (#17523)
Bind hosted controller admission to the repository, GitHub run, first attempt, workflow revision and selected execution before credential reads or provider launch. Keep offline evidence replay independent of the current worker environment. Preserve the single-project boundary editor and refresh project-access data with agent-detail updates.

Verified head: 1e588f75fe.
Validation: 74 synthetic source/portable controller tests, 98 focused UI tests and token gates passed before the ancestry-only final sync; four hosted/portable regressions pass again with unchanged eval and UI repair trees. Final exact-head full CI passed (40387856225), and Greptile reviewed this head at 5/5 with zero unresolved findings. The optional secondary Paperclip Review is paused and not counted as completed. No paid work or schedule changes.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
canary/v2026.1026.0-canary.10
2026-10-26 14:43:58 -05:00
DottaandPaperclip 9ae4c25e7e perf(runner): reuse compatible protected provider packs (#17749)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Native Runner starts provider runtimes in remote execution
environments.
> - Sandbox images already contain qualified provider packs.
> - Startup required the image pack to match the entire current app
release manifest.
> - An unrelated app commit could therefore cause pack verification,
transfer, and installation again.
> - This pull request selects protected packs by their provider
interface and platform.
> - The benefit is no extra pack probe, directory scan, version command,
link, or upload on the compatible image path.

## Linked Issues or Issue Description

**What happened?**

Starting a remote task can reject a compatible image pack because its
source revision or unrelated provider differs from the controller. Pack
replacement added about 16 seconds in the investigated startup. Startup
also repeated full content checks.

**Expected behavior**

Use an already qualified, protected pack when its selected provider
interface and target platform are compatible. Keep the selected artifact
identity for process launch and recovery.

**Steps to reproduce**

1. Install a qualified provider pack in a sandbox image.
2. Start a controller built from another app commit.
3. Start a remote OpenCode task. The old complete-manifest comparison
rejects the image pack even when the provider interface still works.

Related repairs: #16493 reduced transfer cost. #17512 retained exact
artifact authority during reattachment. This change preserves that
recovery rule and changes fresh-launch pack selection.

## What Changed

- Add explicit OpenCode and ACPX interface revisions to produced pack
manifests. App Git SHAs and dependency pins remain provenance.
- Read bounded protected-installation metadata in the existing final
runner metadata query. Accept only root-owned paths that the execution
user cannot write, including ancestors and manifest. Reject writable
aliases.
- Select and prepare the pack in server-owned environment setup before
constructing the existing transport. Bind provider launch paths and
digests from the selected installation. Save that identity for exact
reattachment.
- Keep full content verification for uploads, writable installations,
and legacy packs. Reuse successful verification within one startup. Keep
older attached runners compatible with the optional metadata request.
- Seal image packs and document the one-time image refresh that enables
reuse across later compatible releases. Keep selected ACPX agent
qualification checks.

## Verification

- Red/green regression: the old code rejects a protected pack from
another app revision with `manifest mismatch`; the fixed path selects it
without executing verification commands.
- Native startup regression: select the installed pack's own Node digest
with one existing runner metadata request and no pack verification or
version commands.
- Targeted pack, artifact, recovery, execution-driver, and Rust metadata
tests pass. Incompatible interfaces/platforms, malformed identities,
writable roots, path aliases, and exact reattachment are covered.
- Final revision `91dc1676ff67bdbe5866c8586daac10240530cca`: workspace
typecheck and build pass. All 53 current-head checks are successful,
with no pending or failed checks. Greptile is 5/5 with no open findings.
- The broad local `pnpm test:run` attempt reported a workspace-runtime
conflict test failure; its isolated rerun passed. The broad run was
stopped after that failure. Full CI now passes, including the server
test shards. This is not a claim that the full local run passed.
- Linux filesystem evidence: the production metadata functions read a
real root-owned preinstalled pack as a non-root user in 16 microseconds
median and 20 microseconds p95 across 100 warm reads. This measures
metadata admission, not model or hosted response latency.
- All 910 affected server tests and 57 Copilot attestation tests pass
locally on the final implementation. Full CI covers the unchanged Runner
transport. No provider qualification hash was refreshed.
- Built the actual Linux daemon at
`416e7ec7425d0d3565b4a5e1808002d650a60414` and ran its metadata command
as UID 65534. The protected installation returned its real manifest with
`immutable: true`; writable alias and missing-pack cases returned
`immutable: false`. This is metadata/permission evidence, not provider
execution.
- Hosted rollout and a hosted end-to-end latency measurement have not
run.

## Risks

- Existing images need one rebuild to publish the compatibility
declaration. Packs without it keep the legacy content-verification path.
- Fast admission relies on image publication producing a qualified
protected tree. Root execution and task-writable installations retain
full verification.
- Bump an interface revision when required runner/pack behavior changes
incompatibly. Deploy a new image to roll out compatible runtime fixes or
upgrades.
- This removes provider-pack preparation delay. Other runner startup,
context, model, and finalization costs remain separate.

## Model Used

OpenAI Codex, configured model `gpt-6.1-sol`, reasoning effort `xhigh`,
with tool use and code execution. The context-window size is 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-26 14:43:12 -05:00
DottaandPaperclip f1922d95e1 test(runner): qualify the OpenCode discovery fixture on Linux (#17757)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Runner tests must exercise the same verified launch boundary as real
providers.
> - The assigned-tool test from #17740 used an executable JavaScript
script as its OpenCode fixture.
> - Linux launches verified executable bytes from a sealed, unlinked
memory file.
> - Node cannot reopen that deleted script path. Cleanup then hid the
startup error.
> - This pull request uses the native fixture wrapper already used by
the adjacent OpenCode integration test.

## Linked Issues or Issue Description

Refs #17740. Related fixture qualification work: #14529.

**What happened?**

The merged-source Cloud readiness job failed twice in the new
assigned-tool integration test. Linux could not start the script fixture
from the verified executable file. The later cleanup error hid the
original `ENOENT` error for `/memfd:paperclip-verified-launch
(deleted)`.

**Expected behavior**

The test must pass through the real Rust Runner, OpenCode proxy, and
HTTP MCP bridge on Linux. It must also report the original error if
cleanup fails.

**Steps to reproduce**

Run `vitest run src/live/runnerd-opencode-assigned-tools.test.ts` in the
Runner package with its Linux binary and built proxy. The original
fixture fails during startup. The native wrapper passes the
assigned-tool assertions and durable close.

## What Changed

- Launch the existing JavaScript server fixture through a native
wrapper.
- Qualify an owned Node copy on Linux with strict file permissions.
- Bundle the current production proxy into the test's temporary
directory. The test no longer skips when shared `dist` output is absent.
- Preserve both the original error and a cleanup error.
- Remove the temporary fixture even when setup fails.

## Verification

- Reproduced the failure in a local Linux container with the exact
merged Runner binary from the published Core image.
- The same Linux test passes after this change. It checks the assigned
discovery call, the completion call, and successful durable close.
- The updated test passes on macOS.
- A real Linux compiler-failure probe leaves zero fixture directories
behind.
- `pnpm -r typecheck` and `pnpm build`: passed.
- Runner TypeScript checks pass after the cleanup review change.
- Full technical CI passed on
`6ee1865af3310f13523b11407f9e41879832f543`.
- Fresh Greptile review: 5/5, with no unresolved findings.
- Fresh Paperclip Review published 5/5 on
`6ee1865af3310f13523b11407f9e41879832f543`, with no actionable findings.
- The optional Entire assessment remains pending because this branch has
no assessed Entire Change. The maintainer approved merging after CI and
both reviews pass.
- The full local test suite was not repeated. Earlier attempts hit host
PostgreSQL semaphore limits. CI provides the full suite check.

## Risks

Low risk. This changes one test fixture. Runtime behavior and launch
verification stay the same. The test now needs the C compiler already
required by the adjacent native fixture tests.

## Model Used

OpenAI Codex, GPT-6 family, with reasoning, tool use, and code
execution. The runtime does not expose the exact backend model ID or
context-window size.

## 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
#` 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>
canary/v2026.1026.0-canary.9
2026-10-26 14:36:22 -05:00
DottaandPaperclip 8c702d59db feat(evals): package a portable Runner controller runtime (#17506)
Package a verified portable Runner eval controller with complete bounded file receipts, copied dependency closure, private evidence replay and symlink-safe CLI entrypoints. Preserve fail-closed cost holds, native trace receipts and all parent security repairs.

Verified head: 1c892ff464.
Validation: 72 synthetic source/portable tests pass after current-master sync. Full current-head CI passed (40386180906); Greptile reviewed this exact head at5/5, with zero unresolved findings.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-26 14:32:46 -05:00
DottaandPaperclip 5061ab7b35 perf(ui): speed up task and inbox cold opens (#17756)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Task lists and inboxes are the main entry points to that work.
> - Cold opens fetch overlapping task lists, task descriptions, and run
details before useful rows settle.
> - Independent responses can insert rows above content that a person
has started to read.
> - This pull request loads a small task index first and adds details
only for visible rows.
> - It keeps row order and geometry stable while those details arrive.

## Linked Issues or Issue Description

**What existing behavior does this improve?**

Cold opens of Tasks and Inbox, including the shared navigation badge.

**Subsystem affected**

Server list reads, shared response contracts, and the React UI.

**Current behavior**

The badge fetches full task bodies. Mine fetches several overlapping
lists. Historical diagnostics and row metadata add work before the first
useful list. A fast failed-run response can appear before task rows,
then move down when tasks arrive.

**Proposed behavior**

Load the selected inbox source and its required context together. Use an
index without task descriptions or recovery diagnostics. Fetch
diagnostic details for up to 50 visible rows. Keep skeletons, recovery
indicators, external status, and live metadata in fixed space.

**Reason and benefit**

Reduce work on a cold open and prevent loading-induced row movement. On
the same 100 local fixture tasks, the compact response was 262,441
decoded bytes and the index was 110,909 bytes. This comparison excludes
compression and is not a page latency benchmark.

**Breaking changes**

Existing full and compact responses remain available. New index/row
projections are opt-in and marked as partial data. Mine keeps its
existing most-recent-100 display limit, now selected on the server.
Existing filters and group preferences remain in the client. No database
migration.

**Additional context**

Refs: #17593. Related: #13095, #17428, #13803. This change addresses
collection overfetch and layout stability. It does not replace the
blocked-inbox query work or the database activity-index work.

## What Changed

- Add authorized index and row projections, with bounded task and parent
ID batches.
- Replace badge list downloads with unread IDs and aggregate counts.
Preserve actor privacy, dismissals, and local archive behavior.
- Load only the selected inbox source, plus bounded parent and
failed-run context. Return only relevant failures from the bounded run
window.
- Batch hierarchy reads, including at most one authorized child per
collapsed parent in one request. Collapsed markers do not consume the
expanded row budget, and partial descendant counts are not shown as
totals. Enrich visible rows without replacing membership, ordering,
titles, or read state.
- Reserve row geometry on desktop and mobile. Reveal the initial inbox
only after its sources settle. Preserve legacy task-list reads.
- Start collection module downloads during access checks. Keep partial
rows out of the task-detail cache.
- Keep ETags and concurrent request sharing for the new projections, but
skip the short server response TTL so archive undo sees fresh state.

## Verification

- On final head `ef6afb2a56`, the full CI workflow passed, including
build, typecheck, server/workspace/runner suites, and all eight browser
shards. A server shard reported **1,489 passing tests** before runner
shutdown canceled the job; its single infrastructure retry passed. Both
Greptile and Paperclip Review are **5/5**, with zero unresolved review
threads.
- The optional external **Entire Gates** check remains `unassessed`
because it has no active assessed Change for this comparison. Entire is
not set up in this checkout. The repository ruleset requires `ci /
verify` and `ci / e2e`; both passed. No gate configuration was changed.

- Passed workspace typecheck after the final API batching change. The
full production build also passed on the final commit; the exact-retry
E2E run built the shipped UI.
- Passed token gates and map validation. The final batch-preview pass
has 91 passing route/hierarchy/component tests, including privacy,
request bounds, 30 collapsed parents in one read, and a 120-child parent
alongside a sibling.
- Passed the 166-test focused UI/inbox/badge run, 47 additional UI
regression tests, and 34 issue-list route tests. The latest regressions
cover low-trust agent badge IDs, cold company selection, 30
description-only Mine matches with archive actions, retrying optional
row details, and collapsed/expanded siblings.
- The full local `pnpm test:run` spanned the rebase and reported
failures in five suites before it was stopped; it is not claimed as a
complete pass. A fresh serial rerun of all five suites passed
**452/452** tests (tool gateway, native resume, project repositories,
workspace recovery, and runner selection). Full current-commit coverage
is checked by CI.
- Real browser: delayed index and row-detail responses on Tasks and
Mine. The first placeholder and first row had the same origin and
44-pixel height. Twelve rows on each page had zero position, height, or
title-width change after recovery details arrived.
- Real browser: reviewed long titles and recovery status at a 390 by 844
viewport. Task text stays on one line and recovery uses a compact
indicator.
- Three fresh document loads per page on final commit `260893bf92`, with
HTTP cache retained on a warm local development server: Tasks
1.031–1.190 seconds; Mine 0.999–1.193 seconds. Browser-control overhead
is included. These values must not be compared directly with staging
latency or the earlier local samples taken during a full test run.
- The browser archive test exposed stale results after Undo. The new
projections now bypass the server TTL; immediate-mutation regression
tests pass. The final browser retry passed: Archive followed by Undo
restored exactly one row and the badge count.

- CI exposed a hook-order crash when company selection resolved after
the first inbox render. The hook now runs before the empty-company
return. All seven affected exact-retry and legacy-continuation browser
scenarios pass locally after the fix.
- Real browser review regressions: 97 description-only source matches
retained Archive actions; deliberately failed optional row reads
displayed a retry notice while all 12 observed row positions and heights
stayed unchanged. Retry restored the recovery indicator. Network fault
injection was removed.

- The final production build and workspace typecheck passed. Final
focused verification passed 153 UI/helper tests and 26 heartbeat privacy
route tests. Final review regressions cover newer diagnostics arriving
during the index read, reloading diagnostics when the same task ID
changes version, optional source failure/retry without hiding available
rows, and required external-status filter failure. The latest-failures
route test verifies bounded selection, agent filtering, success
suppressing an older failure, and private-run redaction.
- Real browser: deliberately failed the run source, then retried it.
Twelve available task rows kept the same position and 44-pixel height
before, during, and after retry. No loading skeleton replaced them.
Fault injection was removed.
- Hierarchy review decision: the cold-open barrier stays because
inserting ancestors or expanded children after revealing index rows
would cause layout shifts. Existing hierarchy context now survives
subsequent requests, with a regression proving a new ancestor read does
not blank the list. The bounded recursive tree read can still add
latency for unusually deep expanded trees.

- Tasks now handles a failed external-status filter with an explicit
error and Retry, suppressing a false empty state. All 52 Tasks component
tests pass, including failure-to-success retry. One existing large-tree
test timed out while workspace typechecking ran concurrently; the whole
component suite passed when rerun without that competing work. Workspace
typecheck, the full production build, and token gates passed for this
fix.

## Risks

- Saved filters and grouping still operate on the existing bounded
collection. This is not a new global server pagination model.
- Fixed row slots reduce available title width. Long titles remain
accessible through task navigation.
- Recovery and related diagnostics arrive after core rows. Their
responses cannot replace ordering fields, and stale versions are
rejected.
- Index/row requests now revalidate against current data instead of a
short server TTL. They still share concurrent reads and use ETags.
- This has not been deployed by this pull request. Staging latency must
be measured after deployment under comparable conditions.

## Model Used

OpenAI Codex, GPT-6 family. The exact runtime model ID and
context-window size are not exposed in this session. Used code editing,
terminal execution, and real-browser diagnostics.

## 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-26 14:29:20 -05:00