tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

commit 26f8bd718523fe248eded2e240c3d43709ca8dbe
parent 207ccd39e38bf71b36dfa2f36cad4f3f33b51c0c
Author: James Eversole <james@eversole.co>
Date:   Sat, 24 Oct 2026 16:56:18 -0500

Observe committed generation checkpoints and preserve primary guard failures

Private publication stages are not progress checkpoints. Keep the original execution/monitoring failure reason when reproduction was never reached. The interrupted H2 is not acceptance; the next pair uses fresh stores.

Diffstat:
Mtest/bootstrap_generations.py | 26++++++++++++++++++--------
Mtest/unit.py | 15+++++++++++++++
2 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/test/bootstrap_generations.py b/test/bootstrap_generations.py @@ -79,6 +79,16 @@ def snapshot(map_text, entries, source_root): for alias, row in entries.items()}) +def published_checkpoints(output, required): + """Observe only committed aliases, never same-directory private stages.""" + for name in required: + checkpoint = output / 'cas/cache/source-build' / name + try: + yield name, checkpoint.read_bytes() + except FileNotFoundError: + continue + + def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('previous', type=Path, nargs='?', help='completed generation; omit when selecting --bootstrap-kit') @@ -291,13 +301,13 @@ def main(): try: monitor = ChildRSS(proc) while proc.poll() is None: - for checkpoint in (output / 'cas/cache/source-build').glob('*'): - current = checkpoint.read_bytes() - if seen.get(checkpoint.name) != current: - seen[checkpoint.name] = current + for name, current in published_checkpoints(output, required): + if seen.get(name) != current: + seen[name] = current last = time.monotonic(); extended = False - print(f'[{last-start:.1f}s] module-checkpoint={checkpoint.name}', flush=True) - objects = list((output / 'cas/objects').glob('*/*')) + print(f'[{last-start:.1f}s] module-checkpoint={name}', flush=True) + objects = [path for path in (output / 'cas/objects').glob('*/*') + if len(path.name) == 64 and all(c in '0123456789abcdef' for c in path.name)] if len(objects) != object_count: object_count = len(objects) last = time.monotonic(); extended = False @@ -353,9 +363,9 @@ def main(): status['reason'] = reason if reason != 'completed' else 'execution, input consistency or audit failure' if args.expect_identical: reproduced = len(comparisons) == len(required) and all(comparisons.values()) - success = success and reproduced - if not reproduced: + if success and not reproduced: status['reason'] = 'manifest reproduction failure' + success = success and reproduced audit_seconds = time.monotonic() - audit_start packing_start = time.monotonic() if success and args.root == 'source_map': diff --git a/test/unit.py b/test/unit.py @@ -1613,6 +1613,21 @@ class BackendDefaultTests(unittest.TestCase): self.assertEqual(captured[0].backend, override or 'stable') +class CheckpointProgressTests(unittest.TestCase): + def test_private_and_unselected_files_are_never_read_as_checkpoints(self): + from bootstrap_generations import published_checkpoints + with tempfile.TemporaryDirectory() as temporary: + root = Path(temporary) + cache = root / 'cas/cache/source-build' + cache.mkdir(parents=True) + (cache/'app').write_bytes(b'committed') + # Directories would fail read_bytes if the watcher touched them. + (cache/'473-17.tricu-stage-').mkdir() + (cache/'unselected').mkdir() + self.assertEqual(dict(published_checkpoints(root, ['app', 'not-yet-published'])), + {'app': b'committed'}) + + class PublishedInventoryTests(unittest.TestCase): def test_only_reserved_unpublished_stage_names_are_excluded(self): from shared_library_generation import published_objects