Skip to content

Fix Workforce persona authoring for master workflows#66

Merged
khaliqgant merged 1 commit into
mainfrom
codex/ricky-workforce-master-generation
May 7, 2026
Merged

Fix Workforce persona authoring for master workflows#66
khaliqgant merged 1 commit into
mainfrom
codex/ricky-workforce-master-generation

Conversation

@khaliqgant

Copy link
Copy Markdown
Member

Summary

  • remove the early return that skipped Workforce persona authoring whenever deterministic generation produced a master execution plan
  • add a regression test proving master workflow specs invoke the persona writer and preserve the master execution plan metadata

Verification

  • npx vitest run src/product/generation/workforce-persona-writer.test.ts src/product/generation/pipeline.test.ts
  • npm run typecheck

Notes

  • The branch intentionally leaves existing unrelated local changes unstaged.

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The head commit changed during the review from b7f09cb to 3f95ba9.

📝 Walkthrough

Walkthrough

This PR removes an early-return guard in generateWithWorkforcePersona that was preventing the workforce persona pipeline from running when a master execution plan existed. A corresponding test validates that master execution workflows are now correctly processed through the full persona writing, validation, and repair pipeline.

Changes

Master Execution Workflow Persona Generation

Layer / File(s) Summary
Control Flow Fix
src/product/generation/pipeline.ts
Removed early-return guard that blocked workforce persona writer logic when baseResult.masterExecutionPlan was present.
Master Workflow Test Coverage
src/product/generation/workforce-persona-writer.test.ts
New test validates generateWithWorkforcePersona for runtime-master workflows: asserts master execution plan presence, single persona writer call with correct outputPath, mode: one-shot send options, and artifact content includes WORKFORCE_PERSONA_MASTER_AUTHORING.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly Related PRs

  • AgentWorkforce/ricky#54: Both PRs modify generateWithWorkforcePersona control flow in src/product/generation/pipeline.ts—this PR removes an early return so the workforce-persona writer runs for master execution plans, which builds on the prior PR's addition of pre-write repair and persona wiring in the same function.

Poem

🐇 A master's path was barred before,
An early exit closed the door,
But now the persona writer flows,
Through master workflows—onward goes!
One small guard removed, so clear and neat,
Master execution workflows complete! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: removing an early return that prevented Workforce persona authoring for master workflows.
Description check ✅ Passed The description is directly related to the changeset, explaining the removal of the early return and the addition of a regression test, with verification steps provided.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ricky-workforce-master-generation

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/product/generation/workforce-persona-writer.test.ts (1)

315-316: ⚡ Quick win

Strengthen master plan assertion to verify preservation, not just existence.

toBeDefined() can miss metadata drift. Assert equality (or at least a stable subset) against the pre-persona baseline plan.

Suggested assertion upgrade
     expect(result.success).toBe(true);
     expect(result.masterExecutionPlan).toBeDefined();
+    expect(result.masterExecutionPlan).toMatchObject(base.masterExecutionPlan!);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/product/generation/workforce-persona-writer.test.ts` around lines 315 -
316, Replace the loose existence check on result.masterExecutionPlan with a
deterministic equality (or stable-subset) assertion against the pre-persona
baseline plan to ensure metadata is preserved; specifically, change the
assertion involving result.masterExecutionPlan to compare it to the baseline
(e.g., use toEqual(prePersonaMasterExecutionPlan) or
toMatchObject(prePersonaMasterExecutionPlanSubset)) and keep the calls length
assertion as-is to still verify only one invocation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/product/generation/workforce-persona-writer.test.ts`:
- Around line 315-316: Replace the loose existence check on
result.masterExecutionPlan with a deterministic equality (or stable-subset)
assertion against the pre-persona baseline plan to ensure metadata is preserved;
specifically, change the assertion involving result.masterExecutionPlan to
compare it to the baseline (e.g., use toEqual(prePersonaMasterExecutionPlan) or
toMatchObject(prePersonaMasterExecutionPlanSubset)) and keep the calls length
assertion as-is to still verify only one invocation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ac89059c-9438-4d90-b9bf-fc1ef27de579

📥 Commits

Reviewing files that changed from the base of the PR and between f8d867c and 3f95ba9.

📒 Files selected for processing (2)
  • src/product/generation/pipeline.ts
  • src/product/generation/workforce-persona-writer.test.ts
💤 Files with no reviewable changes (1)
  • src/product/generation/pipeline.ts

@khaliqgant khaliqgant force-pushed the codex/ricky-workforce-master-generation branch from b7f09cb to 3f95ba9 Compare May 7, 2026 13:34

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

Copy link
Copy Markdown

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: 3f95ba9b9f

ℹ️ 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".

Comment on lines 86 to 87
if (input.workforcePersonaWriter === false || !baseResult.artifact || !baseResult.success) {
return baseResult;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the master executor contract

When generateWithWorkforcePersona is called for a spec that produced baseResult.masterExecutionPlan, this path now sends the already-decomposed master workflow to the persona writer without passing the child plan or enforcing that the returned artifact still contains/materializes/runs those children. A persona can return any otherwise-valid workflow for the broad spec, pass validateGeneratedArtifact, and the return value still spreads the stale masterExecutionPlan, so callers believe they have a master executor while the artifact may no longer execute the planned child workflows. Please either keep master workflows out of this path or pass and validate the master plan/RICKY_MASTER_EXECUTOR_WORKFLOW contract before accepting the persona artifact.

Useful? React with 👍 / 👎.

@khaliqgant khaliqgant merged commit 756632f into main May 7, 2026
1 of 2 checks passed
@khaliqgant khaliqgant deleted the codex/ricky-workforce-master-generation branch May 7, 2026 13:34

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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.

1 participant