@mediadatafusion/pi-workflow-suite 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/CONTRIBUTING.md +14 -4
- package/README.md +31 -124
- package/SECURITY.md +6 -2
- package/SUPPORT.md +3 -5
- package/VERSION +1 -1
- package/config/prompts/mission-final-validation.md +3 -2
- package/config/prompts/validate-approved-plan.md +4 -3
- package/extensions/subagent/index.ts +69 -3
- package/extensions/subagent/repolock-guard.ts +111 -0
- package/extensions/subagent/runner.ts +51 -3
- package/extensions/workflow-modes.ts +95 -49
- package/extensions/workflow-parsers.ts +2 -1
- package/extensions/workflow-state.ts +2 -1
- package/extensions/workflow-tool-guard.ts +68 -29
- package/extensions/workflow-validation-classifier.ts +5 -2
- package/package.json +3 -2
- package/scripts/install-to-live.sh +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable public releases will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.0.10] - 2026-05-25
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Improved workflow reliability across Standard, Plan, and Mission execution, including stronger progress tracking and validation handoff behavior.
|
|
10
|
+
- Tightened repository safety checks to keep guarded workflows scoped to the active project.
|
|
11
|
+
|
|
5
12
|
## [0.0.9] - 2026-05-23
|
|
6
13
|
|
|
7
14
|
### Changed
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
Pi Workflow Suite is a maintainer-led project.
|
|
3
|
+
Pi Workflow Suite is a maintainer-led project. Contributions are welcome only at maintainer discretion, and unsolicited pull requests may be closed without review.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Before opening a pull request, discuss changes that affect workflow behavior, release safety, or maintenance burden.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Pull requests require explicit maintainer approval before changing:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- workflow modes or mode state
|
|
10
|
+
- Mission Mode behavior, milestones, validation, repair, or reviewer logic
|
|
11
|
+
- Plan Mode approval, execution, validation, or repair flow
|
|
12
|
+
- Standard Mode task handling, clarification, or To Do behavior
|
|
13
|
+
- package publishing, GitHub Actions, or install scripts
|
|
14
|
+
- security-sensitive logic
|
|
15
|
+
- dependency behavior or dependency lists
|
|
16
|
+
|
|
17
|
+
Contributors must not introduce telemetry, postinstall scripts, credential handling, network calls, obfuscated code, or new dependencies without explicit justification and maintainer approval.
|
|
18
|
+
|
|
19
|
+
External contributions must preserve existing behavior unless a behavior change is explicitly approved. Feature requests may be declined if they increase scope, complexity, or support burden.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](#installation) [](#quick-start) [](#core-commands) [](#settings-reference)
|
|
6
6
|
|
|
7
|
-
**Workflow Suite Version:** `v0.0.
|
|
7
|
+
**Workflow Suite Version:** `v0.0.10`
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
@@ -116,7 +116,7 @@ Pi Workflow Suite turns Pi into a guided workflow environment:
|
|
|
116
116
|
| Themes And Startup UI | Workflow Suite themes, startup visual cards, startup logo modes, custom terminal logo text, custom brand cards, footer/status styling, widgets, and optional input border styling. |
|
|
117
117
|
| Interactive Diagrams | `workflow_diagram` Mermaid support with terminal preview, SVG-first clickable artifacts, PNG/runtime rendering support, dark-mode-friendly styling, and runtime artifact storage. |
|
|
118
118
|
| Web Research | First-party `workflow_web_search` and `workflow_web_fetch` tools for public web search/fetch with source URLs, blocked local/private/internal hosts, time/size limits, and untrusted-content handling. |
|
|
119
|
-
| Repo Lock | Project-scoped Global Safety control that constrains
|
|
119
|
+
| Repo Lock | Project-scoped Global Safety control that constrains normal file tools, bash path checks, and sub-agents to the active repository, with protected configuration paths and clear non-sandbox caveats. |
|
|
120
120
|
| Compaction | Pi default, custom model, or disabled Workflow Suite compaction so context summarization can use its own provider/model, proactive threshold checks, idle-boundary execution, custom token tuning, adaptive fitting, status reporting, and safe fallback. |
|
|
121
121
|
| Workflow Roles | Planner, Executor, Reviewer, Validator, Mission, and compaction responsibilities are separated by phase so each job has clear boundaries and can be matched to the right model. |
|
|
122
122
|
| Model Selection | Configure which provider/model and thinking level powers each workflow role, with shared defaults plus Standard-specific and Mission-specific overrides for simpler or higher-rigor setups. |
|
|
@@ -139,7 +139,7 @@ Pi Workflow Suite turns Pi into a guided workflow environment:
|
|
|
139
139
|
- Workflow themes with a `none` option, startup visual cards, startup logo modes, custom terminal logo text, custom brand cards, and optional themed input borders.
|
|
140
140
|
- Integrated `workflow_web_search` and `workflow_web_fetch` tools for current public evidence and source-backed URL reading.
|
|
141
141
|
- Interactive `workflow_diagram` Mermaid rendering with terminal preview, clickable SVG artifacts, and PNG/runtime rendering support.
|
|
142
|
-
- Repo Lock for project-scoped path safety around repository and
|
|
142
|
+
- Repo Lock for project-scoped path safety around repository work, protected project configuration, and sub-agent inheritance.
|
|
143
143
|
- Role-aware model selection so planning, execution, review, validation, Mission work, and compaction can each use the provider/model and thinking level that fits the job.
|
|
144
144
|
- Sub-agent usage policies for planning, execution, repair, review, and validation, with explicit documentation that these are orchestration settings, not a universal permission manager.
|
|
145
145
|
- Safe install, backup, audit, quarantine, verification, and package validation scripts.
|
|
@@ -215,7 +215,7 @@ Core behavior:
|
|
|
215
215
|
- `/standard todo clear` clears the Standard To Do list.
|
|
216
216
|
- `/standard exit` returns to idle.
|
|
217
217
|
|
|
218
|
-
Standard Mode settings live under `standard.*`, including `autoTodoEnabled`, `todoTriggerMode`, `todoProgressVisible`, `clarificationEnabled`, `clarificationMode`, `maxClarificationQuestions`, `interactiveClarificationEnabled`, `clarificationTiming`, `clarificationQualityGate`, `allowClarificationWithoutAnalysis`, `useSubagentsBeforeClarification`, `allowSubagents`, `subagentScope`, Standard-specific sub-agent phase overrides, `statusWidgetVisible`, `modelRole`, and `useSharedExecutorModel`. These controls are user-configurable through `/workflow settings Standard Mode
|
|
218
|
+
Standard Mode settings live under `standard.*`, including `autoTodoEnabled`, `todoTriggerMode`, `todoProgressVisible`, `clarificationEnabled`, `clarificationMode`, `maxClarificationQuestions`, `interactiveClarificationEnabled`, `clarificationTiming`, `clarificationQualityGate`, `allowClarificationWithoutAnalysis`, `useSubagentsBeforeClarification`, `allowSubagents`, `subagentScope`, Standard-specific sub-agent phase overrides, `statusWidgetVisible`, `modelRole`, and `useSharedExecutorModel`. These controls are user-configurable through `/workflow settings Standard Mode`, and custom workflow presets can save/apply Standard Mode settings.
|
|
219
219
|
|
|
220
220
|
## Plan Mode
|
|
221
221
|
|
|
@@ -402,7 +402,7 @@ Standard Mode, Plan Mode, and Mission Mode use model settings differently:
|
|
|
402
402
|
- **Plan Mode** supports formal planned execution: plan, approve, optionally review with a second model, execute with the selected executor model, optionally validate with an independent validator model, and optionally repair/retry failed validation.
|
|
403
403
|
- **Mission Mode** supports persistent milestone work: plan mission milestones, approve the mission, execute the current milestone, validate that milestone, checkpoint, repair/retry if needed, optionally run final whole-mission validation, then continue or complete according to autonomy settings. Mission-specific role overrides let long-running work use different planner/executor/reviewer/validator choices from normal Plan Mode.
|
|
404
404
|
|
|
405
|
-
The included example settings provide defaults, but users can change provider/model, thinking level, role enablement, reviewer/validator behavior, Mission Mode autonomy, and mission-specific model selection through `/workflow
|
|
405
|
+
The included example settings provide defaults, but users can change provider/model, thinking level, role enablement, reviewer/validator behavior, Mission Mode autonomy, and mission-specific model selection through `/workflow settings`. Do not treat the shipped defaults as the only supported setup. Provider names must match the user's configured Pi/Factory model route and API compatibility; official providers and proxy/generic providers may require different provider values even when the display model name looks similar.
|
|
406
406
|
|
|
407
407
|
Thinking levels:
|
|
408
408
|
|
|
@@ -427,30 +427,11 @@ Configuration examples:
|
|
|
427
427
|
/workflow settings Standard Mode
|
|
428
428
|
/workflow settings Mission Mode
|
|
429
429
|
/workflow settings Shared Compaction
|
|
430
|
-
/workflow-settings configure models
|
|
431
|
-
/workflow-settings configure standard-mode
|
|
432
|
-
/workflow-settings configure mission-mode
|
|
433
|
-
/workflow-settings configure compaction
|
|
434
|
-
|
|
435
|
-
# Standard-specific model overrides
|
|
436
|
-
/workflow-settings set standard useStandardSpecificModels true|false
|
|
437
|
-
/workflow-settings set standard-models executor <provider> <model>
|
|
438
|
-
/workflow-settings set standard-models validator <provider> <model>
|
|
439
|
-
|
|
440
|
-
# Mission-specific model overrides
|
|
441
|
-
/workflow-settings set missions useMissionSpecificModels true|false
|
|
442
|
-
# Then use /workflow-settings configure mission-mode to select Mission Planner, Executor, Reviewer, and Validator models.
|
|
443
|
-
|
|
444
|
-
# Compaction model selection and token budget
|
|
445
|
-
/workflow-settings set context compactionMode custom_model
|
|
446
|
-
/workflow-settings set context compactionModelProvider <provider>
|
|
447
|
-
/workflow-settings set context compactionModel <model>
|
|
448
|
-
/workflow-settings set context customCompactionEnabled true
|
|
449
|
-
/workflow-settings set context customCompactionReserveTokens 4096-65536|default|reset
|
|
450
|
-
/workflow-settings set context customCompactionKeepRecentTokens 1000-200000|default|reset
|
|
451
430
|
```
|
|
452
431
|
|
|
453
|
-
|
|
432
|
+
The grouped settings menus expose shared role selection, Standard-specific model behavior, Mission-specific model behavior, and compaction model/token-budget controls without relying on legacy dashed command entry points.
|
|
433
|
+
|
|
434
|
+
Shared model selection is available through `/workflow settings Shared Models`. Standard-specific and mission-specific model selection is available through their mode settings menus.
|
|
454
435
|
|
|
455
436
|
## Workflow Settings UI
|
|
456
437
|
|
|
@@ -476,16 +457,7 @@ Public slash menu entries use the grouped `/workflow settings ...` surface. Use
|
|
|
476
457
|
/workflow settings Summary
|
|
477
458
|
```
|
|
478
459
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
```text
|
|
482
|
-
/workflow-settings
|
|
483
|
-
/workflow-settings list
|
|
484
|
-
/workflow-settings help
|
|
485
|
-
/workflow-settings scope
|
|
486
|
-
/workflow-settings write-target
|
|
487
|
-
/workflow-settings create-project-override
|
|
488
|
-
```
|
|
460
|
+
Public command discovery is through `/workflow help` and the grouped `/workflow settings ...` entries above. Legacy dashed compatibility routes may exist for older scripts, but they are not public slash-menu commands and are not the recommended README surface.
|
|
489
461
|
|
|
490
462
|
Settings menus:
|
|
491
463
|
|
|
@@ -538,7 +510,7 @@ Sub-agents: forced maximum teams across planning/execution/repair/review/validat
|
|
|
538
510
|
Mission: supervised auto, final validation, higher retry budget
|
|
539
511
|
```
|
|
540
512
|
|
|
541
|
-
`/workflow settings Show Current Settings`
|
|
513
|
+
`/workflow settings Show Current Settings` prints an Active Profile section near the top so the active preset is explained before the detailed settings.
|
|
542
514
|
|
|
543
515
|
Quick access:
|
|
544
516
|
|
|
@@ -588,24 +560,6 @@ Open the interactive theme menu from the public settings surface:
|
|
|
588
560
|
/workflow settings Theme
|
|
589
561
|
```
|
|
590
562
|
|
|
591
|
-
Direct theme commands are also available:
|
|
592
|
-
|
|
593
|
-
```text
|
|
594
|
-
/workflow-settings theme list
|
|
595
|
-
/workflow-settings theme use aurora|synthwave|matrix|nebula|ember|arctic|oceanic|royal|solar|graphite|access|diagnostic|classic|MediaDataFusion|none
|
|
596
|
-
/workflow-settings theme startup mission_control|diagnostic_center|workflow_duo|data_stream|neural_grid|minimal|custom_brand|none
|
|
597
|
-
/workflow-settings theme startup-logo none|pi|custom
|
|
598
|
-
/workflow-settings theme logo-text <letters>
|
|
599
|
-
/workflow-settings theme logo-font block|shadow|outline|wide|double|three_d
|
|
600
|
-
/workflow-settings theme logo-shadow down_right|down|up|left|right
|
|
601
|
-
/workflow-settings theme logo-color theme|primary|split
|
|
602
|
-
/workflow-settings theme startup-on-open enable|disable
|
|
603
|
-
/workflow-settings theme preview
|
|
604
|
-
/workflow-settings theme brand enable|disable
|
|
605
|
-
/workflow-settings theme brand text <custom text>
|
|
606
|
-
/workflow-settings theme brand base minimal|workflow_duo|mission_control|diagnostic_center|data_stream|neural_grid
|
|
607
|
-
```
|
|
608
|
-
|
|
609
563
|
The interactive menu is the easiest way to configure appearance:
|
|
610
564
|
|
|
611
565
|
```text
|
|
@@ -632,38 +586,14 @@ How the pieces fit together:
|
|
|
632
586
|
|
|
633
587
|
`startupVisual: none` is separate. It disables only the startup visual card. It does not disable the selected Workflow Suite theme, Standard Mode, Plan Mode, Mission Mode, widgets, presets, or commands.
|
|
634
588
|
|
|
635
|
-
Practical recipes:
|
|
589
|
+
Practical recipes use the guided appearance menu:
|
|
636
590
|
|
|
637
591
|
```text
|
|
638
|
-
# Open the guided appearance menu
|
|
639
592
|
/workflow settings Theme
|
|
640
|
-
|
|
641
|
-
# Preview the current startup card and logo
|
|
642
|
-
/workflow-settings theme preview
|
|
643
|
-
|
|
644
|
-
# Choose a complete visual style
|
|
645
|
-
/workflow-settings theme use synthwave
|
|
646
|
-
/workflow-settings theme startup mission_control
|
|
647
|
-
/workflow-settings theme startup-logo pi
|
|
648
|
-
|
|
649
|
-
# Add your own short terminal logo above the card
|
|
650
|
-
/workflow-settings theme startup-logo custom
|
|
651
|
-
/workflow-settings theme logo-text ACME
|
|
652
|
-
/workflow-settings theme logo-font shadow
|
|
653
|
-
/workflow-settings theme logo-color primary
|
|
654
|
-
|
|
655
|
-
# Use a branded startup card without changing workflow behavior
|
|
656
|
-
/workflow-settings theme startup custom_brand
|
|
657
|
-
/workflow-settings theme brand text Acme Workflow
|
|
658
|
-
/workflow-settings theme brand base mission_control
|
|
659
|
-
|
|
660
|
-
# Turn off only the startup card
|
|
661
|
-
/workflow-settings theme startup none
|
|
662
|
-
|
|
663
|
-
# Turn off Workflow Suite visual theming while keeping features active
|
|
664
|
-
/workflow-settings theme use none
|
|
665
593
|
```
|
|
666
594
|
|
|
595
|
+
From that menu users can preview the current startup card and logo, choose a complete visual style, configure a short terminal logo, configure a branded startup card, turn off only the startup card, or opt out of Workflow Suite visual theming while keeping workflow features active.
|
|
596
|
+
|
|
667
597
|
## Sub-Agents And Parallel Work
|
|
668
598
|
|
|
669
599
|
Pi Workflow Suite includes reusable workflow agents and skills. Agents are isolated-context workers that can be invoked by the sub-agent tool or by Workflow Suite orchestration policy. Skills are bundled guidance modules for repeatable workflow practices. Runtime tools such as `workflow_web_search`, `workflow_web_fetch`, `workflow_diagram`, `workflow_progress`, and `standard_todo` are separate from both agents and skills.
|
|
@@ -716,7 +646,7 @@ Commands:
|
|
|
716
646
|
/workflow subagents status
|
|
717
647
|
/workflow subagents list
|
|
718
648
|
/workflow subagents orchestration
|
|
719
|
-
/workflow
|
|
649
|
+
/workflow settings Shared Sub-agents
|
|
720
650
|
```
|
|
721
651
|
|
|
722
652
|
## Review, Validation, Repair, And Retry
|
|
@@ -772,7 +702,6 @@ Compaction settings are available through:
|
|
|
772
702
|
|
|
773
703
|
```text
|
|
774
704
|
/workflow settings Shared Compaction
|
|
775
|
-
/workflow-settings configure compaction
|
|
776
705
|
```
|
|
777
706
|
|
|
778
707
|
Supported modes:
|
|
@@ -784,13 +713,7 @@ Supported modes:
|
|
|
784
713
|
|
|
785
714
|
Workflow Suite can request proactive compaction when context usage reaches the configured threshold. For Custom model mode, a configured compaction provider/model with custom compaction enabled arms the threshold trigger even when generic auto-trigger behavior is otherwise off. This lets compaction use a different model than planning, execution, review, or validation, which is useful when context summarization has a different cost, speed, or context-window requirement than active workflow work. Actual proactive compaction runs only at a safe after-turn idle agent boundary, so it does not interrupt arbitrary tool execution or queued workflow handoffs. Pi default auto-compaction remains available as a safety fallback near the model limit.
|
|
786
715
|
|
|
787
|
-
|
|
788
|
-
/workflow-settings set context autoCompactionEnabled true|false
|
|
789
|
-
/workflow-settings set context compactionTriggerPercent 50-95|default|reset
|
|
790
|
-
/workflow-settings set context compactionCooldownMinutes 0-240
|
|
791
|
-
/workflow-settings set context customCompactionReserveTokens 4096-65536|default|reset
|
|
792
|
-
/workflow-settings set context customCompactionKeepRecentTokens 1000-200000|default|reset
|
|
793
|
-
```
|
|
716
|
+
The grouped Shared Compaction menu controls auto-compaction, trigger threshold, cooldown, reserve tokens, keep-recent tokens, and custom compaction model behavior.
|
|
794
717
|
|
|
795
718
|
Important behavior:
|
|
796
719
|
|
|
@@ -850,9 +773,11 @@ Repo Lock is a Global Safety setting controlled through:
|
|
|
850
773
|
/workflow settings Global Safety
|
|
851
774
|
```
|
|
852
775
|
|
|
853
|
-
The underlying setting is `safety.repoLockEnabled`. The interactive toggle is project-scoped: it writes to the active repository override at `.pi/workflow-settings.json` so Repo Lock can be enabled for one project without changing every Pi session.
|
|
776
|
+
The underlying setting is `safety.repoLockEnabled`. The interactive toggle is project-scoped: it writes to the active repository override at `.pi/workflow-settings.json` so Repo Lock can be enabled for one project without changing every Pi session.
|
|
777
|
+
|
|
778
|
+
When enabled, Repo Lock keeps normal file tools, conservative bash path checks, and Workflow Suite sub-agents inside the active repository. Project `.pi` files may be read for settings and instruction context, but protected project control paths such as `.pi/workflow-settings.json`, `.pi/settings.json`, and `.pi/agents/**` are not edited through normal file tools. Use the dedicated settings UI/commands for intentional Workflow Suite settings changes, or temporarily disable Repo Lock, make the configuration change, and re-enable it.
|
|
854
779
|
|
|
855
|
-
Repo Lock
|
|
780
|
+
Repo Lock does not grant normal agent tools access to the live Pi runtime under `~/.pi/agent`. Workflow Suite internals still use the runtime for required state, settings, widgets, agents, skills, prompts, and install resources, but target-repository workflows should not inspect or mutate live runtime files through generic read/edit/write tools.
|
|
856
781
|
|
|
857
782
|
Repo Lock helps prevent accidental cross-repository work. It is not an operating-system sandbox, a complete shell parser, or a guarantee that every possible child process is contained. Review commands before running them, especially commands that invoke other tools or scripts.
|
|
858
783
|
|
|
@@ -927,16 +852,7 @@ Widget commands:
|
|
|
927
852
|
/workflow widgets off
|
|
928
853
|
```
|
|
929
854
|
|
|
930
|
-
Footer hints can be tuned without disabling the actual commands/shortcuts
|
|
931
|
-
|
|
932
|
-
```text
|
|
933
|
-
/workflow-settings set ui showIdleWorkflowEntryHint true|false
|
|
934
|
-
/workflow-settings set ui showActiveWorkflowSwitchHint true|false
|
|
935
|
-
/workflow-settings set ui showWidgetShortcutHint true|false
|
|
936
|
-
/workflow-settings set ui showPresetShortcutHint true|false
|
|
937
|
-
```
|
|
938
|
-
|
|
939
|
-
The interactive path is `/workflow settings UI Widgets` → `Footer Hints`. Direct command users can also open it with `/workflow-settings configure widgets`.
|
|
855
|
+
Footer hints can be tuned without disabling the actual commands/shortcuts. The interactive path is `/workflow settings UI Widgets` → `Footer Hints`.
|
|
940
856
|
|
|
941
857
|
Mission heartbeat and stale-status fields are tracked and displayed. Checkpoint interval settings record the preferred cadence for future timed checkpoint automation, while recovery actions remain user-supervised for safety.
|
|
942
858
|
|
|
@@ -1001,6 +917,7 @@ Operational scripts:
|
|
|
1001
917
|
| `scripts/backup-live.sh` | Create a timestamped live-runtime backup while excluding credentials, sessions, logs, and workflow state. |
|
|
1002
918
|
| `scripts/quarantine-live-junk.sh` | Dry-run or move known stale runtime debris to quarantine; it does not delete files. |
|
|
1003
919
|
| `scripts/bootstrap-project.sh /path/to/project` | Create project-local Workflow Suite setup files for a target project. |
|
|
920
|
+
| `scripts/sync-from-live.sh` | Maintainer synchronization helper for reviewing live runtime resources before deciding what belongs in source. |
|
|
1004
921
|
|
|
1005
922
|
The live Pi runtime should not contain a top-level `.git`, stale `*.backup.*` / `*.broken.*` files in active resource directories, or old recovery/disabled directories mixed with current resources. Quarantine moves files; it does not delete them.
|
|
1006
923
|
|
|
@@ -1115,7 +1032,7 @@ Example defaults shipped with the suite include Standard Mode enabled with confi
|
|
|
1115
1032
|
|
|
1116
1033
|
Users can change the workflow shape. For example, a user may disable reviewer involvement for fast local work, use a stronger reviewer for corporate policy review, route executor to a tool-use/code-writing model, route validator to a separate high-reasoning model, or use mission-specific models for long-running work.
|
|
1117
1034
|
|
|
1118
|
-
Use `/workflow settings Show Current Settings`
|
|
1035
|
+
Use `/workflow settings Show Current Settings` for the effective merged Workflow Suite configuration. For Pi core settings versus Workflow Suite settings, run `./scripts/audit-settings.sh [target-cwd]`; it reports global/project paths, Workflow Suite write targets, and safe summaries without writing settings or printing secrets.
|
|
1119
1036
|
|
|
1120
1037
|
Workflow Suite settings are currently global/project scoped, not session-local. A global preset/theme/model change can affect every session using global settings; a project `.pi/workflow-settings.json` can affect sessions launched under that project. Use project overrides for per-project behavior today. A true session-local profile lock should be treated as a separate future runtime feature; see `docs/SESSION_PROFILES.md` for the design.
|
|
1121
1038
|
|
|
@@ -1152,7 +1069,7 @@ Common recovery commands:
|
|
|
1152
1069
|
```text
|
|
1153
1070
|
/workflow status
|
|
1154
1071
|
/workflow settings Show Current Settings
|
|
1155
|
-
/
|
|
1072
|
+
./scripts/audit-settings.sh [target-cwd]
|
|
1156
1073
|
/mission status
|
|
1157
1074
|
/mission resume
|
|
1158
1075
|
/workflow widgets list
|
|
@@ -1171,10 +1088,10 @@ See `docs/TROUBLESHOOTING.md` for detailed diagnostics.
|
|
|
1171
1088
|
|
|
1172
1089
|
## Versioning
|
|
1173
1090
|
|
|
1174
|
-
The current
|
|
1091
|
+
The current preparation version is `v0.0.10`. Version information is intentionally aligned across:
|
|
1175
1092
|
|
|
1176
|
-
- `VERSION` (`v0.0.
|
|
1177
|
-
- `package.json` (`0.0.
|
|
1093
|
+
- `VERSION` (`v0.0.10`),
|
|
1094
|
+
- `package.json` (`0.0.10`),
|
|
1178
1095
|
- `package-lock.json`,
|
|
1179
1096
|
- this README,
|
|
1180
1097
|
- Workflow Suite settings/about output.
|
|
@@ -1189,13 +1106,11 @@ Apache-2.0 licenses the code, not the MediaDataFusion names, Workflow Suite name
|
|
|
1189
1106
|
|
|
1190
1107
|
This project is not officially affiliated with, endorsed by, sponsored by, or maintained by Pi or any third-party platform unless explicitly stated in official project materials.
|
|
1191
1108
|
|
|
1192
|
-
Security issues should
|
|
1193
|
-
|
|
1194
|
-
Pi Workflow Suite is maintainer-led and provided as-is. Feedback may be considered, but issues are not support tickets and no response or implementation timeline is promised. See `SUPPORT.md`.
|
|
1109
|
+
Security issues should be reported privately, not through public issues. See `SECURITY.md`. A private reporting channel will be published before broad public release.
|
|
1195
1110
|
|
|
1196
|
-
|
|
1111
|
+
Support is maintainer-led and best-effort. See `SUPPORT.md`.
|
|
1197
1112
|
|
|
1198
|
-
|
|
1113
|
+
Contributions are welcome when they align with the project direction. Workflow behavior, installation, dependency, security, and release changes require maintainer review. See `CONTRIBUTING.md`.
|
|
1199
1114
|
|
|
1200
1115
|
## Release Status
|
|
1201
1116
|
|
|
@@ -1206,20 +1121,12 @@ The intended package and repository identities are:
|
|
|
1206
1121
|
https://github.com/MediaDataFusion/pi-workflow-suite
|
|
1207
1122
|
```
|
|
1208
1123
|
|
|
1209
|
-
The current release candidate is prepared as `@mediadatafusion/pi-workflow-suite@0.0.9`.
|
|
1210
|
-
|
|
1211
1124
|
Private DEV, private main, and the clean public release repository should carry the same approved package version before publication.
|
|
1212
1125
|
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
```bash
|
|
1216
|
-
pi install npm:@mediadatafusion/pi-workflow-suite@0.0.9
|
|
1217
|
-
```
|
|
1218
|
-
|
|
1219
|
-
After npm publication, temporary evaluation in a current Pi run can use:
|
|
1126
|
+
Published public package versions are installed from npm with:
|
|
1220
1127
|
|
|
1221
1128
|
```bash
|
|
1222
|
-
pi
|
|
1129
|
+
pi install npm:@mediadatafusion/pi-workflow-suite@<version>
|
|
1223
1130
|
```
|
|
1224
1131
|
|
|
1225
1132
|
## Planned Enhancements
|
package/SECURITY.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Do not report security issues in public issues, public pull requests, or public discussions.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Private security reporting contact is not yet configured. This is a release blocker before enabling broad public issue intake or accepting outside security reports.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Supported versions will be listed after the first public release. Until then, only the current private preparation version is under active review.
|
|
8
|
+
|
|
9
|
+
Malicious pull requests, suspicious dependency changes, postinstall scripts, credential collection, telemetry, obfuscated code, or unexplained network behavior will be rejected.
|
|
10
|
+
|
|
11
|
+
When reporting a vulnerability privately after a reporting channel is configured, include the affected version, install method, reproduction steps, impact, and any relevant logs with secrets removed.
|
package/SUPPORT.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# Support
|
|
2
2
|
|
|
3
|
-
Pi Workflow Suite is a
|
|
3
|
+
Pi Workflow Suite is provided without a support SLA. Free use does not imply free support.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Support is provided at maintainer discretion. Before requesting help, read the README, release notes, and relevant troubleshooting guidance, and include the package version, install method, operating system, Pi version if known, commands run, and exact error output.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Priority help, implementation support, integration work, or workflow design may be available separately through a paid MediaDataFusion engagement.
|
|
7
|
+
Paid consulting through MediaDataFusion may be available separately for implementation, integration, or workflow design work.
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v0.0.
|
|
1
|
+
v0.0.10
|
|
@@ -14,8 +14,9 @@ Rules:
|
|
|
14
14
|
- Validate the original mission goal across all milestones, not only the last milestone.
|
|
15
15
|
- Review milestone outcomes, checkpoints, validation reports, repair history, changed files, tests/builds, integration risks, and unresolved issues.
|
|
16
16
|
- Return PASS only when the complete mission goal is satisfied and no blocking risk remains.
|
|
17
|
-
- Return
|
|
17
|
+
- Return FAIL when concrete missing requirements, regressions, unsafe changes, repairable defects, or concrete code/content/citation/source/file/metadata/artifact fixes remain.
|
|
18
|
+
- Return PARTIAL PASS only when manual/visual/browser verification remains or evidence is incomplete without a concrete repairable issue.
|
|
18
19
|
- Evidence gaps are not repairable defects unless a concrete missing requirement or artifact is identified.
|
|
19
|
-
-
|
|
20
|
+
- If concrete repairable issues remain, mark Concrete Repairable Issue: yes, list them clearly, and prefer FAIL over PARTIAL PASS.
|
|
20
21
|
|
|
21
22
|
Mermaid diagrams are rendered by Workflow Suite in a uniform dark-mode visual style. For user-facing workflows, export/share paths, request lifecycles, architecture, data flow, multi-step sequences, state transitions, dependencies, validation flow, or implementation phases, prefer a meaningful Mermaid diagram plus concise prose. Use concise labels and the right diagram type; do not hardcode random style/classDef/light-theme overrides unless the user explicitly asks. Skip diagrams for trivial responses.
|
|
@@ -13,9 +13,10 @@ Use validation sub-agents aggressively for independent checks, regression review
|
|
|
13
13
|
|
|
14
14
|
Verdict rules:
|
|
15
15
|
- PASS only when the approved plan is fully satisfied with no blocking unresolved risk.
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
- Manual visual-verification caveats alone are not repairable
|
|
16
|
+
- FAIL when concrete missing requirements, unexpected changes, regressions, broken checks, unsafe/out-of-scope work, or concrete code/content/citation/source/file/metadata/artifact fixes remain.
|
|
17
|
+
- PARTIAL PASS is only for manual/visual/browser verification caveats or evidence gaps without a concrete repairable issue.
|
|
18
|
+
- Manual visual-verification caveats alone are not repairable failures; recommend manual QA/revalidation instead of repair.
|
|
19
|
+
- If concrete repairable issues remain in code, content, citations, sources, generated files, indexes, metadata, artifacts, or validation artifacts, mark Concrete Repairable Issue: yes, list them clearly under Missing Requirements or Recommended Next Action, and prefer FAIL over PARTIAL PASS.
|
|
19
20
|
- Evidence gaps are not repairable defects unless a concrete missing requirement or artifact is identified.
|
|
20
21
|
|
|
21
22
|
Mermaid diagrams are rendered by Workflow Suite in a uniform dark-mode visual style. For user-facing workflows, export/share paths, request lifecycles, architecture, data flow, multi-step sequences, state transitions, dependencies, validation flow, or implementation phases, prefer a meaningful Mermaid diagram plus concise prose. Use concise labels and the right diagram type; do not hardcode random style/classDef/light-theme overrides unless the user explicitly asks. Skip diagrams for trivial responses.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Uses JSON mode to capture structured output from subagents.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { spawn } from "node:child_process";
|
|
18
|
+
import { execFileSync, spawn } from "node:child_process";
|
|
19
19
|
import { createRequire } from "node:module";
|
|
20
20
|
import * as fs from "node:fs";
|
|
21
21
|
import * as os from "node:os";
|
|
@@ -109,6 +109,42 @@ class SafeContainer {
|
|
|
109
109
|
const MAX_PARALLEL_TASKS = 8;
|
|
110
110
|
const MAX_CONCURRENCY = 4;
|
|
111
111
|
const COLLAPSED_ITEM_COUNT = 10;
|
|
112
|
+
const REPOLOCK_GUARD_EXTENSION = path.join(path.dirname(new URL(import.meta.url).pathname), "repolock-guard.ts");
|
|
113
|
+
|
|
114
|
+
function safeRealpath(candidate: string): string {
|
|
115
|
+
try {
|
|
116
|
+
return fs.realpathSync(candidate);
|
|
117
|
+
} catch {
|
|
118
|
+
return candidate;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function pathInsideRoot(candidate: string, root: string): boolean {
|
|
123
|
+
return candidate === root || candidate.startsWith(`${root}${path.sep}`);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function resolveSubagentCwd(candidate: string | undefined, defaultCwd: string): string {
|
|
127
|
+
return safeRealpath(path.resolve(defaultCwd, candidate || "."));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function repoRootForCwd(cwd: string): string {
|
|
131
|
+
try {
|
|
132
|
+
const root = execFileSync("git", ["rev-parse", "--show-toplevel"], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
133
|
+
return safeRealpath(root || cwd);
|
|
134
|
+
} catch {
|
|
135
|
+
return safeRealpath(cwd);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function repoLockRootForSubagent(defaultCwd: string, settings: ReturnType<typeof loadWorkflowSettings>): string | undefined {
|
|
140
|
+
if (process.env.PI_WORKFLOW_REPO_LOCK_ENABLED === "1" && process.env.PI_WORKFLOW_REPO_LOCK_ROOT) return safeRealpath(process.env.PI_WORKFLOW_REPO_LOCK_ROOT);
|
|
141
|
+
return settings.safety.repoLockEnabled === true ? repoRootForCwd(defaultCwd) : undefined;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function repoLockCwdError(candidate: string | undefined, defaultCwd: string, root: string): string | undefined {
|
|
145
|
+
const resolved = resolveSubagentCwd(candidate, defaultCwd);
|
|
146
|
+
return pathInsideRoot(resolved, root) ? undefined : `Repo Lock blocked sub-agent cwd outside current repository: ${resolved} (repo root: ${root})`;
|
|
147
|
+
}
|
|
112
148
|
|
|
113
149
|
function formatTokens(count: number): string {
|
|
114
150
|
if (count < 1000) return count.toString();
|
|
@@ -345,7 +381,23 @@ async function runSingleAgent(
|
|
|
345
381
|
};
|
|
346
382
|
}
|
|
347
383
|
|
|
348
|
-
const
|
|
384
|
+
const settings = loadWorkflowSettings(defaultCwd);
|
|
385
|
+
const lockRoot = repoLockRootForSubagent(defaultCwd, settings);
|
|
386
|
+
const effectiveCwd = resolveSubagentCwd(cwd, defaultCwd);
|
|
387
|
+
if (lockRoot && !pathInsideRoot(effectiveCwd, lockRoot)) {
|
|
388
|
+
return {
|
|
389
|
+
agent: agentName,
|
|
390
|
+
agentSource: agent.source,
|
|
391
|
+
task,
|
|
392
|
+
exitCode: 1,
|
|
393
|
+
messages: [],
|
|
394
|
+
stderr: `Repo Lock blocked sub-agent cwd outside current repository: ${effectiveCwd} (repo root: ${lockRoot})`,
|
|
395
|
+
usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0, contextTokens: 0, turns: 0 },
|
|
396
|
+
step,
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const args: string[] = ["--no-extensions", "--extension", REPOLOCK_GUARD_EXTENSION, "--mode", "json", "-p", "--no-session"];
|
|
349
401
|
if (agent.model) args.push("--model", agent.model);
|
|
350
402
|
if (agent.tools && agent.tools.length > 0) args.push("--tools", agent.tools.join(","));
|
|
351
403
|
|
|
@@ -390,13 +442,14 @@ async function runSingleAgent(
|
|
|
390
442
|
const exitCode = await new Promise<number>((resolve) => {
|
|
391
443
|
const invocation = getPiInvocation(args);
|
|
392
444
|
const proc = spawn(invocation.command, invocation.args, {
|
|
393
|
-
cwd:
|
|
445
|
+
cwd: effectiveCwd,
|
|
394
446
|
shell: false,
|
|
395
447
|
stdio: ["ignore", "pipe", "pipe"],
|
|
396
448
|
env: {
|
|
397
449
|
...process.env,
|
|
398
450
|
PI_SUBAGENT_WORKER: "1",
|
|
399
451
|
PI_SUBAGENT_NAME: agent.name,
|
|
452
|
+
...(lockRoot ? { PI_WORKFLOW_REPO_LOCK_ENABLED: "1", PI_WORKFLOW_REPO_LOCK_ROOT: lockRoot } : {}),
|
|
400
453
|
},
|
|
401
454
|
});
|
|
402
455
|
let buffer = "";
|
|
@@ -562,6 +615,19 @@ export default function (pi: ExtensionAPI) {
|
|
|
562
615
|
|
|
563
616
|
async execute(_toolCallId, params, signal, onUpdate, ctx) {
|
|
564
617
|
const settings = loadWorkflowSettings(ctx.cwd);
|
|
618
|
+
const lockRoot = repoLockRootForSubagent(ctx.cwd, settings);
|
|
619
|
+
if (lockRoot) {
|
|
620
|
+
const cwdErrors = [params.cwd, ...(params.tasks ?? []).map((task) => task.cwd), ...(params.chain ?? []).map((step) => step.cwd)]
|
|
621
|
+
.map((cwdValue) => repoLockCwdError(cwdValue, ctx.cwd, lockRoot))
|
|
622
|
+
.filter((error): error is string => Boolean(error));
|
|
623
|
+
if (cwdErrors.length) {
|
|
624
|
+
return {
|
|
625
|
+
content: [{ type: "text", text: cwdErrors[0] }],
|
|
626
|
+
details: { mode: "single", agentScope: params.agentScope ?? "user", projectAgentsDir: null, results: [] },
|
|
627
|
+
isError: true,
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
}
|
|
565
631
|
const subagentLimits = { timeoutMinutes: settings.subagents.subagentTimeoutMinutes, staleMinutes: settings.subagents.subagentStaleMinutes };
|
|
566
632
|
if (settings.subagents.requireApprovalBeforeRun === true) {
|
|
567
633
|
const requested = params.tasks?.length
|