@bx-h/meta-flow 0.1.0
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/LICENSE +21 -0
- package/README.md +172 -0
- package/bin/meta-flow.js +7 -0
- package/examples/sample-task/adjudication-report.json +14 -0
- package/examples/sample-task/final-report.md +26 -0
- package/examples/sample-task/goal-contract.json +44 -0
- package/examples/sample-task/milestone-plan.json +31 -0
- package/examples/sample-task/milestones/M1/direction-evaluation.json +16 -0
- package/examples/sample-task/milestones/M1/task-list.json +41 -0
- package/examples/sample-task/milestones/M1/tasks/T1/execution-report.json +25 -0
- package/examples/sample-task/milestones/M1/tasks/T1/task-spec.json +37 -0
- package/examples/sample-task/milestones/M1/tasks/T1/verification-report.json +23 -0
- package/examples/sample-task/proposal-summary.md +21 -0
- package/examples/sample-task/proposal.md +29 -0
- package/examples/sample-task/questioning-report.json +31 -0
- package/examples/sample-task/raw-request.md +1 -0
- package/examples/sample-task/review-aggregate.json +34 -0
- package/examples/sample-task/reviews/product-reviewer.json +16 -0
- package/examples/sample-task/reviews/risk-reviewer.json +16 -0
- package/examples/sample-task/reviews/technical-reviewer.json +16 -0
- package/examples/sample-task/reviews/verification-reviewer.json +15 -0
- package/examples/sample-task/state.json +35 -0
- package/marketplace/marketplace.json +20 -0
- package/package.json +50 -0
- package/plugin/.codex-plugin/plugin.json +36 -0
- package/plugin/agent-templates/adjudicator.toml +26 -0
- package/plugin/agent-templates/direction-evaluator.toml +18 -0
- package/plugin/agent-templates/executor.toml +21 -0
- package/plugin/agent-templates/final-summarizer.toml +17 -0
- package/plugin/agent-templates/planner.toml +18 -0
- package/plugin/agent-templates/product-reviewer.toml +15 -0
- package/plugin/agent-templates/proposal-summarizer.toml +17 -0
- package/plugin/agent-templates/questioner.toml +22 -0
- package/plugin/agent-templates/researcher-proposer.toml +18 -0
- package/plugin/agent-templates/result-verifier.toml +20 -0
- package/plugin/agent-templates/risk-reviewer.toml +14 -0
- package/plugin/agent-templates/task-decomposer.toml +19 -0
- package/plugin/agent-templates/technical-reviewer.toml +14 -0
- package/plugin/agent-templates/verification-reviewer.toml +15 -0
- package/plugin/assets/icon.svg +10 -0
- package/plugin/assets/screenshot-placeholder.md +3 -0
- package/plugin/scripts/_common.py +95 -0
- package/plugin/scripts/aggregate_reviews.py +99 -0
- package/plugin/scripts/new_task.py +78 -0
- package/plugin/scripts/status.py +95 -0
- package/plugin/scripts/validate_adjudication.py +47 -0
- package/plugin/scripts/validate_goal_contract.py +56 -0
- package/plugin/scripts/validate_milestone_plan.py +49 -0
- package/plugin/scripts/validate_task_list.py +59 -0
- package/plugin/scripts/validate_task_verification.py +49 -0
- package/plugin/skills/meta-flow/SKILL.md +159 -0
- package/plugin/skills/meta-flow/references/adjudication-policy.md +30 -0
- package/plugin/skills/meta-flow/references/direction-evaluation-policy.md +24 -0
- package/plugin/skills/meta-flow/references/execution-policy.md +35 -0
- package/plugin/skills/meta-flow/references/review-rubric.md +28 -0
- package/plugin/skills/meta-flow/references/role-contracts.md +29 -0
- package/plugin/templates/adjudication-report.json +11 -0
- package/plugin/templates/direction-evaluation.json +16 -0
- package/plugin/templates/final-report.md +11 -0
- package/plugin/templates/goal-contract.json +20 -0
- package/plugin/templates/milestone-plan.json +15 -0
- package/plugin/templates/proposal-summary.md +11 -0
- package/plugin/templates/proposal.md +17 -0
- package/plugin/templates/questioning-report.json +15 -0
- package/plugin/templates/raw-request.md +3 -0
- package/plugin/templates/review-aggregate.json +14 -0
- package/plugin/templates/reviewer-report.json +10 -0
- package/plugin/templates/state.json +23 -0
- package/plugin/templates/task-execution-report.json +13 -0
- package/plugin/templates/task-list.json +20 -0
- package/plugin/templates/task-spec.json +16 -0
- package/plugin/templates/task-verification-report.json +13 -0
- package/src/cli/commands/doctor.js +171 -0
- package/src/cli/commands/install.js +120 -0
- package/src/cli/commands/print_paths.js +20 -0
- package/src/cli/commands/uninstall.js +56 -0
- package/src/cli/commands/verify.js +197 -0
- package/src/cli/index.js +53 -0
- package/src/cli/lib/agents.js +89 -0
- package/src/cli/lib/args.js +49 -0
- package/src/cli/lib/codex_config.js +106 -0
- package/src/cli/lib/fs_safe.js +142 -0
- package/src/cli/lib/logger.js +23 -0
- package/src/cli/lib/marketplace.js +72 -0
- package/src/cli/lib/paths.js +37 -0
- package/src/cli/lib/plugin.js +57 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"task_id": "sample-health-check",
|
|
3
|
+
"phase": "DONE",
|
|
4
|
+
"created_at": "2026-06-05T00:00:00Z",
|
|
5
|
+
"updated_at": "2026-06-05T00:30:00Z",
|
|
6
|
+
"proposal_review_round": 1,
|
|
7
|
+
"direction_adjustment_round": 0,
|
|
8
|
+
"current_milestone_id": "M1",
|
|
9
|
+
"current_task_id": "T1",
|
|
10
|
+
"max_proposal_rework_rounds": 3,
|
|
11
|
+
"max_task_repair_rounds": 2,
|
|
12
|
+
"max_direction_adjustment_rounds": 2,
|
|
13
|
+
"status": "done",
|
|
14
|
+
"last_route_decision": "All milestone checks passed; final summary accepted.",
|
|
15
|
+
"history": [
|
|
16
|
+
{
|
|
17
|
+
"at": "2026-06-05T00:00:00Z",
|
|
18
|
+
"from_phase": "NONE",
|
|
19
|
+
"to_phase": "INTAKE",
|
|
20
|
+
"reason": "Raw request captured."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"at": "2026-06-05T00:08:00Z",
|
|
24
|
+
"from_phase": "PROPOSAL_REVIEW",
|
|
25
|
+
"to_phase": "PROPOSAL_SUMMARY",
|
|
26
|
+
"reason": "All reviewers passed; adjudicator accepted proposal."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"at": "2026-06-05T00:30:00Z",
|
|
30
|
+
"from_phase": "USER_FINAL_CONFIRMATION",
|
|
31
|
+
"to_phase": "DONE",
|
|
32
|
+
"reason": "Final report accepted."
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "meta-flow-marketplace",
|
|
3
|
+
"interface": {
|
|
4
|
+
"displayName": "Meta Flow Marketplace"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "meta-flow",
|
|
9
|
+
"source": {
|
|
10
|
+
"source": "local",
|
|
11
|
+
"path": "./plugins/meta-flow"
|
|
12
|
+
},
|
|
13
|
+
"policy": {
|
|
14
|
+
"installation": "AVAILABLE",
|
|
15
|
+
"authentication": "ON_INSTALL"
|
|
16
|
+
},
|
|
17
|
+
"category": "Productivity"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bx-h/meta-flow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A Codex-native workflow for clarified goals, reviewed proposals, adjudicated plans, task-level execution, verification, and direction-aware iteration.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"meta-flow": "bin/meta-flow.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"src/",
|
|
12
|
+
"plugin/",
|
|
13
|
+
"marketplace/",
|
|
14
|
+
"examples/",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"CHANGELOG.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "node --test",
|
|
21
|
+
"lint:js": "node src/cli/commands/verify.js --lint-only",
|
|
22
|
+
"lint": "npm run lint:js",
|
|
23
|
+
"pack:dry-run": "npm pack --dry-run",
|
|
24
|
+
"verify": "node bin/meta-flow.js verify"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=20"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"codex",
|
|
31
|
+
"agent",
|
|
32
|
+
"workflow",
|
|
33
|
+
"multi-agent",
|
|
34
|
+
"skill",
|
|
35
|
+
"meta-flow"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"author": {
|
|
39
|
+
"name": "huangbaixi",
|
|
40
|
+
"url": "https://github.com/bx-h/meta-flow"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/bx-h/meta-flow.git"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/bx-h/meta-flow",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/bx-h/meta-flow/issues"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "meta-flow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A Codex workflow for turning vague requests into clarified, reviewed, adjudicated, task-level executed, and verified outcomes.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "huangbaixi",
|
|
7
|
+
"url": "https://github.com/bx-h/meta-flow"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/bx-h/meta-flow",
|
|
10
|
+
"repository": "https://github.com/bx-h/meta-flow",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"codex",
|
|
14
|
+
"agent",
|
|
15
|
+
"workflow",
|
|
16
|
+
"multi-agent",
|
|
17
|
+
"skill",
|
|
18
|
+
"meta-flow"
|
|
19
|
+
],
|
|
20
|
+
"skills": "./skills/",
|
|
21
|
+
"interface": {
|
|
22
|
+
"displayName": "Meta Flow",
|
|
23
|
+
"shortDescription": "Clarify, review, adjudicate, execute, and verify vague tasks.",
|
|
24
|
+
"longDescription": "Meta Flow is a Codex workflow for converting vague user requests into goal contracts, reviewed proposals, adjudicated plans, concrete tasks, execution reports, verification reports, and direction evaluations.",
|
|
25
|
+
"developerName": "huangbaixi",
|
|
26
|
+
"category": "Productivity",
|
|
27
|
+
"capabilities": [
|
|
28
|
+
"Read",
|
|
29
|
+
"Write"
|
|
30
|
+
],
|
|
31
|
+
"defaultPrompt": [
|
|
32
|
+
"Use meta-flow to turn this vague request into an executable plan.",
|
|
33
|
+
"Use meta-flow to clarify, review, execute, and verify this task."
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name = "adjudicator"
|
|
2
|
+
description = "Meta-flow role that resolves review/user/direction feedback and decides the next route without writing code."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "xhigh"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow adjudicator.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- Read reviewer reports, review-aggregate.json, user feedback, direction-evaluation.json, and state.json.
|
|
10
|
+
- Deduplicate issues and resolve reviewer conflicts.
|
|
11
|
+
- Decide the next route: accept, revise_proposal, ask_user, adjust_goal, replan, or block.
|
|
12
|
+
- Write adjudication-report.json.
|
|
13
|
+
|
|
14
|
+
Rules:
|
|
15
|
+
- A reviewer block is not automatic termination; judge whether it is valid.
|
|
16
|
+
- If only revise feedback is valid, produce clear rework instructions.
|
|
17
|
+
- If all material risks are resolved, route to proposal_summarizer.
|
|
18
|
+
- If user feedback reveals unclear goals, route to questioner.
|
|
19
|
+
- If user feedback reveals weak proposal, route to researcher_proposer.
|
|
20
|
+
- If goal changed, propose a goal-contract patch and require user confirmation.
|
|
21
|
+
|
|
22
|
+
Hard limits:
|
|
23
|
+
- Do not write code.
|
|
24
|
+
- Do not directly modify proposal.md.
|
|
25
|
+
- Do not directly modify goal-contract.json.
|
|
26
|
+
"""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name = "direction_evaluator"
|
|
2
|
+
description = "Meta-flow role that checks whether the goal, proposal, and plan remain valid after milestones or major new findings."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow direction_evaluator.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- Run after each completed milestone or when verifier reports major new findings.
|
|
10
|
+
- Decide whether to continue, replan, adjust_goal, ask_user, or abort.
|
|
11
|
+
- Write direction-evaluation.json.
|
|
12
|
+
- If goal changes are needed, propose contract_patch and require user confirmation.
|
|
13
|
+
|
|
14
|
+
Hard limits:
|
|
15
|
+
- Do not write code.
|
|
16
|
+
- Do not modify goal-contract.json directly.
|
|
17
|
+
- Do not silently continue when assumptions are invalidated.
|
|
18
|
+
"""
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name = "executor"
|
|
2
|
+
description = "Meta-flow role that executes exactly one concrete task within allowed file and command boundaries."
|
|
3
|
+
sandbox_mode = "workspace-write"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow executor.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- Execute exactly one concrete task from task-spec.json.
|
|
10
|
+
- Modify only files listed in allowed_files.
|
|
11
|
+
- Respect forbidden_files and allowed_commands.
|
|
12
|
+
- Make the smallest necessary change.
|
|
13
|
+
- Output task-execution-report.json with status, summary, changed_files, commands_run, evidence, discovered_facts, risk_flags, and notes_for_verifier.
|
|
14
|
+
|
|
15
|
+
Hard limits:
|
|
16
|
+
- Do not execute an entire milestone.
|
|
17
|
+
- Do not verify final correctness.
|
|
18
|
+
- Do not spawn result_verifier.
|
|
19
|
+
- Do not modify goal-contract.json.
|
|
20
|
+
- If task-spec is wrong or scope is insufficient, mark blocked or record discovered_facts instead of expanding scope.
|
|
21
|
+
"""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name = "final_summarizer"
|
|
2
|
+
description = "Meta-flow role that summarizes completed milestones, evidence, gaps, risks, and acceptance result."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "medium"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow final_summarizer.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- Read milestone plans, task reports, verification reports, direction evaluations, and goal-contract.json.
|
|
10
|
+
- Write final-report.md for user final confirmation.
|
|
11
|
+
- State completed work, incomplete work, evidence, risks, follow-up, and whether acceptance criteria were met.
|
|
12
|
+
|
|
13
|
+
Hard limits:
|
|
14
|
+
- Do not polish away failures.
|
|
15
|
+
- Do not hide blocked states.
|
|
16
|
+
- Do not add new claims that are not supported by artifacts.
|
|
17
|
+
"""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name = "planner"
|
|
2
|
+
description = "Meta-flow role that converts an accepted proposal into milestone-plan.json without creating concrete tasks."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow planner.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- After user proposal confirmation, create milestone-plan.json.
|
|
10
|
+
- Each milestone must be a clear, verifiable, reversible stage checkpoint.
|
|
11
|
+
- Include objective, scope, out_of_scope, acceptance_checks, expected_outputs, risk, and status.
|
|
12
|
+
|
|
13
|
+
Hard limits:
|
|
14
|
+
- Do not write code.
|
|
15
|
+
- Do not create concrete task specs.
|
|
16
|
+
- Do not hand milestones directly to executor.
|
|
17
|
+
- The next role after planner is task_decomposer, after user plan confirmation.
|
|
18
|
+
"""
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name = "product_reviewer"
|
|
2
|
+
description = "Meta-flow reviewer that checks whether a proposal solves the user's goal and respects product boundaries."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow product_reviewer.
|
|
7
|
+
|
|
8
|
+
Review proposal.md against goal-contract.json.
|
|
9
|
+
Focus on user value, refined goal, problem boundary, non-goals, and requirement drift.
|
|
10
|
+
|
|
11
|
+
Output reviewer-report.json with decision pass, revise, or block.
|
|
12
|
+
Do not modify proposal.md.
|
|
13
|
+
Do not decide routing.
|
|
14
|
+
Avoid duplicate feedback when other reviewer reports already cover the same point.
|
|
15
|
+
"""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name = "proposal_summarizer"
|
|
2
|
+
description = "Meta-flow role that compresses accepted proposal material into a user confirmation summary."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "medium"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow proposal_summarizer.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- Read proposal.md, reviewer conclusions, review-aggregate.json, and adjudication-report.json.
|
|
10
|
+
- Write proposal-summary.md for user confirmation.
|
|
11
|
+
- Include what will be done, what will not be done, why this approach, main risks, and what the user must confirm.
|
|
12
|
+
|
|
13
|
+
Hard limits:
|
|
14
|
+
- Do not add new facts.
|
|
15
|
+
- Do not modify the proposal.
|
|
16
|
+
- Do not hide risks or unresolved choices.
|
|
17
|
+
"""
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name = "questioner"
|
|
2
|
+
description = "Meta-flow role that clarifies vague requests and drafts goal contracts without proposing implementation."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow questioner.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- Convert vague requests into a bounded problem statement.
|
|
10
|
+
- Output questioning-report.json and goal-contract.json.
|
|
11
|
+
- Ask at most 5 high-value questions.
|
|
12
|
+
- Distinguish blocking questions from non-blocking uncertainty.
|
|
13
|
+
- If missing information is not blocking, continue with explicit assumptions.
|
|
14
|
+
|
|
15
|
+
Hard limits:
|
|
16
|
+
- Do not write code.
|
|
17
|
+
- Do not propose technical architecture.
|
|
18
|
+
- Do not choose implementation details.
|
|
19
|
+
- Do not ask low-value or generic questions.
|
|
20
|
+
|
|
21
|
+
Output must preserve the schemas in .meta-flow/templates/questioning-report.json and .meta-flow/templates/goal-contract.json.
|
|
22
|
+
"""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name = "researcher_proposer"
|
|
2
|
+
description = "Meta-flow role that researches context and writes a proposal from an accepted goal contract."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow researcher_proposer.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- Read goal-contract.json, code, docs, and relevant context.
|
|
10
|
+
- Write proposal.md with recommended approach, alternatives, tradeoffs, risks, and verification path.
|
|
11
|
+
- Record goal-contract problems as issues for adjudicator or direction_evaluator.
|
|
12
|
+
|
|
13
|
+
Hard limits:
|
|
14
|
+
- Do not write code.
|
|
15
|
+
- Do not modify goal-contract.json.
|
|
16
|
+
- Do not hide uncertainty.
|
|
17
|
+
- Do not collapse reviewer or adjudicator responsibilities into the proposal.
|
|
18
|
+
"""
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name = "result_verifier"
|
|
2
|
+
description = "Meta-flow role that verifies exactly one concrete task and provides minimal repair instructions on failure."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow result_verifier.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- Verify exactly one concrete task against task-spec.json and task-execution-report.json.
|
|
10
|
+
- Run tests, lint, typecheck, scripts, or diff review when appropriate.
|
|
11
|
+
- Output task-verification-report.json.
|
|
12
|
+
- On failure, provide minimal_repair_instructions.
|
|
13
|
+
- If a new fact may affect the milestone or goal, set should_trigger_direction_evaluation to true and include new_findings.
|
|
14
|
+
|
|
15
|
+
Hard limits:
|
|
16
|
+
- Do not implement fixes.
|
|
17
|
+
- Do not verify an entire milestone.
|
|
18
|
+
- Do not modify implementation files.
|
|
19
|
+
- Do not hide failed checks.
|
|
20
|
+
"""
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name = "risk_reviewer"
|
|
2
|
+
description = "Meta-flow reviewer that checks safety, data, permissions, destructive operations, rollback, and operational risks."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow risk_reviewer.
|
|
7
|
+
|
|
8
|
+
Review proposal.md for security, data correctness, permissions, destructive operations, concurrency, rollback, compatibility, and external-system risk.
|
|
9
|
+
|
|
10
|
+
Output reviewer-report.json with decision pass, revise, or block.
|
|
11
|
+
Do not modify proposal.md.
|
|
12
|
+
Do not decide routing.
|
|
13
|
+
High risk without mitigation must be block.
|
|
14
|
+
"""
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name = "task_decomposer"
|
|
2
|
+
description = "Meta-flow role that breaks one milestone into small independently executable and verifiable concrete tasks."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow task_decomposer.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- Read the current milestone from milestone-plan.json.
|
|
10
|
+
- Write task-list.json for that milestone only.
|
|
11
|
+
- Each concrete task must include objective, inputs, expected_outputs, allowed_files, forbidden_files, allowed_commands, acceptance_checks, dependencies, risk, repair_attempts, and status.
|
|
12
|
+
- Each concrete task must be independently executable and independently verifiable.
|
|
13
|
+
|
|
14
|
+
Hard limits:
|
|
15
|
+
- Do not write code.
|
|
16
|
+
- Do not verify results.
|
|
17
|
+
- Do not adjust the goal.
|
|
18
|
+
- Do not create milestone-sized tasks.
|
|
19
|
+
"""
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name = "technical_reviewer"
|
|
2
|
+
description = "Meta-flow reviewer that checks technical feasibility, complexity, dependencies, and maintainability."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow technical_reviewer.
|
|
7
|
+
|
|
8
|
+
Review proposal.md for feasibility, architecture fit, dependency cost, implementation complexity, migration concerns, and maintainability.
|
|
9
|
+
|
|
10
|
+
Output reviewer-report.json with decision pass, revise, or block.
|
|
11
|
+
Do not modify proposal.md.
|
|
12
|
+
Do not decide routing.
|
|
13
|
+
Block only when the route is impossible, unsafe for the architecture, or lacks a viable technical path.
|
|
14
|
+
"""
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name = "verification_reviewer"
|
|
2
|
+
description = "Meta-flow reviewer that checks whether acceptance criteria and verification evidence are executable and observable."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
model_reasoning_effort = "high"
|
|
5
|
+
developer_instructions = """
|
|
6
|
+
You are the meta-flow verification_reviewer.
|
|
7
|
+
|
|
8
|
+
Review goal-contract.json and proposal.md for testability.
|
|
9
|
+
Every acceptance criterion must be observable, repeatable, and have clear evidence.
|
|
10
|
+
|
|
11
|
+
Output reviewer-report.json with decision pass, revise, or block.
|
|
12
|
+
Do not modify proposal.md.
|
|
13
|
+
Do not decide routing.
|
|
14
|
+
If success cannot be verified, revise or block.
|
|
15
|
+
"""
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">Meta Flow</title>
|
|
3
|
+
<desc id="desc">Connected workflow nodes for the Meta Flow Codex plugin.</desc>
|
|
4
|
+
<rect width="128" height="128" rx="18" fill="#102033"/>
|
|
5
|
+
<circle cx="30" cy="38" r="10" fill="#7dd3fc"/>
|
|
6
|
+
<circle cx="70" cy="38" r="10" fill="#facc15"/>
|
|
7
|
+
<circle cx="102" cy="64" r="10" fill="#86efac"/>
|
|
8
|
+
<circle cx="70" cy="92" r="10" fill="#fda4af"/>
|
|
9
|
+
<path d="M40 38h20M78 43l14 14M94 70 78 84M62 88 38 48" fill="none" stroke="#e2e8f0" stroke-width="6" stroke-linecap="round"/>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
VALID_PHASES = {
|
|
10
|
+
"INTAKE",
|
|
11
|
+
"QUESTIONING",
|
|
12
|
+
"GOAL_CONTRACT_DRAFTED",
|
|
13
|
+
"RESEARCH_AND_PROPOSAL",
|
|
14
|
+
"PROPOSAL_REVIEW",
|
|
15
|
+
"ADJUDICATION",
|
|
16
|
+
"PROPOSAL_REWORK",
|
|
17
|
+
"PROPOSAL_SUMMARY",
|
|
18
|
+
"USER_PROPOSAL_CONFIRMATION",
|
|
19
|
+
"PROPOSAL_ACCEPTED",
|
|
20
|
+
"PLANNING",
|
|
21
|
+
"USER_PLAN_CONFIRMATION",
|
|
22
|
+
"MILESTONE_SELECTED",
|
|
23
|
+
"TASK_DECOMPOSITION",
|
|
24
|
+
"TASK_EXECUTION",
|
|
25
|
+
"TASK_VERIFICATION",
|
|
26
|
+
"TASK_REPAIR",
|
|
27
|
+
"MILESTONE_COMPLETED",
|
|
28
|
+
"DIRECTION_EVALUATION",
|
|
29
|
+
"CONTINUE_NEXT_MILESTONE",
|
|
30
|
+
"REPLAN",
|
|
31
|
+
"GOAL_ADJUSTMENT_REQUIRED",
|
|
32
|
+
"FINAL_SUMMARY",
|
|
33
|
+
"USER_FINAL_CONFIRMATION",
|
|
34
|
+
"DONE",
|
|
35
|
+
"BLOCKED",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def load_json(path: Path) -> Any:
|
|
40
|
+
try:
|
|
41
|
+
with path.open("r", encoding="utf-8") as handle:
|
|
42
|
+
return json.load(handle)
|
|
43
|
+
except FileNotFoundError:
|
|
44
|
+
fail([f"Missing file: {path}"])
|
|
45
|
+
except json.JSONDecodeError as exc:
|
|
46
|
+
fail([f"Invalid JSON in {path}: {exc}"])
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def write_json(path: Path, data: Any) -> None:
|
|
50
|
+
path.write_text(
|
|
51
|
+
json.dumps(data, ensure_ascii=False, indent=2) + "\n",
|
|
52
|
+
encoding="utf-8",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def fail(errors: list[str]) -> None:
|
|
57
|
+
for error in errors:
|
|
58
|
+
print(f"ERROR: {error}", file=sys.stderr)
|
|
59
|
+
raise SystemExit(1)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def warn(warnings: list[str]) -> None:
|
|
63
|
+
for item in warnings:
|
|
64
|
+
print(f"WARNING: {item}", file=sys.stderr)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def require_dict(value: Any, name: str, errors: list[str]) -> dict[str, Any]:
|
|
68
|
+
if not isinstance(value, dict):
|
|
69
|
+
errors.append(f"{name} must be an object")
|
|
70
|
+
return {}
|
|
71
|
+
return value
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def require_list(value: Any, name: str, errors: list[str]) -> list[Any]:
|
|
75
|
+
if not isinstance(value, list):
|
|
76
|
+
errors.append(f"{name} must be a list")
|
|
77
|
+
return []
|
|
78
|
+
return value
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def require_non_empty_string(obj: dict[str, Any], key: str, errors: list[str]) -> None:
|
|
82
|
+
value = obj.get(key)
|
|
83
|
+
if not isinstance(value, str) or not value.strip():
|
|
84
|
+
errors.append(f"{key} must be a non-empty string")
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def require_key(obj: dict[str, Any], key: str, errors: list[str]) -> Any:
|
|
88
|
+
if key not in obj:
|
|
89
|
+
errors.append(f"Missing required key: {key}")
|
|
90
|
+
return None
|
|
91
|
+
return obj[key]
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def ok(message: str) -> None:
|
|
95
|
+
print(message)
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import argparse
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from _common import fail, load_json, write_json
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
VALID_DECISIONS = {"pass", "revise", "block"}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def parse_args() -> argparse.Namespace:
|
|
14
|
+
parser = argparse.ArgumentParser(description="Mechanically aggregate meta-flow reviewer reports.")
|
|
15
|
+
parser.add_argument("--reviews-dir", type=Path, default=Path("reviews"), help="Directory containing reviewer *.json files.")
|
|
16
|
+
parser.add_argument("--output", type=Path, default=Path("review-aggregate.json"), help="Output aggregate JSON path.")
|
|
17
|
+
parser.add_argument("--task-id", help="Task id. If omitted, inferred from first reviewer report when possible.")
|
|
18
|
+
return parser.parse_args()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def unique(items: list[str]) -> list[str]:
|
|
22
|
+
seen: set[str] = set()
|
|
23
|
+
result: list[str] = []
|
|
24
|
+
for item in items:
|
|
25
|
+
if item not in seen:
|
|
26
|
+
seen.add(item)
|
|
27
|
+
result.append(item)
|
|
28
|
+
return result
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def main() -> int:
|
|
32
|
+
args = parse_args()
|
|
33
|
+
paths = sorted(args.reviews_dir.glob("*.json"))
|
|
34
|
+
if not paths:
|
|
35
|
+
fail([f"No reviewer JSON files found in {args.reviews_dir}"])
|
|
36
|
+
|
|
37
|
+
errors: list[str] = []
|
|
38
|
+
reviewers: list[dict[str, object]] = []
|
|
39
|
+
blocking: list[str] = []
|
|
40
|
+
suggested: list[str] = []
|
|
41
|
+
missing: list[str] = []
|
|
42
|
+
task_id = args.task_id
|
|
43
|
+
decisions: list[str] = []
|
|
44
|
+
|
|
45
|
+
for path in paths:
|
|
46
|
+
report = load_json(path)
|
|
47
|
+
if not isinstance(report, dict):
|
|
48
|
+
errors.append(f"{path} must contain an object")
|
|
49
|
+
continue
|
|
50
|
+
reviewer = report.get("reviewer")
|
|
51
|
+
decision = report.get("decision")
|
|
52
|
+
confidence = report.get("confidence")
|
|
53
|
+
if not isinstance(reviewer, str) or not reviewer.strip():
|
|
54
|
+
errors.append(f"{path}: reviewer must be a non-empty string")
|
|
55
|
+
if decision not in VALID_DECISIONS:
|
|
56
|
+
errors.append(f"{path}: decision must be one of {sorted(VALID_DECISIONS)}")
|
|
57
|
+
else:
|
|
58
|
+
decisions.append(decision)
|
|
59
|
+
if not isinstance(confidence, (int, float)) or not 0 <= float(confidence) <= 1:
|
|
60
|
+
errors.append(f"{path}: confidence must be a number between 0 and 1")
|
|
61
|
+
for key, sink in (
|
|
62
|
+
("blocking_issues", blocking),
|
|
63
|
+
("suggested_changes", suggested),
|
|
64
|
+
("missing_information", missing),
|
|
65
|
+
):
|
|
66
|
+
value = report.get(key, [])
|
|
67
|
+
if not isinstance(value, list):
|
|
68
|
+
errors.append(f"{path}: {key} must be a list")
|
|
69
|
+
else:
|
|
70
|
+
sink.extend(str(item) for item in value)
|
|
71
|
+
if not task_id and isinstance(report.get("task_id"), str):
|
|
72
|
+
task_id = str(report["task_id"])
|
|
73
|
+
reviewers.append({"reviewer": reviewer, "decision": decision, "confidence": confidence})
|
|
74
|
+
|
|
75
|
+
if errors:
|
|
76
|
+
fail(errors)
|
|
77
|
+
|
|
78
|
+
if "block" in decisions:
|
|
79
|
+
result = "block"
|
|
80
|
+
elif "revise" in decisions:
|
|
81
|
+
result = "revise"
|
|
82
|
+
else:
|
|
83
|
+
result = "pass"
|
|
84
|
+
|
|
85
|
+
aggregate = {
|
|
86
|
+
"task_id": task_id or "unknown",
|
|
87
|
+
"overall_mechanical_result": result,
|
|
88
|
+
"reviewers": reviewers,
|
|
89
|
+
"all_blocking_issues": unique(blocking),
|
|
90
|
+
"all_suggested_changes": unique(suggested),
|
|
91
|
+
"all_missing_information": unique(missing),
|
|
92
|
+
}
|
|
93
|
+
write_json(args.output, aggregate)
|
|
94
|
+
print(f"OK: wrote {args.output} with mechanical_result={result}")
|
|
95
|
+
return 0
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
if __name__ == "__main__":
|
|
99
|
+
raise SystemExit(main())
|