taskq.xyz / placement-engine
Placement engine

Cheapest compliant capacity. No silent fallback.

TaskQ does not “route” like a proxy. It solves placement as a constrained decision across policy, jurisdiction, custody, attestation, price, health, capacity, and proof.

TASKQ POLICY RECEIPTVERIFIED
request_idreq_plc_01
planerelay
must_run_inCA-AB
must_not_run_inUS
trust_flooraudited
custodypinned/enclave
merge_statustightened
✓ requests tighten — never loosen
Core rule

Placement is not load balancing.

Load balancing asks which server is least busy. TaskQ asks which worker is allowed, trusted, healthy, priced within ceiling, jurisdiction-compatible, custody-compatible, and cheapest after every hard constraint is enforced.

Hard constraints — never relax.

If the customer requires Canada-only execution, the US does not become acceptable because it is cheaper, faster, or available.

Cheapest compliant — cost after policy.

The engine finds the lowest-cost worker inside the compliant set. It does not compare compliant and non-compliant workers as if they are equal.

Replayable — the decision leaves evidence.

Policy hash, registry snapshot, eligible-set commitment, chosen worker attributes, lease, and price basis are written into proof.

Live demo

The candidate set gets smaller on purpose.

Every filter removes workers that would make the request cheaper, faster, or easier — if they violate the policy, they are not candidates. Empty the pool and TaskQ refuses with proof.

Jurisdiction

must_run_in: CA
must_not_run_in: US

Trust & custody

trust_floor: audited
key_custody: pinned/enclave

Economics

max_price_usd_per_mtok 0.75
Policy merge

Requests can tighten policy. They cannot loosen defaults.

  • Merge order: platform defaults → customer defaults → credential policy → request policy.
  • Allowed: default must_run_in: [CA], request [CA-AB] — stricter, accepted.
  • Rejected: default blocks the US, request removes the block — 422 POLICY_LOOSENING_FORBIDDEN.
policy.merge — hard constraints
customer.default.must_run_in = ["CA"]
request.must_run_in          = ["CA-AB"]
result = allowed / tighter

customer.default.must_not_run_in = ["US"]
request.must_not_run_in          = []
result = 422 POLICY_LOOSENING_FORBIDDEN
Placement proof

The route becomes a proof object.

TaskQ commits to the policy, registry snapshot, eligible set, chosen worker attributes, price basis, lease ID, and selection reason. That is the difference between a router and an execution control plane.

FieldPurposeWhy it matters
policy_hashsha256:...Proves the constraints that were applied.
registry_snapshotmerkle:...Shows the worker universe at decision time.
eligible_setcommitmentSupports replay without leaking the entire network.
selection_reasonlowest_price_within_hard_constraintsExplains why the worker won.
lease_idlease_...Prevents solve-to-dispatch race conditions.
Auditor replay

An auditor can ask the question you are afraid of.

  • Was a cheaper compliant option skipped? Was a non-compliant worker used?
  • Were expired attestations ignored? Did the chosen worker satisfy custody and jurisdiction at that moment?
  • Weakest claim wins. If jurisdiction is audited but key hygiene is self-asserted, the worker cannot satisfy an audited key-hygiene policy.
load policy_hashok
load registry_snapshotok
filter jurisdictionCA only
filter custodypinned|enclave
filter attestationsaudited+
sort eligible by priceok
compare chosen workermatch
resultPLACEMENT_REPLAY_PASSED

Routing is easy. Proving the route was compliant is the moat.

Hard constraints, cheapest-compliant selection, deterministic tie-breakers, and a proof object for every decision.