host: metamodel create-relation form (session-scoped) + keep load-rel-kinds! unrolled
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 52s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 52s
Define a relation through the UI (metamodel editor surface 1, completing it): POST /meta/new-relation creates a relation-post (is-a relation, :rel metadata) and registers it via a runtime concat onto host/blog-rel-kinds — safe because the serving handler has the IO resolver installed. /meta gains a '+ Relation' form (name, label, symmetric). Verified: define 'Blocks' (symmetric) -> Relations(5), its editor renders on edit pages, kind-spec + symmetric correct; auth-guarded. SESSION-SCOPED: the relation-post + edges persist durably, but the rel-kinds registry entry is lost on restart because load-rel-kinds! must stay UNROLLED — it runs at BOOT where it is JIT-compiled but the IO resolver is NOT yet installed, so a dynamic loader (map/reduce over instances-of 'relation' with a durable read per item) silently returns [] (verified: dynamic -> /meta Relations(0)). The serving-JIT HO-callback-perform fix only engages with the resolver = serve time. Flagged to sx-vm-extensions (NOTE-render-diff-for- vm-ext.md); they ACKed + are tracking the boot-resolver fix. Reverted the dynamic loader, kept the unroll with a comment explaining why. VERIFICATION NOTE: the full blog suite could not complete — the box is under extreme contention from sibling loops (load 14, multiple full conformance + erlang/vm-ext rebuilds) and the Datalog-heavy 140-test suite times out even at a 1800s cap. Verified instead two ways: (1) live-path HTTP (real route + auth + editor render, ephemeral SX_SERVING_JIT=1), (2) a focused in-process eval of the create-relation core (exists/is-a/kind-spec/symmetric/ registry-len = true,true,true,true,5). Prior full run was 140/140; changes since are purely additive (handler + form + route + 3 tests). Re-run the blog suite when the box is quiet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -684,6 +684,25 @@
|
||||
"application/x-www-form-urlencoded" "title=Sneaky Type"))
|
||||
(host/blog-exists? "sneaky-type"))
|
||||
false)
|
||||
|
||||
;; -- metamodel editor: define a relation through the UI (POST /meta/new-relation) --
|
||||
(host-bl-test "/meta has the create-relation form"
|
||||
(contains? (dream-resp-body (host-bl-app (host-bl-req "/meta"))) "/meta/new-relation") true)
|
||||
(host-bl-test "POST /meta/new-relation creates + registers a relation (session-scoped)"
|
||||
(begin
|
||||
(host-bl-wapp (host-bl-send "POST" "/meta/new-relation" "Bearer good"
|
||||
"application/x-www-form-urlencoded" "title=Blocks&label=Blocks&symmetric=on"))
|
||||
(list (host/blog-exists? "blocks")
|
||||
(host/blog-is-a? "blocks" "relation")
|
||||
(not (nil? (host/blog--kind-spec "blocks")))
|
||||
(host/blog--kind-symmetric? "blocks")))
|
||||
(list true true true true))
|
||||
(host-bl-test "create-relation requires auth (unauthed -> not created)"
|
||||
(begin
|
||||
(host-bl-wapp (host-bl-send "POST" "/meta/new-relation" nil
|
||||
"application/x-www-form-urlencoded" "title=Sneaky Rel"))
|
||||
(host/blog-exists? "sneaky-rel"))
|
||||
false)
|
||||
(host-bl-test "a post with no schema'd type is vacuously valid"
|
||||
(host/blog-type-valid? "ppost" "(p \"anything\")") true)
|
||||
(host-bl-test "edit-submit rejects content violating the type schema (not saved)"
|
||||
|
||||
Reference in New Issue
Block a user