@@ -9,6 +9,7 @@ repository as a Fulling project.
99
1010This PRD exists to clarify what "success" means for:
1111
12+ - request acceptance
1213- project creation
1314- sandbox creation
1415- repository cloning
@@ -22,6 +23,7 @@ This document covers the current import flow for:
2223- creating the initial sandbox for that project
2324- cloning the selected repository into the sandbox
2425- representing clone failure without rolling back the project
26+ - deriving import status from the clone task lifecycle
2527
2628This document does not define future repository analysis, skill installation, or
2729deploy automation after import.
@@ -38,6 +40,18 @@ product success condition.
3840
3941## Success Semantics
4042
43+ ### Request acceptance success
44+
45+ The import request is considered accepted when the control plane successfully:
46+
47+ - verifies the selected GitHub installation and repository access
48+ - creates the project record
49+ - creates the initial sandbox record
50+ - creates the initial clone-repository task
51+
52+ At this point, the API may return success immediately even though the sandbox is
53+ not yet runnable and the repository has not yet been cloned.
54+
4155### Project creation success
4256
4357A project is considered successfully created when its sandbox is successfully created
@@ -53,11 +67,23 @@ This means:
5367The import transaction is considered successful only when the repository is cloned
5468successfully into the sandbox.
5569
70+ This is independent from request acceptance and independent from project creation
71+ success once the sandbox is already runnable.
72+
5673## Failure Semantics
5774
5875### Sandbox creation failure
5976
60- If the sandbox fails to reach a runnable state, project creation is considered failed.
77+ If the sandbox enters ` ERROR ` , project creation is considered failed.
78+
79+ Current implementation note:
80+
81+ - explicit sandbox create/start failures transition the sandbox to ` ERROR `
82+ - there is currently no startup timeout that converts a sandbox stuck in ` STARTING `
83+ into ` ERROR `
84+
85+ So today, "failed to reach runnable state" is fully represented only for explicit
86+ failures, not for indefinite startup stalls.
6187
6288### Repository clone failure
6389
@@ -84,6 +110,7 @@ For the current stage of the product:
84110- the user should still land in a usable project with an empty sandbox
85111- no dedicated import-failure modal is required yet
86112- the system should preserve existing code paths as much as possible
113+ - the UI should not wait forever on clone task state if the sandbox has already failed
87114
88115## Status Requirements
89116
@@ -92,21 +119,49 @@ The system should represent two layers of status:
921191 . Project resource status
931202 . Import transaction status
94121
95- For the current product behavior:
122+ ### Project resource status
123+
124+ Project resource status is represented by ` Project.status ` and continues to mean
125+ resource lifecycle state only.
126+
127+ Examples:
128+
129+ - ` CREATING `
130+ - ` STARTING `
131+ - ` RUNNING `
132+ - ` ERROR `
133+
134+ ### Import transaction status
135+
136+ Import transaction status is not a separate persisted ` ProjectStatus ` enum.
137+ It is derived from the latest ` CLONE_REPOSITORY ` task for the project.
138+
139+ Derived meaning:
140+
141+ - ` WAITING_FOR_PREREQUISITES ` , ` PENDING ` , or ` RUNNING ` => ` IMPORTING `
142+ - ` SUCCEEDED ` => ` IMPORTED `
143+ - ` FAILED ` or ` CANCELLED ` => ` IMPORT_FAILED `
144+
145+ For the current product contract:
96146
97147- project status may become ` RUNNING `
98- - import may independently become ` IMPORT_FAILED `
148+ - import may independently derive to ` IMPORT_FAILED `
99149
100150The intended current UI meaning is:
101151
102- - ` RUNNING + IMPORT FAILED `
152+ - ` RUNNING + IMPORT_FAILED `
103153
104154This combination means:
105155
106156- the sandbox is available
107157- the project exists and is usable
108158- the requested repository import did not complete successfully
109159
160+ Current implementation note:
161+
162+ - UI may choose to render this as ` Needs Attention `
163+ - ` Needs Attention ` is a presentation label, not the underlying persisted import status
164+
110165## Retry Behavior
111166
112167Repository clone should automatically retry up to 3 times, matching the current system behavior.
@@ -132,6 +187,12 @@ If clone fails, the database must still clearly reflect:
132187- project creation succeeded
133188- import did not succeed
134189
190+ This currently means:
191+
192+ - ` Project ` persists the imported GitHub metadata
193+ - ` ProjectTask ` persists clone attempts, final success or failure, and error text
194+ - import status is inferred from task state rather than stored as a dedicated project column
195+
135196## GitHub Metadata Requirements
136197
137198If the repository later becomes unavailable or permissions change, the project should
@@ -150,15 +211,19 @@ This PRD does not define:
150211
151212- a new import intent model
152213- a dedicated import failure modal
214+ - a new ` ProjectStatus ` enum value for import outcomes
153215- post-import repository analysis
154216- skill installation after import
155217- deployment after import
156218- new manual retry workflows
219+ - sandbox startup timeout policy
157220
158221## Implementation Notes
159222
160223Current implementation should preserve this product contract:
161224
162- - project creation success is anchored to sandbox success
225+ - request acceptance is synchronous and returns after control-plane state is created
226+ - project creation success is asynchronous and is anchored to sandbox success
163227- clone failure is visible as an import failure, not as project creation failure
164228- import logic may fail independently after the project already exists
229+ - import status should be derived from clone task state, not folded into ` Project.status `
0 commit comments