Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
Workflows: one switch — Publish / Unpublish — implementation plan
Spec / source: .ai/specs/2026-08-24-workflow-publish-unpublish.md
Research: .ai/research/2026-08-24-workflow-version-terminology.md
Branch: fix/workflow-version-copy-changes
Goal: delete workflow.active, rename workflow.activeVersionId →
workflow.publishedVersionId, and make Publish/Unpublish the only on-off switch.
"Published"/"Draft" is the only state vocabulary; the words "Active" and "Live" leave the
product entirely.
Progress
- Task 1: Write and apply the migration
- Task 2: Regenerate database types
- Task 3: Gate
syncWorkflowTriggersonpublishedVersionIdalone - Task 4: Drop the
activepredicates from the scheduler - Task 5: Rename the engine's run-context gate to
workflowPublished - Task 6: Replace
setWorkflowActivewithunpublishWorkflow - Task 7: Swap the column in the service and list loader
- Task 8: Turn the toggle route into an unpublish route
- Task 9: List page — drop the Active column, add Unpublish to the row menu
- Task 10: Builder — Publish/Unpublish button and Published tag
- Task 11: Update the trigger-drift SQL invariant
- Task 12: Update the demo datasets
- Task 13: Update AGENTS.md, rules, and the docs site
- Task 14: Extract i18n strings
- Task 15: End-to-end verification
Dependencies
- Task 2 needs Task 1. Everything else needs Task 2 (the generated types are what make the new column name typecheck).
- Tasks 3, 4, 5, 6, 7, 8, 11, 12 are independent of each other — safe to run in parallel.
- Task 9 needs Tasks 7 and 8. Task 10 needs Task 8.
- Task 14 needs Tasks 9 and 10. Task 15 needs everything.
Task 1: Write and apply the migration
Depends on: none Files:
- Create:
packages/database/supabase/migrations/<timestamp>_workflow-publish-unpublish.sql(the command below generates the name) - Read for context:
packages/database/supabase/migrations/20260810100100_workflows-foundation.sql— lines 32–52 (table), 76–81 (FK), 183–185 (the partial index)
Steps:
- Create the migration file:
pnpm db:migrate:new workflow-publish-unpublish - Put exactly this in it:
-- Publishing is now the only on-off switch: workflow."publishedVersionId" set means the -- workflow runs that version, NULL means it is a draft and nothing fires. -- A workflow that was published but switched OFF is deliberately paused. Collapsing the -- two flags would silently resume it, so unpublish it while "active" still records intent. UPDATE "workflow" SET "activeVersionId" = NULL WHERE "active" = FALSE; -- ...and its dispatch rows with it, matching what syncWorkflowTriggers does on unpublish. -- Must run BEFORE the column is dropped. DELETE FROM "workflowTriggerEvent" te USING "workflow" w WHERE te."workflowId" = w."id" AND te."companyId" = w."companyId" AND w."active" = FALSE; -- Postgres silently drops any index whose predicate names a dropped column, and -- "workflow_due_idx" is partial on "active" = TRUE. Rebuild it, or the scheduler loses -- its index with no error anywhere. DROP INDEX IF EXISTS "workflow_due_idx"; ALTER TABLE "workflow" DROP COLUMN "active"; ALTER TABLE "workflow" RENAME COLUMN "activeVersionId" TO "publishedVersionId"; ALTER TABLE "workflow" RENAME CONSTRAINT "workflow_activeVersionId_fkey" TO "workflow_publishedVersionId_fkey"; CREATE INDEX "workflow_due_idx" ON "workflow" ("nextRunAt") WHERE "nextRunAt" IS NOT NULL AND "publishedVersionId" IS NOT NULL; - Do NOT drop and re-add the FK. Its
ON DELETE SET NULL ("activeVersionId")clause names its column explicitly on purpose (a bareSET NULLwould also nullcompanyId, which isNOT NULL, making the parent row undeletable — see.ai/lessons.md).RENAME COLUMNcarries that clause across intact. - Apply it:
If the local database is not running, STOP and report — do not rebuild or reset the database.pnpm db:migrate
Verify:
psql "$SUPABASE_DB_URL" -c '\d "workflow"' -c "SELECT indexdef FROM pg_indexes WHERE indexname = 'workflow_due_idx';"
# Expected: the column list shows "publishedVersionId" and NO "active" column;
# the constraint is named workflow_publishedVersionId_fkey;
# indexdef contains: WHERE ((("nextRunAt" IS NOT NULL) AND ("publishedVersionId" IS NOT NULL)))
Out of scope: eventSystemSubscription.active (a different table, correctly named);
workflowRun_active_idx (an index on workflowRun, unrelated to this column); every
workflowVersion column.
Task 2: Regenerate database types
Depends on: Task 1 Files:
- Modify (generated, never hand-edited):
packages/database/src/types.ts,packages/database/src/swagger-docs-schema.ts,packages/database/supabase/functions/lib/types.ts
Steps:
- Run:
pnpm run generate:types - These three files already carry uncommitted regeneration drift on this branch. That is expected — the regen absorbs it, so the diff is wider than this feature. Do not try to revert or narrow it, and do not hand-edit any of them.
Verify:
grep -c 'publishedVersionId' packages/database/src/types.ts
grep -n '"active"' packages/database/src/types.ts | grep -i workflow
# Expected: the first prints a number >= 3 (Row/Insert/Update);
# the second prints nothing for the `workflow` table (eventSystemSubscription hits are fine)
Out of scope: hand-editing any generated file.
Task 3: Gate syncWorkflowTriggers on publishedVersionId alone
Depends on: Task 2 Files:
- Modify:
packages/workflows/src/sync.ts— the select and gate insidesyncWorkflowTriggers(around lines 166–188) - Modify:
packages/workflows/src/seed-workflows.test.ts— anyactivereference
Steps:
- Change the select from
["active", "activeVersionId"]to["publishedVersionId"]. - Change the gate
if (workflow?.active && workflow.activeVersionId) {toif (workflow?.publishedVersionId) {, and the.where("id", "=", workflow.activeVersionId)below it toworkflow.publishedVersionId. - Update the doc comment above
CompanyLockand thenextRunAtcomment: "a promote or toggle" becomes "a publish or unpublish". - Leave everything else in the transaction alone — the
lockCompanyfirst statement, the delete-then-insert ofworkflowTriggerEvent, theeventSystemSubscriptionreconciliation, and thenextRunAtwrite are all unchanged.
Verify:
pnpm --filter @carbon/workflows test && pnpm exec turbo run typecheck --filter=@carbon/workflows
# Expected: all tests pass; no TypeScript errors
Out of scope: deriveWorkflowSubscriptions, deriveWorkflowTriggerRows,
findTriggerSchedule — none of them read the workflow row.
Task 4: Drop the active predicates from the scheduler
Depends on: Task 2 Files:
- Modify:
packages/jobs/src/workflows/scheduler.ts— lines ~26, 39, 46, 50–51, 60–61, 70–71, 253 - Modify:
packages/jobs/src/workflows/scheduler.test.ts
Steps:
- Delete both
.where("w.active", "=", true)lines. The.where("w.activeVersionId", "is not", null)beside each one already expresses the whole condition once the flag is gone. - Rename
activeVersionId→publishedVersionIdeverywhere in the file: the row type field, theonRef("v.id", "=", "w.activeVersionId")join, the select list, the remainingis not nullpredicates, the type-narrowing predicate function, andworkflowVersionId: row.activeVersionId. - Update the test fixtures/inserts to drop
activeand use the new column name.
Verify:
pnpm --filter @carbon/jobs test -- scheduler && pnpm exec turbo run typecheck --filter=@carbon/jobs
# Expected: scheduler tests pass; no TypeScript errors
Out of scope: activeRunKeys / activeKeys / workflowRun_active_idx — those describe
in-flight RUNS, not the publish state. Do not rename them.
Task 5: Rename the engine's run-context gate to workflowPublished
Depends on: Task 2 Files:
- Modify:
packages/jobs/src/workflows/engine/log.ts— the context type (line ~15), the select (line ~54), the mapping (line ~76) - Modify:
packages/jobs/src/workflows/engine/execute.ts—SWITCHED_OFF(line 72) and the guard (line ~378) - Modify:
packages/jobs/src/workflows/engine/execute.test.ts,end-to-end.test.ts,batch.test.ts— theworkflowActive: truefixtures
Steps:
- In
log.ts: rename the type fieldworkflowActive: boolean→workflowPublished: boolean; change the select from"w.active as workflowActive"tosql`w."publishedVersionId" IS NOT NULL`.as("workflowPublished")(importsqlfromkyselyif it is not already imported in that file); change the mapping toworkflowPublished: row.workflowPublished === true. - In
execute.ts: change the guard toif (!context.workflowPublished) {and change the constant to:
Rename the constant itself toconst SWITCHED_OFF = "This workflow was unpublished before the run started.";UNPUBLISHEDso the name matches the string, and update its single other use at thestatusReasonline. - Update the three test fixtures to
workflowPublished: true. - The guard deliberately asks "is the workflow published at all", NOT "is this run's version
still the published one". A run already in flight keeps the version it started with even
after a newer version is published — that is existing documented behaviour. If you find
yourself comparing
publishedVersionIdto the run'sworkflowVersionId, STOP and report.
Verify:
pnpm --filter @carbon/jobs test && pnpm exec turbo run typecheck --filter=@carbon/jobs
# Expected: all @carbon/jobs tests pass; no TypeScript errors
Out of scope: matcher.ts — it never read workflow.active; its gate is the presence of
workflowTriggerEvent rows, which Task 3 already controls.
Task 6: Replace setWorkflowActive with unpublishWorkflow
Depends on: Task 2 Files:
- Modify:
apps/erp/app/modules/workflows/workflows.server.ts—publishWorkflowVersion(line 136),line 154), and thesetWorkflowActive(syncAfterWorkflowDeletedoc comment (~line 197) - Modify:
apps/erp/app/modules/workflows/workflows.models.ts— deleteworkflowToggleValidator(~line 69)
Steps:
- In
publishWorkflowVersion, change the update payload from{ activeVersionId: versionId, active: true, ... }to{ publishedVersionId: versionId, ... }. Keep theupdatedBy/updatedAtfields and thedatetime.timestamp()call exactly as they are. - Replace
setWorkflowActivewith:
There is no boolean parameter: publishing needs a version id and runs validation, so it cannot share an entry point with unpublishing.export async function unpublishWorkflow( client: SupabaseClient<Database>, { workflowId, companyId, userId }: { workflowId: string; companyId: string; userId: string; } ): Promise<WorkflowSyncResult> { const updated = await client .from("workflow") .update({ publishedVersionId: null, updatedBy: userId, updatedAt: datetime.timestamp() }) .eq("id", workflowId) .eq("companyId", companyId); if (updated.error) { return { ok: false, issues: [], message: updated.error.message }; } // Unpublishing must still sync — that is what deletes the trigger rows and clears // nextRunAt, which is what actually stops the workflow firing. return syncAndWake(companyId, workflowId); } - Delete
workflowToggleValidatorfromworkflows.models.ts. - In the
syncAfterWorkflowDeletecomment, change "the next publish or toggle" to "the next publish or unpublish".
Verify:
grep -rn "setWorkflowActive\|workflowToggleValidator" apps/erp/app
# Expected: only the not-yet-updated route hit from Task 8; zero after Task 8 lands
Out of scope: validateDefinition, readWorkflowVersion, syncAndWake internals.
Task 7: Swap the column in the service and list loader
Depends on: Task 2 Files:
- Modify:
apps/erp/app/modules/workflows/workflows.service.ts—getWorkflows(lines 18, 29–42),line 62), and the embed at ~line 489getWorkflow( - Modify:
apps/erp/app/routes/x+/workflows+/_index.tsx— lines ~37–46
Steps:
- In
getWorkflows, change the select string from"id, name, description, ownerId, active, activeVersionId, createdAt, updatedAt"to"id, name, description, ownerId, publishedVersionId, createdAt, updatedAt"—activeis dropped entirely, not renamed. - Update the derived-status comment to say
publishedVersionId, and change the two filter branches to.not("publishedVersionId", "is", null)and.is("publishedVersionId", null). The"Published"/"Draft"filter VALUES are unchanged — they are what the UI sends and what saved views already store. - In
getWorkflow(~line 62), dropactive,and renameactiveVersionIdin the select string. - At ~line 489, change
"workflowId, workflow(activeVersionId)"to"workflowId, workflow(publishedVersionId)"and update whatever reads that field. - In
_index.tsx, rename the localactiveVersionIds→publishedVersionIdsand readrow.publishedVersionId.
Verify:
pnpm exec turbo run typecheck --filter=erp
# Expected: no errors mentioning `active` or `activeVersionId`.
# NOTE: the filter is `erp`, NOT `@carbon/erp` — a wrong filter silently passes.
# If turbo returns a cached pass, re-run with --force before trusting it.
Out of scope: the GenericQueryFilters pipeline; getWorkflowVersionNumbers;
getWorkflowLastRuns.
Task 8: Turn the toggle route into an unpublish route
Depends on: Tasks 2, 6 Files:
- Create:
apps/erp/app/routes/x+/workflow+/$id.unpublish.tsx - Delete:
apps/erp/app/routes/x+/workflow+/$id.toggle.tsx - Modify:
apps/erp/app/utils/path.ts— line ~2201 - Copy from (precedent):
apps/erp/app/routes/x+/workflow+/$id.toggle.tsx(the file being replaced) and$id.publish.tsxfor the permission + plan gate shape
Steps:
- Create the new route with the same imports,
assertIsPost,requirePermissions({ update: "workflows" })andrequirePlan({ feature: "WORKFLOWS" })blocks as the toggle route. Drop the validator entirely — unpublish carries no fields — and call:const unpublished = await unpublishWorkflow(client, { workflowId: id, companyId, userId }); if (!unpublished.ok) { return data( { success: false }, await flash( request, error(null, unpublished.message ?? "Failed to unpublish") ) ); } return data( { success: true }, await flash(request, success("Workflow unpublished")) ); - Keep the header comment's intent, updated: this is the one route both the list menu and the builder button post to, so there is exactly one place that re-syncs the trigger rows.
- Delete
$id.toggle.tsx. - In
path.ts, replace theworkflowToggleentry with:
Keep the alphabetical ordering of the surrounding keys (it sits afterworkflowUnpublish: (id: string) => generatePath(`${x}/workflow/${id}/unpublish`),workflowTestRun).
Verify:
grep -rn "workflowToggle\|toggle.tsx" apps/erp/app | grep -i workflow
# Expected: no output
Out of scope: $id.publish.tsx — its path, validator and gates do not change.
Task 9: List page — drop the Active column, add Unpublish to the row menu
Depends on: Tasks 7, 8 Files:
- Modify:
apps/erp/app/modules/workflows/ui/WorkflowsTable.tsx - Delete:
apps/erp/app/modules/workflows/ui/WorkflowActiveCheckbox.tsx - Delete:
apps/erp/app/modules/workflows/ui/WorkflowActiveSwitch.tsx(already unused — nothing imports it) - Modify:
apps/erp/app/modules/workflows/ui/index.ts(or whichever barrel re-exports those two, if any) - Modify:
apps/erp/app/modules/workflows/ui/WorkflowsUpgradeOverlay.tsx— its fake sample rows carry anactivefield (lines ~20–32) - Copy from (precedent): the existing
ConfirmDeleteusage at the bottom ofWorkflowsTable.tsx(~lines 281–297) for the disclosure + selected-row + modal pattern, andapps/erp/app/components/Modals/Confirm/Confirm.tsxfor the dialog itself
Steps:
- Delete the whole
accessorKey: "active"column object (~lines 117–130) and theWorkflowActiveCheckboximport. - Leave the
statuscolumn exactly as it is — it already rendersPublished/Draftbadges and the same static filter. Only itsisPublishedderivation changes source:Boolean(row.original.publishedVersionId), andexportValuelikewise. - Add an
unpublishDisclosure = useDisclosure()beside the existingrenameDisclosure/deleteDisclosure. - In
renderContextMenu, add between Rename and Delete:
Import<MenuItem disabled={ !permissions.can("update", "workflows") || !row.publishedVersionId } onClick={() => { flushSync(() => setSelectedWorkflow(row)); unpublishDisclosure.onOpen(); }} > <MenuIcon icon={<LuCircleStop />} /> {t`Unpublish`} </MenuItem>LuCircleStopfromreact-icons/lualongside the existingLu*imports. AddunpublishDisclosureto therenderContextMenudependency array. - Render the confirm beside the existing modals:
Import{unpublishDisclosure.isOpen && selectedWorkflow && ( <Confirm action={path.to.workflowUnpublish(selectedWorkflow.id)} isOpen title={t`Unpublish ${selectedWorkflow.name}?`} text={t`It will stop running until you publish a version again. Nothing is deleted.`} confirmText={t`Unpublish`} onCancel={() => { setSelectedWorkflow(null); unpublishDisclosure.onClose(); }} onSubmit={() => { setSelectedWorkflow(null); unpublishDisclosure.onClose(); }} /> )}Confirmfrom~/components/Modals(it is exported from that barrel alongsideConfirmDelete). - In
WorkflowsUpgradeOverlay.tsx, remove theactivefield from every sample row and whatever renders it, so the marketing preview matches the real table's columns.
Verify:
pnpm exec turbo run typecheck --filter=erp && pnpm exec biome check apps/erp/app/modules/workflows
# Expected: no TypeScript errors; biome reports no NEW errors
# (the repo has ~419 pre-existing warnings — leave those alone)
Out of scope: the status column's badge copy and filter values (unchanged by design);
the Table component; saved views.
Task 10: Builder — Publish/Unpublish button and Published tag
Depends on: Task 8 Files:
- Modify:
apps/erp/app/modules/workflows/ui/Builder/WorkflowVersionStatus.tsx - Modify:
apps/erp/app/modules/workflows/ui/Builder/BuilderHeader.tsx— lines ~139–156, ~196–270 - Modify:
apps/erp/app/modules/workflows/ui/WorkflowLockModal.tsx— verify the copy at line ~104 still reads correctly - Copy from (precedent): the existing
confirmPublishdisclosure +Modalblock inBuilderHeader.tsx(~lines 238–270) for the second confirm dialog
Steps:
WorkflowVersionStatus.tsx: rename the propisLive→isPublished, the early returnif (!isPublished) return null;, and the badge text from<Trans>Live</Trans>to<Trans>Published</Trans>. Keepvariant="green".BuilderHeader.tsx:- Rename the locals:
live→published,isLiveVersion→isPublishedVersion, both readingworkflow.publishedVersionId. - Update the lock-glyph comment and the tooltip text to
<Trans>This version is published. Create a new version to edit.</Trans>. renderStatuspassesisPublished={v.id === workflow.publishedVersionId}.- Replace the single Publish button with a conditional. When
isPublishedVersionis true, render an Unpublish button (variant="secondary") that opens a newconfirmUnpublishdisclosure; otherwise render the existing Publish button. The Publish button keeps itsisDisabledon!permissions.can("update", "workflows")and the in-flight fetcher state, but DROPSisLiveVersionfrom that condition — the published version now shows Unpublish rather than a permanently disabled Publish. - The Unpublish confirm posts to
path.to.workflowUnpublish(workflow.id). ReuseConfirmfrom~/components/Modals(same component as Task 9) rather than hand-rolling a second inlineModal: titlet`Unpublish this workflow?`, textt`It will stop running until you publish a version again. Nothing is deleted.`, confirmTextt`Unpublish`. - Update the replace-confirm copy: title stays
t`Publish Version ${current.versionNumber}?`, body becomest`Version ${published.versionNumber} is published now and will be replaced.`.
- Rename the locals:
- Check
WorkflowLockModal.tsxline ~104 ("Branch an editable copy of this version that you can change and publish.") — already correct, leave it unless it mentions Live or Active.
Verify:
grep -rn "isLive\|Trans>Live<\|is live" apps/erp/app/modules/workflows
# Expected: no output
pnpm exec turbo run typecheck --filter=erp
# Expected: no TypeScript errors
Out of scope: the builder store's isVersionLocked / canChangeDefinition /
canMoveNodes logic — the locking model does not change; IssuesPanel.tsx ("N problems —
not published") is already correct.
Task 11: Update the trigger-drift SQL invariant
Depends on: Task 2 Files:
- Modify:
packages/checks/src/invariants/workflow-trigger-event-drift.sql
Steps:
- Rename the
activeCTE topublished, and update the threeFROM active a/FROM declaredreferences accordingly. - Replace
WHERE w."active" = TRUEwithWHERE w."publishedVersionId" IS NOT NULL, and renamew."activeVersionId"→w."publishedVersionId"in the CTE select and in the finalt."workflowVersionId" <> d."activeVersionId"comparison. - Reword the three violation strings and the header comment: "an active workflow's" → "a published workflow's"; "an active, promoted version" → "a published version"; "points at a version that is no longer the active one" → "…no longer the published one".
Verify:
pnpm --filter @carbon/checks invariants
# Expected: workflow-trigger-event-drift reports zero violating rows
pnpm --filter @carbon/checks workflow-events
# Expected: passes
If the local database is unreachable these two cannot run — say so explicitly in the report rather than marking the task verified.
Out of scope: every other file in packages/checks/src/invariants/.
Task 12: Update the demo datasets
Depends on: Task 2 Files:
- Modify:
packages/database/src/datasets/tiers/workflow-definitions.ts—SeedWorkflow.activeat lines 63–70 - Modify:
packages/database/src/datasets/tiers/11-workflows.ts— lines ~83–109 - Modify:
packages/database/src/datasets/data/satellite/workflows.ts,data/robotics/workflows.ts,data/precision/workflows.ts,data/motor/workflows.ts— each has oneactive: trueand sixactive: false
Steps:
- Rename the
SeedWorkflowfieldactive: boolean→published: booleanand update its doc comment ("Only the simplest one ships published; the rest are there to read and publish deliberately."). - Rename
active:→published:in all four data files (7 occurrences each). - In
11-workflows.ts:- The log line becomes
ctx.log(`workflow — ${workflow.name}${workflow.published ? "" : " (draft)"}`). - Drop
active: workflow.activefrom theinsertId(ctx, "workflow", {...})payload. - The
UPDATE "workflow" SET "activeVersionId" = $1statement becomesSET "publishedVersionId" = $1and now runs only whenworkflow.published— replace the old comment (which explained why it was set even when off) with: an unpublished seeded workflow is a draft, so it gets no pointer and no trigger rows. - Keep the
if (!workflow.published) continue;guard that skips the trigger rows.
- The log line becomes
- Do NOT touch
reconcileSubscriptions'sactive: true— that is aneventSystemSubscriptioncolumn.
Verify:
pnpm db:check:datasets
# Expected: all four datasets apply and roll back cleanly, no errors
Row counts per table must be unchanged (same workflows, same versions, one published workflow
with trigger rows per dataset), so .ai/runs/*-baseline.txt stays valid. If a count moves,
STOP and report — do not update the baselines.
Out of scope: the workflow definitions themselves (nodes/edges); every other tier.
Task 13: Update AGENTS.md, rules, and the docs site
Depends on: Tasks 3–12 Files:
- Modify:
apps/erp/app/modules/workflows/AGENTS.md— the Vocabulary entry (line ~9), the Publish entry (line ~13), the validation-command comment (line ~42), the file-tree comment (line ~51), the server-function bullet (line ~72) - Modify:
packages/workflows/AGENTS.md— the if-and-only-if rule (~line 302) - Modify:
.claude/rules/workflow-matcher.md— thesyncWorkflowTriggersbullet ("Call it on promote, on trigger edit, and on activate/deactivate") and the surroundingactive/pointer wording - Modify:
.claude/rules/workflow-engine.md— the skipped-run reason string, if it quotes it - Modify:
docs/content/docs/reference/workflows.mdx— lines ~113–117 and ~129
Steps:
apps/erp/app/modules/workflows/AGENTS.md: the Vocabulary entry currently explains that the pointer and the boolean are separate columns on purpose. That reasoning is now wrong. Replace it: a workflow carriesownerIdandpublishedVersionId; the pointer IS the on-off switch — set means published and running that version,NULLmeans draft. The Publish entry loses its "setactive" step (validate → setpublishedVersionId→syncWorkflowTriggers→ wake the scheduler) and gains Unpublish as the inverse. ReplacesetWorkflowActivewithunpublishWorkflowin the server-function bullet, and "publish/toggle" with "publish/unpublish" in the command comment.packages/workflows/AGENTS.md~line 302: aworkflowTriggerEventrow exists if and only if the workflow HAS A PUBLISHED VERSION and that version's trigger node lists the event; the third rewrite trigger becomes "unpublishing" instead of "togglingactive"..claude/rules/workflow-matcher.md: "Call it on publish, on trigger edit, and on unpublish." Fix theactive/activeVersionIdwording in the same section..claude/rules/workflow-engine.md: update the skipped reason string if quoted.docs/content/docs/reference/workflows.mdx:- Delete the entire
<Callout type="warn" title="“Published” and “Active” are different switches">block (lines ~113–115). It documents a distinction that no longer exists. - Rewrite the publishing paragraph: publishing a version makes it the one that runs; "Unpublish" stops the workflow and leaves every version intact, and publishing again starts it. There is no separate on/off switch.
- Change "This version is live. Create a new version to edit." to "This version is published…" (line ~117) and "promote another one mid-run" wording if it says "live".
- Line ~129: the Update permission row's "toggle active" becomes "unpublish".
- Delete the entire
Verify:
grep -rn -i "active switch\|activeVersionId\|are different switches" docs/content/docs/reference/workflows.mdx apps/erp/app/modules/workflows/AGENTS.md packages/workflows/AGENTS.md .claude/rules/workflow-matcher.md
# Expected: no output
pnpm --filter docs build
# Expected: build succeeds (MDX must still parse after the callout removal)
Out of scope: every other docs page; .claude/rules/workflow-event-system.md (its
active references are eventSystemSubscription, correctly named).
Task 14: Extract i18n strings
Depends on: Tasks 9, 10 Files:
- Modify:
packages/locale/locales/*/erp.po(generated by the commands below)
Steps:
- Run:
pnpm lingui:extract && pnpm lingui:clean - Fill the new strings in the other locales with the
/translateskill (it fans the work out to cheap models and merges deterministically). Do not hand-translate. - Expect churn: on this branch
lingui:extractrewrites large parts of the catalogs. Keep the commit for this task separate from the code tasks so review stays readable.
Verify:
grep -c 'msgid "Published"' packages/locale/locales/en/erp.po
# Expected: at least 1
Out of scope: the mes catalog (nothing in apps/mes touches workflows); adding locales.
Task 15: End-to-end verification
Depends on: all previous tasks Files: none (verification only)
Steps:
- Run the full scoped gate set:
pnpm exec turbo run typecheck --filter=erp --filter=@carbon/jobs --filter=@carbon/workflows --filter=@carbon/database pnpm exec biome check pnpm --filter @carbon/jobs test pnpm --filter @carbon/workflows test pnpm db:check:datasets pnpm --filter @carbon/checks workflow-events - Confirm the words are gone:
grep -rn "workflow.active\|activeVersionId" apps/erp/app packages/workflows/src packages/jobs/src packages/checks/src # Expected: no output - Browser pass with the
/auththen/testskills, against/x/workflows, covering spec acceptance criteria 4–8: publish a version (tag appears, list flips to Published), unpublish from the builder (tag gone, list reads Draft), unpublish from the list row menu, republish the same version, and confirm the Active checkbox column is gone from the table. Ask the user before driving the browser. - Report which acceptance criteria are proven by an actual command or browser run and which are not. Do not claim a criterion passed without output to back it.
Verify: every command above exits zero; every criterion in the spec's Acceptance criteria list is either demonstrated or explicitly reported as not demonstrated.
Out of scope: pnpm run build (full repo build) unless something above fails in a way that
suggests a build-only breakage; whole-repo turbo run typecheck --filter='*' (it OOMs).