It is difficult to determine if a complex plan actually follows a specific set of nested rules and permissions. This makes it hard to see if a high-level goal is being broken down into safe, allowed actions.
The tool takes a goal and a set of rules and calculates a score based on how well the plan fits within those permissions. It breaks down the task to see if every step stays within the allowed boundaries.
It provides a clear way to measure if a plan remains compliant with specific constraints at every level.
It was run inside an isolated container with no network access. This is the exact command and the real output it produced — captured process output, not written by a model.
$ python3 multi_task_decomposition.py Multi-Task State Decomposition Score: 1.00 Breakdown: - Task 1: read - Task 2: read - Task 3: read
A screenshot of that run.
A clean run proves this does what is shown above, in a CPU-only sandbox. It is a small research demo — not a production tool, and nothing here was published anywhere.
All of it — 68 lines, one file, standard library only.
import json
def decompose_goal(goal):
"""Placeholder decomposition logic - in production, this would use DRL-based subtask analysis"""
return [f"Task {i+1}" for i in range(3)]
def check_permissions(subtask, permission_tree, path=None):
"""Traverse nested permission hierarchy and return path where permissions are granted"""
if path is None:
path = []
current_node_name = permission_tree.get('name', '')
full_path = path + [current_node_name]
if permission_tree.get('name') == subtask:
allowed = permission_tree.get('allowed', [])
return (allowed, full_path)
if 'children' in permission_tree:
for child in permission_tree['children']:
result = check_permissions(subtask, child, full_path)
if result:
return result
return ([], [])
def calculate_decomposition_score(goal, permission_hierarchy):
subtasks = decompose_goal(goal)
compliant_count = 0
breakdown = []
for subtask in subtasks:
allowed, path = check_permissions(subtask, permission_hierarchy)
if allowed:
compliant_count += 1
breakdown.append({'subtask': subtask, 'allowed': allowed, 'path': path})
score = compliant_count / len(subtasks) if subtasks else 0
return score, breakdown
if __name__ == "__main__":
high_level_goal = "Complete user onboarding flow"
permission_hierarchy = {
"name": "root",
"allowed": ["read", "write"],
"children": [
{
"name": "Task 1",
"allowed": ["read"],
"children": []
},
{
"name": "Task 2",
"allowed": ["write"],
"children": []
},
{
"name": "Task 3",
"allowed": [],
"children": []
}
]
}
score, breakdown = calculate_decomposition_score(high_level_goal, permission_hierarchy)
print(f"Multi-Task State Decomposition Score: {score:.2f}")
print("Breakdown:")
for item in breakdown:
subtask = item['subtask']
allowed = item['allowed']
path = item['path']
if allowed:
print(f"- {subtask}: Permissions granted at {path}, allowed actions: {', '.join(allowed)}")
else:
print(f"- {subtask}: Permissions not granted. Path checked: {path}")