Skip to content

Add brief ingestion to factory entrypoint#4204

Open
habdelra wants to merge 9 commits intomainfrom
cs-10447-implement-brief-intake-and-normalization-for-factorygo
Open

Add brief ingestion to factory entrypoint#4204
habdelra wants to merge 9 commits intomainfrom
cs-10447-implement-brief-intake-and-normalization-for-factorygo

Conversation

@habdelra
Copy link
Contributor

@habdelra habdelra commented Mar 18, 2026

Summary

  • add factory:go brief loading and normalization for Boxel card-source briefs, including title/content/tag extraction from brief source documents
  • support authenticated brief fetches with --auth-token, and wire private-realm auth through a runtime-common-based fetch path
  • move software-factory CLI entrypoints off tsx and onto ts-node --transpileOnly, update docs, and add hermetic test coverage

Try It From The CLI

Public realm brief:

cd packages/software-factory

pnpm factory:go -- \
  --brief-url http://localhost:4201/software-factory/Wiki/sticky-note \
  --target-realm-path /tmp/factory-go-demo \
  --mode implement

Private realm brief with username/password:

cd packages/software-factory

export MATRIX_URL=http://localhost:8008/
export MATRIX_USERNAME=factory
read -s MATRIX_PASSWORD'?Matrix password: '
export MATRIX_PASSWORD
export REALM_SERVER_URL=http://localhost:4201/

pnpm factory:go -- \
  --brief-url http://localhost:4201/software-factory/Wiki/sticky-note \
  --target-realm-path /tmp/factory-go-demo \
  --mode implement

Expected result:

  • the command prints structured JSON to stdout
  • the brief object includes normalized data like title, sourceUrl, contentSummary, and tags
  • the actions list shows input validation, brief fetch, brief normalization, and target-realm path resolution
  • the result block ends in status: "ready" with the next planned step for the factory flow

Note: The test failures are all upstream. the work in this PR is purely within the software factory workspace and the actual software factory tests pass.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c55e763015

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
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 enhances the @cardstack/software-factory factory:go CLI to fetch and normalize a “brief” card (including optional auth), and updates the package’s tooling/tests to support the new behavior.

Changes:

  • Add brief loading + normalization pipeline and include normalized brief metadata in the factory:go JSON summary.
  • Introduce Boxel realm auth-aware fetch wiring (with optional explicit --auth-token) and add corresponding unit/integration tests.
  • Switch software-factory CLI scripts from tsx to ts-node --transpileOnly and update lockfile accordingly.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pnpm-lock.yaml Removes tsx and updates resolved dependency graph for new CLI execution approach.
packages/software-factory/package.json Swaps CLI scripts to ts-node --transpileOnly; removes tsx dependency.
packages/software-factory/README.md Documents brief fetching/normalization and the new --auth-token flag.
packages/software-factory/docs/software-factory-testing-strategy.md Tightens guidance around hermetic tests + synthetic hosts/ports.
packages/software-factory/docs/one-shot-factory-go-plan.md Updates design plan to match brief normalization + prompt templating direction; documents ts-node preference.
packages/software-factory/src/factory-entrypoint.ts Adds --auth-token, brief fetching via runFactoryEntrypoint, and expands summary to include brief metadata/actions.
packages/software-factory/src/cli/factory-entrypoint.ts Converts CLI entry to async flow; adds clearer error handling for usage vs brief failures.
packages/software-factory/src/factory-brief.ts Adds brief fetch + normalization utilities (title/summary/tags/content extraction).
packages/software-factory/src/realm-auth.ts Adds Boxel-profile-aware realm auth fetch setup with explicit authorization override support.
packages/software-factory/src/prompts/brief-judgment.ts Adds a reusable prompt template for brief “thin MVP vs broader pass” judgment.
packages/software-factory/tests/index.ts Registers new unit tests.
packages/software-factory/tests/realm-auth.test.ts Tests explicit auth override + runtime-common auth middleware retry behavior.
packages/software-factory/tests/factory-entrypoint.test.ts Updates/extends unit tests for new args, summary shape, and brief loading path.
packages/software-factory/tests/factory-entrypoint.integration.test.ts Makes CLI integration test hermetic via local HTTP server; asserts auth header and summary includes brief metadata.
packages/software-factory/tests/factory-brief.test.ts Adds unit tests for brief normalization and brief fetching with auth header.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

@github-actions
Copy link

github-actions bot commented Mar 18, 2026

Host Test Results

    1 files  ±0      1 suites  ±0   2h 15m 0s ⏱️ - 1m 47s
2 030 tests ±0  1 997 ✅ +1  15 💤 ±0   0 ❌ ±0  18 🔥  - 1 
2 045 runs  ±0  1 994 ✅ +2  15 💤 ±0  18 ❌  - 1  18 🔥  - 1 

For more details on these errors, see this check.

Results for commit d0b41b4. ± Comparison against base commit e172ea0.

♻️ This comment has been updated with latest results.

@habdelra habdelra requested a review from a team March 18, 2026 20:41
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