|
@@ -2,7 +2,7 @@
|
|
|
"""Fail-closed consistency gates for active status docs vs current 3-axis truth.
|
|
"""Fail-closed consistency gates for active status docs vs current 3-axis truth.
|
|
|
|
|
|
|
|
Activity docs must assert X/Y/Z, six limits, 450/5000/500, permanent EN, hard
|
|
Activity docs must assert X/Y/Z, six limits, 450/5000/500, permanent EN, hard
|
|
|
-truncate, and unbound tip-TD/bitstream placeholders. Stale 2-axis/solenoid IO,
|
|
|
|
|
|
|
+truncate, and bound tip-TD/bitstream identity. Stale 2-axis/solenoid IO,
|
|
|
runtime-limit-inert policy, and old bit/commit-as-current claims must not reappear.
|
|
runtime-limit-inert policy, and old bit/commit-as-current claims must not reappear.
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
@@ -17,11 +17,18 @@ from pathlib import Path
|
|
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
|
|
-PENDING_MARKER = "pending final tip TD"
|
|
|
|
|
|
|
+ARTIFACT_SOURCE_COMMIT = "0de9f93988344e3c11931482902196b02ac7a713"
|
|
|
|
|
+ARTIFACT_SOURCE_SHORT = "0de9f939"
|
|
|
|
|
+BITSTREAM_SHA256 = (
|
|
|
|
|
+ "54ce967da4dce40d7cbb6821eb1e8d7d95b3bdda27a7edf30cbcad7131cb667c"
|
|
|
|
|
+)
|
|
|
|
|
+BITSTREAM_SHORT = "54ce967d"
|
|
|
|
|
+TD_TOOL_BUILD = "6.2.2.200067"
|
|
|
TRUNCATE_SEMANTICS = "truncate_current_high_pulse_immediately_after_synchronized_limit"
|
|
TRUNCATE_SEMANTICS = "truncate_current_high_pulse_immediately_after_synchronized_limit"
|
|
|
PRIOR_BIT_SHORT = "45f548ab"
|
|
PRIOR_BIT_SHORT = "45f548ab"
|
|
|
PRIOR_BIT_COMMIT = "bb515af"
|
|
PRIOR_BIT_COMMIT = "bb515af"
|
|
|
BASELINE_TIP_SHORT = "cdf9f76"
|
|
BASELINE_TIP_SHORT = "cdf9f76"
|
|
|
|
|
+PENDING_MARKER = "pending final tip TD"
|
|
|
|
|
|
|
|
ACTIVITY_DOCS = (
|
|
ACTIVITY_DOCS = (
|
|
|
"README.zh-CN.md",
|
|
"README.zh-CN.md",
|
|
@@ -35,14 +42,17 @@ ACTIVITY_DOCS = (
|
|
|
|
|
|
|
|
# Must appear in every activity doc.
|
|
# Must appear in every activity doc.
|
|
|
PER_DOC_MARKERS = (
|
|
PER_DOC_MARKERS = (
|
|
|
- PENDING_MARKER,
|
|
|
|
|
|
|
+ ARTIFACT_SOURCE_SHORT,
|
|
|
|
|
+ BITSTREAM_SHORT,
|
|
|
PRIOR_BIT_SHORT,
|
|
PRIOR_BIT_SHORT,
|
|
|
PRIOR_BIT_COMMIT,
|
|
PRIOR_BIT_COMMIT,
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
# Must appear somewhere in the activity-doc corpus.
|
|
# Must appear somewhere in the activity-doc corpus.
|
|
|
CORPUS_REQUIRED = (
|
|
CORPUS_REQUIRED = (
|
|
|
- PENDING_MARKER,
|
|
|
|
|
|
|
+ ARTIFACT_SOURCE_COMMIT,
|
|
|
|
|
+ BITSTREAM_SHA256,
|
|
|
|
|
+ TD_TOOL_BUILD,
|
|
|
TRUNCATE_SEMANTICS,
|
|
TRUNCATE_SEMANTICS,
|
|
|
"permanent_high",
|
|
"permanent_high",
|
|
|
"450",
|
|
"450",
|
|
@@ -57,6 +67,7 @@ CORPUS_REQUIRED = (
|
|
|
BASELINE_TIP_SHORT,
|
|
BASELINE_TIP_SHORT,
|
|
|
PRIOR_BIT_SHORT,
|
|
PRIOR_BIT_SHORT,
|
|
|
PRIOR_BIT_COMMIT,
|
|
PRIOR_BIT_COMMIT,
|
|
|
|
|
+ "ARTIFACT-SOURCE-COMMIT",
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
# Superseded identifiers / policies that must not be presented as current tip truth.
|
|
# Superseded identifiers / policies that must not be presented as current tip truth.
|
|
@@ -119,6 +130,10 @@ STALE_AS_CURRENT = (
|
|
|
re.compile(r"(?i)bitstream SHA-256\s*`?a7b5c119"),
|
|
re.compile(r"(?i)bitstream SHA-256\s*`?a7b5c119"),
|
|
|
"stale bitstream a7b5c119 presented as current",
|
|
"stale bitstream a7b5c119 presented as current",
|
|
|
),
|
|
),
|
|
|
|
|
+ (
|
|
|
|
|
+ re.compile(re.escape(PENDING_MARKER)),
|
|
|
|
|
+ "unbound pending marker still present in activity docs after tip TD bind",
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
ROOT_RESIDUE = (
|
|
ROOT_RESIDUE = (
|
|
@@ -137,7 +152,7 @@ class ActivityDocsTruthTests(unittest.TestCase):
|
|
|
missing = [rel for rel in ACTIVITY_DOCS if not (ROOT / rel).is_file()]
|
|
missing = [rel for rel in ACTIVITY_DOCS if not (ROOT / rel).is_file()]
|
|
|
self.assertEqual(missing, [], f"missing activity docs: {missing}")
|
|
self.assertEqual(missing, [], f"missing activity docs: {missing}")
|
|
|
|
|
|
|
|
- def test_each_activity_doc_carries_pending_and_prior_bit_markers(self) -> None:
|
|
|
|
|
|
|
+ def test_each_activity_doc_carries_bound_identity_and_prior_bit_markers(self) -> None:
|
|
|
for rel in ACTIVITY_DOCS:
|
|
for rel in ACTIVITY_DOCS:
|
|
|
text = _read(rel)
|
|
text = _read(rel)
|
|
|
for marker in PER_DOC_MARKERS:
|
|
for marker in PER_DOC_MARKERS:
|
|
@@ -215,7 +230,7 @@ class ActivityDocsTruthTests(unittest.TestCase):
|
|
|
self.assertTrue(hist.is_file(), "expected migrated evidence-batch summary")
|
|
self.assertTrue(hist.is_file(), "expected migrated evidence-batch summary")
|
|
|
|
|
|
|
|
hist_readme = _read("docs/historical/README.md")
|
|
hist_readme = _read("docs/historical/README.md")
|
|
|
- self.assertIn("pending final tip TD", hist_readme)
|
|
|
|
|
|
|
+ self.assertIn(ARTIFACT_SOURCE_SHORT, hist_readme + _read("FINAL_DELIVERY_REPORT.md"))
|
|
|
self.assertIn("2-axis", hist_readme.lower() + hist_readme)
|
|
self.assertIn("2-axis", hist_readme.lower() + hist_readme)
|
|
|
self.assertRegex(hist_readme, r"(?i)not.*old solenoid|not.*solenoid/2-axis|不是.*solenoid|不是.*电磁铁|Root activity docs are \*\*not\*\*")
|
|
self.assertRegex(hist_readme, r"(?i)not.*old solenoid|not.*solenoid/2-axis|不是.*solenoid|不是.*电磁铁|Root activity docs are \*\*not\*\*")
|
|
|
|
|
|