The neck :- into the assert gives the note: neck outofsync,
moreover the assert doesn’t work and gives the error : no permission to call sandboxed assert.
The out-of-sync is a bug, but rather innocent. The reason it doesn’t work is this snipped from the sandboxing code:
%! safe_assert(+Term) is semidet.
%
% True if assert(Term) is safe, which means it asserts in the
% current module. Cross-module asserts are considered unsafe. We
% only allow for adding facts. In theory, we could also allow for
% rules if we prove the safety of the body.
safe_assert(C) :- cyclic_term(C), !, fail.
safe_assert(X) :- var(X), !, fail.
safe_assert(_Head:-_Body) :- !, fail.
safe_assert(_:_) :- !, fail.
safe_assert(_).
safe_assert/1 on a rule fails. So no, you cannot assert rules in the anonymous web version. You can do so if you run SWI-Prolog locally or in a local SWISH instance after tweaking the configuration to disable the sandbox. Sorry …
Either run it as IDE on top of Prolog using the supplied ide.pl from the SWISH distro. Alternatively, set it up with the config file auth_http_always.pl which demands login and disables the sandbox. See README for SWISH.