Taskweft.NIF (taskweft_nif v0.2.0-dev.1)

Copy Markdown View Source

Raw NIF bindings for the Taskweft C++20 planner.

Prefer the higher-level modules (Taskweft, Taskweft.ReBAC, Taskweft.MCExecutor) over calling these directly.

HRR type boundary

HRR NIF input/output types:

NIFInputOutput
hrr_encode_atom/2string, dimphases
hrr_encode_text/2string, dimphases
hrr_phases_to_bytes/1phasesbytes
hrr_bytes_to_phases/2bytes, 0phases
hrr_bind/2bytes, bytesbytes
hrr_unbind/2bytes, bytesbytes
hrr_bundle/1[bytes]bytes
hrr_similarity/2phases, phasesfloat

Phases are lists of floats (radians); bytes are Erlang binaries (little-endian float64 arrays). hrr_similarity takes phases only; passing bytes produces garbage similarity scores. Convert explicitly at each call site.

Summary

Functions

bridge_binding_content(var, arg, val)

bridge_extract_entities(state_json)

bridge_plan_contents(plan_json, domain, entities_json)

bridge_state_bindings(state_json, domain, category)

check_temporal(domain_json, plan_json, origin_iso)

check_temporal_civil(domain_json, plan_json, origin_iso, reference_date)

domain_cache_clear()

mc_execute(domain_json, plan_json, probs_json, seed)

plan(domain_json)

plan_with_temporal(domain_json, origin_iso)

plan_with_temporal_civil(domain_json, origin_iso, reference_date)

rebac_add_edge(graph_json, subj, obj, rel)

rebac_cache_clear()

rebac_can(graph_json, subj, capability, max_depth)

rebac_check(graph_json, subj, expr_json, obj, fuel)

rebac_expand(graph_json, rel, obj, fuel)

rebac_get_entities_with_capability(graph_json, capability)

rebac_get_entity_capabilities(graph_json, entity)

rebac_parse_relation_edges(facts_json, trust_threshold)

replan(domain_json, plan_json, fail_step)