feat(workflow): dry-run preview — resolve tokens and show the step plan without executing hooks

オープン
#114 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, yaml

調査の方向性

Start with src/profiles/core/environment/workflow.py and read _substitute_variables to understand the existing token resolution, then check the workflow exports in src/profiles/core/__init__.py. The proposal also involves the preview route in src/profiles/server/routes/workflow.py, WorkflowRunnerModal.tsx, and both hooks guides. Done means a resolved, read-only preview reports condition outcomes without executing hooks; the issue names no tests to run.

索引モデルが issue の本文から書いたものです。

説明

enhancement

Problem

Authoring workflow hooks today means editing the .profiles YAML, saving, launching a real file, and watching the commands actually run. Every iteration has side effects: files get moved/archived, commands execute, launches happen. A user tweaking a phase: post archive step, or checking whether {{file}}/{{output}} resolve as expected in an ask: prompt, has no way to see the resolved plan without performing the launch. This makes hook authoring the highest-friction part of the workflow feature — debugging requires real files and real executions.

Evidence

  • Token substitution is a private helper with no resolve-only entry point on the core surface: _substitute_variables at src/profiles/core/environment/workflow.py:660. src/profiles/core/__init__.py exports run_hooks_for_file/parse_hook_entries but nothing that renders a step without executing it.
  • Server workflow routes are execution-only: start/get/respond/abort (src/profiles/server/routes/workflow.py:397-643). No preview/dry-run route.
  • The web runner (src/profiles/web/src/components/WorkflowRunnerModal.tsx) can only show steps as they actually execute.
  • docs/hooks-guide.en.md / hooks-guide.fr.md document the token grammar but offer no way to check a substitution result before a real launch.

Proposed approach

  • Core (pure, UI-free): a preview_workflow(steps, context) -> list[PreviewedStep] function in profiles.core.environment.workflow next to _substitute_variables, reusing the same substitution logic (including the quote-aware command path). {{output}} renders as a labelled placeholder since nothing executes; if: conditions are evaluated and reported as true/false/skip. Export from profiles.core.
  • Server: POST /api/workflow/preview taking a file path, with an optional inline steps override so the YAML config editor (issue #95) can preview a draft before saving it.
  • Web: a read-only "Preview" view — either a tab in WorkflowRunnerModal or a standalone modal listing each step with phase, resolved command/message, and condition outcome. No run button.
  • Docs: hooks-guide (en + fr) section.
  • Scope M. No breaking change — pure addition.

Alternatives considered

  1. Cancel before the first command in a real run — still spawns processes, races the user, and can't preview an unsaved draft; doesn't help authoring.
  2. CLI-only profiles --preview-hooks <file> — useful but misses the web-first audience; the core function proposed above can back a CLI flag later at near-zero cost.

Proposed during automated enhancement scan 2026-11-04

主要言語
Python
スター
1
フォーク
1
平均マージ
4時間 46分
マージ済み PR(30日)
55

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

falbany/ProFiles のほかの issue

falbany/ProFiles の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。