Skip to content

fix(examples): fail closed on factory PR metadata - #544

Merged
kjgbot merged 1 commit into
mainfrom
fix/canonical-factory-metadata
Sep 21, 2026
Merged

kjgbot merged 1 commit into
mainfrom
fix/canonical-factory-metadata

Conversation

@miyaontherelay

@miyaontherelay miyaontherelay commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The production recommended Software Garden flow opened AgentWorkforce/cloud#3919 with the placeholder title Software factory change and no closing issue reference. The exact source ticket is AgentWorkforce/cloud#3913: its title and defect match the change, it carried the garden-ready trigger label, and it preceded the factory branch and commit.

The generator fix in AgentWorkforce/agentrelay.com#109 does not protect the canonical Flows artifact used by the live recommended catalog.

Change

  • derive the PR title deterministically from the ticket, normalize whitespace, and cap it at 240 Unicode code points
  • require a normalized GitHub #<number> identifier and exactly one Fixes #<number> line
  • reject placeholder or invalid metadata before the first git push or gh pr create
  • use the same contract in passed, blocked, post-review, and merge-gate branches
  • exercise the actual canonical example, including the #3913 production identity

The existing Cloud PR #3919 has separately been repaired to the exact #3913 title and one Fixes #3913 line. This PR prevents recurrence in the source artifact; it does not release or roll out a new catalog pin.

Verification

$ cd packages/sdk && npx vitest run tests/canonical-software-factory.test.ts

 RUN  v2.1.9 /Users/khaliqgant/Projects/AgentWorkforce/flows-factory-metadata/packages/sdk

 ✓ tests/canonical-software-factory.test.ts (3 tests) 1115ms
   ✓ canonical software-factory metadata contract > opens the actual catalog flow with the ticket title and exactly one GitHub closing line 501ms
   ✓ canonical software-factory metadata contract > normalizes whitespace and caps the title at 240 Unicode code points 373ms

 Test Files  1 passed (1)
      Tests  3 passed (3)
   Duration  2.37s
$ git diff --check
[no output; exit 0]

Note

Low Risk
Changes are confined to the example flow and new tests; behavior is stricter metadata validation with no auth or production rollout in this PR.

Overview
The canonical software-factory example now derives every pull request title from the ticket (whitespace normalized, 240 Unicode code points max) instead of ad hoc or placeholder titles, and draft PRs no longer use a [blocked] title prefix—blocked state stays in the body sections.

For GitHub-sourced tickets it requires identifier in #<number> form, appends a single Fixes #<number> line when missing, and runs redundant shell validation on the final title/body before git push or gh pr create. Invalid or placeholder metadata ends the run as needs_human without opening a PR; the same openPullRequest path is used for success, adversarial block, post-review block, and merge-gate block.

The README documents this contract, the flow version bumps to 2.0.22, and canonical-software-factory.test.ts exercises the real catalog flow (title, closing line, ordering, and fail-closed cases).

Reviewed by Cursor Bugbot for commit a874651. Bugbot is set up for automated code reviews on this repo. Configure here.

Session-Id: 01a0c4a6-dd65-7ce1-a90e-de1b0b4e86c3
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2788fae9-2a52-4a1a-858a-3ffdad6d80ba


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kjgbot
kjgbot merged commit 16237b6 into main Sep 21, 2026
6 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.

2 participants