You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(rfspec): persist results and support fire-and-forget polling
The run.sh script spawns three droid exec calls that take several minutes,
but the Execute tool times out at 60s. When that happens the temp dir
self-destructs and results are lost.
Changes:
- Write model outputs to persistent ~/.factory/rfspec/runs/<id>/ instead of
a temp dir
- Print RFSPEC_RUN_DIR path immediately so the agent captures it before timeout
- Write a done sentinel (STATUS=complete|failed) for polling
- Update SKILL.md (v1.3.0) with fire-and-forget + poll workflow instructions
Poll every 30-60 seconds. The sentinel contains `STATUS=complete` or
55
+
`STATUS=failed`. While waiting, you can do other work or let the user know
56
+
progress.
57
+
58
+
### Step 3 -- Read results
59
+
60
+
Once `done` exists, read the results:
61
+
62
+
```
63
+
Read: <run_dir>/results.md
64
+
```
65
+
66
+
This file contains all three model outputs as markdown sections (Option A, B, C).
67
+
68
+
### Step 4 -- Evaluate and present
69
+
70
+
Evaluate the results -- see [references/evaluation-guide.md](references/evaluation-guide.md).
71
+
Present the choice to the user via AskUser.
72
+
73
+
### Step 5 -- Finalize
74
+
75
+
Present the selected or synthesized spec via ExitSpecMode for user review.
76
+
Save to `specs/active/` only after the user approves in spec mode.
34
77
35
78
## Saving
36
79
@@ -63,29 +106,31 @@ Example 1: User wants competing specs
63
106
User says: "Get me specs from multiple models for adding a dark mode toggle"
64
107
Actions:
65
108
66
-
1. Run `/rfspec add a dark mode toggle to the settings page with persistent user preference`
67
-
2. Read Options A, B, C
68
-
3. Compare: "Option A uses CSS variables with a React context, Option B uses Tailwind's dark class with localStorage, Option C uses a theme provider with system preference detection."
69
-
4. Present choice via AskUser
70
-
Result: User picks Option B, saved to `specs/active/2026-03-06-dark-mode-toggle.md`
109
+
1. Execute `/rfspec add a dark mode toggle ...` with `fireAndForget=true`
110
+
2. Read the background log to get `RFSPEC_RUN_DIR`
111
+
3. Tell user: "Models are running, I'll check back shortly."
112
+
4. Poll `<run_dir>/done` until `STATUS=complete`
113
+
5. Read `<run_dir>/results.md`, compare Options A, B, C
114
+
6. Present choice via AskUser
115
+
Result: User picks Option B, saved to `specs/active/2026-03-06-dark-mode-toggle.md`
71
116
72
117
Example 2: User wants synthesis
73
118
User says: "rfspec this: refactor the auth module to use JWT"
74
119
Actions:
75
120
76
-
1.Run `/rfspec refactor the auth module to use JWT`
77
-
2.Compare results, noting Option A has better token rotation but Option C has cleaner middleware
121
+
1.Launch background, poll for completion
122
+
2.Read results, compare -- Option A has better token rotation, Option C has cleaner middleware
0 commit comments