What does Zero-Courier Dispatch conclude, in numbers, about “The Directed Acyclic Task Graph: Kahn's Topological Sort, the Critical Path and Monte Carlo Durations”?

Answer: Chapter 2 detects cycles with Kahn's sort and computes float by the critical path method; a deterministic plan of 17.4 hours is met with probability only 0.0213 under Monte Carlo.

Scope of the numbers: Its parameters are illustrative and all calculations are generated by its programs. It names no server, account, key or deployment command, and it is general business analysis, not personalised advice.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.0213, 17.4

deterministic plan 17.4 h
P50 23.3 h, P80 26.2 h, P95 28.9 h
P(length <= plan)0.0213
P(length <24 h) = 0.5848
criticality index of parallel tasks:
verify_refs0.1064
write_programs0.8937
write_chapters1.0000
write_meta0.0000
distill_kit0.0000
sign_shelf_publish0.4966
sign_external_register0.5033
Show the full program
# Chapter 2. p23: Monte Carlo of the critical path under uncertainty.
# Model: same 15-node graph as p22. Agent tasks draw a triangular time
# (0.7 d, mode d, 2.0 d), right-skewed as overruns are. Each human gate
# waits triangular(0.5, 12, mode 4) hours. 20,000 seeded runs give the
# length quantiles, the chance of meeting a 24-hour deadline and the
# criticality index: how often each parallel task is on the longest
# path. The deterministic plan is beaten less often than one expects.
import random

DUR = {
    "claim_lock": 0.1, "read_spec": 0.5, "verify_refs": 2.0,
    "write_programs": 3.0, "write_chapters": 8.0, "write_meta": 1.0,
    "distill_kit": 1.5, "run_gate": 0.5, "write_receipt": 0.1,
    "build_book": 1.0, "sign_shelf_publish": 4.0,
    "sign_external_register": 4.0, "shelf_publish": 0.2,
    "external_register": 0.2, "ledger_append": 0.1,
}
ORDER = list(DUR)
PRED = {
    "verify_refs": ["claim_lock", "read_spec"],
    "write_programs": ["claim_lock", "read_spec"],
    "write_chapters": ["verify_refs", "write_programs"],
    "write_meta": ["verify_refs", "write_programs"],
    "distill_kit": ["verify_refs", "write_programs"],
    "run_gate": ["write_chapters", "write_meta", "distill_kit"],
    "write_receipt": ["run_gate"], "build_book": ["write_receipt"],
    "sign_shelf_publish": ["build_book"],
    "sign_external_register": ["build_book"],
    "shelf_publish": ["sign_shelf_publish"],
    "external_register": ["sign_external_register"],
    "ledger_append": ["shelf_publish", "external_register"],
}
N = 20000


def longest(dur):
    ef, arg = {}, {}
    for n in ORDER:
        ps = PRED.get(n, [])
        best = max(ps, key=lambda p: ef[p]) if ps else None
        ef[n] = (ef[best] if best else 0.0) + dur[n]
        arg[n] = best
    path, n = set(), "ledger_append"
    while n:
        path.add(n)
        n = arg[n]
    return ef["ledger_append"], path


if __name__ == "__main__":
    rng = random.Random(40723)
    lengths, hits = [], {n: 0 for n in ORDER}
    for _ in range(N):
        d = {}
        for n in ORDER:
            if n.startswith("sign_"):
                d[n] = rng.triangular(0.5, 12.0, 4.0)
            else:
                d[n] = rng.triangular(0.7 * DUR[n], 2.0 * DUR[n], DUR[n])
        t, path = longest(d)
        lengths.append(t)
        for n in path:
            hits[n] += 1
    lengths.sort()
    q = [lengths[int(p * N) - 1] for p in (0.5, 0.8, 0.95)]
    plan = longest(DUR)[0]
    print("deterministic plan {:.1f} h".format(plan))
    print("P50 {:.1f} h, P80 {:.1f} h, P95 {:.1f} h".format(*q))
    ok_plan = len([x for x in lengths if x <= plan]) / N
    ok_24 = len([x for x in lengths if x <= 24.0]) / N
    print("P(length <= plan) = {:.4f}".format(ok_plan))
    print("P(length <= 24 h) = {:.4f}".format(ok_24))
    print("criticality index of parallel tasks:")
    for n in ["verify_refs", "write_programs", "write_chapters",
              "write_meta", "distill_kit", "sign_shelf_publish",
              "sign_external_register"]:
        print("  {:<24} {:.4f}".format(n, hits[n] / N))

Single source and citation

Fan, Y. (2026). Commander Intent Compilation, Automated DAG Task Decomposition and Zero-Courier Multi-Agent Dispatch (Version 1.0.0), Chapter 2: The Directed Acyclic Task Graph: Kahn's Topological Sort, the Critical Path and Monte Carlo Durations. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-407 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026407,
  author    = {Fan, Yafu},
  title     = {Commander Intent Compilation, Automated DAG Task Decomposition and Zero-Courier Multi-Agent Dispatch},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book