Files
fusion/scripts/__tests__/lifecycle-census-workflow-role.test.mjs
Phil Larson 210c22c485 fix(ci): classify workflowRole as role vocabulary (#3408)
## Summary
- Classify workflow work-item `workflowRole` comparisons as role
vocabulary in the lifecycle-column census.
- Add a regression test so triage role comparisons cannot raise a
phantom lifecycle-column guard.

## Test Plan
- `node --test scripts/__tests__/lifecycle-census*.test.mjs`
- `corepack pnpm check:lifecycle-columns`
- `corepack pnpm lint`
- `corepack pnpm check:changesets --strict`


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved classification of workflow role comparisons, including
`workflowRole === "triage"`, so they are recognized separately from
lifecycle-column comparisons.
* Ensured workflow role values are correctly identified as role
vocabulary rather than lifecycle-column values.

* **Tests**
* Added automated coverage to verify accurate workflow role and column
identification across comparison patterns.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-11 11:28:54 -10:00

24 lines
936 B
JavaScript

/*
FNXC:LifecycleColumnCensus 2026-08-10-06:00:
Workflow work-item `workflowRole` uses the triage/executor/reviewer/merger role vocabulary, not task
column ids. A triage-only comparison has no sibling role literal for the AST classifier to infer from,
so it must be named as a role receiver or the clean-main lifecycle ratchet reports a phantom column
guard and blocks every unrelated pull request.
*/
import test from "node:test";
import assert from "node:assert/strict";
import { findComparisons } from "../lib/lifecycle-column-census-ast.mjs";
test("workflowRole triage comparisons stay in the role vocabulary", () => {
const findings = findComparisons(
"t.ts",
'const held = items.find((item) => item.workflowRole === "triage");',
);
assert.deepEqual(
findings.map(({ columnId, receiver, kind }) => ({ columnId, receiver, kind })),
[{ columnId: "triage", receiver: "workflowRole", kind: "role" }],
);
});