|
| 1 | +# Import Project Control Flow |
| 2 | + |
| 3 | +Status: Draft |
| 4 | + |
| 5 | +## Goal |
| 6 | + |
| 7 | +Define the product behavior and control-plane semantics for importing a GitHub |
| 8 | +repository as a Fulling project. |
| 9 | + |
| 10 | +This PRD exists to clarify what "success" means for: |
| 11 | + |
| 12 | +- project creation |
| 13 | +- sandbox creation |
| 14 | +- repository cloning |
| 15 | +- import failure handling |
| 16 | + |
| 17 | +## Scope |
| 18 | + |
| 19 | +This document covers the current import flow for: |
| 20 | + |
| 21 | +- creating a project from a GitHub repository |
| 22 | +- creating the initial sandbox for that project |
| 23 | +- cloning the selected repository into the sandbox |
| 24 | +- representing clone failure without rolling back the project |
| 25 | + |
| 26 | +This document does not define future repository analysis, skill installation, or |
| 27 | +deploy automation after import. |
| 28 | + |
| 29 | +## User Intent |
| 30 | + |
| 31 | +When a user imports a project from GitHub, the system receives two requested outcomes: |
| 32 | + |
| 33 | +1. Create and start a sandbox for the project |
| 34 | +2. Clone the selected GitHub repository into that sandbox |
| 35 | + |
| 36 | +These two outcomes are related, but they are not treated as a single all-or-nothing |
| 37 | +product success condition. |
| 38 | + |
| 39 | +## Success Semantics |
| 40 | + |
| 41 | +### Project creation success |
| 42 | + |
| 43 | +A project is considered successfully created when its sandbox is successfully created |
| 44 | +and reaches a runnable state. |
| 45 | + |
| 46 | +This means: |
| 47 | + |
| 48 | +- if sandbox creation succeeds, project creation succeeds |
| 49 | +- project success is not blocked by repository clone failure |
| 50 | + |
| 51 | +### Import transaction success |
| 52 | + |
| 53 | +The import transaction is considered successful only when the repository is cloned |
| 54 | +successfully into the sandbox. |
| 55 | + |
| 56 | +## Failure Semantics |
| 57 | + |
| 58 | +### Sandbox creation failure |
| 59 | + |
| 60 | +If the sandbox fails to reach a runnable state, project creation is considered failed. |
| 61 | + |
| 62 | +### Repository clone failure |
| 63 | + |
| 64 | +If the sandbox succeeds but repository cloning fails, the system must: |
| 65 | + |
| 66 | +- keep the project |
| 67 | +- keep the sandbox |
| 68 | +- mark the import transaction as failed |
| 69 | +- preserve the GitHub association metadata on the project |
| 70 | + |
| 71 | +Clone failure does not roll back the project. |
| 72 | + |
| 73 | +Examples of clone failure include: |
| 74 | + |
| 75 | +- repository does not exist |
| 76 | +- repository access is denied |
| 77 | +- clone operation times out |
| 78 | +- GitHub access token or upstream operation fails |
| 79 | + |
| 80 | +## Current UX Requirements |
| 81 | + |
| 82 | +For the current stage of the product: |
| 83 | + |
| 84 | +- the user should still land in a usable project with an empty sandbox |
| 85 | +- no dedicated import-failure modal is required yet |
| 86 | +- the system should preserve existing code paths as much as possible |
| 87 | + |
| 88 | +## Status Requirements |
| 89 | + |
| 90 | +The system should represent two layers of status: |
| 91 | + |
| 92 | +1. Project resource status |
| 93 | +2. Import transaction status |
| 94 | + |
| 95 | +For the current product behavior: |
| 96 | + |
| 97 | +- project status may become `RUNNING` |
| 98 | +- import may independently become `IMPORT_FAILED` |
| 99 | + |
| 100 | +The intended current UI meaning is: |
| 101 | + |
| 102 | +- `RUNNING + IMPORT FAILED` |
| 103 | + |
| 104 | +This combination means: |
| 105 | + |
| 106 | +- the sandbox is available |
| 107 | +- the project exists and is usable |
| 108 | +- the requested repository import did not complete successfully |
| 109 | + |
| 110 | +## Retry Behavior |
| 111 | + |
| 112 | +Repository clone should automatically retry up to 3 times, matching the current system behavior. |
| 113 | + |
| 114 | +Requirements: |
| 115 | + |
| 116 | +- retries are automatic |
| 117 | +- no manual retry UX is required in this phase |
| 118 | +- exhausting retries should leave the project intact and mark import as failed |
| 119 | + |
| 120 | +## Persistence Requirements |
| 121 | + |
| 122 | +The system must persist enough state to represent: |
| 123 | + |
| 124 | +- that the project exists |
| 125 | +- that the sandbox exists |
| 126 | +- that the project was created from GitHub |
| 127 | +- that the clone task was attempted |
| 128 | +- whether the clone task eventually succeeded or failed |
| 129 | + |
| 130 | +If clone fails, the database must still clearly reflect: |
| 131 | + |
| 132 | +- project creation succeeded |
| 133 | +- import did not succeed |
| 134 | + |
| 135 | +## GitHub Metadata Requirements |
| 136 | + |
| 137 | +If the repository later becomes unavailable or permissions change, the project should |
| 138 | +continue to retain its GitHub association metadata. |
| 139 | + |
| 140 | +This means clone failure or later repository access loss should not automatically clear: |
| 141 | + |
| 142 | +- GitHub installation reference |
| 143 | +- GitHub repository ID |
| 144 | +- GitHub repository full name |
| 145 | +- default branch metadata |
| 146 | + |
| 147 | +## Non-Goals |
| 148 | + |
| 149 | +This PRD does not define: |
| 150 | + |
| 151 | +- a new import intent model |
| 152 | +- a dedicated import failure modal |
| 153 | +- post-import repository analysis |
| 154 | +- skill installation after import |
| 155 | +- deployment after import |
| 156 | +- new manual retry workflows |
| 157 | + |
| 158 | +## Implementation Notes |
| 159 | + |
| 160 | +Current implementation should preserve this product contract: |
| 161 | + |
| 162 | +- project creation success is anchored to sandbox success |
| 163 | +- clone failure is visible as an import failure, not as project creation failure |
| 164 | +- import logic may fail independently after the project already exists |
0 commit comments