Skip to content

feat(#516): Complete domain extraction - codegen tests, studio imports, verification#526

Merged
chelslava merged 12 commits into
mainfrom
feature/516-domain-extraction
Jun 8, 2026
Merged

feat(#516): Complete domain extraction - codegen tests, studio imports, verification#526
chelslava merged 12 commits into
mainfrom
feature/516-domain-extraction

Conversation

@chelslava

Copy link
Copy Markdown
Owner

What's Changed

Issue #522 — Codegen tests (186 tests)

  • Added Vitest test infrastructure to packages/codegen
  • 5 test suites with 186 tests:
    • utils.test.ts (70): sanitizeIdentifier, sanitizeString, reprValue, formatSwitchCondition, getActivityKeyword
    • graph.test.ts (26): buildGraph, findReachableDistances, findCommonMergeNode
    • mermaidGenerator.test.ts (50): diagramToMermaid, getMermaidTheme
    • generator.test.ts (36): generatePythonCode, all control flow constructs
    • golden.test.ts (4): regression tests with fixture files

Issue #523 — Studio imports migration

  • Added @rpaforge/domain-model and @rpaforge/codegen as workspace dependencies
  • Updated types/domain-model.ts to re-export from @rpaforge/domain-model with React Flow compatibility
  • Old domain/codegen/ and utils/mermaidGenerator.ts → re-export shims to @rpaforge/codegen
  • tsc --noEmit passes cleanly

Issue #524 — Verification

  • Golden tests with fixture diagrams (simple + complex processes)
  • Knowledge base updated

Bug fix found during testing

  • Library import generation order: In generator.ts, library imports were generated before the generateNode traversal that populates the libraries Set. Moved import generation to after node processing. This meant library import statements were silently missing from generated Python code.

chelslava added 7 commits June 8, 2026 02:37
Add vitest@^2.1.9 devDependency, test scripts, and vitest.config.ts with node environment. Part of issue #522.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
96 tests: sanitizeIdentifier, sanitizeString, reprValue, formatSwitchCondition, getActivityKeyword (utils) + buildGraph, findReachableDistances, findCommonMergeNode (graph). Part of issue #522.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
50 tests: diagramToMermaid with all node shapes and edge types, getMermaidTheme, sanitizers. Part of issue #522.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Bugfix: library imports were generated before generateNode() populated the libraries Set. Moved import generation to after node traversal loop.

36 tests for generatePythonCode covering all control flow constructs (if/else, switch, try-catch, while, for-each, activity, assign, throw). Part of issues #522, #524.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
4 golden tests with simple-process and complex-process fixtures (start→if/else→activities→end). Ensures codegen output remains stable across changes. Part of issue #524.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
…domain-model

Add workspace dependencies, update domain-model shim with React Flow compatibility, replace old codegen/mermaid files with re-export shims. Part of issue #523.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Record completion of issues #522 (tests), #523 (imports), #524 (verification).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Comment thread packages/codegen/src/golden/complex-process.txt Fixed
…urity audit

Ruff was flagging golden fixture .py files as invalid Python. Added exclude = ["packages/codegen/src/golden/"] to [tool.ruff].

Security audit found CVE in vitest <=4.1.0 (GHSA-5xrq-8626-4rwp). Upgraded from ^2.1.9 to ^4.1.8 to resolve the critical vulnerability.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
@codecov

codecov Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

chelslava added 3 commits June 8, 2026 02:57
…install

Add pnpm prepare scripts to @rpaforge/codegen and @rpaforge/domain-model so tsc runs on pnpm install, ensuring dist/ exists for studio type resolution.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
…resolution

Add @rpaforge/domain-model as dependency so pnpm runs prepare scripts in topological order (domain-model first, then codegen).

Remove paths and references from codegen's tsconfig — npm dependency handles resolution.

Exclude src/golden/ from tsc build (fixtures, not source).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
… .txt

package-lock.json had stale @vitest/* 2.1.9 entries under packages/codegen/node_modules/ from before the vitest 4.x upgrade. Removed them so npm audit no longer flags GHSA-5xrq-8626-4rwp.

Renamed golden/.py fixtures to .txt — they are reference files (not real Python), and CodeQL was flagging complex-process.py for invalid syntax (${status}).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
@chelslava chelslava merged commit 73be993 into main Jun 8, 2026
19 checks passed
@chelslava chelslava deleted the feature/516-domain-extraction branch June 8, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants