mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-12 18:06:11 +02:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The Codex driver needs a controller-owned oracle for semantic completion and replay > - Provider proposals are advisory and must satisfy the exact task envelope > - Persisted events must be bounded and validated before deterministic replay > - Live provider behaviors also need one checked-in, schema-validated fixture > - This pull request adds that test and conformance layer before the full driver > - The runner adapter remains disabled and no production execution path changes ## Linked Issues or Issue Description **Subsystem affected** `packages/paperclip-runner` Codex trace, result-validation, and replay conformance. **Problem or motivation** A provider-completed turn is not sufficient authority to finalize a Paperclip run. Results must match the controller-owned completion contract, and persisted provider events must be validated before they can rebuild controller state. **Proposed solution** Add a bounded Codex trace harness that validates result proposals, emits controller decisions and terminals, verifies live/replay parity, and rejects malformed persisted streams. Add a validated fixture for runtime requests, goals, lineage, controls, reconnect identity, and redaction cases. **Alternatives considered** Embedding these assertions only in the production driver would mix controller authority with provider transport behavior and make deterministic replay harder to review. **Roadmap alignment** This supports the Codex-first experimental runner. It does not enable the runner adapter or add another provider. ## What Changed - Added exact task-envelope result validation. - Added bounded persisted-event validation and deterministic replay. - Added a controller-owned Codex trace harness and parity assertions. - Added and validated the checked-in Live console conformance fixture. - Updated the generated protocol manifest with the fixture source. - Added focused result and fixture tests. ## Verification - `pnpm --filter @paperclipai/paperclip-runner test:typescript` - `pnpm -r typecheck` - `pnpm build` - The focused trace-conformance test has 2 passing cases. ## Risks The main risks are accepting a mismatched semantic result or replaying corrupted provider history. Validation covers schema, contract revision, criteria identity, disposition invariants, event identity, uniqueness, ordering, terminal count, and byte limits. ## Model Used OpenAI Codex with GPT-5.6 and repository tool use. ## 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 - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge
112 lines
3.2 KiB
JSON
112 lines
3.2 KiB
JSON
{
|
|
"schema": "paperclip.runner.live-console.conformance.v1",
|
|
"codexVersion": "0.132.0",
|
|
"runtimeRequests": [
|
|
{
|
|
"id": "command-accept-session",
|
|
"method": "item/commandExecution/requestApproval",
|
|
"requestKind": "command_approval",
|
|
"resolution": { "action": "accept_for_session" },
|
|
"expectedResponse": { "decision": "acceptForSession" }
|
|
},
|
|
{
|
|
"id": "file-reject",
|
|
"method": "item/fileChange/requestApproval",
|
|
"requestKind": "file_approval",
|
|
"resolution": { "action": "decline" },
|
|
"expectedResponse": { "decision": "decline" }
|
|
},
|
|
{
|
|
"id": "permission-accept-turn",
|
|
"method": "item/permissions/requestApproval",
|
|
"requestKind": "permission_approval",
|
|
"resolution": { "action": "accept" },
|
|
"expectedResponse": { "permissions": {}, "scope": "turn" }
|
|
},
|
|
{
|
|
"id": "user-input-submit",
|
|
"method": "item/tool/requestUserInput",
|
|
"requestKind": "user_input",
|
|
"resolution": {
|
|
"action": "submit",
|
|
"answers": { "preferred_name": { "answers": ["Ada"] } }
|
|
},
|
|
"expectedResponse": {
|
|
"answers": { "preferred_name": { "answers": ["Ada"] } }
|
|
}
|
|
},
|
|
{
|
|
"id": "elicitation-cancel",
|
|
"method": "mcpServer/elicitation/request",
|
|
"requestKind": "elicitation",
|
|
"resolution": { "action": "cancel" },
|
|
"expectedResponse": { "action": "cancel", "content": null, "_meta": null }
|
|
}
|
|
],
|
|
"goals": [
|
|
{
|
|
"action": "get",
|
|
"method": "thread/goal/get",
|
|
"params": {}
|
|
},
|
|
{
|
|
"action": "set",
|
|
"method": "thread/goal/set",
|
|
"params": { "objective": "Ship the Live console tracer", "status": "active", "tokenBudget": 4096 }
|
|
},
|
|
{
|
|
"action": "pause",
|
|
"method": "thread/goal/set",
|
|
"params": { "status": "paused" }
|
|
},
|
|
{
|
|
"action": "resume",
|
|
"method": "thread/goal/set",
|
|
"params": { "status": "active" }
|
|
},
|
|
{
|
|
"action": "clear",
|
|
"method": "thread/goal/clear",
|
|
"params": {}
|
|
}
|
|
],
|
|
"lineage": {
|
|
"rootThreadId": "thread-root",
|
|
"childThread": {
|
|
"id": "thread-child",
|
|
"sessionId": "provider-session-1",
|
|
"source": {
|
|
"subAgent": {
|
|
"thread_spawn": {
|
|
"parent_thread_id": "thread-root",
|
|
"depth": 1,
|
|
"agent_path": ["researcher"],
|
|
"agent_nickname": "Scout",
|
|
"agent_role": "researcher"
|
|
}
|
|
}
|
|
},
|
|
"agentNickname": "Scout",
|
|
"agentRole": "researcher"
|
|
}
|
|
},
|
|
"controls": {
|
|
"sameTurnSteer": { "turnId": "turn-1", "expected": "acknowledged" },
|
|
"staleTurnSteer": { "turnId": "turn-stale", "expected": "stale_turn" },
|
|
"interruptBeforeStart": { "expected": "queued" },
|
|
"interruptAfterTerminal": { "expected": "already_terminal" }
|
|
},
|
|
"reconnect": {
|
|
"runId": "run-liveConsole",
|
|
"normalizedSessionId": "normalized-liveConsole",
|
|
"driverSessionId": "thread-root",
|
|
"providerSessionId": "provider-session-1",
|
|
"lastSourceSequence": 17
|
|
},
|
|
"redactionMarkers": [
|
|
"Bearer browser-secret",
|
|
"OPENAI_API_KEY=provider-secret",
|
|
"https://user:password@example.test/path?token=query-secret"
|
|
]
|
|
}
|