21 KiB
Workspace Product Model, Work Product, and PR Flow
Context
Paperclip needs to support two very different but equally valid ways of working:
- a solo developer working directly on
master, or in a folder that is not even a git repo - a larger engineering workflow with isolated branches, previews, pull requests, and cleanup automation
Today, Paperclip already has the beginnings of this model:
projectscan carry execution workspace policyproject_workspacesalready exist as a durable project-scoped object- issues can carry execution workspace settings
- runtime services can be attached to a workspace or issue
What is missing is a clear product model and UI that make these capabilities understandable and operable.
The main product risk is overloading one concept to do too much:
- making subissues do the job of branches or PRs
- making projects too infrastructure-heavy
- making workspaces so hidden that users cannot form a mental model
- making Paperclip feel like a code review tool instead of a control plane
Goals
- Keep
projectlightweight enough to remain a planning container. - Make workspace behavior understandable for both git and non-git projects.
- Support three real workflows without forcing one:
- shared workspace / direct-edit workflows
- isolated issue workspace workflows
- long-lived branch or operator integration workflows
- Provide a first-class place to see the outputs of work:
- previews
- PRs
- branches
- commits
- documents and artifacts
- Keep the main navigation and task board simple.
Non-Goals
- Turning Paperclip into a full code review product
- Requiring every issue to have its own branch or PR
- Requiring every project to configure code/workspace automation
- Making workspaces a top-level global navigation primitive in V1
Core Product Decisions
1. Project stays the planning object
A project remains the thing that groups work around a deliverable or initiative.
It may have:
- no code at all
- one default codebase/workspace
- several codebases/workspaces
Projects are not required to become heavyweight.
2. Project workspace is a first-class object, but scoped under project
A project workspace is the durable codebase or root environment for a project.
Examples:
- a local folder on disk
- a git repo checkout
- a monorepo package root
- a non-git design/doc folder
- a remote adapter-managed codebase reference
This is the stable anchor that operators configure once.
It should not be a top-level sidebar item in the main app. It should live under the project experience.
3. Execution workspace is a first-class runtime object
An execution workspace is where a specific run or issue actually executes.
Examples:
- the shared project workspace itself
- an isolated git worktree
- a long-lived operator branch checkout
- an adapter-managed remote sandbox
This object must be recorded explicitly so that Paperclip can:
- show where work happened
- attach previews and runtime services
- link PRs and branches
- decide cleanup behavior
- support reuse across multiple related issues
4. PRs are work product, not the core issue model
A PR is an output of work, not the planning unit.
Paperclip should treat PRs as a type of work product linked back to:
- the issue
- the execution workspace
- optionally the project workspace
Git-specific automation should live under workspace policy, not under the core issue abstraction.
5. Subissues remain planning and ownership structure
Subissues are for decomposition and parallel ownership.
They are not the same thing as:
- a branch
- a worktree
- a PR
- a preview
They may correlate with those things, but they should not be overloaded to mean them.
Terminology
Use these terms consistently in product copy:
Project: planning containerProject workspace: durable configured codebase/rootExecution workspace: actual runtime workspace used for issue executionIsolated issue workspace: user-facing term for an issue-specific derived workspaceWork product: previews, PRs, branches, commits, artifacts, docsRuntime service: a process or service Paperclip owns or tracks for a workspace
Avoid teaching users that "workspace" always means "git worktree on my machine".
Product Object Model
1. Project
Existing object. No fundamental change in role.
Required behavior
- can exist without code/workspace configuration
- can have zero or more project workspaces
- can define execution defaults that new issues inherit
Proposed fields
idcompanyIdnamedescriptionstatusgoalIdsleadAgentIdtargetDateexecutionWorkspacePolicyworkspaces[]primaryWorkspace
2. Project Workspace
Durable, configured, project-scoped codebase/root object.
This should evolve from the current project_workspaces table into a more explicit product object.
Motivation
This separates:
- "what codebase/root does this project use?"
from:
- "what temporary execution environment did this issue run in?"
That keeps the model simple for solo users while still supporting advanced automation.
Proposed fields
idcompanyIdprojectIdnamesourceTypelocal_pathgit_reporemote_managednon_git_path
cwdrepoUrldefaultRefisPrimaryvisibilitydefaultadvanced
setupCommandcleanupCommandmetadatacreatedAtupdatedAt
Notes
sourceType=non_git_pathis important so non-git projects are first-class.setupCommandandcleanupCommandshould be allowed here for workspace-root bootstrap, even when isolated execution is not used.- For a monorepo, multiple project workspaces may point at different roots or packages under one repo.
3. Project Execution Workspace Policy
Project-level defaults for how issues execute.
This is the main operator-facing configuration surface.
Motivation
This lets Paperclip support:
- direct editing in a shared workspace
- isolated workspaces for issue parallelism
- long-lived integration branch workflows
without forcing every issue or agent to expose low-level runtime configuration.
Proposed fields
enabled: booleandefaultModeshared_workspaceisolated_workspaceoperator_branchadapter_default
allowIssueOverride: booleandefaultProjectWorkspaceId: uuid | nullworkspaceStrategytypeproject_primarygit_worktreeadapter_managed
baseRefbranchTemplateworktreeParentDirprovisionCommandteardownCommand
branchPolicynamingTemplateallowReuseExistingpreferredOperatorBranch
pullRequestPolicymodedisabledmanualagent_may_open_draftapproval_required_to_openapproval_required_to_mark_ready
baseBranchtitleTemplatebodyTemplate
runtimePolicyallowWorkspaceServicesdefaultServicesProfileautoHarvestOwnedUrls
cleanupPolicymodemanualwhen_issue_terminalwhen_pr_closedretention_window
retentionHourskeepWhilePreviewHealthykeepWhileOpenPrExists
4. Issue Workspace Binding
Issue-level selection of execution behavior.
This should remain lightweight in the normal case and only surface richer controls when relevant.
Motivation
Not every issue in a code project should create a new derived workspace.
Examples:
- a tiny fix can run in the shared workspace
- three related issues may intentionally share one integration branch
- a solo operator may be working directly on
master
Proposed fields on issues
projectWorkspaceId: uuid | nullexecutionWorkspacePreferenceinheritshared_workspaceisolated_workspaceoperator_branchreuse_existing
preferredExecutionWorkspaceId: uuid | nullexecutionWorkspaceSettings- keep advanced per-issue override fields here
Rules
- if the project has no workspace automation, these fields may all be null
- if the project has one primary workspace, issue creation should default to it silently
reuse_existingis advanced-only and should target active execution workspaces, not the whole workspace universe
5. Execution Workspace
A durable record for a shared or derived runtime workspace.
This is the missing object that makes cleanup, previews, PRs, and branch reuse tractable.
Motivation
Without an explicit execution workspace record, Paperclip has nowhere stable to attach:
- derived branch/worktree identity
- active preview ownership
- PR linkage
- cleanup state
- "reuse this existing integration branch" behavior
Proposed new object
execution_workspaces
Proposed fields
idcompanyIdprojectIdprojectWorkspaceIdsourceIssueIdmodeshared_workspaceisolated_workspaceoperator_branchadapter_managed
strategyTypeproject_primarygit_worktreeadapter_managed
namestatusactiveidlein_reviewarchivedcleanup_failed
cwdrepoUrlbaseRefbranchNameproviderRefderivedFromExecutionWorkspaceIdlastUsedAtopenedAtclosedAtcleanupEligibleAtcleanupReasonmetadatacreatedAtupdatedAt
Notes
sourceIssueIdis the issue that originally caused the workspace to be created, not necessarily the only issue linked to it later.- multiple issues may link to the same execution workspace in a long-lived branch workflow.
6. Issue-to-Execution Workspace Link
An issue may need to link to one or more execution workspaces over time.
Examples:
- an issue begins in a shared workspace and later moves to an isolated one
- a failed attempt is archived and a new workspace is created
- several issues intentionally share one operator branch workspace
Proposed object
issue_execution_workspaces
Proposed fields
issueIdexecutionWorkspaceIdrelationTypecurrenthistoricalpreferred
createdAtupdatedAt
UI simplification
Most issues should only show one current workspace in the main UI. Historical links belong in advanced/history views.
7. Work Product
User-facing umbrella concept for outputs of work.
Motivation
Paperclip needs a single place to show:
- "here is the preview"
- "here is the PR"
- "here is the branch"
- "here is the commit"
- "here is the artifact/report/doc"
without turning issues into a raw dump of adapter details.
Proposed new object
issue_work_products
Proposed fields
idcompanyIdprojectIdissueIdexecutionWorkspaceIdruntimeServiceIdtypepreview_urlruntime_servicepull_requestbranchcommitartifactdocument
providerpaperclipgithubgitlabvercelnetlifycustom
externalIdtitleurlstatusactiveready_for_reviewmergedclosedfailedarchived
reviewStatenoneneeds_board_reviewapprovedchanges_requested
isPrimaryhealthStatusunknownhealthyunhealthy
summarymetadatacreatedByRunIdcreatedAtupdatedAt
Behavior
- PRs are stored here as
type=pull_request - previews are stored here as
type=preview_urlorruntime_service - Paperclip-owned processes should update health/status automatically
- external providers should at least store link, provider, external id, and latest known state
Page and UI Model
1. Global Navigation
Do not add Workspaces as a top-level sidebar item in V1.
Motivation
That would make the whole product feel infra-heavy, even for companies that do not use code automation.
Global nav remains
- Dashboard
- Inbox
- Companies
- Agents
- Goals
- Projects
- Issues
- Approvals
Workspaces and work product should be surfaced through project and issue detail views.
2. Project Detail
Add a project sub-navigation that keeps planning first and code second.
Tabs
OverviewIssuesCodeActivity
Optional future:
Outputs
Overview tab
Planning-first summary:
- project status
- goals
- lead
- issue counts
- top-level progress
- latest major work product summaries
Issues tab
- default to top-level issues only
- show parent issue rollups:
- child count
x/ydone- active preview/PR badges
- optional toggle:
Show subissues
Code tab
This is the main workspace configuration and visibility surface.
Section: Project Workspaces
List durable project workspaces for the project.
Card/list columns:
- workspace name
- source type
- path or repo
- default ref
- primary/default badge
- active execution workspaces count
- active issue count
- active preview count
Actions:
Add workspaceEditSet defaultArchive
Section: Execution Defaults
Fields:
Enable workspace automationDefault issue execution modeShared workspaceIsolated workspaceOperator branchAdapter default
Default codebaseAllow issue override
Section: Provisioning
Fields:
Setup commandCleanup commandImplementationShared workspaceGit worktreeAdapter-managed
Base refBranch naming templateDerived workspace parent directory
Hide git-specific fields when the selected workspace is not git-backed.
Section: Pull Requests
Fields:
PR workflowDisabledManualAgent may open draft PRApproval required to open PRApproval required to mark ready
Default base branchPR title templatePR body template
Section: Previews and Runtime
Fields:
Allow workspace runtime servicesDefault services profileHarvest owned preview URLsTrack external preview URLs
Section: Cleanup
Fields:
Cleanup modeManualWhen issue is terminalWhen PR closesAfter retention window
Retention windowKeep while preview is activeKeep while PR is open
3. Add Project Workspace Flow
Entry point: Project > Code > Add workspace
Form fields
NameSource typeLocal folderGit repoNon-git folderRemote managed
Local pathRepository URLDefault refSet as default workspaceSetup commandCleanup command
Behavior
- if source type is non-git, hide branch/PR-specific setup
- if source type is git, show ref and optional advanced branch fields
- for simple solo users, this can be one path field and one save button
4. Issue Create Flow
Issue creation should stay simple by default.
Default behavior
If the selected project:
- has no workspace automation: show no workspace UI
- has one default project workspace and default execution mode: inherit silently
Show a Workspace section only when relevant
Basic fields
Codebase- default selected project workspace
Execution modeProject defaultShared workspaceIsolated workspaceOperator branch
Advanced-only field
Reuse existing execution workspace
This dropdown should show only active execution workspaces for the selected project workspace, with labels like:
dotta/integration-branchPAP-447-add-worktree-supportshared primary workspace
Important rule
Do not show a picker containing every possible workspace object by default.
The normal flow should feel like:
- choose project
- optionally choose codebase
- optionally choose execution mode
not:
- choose from a long mixed list of roots, derived worktrees, previews, and branch names
5. Issue Detail
Issue detail should expose workspace and work product clearly, but without becoming a code host UI.
Header chips
Show compact summary chips near the title/status area:
Codebase: Web AppWorkspace: SharedWorkspace: PAP-447-add-worktree-supportPR: OpenPreview: Healthy
Tabs
CommentsSubissuesWork ProductActivity
Work Product tab
Sections:
Current workspacePreviewsPull requestsBranches and commitsArtifacts and documents
Current workspace panel
Fields:
- workspace name
- mode
- branch
- base ref
- last used
- linked issues count
- cleanup status
Actions:
Open workspace detailsMark in reviewRequest cleanup
Pull request cards
Fields:
- title
- provider
- status
- review state
- linked branch
- open/ready/merged timestamps
Actions:
Open PRRefresh statusRequest board review
Preview cards
Fields:
- title
- URL
- provider
- health
- ownership
- updated at
Actions:
Open previewRefreshArchive
6. Execution Workspace Detail
This can be reached from a project code tab or an issue work product tab.
It does not need to be in the main sidebar.
Sections
- identity
- source issue
- linked issues
- branch/ref
- active runtime services
- previews
- PRs
- cleanup state
- event/activity history
Motivation
This is where advanced users go when they need to inspect the mechanics. Most users should not need it in normal flow.
7. Inbox Behavior
Inbox should surface actionable work product events, not every implementation detail.
Show inbox items for
- issue assigned or updated
- PR needs board review
- PR opened or marked ready
- preview unhealthy
- workspace cleanup failed
- runtime service failed
Do not show by default
- every workspace heartbeat
- every branch update
- every derived workspace creation
Display style
If the inbox item is about a preview or PR, show issue context with it:
- issue identifier and title
- parent issue if this is a subissue
- workspace name if relevant
8. Issues List and Kanban
Keep list and board planning-first.
Default behavior
- show top-level issues by default
- show parent rollups for subissues
- do not flatten every child execution detail into the main board
Row/card adornments
For issues with linked work product, show compact badges:
1 PR2 previewsshared workspaceisolated workspace
Optional advanced filters
Has PRHas previewWorkspace modeCodebase
Behavior Rules
1. Cleanup must not depend on agents remembering in_review
Agents may still use in_review, but cleanup behavior must be governed by policy and observed state.
Keep an execution workspace alive while any of these are true
- a linked issue is non-terminal
- a linked PR is open
- a linked preview/runtime service is active
- the workspace is still within retention window
Hide instead of deleting aggressively
Archived or idle workspaces should be hidden from default lists before they are hard-cleaned up.
2. Multiple issues may intentionally share one execution workspace
This is how Paperclip supports:
- solo dev on a shared branch
- operator integration branches
- related features batched into one PR
This is the key reason not to force 1 issue = 1 workspace = 1 PR.
3. Isolated issue workspaces remain opt-in
Even in a git-heavy project, isolated workspaces should be optional.
Examples where shared mode is valid:
- tiny bug fixes
- branchless prototyping
- non-git projects
- single-user local workflows
4. PR policy belongs to git-backed workspace policy
PR automation decisions should be made at the project/workspace policy layer.
The issue should only:
- surface the resulting PR
- route approvals/review requests
- show status and review state
5. Work product is the user-facing unifier
Previews, PRs, commits, and artifacts should all be discoverable through one consistent issue-level affordance.
That keeps Paperclip focused on coordination and visibility instead of splitting outputs across many hidden subsystems.
Recommended Implementation Order
Phase 1: Clarify current objects in UI
- Surface
Project > Codetab - Show existing project workspaces there
- Re-enable project-level execution workspace policy with revised copy
- Keep issue creation simple with inherited defaults
Phase 2: Add explicit execution workspace record
- Add
execution_workspaces - Link runs, issues, previews, and PRs to it
- Add simple execution workspace detail page
Phase 3: Add work product model
- Add
issue_work_products - Ingest PRs, previews, branches, commits
- Add issue
Work Producttab - Add inbox items for actionable work product state changes
Phase 4: Add advanced reuse and cleanup workflows
- Add
reuse existing execution workspace - Add cleanup lifecycle UI
- Add operator branch workflow shortcuts
- Add richer external preview harvesting
Why This Model Is Right
This model keeps the product balanced:
- simple enough for solo users
- strong enough for real engineering teams
- flexible for non-git projects
- explicit enough to govern PRs and previews
Most importantly, it keeps the abstractions clean:
- projects plan the work
- project workspaces define the durable codebases
- execution workspaces define where work ran
- work product defines what came out of the work
- PRs remain outputs, not the core task model
That is a better fit for Paperclip than either extreme:
- hiding workspace behavior until nobody understands it
- or making the whole app revolve around code-host mechanics