@nanobpm/nano-workforce 0.63.0 → 0.65.0

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 (42) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/app/agentCompletion.test.ts +51 -0
  3. package/app/agentCompletion.ts +50 -12
  4. package/app/feature.ts +80 -2
  5. package/app/featureEscalation.test.ts +180 -0
  6. package/app/service.ts +45 -1
  7. package/db/migrations/031_feature_escalation_surface.sql +28 -0
  8. package/e2e/feature-run.e2e.ts +58 -0
  9. package/nano.app.json +6 -1
  10. package/openapi.yaml +52 -0
  11. package/operations/answerFeatureEscalation.ts +68 -0
  12. package/package.json +2 -2
  13. package/pages/feature.page.json +39 -3
  14. package/pages/overview.page.json +37 -2
  15. package/resources/processes/convergence-loop.bpmn +10 -0
  16. package/resources/processes/feature.bpmn +104 -58
  17. package/resources/processes/merge-loop.bpmn +2 -0
  18. package/resources/processes/plan-fanout.bpmn +42 -1
  19. package/resources/processes/retro.bpmn +20 -0
  20. package/scripts/pages-contract.test.ts +1 -1
  21. package/workers/answer-escalation/worker.ts +3 -5
  22. package/workers/arm-merge/worker.ts +3 -3
  23. package/workers/converge-feature/worker.ts +3 -5
  24. package/workers/ensure-base-branch/worker.ts +3 -4
  25. package/workers/finalize/worker.ts +4 -16
  26. package/workers/mark-merged/worker.ts +3 -3
  27. package/workers/merge/worker.ts +3 -11
  28. package/workers/persist-escalation/worker.ts +5 -22
  29. package/workers/persist-round/worker.ts +6 -16
  30. package/workers/record-dependency/worker.ts +5 -4
  31. package/workers/record-feature/worker.ts +9 -6
  32. package/workers/record-feature-escalation/worker.test.ts +74 -0
  33. package/workers/record-feature-escalation/worker.ts +42 -0
  34. package/workers/record-plan/worker.ts +3 -0
  35. package/workers/record-plan-review/worker.ts +3 -6
  36. package/workers/record-results/worker.ts +3 -3
  37. package/workers/record-trial-merge/worker.ts +4 -0
  38. package/workers/record-wave/worker.ts +3 -0
  39. package/workers/resolve-trial-attention/worker.ts +3 -5
  40. package/workers/retro-gather/worker.ts +3 -3
  41. package/workers/retro-record/worker.ts +4 -8
  42. package/workers/select-wave/worker.ts +3 -4
@@ -8,16 +8,12 @@
8
8
  // exposes the raw transcript under the `io.nanobpm.agentResult` envelope's `.output`.
9
9
  import type { AppJobHandler } from "@nanobpm/urban";
10
10
  import { recordRetro } from "../../app/retro.ts";
11
+ import type { WorkerInputs } from "../../nano-generated/worker-io.d.ts";
11
12
 
12
13
  const AGENT_RESULT_KEY = "io.nanobpm.agentResult";
13
14
 
14
- interface In extends Record<string, unknown> {
15
- planKey: string;
16
- retroLearnings?: number;
17
- status?: unknown; // filed | skipped | blocked
18
- pr?: unknown; // "<owner>/<repo>#<n>" of the promotion PR, when filed
19
- summary?: unknown;
20
- }
15
+ // Input typed off the model data envelope (`RetroRecordIn` in retro.bpmn) — ADR 0040.
16
+ type In = WorkerInputs["pr.retro-record"];
21
17
 
22
18
  function asStr(v: unknown): string | null {
23
19
  return typeof v === "string" && v.trim() !== "" ? v.trim() : null;
@@ -42,7 +38,7 @@ const handler: AppJobHandler<In> = async (job, app) => {
42
38
  const summary = asStr(job.variables.summary);
43
39
 
44
40
  // biome-ignore lint/plugin: runtime/framework contract boundary for external data shape
45
- const env = job.variables[AGENT_RESULT_KEY] as { output?: unknown } | undefined;
41
+ const env = (job.variables as Record<string, unknown>)[AGENT_RESULT_KEY] as { output?: unknown } | undefined;
46
42
  const report = typeof env?.output === "string" ? env.output : null;
47
43
 
48
44
  await recordRetro(app.data, planKey, {
@@ -16,11 +16,10 @@
16
16
  // immediately (the same 0-task path the flat fan-out already relied on).
17
17
  import type { AppJobHandler } from "@nanobpm/urban";
18
18
  import { plans, planTaskDeps, planTasks } from "../../app/plan.ts";
19
+ import type { WorkerInputs } from "../../nano-generated/worker-io.d.ts";
19
20
 
20
- interface In extends Record<string, unknown> {
21
- planKey: string;
22
- currentWave: number;
23
- }
21
+ // Input typed off the model data envelope (`SelectWaveIn` in plan-fanout.bpmn) — ADR 0040.
22
+ type In = WorkerInputs["pr.select-wave"];
24
23
  interface WaveTaskOut {
25
24
  id: string;
26
25
  title: string;