kibi-core 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kibi-core",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "private": false,
5
5
  "description": "Core Prolog modules and RDF graph logic for Kibi",
6
6
  "type": "module",
package/src/kb.pl CHANGED
@@ -288,15 +288,16 @@ kb_write_lock_owner(Directory) :-
288
288
  ; BootId = ""
289
289
  ),
290
290
  get_time(Now),
291
- format_time(atom(StartedAt), '%FT%TZ', Now),
291
+ stamp_date_time(Now, NowUTC, 'UTC'),
292
+ format_time(atom(StartedAt), '%FT%TZ', NowUTC),
292
293
  atom_concat(Path, '.tmp', TmpPath),
293
294
  setup_call_cleanup(
294
295
  open(TmpPath, write, Stream),
295
296
  json_write_dict(Stream,
296
- json([pid:Pid,
297
- workspaceRoot:Directory,
298
- bootId:BootId,
299
- startedAt:StartedAt]),
297
+ _{pid:Pid,
298
+ workspaceRoot:Directory,
299
+ bootId:BootId,
300
+ startedAt:StartedAt},
300
301
  []),
301
302
  (close(Stream), rename_file(TmpPath, Path))).
302
303
 
@@ -939,10 +939,10 @@ receipt_for_current_mode(TestId, Context, Receipts, SnapshotReceipts) :-
939
939
  ( Context.proofBindingMode == per_contract,
940
940
  get_dict(TestId, Context.proofTestBindings, CurrentBinding)
941
941
  -> include(receipt_with_binding_hash, Receipts, BoundReceipts),
942
- include(receipt_for_binding(CurrentBinding), BoundReceipts, SnapshotReceipts),
943
- ( SnapshotReceipts == []
942
+ include(receipt_for_binding(CurrentBinding), BoundReceipts, BindingReceipts),
943
+ ( BindingReceipts == []
944
944
  -> include(receipt_for_snapshot(Context.proofSnapshot), Receipts, SnapshotReceipts)
945
- ; true
945
+ ; SnapshotReceipts = BindingReceipts
946
946
  )
947
947
  ; include(receipt_for_snapshot(Context.proofSnapshot), Receipts, SnapshotReceipts)
948
948
  ).
package/src/status.pl CHANGED
@@ -99,7 +99,8 @@ synced_at(DataFile, SyncedAt) :-
99
99
  exists_file(DataFile),
100
100
  !,
101
101
  time_file(DataFile, Timestamp),
102
- format_time(atom(SyncedAt), '%FT%TZ', Timestamp).
102
+ stamp_date_time(Timestamp, TimestampUTC, 'UTC'),
103
+ format_time(atom(SyncedAt), '%FT%TZ', TimestampUTC).
103
104
  % Before the first successful sync there is no kb.rdf, so the public JSON contract must expose syncedAt: null.
104
105
  synced_at(_, null).
105
106
 
@@ -263,6 +264,7 @@ directory_tree_newer(Path, SnapshotTime) :-
263
264
  !.
264
265
 
265
266
  directory_tree_newer(Path, SnapshotTime) :-
267
+ \+ ignored_documentation_file(Path),
266
268
  exists_directory(Path),
267
269
  directory_files(Path, Entries),
268
270
  member(Entry, Entries),
@@ -275,6 +277,7 @@ directory_tree_newer(Path, SnapshotTime) :-
275
277
  directory_tree_newer_path(Path, SnapshotTime, Path) :-
276
278
  newer_entity_documentation_file(Path, SnapshotTime).
277
279
  directory_tree_newer_path(Path, SnapshotTime, ChildPath) :-
280
+ \+ ignored_documentation_file(Path),
278
281
  exists_directory(Path),
279
282
  directory_files(Path, Entries),
280
283
  member(Entry, Entries),
@@ -377,8 +380,12 @@ ignored_documentation_file(Path) :-
377
380
  file_base_name(Path, 'README.md').
378
381
  ignored_documentation_file(Path) :-
379
382
  sub_atom(Path, _, _, _, '/tests/e2e/').
383
+ ignored_documentation_file(Path) :-
384
+ sub_atom(Path, _, _, 0, '/tests/e2e').
380
385
  ignored_documentation_file(Path) :-
381
386
  sub_atom(Path, _, _, _, '/tests/benchmarks/').
387
+ ignored_documentation_file(Path) :-
388
+ sub_atom(Path, _, _, 0, '/tests/benchmarks').
382
389
 
383
390
  %% newer_entity_documentation_file(+Path, +SnapshotTime) is semidet.
384
391
  % Cheap path and mtime tests run before the file is read, and the content
@@ -395,6 +402,8 @@ newer_entity_documentation_file(Path, SnapshotTime) :-
395
402
  entity_documentation_file(Path) :-
396
403
  read_file_to_string(Path, Content, []),
397
404
  sub_string(Content, 0, 3, _, "---"),
405
+ % These are existence checks, not generators. Repeated metadata examples
406
+ % must not multiply freshness reasons or cause Cartesian backtracking.
398
407
  once(sub_string(Content, _, _, _, "id:")),
399
408
  once(sub_string(Content, _, _, _, "title:")),
400
409
  once(sub_string(Content, _, _, _, "status:")).