Files
PaperClipAI/scripts/serialized-shard-durations.json
T
DottaandPaperclip e40de0c9e8 perf(ci): refresh test weights and narrow graph dependencies (#18464)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Contributors need fast, reliable CI feedback.
> - Diff-aware CI selects test files and partitions them into runner
jobs.
> - Stale cost estimates put several slow suites on the same runner.
Broad imports also couple small tests to large modules.
> - This PR refreshes test costs, runs independent graph discovery in
parallel, and narrows three dependency boundaries.
> - Selection safeguards and CODEOWNER-only AWS routing stay in force.

## Linked Issues or Issue Description

Refs #18398. This follows the audit of [PR #18427's verification
run](https://github.com/paperclipai/paperclip/actions/runs/41169978784).

The audit found 403 selected general-server files without timing
weights. Three suites measured at 232s, 122s and 116s shared one shard
because each received a roughly 2s fallback weight. Local graph
discovery across four projects took 43.7s serially and 21.7s with two
workers. A reverse-order repeat took 37.7s serially and 22.6s with two
workers. Both comparisons produced identical selection results. This is
a local measurement, not a claim about production CI speed.

## What Changed

- Refresh general-server costs for 1,285 of 1,309 current files and
serialized costs for all 163 files from two successful protected-master
Cloud readiness runs. Retain prior costs for unmeasured files, including
dedicated chat and native-runner suites.
- Record passing server file costs, including collection, setup and
environment preparation. A weekly hosted workflow validates trusted
source runs and opens a timing-only PR. It tests shard coverage, pauses
while a refresh PR is open, and never merges automatically.
- Discover at most two project graphs concurrently in isolated,
heap-limited Node processes. Cache repeated inventory reads within one
selection. Worker errors and timeouts retain the full task plan.
- Fetch only the merge commit and parents for the selector. A real
shallow-clone regression proves the complete diff still includes more
than 300 files, renames and deletions.
- Share the identical log viewer and run details between both
AgentDetail pages. The viewer test imports the shared implementation and
runs each of its 13 distinct cases once.
- Extract the pure API error class while preserving the API client's
public exports. Import delivery work signals through their existing
narrow DB export.

## Verification

- PASS: `pnpm -r typecheck` and `pnpm build`.
- PASS: 284 CI selection, timing, shallow-diff, sharding and routing
tests.
- PASS: 74 further cache, routing and graph-proof tests.
- PASS: 94 targeted UI assertions across the viewer, run invocation, API
errors/client and progress helpers. All 76 assertions in the 12 server
suites made independently selectable also pass.
- PASS: `pnpm check:token-gates`, module-boundary checks, YAML parsing
and `git diff --check`.
- PASS: [Full PR CI and required `ci / verify`
aggregate](https://github.com/paperclipai/paperclip/actions/runs/41206683345),
including all 12 general-server shards, all nine serialized shards,
workspace groups, chat suites, Runner lanes and build checks.
- PASS: [GitHub hosted real-workspace selector and cache/routing
qualification](https://github.com/paperclipai/paperclip/actions/runs/41206683205).
- PASS: Both Greptile and Paperclip reviews are 5/5 with no actionable
findings or inline comments on `7dc65c51b8`. The PR has no merge
conflicts.
- PASS: The production refresh parser accepted all 107 structured
file-cost records from a real successful server CI job, including
setup/loading cost.
- Local `pnpm test:run` completed all six chat shards successfully. The
duplicate monolithic local run was stopped after the complete remote
suite passed; it was not completed locally.

The focused log-viewer command improved from 18.84s (26 duplicate
variant cases) to 8.49s (all 13 distinct behavior cases). The dependency
audit confirms 12 server files and the API-error test no longer need
conservative always-run retention. Repartitioning the audited PR with
the new costs changes the slowest shard from 810s to 591s of summed
historical test execution (1,124 of 1,142 files measured). This is a
workload simulation, not measured new CI wall time.

## Risks

- Two graph processes use more peak memory. Each has a 2 GiB heap limit
and a three-minute timeout. Any failure preserves the original task
plan. Real workspace qualification runs in GitHub CI.
- Historical logs contain test/hook costs only. New reporter records add
loading/setup costs after merge. The manifests identify measurement
coverage and source runs. These weights change placement, never
permission to skip tests.
- Runner load adds timing noise. The refresh uses medians and requires
at least 90% measurement coverage in each lane.
- GitHub may require approval to run checks on a PR created with
`GITHUB_TOKEN`. Refreshes remain reviewable and do not merge themselves.
- The shared viewer is a mechanical extraction. Both pages retain their
existing exports, and the behavior assertions remain covered. AWS runner
authorization is unchanged.

## Model Used

OpenAI Codex, GPT-6, with repository inspection, reasoning, code
execution and GitHub tools. The exact deployment ID and context-window
size were 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 references)
- [x] My branch name describes the change and contains no internal
Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass (focused checks and six
chat shards; complete suite passed in CI as detailed above)
- [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-31 11:05:12 -05:00

189 lines
12 KiB
JSON

{
"$comment": "Generated by node scripts/ci/refresh-test-durations.mjs from successful protected-master Cloud readiness runs. Median per-file cost includes tests, hooks, collection, setup and environment preparation when the timing reporter is present; older logs bootstrap test/hook durations only. Missing files retain their prior weight or the partitioner's median fallback. Timing changes only partition work; they never authorize skipping a test.",
"unit": "ms",
"sources": [
{
"run": 41202111422,
"attempt": 1,
"sha": "c2971badde04b602fa9fe698015e1f3653b39e6b",
"url": "https://github.com/paperclipai/paperclip/actions/runs/41202111422"
},
{
"run": 41201965500,
"attempt": 1,
"sha": "d5766e40748ac5881c4b9879fad1d5a61d9b493d",
"url": "https://github.com/paperclipai/paperclip/actions/runs/41201965500"
}
],
"coverage": {
"measured": 163,
"withSetup": 0,
"inventory": 163
},
"durations": {
"server/src/__tests__/access-routes-hidden-floor.test.ts": 4202,
"server/src/__tests__/access-routes-permissions-upgrade.test.ts": 3661,
"server/src/__tests__/activity-routes.test.ts": 15018,
"server/src/__tests__/adapter-auth-signal-routes.test.ts": 14386,
"server/src/__tests__/adapter-model-refresh-routes.test.ts": 7225,
"server/src/__tests__/adapter-routes-authz.test.ts": 13466,
"server/src/__tests__/adapter-routes.test.ts": 3359,
"server/src/__tests__/agent-action-audit-routes.test.ts": 4488,
"server/src/__tests__/agent-adapter-validation-routes.test.ts": 77234,
"server/src/__tests__/agent-cross-tenant-authz-routes.test.ts": 4565,
"server/src/__tests__/agent-device-login-routes.test.ts": 4861,
"server/src/__tests__/agent-hire-auth-inheritance-routes.test.ts": 3045,
"server/src/__tests__/agent-hire-idempotency-routes.test.ts": 1271,
"server/src/__tests__/agent-instructions-routes.test.ts": 3836,
"server/src/__tests__/agent-live-run-routes.test.ts": 69136,
"server/src/__tests__/agent-permissions-routes.test.ts": 3946,
"server/src/__tests__/agent-runner-qualification-routes.test.ts": 1009,
"server/src/__tests__/agent-secrets-routes.test.ts": 1104,
"server/src/__tests__/agent-skills-routes.test.ts": 4859,
"server/src/__tests__/agent-test-environment-routes.test.ts": 6760,
"server/src/__tests__/ai-connection-router.test.ts": 19925,
"server/src/__tests__/announcements-routes.test.ts": 626,
"server/src/__tests__/approval-routes-idempotency.test.ts": 3352,
"server/src/__tests__/artifact-review-document-routes.test.ts": 7798,
"server/src/__tests__/assets.test.ts": 8543,
"server/src/__tests__/auth-routes.test.ts": 100,
"server/src/__tests__/auth-session-route.test.ts": 100,
"server/src/__tests__/authz-company-access.test.ts": 100,
"server/src/__tests__/authz-existence-oracle-guard.test.ts": 100,
"server/src/__tests__/authz-secret-context.test.ts": 100,
"server/src/__tests__/board-chat-route-feature-flag.test.ts": 895,
"server/src/__tests__/bootstrap-claim-routes.test.ts": 100,
"server/src/__tests__/browser-use-route-scope.test.ts": 136,
"server/src/__tests__/built-in-agent-routes.test.ts": 6740,
"server/src/__tests__/cases-routes.test.ts": 4496,
"server/src/__tests__/cli-auth-routes.test.ts": 17331,
"server/src/__tests__/cloud-routes.test.ts": 100,
"server/src/__tests__/companies-route-cross-company-authz.test.ts": 11340,
"server/src/__tests__/companies-route-path-guard.test.ts": 100,
"server/src/__tests__/company-branding-route.test.ts": 4804,
"server/src/__tests__/company-import-transfer-routes.test.ts": 1428,
"server/src/__tests__/company-portability-routes.test.ts": 2672,
"server/src/__tests__/company-portability.test.ts": 1315,
"server/src/__tests__/company-search-extract-routes.test.ts": 115,
"server/src/__tests__/company-search-rate-limit-routes.test.ts": 100,
"server/src/__tests__/company-skill-policy-routes.test.ts": 626,
"server/src/__tests__/company-skills-import-authz-routes.test.ts": 1524,
"server/src/__tests__/company-skills-routes.test.ts": 3409,
"server/src/__tests__/company-user-directory-route.test.ts": 100,
"server/src/__tests__/cost-data-quality-routes.test.ts": 100,
"server/src/__tests__/costs-service.test.ts": 1070,
"server/src/__tests__/decision-queues-routes.test.ts": 2092,
"server/src/__tests__/document-annotation-routes.test.ts": 8418,
"server/src/__tests__/email-routes-provider-errors.test.ts": 100,
"server/src/__tests__/environment-custom-image-routes.test.ts": 100,
"server/src/__tests__/environment-instance-routes.test.ts": 100,
"server/src/__tests__/environment-routes.test.ts": 198,
"server/src/__tests__/environment-selection-route-guards.test.ts": 119,
"server/src/__tests__/execution-workspace-runtime-lease-route.test.ts": 2694,
"server/src/__tests__/execution-workspaces-routes.test.ts": 100,
"server/src/__tests__/express5-auth-wildcard.test.ts": 100,
"server/src/__tests__/external-object-routes.test.ts": 4096,
"server/src/__tests__/folders-routes.test.ts": 1358,
"server/src/__tests__/health-dev-server-token.test.ts": 104,
"server/src/__tests__/health.test.ts": 100,
"server/src/__tests__/heartbeat-dependency-scheduling.test.ts": 27885,
"server/src/__tests__/heartbeat-issue-liveness-escalation.test.ts": 47816,
"server/src/__tests__/heartbeat-process-recovery.test.ts": 324638,
"server/src/__tests__/heartbeat-run-privacy-routes.test.ts": 4967,
"server/src/__tests__/inbox-agent-policy-routes.test.ts": 831,
"server/src/__tests__/inbox-archive-routes.test.ts": 2794,
"server/src/__tests__/instance-database-backups-routes.test.ts": 100,
"server/src/__tests__/instance-settings-routes.test.ts": 3161,
"server/src/__tests__/invite-accept-existing-member.test.ts": 100,
"server/src/__tests__/invite-accept-gateway-defaults.test.ts": 584,
"server/src/__tests__/invite-accept-replay.test.ts": 100,
"server/src/__tests__/invite-create-route.test.ts": 7648,
"server/src/__tests__/invite-expiry.test.ts": 100,
"server/src/__tests__/invite-join-manager.test.ts": 100,
"server/src/__tests__/invite-list-route.test.ts": 457,
"server/src/__tests__/invite-logo-route.test.ts": 100,
"server/src/__tests__/invite-onboarding-text.test.ts": 100,
"server/src/__tests__/invite-rate-limit-route.test.ts": 5390,
"server/src/__tests__/invite-summary-route.test.ts": 6262,
"server/src/__tests__/invite-test-resolution-route.test.ts": 4135,
"server/src/__tests__/invite-url-public-base-url.test.ts": 4075,
"server/src/__tests__/issue-access-grants-routes.test.ts": 4910,
"server/src/__tests__/issue-activity-events-routes.test.ts": 9271,
"server/src/__tests__/issue-agent-mutation-ownership-routes.test.ts": 9524,
"server/src/__tests__/issue-assigned-backlog-contract-routes.test.ts": 4067,
"server/src/__tests__/issue-assignee-invokability-routes.test.ts": 125,
"server/src/__tests__/issue-attachment-routes.test.ts": 4226,
"server/src/__tests__/issue-blocker-diagnostics-routes.test.ts": 1268,
"server/src/__tests__/issue-closed-workspace-routes.test.ts": 4032,
"server/src/__tests__/issue-comment-attribution-audit-routes.test.ts": 4466,
"server/src/__tests__/issue-comment-cancel-routes.test.ts": 3762,
"server/src/__tests__/issue-comment-reopen-routes.test.ts": 501,
"server/src/__tests__/issue-create-deduplication-routes.test.ts": 1646,
"server/src/__tests__/issue-created-from-routes.test.ts": 828,
"server/src/__tests__/issue-creation-source-routes.test.ts": 1836,
"server/src/__tests__/issue-dependency-wakeups-routes.test.ts": 8947,
"server/src/__tests__/issue-document-restore-routes.test.ts": 7787,
"server/src/__tests__/issue-execution-policy-routes.test.ts": 3678,
"server/src/__tests__/issue-feedback-routes.test.ts": 3786,
"server/src/__tests__/issue-identifier-routes.test.ts": 622,
"server/src/__tests__/issue-list-assignee-filter-routes.test.ts": 6773,
"server/src/__tests__/issue-list-updatedsince-filter-routes.test.ts": 772,
"server/src/__tests__/issue-onboarding-first-task-routes.test.ts": 6124,
"server/src/__tests__/issue-queued-comments-routes.test.ts": 47964,
"server/src/__tests__/issue-scheduled-retry-routes.test.ts": 7804,
"server/src/__tests__/issue-stale-execution-lock-routes.test.ts": 2222,
"server/src/__tests__/issue-stalled-review-decision-routes.test.ts": 2218,
"server/src/__tests__/issue-status-version-route-service.test.ts": 881,
"server/src/__tests__/issue-subtree-diagnostics-routes.test.ts": 1299,
"server/src/__tests__/issue-summaries-routes.test.ts": 832,
"server/src/__tests__/issue-telemetry-routes.test.ts": 4919,
"server/src/__tests__/issue-thread-interaction-routes.test.ts": 14647,
"server/src/__tests__/issue-tree-control-routes.test.ts": 1004,
"server/src/__tests__/issue-update-comment-wakeup-routes.test.ts": 4204,
"server/src/__tests__/issue-wake-diagnostics-routes.test.ts": 1493,
"server/src/__tests__/issue-watchdogs-routes.test.ts": 6085,
"server/src/__tests__/issue-workspace-command-authz.test.ts": 4361,
"server/src/__tests__/issues-checkout-wakeup.test.ts": 100,
"server/src/__tests__/issues-goal-context-routes.test.ts": 100,
"server/src/__tests__/issues-service.test.ts": 14248,
"server/src/__tests__/llms-routes.test.ts": 1700,
"server/src/__tests__/low-trust-red-team-routes.test.ts": 21637,
"server/src/__tests__/managed-agent-profile-routes-authz.test.ts": 100,
"server/src/__tests__/multilingual-issues-routes.test.ts": 990,
"server/src/__tests__/muse-qualification-routes.test.ts": 100,
"server/src/__tests__/onboarding-seed-route.test.ts": 2184,
"server/src/__tests__/openapi-routes.test.ts": 808,
"server/src/__tests__/openclaw-invite-prompt-route.test.ts": 100,
"server/src/__tests__/opencode-local-adapter-environment.test.ts": 6051,
"server/src/__tests__/openrouter-attribution.test.ts": 100,
"server/src/__tests__/permissions-upgrade-boundary-routes.test.ts": 1292,
"server/src/__tests__/plugin-install-route-security.test.ts": 3548,
"server/src/__tests__/plugin-routes-authz.test.ts": 3421,
"server/src/__tests__/plugin-scoped-api-routes.test.ts": 2549,
"server/src/__tests__/project-goal-telemetry-routes.test.ts": 3418,
"server/src/__tests__/project-routes-env.test.ts": 4210,
"server/src/__tests__/project-workspace-managed-sandbox-routes.test.ts": 6883,
"server/src/__tests__/projects-list-archived-routes.test.ts": 1152,
"server/src/__tests__/redaction.test.ts": 100,
"server/src/__tests__/resource-memberships-routes.test.ts": 1629,
"server/src/__tests__/routine-document-annotation-routes.test.ts": 2027,
"server/src/__tests__/routines-e2e.test.ts": 17403,
"server/src/__tests__/routines-routes.test.ts": 6826,
"server/src/__tests__/secret-proposals-routes.test.ts": 9151,
"server/src/__tests__/secrets-routes-claude-oauth-service.test.ts": 1360,
"server/src/__tests__/secrets-routes.test.ts": 198,
"server/src/__tests__/sidebar-preferences-routes.test.ts": 3043,
"server/src/__tests__/subscription-routes.test.ts": 100,
"server/src/__tests__/summary-slot-routes.test.ts": 5832,
"server/src/__tests__/task-connector-read-routes.test.ts": 122,
"server/src/__tests__/task-title-routes.test.ts": 4602,
"server/src/__tests__/teams-catalog-routes.test.ts": 3849,
"server/src/__tests__/user-profile-routes.test.ts": 1209,
"server/src/__tests__/workspace-command-authz.test.ts": 100,
"server/src/__tests__/workspace-preferences-routes.test.ts": 100,
"server/src/__tests__/workspace-restore-repair-route.test.ts": 1666,
"server/src/__tests__/workspace-runtime-routes-authz.test.ts": 3430,
"server/src/__tests__/workspace-runtime-service-authz.test.ts": 926
}
}