Add workflow orchestrator correctness improvements - #6
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b5bd7cad1
ℹ️ 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".
| declaredFiles: string[], | ||
| ): Promise<string | undefined> { | ||
| try { | ||
| const { stdout } = await execFile("git", ["diff", "--name-only"], { cwd, shell: false }); |
There was a problem hiding this comment.
Include untracked files before comparing reports
When a developer creates a new file and correctly lists it in filesChanged, git diff --name-only does not report untracked files, so this code records a false “Missing from diff” blocking issue and passes that noise to the verifier. This affects common first-wave tasks that add new files; include untracked files (for example via git ls-files --others --exclude-standard) or avoid treating them as missing.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| /** Copy editable defaults into the project without overwriting existing files. */ | ||
| export function materializeProjectDefaults(cwd: string): string[] { |
There was a problem hiding this comment.
Call the default materializer before loading workflows
The new first-run copier is never invoked outside tests (rg materializeProjectDefaults only finds this file and tests), while start/resume still load from ctx.cwd/.pi/workflows. In a package-installed project that does not already have .pi/workflows/default.workflow.json, the documented first run fails with “Workflow not found” instead of copying the bundled defaults; wire this helper or resolveWorkflowPath into the startup path.
Useful? React with 👍 / 👎.
| ```bash | ||
| pi | ||
| /workflow start default "Your goal" | ||
| /workflow "Your goal" |
There was a problem hiding this comment.
Wire the advertised workflow shorthand into the handler
This quick-start command is now advertised, but the registered /workflow handler still treats the first token as a subcommand and only starts on command === "start"; the new shorthand/model parsers are only referenced by tests. Users following this line get the usage warning instead of starting the default workflow, so either route /workflow <goal> through the new parser or keep the docs on /workflow start default ....
Useful? React with 👍 / 👎.
|
@cryptosebek While I am not against AI contributions, reading your PRs - it's not really clear to me what they do, what problems are fixed, or the reasoning behind them. This
makes me think you didn't even test the changes, and if you didn't - why should I? |
Summary
This PR improves workflow orchestrator runtime correctness, typed contracts, state handling, and integration coverage while preserving project-level customization.
Runtime changes
Documentation and configuration
Tests
Validation
git diff --checkpassingEventEmitterAsyncResource; the repository dependencies require a newer Node runtime.