From 37d3a1e152707d2da587440c4cea8601b9ef0fd2 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 27 Sep 2026 13:14:38 +0100 Subject: Lay Pure out as a core with the parts selected around it The app model, the tree store and the HTTP host lived in prototypes/connections among the earlier document runtime, the store was known only by its format's name, and Vega compiled six Pure sources by path. Now, as the README's principle has it: core/ runtime, flow and the app model (module*.c), with what the core asks of storage (state.h, store.h) store/ the tree store (PURETRE3, PUREREC1) serve/ pure-serve: HTTP host, outbound delivery, JSON in place cli/ pure-run, pure-edit-module A top-level make builds libpure.a (app model and store, for hosts to link) and the hosts; make check runs the store's and the app model's tests. The earlier runtime still builds from prototypes/connections against core/ and store/ (check, check-tree and check-core pass). Design 009 records the rule: parts by role behind libraries; git repositories split by coupling, so the store stays here while its contract moves with the core, and Vega stays apart. --- research/experiments/010-one-sync-commit/run.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'research/experiments/010-one-sync-commit/run.py') diff --git a/research/experiments/010-one-sync-commit/run.py b/research/experiments/010-one-sync-commit/run.py index 9a01c07..c729358 100644 --- a/research/experiments/010-one-sync-commit/run.py +++ b/research/experiments/010-one-sync-commit/run.py @@ -16,11 +16,18 @@ from pathlib import Path HERE = Path(__file__).resolve().parent ROOT = HERE.parents[2] -PURE = ROOT / 'prototypes' / 'connections' +CORE = ROOT / 'core' # the store's headers +STORE = ROOT / 'store' / 'store-tree.c' + + +def stored_at(revision): + """Where the tree store was at a revision: store/ now, prototypes/connections/ before.""" + moved = subprocess.run(['git', '-C', str(ROOT), 'cat-file', '-e', f'{revision}:store/store-tree.c'], capture_output=True) + return 'store/store-tree.c' if moved.returncode == 0 else 'prototypes/connections/store-tree.c' def build(output, sources): - subprocess.run(['cc', '-O2', '-std=c17', f'-I{PURE}', '-o', str(output)] + [str(s) for s in sources] + ['-lpthread'], + subprocess.run(['cc', '-O2', '-std=c17', f'-I{CORE}', '-o', str(output)] + [str(s) for s in sources] + ['-lpthread'], check=True) @@ -34,12 +41,12 @@ def main(): with tempfile.TemporaryDirectory() as work: work = Path(work) before = work / 'store-tree-before.c' - before.write_text(subprocess.run(['git', '-C', str(ROOT), 'show', f'{args.before}:prototypes/connections/store-tree.c'], + before.write_text(subprocess.run(['git', '-C', str(ROOT), 'show', f'{args.before}:{stored_at(args.before)}'], capture_output=True, text=True, check=True).stdout) build(work / 'probe', [HERE / 'probe.c']) builds = {'two syncs': work / 'commits-before', 'one sync': work / 'commits-after'} build(builds['two syncs'], [HERE / 'commits.c', before]) - build(builds['one sync'], [HERE / 'commits.c', PURE / 'store-tree.c']) + build(builds['one sync'], [HERE / 'commits.c', STORE]) results = {'rounds': []} for round_ in range(args.rounds): probe = subprocess.run([str(work / 'probe'), str(args.directory)], capture_output=True, text=True, check=True) -- cgit v1.2.3