Precedence order check
precedence-order-check · version 1.0.0 · Numbers & math · free, no key needed
Check whether a claimed node order is exactly a precedence-respecting linear extension of a caller-supplied DAG.
Use when you need to: check claimed topological order · verify linear extension certificate · audit serialized task ordering.
Decide before calling
Read the versioned contract and the supported scope below. Reuse precedence-order-check@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use precedence-order-check@1.0.0 for check claimed topological order. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- check claimed topological order
- verify linear extension certificate
- audit serialized task ordering
- find first ordering edge violation
- validate dependency sequence permutation
- check ordered DAG execution plan
Not supported
- compute or repair a claimed result
- infer dependencies from prose
- accept cyclic dependency graphs
Behavior
- nodes and identifiers use exact Unicode scalar-value string equality; no normalization or trimming; null is never an identifier.
- nodes must be unique, every edge endpoint must be declared, self-edges and cyclic graphs are invalid_input.
- A well-typed claim is valid only if it contains every source node exactly once and satisfies the tool-specific precedence rule.
- Claims are never repaired; the first issue is reported by claim index, then source node order, then source edge order.
- Duplicate edges are allowed and have identical semantics to one edge.
- Any permutation satisfying every edge is accepted; unrelated-node tie order is unrestricted.
- Every output names reference_version Kahn-1962-topological-order-and-poset-linear-extension.
Input
nodes(array of string, required): max items 5000; each min length 1; each max length 128edges(array of array of string, required): max items 20000; each min items 2; each max items 2; each each min length 1; each each max length 128order(array of string, required): max items 5000; each min length 1; each max length 128
Output
valid(boolean, required)reason(string, optional)discrepancy(object, optional)reference_version(constant "Kahn-1962-topological-order-and-poset-linear-extension", required)
Limits
- max nodes: 5000
- max edges: 20000
- max id bytes: 128
- max input bytes: 1000000
Example
Request input:
{
"nodes": [
"compile",
"test",
"ship"
],
"edges": [
[
"compile",
"test"
],
[
"test",
"ship"
]
],
"order": [
"compile",
"test",
"ship"
]
}
Response:
{
"result": {
"valid": true,
"reference_version": "Kahn-1962-topological-order-and-poset-linear-extension"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "precedence-order-check",
"version": "1.0.0",
"input": {
"nodes": [
"compile",
"test",
"ship"
],
"edges": [
[
"compile",
"test"
],
[
"test",
"ship"
]
],
"order": [
"compile",
"test",
"ship"
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/precedence-order-check/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"nodes":["compile","test","ship"],"edges":[["compile","test"],["test","ship"]],"order":["compile","test","ship"]}'
The machine-readable contract is at /v1/tools/precedence-order-check/versions/1.0.0.
CLI
node cli.mjs run precedence-order-check 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Precedence batches check: Check whether claimed parallel batches contain every node once and respect a caller-supplied DAG.
- Topological order check: Check that a claimed vertex order is a permutation and topological order of a digraph; reports the first backward edge
- Join inner result check: Check a claimed ordered inner join index result and report its first discrepancy.
- Join left result check: Check a claimed ordered left join index result and report its first discrepancy.
- Join semi result check: Check a claimed ordered semi-join index result and report its first discrepancy.
- Precedence levels check: Check whether claimed node levels exactly equal the earliest levels induced by a caller-supplied DAG.