mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-30 05:16:50 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Product E2E journeys verify saved application behavior across deployments. > - Task creation and questions need reusable smoke selections and exact run attribution. > - Operators also need to inspect the OpenCode execution behind a measured question. > - Company observability does not currently support native OpenCode. > - This change adds the journeys and a bounded projection of normalized OpenCode run events. > - The projection follows the configured capture policy and retains the current run identity across warm reuse. ## Linked Issues or Issue Description Related foundation: #17262. Related alternative: #17989 exports metadata from OpenCode's native OTLP stream. This change uses normalized run events to support the existing content switches and per-run linkage. It does not forward the native stream. The two PRs overlap in launch registration and must be reconciled before both land. **What existing behavior does this improve?** Reusable Product E2E smoke selections and company observability for native OpenCode. **Current behavior** The journey catalog lacks reusable task creation and attached-agent question checks. Native OpenCode is marked unsupported for company observability, so a successful destination connection test does not prove that agent traces will appear. **Proposed behavior** Add explicit task-create and ask-question selections. Verify saved state and exact company, issue, agent, model, environment and successful run attribution. Export normalized OpenCode turns, tools and usage to the configured OTLP destination. Honor each capture switch and redact known secrets. **Reason and benefit** CI can run a small measured smoke selection, retain its screenshots and checks, and link results to traces belonging to the same run. **Breaking changes** Existing selectors remain unchanged. OpenCode export is opt-in through existing company settings. Legacy OpenCode stays unsupported. ## What Changed - Add reusable task creation and question journeys, configured-agent capability, owned-fixture checkpoints and strict evidence validation. - Add an OpenCode-owned projection of normalized run events. No provider SDK or raw payload schema enters heartbeat coordination. - Extend the private launch union and reserved environment allowlist for native OpenCode. With export disabled, no receiver request runs. - Keep destination headers in the parent wrapper and out of the actual provider child environment and configuration. - Bound each turn to 64 tool and 64 usage entries, 8 KiB per text field and a 1 MiB request. Use a three-second request deadline, four concurrent exports, and no retries or idle worker. - Pass the rotated runner authority to each proxy turn. A retained process no longer attributes later turns to its original launch run. - Update settings copy, observability documentation and capability maps. ## Verification - `pnpm -r typecheck` and `pnpm build` passed after the implementation changes. - Adapter launch/redaction: 9 tests passed. Projection and actual proxy: 12 tests passed before the review fix; the expanded projection suite passed all 12 cases after the fix. The proxy test exercises two runs in one process against a real local HTTP receiver and a fake provider. - Full OpenCode driver/projection suite: 72 passed, one existing response_wake test timed out at five seconds. A focused check then passed both existing omitted-continuation cases and the new trace export case. The timeout cause remains unconfirmed. - Runner package TypeScript and Rust `cargo check` passed. Map and UI token checks passed. - Prior journey validation: 273 tests across 12 files and the journey TypeScript check passed. - Broad local `pnpm test:run` encountered native-runtime integration failures with repeated embedded PostgreSQL initialization failures and was stopped. All 16 failing cases passed in an isolated run outside the filesystem sandbox (961 unrelated cases unselected). The broad local run is not a clean acceptance result. A later focused database-backed chat/heartbeat run passed all six selected observability cases, including native OpenCode launch and successful allocation (1,809 unrelated cases were unselected). - All CI gates passed for `21085f880d8babc9efeb22d0623db99613d33093`, including packaged-runner, clean-install, browser and build checks: https://github.com/paperclipai/paperclip/actions/runs/40884658995 . Greptile reviewed the same commit at 5/5 with no unresolved findings. - Verified OTLP JSON acceptance and indexing with an explicitly synthetic transport marker. No live OpenCode model trace or deployed smoke acceptance is claimed yet. ## Risks Export is best effort. Abrupt termination, recovered in-flight turns without a new submitted event, limits or receiver failure can lose traces. Export failure does not change task success. The projection represents observed normalized events, not raw native model spans or hidden reasoning. Known-secret redaction is not an OS isolation boundary. UI changes can break journey locators. Deployment adapters retain credential, ownership and cleanup responsibility. Both the controller and native runner bundle must be updated before live qualification. ## Model Used OpenAI Codex, GPT-6, with reasoning, code execution and browser tools. The exact serving model ID and context size are not exposed to 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 (targeted suites; broad local limitation documented 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>
123 lines
6.9 KiB
TypeScript
123 lines
6.9 KiB
TypeScript
import { fileURLToPath } from "node:url";
|
|
import { featureIndex } from "../../scripts/feature-map.mjs";
|
|
import type { ReportExecution } from "./report-catalog.js";
|
|
|
|
export const journeyFeatureMap = featureIndex(fileURLToPath(new URL("../../", import.meta.url)));
|
|
export const journeyFeatures = journeyFeatureMap.sections.flatMap((section) =>
|
|
section.features.map((feature) => ({ ...feature, section: section.title })),
|
|
);
|
|
const capabilities = new Map(journeyFeatures.flatMap((feature) =>
|
|
feature.capabilities.map((capability) => [capability.id, { ...capability, feature }] as const),
|
|
));
|
|
const associations = new Map<string, readonly string[]>();
|
|
|
|
function associate(suites: readonly string[], cases: Record<string, readonly string[]>) {
|
|
for (const [caseId, ids] of Object.entries(cases)) {
|
|
for (const id of ids) if (!capabilities.has(id)) throw new Error(`Unknown journey capability: ${id}`);
|
|
for (const suite of suites) associations.set(`${suite}/${caseId}`, ids);
|
|
}
|
|
}
|
|
|
|
associate(["product-journeys"], { "task-create": ["tasks/create"], "ask-question": ["questions-and-approvals/questions"],
|
|
"task-properties": ["tasks/properties"], "cloud-onboarding": ["onboarding/first-task"] });
|
|
associate(["core-compatibility", "openrouter-model-breadth", "extended-harnesses", "grok-qualification", "grok-subscription-qualification"], {
|
|
"message-marker": ["runs-adapters/runs"],
|
|
"hello-complete": ["runs-adapters/runs"],
|
|
"plan-revise-accept": ["questions-and-approvals/plan-review"],
|
|
"plan-approve-complete": ["questions-and-approvals/plan-review"],
|
|
"ask-question": ["questions-and-approvals/questions"],
|
|
"question-resume-complete": ["questions-and-approvals/questions", "questions-and-approvals/continuation"],
|
|
});
|
|
associate(["local-session-integrity", "extended-harnesses", "grok-qualification", "grok-subscription-qualification"], {
|
|
"structured-question-resume": ["questions-and-approvals/continuation", "runs-adapters/session"],
|
|
"structured-question-restart-resume": ["questions-and-approvals/continuation", "runs-adapters/session"],
|
|
});
|
|
associate(["question-resume"], {
|
|
"question-answer-resume": ["questions-and-approvals/questions", "questions-and-approvals/continuation"],
|
|
});
|
|
associate(["feedback-persistence"], {
|
|
"complaint-and-suggestion": ["activity/agent-commentary"],
|
|
});
|
|
associate(["continuation"], {
|
|
"answer-updates-scope": ["questions-and-approvals/questions", "questions-and-approvals/continuation"],
|
|
"clarification-not-approval": ["questions-and-approvals/questions", "questions-and-approvals/confirmations"],
|
|
"revision-preserves-approval": ["questions-and-approvals/plan-review"],
|
|
"completed-action-resume": ["questions-and-approvals/continuation"],
|
|
"question-tool-documentation": ["questions-and-approvals/questions"],
|
|
"provider-question-bridge": ["questions-and-approvals/questions", "questions-and-approvals/continuation"],
|
|
});
|
|
associate(["first-task", "confirmation-replies", "completion-updates"], Object.fromEntries([
|
|
"interview-first-response", "clear-task-first-response", "ambiguous-task-first-response",
|
|
"plain-message-first-response", "plan-first-response", "interview-plan-accept",
|
|
"task-card-accept", "accept-while-running", "task-reply-accept", "clarify-propose-accept",
|
|
"revise-accept", "reject-no-execution",
|
|
].map((id) => [id, ["onboarding/first-task"]])));
|
|
associate(["first-task"], { "ordinary-task-control": ["tasks/completion"] });
|
|
associate(["confirmation-replies"], {
|
|
"confirmation-ambiguous": ["questions-and-approvals/confirmations", "questions-and-approvals/audience"],
|
|
"unanswered-question-return": ["questions-and-approvals/dismiss-and-reopen", "questions-and-approvals/continuation"],
|
|
});
|
|
associate(["agent-chat", "agent-chat-hardening", "grok-qualification", "grok-subscription-qualification", "stock-harness"], {
|
|
"create-backlog": ["tasks/create"],
|
|
"reassign-task": ["tasks/properties"],
|
|
"continuity-restart": ["agent-chat/history", "runs-adapters/session"],
|
|
"new-session": ["agent-chat/history", "runs-adapters/session"],
|
|
"stop-new-resume": ["steering/stop-and-pause", "runs-adapters/session"],
|
|
"stop-startup-new-resume": ["steering/stop-and-pause", "runs-adapters/session"],
|
|
"plan-handoff": ["agent-chat/handoff", "questions-and-approvals/plan-review"],
|
|
"clarify-reuse": ["projects/task-context"],
|
|
"multi-repository": ["projects/repositories"],
|
|
"hire-delegate-reuse": ["agents/hire", "task-coordination/delegation"],
|
|
"committed-send-retry": ["recovery/unknown-outcome"],
|
|
});
|
|
associate(["agent-chat-qualification"], {
|
|
"active-reassignment": ["tasks/properties"],
|
|
"worker-crash-retry": ["recovery/source-action"],
|
|
});
|
|
associate(["agent-chat-stories"], {
|
|
"enable-disable-resume": ["agent-chat/history"],
|
|
"followup-while-running": ["steering/queue"],
|
|
"revise-while-running": ["steering/steer"],
|
|
});
|
|
associate(["completion-updates"], Object.fromEntries([
|
|
"handoff-completion-idle", "handoff-completion-busy", "handoff-completion-multiple", "handoff-completion-restart",
|
|
].map((id) => [id, ["agent-chat/handoff", "tasks/completion"]])));
|
|
associate(["everyday-workflows", "native-connection-guidance", "grok-qualification", "grok-subscription-qualification"], {
|
|
"build-revise": ["documents-artifacts/work-products"],
|
|
"delegate-feedback": ["task-coordination/delegation", "steering/steer"],
|
|
"agent-review-handoff": ["task-coordination/signoff"],
|
|
"hire-reuse": ["agents/hire", "task-coordination/delegation"],
|
|
"service-approve": ["questions-and-approvals/tool-review", "app-permissions/action-policy"],
|
|
"service-decline": ["questions-and-approvals/tool-review", "app-permissions/action-policy"],
|
|
"connection-decline": ["connection-setup/task-request"],
|
|
"provider-decline": ["connection-setup/task-request"],
|
|
"provider-second": ["connection-setup/task-request"],
|
|
"provider-native": ["connection-setup/task-request"],
|
|
"agentmail-setup": ["connection-setup/task-request"],
|
|
"recover-controller": ["recovery/user-continuation", "documents-artifacts/work-products"],
|
|
"stop-redirect": ["steering/stop-and-pause"],
|
|
"create-skill-studio": ["skills/authoring"],
|
|
});
|
|
associate(["hiring-templates"], { "hire-coder-template-reuse": ["agents/hire", "task-coordination/delegation"] });
|
|
associate(["task-workspaces"], {
|
|
"task-directory-repository-resume": ["workspaces/binding", "workspaces/provisioning", "projects/repositories"],
|
|
});
|
|
associate(["task-titles"], {
|
|
"prompt-title-standard": ["tasks/create"],
|
|
"prompt-title-ask": ["tasks/create"],
|
|
"preserve-explicit-title": ["tasks/create"],
|
|
});
|
|
associate(["pi-controls", "native-active-stop"], {
|
|
"pending-permission-stop": ["steering/stop-and-pause"],
|
|
"same-turn-steering": ["steering/steer"],
|
|
});
|
|
|
|
export function journeyCapabilities(execution: Pick<ReportExecution, "suite" | "task">) {
|
|
return (associations.get(`${execution.suite.id}/${execution.task.id}`) ?? [])
|
|
.map((id) => capabilities.get(id)!);
|
|
}
|
|
|
|
export function journeyFeatureIds(execution: Pick<ReportExecution, "suite" | "task">) {
|
|
return [...new Set(journeyCapabilities(execution).map((capability) => capability.feature.id))];
|
|
}
|