Skip to content

CS-10585: Consolidate software-factory module layout#4358

Merged
habdelra merged 2 commits intomainfrom
cs-10585-consolidate-software-factory-module-layout-src-vs-scriptslib
Apr 9, 2026
Merged

CS-10585: Consolidate software-factory module layout#4358
habdelra merged 2 commits intomainfrom
cs-10585-consolidate-software-factory-module-layout-src-vs-scriptslib

Conversation

@habdelra
Copy link
Copy Markdown
Contributor

@habdelra habdelra commented Apr 8, 2026

Summary

  • Move all 20 library modules from scripts/lib/ into src/, eliminating the confusing split where factory-bootstrap.ts lived in src/ but factory-loop.ts lived in scripts/lib/
  • Remove obsolete src/cli/smoke-realm.ts (Playwright specs and realm-read tool executor test now cover this path)
  • Move src/cli/smoke-test-realm.ts to scripts/smoke-tests/ alongside the other smoke tests
  • Update all import paths across 51 files (src, scripts, smoke-tests, and test files)

New layout

  • src/ — all library modules (30 files)
  • src/cli/ — thin CLI entrypoints only (4 files)
  • src/harness/ — test infrastructure (unchanged)
  • scripts/ — standalone tools (boxel-search, pick-ticket, etc.)
  • scripts/smoke-tests/ — all smoke tests (7 files)

Test plan

  • All 386 node tests pass (pnpm --filter software-factory test:node)
  • ESLint + Prettier clean (pnpm --filter software-factory lint:js)
  • TypeScript compiles (only pre-existing ../base/*.gts errors, unrelated)
  • CI passes with no regressions
  • Playwright tests pass in CI

Closes CS-10585

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates the packages/software-factory module layout by moving previously split library code from scripts/lib/ into src/, deleting an obsolete CLI entrypoint, relocating the smoke-test realm script into scripts/smoke-tests/, and updating import paths across tests, scripts, and smoke tests accordingly.

Changes:

  • Move shared library modules into src/ (and adjust relative-path constants accordingly).
  • Split test-run functionality into cohesive modules (test-run-*.ts) and add a barrel re-export (factory-test-realm.ts).
  • Update imports across tests/scripts and remove src/cli/smoke-realm.ts + its package.json script.

Reviewed changes

Copilot reviewed 38 out of 51 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/software-factory/tests/runtime-schema.spec.ts Updates imports to use src/ modules after consolidation.
packages/software-factory/tests/realm-auth.test.ts Updates matrixLogin import to new src/boxel location.
packages/software-factory/tests/factory-tool-registry.test.ts Updates ToolRegistry imports to src/.
packages/software-factory/tests/factory-tool-executor.test.ts Updates ToolExecutor/Registry imports to src/.
packages/software-factory/tests/factory-tool-executor.spec.ts Updates Playwright spec imports to src/ modules.
packages/software-factory/tests/factory-tool-executor.integration.test.ts Updates integration test imports to src/.
packages/software-factory/tests/factory-tool-builder.test.ts Updates tool builder/executor/types imports to src/.
packages/software-factory/tests/factory-test-realm.test.ts Updates factory test realm imports to src/ modules.
packages/software-factory/tests/factory-test-realm.spec.ts Updates realm file ops/test realm imports to src/.
packages/software-factory/tests/factory-skill-loader.test.ts Updates skill loader + agent type imports to src/.
packages/software-factory/tests/factory-prompt-loader.test.ts Updates prompt loader + agent type imports to src/.
packages/software-factory/tests/factory-loop.test.ts Updates loop + tool builder imports to src/.
packages/software-factory/tests/factory-implement.test.ts Updates implement orchestration imports to src/.
packages/software-factory/tests/factory-context-builder.test.ts Updates context builder/skill loader imports to src/.
packages/software-factory/tests/factory-agent.test.ts Updates agent/tool builder imports to src/.
packages/software-factory/tests/factory-agent.integration.test.ts Updates integration agent import to src/.
packages/software-factory/src/test-run-types.ts Introduces shared types for realm test execution and TestRun cards.
packages/software-factory/src/test-run-parsing.ts Adds QUnit result parsing + TestResult summary formatting.
packages/software-factory/src/test-run-execution.ts Adjusts host dist path resolution to match new src/ location.
packages/software-factory/src/test-run-cards.ts Adds TestRun card create/complete/build helpers.
packages/software-factory/src/realm-operations.ts Centralizes realm HTTP operations under src/.
packages/software-factory/src/factory-tool-registry.ts Moves tool manifests + ToolRegistry to src/.
packages/software-factory/src/factory-tool-executor.ts Moves ToolExecutor to src/ and wires realm/script/boxel-cli execution.
packages/software-factory/src/factory-tool-builder.ts Moves ToolBuilder to src/ and wraps registered tools + realm ops.
packages/software-factory/src/factory-test-realm.ts Adds barrel re-export for the split test-run modules.
packages/software-factory/src/factory-target-realm.ts Updates imports to new src/boxel + src/realm-operations.
packages/software-factory/src/factory-skill-loader.ts Updates PACKAGE_ROOT resolution for new src/ location.
packages/software-factory/src/factory-prompt-loader.ts Updates prompts directory path for new src/ location.
packages/software-factory/src/factory-loop.ts Moves loop orchestrator into src/.
packages/software-factory/src/factory-implement.ts Updates imports and PACKAGE_ROOT for the new layout.
packages/software-factory/src/factory-entrypoint.ts Updates implement import to src/.
packages/software-factory/src/factory-context-builder.ts Adds ContextBuilder under src/.
packages/software-factory/src/factory-agent.ts Updates realm-auth import path and re-exports types/tool-use agent.
packages/software-factory/src/factory-agent-types.ts Introduces shared agent/tool/test types module.
packages/software-factory/src/factory-agent-tool-use.ts Updates realm-auth import path to new src/ location.
packages/software-factory/src/factory-agent-mocks.ts Adds deterministic mock agents for unit/smoke tests.
packages/software-factory/src/darkfactory-schemas.ts Moves runtime schema fetching + card doc builder into src/.
packages/software-factory/src/cli/smoke-realm.ts Removes obsolete CLI entrypoint.
packages/software-factory/src/boxel.ts Updates error-format import to new src/ location.
packages/software-factory/scripts/smoke-tests/smoke-test-realm.ts Relocates smoke realm test script and updates imports to src/.
packages/software-factory/scripts/smoke-tests/factory-tools-smoke.ts Updates smoke test imports to src/.
packages/software-factory/scripts/smoke-tests/factory-skill-smoke.ts Updates smoke test imports to src/.
packages/software-factory/scripts/smoke-tests/factory-prompt-smoke.ts Updates smoke test imports to src/.
packages/software-factory/scripts/smoke-tests/factory-loop-smoke.ts Updates smoke test imports to src/.
packages/software-factory/scripts/smoke-tests/factory-context-smoke.ts Updates smoke test imports to src/.
packages/software-factory/scripts/smoke-tests/factory-agent-smoke.ts Updates smoke test imports to src/.
packages/software-factory/scripts/run-realm-tests.ts Updates imports to src/boxel and src/realm-operations.
packages/software-factory/scripts/pick-ticket.ts Updates imports to src/boxel.
packages/software-factory/scripts/boxel-session.ts Updates imports to src/boxel.
packages/software-factory/scripts/boxel-search.ts Updates imports to src/boxel.
packages/software-factory/package.json Removes obsolete smoke:realm script and points smoke:test-realm to new script location.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@habdelra habdelra requested a review from a team April 8, 2026 16:59
@habdelra habdelra force-pushed the cs-10585-consolidate-software-factory-module-layout-src-vs-scriptslib branch from ad707ac to 65b7818 Compare April 9, 2026 12:46
habdelra and others added 2 commits April 9, 2026 08:50
…/lib/)

Move all 20 library modules from scripts/lib/ into src/ so there is a
single canonical location for importable code. Remove the obsolete
smoke-realm CLI entrypoint and relocate smoke-test-realm into
scripts/smoke-tests/ where it belongs. Update every import path and
__dirname-relative resolution across src/, scripts/, and tests/.

All 386 node tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@habdelra habdelra force-pushed the cs-10585-consolidate-software-factory-module-layout-src-vs-scriptslib branch from 65b7818 to 220ddf3 Compare April 9, 2026 12:51
@habdelra habdelra merged commit 1f72fe3 into main Apr 9, 2026
22 checks passed
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.

3 participants