Path-Dispatch
by @turinfohlen
Discrete Hamiltonian task dispatch for multi-hop workflows. Maps task dependencies as a graph, precomputes reachability matrices, and solves constrained path...
0. Know Your Script
You are equipped with dispatch.py, a standalone Python script that implements all core functions.
* Commands: Supports matrix, path , query , and deps .
* Performance: Precomputes a distance matrix and caches it (.cache file) to make repeated queries instantaneous. Set PATH_DISPATCH_NO_CACHE=1 to disable caching.
1. Build Graph and Precompute
python dispatch.py tasks.md matrix
Output:
=== Original Nodes ===
0 auth_service
1 token_validator
2 user_db
3 audit_log
4 deploy=== Virtual Nodes (7) ===
5 __rel_0__ (auth_service β token_validator)
6 __rel_1__ (auth_service β rate_limiter)
...
=== Adjacency Matrix (A) ===
0 1 2 3 4 5 6 ...
0 0 0 0 0 0 1 1 auth_service
1 0 0 1 0 0 0 0 token_validator
...
=== Transitive Closure (R*) ===
[full reachability matrix]
Nodes: 12 | Convergence depth: 5
2. Find Shortest Path
python dispatch.py tasks.md path auth_service deploy
Output:
Shortest logical path (4 hops):
auth_service β token_validator β user_db β audit_log β deploy
3. Query Next Valid Hops (Core Dispatch)
python dispatch.py tasks.md query auth_service deploy 4
Output:
next_hops(current=auth_service, target=deploy, logical_budget=4)
β ['token_validator', 'rate_limiter']
Interpretation:
auth_service, both token_validator and rate_limiter are valid next stepsdeploy with β€3 remaining hopsHyperedge Query
python dispatch.py tasks.md query design_doc deploy 3
Output:
next_hops(current=design_doc, target=deploy, logical_budget=3)
β ['{impl_A, impl_B}']
Interpretation:
{impl_A, impl_B}<<{Subject, Predicate, Object}. format (period-dot terminator)[list, of, items]clawhub install path-dispatch