MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / existing_output

Function existing_output

tests/coverage_live_v2_admin.py:41–60  ·  view source on GitHub ↗
(context, case, symlink=False)

Source from the content-addressed store, hash-verified

39
40
41def existing_output(context, case, symlink=False):
42 runner, marker = untouched_runner(case)
43 registry = context.registry(case, image=digest(runner))
44 original = case / "caller-directory"
45 original.mkdir()
46 sentinel = original / "caller-data"
47 sentinel.write_bytes(b"caller-owned bytes\x00unchanged\n")
48 old_meta = original / "meta.json"
49 old_meta.write_bytes(b'{"caller":"preexisting-marker"}\n')
50 before = {path.name: digest(path) for path in original.iterdir()}
51 destination = case / "bundle" if symlink else original
52 if symlink:
53 destination.symlink_to(original, target_is_directory=True)
54 process, _ = context.collect(case, registry, runner=runner, destination=destination)
55 require(process["exit"] == 2, "existing output must be rejected")
56 require(not marker.exists(), "existing output rejection executed runner")
57 require({path.name: digest(path) for path in original.iterdir()} == before,
58 "collector changed preexisting caller data/marker")
59 require(not symlink or destination.is_symlink(), "collector replaced caller symlink")
60 return {"class": "administrative", "caller_bytes_preserved": True, "symlink": symlink}
61
62
63def invalid_registry(context, case):

Callers 1

mainFunction · 0.90

Calls 5

digestFunction · 0.90
requireFunction · 0.90
untouched_runnerFunction · 0.85
registryMethod · 0.80
collectMethod · 0.80

Tested by 1

mainFunction · 0.72