Adjust-existing-card flow for factory:go (seed-from-source + adjustment issues)#5145
Open
jurgenwerk wants to merge 8 commits into
Open
Adjust-existing-card flow for factory:go (seed-from-source + adjustment issues)#5145jurgenwerk wants to merge 8 commits into
jurgenwerk wants to merge 8 commits into
Conversation
Contributor
When a brief carries a sourceCardUrl, factory:go seeds the target realm from that existing card and its same-realm dependency graph, confirms a green baseline (writing characterization tests when the source card has none), then creates adjustment-type issues from the brief. Absent a sourceCardUrl the run stays greenfield, unchanged. - realm/wiki.gts: optional sourceCardUrl field on the brief card - realm/kanban-config.gts: adjustment issueType - src/factory-brief.ts: read sourceCardUrl onto FactoryBrief - src/factory-seed.ts: branch the bootstrap-seed issue on sourceCardUrl - skills-orchestrator bootstrap/operations: improve + adjustment guidance - docs/improve-existing-card-flow.md: contract design note - realm/Wiki/improve-mortgage-extra-payment.json: test brief fixture - tests/factory-brief.test.ts: sourceCardUrl parsing Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a1089a9 to
101797a
Compare
The `Issue` class is defined in `issue-tracker` and re-exported by `darkfactory`. Factory-written issues adopt `darkfactory#Issue`; an issue a human adds through the IssueTracker board adopts the canonical `issue-tracker#Issue`. The scheduler's issue search filtered on `darkfactory#Issue` only, so board-added (human-in-the-loop) issues were invisible — the loop loaded just the factory issues and exited `no_unblocked_issues`. RealmIssueStore.listIssues / refreshIssue now match `Issue` from either module via an `any` type filter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
darkfactory.gts exported Issue / Project / IssueTracker as empty subclasses of the canonical issue-tracker definitions, which forked the card type identity: factory-written cards adopt darkfactory#Issue while cards added via the IssueTracker board UI adopt issue-tracker#Issue, so a type filter on one didn't match the other — human-added issues were invisible to the scheduler. Re-export the same classes so darkfactory#Issue === issue-tracker#Issue. Pairs with the scheduler's any-of-both-modules filter (which keeps the loop working on already-indexed realms until they reindex against the new module). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The skill loader gated `software-factory-operations` on workflow keywords in the issue text. Sparse, human-authored issues added via the board UI (e.g. a one-line "Modernize the look" adjustment) didn't match, so the agent ran without the edit-in-place / guard-the-baseline guidance — it only succeeded on the model's own judgment. Every non-bootstrap issue is a factory delivery issue, so load operations unconditionally. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Standardize the flow's wording on "adjust" (matching the `adjustment` issueType) across code, skills, the design note, and the test brief — comments, strings, the seed "Mode: ADJUST EXISTING CARD" label, adjustSeedInstructions, the bootstrap "Adjust flow" section. Renamed docs/improve-existing-card-flow.md → adjust-existing-card-flow.md and the brief fixture → adjust-mortgage-extra-payment.json. The Linear project's proper-name reference is left intact. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The note was framed as a pre-implementation design ticket whose breakdown (CS-11399–CS-11407) "builds on" it — but that breakdown is mostly canceled and the code shipped in this PR. Removed the reference-map table, the "no code ships from this ticket" status framing, and the inline CS-#### tags throughout, so the note just describes the contract. Also fixed a stray "improving" → "adjusting" in the seed instructions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Remove realm/Wiki/adjust-mortgage-extra-payment.json (test brief — not needed in the PR). - Shorten the darkfactory re-export comment to the essential rationale. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the software-factory “factory:go” workflow to support an adjust-existing-card mode driven by a brief’s optional sourceCardUrl, adds an adjustment issue type, and fixes issue discovery/skill loading so human-created board issues participate in the scheduling loop.
Changes:
- Add
sourceCardUrlto the brief contract (Wiki card + brief normalization) and update seed/bootstrap guidance to branch into an “adjust existing card” flow. - Add
adjustmentas a first-classissueTypeoption and document the adjust flow contract. - Fix scheduler issue discovery to match
Issuecards from bothdarkfactoryandissue-tracker, and ensure non-bootstrap issues always loadsoftware-factory-operations.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/software-factory/src/factory-brief.ts | Extends brief normalization to read optional sourceCardUrl. |
| packages/software-factory/tests/factory-brief.test.ts | Adds tests for sourceCardUrl present/absent normalization behavior. |
| packages/software-factory/src/factory-seed.ts | Branches bootstrap seed issue instructions for greenfield vs adjust flows. |
| packages/software-factory/.agents/skills-orchestrator/software-factory-bootstrap/SKILL.md | Documents greenfield vs adjust bootstrap responsibilities and steps. |
| packages/software-factory/.agents/skills-orchestrator/software-factory-operations/SKILL.md | Adds operational guidance specific to adjustment issues (edit-in-place + baseline protection). |
| packages/software-factory/realm/wiki.gts | Adds sourceCardUrl field to the Wiki card used as a factory brief. |
| packages/software-factory/realm/kanban-config.gts | Adds adjustment to issueTypeOptions. |
| packages/software-factory/realm/darkfactory.gts | Re-exports tracker card types to avoid subclass type-identity divergence. |
| packages/software-factory/src/issue-scheduler.ts | Updates RealmIssueStore filtering to match Issue cards from both modules. |
| packages/software-factory/tests/issue-scheduler.test.ts | Adds regression test asserting the scheduler queries both Issue module URLs. |
| packages/software-factory/src/factory-skill-loader.ts | Always includes software-factory-operations for non-bootstrap issues. |
| packages/software-factory/tests/factory-skill-loader.test.ts | Adds/updates tests to reflect operations skill always loading. |
| packages/software-factory/docs/adjust-existing-card-flow.md | New design/contract doc for the adjust-existing-card flow and brief schema. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- factory-skill-loader: drop the dangling FACTORY_WORKFLOW_KEYWORDS doc comment left after the keyword list was removed. - issue-scheduler: derive the issue-tracker module URL by swapping the final path segment after trimming trailing slashes, so it's robust to a trailing slash / equivalent canonicalization of darkfactoryModuleUrl. - design note: reword the same-server "cost" bullet — it's a procedural assumption (a cross-server URL just fails to fetch), not a code-enforced origin rejection. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
habdelra
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Teaches
factory:goto adjust an existing card instead of only generating new ones. When the brief carries asourceCardUrl, the factory seeds the new realm with a working copy of that card and its dependency graph, confirms a green baseline, then runs the standard issue loop — where the issues describe adjustments (deltas) to the seeded card. NosourceCardUrl→ greenfield, exactly as before. Run inputs stay 2-input (brief URL + new realm URL).What's in here
sourceCardUrlon the brief card; present → adjust flow, absent → greenfield.adjustmentissue type — alongsidebootstrap/feature.factory-seed.ts) — whensourceCardUrlis set, the bootstrap issue carries adjust instructions: seed the source card + its dependency graph, confirm a green baseline, write a source-provenance article, and createadjustmentissues. Source cards with no co-located tests get characterization tests first, so there's a baseline to protect.Issuecards whichever module they adopt, so issues a human adds through the board UI get picked up (previously invisible to the loop).software-factory-operationsfor non-bootstrap issues — sparse, human-written issues were silently skipping it.Verified
Several
factory:goruns against the catalog mortgage-calculator: seed → green baseline → adjustments applied, all five validators green — including a human-added board issue that got picked up and implemented after the scheduler + darkfactory fixes.The dedicated
boxel realm ingest-cardcommand the seed step uses is in the stacked #5166 (based on this branch).🤖 Generated with Claude Code