Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
169d517
docs(cf-10): define public real-IG delta corpus
TheHalfMoon Aug 15, 2026
1407b9c
docs(cf-10): plan corpus discovery and execution
TheHalfMoon Aug 15, 2026
0b66579
docs(cf-10): define corpus execution tasks
TheHalfMoon Aug 15, 2026
209a7ac
docs(cf-10): record real-IG corpus provenance boundary
TheHalfMoon Aug 15, 2026
8742f5f
ci(cf-10): discover reproducible public package digests
TheHalfMoon Aug 15, 2026
dd3d495
chore(cf-10): reconcile frozen corpus with canonical main
TheHalfMoon Aug 15, 2026
fdd0395
ci(cf-10): pin digest discovery action revisions
TheHalfMoon Aug 15, 2026
0a6fa33
ci(cf-10): run digest discovery on pull requests
TheHalfMoon Aug 15, 2026
1443141
ci(cf-10): report all frozen eligibility failures
TheHalfMoon Aug 15, 2026
5ec463f
chore(cf10): reconcile canonical CF-11 foundation (#14)
TheHalfMoon Aug 15, 2026
d8cb88b
docs(cf10): authorize frozen eligibility rerun
TheHalfMoon Aug 15, 2026
4f69145
docs(cf10): freeze real IG package attestations
TheHalfMoon Aug 15, 2026
81ba5ab
feat(cf10): freeze corpus v1 package manifest
TheHalfMoon Aug 15, 2026
3f87506
feat(cf10): add typed corpus manifest model
TheHalfMoon Aug 15, 2026
edd2436
feat(cf10): add corpus manifest errors
TheHalfMoon Aug 15, 2026
a2f3174
feat(cf10): validate corpus manifests fail closed
TheHalfMoon Aug 15, 2026
7ebc1d7
feat(cf10): expose typed corpus manifest boundary
TheHalfMoon Aug 15, 2026
b9206ed
test(cf10): cover corpus manifest contract
TheHalfMoon Aug 15, 2026
1ecb4dc
style(cf10): apply rustfmt to corpus boundary
TheHalfMoon Aug 15, 2026
6f07ab5
style(cf10): format corpus errors
TheHalfMoon Aug 15, 2026
7712894
style(cf10): format corpus manifest tests
TheHalfMoon Aug 15, 2026
0241e6e
feat(cf10): model package attestation evidence
TheHalfMoon Aug 15, 2026
40b6ae5
feat(cf10): expose verified cache bytes internally
TheHalfMoon Aug 15, 2026
6e6df8b
feat(cf10): add package attestation failures
TheHalfMoon Aug 15, 2026
eb625bb
feat(cf10): require verified package attestation
TheHalfMoon Aug 15, 2026
d1975f8
feat(cf10): expose verified corpus attestation
TheHalfMoon Aug 15, 2026
43dbc2e
test(cf10): enforce verified package attestation
TheHalfMoon Aug 15, 2026
e100442
style(cf10): format package attestation boundary
TheHalfMoon Aug 15, 2026
971bf85
style(cf10): format package attestation tests
TheHalfMoon Aug 15, 2026
64f603d
docs(cf10): authorize deterministic corpus execution surface
TheHalfMoon Aug 15, 2026
39b9db7
docs(cf10): lock corpus execution plan
TheHalfMoon Aug 15, 2026
4bf5aeb
docs(cf10): reconcile completed foundation and attestation tasks
TheHalfMoon Aug 15, 2026
3333ddf
feat(cf10): add deterministic corpus summary model
TheHalfMoon Aug 15, 2026
83c5c2f
feat(cf10): add corpus evaluation failures
TheHalfMoon Aug 15, 2026
16c6f89
feat(cf10): add canonical corpus evaluator
TheHalfMoon Aug 15, 2026
a6ca271
refactor(cf10): clean corpus evaluator imports
TheHalfMoon Aug 15, 2026
aa944be
feat(cf10): export corpus evaluator APIs
TheHalfMoon Aug 15, 2026
dd5542a
test(cf10): cover canonical corpus evaluation and summary
TheHalfMoon Aug 15, 2026
6e5c08c
style(cf10): format corpus evaluator
TheHalfMoon Aug 15, 2026
36f5731
style(cf10): format corpus evaluator tests
TheHalfMoon Aug 15, 2026
f5292e3
refactor(cf10): expose canonical oracle report
TheHalfMoon Aug 15, 2026
18dfc62
feat(cf10): add changed-only oracle execution mode
TheHalfMoon Aug 15, 2026
f659482
feat(cf10): add bounded corpus execution orchestrator
TheHalfMoon Aug 15, 2026
629c6b6
feat(cf10): wire corpus run CLI
TheHalfMoon Aug 15, 2026
00e3bfe
style(cf10): format corpus orchestrator
TheHalfMoon Aug 15, 2026
9f7a169
style(cf10): format corpus CLI wiring
TheHalfMoon Aug 15, 2026
c27a465
test(cf10): cover corpus CLI fail-closed boundaries
TheHalfMoon Aug 15, 2026
6b66a28
test(cf10): harden corpus CLI early-failure fixtures
TheHalfMoon Aug 15, 2026
e3b89c6
fix(cf10): bound corpus result evidence bytes
TheHalfMoon Aug 15, 2026
52721aa
ci(cf10): add deterministic real corpus proof
TheHalfMoon Aug 15, 2026
b3daf4d
style(cf10): format corpus CLI boundary tests
TheHalfMoon Aug 15, 2026
c97bb4b
ci(cf10): pin Java setup action
TheHalfMoon Aug 15, 2026
e511116
fix(cf10): count actual oracle comparisons
TheHalfMoon Aug 15, 2026
d4813db
test(cf10): distinguish compared from uncomparable oracle evidence
TheHalfMoon Aug 15, 2026
6efea1a
fix(cf07): scope terminology closure canonical indexing
TheHalfMoon Aug 15, 2026
1fb9f8f
style(cf07): format scoped terminology closure
TheHalfMoon Aug 15, 2026
a8d30fc
fix(cf07): scope closure resolution to ValueSets
TheHalfMoon Aug 15, 2026
fed73a4
fix(cf10): distinguish evidence-stage failures
TheHalfMoon Aug 15, 2026
b57368d
fix(cf10): keep evidence-bound failures case-local
TheHalfMoon Aug 15, 2026
fd129d1
ci(cf10): avoid duplicate feature-branch corpus runs
TheHalfMoon Aug 15, 2026
b038cf6
fix(cf07): dedupe identical ValueSet canonicals
TheHalfMoon Aug 15, 2026
1f6f4c5
style(cf10): format evidence failure handling
TheHalfMoon Aug 15, 2026
dbfcdb1
ci(cf10): harden digest discovery triggers and diagnostics
TheHalfMoon Aug 15, 2026
61c4ea4
ci(cf10): preserve both clean corpus runs on failure
TheHalfMoon Aug 15, 2026
aad9ca5
test(cf10): cover oracle failure handling
TheHalfMoon Aug 15, 2026
340fa5e
style(cf10): format oracle failure handler
TheHalfMoon Aug 15, 2026
d3aae3e
fix(cf07): dedupe equivalent binding evidence
TheHalfMoon Aug 15, 2026
0b915dd
style(cf07): format binding evidence helper
TheHalfMoon Aug 15, 2026
b91792f
fix(cf07): keep expansion context ambiguity fail closed
TheHalfMoon Aug 15, 2026
f974c19
fix(cf10): ignore expected build outputs in payload gate
TheHalfMoon Aug 15, 2026
70992c9
fix(cf07): preserve ambiguous binding evidence
TheHalfMoon Aug 15, 2026
61c8dc2
test(cf07): preserve ambiguous bare binding evidence
TheHalfMoon Aug 15, 2026
e0ee918
refactor(cf07): parameterize archive scan budget
TheHalfMoon Aug 15, 2026
cedae0a
fix(cf07): bound terminology closure scan separately
TheHalfMoon Aug 15, 2026
72c4355
style(cf07): format ambiguous binding correction
TheHalfMoon Aug 15, 2026
f6f7f24
style(cf07): format terminology scan budget
TheHalfMoon Aug 15, 2026
9c03b23
test(cf07): reconcile ambiguous binding contract
TheHalfMoon Aug 15, 2026
e5391d8
fix(corpus): bind closure and oracle dependency context
TheHalfMoon Aug 15, 2026
60347c5
fix(corpus): scope terminology and oracle contexts
Aug 15, 2026
60e7734
chore(corpus): re-anchor validated context scope
TheHalfMoon Aug 15, 2026
7da0ea6
fix(oracle): allow versioned dependency profile coexistence
Aug 15, 2026
edad98f
chore(oracle): re-anchor validated dependency coexistence
TheHalfMoon Aug 15, 2026
381327f
test(oracle): add deterministic CF-10 qualification probe
TheHalfMoon Aug 15, 2026
5fe10d9
fix(corpus): bind retained closure evidence
TheHalfMoon Aug 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 186 additions & 0 deletions .github/scripts/cf10-closure-evidence/test_verify_closure_binding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
import importlib.util
import json
from pathlib import Path
import sys
import tempfile
import unittest


MODULE_PATH = Path(__file__).with_name("verify_closure_binding.py")
SPEC = importlib.util.spec_from_file_location("verify_closure_binding", MODULE_PATH)
assert SPEC is not None and SPEC.loader is not None
MODULE = importlib.util.module_from_spec(SPEC)
sys.modules[SPEC.name] = MODULE
SPEC.loader.exec_module(MODULE)


def package(name, version, sha, dependencies=None, source=None):
value = {
"name": name,
"version": version,
"sha256": sha,
"source": source or f"https://packages.example/{name}/{version}",
"dependencies": dependencies or {},
}
return value


def normalized(packages):
values = [
{
"name": p["name"],
"version": p["version"],
"sha256": p["sha256"],
"dependencies": {
key: p["dependencies"][key] for key in sorted(p["dependencies"])
},
}
for p in packages
]
return sorted(
values,
key=lambda p: (
p["name"],
p["version"],
p["sha256"],
tuple(p["dependencies"].items()),
),
)


def summary_for(before_packages, after_packages):
before = normalized(before_packages)
after = normalized(after_packages)
return {
"schema": 1,
"manifest_sha256": "f" * 64,
"cases": [
{
"case_id": "C001",
"package": "root.pkg",
"before": {
"version": "1.0.0",
"sha256": "a" * 64,
"closure_sha256": MODULE.closure_sha256(before),
"closure": before,
},
"after": {
"version": "2.0.0",
"sha256": "b" * 64,
"closure_sha256": MODULE.closure_sha256(after),
"closure": after,
},
"status": "oracle_failed",
"structural": None,
"compatibility": None,
"terminology": None,
"oracle": None,
}
],
}


class BindingTests(unittest.TestCase):
def setUp(self):
self.temp = tempfile.TemporaryDirectory()
self.root = Path(self.temp.name)
self.evidence = self.root / "evidence" / "C001"
self.evidence.mkdir(parents=True)

self.before = [
package(
"root.pkg",
"1.0.0",
"a" * 64,
{"same.dep": "1.0.0", "leaf.dep": "3.0.0"},
),
package("same.dep", "1.0.0", "c" * 64),
package("same.dep", "2.0.0", "d" * 64),
package("leaf.dep", "3.0.0", "e" * 64),
]
self.after = [
package("root.pkg", "2.0.0", "b" * 64, {"same.dep": "2.0.0"}),
package("same.dep", "2.0.0", "d" * 64),
]
self.summary = summary_for(self.before, self.after)
self._write_all(self.before, self.after)

def tearDown(self):
self.temp.cleanup()

def _write_lock(self, side, root_version, packages):
value = {
"schema": 1,
"roots": [f"root.pkg@{root_version}"],
"packages": packages,
}
(self.evidence / f"{side}.commandf.lock").write_text(
json.dumps(value, indent=2) + "\n", encoding="utf-8"
)

def _write_summary(self, summary=None):
path = self.root / "summary.json"
path.write_text(json.dumps(summary or self.summary), encoding="utf-8")
return path

def _write_all(self, before, after):
self._write_lock("before", "1.0.0", before)
self._write_lock("after", "2.0.0", after)

def _verify(self, summary=None):
MODULE.verify_summary(self._write_summary(summary), self.root / "evidence")

def test_exact_binding_with_same_name_multi_version_passes(self):
self._verify()

def test_source_only_change_is_excluded_from_closure_contract(self):
changed = [dict(value) for value in self.before]
changed[1] = dict(
changed[1], source="https://mirror.example/same.dep/1.0.0"
)
self._write_lock("before", "1.0.0", changed)
self._verify()

def test_dependency_map_only_tampering_fails(self):
changed = [dict(value) for value in self.before]
changed[0] = dict(
changed[0],
dependencies={"same.dep": "2.0.0", "leaf.dep": "3.0.0"},
)
self._write_lock("before", "1.0.0", changed)
with self.assertRaisesRegex(MODULE.BindingError, "does not match summary closure"):
self._verify()

def test_missing_package_partial_binding_fails(self):
self._write_lock("before", "1.0.0", self.before[:-1])
with self.assertRaisesRegex(MODULE.BindingError, "does not match summary closure"):
self._verify()

def test_digest_mismatch_fails_even_when_closure_matches(self):
changed_summary = json.loads(json.dumps(self.summary))
changed_summary["cases"][0]["before"]["closure_sha256"] = "0" * 64
with self.assertRaisesRegex(MODULE.BindingError, "closure digest mismatch"):
self._verify(changed_summary)

def test_root_identity_mismatch_fails(self):
value = {
"schema": 1,
"roots": ["other.pkg@1.0.0"],
"packages": self.before,
}
(self.evidence / "before.commandf.lock").write_text(
json.dumps(value), encoding="utf-8"
)
with self.assertRaisesRegex(MODULE.BindingError, "roots must contain exactly one"):
self._verify()

def test_summary_closure_order_tampering_fails(self):
changed_summary = json.loads(json.dumps(self.summary))
closure = changed_summary["cases"][0]["before"]["closure"]
closure[0], closure[1] = closure[1], closure[0]
with self.assertRaisesRegex(MODULE.BindingError, "not canonically sorted"):
self._verify(changed_summary)


if __name__ == "__main__":
unittest.main()
Loading
Loading