From e6661bfa6a3d7dc477d0b7717c80bd536eca2d68 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Sat, 14 Mar 2026 11:39:04 -0300 Subject: =?UTF-8?q?Branching=20and=20na=C3=AFve=20merge=20strategies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * AGPL license * branching and merging * Delete LICENSE in favor of separate PR Signed-off-by: Marcos Magueta * add unmonitored tests and docs --------- Signed-off-by: Marcos Magueta --- docs/karuta-integration.org | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'docs/karuta-integration.org') diff --git a/docs/karuta-integration.org b/docs/karuta-integration.org index a144a25..0642254 100644 --- a/docs/karuta-integration.org +++ b/docs/karuta-integration.org @@ -14,10 +14,26 @@ Here's an overview of the sublanguages and how they are manifested in Karuta: - Pure querying, total/terminating subset; - No user recursion with no self references. -** DCL (Data Constraint Language) +** ICL (Integrity Control Language) - Integrity rules (key, FK-like, checks, assertions, aggregates-for-integrity). - Semantically predicates, but with enforcement timing (on write/commit), not free query operators. +- Implemented in =lib/icl/= (=Ast=, =Parser=, =Executor=). + +** DCL (Database Control Language) + +- Branch management: create/checkout branches, query HEAD and tip hashes. +- Merge: 3-way merge of two branch tips with configurable conflict strategy (=PreferLeft=, =PreferRight=, =RevertToAncestor=). +- Implemented in =lib/dcl/= (=Ast=, =Parser=, =Executor=). +- Example commands: + #+begin_src sexp + (CreateBranch (name "feature") (tip "")) + (Checkout "feature") + (GetHead) + (GetBranchTip "main") + (UpdateBranchTip (name "main") (tip "")) + (Merge (left "main") (right "feature") (strategy PreferLeft)) + #+end_src ** DML (Data Manipulation Language) @@ -35,7 +51,7 @@ Here's an overview of the sublanguages and how they are manifested in Karuta: ** PPL (Procedural Predicate Language) - Stored procedures/functions, recursion allowed, orchestration logic. -- Can call DRL/DML/DCL-aware operations, but not all PPL predicates are DRL-safe. +- Can call DRL/DML/ICL/DCL-aware operations, but not all PPL predicates are DRL-safe. ** ACL (Authorization/Policy Language) (optional early, important later) @@ -62,21 +78,21 @@ Here's an overview of the sublanguages and how they are manifested in Karuta: person[string, natural] :: sakura:persisted person[Name, Age] :- valid_age[Age]. - % DCL + % ICL another-constraint[list[person], string, natural] :: sakura:constraint another-constraint[[], _, _]. another-constraint[[person[Name, Age]|Rest], Whatever1, Whatever2] :- (eq[Name, Whatever1] ; !eq[Name, Whatever1], !eq[Age, Whatever2]), another-constraint[Rest, Whatever1, Whatever2]. - % DCL + % ICL my-predicate[int, string, nat] :: sakura:constraint my-predicate[Arg1, Arg2, Arg3] :- another-module:my-predicate[Arg1, Arg2, Arg3], on[insert, update], timing[immediate]. - % DCL + % ICL valid_age/1 :: sakura:constraint valid_age[Age] with [karuta, sakura] :- nat[Age], -- cgit v1.2.3