feature-factory 0.7.3 → 0.7.4

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 (2) hide show
  1. package/bin/factory.js +13 -6
  2. package/package.json +1 -1
package/bin/factory.js CHANGED
@@ -1039,12 +1039,19 @@ const HANDLERS = {
1039
1039
  const at = stamp(flags);
1040
1040
  const next = await transition(runDir, {
1041
1041
  participants: [{ familyId: "envelope", mode: "terminalize" }],
1042
- apply: (state) => ({
1043
- ...state,
1044
- updated_at: at,
1045
- status,
1046
- terminal_result: { status, reason: flags.reason },
1047
- }),
1042
+ apply: (state) => {
1043
+ // Enforcement, not instruction: `completed` is the only terminal status that asserts the run earned a
1044
+ // result, and the ordering that gave it meaning -- publish, then terminalize with reason
1045
+ // `draft-pr-recorded` -- lived in WORKFLOW.md alone, so a driver that skipped the work could still
1046
+ // record success. mimir 1483 did exactly that: ~70 seconds, no commits, no pushed branch, no PR, and
1047
+ // a status a consumer binding on `status == "completed"` read as a shipped epic. `blocked` and
1048
+ // `partial` stay unguarded because they claim less, and cleanup re-terminalizes an already-published
1049
+ // run whose `pr_url` is set, so it still passes.
1050
+ if (status === "completed" && !state.pr_url) {
1051
+ throw new CliError("factory terminal completed requires a recorded pr_url; use blocked or partial");
1052
+ }
1053
+ return { ...state, updated_at: at, status, terminal_result: { status, reason: flags.reason } };
1054
+ },
1048
1055
  });
1049
1056
  return emit(flags, { run_id: runId, status: next.status, reason: next.terminal_result.reason });
1050
1057
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feature-factory",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "Durable, observed control plane for /feature runs. Host-agnostic: no opencode dependency.",
5
5
  "type": "module",
6
6
  "license": "MIT",