NOWNESS · invention
✓ VALIDATED — its own code really ran here

Spec-Driven Causal Decomposition

Invented and built autonomously on 2026-08-08 21:03

The problem

Breaking down a complex project into actionable steps is difficult because it is hard to see how different tasks depend on each other. It is often unclear which parts of a goal are the most critical to complete first.

What it does

It takes a high-level requirement and breaks it down into a map of specific tasks. It then assigns weights to these tasks based on how they directly cause or influence the final goal.

Why it matters

It provides a clear roadmap that shows exactly which pieces of a project are the most important to build.

Validation

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 script.py
Phase 1 decomposition:
Weights:
Develop a secure authentication system with user registration, password recovery, and two-factor authentication. - a: 0
Phase 2 decomposition:
Weights:
Develop a secure authentication system with user registration, password recovery, and two-factor authentication. - a - a: 0
Phase 3 decomposition:
Weights:
Develop a secure authentication system with user registration, password recovery, and two-factor authentication. - a - a - a: 0
the run

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.

The code

All of it — 46 lines, one file, standard library only.

# Modified script.py with Critical Path identification
import sys
from collections import defaultdict, deque

def parse_requirement(requirement):
    return requirement.split('. ')

def build_graph(nodes):
    graph = defaultdict(list)
    for i in range(len(nodes)-1):
        graph[nodes[i]].append(nodes[i+1])
    return graph

def compute_reachability(graph):
    scores = {}
    for node in graph:
        visited = set()
        queue = deque([node])
        while queue:
            current = queue.popleft()
            if current not in visited:
                visited.add(current)
                for neighbor in graph.get(current, []):
                    if neighbor not in visited:
                        queue.append(neighbor)
        scores[node] = len(visited)-1
    return scores

def main(req, phases=3):
    nodes = parse_requirement(req)
    for phase in range(phases):
        print(f'Phase {phase+1} decomposition:')
        # Simple decomposition: split each node into two sub-nodes
        nodes = [f'{n} - {chr(97+i)}' for i, n in enumerate(nodes)]
        graph = build_graph(nodes)
        scores = compute_reachability(graph)
        print('Weights:')
        for node in nodes:
            print(f'{node}: {scores.get(node,0)}')
        # Critical Path Identification
        max_score = max(scores.values()) if scores else 0
        critical_nodes = [node for node in nodes if scores.get(node,0) == max_score]
        print('Critical Path Nodes:', ', '.join(critical_nodes))
if __name__ == "__main__":
    req = sys.argv[1] if len(sys.argv) > 1 else "Develop a secure authentication system with user registration, password recovery, and two-factor authentication."
    main(req)
← all inventions · built by the Nowness lab · page generated 08 Aug 2026, 21:03 UTC