Guide Ricky workflow persona with squad review defaults#105
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR standardizes the multi-agent workflow squad pattern for serious implementation work across Ricky guidance and injects repo-local workflow policies into persona task generation. ChangesWorkflow Squad Loop Standardization and Policy Injection
Sequence Diagram(s)Sequence diagrams are embedded in the hidden review stack artifact above. Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/product/generation/workforce-persona-writer.test.ts (1)
58-99: ⚡ Quick winAdd one negative-path assertion for missing policy files.
This test covers the happy path well, but the new fallback branch (
MISSING: Ricky workflow policy file...) remains untested. A small companion test with one missing file would lock behavior and prevent regressions.🤖 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 58 - 99, Add a negative-path test in workforce-persona-writer.test.ts that calls buildWorkflowPersonaTask (same args as the existing test) but leaves out one of the repo-local policy files (e.g., don't create workflows/shared/WORKFLOW_AUTHORING_RULES.md), then assert the returned task contains the fallback marker string "MISSING: Ricky workflow policy file" (and still contains the other existing file contents) to lock the fallback branch behavior and prevent regressions.
🤖 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.
Inline comments:
In `@src/product/generation/workforce-persona-writer.ts`:
- Around line 686-690: In safeReadPolicyFile, don’t swallow all read errors;
catch the exception into a variable, inspect its code (e.g., err.code ===
'ENOENT') and return null only for "file not found" errors, otherwise surface
the problem (rethrow the error or log it and return null as appropriate for your
error-handling policy). Update the function safeReadPolicyFile to read the file
inside try, catch (err) { if (err?.code === 'ENOENT') return null; throw err; }
(or replace throw with a processLogger.error call if you prefer logging) so
permission and other I/O errors are not misreported as “not found.”
---
Nitpick comments:
In `@src/product/generation/workforce-persona-writer.test.ts`:
- Around line 58-99: Add a negative-path test in
workforce-persona-writer.test.ts that calls buildWorkflowPersonaTask (same args
as the existing test) but leaves out one of the repo-local policy files (e.g.,
don't create workflows/shared/WORKFLOW_AUTHORING_RULES.md), then assert the
returned task contains the fallback marker string "MISSING: Ricky workflow
policy file" (and still contains the other existing file contents) to lock the
fallback branch behavior and prevent regressions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 99573ef4-c9d9-4bd0-94ae-c1d1596336d0
📒 Files selected for processing (6)
AGENTS.mddocs/workflows/WORKFLOW_STANDARDS.mdsrc/product/generation/workforce-persona-writer.test.tssrc/product/generation/workforce-persona-writer.tsworkflows/meta/spec/generated-workflow-template.mdworkflows/shared/WORKFLOW_AUTHORING_RULES.md
| function safeReadPolicyFile(path: string): string | null { | ||
| try { | ||
| return truncateText(readFileSync(path, 'utf8'), MAX_POLICY_FILE_BYTES).text; | ||
| } catch { | ||
| return null; |
There was a problem hiding this comment.
Differentiate “file missing” from other read failures.
Line 689 swallows all I/O errors and later reports “not found,” which is misleading for permission/other read failures.
Suggested fix
-function safeReadPolicyFile(path: string): string | null {
+function safeReadPolicyFile(path: string): { content: string } | { missing: true } | { error: string } {
try {
- return truncateText(readFileSync(path, 'utf8'), MAX_POLICY_FILE_BYTES).text;
- } catch {
- return null;
+ return { content: truncateText(readFileSync(path, 'utf8'), MAX_POLICY_FILE_BYTES).text };
+ } catch (error) {
+ if ((error as NodeJS.ErrnoException)?.code === 'ENOENT') return { missing: true };
+ return { error: errorMessage(error) };
}
}- return RICKY_WORKFLOW_POLICY_FILES.map((path) => {
+ return RICKY_WORKFLOW_POLICY_FILES.map((path) => {
const absolute = resolve(repoRoot, path);
- const content = safeReadPolicyFile(absolute);
- return content
- ? `# ${path}\n${content}`
- : `# ${path}\nMISSING: Ricky workflow policy file was not found at ${absolute}.`;
+ const read = safeReadPolicyFile(absolute);
+ if ('content' in read) return `# ${path}\n${read.content}`;
+ if ('missing' in read) return `# ${path}\nMISSING: Ricky workflow policy file was not found at ${absolute}.`;
+ return `# ${path}\nUNREADABLE: ${read.error}`;
}).join('\n\n');
}🤖 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.ts` around lines 686 - 690,
In safeReadPolicyFile, don’t swallow all read errors; catch the exception into a
variable, inspect its code (e.g., err.code === 'ENOENT') and return null only
for "file not found" errors, otherwise surface the problem (rethrow the error or
log it and return null as appropriate for your error-handling policy). Update
the function safeReadPolicyFile to read the file inside try, catch (err) { if
(err?.code === 'ENOENT') return null; throw err; } (or replace throw with a
processLogger.error call if you prefer logging) so permission and other I/O
errors are not misreported as “not found.”
Ricky Eval ReviewRun: Passed: 8 | Needs human: 43 | Reviewable: 43 | Missing output: 0 | Failed: 0 | Skipped: 0 Human Review CasesThese cases passed deterministic checks and include captured Ricky output for a human verdict against their REVIEW
|
Summary
Tests