feat: introduce PR workflow support with workflowType and idempotent execution#205
Open
patkaryash wants to merge 2 commits into
Open
feat: introduce PR workflow support with workflowType and idempotent execution#205patkaryash wants to merge 2 commits into
patkaryash wants to merge 2 commits into
Conversation
Add the IssueWorkflowType type and plumbing needed for PR workflows. - Database: add workflow_type column to issues table with migration 0094 - Shared: ISSUE_WORKFLOW_TYPES constants, IssueWorkflowType type, validator and export plumbing - API: include workflowType in issue selects and heartbeat wake payload/task markdown - Workspace policy: PR workflow issues default to isolated_workspace when no explicit policy is set - UI: workflowType selector in NewIssueDialog, PR badge on IssueDetail, fixture/story updates - Onboarding: PR_WORKFLOW_EXIT_GATE.md default instruction asset - PR workflow idempotency service with tests (step resolution, skip/resume/recreate logic, sha256 fingerprints) Validation: tested via end-to-end PR workflow executions including a clean validation using YAS-243.
- Patch hermes-paperclip-adapter@0.2.0 for Paperclip auth and workspace resolution - Add Authorization header guidance and propagate PAPERCLIP_API_KEY from ctx.authToken - Resolve cwd from paperclipWorkspace realizations - Ignore persisted sessions by default for fresh issue conversations - Unwrap structured env values - Only apply tsx loader to TS plugin worker entrypoints to avoid tsx Windows ESM bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce first-class PR workflow support by adding a dedicated workflowType (issue | pr) throughout Paperclip.
This enables the system to distinguish standard issue workflows from Pull Request workflows and apply PR-specific behavior such as isolated workspaces, deterministic execution, and idempotent PR handling.
##What Changed
-added a workflow_type column to the issues table with migration 0094.
-Introduced the shared IssueWorkflowType type, constants, validators, and exports.
-Propagated workflowType through issue APIs, heartbeat execution, task payloads, and runtime context.
-Updated the execution workspace policy so PR workflows default to isolated workspaces when no explicit policy is configured.
-Added a workflow type selector to the New Issue dialog and a PR badge on the Issue Detail page.
-Added the PR workflow idempotency service with deterministic step resolution, resume/skip logic, and SHA-256 fingerprinting.
-Added onboarding assets and updated tests, Storybook fixtures, and validation.
##Validation
-Added and updated automated tests.
-execution-workspace-policy.test.ts — 16 passing
-pr-workflow-idempotency.test.ts — 31 passing
-Verified end-to-end PR workflow execution using YAS-243, including branch creation, commit, push, and Pull Request creation.
##Risks
-Database migration introducing a new non-null workflow_type column.
-Existing issues continue to default to issue, maintaining backward compatibility.
-Runtime behavior changes apply only to PR workflow issues.
##Thinking Path
-Paperclip orchestrates AI agents that execute engineering work across repositories.
-Engineering tasks may result in either discussion or Pull Requests.
-Previously, both workflows were represented identically, preventing the runtime from applying PR-specific behavior.
-This limited workspace isolation and made deterministic PR execution difficult.
-This pull request introduces a first-class workflowType and propagates it through the database, backend, runtime, workspace policy, and UI.
The result is a more reliable and extensible foundation for PR-based workflows.