@guanlin4924/devflow-pi 0.1.105 → 0.1.107
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/README.md +10 -8
- package/package.json +1 -1
- package/plugins/devflow-core/extensions/devflow-core.ts +287 -394
- package/plugins/devflow-core/runtime/hooks/context_sync_gate.py +3 -1
- package/plugins/devflow-core/runtime/hooks/hook_common.py +6 -5
- package/plugins/devflow-core/runtime/hooks/index_gate.py +19 -26
- package/plugins/devflow-core/skills/wireframe-proposal/SKILL.md +2 -0
- package/plugins/devflow-core/skills/wireframe-render/SKILL.md +2 -0
- package/plugins/devflow-core/skills/wireframe-review/SKILL.md +2 -0
- package/plugins/devflow-core/skills/wireframe-validate/SKILL.md +2 -0
- package/plugins/devflow-core/skills/workflow-dynamic/SKILL.md +41 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/SKILL.md +37 -50
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/advance_state.rb +46 -191
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/artifact_specs.rb +12 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/dynamic_plan.rb +504 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/execution_contract.rb +38 -1
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/gate_policy.rb +11 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/gate_result.rb +12 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/gate_runtime.rb +4 -9
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/inspect_state.rb +19 -86
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/parallel_recover.rb +24 -13
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/repair_control_plane.rb +4 -4
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/sync_artifacts.rb +7 -1
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/validate_state.rb +17 -39
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/wireframe_commit.rb +39 -3
- package/plugins/devflow-core/skills/workflow-orchestrator/templates/feature-development.yaml +2 -3
- package/plugins/devflow-core/skills/workflow-orchestrator/templates/regression-acceptance.yaml +0 -1
- package/plugins/devflow-core/skills/workflow-pipeline/SKILL.md +13 -5
- package/plugins/devflow-core/skills/workflow-pipeline/references/pipeline-flow.md +1 -1
- package/plugins/devflow-core/skills/workflow-project-context/SKILL.md +2 -0
- package/plugins/devflow-design/skills/workflow-api-call-guide/SKILL.md +2 -0
- package/plugins/devflow-design/skills/workflow-api-contract/SKILL.md +3 -1
- package/plugins/devflow-design/skills/workflow-api-supplement/SKILL.md +2 -0
- package/plugins/devflow-design/skills/workflow-architecture-feasibility/SKILL.md +2 -0
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/SKILL.md +6 -4
- package/plugins/devflow-design/skills/workflow-design-rule-pack/SKILL.md +2 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/SKILL.md +2 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/SKILL.md +6 -4
- package/plugins/devflow-design/skills/workflow-integration-verify/SKILL.md +3 -1
- package/plugins/devflow-design/skills/workflow-ui-spec/SKILL.md +4 -2
- package/plugins/devflow-implementation/agents/implementation-worker.md +2 -8
- package/plugins/devflow-implementation/skills/workflow-bug-fix/SKILL.md +5 -0
- package/plugins/devflow-implementation/skills/workflow-change-plan/SKILL.md +3 -1
- package/plugins/devflow-implementation/skills/workflow-execute-phase/SKILL.md +6 -1
- package/plugins/devflow-intel/skills/code-index-query/SKILL.md +2 -0
- package/plugins/devflow-intel/skills/workflow-code-index/SKILL.md +2 -0
- package/plugins/devflow-intel/skills/workflow-context-sync/SKILL.md +2 -0
- package/plugins/devflow-intel/skills/workflow-update-navigation/SKILL.md +3 -1
- package/plugins/devflow-quality/agents/code-reviewer.md +2 -0
- package/plugins/devflow-quality/skills/code-review/SKILL.md +7 -2
- package/plugins/devflow-quality/skills/workflow-acceptance-test-design/SKILL.md +3 -1
- package/plugins/devflow-quality/skills/workflow-gen-test-guide/SKILL.md +2 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/SKILL.md +2 -0
- package/plugins/devflow-quality/skills/workflow-human-acceptance/SKILL.md +2 -0
- package/plugins/devflow-quality/skills/workflow-regression-test-design/SKILL.md +2 -0
- package/plugins/devflow-quality/skills/workflow-release-closeout/SKILL.md +7 -5
- package/plugins/devflow-quality/skills/workflow-run-acceptance-tests/SKILL.md +11 -6
- package/plugins/devflow-requirements/skills/requirement-feasibility-review/SKILL.md +2 -0
- package/plugins/devflow-requirements/skills/workflow-demand-clarify/SKILL.md +2 -0
- package/plugins/devflow-requirements/skills/workflow-domain-modeling/SKILL.md +2 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/SKILL.md +6 -2
- package/plugins/devflow-requirements/skills/workflow-requirement-triage/SKILL.md +5 -0
- package/plugins/devflow-requirements/skills/workflow-wayfinder/SKILL.md +2 -0
- package/src/constants.ts +1 -1
- package/src/dynamic-workflow.ts +31 -0
- package/templates/omp/AGENTS.md +8 -3
|
@@ -5,6 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
|
|
6
6
|
import argparse
|
|
7
7
|
import json
|
|
8
|
+
import os
|
|
8
9
|
import subprocess
|
|
9
10
|
import sys
|
|
10
11
|
from pathlib import Path
|
|
@@ -163,7 +164,8 @@ def stop_hook() -> int:
|
|
|
163
164
|
print(
|
|
164
165
|
json.dumps(
|
|
165
166
|
{
|
|
166
|
-
"decision": "
|
|
167
|
+
"decision": "approve",
|
|
168
|
+
"soft_gate": True,
|
|
167
169
|
"reason": reason,
|
|
168
170
|
"stop_block_count": stop_block_count,
|
|
169
171
|
},
|
|
@@ -444,8 +444,8 @@ def tool_requests_protected_source(
|
|
|
444
444
|
|
|
445
445
|
# Core control store protection (approval records live in control.db). This is
|
|
446
446
|
# misuse prevention, not a defence against a hostile same-user process. It is
|
|
447
|
-
# always
|
|
448
|
-
#
|
|
447
|
+
# always detected; index_gate emits warnings rather than
|
|
448
|
+
# denial. Hook-config may only add extra protected path globs.
|
|
449
449
|
CONTROL_STORE_NAME_RE = re.compile(r"^control\.db(?:$|[-.])", re.IGNORECASE)
|
|
450
450
|
CANONICAL_ACCEPTANCE_RE = re.compile(
|
|
451
451
|
r"(?:^|/)\.devflow/planning/test-runs/[^/]+/acceptance-results(?:\.meta)?\.json$",
|
|
@@ -713,7 +713,7 @@ def tool_touches_control_store(event: dict[str, Any], root: Path) -> tuple[bool,
|
|
|
713
713
|
|
|
714
714
|
# MCP authorization and audit data are user-local security state. This guard
|
|
715
715
|
# is deliberately narrower than DEVFLOW_HOME: only mcp.json and mcp-audit/
|
|
716
|
-
# are
|
|
716
|
+
# are detected here; index_gate applies the soft/strict policy to the finding.
|
|
717
717
|
def path_is_mcp_protected(raw: str, cwd: Path) -> bool:
|
|
718
718
|
candidate = Path(_expand_shell_path(str(raw)))
|
|
719
719
|
if not candidate.is_absolute():
|
|
@@ -792,8 +792,9 @@ def tool_touches_mcp_config(event: dict[str, Any], root: Path) -> tuple[bool, li
|
|
|
792
792
|
|
|
793
793
|
|
|
794
794
|
# Run artifacts are user-local evidence, not agent-readable source. Keep this
|
|
795
|
-
# guard separate from the control-store guard:
|
|
796
|
-
# read exception is the Core-produced result.json summary.
|
|
795
|
+
# guard separate from the control-store guard: detection always runs and its
|
|
796
|
+
# only read exception is the Core-produced result.json summary. The caller
|
|
797
|
+
# chooses warning or denial according to the soft/strict policy.
|
|
797
798
|
def _run_root(cwd: Path) -> Path:
|
|
798
799
|
# macOS commonly exposes /var as a symlink to /private/var; use the
|
|
799
800
|
# canonical cwd so lexical and realpath checks compare in one namespace.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""PreToolUse
|
|
2
|
+
"""PreToolUse checks: report access risks without workflow blocking."""
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
6
|
import json
|
|
7
|
+
import os
|
|
7
8
|
|
|
8
9
|
from hook_common import (
|
|
9
10
|
direct_tool_paths,
|
|
@@ -22,50 +23,42 @@ from hook_common import (
|
|
|
22
23
|
)
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
def
|
|
26
|
-
print(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"hookEventName": "PreToolUse",
|
|
31
|
-
"permissionDecision": "deny",
|
|
32
|
-
"permissionDecisionReason": reason,
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
ensure_ascii=False,
|
|
36
|
-
)
|
|
37
|
-
)
|
|
26
|
+
def advise(reason: str) -> int:
|
|
27
|
+
print(json.dumps({"hookSpecificOutput": {
|
|
28
|
+
"hookEventName": "PreToolUse", "permissionDecision": "allow",
|
|
29
|
+
"additionalContext": "Workflow warning: " + reason,
|
|
30
|
+
}}, ensure_ascii=False))
|
|
38
31
|
return 0
|
|
39
32
|
|
|
40
33
|
|
|
41
34
|
def main() -> int:
|
|
42
35
|
event = read_event()
|
|
43
36
|
root = project_root(event)
|
|
44
|
-
#
|
|
37
|
+
# Check protected targets first; advise() reports findings.
|
|
45
38
|
mcp_blocked, mcp_paths = tool_touches_mcp_config(event, root)
|
|
46
39
|
if mcp_blocked:
|
|
47
|
-
return
|
|
40
|
+
return advise(
|
|
48
41
|
"MCP_CONFIG_PROTECTED: $DEVFLOW_HOME/mcp.json and $DEVFLOW_HOME/mcp-audit/ are reserved for "
|
|
49
|
-
"Devflow MCP authorization and audit records;
|
|
50
|
-
"
|
|
42
|
+
"Devflow MCP authorization and audit records; use the runtime authorization tools. "
|
|
43
|
+
"Access findings are advisory. Target: " + ", ".join(mcp_paths) + "."
|
|
51
44
|
)
|
|
52
45
|
control_blocked, control_paths = tool_touches_control_store(event, root)
|
|
53
46
|
if control_blocked:
|
|
54
|
-
return
|
|
47
|
+
return advise(
|
|
55
48
|
"CONTROL_STORE_PROTECTED: Devflow control.db, the Devflow data-home projects tree and writes to canonical "
|
|
56
|
-
"acceptance results are reserved for Core runtime tools; this misuse-prevention hook
|
|
57
|
-
"shell access
|
|
49
|
+
"acceptance results are reserved for Core runtime tools; this misuse-prevention hook warns about ordinary agent file and "
|
|
50
|
+
"shell access, but is not a same-user process sandbox. "
|
|
58
51
|
"Canonical acceptance-results*.json may be read with the Read/Grep file tools. "
|
|
59
|
-
f"Use devflow_approval(action=\"propose\"|\"list\") for approvals.
|
|
52
|
+
f"Use devflow_approval(action=\"propose\"|\"list\") for approvals. Target: {', '.join(control_paths)}."
|
|
60
53
|
)
|
|
61
54
|
run_blocked, run_paths = tool_touches_run_artifacts(event, root)
|
|
62
55
|
if run_blocked:
|
|
63
|
-
return
|
|
56
|
+
return advise(
|
|
64
57
|
"RUN_ARTIFACTS_PROTECTED: .devflow/runs/ contains trace, screenshots, runtime logs and other "
|
|
65
|
-
"user-local evidence
|
|
58
|
+
"user-local evidence; ordinary Agent access warns in soft mode and is denied in strict mode. Trace and screenshots "
|
|
66
59
|
"are for the user to inspect locally with Playwright in a terminal; Agent failure analysis must read "
|
|
67
60
|
"the Core-produced result.json summary instead. Only pure-read access to a feature execution's "
|
|
68
|
-
"result.json
|
|
61
|
+
"result.json needs no access warning. Target: " + ", ".join(run_paths) + "."
|
|
69
62
|
)
|
|
70
63
|
policy = load_policy(root)
|
|
71
64
|
session_id = ensure_session(root, event)
|
|
@@ -79,7 +72,7 @@ def main() -> int:
|
|
|
79
72
|
missing = [path for path in required if path not in observed]
|
|
80
73
|
strict = str(policy.get("mode", "strict")).lower() == "strict"
|
|
81
74
|
if strict and required and missing and blocked:
|
|
82
|
-
return
|
|
75
|
+
return advise(
|
|
83
76
|
"INDEX_GATE_BLOCKED: protected source access requires observed index evidence. "
|
|
84
77
|
f"Read these files first, in order: {', '.join(missing)}. "
|
|
85
78
|
f"Blocked target: {', '.join(paths)}. The gate records successful tool reads, not assistant promises."
|
|
@@ -3,6 +3,8 @@ name: wireframe-proposal
|
|
|
3
3
|
description: Generate or revise a low-fidelity wireframe proposal from controlled requirements. Use during the wireframe-proposal workflow step.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
门禁策略:默认软门禁,门禁行为以本段为准。本文及引用材料中的前置检查、审查、质量、完成条件和 CP 确认用于诊断;未满足时记录缺项、风险与后续处理,继续可执行的工作,不自动阻断阶段推进。保留真实的 failed/blocked/未审批状态,不把继续执行写成通过或人工批准。硬门禁及其恢复开关已移除。
|
|
7
|
+
|
|
6
8
|
# Wireframe Proposal
|
|
7
9
|
|
|
8
10
|
Run only when Core reports `wireframe-proposal` as the current step. A no-UI decision is evaluated and recorded by Core after CP-1; do not infer it from requirement prose, edit workflow state, or self-skip this step.
|
|
@@ -3,6 +3,8 @@ name: wireframe-render
|
|
|
3
3
|
description: Render validated canonical wireframe JSON into deterministic Markdown and SVG previews. Use after wireframe-validate.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
门禁策略:默认软门禁,门禁行为以本段为准。本文及引用材料中的前置检查、审查、质量、完成条件和 CP 确认用于诊断;未满足时记录缺项、风险与后续处理,继续可执行的工作,不自动阻断阶段推进。保留真实的 failed/blocked/未审批状态,不把继续执行写成通过或人工批准。硬门禁及其恢复开关已移除。
|
|
7
|
+
|
|
6
8
|
# Wireframe Render
|
|
7
9
|
|
|
8
10
|
Run only when Core reports `wireframe-render` as the current step. A no-UI decision is evaluated and recorded by Core after CP-1; do not infer it from requirement prose, edit workflow state, or self-skip this step.
|
|
@@ -3,6 +3,8 @@ name: wireframe-review
|
|
|
3
3
|
description: Present validated wireframe previews and unresolved questions for explicit user review. Use at the wireframe-review checkpoint.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
门禁策略:默认软门禁,门禁行为以本段为准。本文及引用材料中的前置检查、审查、质量、完成条件和 CP 确认用于诊断;未满足时记录缺项、风险与后续处理,继续可执行的工作,不自动阻断阶段推进。保留真实的 failed/blocked/未审批状态,不把继续执行写成通过或人工批准。硬门禁及其恢复开关已移除。
|
|
7
|
+
|
|
6
8
|
# Wireframe Review
|
|
7
9
|
|
|
8
10
|
Run only when Core reports `wireframe-review` as the current step. A no-UI decision is evaluated and recorded by Core after CP-1; do not infer it from requirement prose, edit workflow state, or self-skip this step.
|
|
@@ -3,6 +3,8 @@ name: wireframe-validate
|
|
|
3
3
|
description: Run deterministic validation for a wireframe proposal and build canonical JSON. Use after wireframe-proposal.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
门禁策略:默认软门禁,门禁行为以本段为准。本文及引用材料中的前置检查、审查、质量、完成条件和 CP 确认用于诊断;未满足时记录缺项、风险与后续处理,继续可执行的工作,不自动阻断阶段推进。保留真实的 failed/blocked/未审批状态,不把继续执行写成通过或人工批准。硬门禁及其恢复开关已移除。
|
|
7
|
+
|
|
6
8
|
# Wireframe Validate
|
|
7
9
|
|
|
8
10
|
Run only when Core reports `wireframe-validate` as the current step. A no-UI decision is evaluated and recorded by Core after CP-1; do not infer it from requirement prose, edit workflow state, or self-skip this step.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-dynamic
|
|
3
|
+
description: Execute a Core-owned dynamic requirement plan, maintain one readable requirement document, route technical findings to repair skills, and ask only genuine business decisions. Use when the inspector reports mode dynamic; existing fixed workflows keep their own contracts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dynamic requirement delivery
|
|
7
|
+
|
|
8
|
+
Use `devflow_plan inspect` as the scheduling authority. Present task titles and progress in the user's language. Do not edit STATE, synthesize test results, or use legacy complete-step/checkpoint tools.
|
|
9
|
+
|
|
10
|
+
## Intent and planning
|
|
11
|
+
|
|
12
|
+
Read the single document returned by Core and inspect relevant source. Update that document for scope, approach, and acceptance requirements. Each acceptance clause has a stable heading such as `### R-1: Do not send another batch after the deadline`. Preserve IDs across wording changes. Cosmetic whitespace does not change the obligation. Removing an obligation requires a genuine scope decision; never delete a failed obligation to finish.
|
|
13
|
+
|
|
14
|
+
Propose tasks with `revise`, including its inspected `expected_revision` and a plain-language change reason. Fields are `id`, `title`, `kind`, `requirements`, `dependencies`, `inputs`, `outputs`, `checks`. Allowed kinds: discover, implement, verify, review. Each check declares an executable `argv` array and optional timeout seconds. Inputs must include the relevant production code, tests, and configuration: a test file alone is insufficient. Prefer directories where additional source files affect behavior. Every acceptance clause needs a verification task. Code changes need an independent review task that depends on the implementation and verification tasks.
|
|
15
|
+
|
|
16
|
+
Generate only applicable work. A backend-only feature has no UI, wireframe, browser-test, or frontend-document task. If applicability is unclear, investigate it before proposing that branch. Do not generate no-op documents. Tasks may produce source, tests, migrations, schemas or genuinely needed design assets; their existence must have a consumer.
|
|
17
|
+
|
|
18
|
+
## Execution
|
|
19
|
+
|
|
20
|
+
1. Inspect and claim the task selected by Core. Use the returned task ID and attempt for all subsequent results.
|
|
21
|
+
2. Read its exact Skill ID. In dynamic mode use that skill's technical procedures, but the dynamic task supplies scope, inputs, outputs and acceptance. Legacy stage lists, mandatory Markdown/meta pairs and checkpoint instructions do not apply.
|
|
22
|
+
3. For discovery/implementation/repair, do the work and call `report` with a factual summary. This records activity completion, not an acceptance pass.
|
|
23
|
+
4. For verification, call `verify`. Core executes the declared commands and captures exit status and output. Do not substitute a shell transcript or self-reported pass. Use tests that assert the actual expected behavior, including production paths and meaningful failure scenarios.
|
|
24
|
+
5. For review, dispatch a read-only `devflow-code-reviewer` task with the requirement document, task, source paths and recorded verification evidence. Ask for strict JSON `{"summary":"...","findings":[...]}`; each finding identifies the violated requirement, evidence, affected scope and suggested recheck. Submit its task-call ID using `review_result`; Core accepts only the captured child result, not your rewritten report.
|
|
25
|
+
6. Continue ready tasks. Failed checks automatically create a bounded repair task. Read the finding and invoke its repair skill, then allow Core to rerun the original verification. Do not reset repair budgets by renaming tasks.
|
|
26
|
+
|
|
27
|
+
## Changes, waiting, and recovery
|
|
28
|
+
|
|
29
|
+
Keep stable task IDs. To cancel unnecessary work, retain the task with `cancelled: true` and a reason and rewire its consumers in the same proposal. Preserve verification coverage. A failed required behavior is a repair, not an irrelevant task.
|
|
30
|
+
|
|
31
|
+
After a requirement edit, inspect and revise only affected work. Old evidence remains history and cannot certify changed inputs. Never weaken checks merely to obtain a pass.
|
|
32
|
+
|
|
33
|
+
Use `decision` only for business alternatives, scope reduction, residual-risk choices, or actions outside existing authorization. Supply one clear question and two or three options with consequences; place the recommendation first. Core displays and records the actual user choice. Missing metadata, stale indexes, missing tests and repairable code defects are technical work, not user decisions. A cancelled choice stays pending; it is not approval. Continue independent tasks if possible.
|
|
34
|
+
|
|
35
|
+
For removed acceptance clauses, include their IDs in `remove_requirements` and identify the exact `approval_option` in the decision. Only that actual user selection authorizes removing those clauses; bind the subsequent revision with `scope_decision_id`. A generic confirmation or a choice to retain scope is not permission to remove acceptance requirements.
|
|
36
|
+
|
|
37
|
+
For an interrupted running/checking task, inspect actual effects first. Use `recover` with the findings only after establishing the previous operation is no longer running and retry is appropriate. Do not rerun uncertain external writes. Repair exhaustion remains failed: explain what was attempted and actionable next choices without claiming delivery complete.
|
|
38
|
+
|
|
39
|
+
If an external dependency is unavailable, use `wait` with the task attempt and concrete reason. After read-only evidence establishes readiness, use `resume`; this creates eligibility for a new attempt. Do not classify missing generated documents as external dependencies.
|
|
40
|
+
|
|
41
|
+
Summarize the readable task board and remaining decisions. Detailed machine evidence stays in Core; do not generate another report document for each invocation.
|
|
@@ -3,6 +3,14 @@ name: workflow-orchestrator
|
|
|
3
3
|
description: Use when the user asks to continue, resume, advance, inspect, or route a .devflow/planning-based workflow; when the OMP development agent must decide the next workflow skill from project state; or when a checkpoint must be handled before proceeding.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
Dynamic plan mode: when Core reports `mode: dynamic`, use `workflow-dynamic` as the execution protocol. The selected task supplies scope, dependencies, required outputs and verification. Use this skill's relevant technical guidance, but do not create legacy stage documents/meta pairs, require fixed checkpoints, or advance legacy STATE. Return activity/evidence to `devflow_plan`; only Core records verification.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## 默认软门禁策略
|
|
10
|
+
|
|
11
|
+
工作流硬门禁已移除。下文及各步骤中的产物、索引、合同、审查、质量、恢复和 CP 审批条件均为诊断建议:保留失败证据和缺项,允许继续执行。用户说“下一步”即可推进,无需额外批准弹窗;不得把继续执行记录成人工批准,也不得把失败、未执行的测试改写为通过。真实读写/执行失败、无法解析的状态和并发版本冲突须如实报告。硬门禁及其恢复开关已移除。
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# Workflow Orchestrator
|
|
7
15
|
|
|
8
16
|
## Overview
|
|
@@ -13,9 +21,9 @@ This skill is the **single source of truth for all execution-time rules**: gate
|
|
|
13
21
|
|
|
14
22
|
## Chain-skill mode (current)
|
|
15
23
|
|
|
16
|
-
The
|
|
24
|
+
The chain skill owns dispatch and sequencing. Core contract, checker, output, and review gates are diagnostic only and must not hard-block skill execution. Call the current step skill, verify its declared inputs and outputs, collect its result, and continue the chain; preserve missing facts and failed checks as structured findings for the next skill or the user. Do not invoke Core gate APIs to force a step through, and report operations that cannot execute because of unsafe paths, corrupted state, or genuinely missing execution inputs. CP confirmation is advisory by default.
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
Hard workflow gates and their configuration switches have been removed.
|
|
19
27
|
|
|
20
28
|
## Quick Start
|
|
21
29
|
|
|
@@ -60,10 +68,10 @@ When the invocation contains `<devflow-runtime-directive>`, run the workflow con
|
|
|
60
68
|
1. Inspect state and execute exactly the returned action.
|
|
61
69
|
2. After a successful step transition and artifact synchronization, inspect state again.
|
|
62
70
|
3. Continue with the newly returned action and load only that step's Skill.
|
|
63
|
-
4.
|
|
64
|
-
5.
|
|
71
|
+
4. On `await_user_confirmation`, follow the soft checkpoint rules below and continue without fabricating approval. Stop on `workflow_complete`, an explicit user interruption, an unrecoverable operation failure, or an actual control-plane error reported as `blocked`.
|
|
72
|
+
5. When explicit CP confirmation is enabled, present the checkpoint and yield to the user at `await_user_confirmation`; resume after confirmation and a successful `devflow_transition`. Otherwise report the checkpoint diagnostics and continue through the soft transition.
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
Apply the configured gate policy during automatic execution. Preserve diagnostics and approval facts; re-inspect before retrying a stale revision. An operation that actually failed remains failed. If context pressure requires a new turn, preserve project truth in `.devflow/planning`, finish required context synchronization, and use `/devflow resume` rather than inventing state from the conversation.
|
|
67
75
|
|
|
68
76
|
## Step Execution Protocol
|
|
69
77
|
|
|
@@ -80,58 +88,37 @@ Each step execution follows this fixed sequence:
|
|
|
80
88
|
|
|
81
89
|
**After execution:**
|
|
82
90
|
6. Verify the step's outputs exist and record the revision returned by `devflow_state(action="inspect")`. **Do not call `devflow_transition` or write `xd://devflow_transition`: the Devflow Runtime owns the user confirmation and the atomic state transition after this agent turn.**
|
|
83
|
-
7. If the YAML step has `meta_output`, verify the `.meta.json` file exists and has the required fields. If missing,
|
|
91
|
+
7. If the YAML step has `meta_output`, verify the `.meta.json` file exists and has the required fields. If missing, record an advisory with reason "missing_meta_output" and continue without inventing metadata.
|
|
84
92
|
8. `devflow_transition` validates the proposed state before writing and rejects inconsistent updates. Never repeat the transition after it reports success.
|
|
85
93
|
9. Call `devflow_artifact(action="sync", preserve=false)` only when the registry still shows stale `planned`/`generated` statuses for completed steps.
|
|
86
94
|
|
|
87
95
|
## Checkpoint Rules
|
|
88
96
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
When the inspector returns `await_user_confirmation
|
|
92
|
-
|
|
93
|
-
1. Read the checkpoint definition from YAML: `checkpoints.<cp-id>`.
|
|
94
|
-
2. Prefer structured checkpoint fields when present:
|
|
95
|
-
- `producing_step`
|
|
96
|
-
- `required_outputs`
|
|
97
|
-
- `required_meta_output`
|
|
98
|
-
- `required_meta_fields`
|
|
99
|
-
- `summary_fields`
|
|
100
|
-
- `prompt`
|
|
101
|
-
- `confirm_options`
|
|
102
|
-
- `skip_policy`
|
|
103
|
-
3. Read the producing step's `meta_output` or checkpoint `required_meta_output` → `.meta.json` to get structured field values (e.g., `fp_count`, `br_count`).
|
|
104
|
-
4. Verify the listed required outputs exist.
|
|
105
|
-
5. Check artifact registry content_valid status for the listed outputs.
|
|
106
|
-
6. Use `ask` to present the CP prompt, filling in the `summary_fields` from `.meta.json` data.
|
|
107
|
-
7. If the user confirms, inspect the current revision and call `devflow_transition(action="confirm-checkpoint", expectedRevision=<revision>)`.
|
|
108
|
-
8. If the user asks for fixes or rejects the checkpoint, keep `.devflow/planning/STATE.md` at `status: waiting_checkpoint`, inspect the current revision, call `devflow_transition(action="checkpoint-decision", decision="needs_fix", expectedRevision=<revision>)`, and route to the requested remediation.
|
|
109
|
-
|
|
110
|
-
CP skip rules:
|
|
111
|
-
- CP-1, CP-API, CP-2, CP-3, CP-4: **never skip**.
|
|
112
|
-
- CP-2 is the Merge Gate. It cannot be skipped in the dual-track workflow.
|
|
97
|
+
CP definitions (prompts, options, fields) are in the active workflow YAML (`feature-development.yaml` → `checkpoints`). By default, report missing outputs and checks, then use the Core transition to continue with `continued_with_warning`; no additional approval prompt is required. This records continuation, never human approval. Explicit review decisions remain available when the user requests them; they are not prerequisites for continuation.
|
|
98
|
+
|
|
99
|
+
When the inspector returns `await_user_confirmation`, inspect the current revision, report missing outputs and check results, and continue through the Core transition with `continued_with_warning`. Do not create an approval record or freeze candidate facts merely to advance. If the user requests fixes or rejects an output, follow that request.
|
|
113
100
|
|
|
114
101
|
## Global Gate Rules
|
|
115
102
|
|
|
116
|
-
After each step completes,
|
|
103
|
+
After each step completes, evaluate the following checks and carry any failures forward as advisories:
|
|
117
104
|
|
|
118
|
-
| Step |
|
|
105
|
+
| Step | Check | Advisory handoff |
|
|
119
106
|
|------|------|---------|
|
|
120
|
-
| requirement-triage | triage.meta.json `status` is `routed` AND `route` is `ready_for_wayfinder` |
|
|
121
|
-
| requirement-wayfinder | 决策地图.meta.json `status=ready_for_baseline` AND `ready_for_baseline=true` |
|
|
122
|
-
| domain-modeling | 领域模型记录及 meta 存在且标识当前功能 |
|
|
123
|
-
| requirement-feasibility-review | 可实现性审查.meta.json `status=ready_for_baseline`、`baseline_gate=pass`、`blocking_gap_count=0` 且无 critical finding;`gap_count` 记录全部发现数 |
|
|
124
|
-
| requirement-baseline | baseline.md review conclusion is "通过" AND baseline.meta.json `review_status` / `traceability_status` are `passed` AND blocking counters are all 0 |
|
|
125
|
-
| api-contract | api-contract.meta.json `review_status` / `traceability_status` are `passed` AND `pending_contract_count` is 0 |
|
|
126
|
-
| architecture-feasibility | Core-derived `architecture-brief.md` / meta exist. If `assessment_level=full`, require `assessment_status=ready` and `comparison_status=confirmed`; a lightweight incomplete result may proceed only as an explicitly unresolved downstream input. |
|
|
127
|
-
| ui-spec | UI-SPEC.md review conclusion is "通过" |
|
|
128
|
-
| feature-breakdown | 功能点梳理.md review conclusion is "通过" |
|
|
129
|
-
| api-call-guide | api-call-guide.meta.json `frontend_consumable` and `mock_ready` are true, pending_items is empty |
|
|
130
|
-
| frontend-tech-spec + backend-tech-spec | Both review conclusions are "通过" |
|
|
131
|
-
| integration-verify | integration-report.meta.json `merge_gate_status` / `traceability_status` are `passed` and all mismatch/blocking counters are 0 |
|
|
132
|
-
| change-plan | 变更清单.md review conclusion is "通过" AND 变更清单.meta.json traceability_status is `passed` with zero uncovered/orphan counts |
|
|
133
|
-
|
|
134
|
-
|
|
107
|
+
| requirement-triage | triage.meta.json `status` is `routed` AND `route` is `ready_for_wayfinder` | Carry findings to requirement-wayfinder |
|
|
108
|
+
| requirement-wayfinder | 决策地图.meta.json `status=ready_for_baseline` AND `ready_for_baseline=true` | Carry findings to domain-modeling |
|
|
109
|
+
| domain-modeling | 领域模型记录及 meta 存在且标识当前功能 | Carry findings to requirement-feasibility-review |
|
|
110
|
+
| requirement-feasibility-review | 可实现性审查.meta.json `status=ready_for_baseline`、`baseline_gate=pass`、`blocking_gap_count=0` 且无 critical finding;`gap_count` 记录全部发现数 | Carry findings to requirement-baseline |
|
|
111
|
+
| requirement-baseline | baseline.md review conclusion is "通过" AND baseline.meta.json `review_status` / `traceability_status` are `passed` AND blocking counters are all 0 | Carry findings to api-contract |
|
|
112
|
+
| api-contract | api-contract.meta.json `review_status` / `traceability_status` are `passed` AND `pending_contract_count` is 0 | Carry findings to dual tracks |
|
|
113
|
+
| architecture-feasibility | Core-derived `architecture-brief.md` / meta exist. If `assessment_level=full`, require `assessment_status=ready` and `comparison_status=confirmed`; a lightweight incomplete result may proceed only as an explicitly unresolved downstream input. | Carry findings to dual tracks for an incomplete full assessment |
|
|
114
|
+
| ui-spec | UI-SPEC.md review conclusion is "通过" | Carry findings to feature-breakdown |
|
|
115
|
+
| feature-breakdown | 功能点梳理.md review conclusion is "通过" | Carry findings to tech-specs |
|
|
116
|
+
| api-call-guide | api-call-guide.meta.json `frontend_consumable` and `mock_ready` are true, pending_items is empty | Carry findings to merge review |
|
|
117
|
+
| frontend-tech-spec + backend-tech-spec | Both review conclusions are "通过" | Carry findings to integration-verify |
|
|
118
|
+
| integration-verify | integration-report.meta.json `merge_gate_status` / `traceability_status` are `passed` and all mismatch/blocking counters are 0 | Carry findings to change-plan |
|
|
119
|
+
| change-plan | 变更清单.md review conclusion is "通过" AND 变更清单.meta.json traceability_status is `passed` with zero uncovered/orphan counts | Carry findings to execute |
|
|
120
|
+
|
|
121
|
+
Retain failures as diagnostic findings and continue with usable artifacts. Report any operation that cannot execute.
|
|
135
122
|
|
|
136
123
|
## Requirement Writeback Gate
|
|
137
124
|
|
|
@@ -180,7 +167,7 @@ When the inspector returns `run_parallel_window`:
|
|
|
180
167
|
|
|
181
168
|
## State Writeback Rules
|
|
182
169
|
|
|
183
|
-
Use `devflow_transition` for deterministic state updates.
|
|
170
|
+
Use `devflow_transition` for deterministic state updates. The OMP extension warns about direct file edits and direct calls to writer scripts without blocking workflow progress. Use Core tools to preserve consistent state and revision checks.
|
|
184
171
|
|
|
185
172
|
Common operations:
|
|
186
173
|
|
|
@@ -247,7 +234,7 @@ Steps with `meta_output` in the workflow YAML must produce a `.meta.json` file a
|
|
|
247
234
|
1. After step execution, check if the YAML step has `meta_output`.
|
|
248
235
|
2. If yes, verify the `.meta.json` file at `meta_output.path` exists.
|
|
249
236
|
3. Verify all `required: true` fields are present and non-null.
|
|
250
|
-
4. If missing or incomplete,
|
|
237
|
+
4. If missing or incomplete, retain the failed check and missing evidence as an advisory and continue with the available inputs.
|
|
251
238
|
|
|
252
239
|
The `.meta.json` data feeds CP prompts — e.g., CP-1 reads `baseline.meta.json` to show `fp_count: 7` instead of having the AI count manually.
|
|
253
240
|
|
|
@@ -257,7 +244,7 @@ This skill must be portable. Do not require manually-created `.devflow/planning`
|
|
|
257
244
|
|
|
258
245
|
If `.devflow/planning/STATE.md` is missing and project context files are also missing, route to `workflow-project-context` instead of asking for `init_state.rb`. If `.devflow/planning/STATE.md` is missing but project context files already exist, keep the existing `init_state.rb` recovery path.
|
|
259
246
|
|
|
260
|
-
If `.devflow/planning/STATE.md` contains
|
|
247
|
+
If `.devflow/planning/STATE.md` contains findings with `type: PENDING_TEMPLATE`, report the missing depth spec template and continue normal dispatch in soft mode. Include the codebase, topic, matched path, missing template path, and impact.
|
|
261
248
|
|
|
262
249
|
Use these generators:
|
|
263
250
|
|