About
\n" + "amduatd is a local-first mapping surface over a single ASL store root. This UI is a lightweight editor and runner for concepts and PEL programs.
\n" + "diff --git a/src/amduatd.c b/src/amduatd.c index f081890..71ab760 100644 --- a/src/amduatd.c +++ b/src/amduatd.c @@ -10,6 +10,7 @@ #include "amduat/enc/pel1_result.h" #include "amduat/enc/pel_program_dag.h" #include "amduat/enc/tgk1_edge.h" +#include "amduat/fer/receipt.h" #include "amduat/format/pel.h" #include "amduat/tgk/core.h" #include "amduat/pel/program_dag.h" @@ -114,15 +115,40 @@ typedef struct { char edges_path[1024]; amduat_reference_t rel_aliases_ref; amduat_reference_t rel_materializes_ref; + amduat_reference_t rel_represents_ref; + amduat_reference_t rel_requires_key_ref; + amduat_reference_t rel_within_domain_ref; + amduat_reference_t rel_computed_by_ref; + amduat_reference_t rel_has_provenance_ref; amduatd_ref_list_t edge_refs; } amduatd_concepts_t; +static bool amduatd_concepts_put_name_artifact(amduat_asl_store_t *store, + const char *name, + amduat_reference_t *out_ref); +static bool amduatd_concepts_put_edge(amduat_asl_store_t *store, + amduatd_concepts_t *c, + amduat_reference_t from, + amduat_reference_t to, + amduat_reference_t relation_concept_ref, + amduat_reference_t *out_edge_ref); +static bool amduatd_concepts_lookup_alias(amduat_asl_store_t *store, + const amduat_asl_store_fs_config_t *cfg, + const amduatd_concepts_t *c, + const char *name, + amduat_reference_t *out_concept_ref); + static void amduatd_concepts_free(amduatd_concepts_t *c) { if (c == NULL) { return; } amduat_reference_free(&c->rel_aliases_ref); amduat_reference_free(&c->rel_materializes_ref); + amduat_reference_free(&c->rel_represents_ref); + amduat_reference_free(&c->rel_requires_key_ref); + amduat_reference_free(&c->rel_within_domain_ref); + amduat_reference_free(&c->rel_computed_by_ref); + amduat_reference_free(&c->rel_has_provenance_ref); amduatd_ref_list_free(&c->edge_refs); } @@ -141,11 +167,13 @@ static const char k_amduatd_contract_v1_json[] = "{\"method\":\"POST\",\"path\":\"/v1/concepts/{name}/publish\"}," "{\"method\":\"GET\",\"path\":\"/v1/resolve/{name}\"}," "{\"method\":\"POST\",\"path\":\"/v1/artifacts\"}," + "{\"method\":\"GET\",\"path\":\"/v1/relations\"}," "{\"method\":\"GET\",\"path\":\"/v1/artifacts/{ref}\"}," "{\"method\":\"HEAD\",\"path\":\"/v1/artifacts/{ref}\"}," "{\"method\":\"GET\",\"path\":\"/v1/artifacts/{ref}?format=info\"}," "{\"method\":\"POST\",\"path\":\"/v1/pel/run\"}," - "{\"method\":\"POST\",\"path\":\"/v1/pel/programs\"}" + "{\"method\":\"POST\",\"path\":\"/v1/pel/programs\"}," + "{\"method\":\"POST\",\"path\":\"/v1/context_frames\"}" "]," "\"schemas\":{" "\"pel_run_request\":{" @@ -155,7 +183,21 @@ static const char k_amduatd_contract_v1_json[] = "\"program_ref\":{\"type\":\"string\",\"description\":\"hex ref or concept name\"}," "\"input_refs\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"hex ref or concept name\"}}," "\"params_ref\":{\"type\":\"string\",\"description\":\"hex ref or concept name\"}," - "\"scheme_ref\":{\"type\":\"string\",\"description\":\"hex ref or 'dag'\"}" + "\"scheme_ref\":{\"type\":\"string\",\"description\":\"hex ref or 'dag'\"}," + "\"receipt\":{" + "\"type\":\"object\"," + "\"required\":[\"input_manifest_ref\",\"environment_ref\",\"evaluator_id\",\"executor_ref\",\"started_at\",\"completed_at\"]," + "\"properties\":{" + "\"input_manifest_ref\":{\"type\":\"string\",\"description\":\"hex ref or concept name\"}," + "\"environment_ref\":{\"type\":\"string\",\"description\":\"hex ref or concept name\"}," + "\"evaluator_id\":{\"type\":\"string\",\"description\":\"opaque evaluator bytes (utf-8)\"}," + "\"executor_ref\":{\"type\":\"string\",\"description\":\"hex ref or concept name\"}," + "\"sbom_ref\":{\"type\":\"string\",\"description\":\"hex ref or concept name\"}," + "\"parity_digest_hex\":{\"type\":\"string\",\"description\":\"hex bytes\"}," + "\"started_at\":{\"type\":\"integer\"}," + "\"completed_at\":{\"type\":\"integer\"}" + "}" + "}" "}" "}," "\"pel_run_response\":{" @@ -164,10 +206,33 @@ static const char k_amduatd_contract_v1_json[] = "\"properties\":{" "\"result_ref\":{\"type\":\"string\",\"description\":\"hex ref\"}," "\"trace_ref\":{\"type\":\"string\",\"description\":\"hex ref\"}," + "\"receipt_ref\":{\"type\":\"string\",\"description\":\"hex ref\"}," "\"output_refs\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"description\":\"hex ref\"}}," "\"status\":{\"type\":\"string\"}" "}" "}," + "\"context_frame_request\":{" + "\"type\":\"object\"," + "\"required\":[\"bindings\"]," + "\"properties\":{" + "\"bindings\":{" + "\"type\":\"array\"," + "\"items\":{" + "\"type\":\"object\"," + "\"required\":[\"key\"]," + "\"properties\":{" + "\"key\":{\"type\":\"string\",\"description\":\"concept name or hex ref\"}," + "\"value\":{\"type\":\"string\",\"description\":\"hex ref or concept name\"}," + "\"value_ref\":{\"type\":\"string\",\"description\":\"hex ref or concept name\"}," + "\"value_scalar\":{\"type\":\"object\",\"properties\":{" + "\"int\":{\"type\":\"integer\"}," + "\"enum\":{\"type\":\"string\",\"description\":\"concept name or hex ref\"}" + "}}" + "}" + "}" + "}" + "}" + "}," "\"pel_program_author_request\":{" "\"type\":\"object\"," "\"required\":[\"nodes\",\"roots\"]," @@ -187,35 +252,86 @@ static const char k_amduatd_ui_html[] = " \n" "
Load shows the latest materialized bytes; Save uploads a new artifact and publishes a new version. Use the runner to execute PEL programs against stored artifacts.
\n" + "amduatd is a local-first mapping surface over a single ASL store root. This UI is a lightweight editor and runner for concepts and PEL programs.
\n" + "