refactor: extract generatorDispatch + factBreakout to forge/ (tier-2) - #137
Conversation
…30) Move the byte-identical generatorDispatch, writeUnder, and factBreakout functions from ai-forge/ and saas-forge/ into forge/generators.mjs and forge/breakouts.mjs. Both products re-export from the shared module so downstream import paths are unchanged. Product-specific code stays product-side: - ai-forge: makePatternGenerators, runPatternBreakouts - saas-forge: makeDemoGenerators, runTeamBreakouts (incl. fight logs) Adds forge/scripts/test-boundaries.mjs — a CI grep guard that asserts neither product imports from the other. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhZFdxVtf2rgMnzxCEW5NS
|
@claude take care of th9s please |
|
Claude finished @dsmcewan's task in 1m 27s —— View job Review complete ✅
CI status: both Code review — looks correct, nothing to fix:
I wasn't able to execute Verdict: this PR is clean, scoped correctly, and CI-green — looks ready to merge as-is. No changes needed from me. |
…raction # Conflicts: # forge/package.json
Summary
Closes the tier-2 scope from #30 — extracts the byte-identical
generatorDispatch,writeUnder, andfactBreakoutfunctions into sharedforge/modules.forge/generators.mjs— sharedgeneratorDispatch+writeUnder(extracted from both forges)forge/breakouts.mjs— sharedfactBreakout(extracted from both forges)forge/scripts/test-boundaries.mjs— CI grep guard: assertsai-forge/never imports fromsaas-forge/and vice versaBoth products re-export from the shared modules, so zero downstream consumer changes — all existing import paths work unchanged, including the 4 doc run scripts.
Product-specific code stays product-side:
makePatternGeneratorsmakeDemoGeneratorsrunPatternBreakoutsrunTeamBreakouts(incl. fight-log persistence)Test plan
npm test --prefix forge— 5 existing tests + boundary guard passnpm test --prefix ai-forge— all 15 tests pass with zero test modificationsnpm test --prefix saas-forge— all 3 tests pass with zero test modificationsnode --checkon all 4 doc run scripts (re-export means paths unchanged)🤖 Generated with Claude Code
https://claude.ai/code/session_01FhZFdxVtf2rgMnzxCEW5NS