Repository navigation
ci(lint): guard workflow module boundaries - #1609
huong8373tt-beep wants to merge 4 commits into
Conversation
|
Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content. |
Validation: The description records real-CLI runs and a focused harness invoking real oxlint with the plugin. No missing-e2e finding. I only read the requested diff; I ran no PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
No blocking findings: the Vitest scanner stays in this slice, so nothing loses coverage, and the branch merges cleanly. But the rule is turned on as error, and the CI review's four findings are real gaps I'd fix before it replaces the scanner:
- [P2 non-blocking] The allow-list checks the local name, so
import { takeRunLock as lock }is rejected. Checkimported.name. - [P2 non-blocking] The early return after an allowed entry skips the flat-module check, so
src/workflow/engine.tsimporting./drivers/skill/skill-driver.jspasses. - [P2 non-blocking] Dynamic
import()andexport *carry no specifiers, so a type-only or symbol-limited target passes through them. Treat "no specifiers" as "everything". - [P2 non-blocking]
typeOnly()is per declaration, so a mixedimport { type X, envAdvice }checks the type name against the value allow-list. Decide per specifier.
Each wants a rule.invalid or rule.valid case. The test file has 16 lines for a 174-line rule.
@jeff-r2026 Your call: ready once those are in, or now if you're happy to fix them in the slice that removes the scanner.
|
Follow-up pushed in
Added focused regression coverage: 14 tests passed through the real oxlint harness. Also passed Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content. |
Earlier findings: All four are resolved in the current diff. Validation: The description documents representative real-CLI runs and a real-oxlint harness; no missing-e2e finding. I only read the requested diff and ran no PR code. |
|
Follow-up pushed in
Added focused real-oxlint harness coverage for both cases. Validation passed: 16 focused tests, Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content. |
Earlier findings: All six are resolved in the current diff. Validation: The description records build and representative real-CLI runs, plus a real-oxlint harness; no missing-e2e finding. I only read the requested diff and ran no PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Re-checked at f838de0b. Both follow-ups work: a renamed re-export is checked by its source name, and export type * passes as type-only, each with a test.
[P2 non-blocking] Moving specifier.local?.name ahead of exported also applies it to default and namespace imports, which have no imported. So import * as takeRunLock from '../../store.js' resolves to takeRunLock and passes the store allowlist, and the '*' / 'default' fallbacks are now unreachable. Reading local only for an ExportSpecifier keeps both fixes:
name: specifier.imported?.name
?? (specifier.type === 'ExportSpecifier' ? specifier.local?.name : undefined)
?? (specifier.type === 'ImportNamespaceSpecifier' ? '*' : specifier.type === 'ImportDefaultSpecifier' ? 'default' : ''),A namespace-import case in the tests would pin it. This is the same point as the automated review's first item. Its second item, explicit .ts specifiers, cannot occur while tsconfig does not allow .ts imports, so I would leave it.
@jeff-r2026 Your call: ready from my side; the point above needs an odd local name to bite.
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
[P1 blocking] #1590 moves each static check into lint and deletes the Vitest test it replaces, so CI gets shorter. This PR adds teamai/workflow-boundaries but keeps src/__tests__/workflow-module-boundaries.test.ts (250 lines, a web-tree-sitter parse of all of src/ with a 60 s timeout), which #1590 names as the slowest of these scanners. Deleting it is the main point of this slice. The rule's allowlist entry for that test file can go with it.
@jeff-r2026 Your call once the old test is gone.
|
Confirmed the final workflow-boundaries follow-up is resolved in Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Requesting changes for the [P1 blocking] point above (#1609 (review)): this slice must delete the Vitest scan it replaces, per #1590.
|
Pushed |
Thank you for this. #1630 has just merged and moved all of #1590 into |
Summary
Part of #1590. This draft moves the existing workflow module-boundary invariant from the Vitest source-graph scanner into the TeamAI oxlint plugin.
The new
teamai/workflow-boundariesrule preserves the current guards for skill drivers, local drivers, place/discovery entry points, and flat workflow modules. It also keeps the three documented test-only exceptions and handles static imports, exports, dynamic imports, andvi.mockpaths.Validation
npx vitest run oxlint-plugin-teamai/rules/workflow-boundaries.test.ts— 8 passednpm run typecheck— passednpm run lint— 0 warnings, 0 errors across 1,454 filesnpm run build— passednode dist/index.js --version—0.22.0node dist/index.js list --help— exit 0git diff --check— passedThe focused harness launches the real oxlint binary and loads the plugin rule. The existing workflow module-boundaries Vitest scanner remains in place in this slice; deletion will follow once the migration has been reviewed.
Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.