parallel-codex-tui 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.parallel-codex/config.example.toml +46 -0
  2. package/README.md +96 -19
  3. package/dist/cli-startup-preflight.js +18 -0
  4. package/dist/cli-startup-recovery.js +13 -1
  5. package/dist/cli.js +19 -7
  6. package/dist/core/clipboard.js +97 -0
  7. package/dist/core/collaboration-timeline.js +9 -2
  8. package/dist/core/config.js +161 -103
  9. package/dist/core/router.js +1 -1
  10. package/dist/core/session-index.js +234 -61
  11. package/dist/core/session-manager.js +25 -1
  12. package/dist/core/task-session-details.js +175 -0
  13. package/dist/core/task-state-machine.js +10 -9
  14. package/dist/doctor.js +58 -39
  15. package/dist/domain/schemas.js +15 -1
  16. package/dist/orchestrator/collaboration-channel.js +35 -3
  17. package/dist/orchestrator/final-acceptance.js +86 -0
  18. package/dist/orchestrator/orchestrator.js +405 -69
  19. package/dist/orchestrator/prompts.js +42 -3
  20. package/dist/orchestrator/workspace-sandbox.js +16 -0
  21. package/dist/tui/App.js +514 -56
  22. package/dist/tui/AppShell.js +9 -3
  23. package/dist/tui/FeatureBoardView.js +7 -2
  24. package/dist/tui/InputBar.js +87 -15
  25. package/dist/tui/StatusBar.js +1 -1
  26. package/dist/tui/StatusDetailView.js +164 -0
  27. package/dist/tui/TaskSessionDetailView.js +222 -0
  28. package/dist/tui/TaskSessionsView.js +5 -2
  29. package/dist/tui/WorkerOutputView.js +6 -1
  30. package/dist/tui/WorkerOverviewView.js +23 -4
  31. package/dist/tui/keyboard.js +6 -0
  32. package/dist/tui/status-line.js +42 -0
  33. package/dist/version.js +1 -1
  34. package/dist/workers/capabilities.js +4 -3
  35. package/dist/workers/live-probe.js +4 -3
  36. package/dist/workers/mock-adapter.js +37 -5
  37. package/dist/workers/native-attach.js +32 -17
  38. package/dist/workers/process-adapter.js +2 -0
  39. package/dist/workers/provider.js +26 -0
  40. package/dist/workers/registry.js +12 -22
  41. package/package.json +7 -1
@@ -70,6 +70,7 @@ export function buildActorPrompt(input) {
70
70
  "",
71
71
  `Task directory: ${input.taskDir}`,
72
72
  `Judge directory: ${input.judgeDir}`,
73
+ ...(input.workerDir ? [`Worker directory: ${input.workerDir}`] : []),
73
74
  ...(input.workspaceDir ? [
74
75
  `Feature workspace: ${input.workspaceDir}`,
75
76
  "The feature workspace above is the logical project root for this run.",
@@ -86,7 +87,7 @@ export function buildActorPrompt(input) {
86
87
  "- acceptance.md",
87
88
  "- actor-brief.md",
88
89
  "",
89
- "Write in your worker directory:",
90
+ "Write these coordination artifacts in the exact worker directory above, not in the feature workspace:",
90
91
  "- worklog.md",
91
92
  "- patch.diff when a diff is available",
92
93
  "",
@@ -112,6 +113,7 @@ export function buildCriticPrompt(input) {
112
113
  "",
113
114
  `Task directory: ${input.taskDir}`,
114
115
  `Judge directory: ${input.judgeDir}`,
116
+ ...(input.workerDir ? [`Worker directory: ${input.workerDir}`] : []),
115
117
  `Actor directory: ${input.actorDir ?? ""}`,
116
118
  ...(input.workspaceDir ? [
117
119
  `Review workspace: ${input.workspaceDir}`,
@@ -125,7 +127,7 @@ export function buildCriticPrompt(input) {
125
127
  "Read Judge files and Actor output.",
126
128
  "Read actor-replies.jsonl when reviewing a revision.",
127
129
  "",
128
- "Write review.md in your worker directory. Include APPROVED when no blocking findings remain.",
130
+ "Write review.md in the exact worker directory above, not in the disposable review workspace. Include APPROVED when no blocking findings remain.",
129
131
  "If revision is required, include REVISION_REQUIRED and a concise fix list.",
130
132
  'Write critic-findings.jsonl in the feature mailbox with one JSON object per blocking issue: {"id":"C-001","severity":"blocker","summary":"what must change"}.',
131
133
  "",
@@ -198,6 +200,42 @@ export function buildWaveActorPrompt(input) {
198
200
  ""
199
201
  ].join("\n");
200
202
  }
203
+ export function buildFinalJudgePrompt(input) {
204
+ const role = roleConfig(input.role, "Final Judge", [
205
+ "Perform the final integration acceptance against the requirements you established before the task can be completed."
206
+ ]);
207
+ return [
208
+ `# Role: ${role.title} · Final acceptance`,
209
+ "",
210
+ ...instructionLines(role.instructions),
211
+ "",
212
+ `Task directory: ${input.taskDir}`,
213
+ `Judge artifact directory: ${input.judgeDir}`,
214
+ `Final Judge worker directory: ${input.workerDir}`,
215
+ `Final verification workspace: ${input.workspaceDir}`,
216
+ `Supervisor summary: ${input.supervisorSummaryPath}`,
217
+ ...turnLines(input.turn),
218
+ "",
219
+ "The verification workspace is a disposable snapshot of the integrated project.",
220
+ "Inspect and test it as the logical project root. Do not modify the live workspace.",
221
+ "Read requirements.md, acceptance.md, the supervisor summary, feature decisions, and Critic reviews.",
222
+ "Run the commands needed to validate the complete integrated result, including cross-feature behavior.",
223
+ "",
224
+ `Required acceptance criterion ids: ${JSON.stringify(input.expectedCriterionIds)}`,
225
+ `Authoritative changed paths: ${JSON.stringify(input.changedPaths)}`,
226
+ "",
227
+ "Write final-acceptance.json in the Final Judge worker directory.",
228
+ "It must be strict JSON with this shape:",
229
+ '{"version":1,"decision":"approved|rejected","summary":"concise verdict","acceptance":[{"criterion_id":"A-001","status":"passed|failed","evidence":"command or observable result"}],"changed_paths":["relative/path"]}',
230
+ "Include every required criterion exactly once and copy the authoritative changed paths exactly.",
231
+ "Use decision approved only when every criterion passed; otherwise use rejected and identify each failure.",
232
+ "Do not rely on process exit alone and do not omit evidence.",
233
+ "",
234
+ "User request:",
235
+ input.request,
236
+ ""
237
+ ].join("\n");
238
+ }
201
239
  function roleConfig(role, title, instructions) {
202
240
  return {
203
241
  title: role?.title ?? title,
@@ -232,7 +270,8 @@ function featureLines(feature) {
232
270
  `Actor feature worklog: ${feature.actorWorklogPath}`,
233
271
  `Critic findings: ${feature.criticFindingsPath}`,
234
272
  `Actor replies: ${feature.actorRepliesPath}`,
235
- `Feature decisions: ${feature.decisionsPath}`
273
+ `Feature decisions: ${feature.decisionsPath}`,
274
+ `Feature engine assignment: ${feature.assignmentPath}`
236
275
  ];
237
276
  }
238
277
  function turnLines(turn) {
@@ -202,6 +202,22 @@ export class ParallelWorkspaceManager {
202
202
  await cloneTree(featureDir, reviewDir);
203
203
  return reviewDir;
204
204
  }
205
+ async prepareFinalVerificationWorkspace(turnId) {
206
+ if (!/^\d{4,}$/.test(turnId)) {
207
+ throw new Error(`Unsafe workspace turn id: ${turnId}`);
208
+ }
209
+ const turnRoot = join(this.taskDir, "workspaces", `turn-${turnId}`);
210
+ const verificationDir = join(turnRoot, "final-verification");
211
+ await rm(verificationDir, { recursive: true, force: true });
212
+ await cloneTree(this.workspaceRoot, verificationDir, (path) => this.excludeFromSource(path));
213
+ await writeJson(join(turnRoot, "final-verification.json"), {
214
+ version: 1,
215
+ workspace_root: this.workspaceRoot,
216
+ turn_id: turnId,
217
+ verification: verificationDir
218
+ });
219
+ return verificationDir;
220
+ }
205
221
  async commitWave(wave) {
206
222
  const pendingCommit = await this.readPendingCommit(wave);
207
223
  if (pendingCommit) {