mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-23 17:33:51 +02:00
572bef4ba7679451ac1543db25cb8ebd533bf919
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2a5a323e57 |
Add execution-owned Runner launch preparation (#16997)
## Thinking Path > - Paperclip manages work for AI agents. > - Runner can execute in a different environment from Core. > - Core owns provider selection, policy, and resource assignments. > - The execution environment must prepare its own files and paths. > - A shared contract must keep these responsibilities separate. > - This PR adds that contract to the Runner execution driver. ## Linked Issues or Issue Description **Problem or motivation** Runner transport prepares provider files on the controller before launch. An execution owner cannot prepare those files in its own environment through the existing driver. **Proposed solution** Add `prepareLaunch` to the execution driver. Supply versioned Core requirements. Accept a configuration ID, requirements digest, and ordinary provider descriptor. Validate Core policy and assignments before launch. Keep existing provider session checks. **Alternatives considered** Provider-specific ownership flags would spread the boundary across backends. Shell preparation would expose process details in the plugin API. Refs #16993, #16977. Both prerequisites are merged. This PR now targets master. Native plugin integration and execution-host preparation follow separately. PR #16978 contains an earlier, unmerged prototype. Its `persistentAgentHome` mode and skill path-map call will be replaced by this preparation contract before activation. This PR preserves current master callers of the skill helper. ## What Changed - Add the optional preparation callback and an explicit Runner artifact identity. - Keep the built-in preparation path as the default. - Validate provider policy and resource assignment identity. Preserve instruction text when resource locations change. - Persist the attachment seed after an authority epoch rotation, so a later controller restart can recover the same run. - Preserve explicit context removal on a new run. Only an omitted context can reuse the saved context. Remove its registered instruction framing when context is removed. - Save exact requirements and configurations in a private file outside Runner commands. Retain the active record across failed attachments. Use current grants for new runs. Keep incompatible session changes rejected. - Join delayed preparation during startup and warm attachment cleanup. Retain an unsettled checkpoint after a timeout. Prevent work after cancellation. - Use the supplied Runner artifact for interrupted handoff recovery. Restore the exact target configuration at each handoff crash boundary. Check the Runner state when the final ACK may be lost. - Bind the changed shared sources to Copilot profile v51. Preserve the v50 receipt and current integrity checks. ## Verification - Workspace typecheck passed. - All 487 affected Runner transport, control-plane, preparation store, builder, policy, and profile tests passed on commit `eaf8ae8d1`. - Workspace build and typecheck passed again on commit `eaf8ae8d12c7ef2d22d226e4b3f05fdbf79ef4cb`. - Both warm attachment cleanup regressions fail before the fix. They pass after the fix. The tests cover delayed preparation, timeout retention, and concurrent attachment rejection. - The routed handoff regression fails with a missing controller binary before the fix. It passes after the fix. The execution owner launches the real fixture Runner. - The 200,000-byte instruction regression fails before the fix and passes after it. Four prepared handoff crash cases verify exact request and configuration recovery. The store tests verify private file mode, conflicting records, corrupt data, and active-run retention. - A real Runner with a controlled fake provider verifies execution-host paths, exact recovery, warm reuse, incompatible profile rejection, and cancellation. It does not contact an external provider. - The regression found undefined settings in strict PRP command hashing. Requirements now contain only JSON values. The warm transition test passes without changing PRP validation. - The broader root suite on the prerequisite finished with 22,420 passing tests, seven failed tests in unchanged Git and diagnostic code, and two suite setup errors because Cargo was absent from its PATH. This PR does not claim a passing full root suite. - The CI Build job passed compilation and production runtime boot, then its runner received a shutdown signal during the clean public install check. Other jobs reported lost communication with their self-hosted runners. The failed jobs passed on retry on the same commit; successful jobs kept their results. - The current Superagent security scan is inconclusive because its pinned merge-base checkout failed or timed out. GitHub rejected the check rerun request through the available API. This is not a passing security scan. - Standard Greptile and Greptile Apex each returned 5/5 on `eaf8ae8d1`. All review threads are resolved. CI passed on attempt 2. Current checks have 55 successes, four optional skips, and the inconclusive security scan described above. The branch is ready, mergeable, and current with master. - No live provider qualification or deployment was run. ## Risks - A preparation owner must store configurations and keep retries bound to the same task and requirements. - Copilot source binding requires a new profile identity. This PR does not claim fresh live qualification. - The callback is an SDK extension. This PR does not connect it to a plugin task process owner or add a Launcher endpoint. ## Model Used - OpenAI Codex, GPT-6. Reasoning and repository tools. The exact serving model identifier and context size are not exposed in this session. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
05f7079ecb |
Extract Runner provider launch preparation (#16977)
## Thinking Path > - Paperclip manages work for AI agents. > - Runner starts providers in local and remote environments. > - Core selects the provider and task policy. > - The execution environment supplies paths and installed files. > - The transport currently combines these inputs in one large method. > - This PR extracts provider descriptor construction before a separate plugin preparation change. ## Linked Issues or Issue Description **What existing behavior does this improve?** Runner provider launch preparation. **Current behavior** The PRP transport constructs each provider descriptor inside startup. This couples provider configuration to transport lifecycle code. **Proposed behavior** The transport calls one built-in descriptor builder. The builder takes Core provider requirements and execution-environment locations as separate inputs. File staging, provider validation logic, and session rules keep their current behavior. The required Copilot source-identity update changes profile admission metadata. **Reason and benefit** This gives launch preparation a separate unit of code. A later PR can add plugin-owned preparation without adding ownership flags to each provider backend. Refs #15406, #16486. This replaces the earlier installed-home implementation in this PR. #16978 remains a draft. ## What Changed - Extract provider descriptor construction and its existing permission helpers. - Keep helper exports at their previous import path. - Add focused tests for selection, permissions, locations, and managed profile rejection. - Update the Copilot source identity. Bind the extracted file and retain the v49 history. The source attestation requires v50 after this move. This changes the admitted profile identity even though no execution behavior changes are intended. - Document the boundary and its current limits. ## Verification - 338 focused builder, transport, Codex security, and Copilot identity tests passed on the rebased head. - `pnpm -r typecheck` passed. `pnpm build` passed. - The full root `pnpm test:run` on the pre-rebase head is still in progress. It has reported five failures in unchanged server tests. One isolated failure rejects the word `private` from this checkout's `/private/tmp` stack path. The full root suite is not reported as passing. - All 56 CI checks passed on the rebased head. Four optional checks were skipped. The branch is mergeable. Workspace typecheck and build passed on this head. - Standard Greptile and Apex each scored commit `47f631883d8f417f6a818500ebe4e77e22cc70b8` 5/5. The rebase onto master changed only Copilot identity metadata, history handling, and related tests. `git range-diff` confirms that the launch-preparation implementation is unchanged. The existing Apex result remains the review evidence; it did not review the new commit hash. - No live provider calls or Cloud deployment were run. ## Risks - A moved field could change provider startup. Existing transport tests and the new boundary tests check the projection. - Copilot source binding requires a new identity after the move. Existing artifacts and retained sessions must match the new admitted profile. This PR does not claim fresh live qualification. - This PR does not enable plugin-owned preparation. File materialization remains in the existing SDK path. ## Model Used - OpenAI Codex, GPT-6. Reasoning and repository tools. The exact serving model identifier and context size are not exposed in this session. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge Co-authored-by: Paperclip <noreply@paperclip.ing> |