# FRCMΠD — Πβ REQUIREMENTS CAPABILITY AUDIT (READ-ONLY) v1.0
Cell 0 — Markdown: Purpose, Boundaries, and Levels
markdown
# FRCMΠD — Πβ REQUIREMENTS CAPABILITY AUDIT (READ-ONLY) v1.0
https://colab.research.google.com/drive/1xR93FY84pU0xA3oCXO7f41be1mqBPA1e#scrollTo=H5C9tQxhlKkg
**Status:** THIRD DRAFT — CORRECTED. ASSEMBLED BUT UNEXECUTED.
**Execution Authorization:** NOT GRANTED.
**Workbench Cell 6:** Empty and unauthorized.
**Source Notebooks:** Untouched.
## Purpose
This notebook is the **Stage 2 Πβ Capability Audit**. It examines mathematical capabilities against the six Πβ requirements (R1–R6).
It consists of two separate components:
1. **Synthetic Test Suite:** Minimal synthetic structures demonstrating mathematical properties.
2. **Source Comparison:** An evidenced evaluation of the inspected source candidates against R1–R6.
It does not select, repair, or replace any candidate for Πβ. It does not decide what Πβ must be.
## Provenance and Inspection Rules
- **No hidden grids:** Do not infer grid-free or coordinate-free implementation from notebook titles, labels, or displayed outputs. Code paths must be inspected. If uninspected, the status is `SOURCE_NOT_INSPECTED`.
- **Mathematical presence $\neq$ Πβ identity:** A feature may exist mathematically without being the Πβ requirement. This is recorded as `PARTIAL_ANALOGUE` or `CORRESPONDENCE_UNRESOLVED`.
- **Scope:** Do not generalize an absence in one function to the whole notebook.
## Capability Levels
1. **Accommodation:** A structure *can* be constructed to exhibit the property.
2. **Synthetic specification:** A specific illustrative structure *has been written* and demonstrated.
3. **FRCMΠD specification:** A candidate *has been formally specified* and checked against the requirement.
4. **Establishment:** The framework's ontology *requires* that structure.
The synthetic tests reach **Synthetic specification**. The source comparisons reach **FRCMΠD specification** only if the evidence supports it. **Establishment** is out of scope.
## Source Assessment Labels
- `PRESENT_AS_WRITTEN`: The inspected function explicitly contains the mathematical feature.
- `PARTIAL_ANALOGUE`: A mathematical feature resembles part of the requirement, but its Πβ role is not established.
- `NOT_PRESENT_IN_INSPECTED_SCOPE`: The feature is absent from the specific function inspected (not a universal claim).
- `CORRESPONDENCE_UNRESOLVED`: A mathematical feature exists, but its link to the Πβ requirement is not established.
- `SOURCE_NOT_INSPECTED`: The source code has not been inspected sufficiently to make the comparison.
## Status Vocabulary
- `execution_status`: `COMPLETED` / `ERROR` / `NOT_RUN`
- `capability_result`: `DEMONSTRATED` / `NOT_DEMONSTRATED` / `UNRESOLVED`
Cell 1 — Markdown: The Source Comparison Plan
markdown
## The Source Comparison Plan
The Stage 2 audit compares the inspected source candidates against R1–R6.
**Candidate 1: Coordinate-Free Successor `C(P,G,Σ)`**
- *Source Scope:* The `C_candidate` function in the Coordinate-Free Successor Model.
- *R1:* `NOT_PRESENT_IN_INSPECTED_SCOPE` (No explicit `b` object or `P→b` mapping).
- *R2:* `PARTIAL_ANALOGUE`. The expansion \(D_G = [\Sigma, P] + g(I_1)[P - P_G^\dagger, P]\) contains a linear component \([\Sigma, P]\) inside a nonlinear assembly. The component is present, but its Πβ identity is `CORRESPONDENCE_UNRESOLVED`.
- *R3:* `NOT_PRESENT_IN_INSPECTED_SCOPE` (Matrix-valued assembly exists, but no full structural Πβ pattern).
- *R4:* `NOT_PRESENT_IN_INSPECTED_SCOPE` (No sequence index).
- *R5:* `NOT_PRESENT_IN_INSPECTED_SCOPE` (No delayed response).
- *R6:* `NOT_PRESENT_IN_INSPECTED_SCOPE` (No reciprocal update rule).
**Candidate 2: 2D Joint-Invariant Coupling `C̃ = tr(bB_G)B_G`**
- *Source Scope:* The `C_tilde` function in the Joint-Invariant Coupling notebook.
- *R1:* `NOT_PRESENT_IN_INSPECTED_SCOPE` (Output is matrix-valued, but no Πβ object).
- *R2:* `PARTIAL_ANALOGUE`. The map is linear in \(b\) for fixed \(B_G\), but it reduces \(b\) to a scalar amplitude along \(B_G\). Its map rank is one (three-dimensional kernel). This is a severe structural compression, not a full linear channel.
- *R3:* `PARTIAL_ANALOGUE`. Discards the entire \(G\)-self-adjoint component of \(b\).
- *R4:* `NOT_PRESENT_IN_INSPECTED_SCOPE` (Static).
- *R5:* `NOT_PRESENT_IN_INSPECTED_SCOPE` (Static).
- *R6:* `NOT_PRESENT_IN_INSPECTED_SCOPE` (No reciprocal law).
*Note on Rank Terminology:* For fixed nonzero \(B_G\), the map \(b \mapsto \widetilde C(b, B_G)\) has a one-dimensional image (map rank one). In the Stage 1 test geometry, the output matrix \(B_G\) itself has matrix rank two. The output is a scalar multiple of \(B_G\).
*Note on Hidden Grids:* The coordinate-free status of Candidate 1 relies on transformation covariance. However, the code paths have not been fully audited for hidden grid dependencies (as per FREE THE CAT #3). The implementation status is `CORRESPONDENCE_UNRESOLVED`.
You are absolutely right. The audit is clear: fix the two small text/logic mismatches, freeze the structure, and **run it**. If anything else surfaces, we find it in the actual execution output, not in the theoretical assembly.
Here are the exact two fixes applied:
1. Changed the header text in Cell 0 to match the code: **FIFTH DRAFT**.
2. Fixed the failure-path table logic: If a test fails to demonstrate, it is marked `Synthetic Specification: NOT DEMONSTRATED` and `Accommodation: UNRESOLVED` (since a failed specific example doesn't mean a different structure couldn't accommodate it).
Here is the complete, single-cell script. Paste it into a fresh Colab cell and hit run.
```python
# ============================================================
# FRCMΠD — Πβ REQUIREMENTS CAPABILITY AUDIT (READ-ONLY) v1.0
# Status: FIFTH DRAFT — CORRECTED, ASSEMBLED BUT UNEXECUTED
# Execution Authorization: NOT GRANTED
# ============================================================
import mpmath as mp
import traceback
mp.mp.dps = 50
TOL = mp.mpf("1e-40")
# ============================================================
# 1. KERNEL GUARD
# ============================================================
if "_FRCMPD_AUDIT_INITIALIZED" in globals():
raise RuntimeError(
"Audit already initialized in this kernel. "
"Restart the kernel (Runtime -> Restart) to begin a new audit run."
)
_FRCMPD_AUDIT_INITIALIZED = True
def max_abs(M):
if M.rows == 0 or M.cols == 0:
return mp.mpf("0")
return max(abs(M[i, j]) for i in range(M.rows) for j in range(M.cols))
def matrix_trace(M):
return sum(M[i, i] for i in range(min(M.rows, M.cols)))
# ============================================================
# 2. PRE-REGISTERED TEST REGISTRY
# ============================================================
test_registry = [
{
"test_id": "R1_test",
"requirement": "R1",
"test_name": "Nonlinear matrix map not reducible to trace",
"assumptions": "A matrix-valued nonlinear map is a candidate for 'structural expression'.",
"inputs": "P_a, P_b (equal trace), P_zero_trace",
"limitation": "Establishes only that a nonlinear matrix-valued map can fail to factor through the scalar trace. Does not establish a universal rule for all zero-trace inputs. FRCMΠD specification: [UNRESOLVED].",
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None
},
{
"test_id": "R2_test",
"requirement": "R2",
"test_name": "Linear channel feeding nonlinear coupling",
"assumptions": "A linear channel is L(x)=2x. The composite is g(L(x))=4x^2.",
"inputs": "x1, x2, scalar a",
"limitation": "Establishes that a linear channel can participate in a nonlinear composite. Does NOT settle what the Πβ linear channel must preserve. FRCMΠD specification: [UNRESOLVED].",
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None
},
{
"test_id": "R3_test",
"requirement": "R3",
"test_name": "Matrix representation preserves structure that trace collapses",
"assumptions": "R_full(X)=X and R_trace(X)=tr(X) are candidate readings.",
"inputs": "X1, X2 (equal trace, different structure)",
"limitation": "Establishes that a matrix representation CAN preserve structure that a trace collapses. Does not establish the actual Πβ representation. FRCMΠD specification: [UNRESOLVED].",
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None
},
{
"test_id": "R4_test",
"requirement": "R4",
"test_name": "Sequence map sensitive to prior state",
"assumptions": "Two explicit sequences with the same present state but different prior states.",
"inputs": "history_1=[0.5, 1.0], history_2=[-0.5, 1.0]",
"limitation": "Establishes a synthetic prior-state-dependent sequence transition. Does NOT establish that memory is required, nor that the index is emergent time. FRCMΠD specification: [UNRESOLVED].",
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None
},
{
"test_id": "R5_test",
"requirement": "R5",
"test_name": "One-index delayed dependence demonstrated synthetically",
"assumptions": "A sequence shift S(u)_n = u_{n-1} with initial condition 0.",
"inputs": "Step sequence u = [0, 0, 1, 1, 1]",
"limitation": "Demonstrates a mathematical representation of delay. Does NOT establish that lag is an intrinsic ontological property, nor that lag is mass. FRCMΠD specification: [UNRESOLVED].",
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None
},
{
"test_id": "R6_test",
"requirement": "R6",
"test_name": "Two-way local cross-sensitivity vs one-way control",
"assumptions": "P and b are represented by scalar stand-ins. Cross-derivatives measure local first-order sensitivity.",
"inputs": "P0=1.0, b0=2.0",
"limitation": "Establishes two-way local cross-sensitivity in a synthetic scalar pair. Does NOT establish full FRCMΠD reciprocity. FRCMΠD specification: [UNRESOLVED].",
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None
}
]
def run_test(test_id, test_func):
record = next((r for r in test_registry if r["test_id"] == test_id), None)
if not record:
raise ValueError(f"Unregistered test ID: {test_id}")
record["invocation_count"] += 1
if record["invocation_count"] > 1:
record["execution_status"] = "ERROR"
record["capability_result"] = "UNRESOLVED"
record["capability_level"] = "[UNRESOLVED]"
record["result"] = "Duplicate execution detected. Original record preserved."
record["exception_diagnostic"] = "Duplicate execution."
print(f"\n[ERROR] {test_id} invoked more than once. Execution halted for this test.")
return
print(f"\n[{record['requirement']} | {record['test_name']}]")
print(f" Assumptions : {record['assumptions']}")
print(f" Inputs : {record['inputs']}")
try:
success, result_str = test_func()
if not isinstance(success, bool):
raise TypeError(f"Test function returned non-Boolean success value: {type(success)}")
record["execution_status"] = "COMPLETED"
if success:
record["capability_result"] = "DEMONSTRATED"
record["capability_level"] = record["target_capability_level"]
else:
record["capability_result"] = "NOT_DEMONSTRATED"
record["capability_level"] = "[UNRESOLVED]"
record["result"] = result_str
record["exception_diagnostic"] = None
except Exception as e:
record["execution_status"] = "ERROR"
record["capability_result"] = "UNRESOLVED"
record["capability_level"] = "[UNRESOLVED]"
record["result"] = "Execution Error"
record["exception_diagnostic"] = traceback.format_exc()
print(f" Execution : {record['execution_status']}")
print(f" Result : {record['capability_result']}")
print(f" Level : {record['capability_level']}")
print(f" Detail : {record['result']}")
print(f" Limitation : {record['limitation']}")
if record["exception_diagnostic"]:
print(f" Exception : {record['exception_diagnostic']}")
# ============================================================
# 3. TEST DEFINITIONS
# ============================================================
print("=" * 80)
print("FRCMΠD — Πβ REQUIREMENTS CAPABILITY AUDIT (READ-ONLY) v1.0")
print("STATUS: FIFTH DRAFT — CORRECTED")
print("=" * 80)
print("\nNOTE: This is a synthetic capability audit. It does not select,")
print("repair, or replace any candidate for Πβ.")
print("\nProvenance Rule: Do not infer grid-free implementation from labels or outputs.")
print("Code paths must be inspected. If uninspected, status is SOURCE_NOT_INSPECTED.")
print("=" * 80)
def test_R1():
def Phi_R1(P):
return P * P + P.T
P_a = mp.matrix([[mp.mpf("1.0"), mp.mpf("2.0")], [mp.mpf("3.0"), mp.mpf("4.0")]])
P_b = mp.matrix([[mp.mpf("1.0"), mp.mpf("-2.0")], [mp.mpf("-3.0"), mp.mpf("4.0")]])
P_zero_trace = mp.matrix([[mp.mpf("1.0"), mp.mpf("2.0")], [mp.mpf("3.0"), mp.mpf("-1.0")]])
phi_a = Phi_R1(P_a)
phi_b = Phi_R1(P_b)
phi_zt = Phi_R1(P_zero_trace)
same_trace = abs(matrix_trace(P_a) - matrix_trace(P_b)) < TOL
different_phi = max_abs(phi_a - phi_b) > TOL
nonlin_resid = max_abs(Phi_R1(P_a + P_a) - mp.mpf("2") * Phi_R1(P_a))
zt_nonzero = max_abs(phi_zt) > TOL
success = same_trace and different_phi and (nonlin_resid > TOL) and zt_nonzero
res_str = (f"tr(P_a)={mp.nstr(matrix_trace(P_a),6)}, tr(P_b)={mp.nstr(matrix_trace(P_b),6)}; "
f"same_trace={same_trace}, diff_Phi={different_phi}; "
f"nonlinearity={mp.nstr(nonlin_resid, 6)}; "
f"selected_zt_nonzero={zt_nonzero}")
return (success, res_str)
def test_R2():
def L_R2(x):
return mp.mpf("2.0") * x
def g_R2(c):
return c * c
def total_R2(x):
return g_R2(L_R2(x))
x1, x2, a = mp.mpf("3.0"), mp.mpf("5.0"), mp.mpf("2.5")
L_add = abs(L_R2(x1 + x2) - L_R2(x1) - L_R2(x2))
L_hom = abs(L_R2(a * x1) - a * L_R2(x1))
L_linear = (L_add < TOL) and (L_hom < TOL)
g_nonlin = abs(g_R2(mp.mpf("2.0")) + g_R2(mp.mpf("3.0")) - g_R2(mp.mpf("5.0")))
comp_add = abs(total_R2(x1 + x2) - total_R2(x1) - total_R2(x2))
comp_nonlin = comp_add > TOL
success = L_linear and (g_nonlin > TOL) and comp_nonlin
res_str = (f"L linear (algebraic+num)={L_linear}; "
f"g nonlin resid={mp.nstr(g_nonlin,6)}; "
f"composite nonlin={comp_nonlin}")
return (success, res_str)
def test_R3():
def R_full(X): return X.copy()
def R_trace(X): return matrix_trace(X)
X1 = mp.matrix([[mp.mpf("1.0"), mp.mpf("2.0")], [mp.mpf("3.0"), mp.mpf("4.0")]])
X2 = mp.matrix([[mp.mpf("1.0"), mp.mpf("-2.0")], [mp.mpf("-3.0"), mp.mpf("4.0")]])
same_trace = abs(R_trace(X1) - R_trace(X2)) < TOL
full_distinguishes = max_abs(R_full(X1) - R_full(X2)) > TOL
trace_collapses = abs(R_trace(X1) - R_trace(X2)) < TOL
success = same_trace and full_distinguishes and trace_collapses
res_str = (f"same_trace={same_trace}; "
f"R_full distinguishes={full_distinguishes}; "
f"R_trace collapses={trace_collapses}")
return (success, res_str)
def test_R4():
history_1 = [mp.mpf("0.5"), mp.mpf("1.0")]
history_2 = [mp.mpf("-0.5"), mp.mpf("1.0")]
def f_instant(x): return x
def f_history(x, prev): return x + mp.mpf("0.5") * prev
inst_1 = f_instant(history_1[-1])
inst_2 = f_instant(history_2[-1])
inst_same = abs(inst_1 - inst_2) < TOL
next_1 = f_history(history_1[-1], history_1[-2])
next_2 = f_history(history_2[-1], history_2[-2])
hist_diff = abs(next_1 - next_2)
success = inst_same and (hist_diff > TOL)
res_str = (f"present-only ignores history: {inst_same}; "
f"history-sensitive distinguishes: {hist_diff > TOL} (resid={mp.nstr(hist_diff,6)})")
return (success, res_str)
def test_R5():
u = [mp.mpf("0"), mp.mpf("0"), mp.mpf("1"), mp.mpf("1"), mp.mpf("1")]
y = [mp.mpf("0")] + u[:-1]
init_ok = y[0] == mp.mpf("0")
shift_ok = all(y[n] == u[n-1] for n in range(1, len(y)))
u_trans = next(i for i, v in enumerate(u) if v == 1)
y_trans = next(i for i, v in enumerate(y) if v == 1)
delay_ok = (y_trans == u_trans + 1)
success = init_ok and shift_ok and delay_ok
res_str = (f"Input: {u}, Output: {y}. "
f"Init_ok={init_ok}, Shift_ok={shift_ok}, "
f"Transitions: {u_trans}->{y_trans}. Delay={delay_ok}")
return (success, res_str)
def test_R6():
def f_P(P, b): return P + mp.mpf("0.5") * b
def g_b(b, P): return b + mp.mpf("0.7") * P
def g_none(b, P): return b
P0, b0, eps = mp.mpf("1.0"), mp.mpf("2.0"), mp.mpf("1e-8")
dP_db = (f_P(P0, b0 + eps) - f_P(P0, b0)) / eps
db_dP = (g_b(b0, P0 + eps) - g_b(b0, P0)) / eps
both_sensitive = (abs(dP_db) > TOL) and (abs(db_dP) > TOL)
d_none_dP = (g_none(b0, P0 + eps) - g_none(b0, P0)) / eps
one_way_zero = abs(d_none_dP) < TOL
success = both_sensitive and one_way_zero
res_str = (f"Two-way: dP/db={mp.nstr(dP_db,4)}, db/dP={mp.nstr(db_dP,4)}. "
f"One-way counter: db/dP={mp.nstr(d_none_dP,4)}.")
return (success, res_str)
# ============================================================
# 4. INVOKE TESTS
# ============================================================
run_test("R1_test", test_R1)
run_test("R2_test", test_R2)
run_test("R3_test", test_R3)
run_test("R4_test", test_R4)
run_test("R5_test", test_R5)
run_test("R6_test", test_R6)
# ============================================================
# 5. AGGREGATE REPORT & VALIDATION
# ============================================================
print("\n" + "="*80)
print("AGGREGATE REPORT — SYNTHETIC TEST SUITE ONLY")
print("="*80)
valid_exec = {"COMPLETED", "ERROR", "NOT_RUN"}
valid_cap = {"DEMONSTRATED", "NOT_DEMONSTRATED", "UNRESOLVED"}
valid_levels = {"Accommodation", "Synthetic specification", "FRCMΠD specification", "Establishment", "[UNRESOLVED]"}
allowed_combinations = {
("NOT_RUN", "UNRESOLVED", "[UNRESOLVED]"),
("ERROR", "UNRESOLVED", "[UNRESOLVED]"),
("COMPLETED", "UNRESOLVED", "[UNRESOLVED]"),
("COMPLETED", "NOT_DEMONSTRATED", "[UNRESOLVED]"),
("COMPLETED", "DEMONSTRATED", "Synthetic specification")
}
errors = []
seen_ids = set()
for r in test_registry:
t_id = r["test_id"]
if t_id in seen_ids:
errors.append(f"Duplicate test ID: {t_id}")
seen_ids.add(t_id)
if r["execution_status"] not in valid_exec:
errors.append(f"{t_id}: Invalid execution_status: {r['execution_status']}")
if r["capability_result"] not in valid_cap:
errors.append(f"{t_id}: Invalid capability_result: {r['capability_result']}")
if r["capability_level"] not in valid_levels:
errors.append(f"{t_id}: Invalid capability_level: {r['capability_level']}")
combo = (r["execution_status"], r["capability_result"], r["capability_level"])
if combo not in allowed_combinations:
errors.append(f"{t_id}: Contradictory status combination: {combo}")
if r["invocation_count"] > 1:
errors.append(f"{t_id}: Executed more than once.")
expected_ids = {"R1_test", "R2_test", "R3_test", "R4_test", "R5_test", "R6_test"}
actual_ids = {r["test_id"] for r in test_registry}
missing = expected_ids - actual_ids
if missing:
for m in missing:
errors.append(f"Missing expected test: {m}")
unexpected = actual_ids - expected_ids
if unexpected:
for u in unexpected:
errors.append(f"Unexpected test ID: {u}")
print(f"{'Req':<6} {'Test ID':<12} {'Test Name':<45} {'Exec':<10} {'Result':<16} {'Level':<24}")
print("-" * 117)
for r in sorted(test_registry, key=lambda x: x["test_id"]):
print(f"{r['requirement']:<6} {r['test_id']:<12} {r['test_name'][:43]:<45} {r['execution_status']:<10} {r['capability_result']:<16} {r['capability_level']:<24}")
print()
if errors:
print("VALIDATION ERRORS:")
for e in errors:
print(f" - {e}")
else:
print("No registry validation errors detected.")
print("\nRequirement Aggregation:")
print(f"{'Req':<6} {'Accommodation':<20} {'Synthetic Spec':<20} {'FRCMΠD Spec':<20} {'Establishment':<20}")
print("-" * 86)
for req in ["R1", "R2", "R3", "R4", "R5", "R6"]:
req_tests = [r for r in test_registry if r["requirement"] == req]
# FIXED: Logical soundness on failure path
if not req_tests:
acc = "MISSING"; syn = "MISSING"
elif all(r["capability_result"] == "DEMONSTRATED" for r in req_tests):
acc = "DEMONSTRATED"; syn = "DEMONSTRATED"
elif any(r["execution_status"] == "ERROR" for r in req_tests) or any(r["execution_status"] == "NOT_RUN" for r in req_tests):
acc = "UNRESOLVED"; syn = "UNRESOLVED"
elif any(r["capability_result"] == "NOT_DEMONSTRATED" for r in req_tests):
acc = "UNRESOLVED"; syn = "NOT DEMONSTRATED"
else:
acc = "UNRESOLVED"; syn = "UNRESOLVED"
print(f"{req:<6} {acc:<20} {syn:<20} {'[UNRESOLVED]':<20} {'[UNRESOLVED]':<20}")
if errors:
synth_status = "FAILURE — INVALID REGISTRY"
elif any(r["execution_status"] == "ERROR" for r in test_registry):
synth_status = "INCOMPLETE — TEST EXECUTION ERRORS"
elif any(r["execution_status"] == "NOT_RUN" for r in test_registry):
synth_status = "NOT_RUN — EXECUTION NOT AUTHORIZED"
elif any(r["capability_result"] == "NOT_DEMONSTRATED" for r in test_registry):
synth_status = "FAILURE — DEMONSTRATION FAILED"
else:
synth_status = "PASS — SYNTHETIC SPECIFICATIONS DEMONSTRATED; FRCMΠD REQUIREMENTS NOT ESTABLISHED"
print("\n" + "="*80)
print("THREE AUDIT STATUSES")
print("="*80)
print(f"1. SYNTHETIC TEST SUITE STATUS: {synth_status}")
print(f"2. SOURCE COMPARISON STATUS: INCOMPLETE — SOURCE INSPECTION EVIDENCE NOT YET AUDITABLE")
print(f"3. STAGE 2 OVERALL STATUS: INCOMPLETE — CANDIDATE-CAPABILITY COMPARISON REQUIRES SOURCE-PROVENANCE COMPLETION")
print("="*80)
# ============================================================
# 6. SOURCE COMPARISON INVENTORY
# ============================================================
print("\n" + "="*80)
print("SOURCE COMPARISON INVENTORY")
print("="*80)
inventory = [
{
"candidate": "Coordinate-Free Successor C(P,G,Σ)",
"source": "FINITE_RESPONSE_COUPLED_MONAD_Π_DYNAMICS_COORDINATE-FREE_SUCCESSOR_MODEL.ipynb",
"location": "C_candidate function (Cell 8 source block)",
"dependencies": "G_adjoint, g_gate, phi_y_scalar, mpmath matrix operations.",
"scope": "Bounded function inspection. Whole notebook not inspected.",
"evidence": "D_G = [J_G, P] expansion. J_G = Σ + g(I_1)(P - P_G^†).",
"finding": "Contains linear component [Σ, P] inside nonlinear assembly.",
"limitations": "Hidden grid arrays (np.roll, dx) not audited. Sequence, lag, reciprocal update absent from inspected function.",
"assessment": "PARTIAL_ANALOGUE",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"hidden_grid": "SOURCE_NOT_INSPECTED"
},
{
"candidate": "2D Joint-Invariant Coupling C̃ = tr(bB_G)B_G",
"source": "FRCMΠD — EXPERIMENTAL TEST: 2D JOINT-INVARIANT COUPLING.ipynb",
"location": "C_tilde function (Cell 1 source block)",
"dependencies": "matrix_trace, mpmath matrix operations.",
"scope": "Bounded function inspection. Whole notebook not inspected.",
"evidence": "Stage 1 executed output: Map rank=1, Kernel=3D, B_G matrix rank=2. Discards G-self-adjoint component.",
"finding": "Linear in b, rank-1 map, but compresses to scalar amplitude.",
"limitations": "Static expression. No sequence, lag, or reciprocal update.",
"assessment": "PARTIAL_ANALOGUE",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"hidden_grid": "NOT_APPLICABLE (static assembly)"
}
]
for inv in inventory:
print(f"\nCandidate: {inv['candidate']}")
print(f" Source: {inv['source']}")
print(f" Location: {inv['location']}")
print(f" Dependencies: {inv['dependencies']}")
print(f" Inspection Scope:{inv['scope']}")
print(f" Evidence: {inv['evidence']}")
print(f" Finding: {inv['finding']}")
print(f" Limitations: {inv['limitations']}")
print(f" Assessment: {inv['assessment']}")
print(f" Πβ Correspondence: {inv['pib_correspondence']}")
print(f" Hidden Grid: {inv['hidden_grid']}")
print("\n" + "="*80)
print("FINAL BOUNDARY")
print("="*80)
print("This is the Stage 2 Πβ Capability Audit.")
print("It advances synthetic tests to the Synthetic specification level.")
print("It leaves FRCMΠD specification and Establishment unresolved for every requirement.")
print("The Source Comparison is incomplete pending direct inspection of the original source notebooks.")
print("No execution authorization has been granted. Workbench Cell 6 remains empty.")
print("="*80)
```
Cell 7 — Markdown: Source Comparison and Overall Limitations
markdown
## Stage 2 Source Comparison: Candidate Evaluation
### Coordinate-Free Successor `C(P,G,Σ)`
*Source Scope:* `C_candidate` function in `FINITE_RESPONSE_COUPLED_MONAD_Π_DYNAMICS_COORDINATE-FREE_SUCCESSOR_MODEL.ipynb`.
- **R1:** `NOT_PRESENT_IN_INSPECTED_SCOPE`. The assembly contains no explicit `b` object or `P→b` mapping.
- **R2:** `PARTIAL_ANALOGUE`. The expansion \(D_G = [\Sigma, P] + g(I_1)[P - P_G^\dagger, P]\) contains a linear component \([\Sigma, P]\) inside a nonlinear assembly. The component is present, but its Πβ identity is `CORRESPONDENCE_UNRESOLVED`.
- **R3:** `NOT_PRESENT_IN_INSPECTED_SCOPE`. Output is matrix-valued, but the correspondence to the full Πβ pattern is unresolved.
- **R4:** `NOT_PRESENT_IN_INSPECTED_SCOPE`. No sequence index.
- **R5:** `NOT_PRESENT_IN_INSPECTED_SCOPE`. No delayed response.
- **R6:** `NOT_PRESENT_IN_INSPECTED_SCOPE`. No reciprocal update rule.
### 2D Joint-Invariant Coupling `C̃ = tr(bB_G)B_G`
*Source Scope:* `C_tilde` function in `FRCMΠD — EXPERIMENTAL TEST: 2D JOINT-INVARIANT COUPLING.ipynb`.
- **R1:** `NOT_PRESENT_IN_INSPECTED_SCOPE`. No Πβ object.
- **R2:** `PARTIAL_ANALOGUE`. Linear in \(b\) for fixed \(B_G\). Map rank is one (three-dimensional kernel). \(B_G\) itself has matrix rank two. Output is a scalar amplitude along \(B_G\).
- **R3:** `PARTIAL_ANALOGUE`. Discards the entire \(G\)-self-adjoint component of \(b\).
- **R4:** `NOT_PRESENT_IN_INSPECTED_SCOPE`. Static.
- **R5:** `NOT_PRESENT_IN_INSPECTED_SCOPE`. Static.
- **R6:** `NOT_PRESENT_IN_INSPECTED_SCOPE`. No reciprocal law.
### Hidden Grid Provenance
The Coordinate-Free Successor's covariance is tested via transformation matrices. However, the code paths have not been fully audited for hidden grid arrays (`np.roll`, `dx`) as discovered in FREE THE CAT #3. Its coordinate-free status remains `CORRESPONDENCE_UNRESOLVED` pending code-path inspection.
## What this Stage 2 Audit establishes
- The synthetic tests reach **Synthetic specification** for R1–R6.
- The source comparison identifies specific mathematical features (`PARTIAL_ANALOGUE`, `NOT_PRESENT_IN_INSPECTED_SCOPE`) but does not establish FRCMΠD specification or Πβ identity.
## What this Stage 2 Audit does NOT establish
- That any specific structure IS the Πβ realization.
- That any FRCMΠD requirement has been satisfied by any candidate (FRCMΠD specification).
- That the ontology's proposition about Π's nonlinearity is established.
- That lag equals mass, or that any sequence index corresponds to emergent time.
- That reciprocity is achieved.
## Boundary
This is the Stage 2 Πβ Capability Audit. It advances synthetic tests to the **Synthetic specification** level. It leaves **FRCMΠD specification** and **Establishment** unresolved for every requirement.
REVISED ->
# ============================================================
# FRCMΠD — Πβ REQUIREMENTS CAPABILITY AUDIT (READ-ONLY) v1.0
# ELEVENTH DRAFT — CHATGPT CONSOLIDATED REVIEW COPY
# Single-cell Colab script; assembled but NOT EXECUTED by ChatGPT.
# Execution authorization: NOT GRANTED by this script.
# ============================================================
import datetime
import hashlib
import json
import os
import platform
import sys
import traceback
import uuid
import mpmath as mp
# ------------------------------------------------------------
# 0. CHANGE CONTROL AND KERNEL GUARD
# ------------------------------------------------------------
AUDIT_VERSION = "1.0"
DRAFT_REVISION = 11
PREVIOUS_DRAFT = 10
DRAFT_STATUS = "ASSEMBLED — NOT EXECUTED IN THIS REVIEW"
# A single kernel may initialize this audit only once. Restart the
# Colab runtime before a new audit run. Do not delete this sentinel.
_KERNEL_SENTINEL = "_FRCMPD_AUDIT_INITIALIZED"
if _KERNEL_SENTINEL in globals():
raise RuntimeError(
"This kernel has already initialized an FRCMΠD audit. "
"Restart the runtime before starting a new run."
)
globals()[_KERNEL_SENTINEL] = True
# Explicit authorization is deliberately OFF by default.
# To authorize a later run, the user must explicitly change the Boolean
# AND populate the reference and timestamp fields before the first run
# in a fresh kernel. This script does not grant authorization itself.
EXECUTION_AUTHORIZED = False
AUTHORIZATION_REFERENCE = None
AUTHORIZATION_TIMESTAMP_UTC = None
# Numerical settings.
mp.mp.dps = 50
TOL = mp.mpf("1e-40")
R6_EPSILON = mp.mpf("1e-8")
# Unique run identifier: UTC timestamp to microseconds plus UUID suffix.
NOW_UTC = datetime.datetime.now(datetime.timezone.utc)
RUN_ID = f"{NOW_UTC.strftime('%Y%m%d_%H%M%S_%f')}_{uuid.uuid4().hex[:8]}"
RUN_TIMESTAMP_UTC = NOW_UTC.isoformat()
NOTEBOOK_FILENAME = (
"FRCMΠD_Πβ_REQUIREMENTS_CAPABILITY_AUDIT_READONLY_v1_0.ipynb"
)
NOTEBOOK_SHA256 = "NOT_COMPUTED — notebook bytes unavailable in kernel context"
SOURCE_CODE_SHA256 = "NOT_COMPUTED — source-cell bytes not independently captured"
# Validation-event severities: ERROR invalidates the audit record;
# WARNING is retained and prevents a misleading PASS where specified.
validation_events = []
def add_validation_event(event_type, message, severity="ERROR"):
validation_events.append(
{
"event_type": str(event_type),
"severity": str(severity),
"message": str(message),
"timestamp_utc": datetime.datetime.now(
datetime.timezone.utc
).isoformat(),
}
)
def authorization_is_complete():
"""Return True only when the explicit authorization record is complete."""
return bool(
EXECUTION_AUTHORIZED is True
and isinstance(AUTHORIZATION_REFERENCE, str)
and AUTHORIZATION_REFERENCE.strip()
and isinstance(AUTHORIZATION_TIMESTAMP_UTC, str)
and AUTHORIZATION_TIMESTAMP_UTC.strip()
)
if EXECUTION_AUTHORIZED and not authorization_is_complete():
add_validation_event(
"INCOMPLETE_AUTHORIZATION_RECORD",
"EXECUTION_AUTHORIZED is True but authorization reference and/or timestamp is missing.",
"ERROR",
)
if not EXECUTION_AUTHORIZED and (
AUTHORIZATION_REFERENCE is not None or AUTHORIZATION_TIMESTAMP_UTC is not None
):
add_validation_event(
"AUTHORIZATION_METADATA_WITHOUT_AUTHORIZATION",
"Authorization metadata was supplied while EXECUTION_AUTHORIZED is False.",
"WARNING",
)
# ------------------------------------------------------------
# 1. AUTHORITATIVE FRCMΠD REQUIREMENTS
# ------------------------------------------------------------
# These are the framework meanings carried forward from the handoff.
# They are not replaced by the narrower synthetic test definitions.
requirement_definitions = {
"R1": {
"authoritative_requirement": (
"Πβ is an emergent structural expression of Π, not a separate substance. "
"A mathematical state variable may represent Πβ without determining its ontology. "
"The relationship between provisional representations (P) and (b) remains unresolved."
),
"synthetic_test_operationalization": (
"Demonstrate that a nonlinear matrix-valued map can distinguish equal-trace "
"inputs and can produce a nonzero output for one selected zero-trace input."
),
"acceptance_criterion": (
"For the specified synthetic witness: equal traces, different mapped outputs, "
"a nonzero nonlinearity residual, and a nonzero mapped output for the selected "
"zero-trace input. Also verify the zero matrix maps to zero for this example."
),
"limitation": (
"The synthetic map is not asserted to be Πβ and does not establish the ontology "
"or a universal statement about all zero-trace inputs."
),
},
"R2": {
"authoritative_requirement": (
"Πβ is described as a linear soliton pattern/channel. The exact mathematical "
"object and meaning of linearity remain open. Linearity of a channel does not "
"impose linearity on the complete coupling."
),
"synthetic_test_operationalization": (
"Demonstrate a linear map L(x)=2x participating in a nonlinear composite "
"g(L(x)) with g(c)=c²."
),
"acceptance_criterion": (
"State additivity and homogeneity identities for L, check them numerically "
"at the selected inputs, and demonstrate that the chosen nonlinear composite "
"is not additive for the selected witness."
),
"limitation": (
"This scalar example does not identify the actual Πβ channel, its domain, "
"codomain, information-preservation properties, or role in the full coupling."
),
},
"R3": {
"authoritative_requirement": (
"Πβ is proposed as a full structural pattern, not merely a trace or scalar "
"contraction. Candidate representations must be assessed for information retained and lost."
),
"synthetic_test_operationalization": (
"Compare the identity map on matrices with the scalar trace map using two "
"distinct matrices having equal traces."
),
"acceptance_criterion": (
"The identity map must distinguish the selected matrices while the trace map "
"returns the same scalar for them."
),
"limitation": (
"This demonstrates a possible information-retention distinction; it does not "
"establish the actual Πβ representation or its complete information content."
),
},
"R4": {
"authoritative_requirement": (
"Πβ carries sequence and proposed emergent time. Distinguish a single state, "
"an ordered trajectory, history, and retained memory. A sequence index is not "
"automatically physical or emergent time."
),
"synthetic_test_operationalization": (
"Construct two finite histories with the same present state and different "
"previous states, then compare a present-only transition with a history-sensitive transition."
),
"acceptance_criterion": (
"The present-only transition must give the same output for the common present "
"state; the history-sensitive transition must give different next-state outputs."
),
"limitation": (
"This is a synthetic prior-state-dependent sequence transition. It does not "
"establish that memory is necessary, that an additional memory variable is required, "
"or that the sequence index is emergent physical time."
),
},
"R5": {
"authoritative_requirement": (
"Lag is proposed as a structural property of reciprocal response, not merely "
"a static mismatch or an equation selected to create delay. The proposition "
"that mass is lag remains a hypothesis."
),
"synthetic_test_operationalization": (
"Demonstrate a one-index delayed output sequence generated from a step input."
),
"acceptance_criterion": (
"Verify the initial output, every shift relation y[n]=u[n-1] for n≥1, "
"one rising transition in each sequence, and the one-index transition offset."
),
"limitation": (
"This demonstrates a synthetic discrete delay only. It does not establish "
"intrinsic physical lag, mass, or an FRCMΠD response mechanism."
),
},
"R6": {
"authoritative_requirement": (
"Π responds to Πβ and Πβ responds to Π. Distinguish mutual constitution, "
"mutual structural dependence, mutual responsiveness, and coupled evolution. "
"Two local cross-sensitivities alone do not establish complete reciprocal feedback."
),
"synthetic_test_operationalization": (
"Use scalar stand-ins to demonstrate nonzero local cross-sensitivities in both "
"directions and contrast them with a one-way control."
),
"acceptance_criterion": (
"Numerical finite-difference sensitivities must agree with the exact analytical "
"derivatives for the two-way example, while the one-way control has zero reverse sensitivity."
),
"limitation": (
"The example uses scalar stand-ins and local sensitivities. It does not establish "
"matrix-valued reciprocity, full feedback, mutual constitution, or coupled evolution."
),
},
}
# ------------------------------------------------------------
# 2. PRE-REGISTERED SYNTHETIC TEST SPECIFICATIONS
# ------------------------------------------------------------
# expected_outcome is explicitly descriptive. The actual test checks below
# are evaluated by the registered functions; this script does not claim a
# separate independent implementation of every test.
test_registry = [
{
"test_id": "R1_test",
"requirement": "R1",
"test_name": "Nonlinear matrix map not reducible to trace",
"assumptions": "A matrix-valued nonlinear map is used as a synthetic witness.",
"inputs": "P_a, P_b (equal trace), P_zero_trace, zero matrix",
"expected_outcome": "Equal traces, distinguishable nonlinear outputs; selected zero-trace input maps nonzero; zero matrix maps to zero.",
"expected_outcome_status": "DESCRIPTIVE_EXPECTATION — evaluated by registered R1 checks",
"limitation": requirement_definitions["R1"]["limitation"],
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None,
},
{
"test_id": "R2_test",
"requirement": "R2",
"test_name": "Linear channel participating in nonlinear composite",
"assumptions": "L(x)=2x; g(c)=c²; g(L(x))=4x².",
"inputs": "x1=3, x2=5, a=2.5",
"expected_outcome": "L is linear; g and the selected composite witness are nonlinear.",
"expected_outcome_status": "DESCRIPTIVE_EXPECTATION — evaluated by registered R2 checks",
"limitation": requirement_definitions["R2"]["limitation"],
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None,
},
{
"test_id": "R3_test",
"requirement": "R3",
"test_name": "Matrix representation preserves distinctions collapsed by trace",
"assumptions": "R_full(X)=X and R_trace(X)=tr(X) are synthetic candidate readings.",
"inputs": "X1, X2 (equal trace, different matrix entries)",
"expected_outcome": "Full matrix representation distinguishes; trace representation collapses.",
"expected_outcome_status": "DESCRIPTIVE_EXPECTATION — evaluated by registered R3 checks",
"limitation": requirement_definitions["R3"]["limitation"],
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None,
},
{
"test_id": "R4_test",
"requirement": "R4",
"test_name": "Prior-state-dependent sequence transition",
"assumptions": "Two explicit finite histories share the same present state but have different prior states.",
"inputs": "history_1=[0.5, 1.0], history_2=[-0.5, 1.0]",
"expected_outcome": "Same current state, different next states under the history-sensitive map.",
"expected_outcome_status": "DESCRIPTIVE_EXPECTATION — evaluated by registered R4 checks",
"limitation": requirement_definitions["R4"]["limitation"],
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None,
},
{
"test_id": "R5_test",
"requirement": "R5",
"test_name": "One-index delayed dependence demonstrated synthetically",
"assumptions": "Discrete sequence shift with initial output zero.",
"inputs": "u=[0, 0, 1, 1, 1]",
"expected_outcome": "The output transition occurs one index after the input transition.",
"expected_outcome_status": "DESCRIPTIVE_EXPECTATION — evaluated by registered R5 checks",
"limitation": requirement_definitions["R5"]["limitation"],
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None,
},
{
"test_id": "R6_test",
"requirement": "R6",
"test_name": "Two-way local cross-sensitivity versus one-way control",
"assumptions": "P and b are scalar stand-ins; analytical derivatives are checked against finite differences.",
"inputs": "P0=1.0, b0=2.0, epsilon=1e-8",
"expected_outcome": "Two nonzero cross-sensitivities and zero reverse sensitivity in one-way control.",
"expected_outcome_status": "DESCRIPTIVE_EXPECTATION — evaluated by registered R6 checks",
"limitation": requirement_definitions["R6"]["limitation"],
"target_capability_level": "Synthetic specification",
"execution_status": "NOT_RUN",
"capability_result": "UNRESOLVED",
"capability_level": "[UNRESOLVED]",
"invocation_count": 0,
"result": "Test not yet executed.",
"exception_diagnostic": None,
},
]
TEST_TO_REQUIREMENT = {
"R1_test": "R1",
"R2_test": "R2",
"R3_test": "R3",
"R4_test": "R4",
"R5_test": "R5",
"R6_test": "R6",
}
# ------------------------------------------------------------
# 3. MATHEMATICAL HELPERS AND TEST FUNCTIONS
# ------------------------------------------------------------
def max_abs(M):
if M.rows == 0 or M.cols == 0:
return mp.mpf("0")
return max(abs(M[i, j]) for i in range(M.rows) for j in range(M.cols))
def matrix_trace(M):
return sum(M[i, i] for i in range(min(M.rows, M.cols)))
def test_R1():
def Phi(P):
return P * P + P.T
P_a = mp.matrix([[1, 2], [3, 4]])
P_b = mp.matrix([[1, -2], [-3, 4]])
P_zero_trace = mp.matrix([[1, 2], [3, -1]])
P_zero = mp.zeros(2, 2)
phi_a = Phi(P_a)
phi_b = Phi(P_b)
phi_zt = Phi(P_zero_trace)
phi_zero = Phi(P_zero)
same_trace = abs(matrix_trace(P_a) - matrix_trace(P_b)) < TOL
different_phi = max_abs(phi_a - phi_b) > TOL
nonlinearity_residual = max_abs(Phi(P_a + P_a) - 2 * Phi(P_a))
selected_zero_trace_nonzero = max_abs(phi_zt) > TOL
zero_matrix_bound = max_abs(phi_zero) == 0
success = bool(
same_trace
and different_phi
and nonlinearity_residual > TOL
and selected_zero_trace_nonzero
and zero_matrix_bound
)
result = (
f"tr(P_a)={mp.nstr(matrix_trace(P_a), 8)}, "
f"tr(P_b)={mp.nstr(matrix_trace(P_b), 8)}; "
f"same_trace={same_trace}; different_phi={different_phi}; "
f"nonlinearity_residual={mp.nstr(nonlinearity_residual, 8)}; "
f"selected_zero_trace_nonzero={selected_zero_trace_nonzero}; "
f"zero_matrix_maps_to_zero={zero_matrix_bound}"
)
return success, result
def test_R2():
def L(x):
return mp.mpf("2") * x
def g(c):
return c * c
def total(x):
return g(L(x))
x1 = mp.mpf("3")
x2 = mp.mpf("5")
a = mp.mpf("2.5")
# General algebraic identities from the definition L(x)=2x:
# L(x1+x2)=2(x1+x2)=2x1+2x2=L(x1)+L(x2).
# L(a*x1)=2*a*x1=a*(2*x1)=a*L(x1).
# These symbolic identities establish linearity for arbitrary real inputs;
# the following residuals are numerical checks at the registered witness.
additivity_residual = abs(L(x1 + x2) - L(x1) - L(x2))
homogeneity_residual = abs(L(a * x1) - a * L(x1))
linearity_numeric_check = (
additivity_residual <= TOL and homogeneity_residual <= TOL
)
g_nonlinearity_residual = abs(g(mp.mpf("2")) + g(mp.mpf("3")) - g(mp.mpf("5")))
composite_additivity_residual = abs(
total(x1 + x2) - total(x1) - total(x2)
)
composite_nonlinear = composite_additivity_residual > TOL
zero_boundary = L(mp.mpf("0")) == 0
success = bool(
linearity_numeric_check
and g_nonlinearity_residual > TOL
and composite_nonlinear
and zero_boundary
)
result = (
"General proof: L(x1+x2)=L(x1)+L(x2); L(a*x)=a*L(x). "
f"Numerical additivity residual={mp.nstr(additivity_residual, 8)}; "
f"homogeneity residual={mp.nstr(homogeneity_residual, 8)}; "
f"g nonlinearity residual={mp.nstr(g_nonlinearity_residual, 8)}; "
f"composite additivity residual={mp.nstr(composite_additivity_residual, 8)}; "
f"L(0)=0: {zero_boundary}"
)
return success, result
def test_R3():
X1 = mp.matrix([[1, 2], [3, 4]])
X2 = mp.matrix([[1, -2], [-3, 4]])
same_trace = abs(matrix_trace(X1) - matrix_trace(X2)) < TOL
full_matrix_distinguishes = max_abs(X1 - X2) > TOL
trace_collapses = same_trace
success = bool(same_trace and full_matrix_distinguishes and trace_collapses)
result = (
f"same_trace={same_trace}; "
f"full_matrix_distinguishes={full_matrix_distinguishes}; "
f"trace_collapses={trace_collapses}; "
f"max_matrix_difference={mp.nstr(max_abs(X1-X2), 8)}"
)
return success, result
def test_R4():
history_1 = [mp.mpf("0.5"), mp.mpf("1.0")]
history_2 = [mp.mpf("-0.5"), mp.mpf("1.0")]
def present_only(x):
return x
def history_sensitive(x, previous):
return x + mp.mpf("0.5") * previous
present_1 = history_1[-1]
present_2 = history_2[-1]
present_same = abs(present_1 - present_2) < TOL
present_only_1 = present_only(present_1)
present_only_2 = present_only(present_2)
present_only_same = abs(present_only_1 - present_only_2) < TOL
next_1 = history_sensitive(history_1[-1], history_1[-2])
next_2 = history_sensitive(history_2[-1], history_2[-2])
history_difference = abs(next_1 - next_2)
extended_1 = history_1 + [next_1]
extended_2 = history_2 + [next_2]
success = bool(
present_same
and present_only_same
and history_difference > TOL
)
result = (
f"history_1={history_1}; history_2={history_2}; "
f"common_present={mp.nstr(present_1, 8)}; "
f"next_1={mp.nstr(next_1, 8)}; next_2={mp.nstr(next_2, 8)}; "
f"extended_1={extended_1}; extended_2={extended_2}; "
f"present_only_same={present_only_same}; "
f"history_sensitive_difference={mp.nstr(history_difference, 8)}"
)
return success, result
def _rising_transition_indices(sequence):
return [
i for i in range(1, len(sequence))
if sequence[i - 1] == 0 and sequence[i] == 1
]
def test_R5():
u = [mp.mpf("0"), mp.mpf("0"), mp.mpf("1"), mp.mpf("1"), mp.mpf("1")]
y = [mp.mpf("0")] + u[:-1]
initial_condition_ok = (y[0] == 0)
shift_relation_ok = (
len(y) == len(u)
and all(y[n] == u[n - 1] for n in range(1, len(y)))
)
input_transitions = _rising_transition_indices(u)
output_transitions = _rising_transition_indices(y)
unique_input_transition = len(input_transitions) == 1
unique_output_transition = len(output_transitions) == 1
if unique_input_transition and unique_output_transition:
input_transition = input_transitions[0]
output_transition = output_transitions[0]
one_index_delay = output_transition == input_transition + 1
else:
input_transition = None
output_transition = None
one_index_delay = False
success = bool(
initial_condition_ok
and shift_relation_ok
and unique_input_transition
and unique_output_transition
and one_index_delay
)
result = (
f"input={u}; output={y}; initial_condition_ok={initial_condition_ok}; "
f"complete_shift_relation_ok={shift_relation_ok}; "
f"input_transition_indices={input_transitions}; "
f"output_transition_indices={output_transitions}; "
f"one_index_delay={one_index_delay}"
)
return success, result
def test_R6():
def f_P(P, b):
return P + mp.mpf("0.5") * b
def g_b(b, P):
return b + mp.mpf("0.7") * P
def g_one_way(b, P):
return b
P0 = mp.mpf("1.0")
b0 = mp.mpf("2.0")
eps = R6_EPSILON
# Exact analytical derivatives for the specified affine functions.
expected_dP_db = mp.mpf("0.5")
expected_db_dP = mp.mpf("0.7")
expected_one_way_reverse = mp.mpf("0")
numerical_dP_db = (f_P(P0, b0 + eps) - f_P(P0, b0)) / eps
numerical_db_dP = (g_b(b0, P0 + eps) - g_b(b0, P0)) / eps
numerical_one_way_reverse = (
g_one_way(b0, P0 + eps) - g_one_way(b0, P0)
) / eps
derivative_tol = TOL
first_derivative_matches = abs(numerical_dP_db - expected_dP_db) <= derivative_tol
second_derivative_matches = abs(numerical_db_dP - expected_db_dP) <= derivative_tol
one_way_matches = abs(
numerical_one_way_reverse - expected_one_way_reverse
) <= derivative_tol
both_nonzero = abs(numerical_dP_db) > TOL and abs(numerical_db_dP) > TOL
success = bool(
first_derivative_matches
and second_derivative_matches
and one_way_matches
and both_nonzero
)
result = (
f"dP/db numerical={mp.nstr(numerical_dP_db, 12)}; "
f"analytic={mp.nstr(expected_dP_db, 12)}; "
f"match={first_derivative_matches}; "
f"db/dP numerical={mp.nstr(numerical_db_dP, 12)}; "
f"analytic={mp.nstr(expected_db_dP, 12)}; "
f"match={second_derivative_matches}; "
f"one-way reverse numerical={mp.nstr(numerical_one_way_reverse, 12)}; "
f"expected_zero={one_way_matches}; epsilon={mp.nstr(eps, 8)}"
)
return success, result
TEST_FUNCTIONS = {
"R1_test": test_R1,
"R2_test": test_R2,
"R3_test": test_R3,
"R4_test": test_R4,
"R5_test": test_R5,
"R6_test": test_R6,
}
# ------------------------------------------------------------
# 4. TEST RUNNER — AUTHORIZATION AND FIXED FUNCTION BINDING
# ------------------------------------------------------------
def run_test(test_id):
if not authorization_is_complete():
add_validation_event(
"UNAUTHORIZED_TEST_INVOCATION",
f"Attempted to invoke {test_id} without a complete authorization record.",
"WARNING",
)
print(f"[BLOCKED] {test_id}: execution authorization is absent or incomplete.")
return
record = next((r for r in test_registry if r["test_id"] == test_id), None)
if record is None:
add_validation_event(
"UNREGISTERED_TEST_ID",
f"Unregistered test ID invoked: {test_id}",
"ERROR",
)
print(f"[ERROR] Unregistered test ID {test_id}; execution skipped.")
return
expected_requirement = TEST_TO_REQUIREMENT.get(test_id)
if expected_requirement != record["requirement"]:
add_validation_event(
"TEST_REQUIREMENT_MAPPING_MISMATCH",
f"{test_id} maps to {expected_requirement}, but registry says {record['requirement']}.",
"ERROR",
)
print(f"[ERROR] Requirement mapping mismatch for {test_id}; execution skipped.")
return
if record["invocation_count"] >= 1:
add_validation_event(
"DUPLICATE_TEST_INVOCATION",
f"Duplicate invocation refused for {test_id}; original result preserved.",
"ERROR",
)
print(f"[ERROR] Duplicate invocation of {test_id}; original record preserved.")
return
test_func = TEST_FUNCTIONS.get(test_id)
if test_func is None:
add_validation_event(
"REGISTERED_FUNCTION_MISSING",
f"No bound test function exists for registered ID {test_id}.",
"ERROR",
)
print(f"[ERROR] No bound function for {test_id}; execution skipped.")
return
record["invocation_count"] = 1
print(f"\n[{record['requirement']} | {record['test_name']}]")
print(f" Assumptions: {record['assumptions']}")
print(f" Inputs: {record['inputs']}")
try:
success, result_text = test_func()
if type(success) is not bool:
raise TypeError(
f"Test function must return bool success; received {type(success).__name__}."
)
if not isinstance(result_text, str):
raise TypeError("Test function result description must be a string.")
record["execution_status"] = "COMPLETED"
if success:
record["capability_result"] = "DEMONSTRATED"
record["capability_level"] = record["target_capability_level"]
else:
record["capability_result"] = "NOT_DEMONSTRATED"
record["capability_level"] = "[UNRESOLVED]"
record["result"] = result_text
record["exception_diagnostic"] = None
except Exception:
record["execution_status"] = "ERROR"
record["capability_result"] = "UNRESOLVED"
record["capability_level"] = "[UNRESOLVED]"
record["result"] = "Execution error; see exception diagnostic."
record["exception_diagnostic"] = traceback.format_exc()
print(f" Execution: {record['execution_status']}")
print(f" Result: {record['capability_result']}")
print(f" Level: {record['capability_level']}")
print(f" Detail: {record['result']}")
if record["exception_diagnostic"]:
print(record["exception_diagnostic"])
# ------------------------------------------------------------
# 5. INVOKE TESTS ONLY WHEN AUTHORIZATION IS COMPLETE
# ------------------------------------------------------------
print("=" * 78)
print("FRCMΠD — Πβ REQUIREMENTS CAPABILITY AUDIT (READ-ONLY) v1.0")
print(f"DRAFT REVISION: {DRAFT_REVISION} (previous: {PREVIOUS_DRAFT})")
print(f"RUN ID: {RUN_ID}")
print(f"RUN TIMESTAMP UTC: {RUN_TIMESTAMP_UTC}")
print(f"EXECUTION AUTHORIZED: {EXECUTION_AUTHORIZED}")
print("=" * 78)
if authorization_is_complete():
print("\n[AUTHORIZED] Running registered synthetic tests.")
for registered_test_id in TEST_TO_REQUIREMENT:
run_test(registered_test_id)
else:
print("\n[NOTICE] Tests remain NOT_RUN — execution authorization is not complete.")
# ------------------------------------------------------------
# 6. VALIDATE TEST REGISTRY AND COMPUTE SYNTHETIC VERDICT
# ------------------------------------------------------------
VALID_EXECUTION_STATUSES = {"COMPLETED", "ERROR", "NOT_RUN"}
VALID_CAPABILITY_RESULTS = {"DEMONSTRATED", "NOT_DEMONSTRATED", "UNRESOLVED"}
VALID_CAPABILITY_LEVELS = {
"Accommodation",
"Synthetic specification",
"FRCMΠD specification",
"Establishment",
"[UNRESOLVED]",
}
ALLOWED_STATUS_COMBINATIONS = {
("NOT_RUN", "UNRESOLVED", "[UNRESOLVED]"),
("ERROR", "UNRESOLVED", "[UNRESOLVED]"),
("COMPLETED", "UNRESOLVED", "[UNRESOLVED]"),
("COMPLETED", "NOT_DEMONSTRATED", "[UNRESOLVED]"),
("COMPLETED", "DEMONSTRATED", "Synthetic specification"),
}
validation_errors = [
event["message"]
for event in validation_events
if event["severity"] == "ERROR"
]
seen_test_ids = set()
for record in test_registry:
test_id = record["test_id"]
if test_id in seen_test_ids:
validation_errors.append(f"Duplicate registry test ID: {test_id}")
seen_test_ids.add(test_id)
if test_id not in TEST_TO_REQUIREMENT:
validation_errors.append(f"Unexpected registry test ID: {test_id}")
elif TEST_TO_REQUIREMENT[test_id] != record["requirement"]:
validation_errors.append(
f"{test_id}: expected requirement {TEST_TO_REQUIREMENT[test_id]}, "
f"found {record['requirement']}."
)
if record["execution_status"] not in VALID_EXECUTION_STATUSES:
validation_errors.append(f"{test_id}: invalid execution status.")
if record["capability_result"] not in VALID_CAPABILITY_RESULTS:
validation_errors.append(f"{test_id}: invalid capability result.")
if record["capability_level"] not in VALID_CAPABILITY_LEVELS:
validation_errors.append(f"{test_id}: invalid capability level.")
combination = (
record["execution_status"],
record["capability_result"],
record["capability_level"],
)
if combination not in ALLOWED_STATUS_COMBINATIONS:
validation_errors.append(f"{test_id}: contradictory status combination {combination}.")
count = record["invocation_count"]
if count == 0 and record["execution_status"] != "NOT_RUN":
validation_errors.append(f"{test_id}: invocation_count=0 but status is not NOT_RUN.")
elif count == 1 and record["execution_status"] == "NOT_RUN":
validation_errors.append(f"{test_id}: invocation_count=1 but status is NOT_RUN.")
elif count not in (0, 1):
validation_errors.append(f"{test_id}: invalid invocation_count {count}.")
expected_test_ids = set(TEST_TO_REQUIREMENT)
actual_test_ids = {r["test_id"] for r in test_registry}
for missing_id in sorted(expected_test_ids - actual_test_ids):
validation_errors.append(f"Missing expected test ID: {missing_id}")
for unexpected_id in sorted(actual_test_ids - expected_test_ids):
validation_errors.append(f"Unexpected test ID: {unexpected_id}")
# Requirement-level aggregation over all expected tests for each requirement.
aggregate_results = {}
for requirement in requirement_definitions:
requirement_records = [
r for r in test_registry if r["requirement"] == requirement
]
if not requirement_records:
accommodation = "UNRESOLVED"
synthetic_specification = "UNRESOLVED"
elif all(r["capability_result"] == "DEMONSTRATED" for r in requirement_records):
accommodation = "DEMONSTRATED"
synthetic_specification = "DEMONSTRATED"
elif any(
r["execution_status"] in {"ERROR", "NOT_RUN"}
or r["capability_result"] == "UNRESOLVED"
for r in requirement_records
):
accommodation = "UNRESOLVED"
synthetic_specification = "UNRESOLVED"
elif any(r["capability_result"] == "NOT_DEMONSTRATED" for r in requirement_records):
accommodation = "UNRESOLVED"
synthetic_specification = "NOT_DEMONSTRATED"
else:
accommodation = "UNRESOLVED"
synthetic_specification = "UNRESOLVED"
aggregate_results[requirement] = {
"accommodation": accommodation,
"synthetic_specification": synthetic_specification,
"frcmd_specification": "[UNRESOLVED]",
"establishment": "[UNRESOLVED]",
}
if validation_errors:
synthetic_status = "FAILURE — INVALID AUDIT RECORD"
elif any(e["event_type"] == "UNAUTHORIZED_TEST_INVOCATION" for e in validation_events):
synthetic_status = "NOT_RUN — UNAUTHORIZED INVOCATION ATTEMPT RECORDED"
elif any(r["execution_status"] == "ERROR" for r in test_registry):
synthetic_status = "INCOMPLETE — TEST EXECUTION ERRORS"
elif any(r["execution_status"] == "NOT_RUN" for r in test_registry):
synthetic_status = "NOT_RUN — EXECUTION NOT AUTHORIZED OR INCOMPLETE"
elif any(r["capability_result"] == "UNRESOLVED" for r in test_registry):
synthetic_status = "INCOMPLETE — UNRESOLVED TESTS PRESENT"
elif any(r["capability_result"] == "NOT_DEMONSTRATED" for r in test_registry):
synthetic_status = "FAILURE — DEMONSTRATION FAILED"
else:
synthetic_status = (
"PASS — SYNTHETIC SPECIFICATIONS DEMONSTRATED; "
"FRCMΠD REQUIREMENTS NOT ESTABLISHED"
)
print("\n" + "=" * 78)
print("SYNTHETIC TEST AGGREGATE")
print("=" * 78)
print(f"{'REQ':<6} {'TEST ID':<12} {'EXECUTION':<12} {'RESULT':<20} {'LEVEL'}")
for record in test_registry:
print(
f"{record['requirement']:<6} {record['test_id']:<12} "
f"{record['execution_status']:<12} "
f"{record['capability_result']:<20} {record['capability_level']}"
)
print("\nValidation errors:", validation_errors)
print("Synthetic test suite status:", synthetic_status)
# ------------------------------------------------------------
# 7. SOURCE INVENTORY AND REQUIREMENT-LEVEL COMPARISON
# ------------------------------------------------------------
# Provenance note: the original candidate notebooks have not been supplied
# as source bytes in this review context. The source descriptions below are
# carried forward as reported DeepSeek inspection findings, not as independent
# ChatGPT source inspection.
source_inventory = [
{
"source_record_id": "SRC_CFS",
"candidate_id": "CFS",
"candidate": "Coordinate-Free Successor C(P,G,Σ)",
"source_filename": "FINITE_RESPONSE_COUPLED_MONAD_Π_DYNAMICS_COORDINATE-FREE_SUCCESSOR_MODEL.ipynb",
"reported_location": "C_candidate function (reported Cell 8 source block)",
"reported_dependencies": ["G_adjoint", "g_gate", "phi_y_scalar", "mpmath matrix operations"],
"reported_inspection_scope": "Bounded function inspection; whole notebook not inspected.",
"reported_dependency_audit_status": "PARTIAL",
"reported_evidence": "D_G=[J_G,P], J_G=Σ+g(I_1)(P-P_G^†).",
"source_report_provenance": "DeepSeek-reported inspection; not independently authenticated here.",
"independent_source_inspection_status": "SOURCE_NOT_INSPECTED",
"notebook_sha256": "NOT_COMPUTED",
"cell_source_sha256": "NOT_COMPUTED",
"hidden_grid_status": "SOURCE_NOT_INSPECTED",
},
{
"source_record_id": "SRC_JIC",
"candidate_id": "JIC",
"candidate": "2D Joint-Invariant Coupling C̃=tr(bB_G)B_G",
"source_filename": "FRCMΠD — EXPERIMENTAL TEST: 2D JOINT-INVARIANT COUPLING.ipynb",
"reported_location": "C_tilde function (reported Cell 1 source block)",
"reported_dependencies": ["matrix_trace", "mpmath matrix operations"],
"reported_inspection_scope": "Bounded function inspection; whole notebook not inspected.",
"reported_dependency_audit_status": "REPORTED_SELF_CONTAINED_NOT_INDEPENDENTLY_VERIFIED",
"reported_evidence": "C_tilde(b,B_G)=tr(bB_G)B_G; Stage 1 report gives map rank 1, kernel dimension 3, and matrix rank(B_G)=2 in the stated test geometry.",
"source_report_provenance": "Prior reported mathematical/source findings; original notebook not independently authenticated here.",
"independent_source_inspection_status": "SOURCE_NOT_INSPECTED",
"notebook_sha256": "NOT_COMPUTED",
"cell_source_sha256": "NOT_COMPUTED",
"hidden_grid_status": "NOT_APPLICABLE_TO_REPORTED_STATIC_EXPRESSION; NOTEBOOK NOT INSPECTED",
},
]
requirement_inventory = [
# Coordinate-Free Successor
{
"source_record_id": "SRC_CFS", "candidate_id": "CFS", "candidate": "Coordinate-Free Successor", "requirement": "R1",
"reported_evidence": "No explicit b object or P→b mapping in the reported C_candidate scope.",
"mathematical_finding": "The reported bounded assembly does not explicitly specify the b object or P-to-b mapping.",
"reported_assessment": "NOT_PRESENT_IN_INSPECTED_SCOPE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Reported bounded-function finding only; original source bytes and complete notebook not independently inspected.",
},
{
"source_record_id": "SRC_CFS", "candidate_id": "CFS", "candidate": "Coordinate-Free Successor", "requirement": "R2",
"reported_evidence": "D_G=[Σ,P]+g(I_1)[P-P_G^†,P].",
"mathematical_finding": "With G and Σ fixed, [Σ,P] is linear in P; the second term is generally nonlinear. This additive decomposition alone does not establish a linear channel feeding a nonlinear coupling.",
"reported_assessment": "PARTIAL_ANALOGUE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Linear summand's functional channel role and Πβ identity are unproven; source report not independently authenticated.",
},
{
"source_record_id": "SRC_CFS", "candidate_id": "CFS", "candidate": "Coordinate-Free Successor", "requirement": "R3",
"reported_evidence": "A matrix-valued output is reported.",
"mathematical_finding": "Matrix-valued output is not by itself evidence that the full Πβ structural pattern is represented.",
"reported_assessment": "CORRESPONDENCE_UNRESOLVED",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Information retention and loss for the complete structural pattern have not been established.",
},
{
"source_record_id": "SRC_CFS", "candidate_id": "CFS", "candidate": "Coordinate-Free Successor", "requirement": "R4",
"reported_evidence": "No sequence index identified in the reported C_candidate scope.",
"mathematical_finding": "No sequence transition is specified in the reported bounded assembly.",
"reported_assessment": "NOT_PRESENT_IN_INSPECTED_SCOPE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Absence is limited to the reported function, not the whole notebook or possible extensions.",
},
{
"source_record_id": "SRC_CFS", "candidate_id": "CFS", "candidate": "Coordinate-Free Successor", "requirement": "R5",
"reported_evidence": "No delayed response identified in the reported C_candidate scope.",
"mathematical_finding": "No delayed response is specified in the reported bounded assembly.",
"reported_assessment": "NOT_PRESENT_IN_INSPECTED_SCOPE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Absence is limited to the reported function, not the whole notebook or possible extensions.",
},
{
"source_record_id": "SRC_CFS", "candidate_id": "CFS", "candidate": "Coordinate-Free Successor", "requirement": "R6",
"reported_evidence": "No reciprocal P,b update rule identified in the reported C_candidate scope.",
"mathematical_finding": "No reciprocal update is specified in the reported bounded assembly.",
"reported_assessment": "NOT_PRESENT_IN_INSPECTED_SCOPE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Absence is limited to the reported function, not the whole notebook or possible extensions.",
},
# 2D Joint-Invariant Coupling
{
"source_record_id": "SRC_JIC", "candidate_id": "JIC", "candidate": "2D Joint-Invariant Coupling", "requirement": "R1",
"reported_evidence": "No explicit Πβ object identified in the reported C_tilde function.",
"mathematical_finding": "The reported expression is a candidate map, not an identified Πβ object.",
"reported_assessment": "NOT_PRESENT_IN_INSPECTED_SCOPE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Original function source not independently inspected.",
},
{
"source_record_id": "SRC_JIC", "candidate_id": "JIC", "candidate": "2D Joint-Invariant Coupling", "requirement": "R2",
"reported_evidence": "For fixed nonzero B_G, b↦tr(bB_G)B_G is linear in b, with one-dimensional image and three-dimensional kernel in the 2×2 input-matrix space.",
"mathematical_finding": "The map is linear in b for fixed B_G but compresses b to a scalar amplitude along B_G.",
"reported_assessment": "PARTIAL_ANALOGUE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Map rank is not the matrix rank of B_G; no Πβ channel identity is established.",
},
{
"source_record_id": "SRC_JIC", "candidate_id": "JIC", "candidate": "2D Joint-Invariant Coupling", "requirement": "R3",
"reported_evidence": "The reported map discards the G-self-adjoint component of b.",
"mathematical_finding": "The reported expression does not preserve the full b input structure; its dependence is compressed to one scalar amplitude.",
"reported_assessment": "PARTIAL_ANALOGUE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Finding is based on the reported expression and Stage 1 results, not direct source inspection here.",
},
{
"source_record_id": "SRC_JIC", "candidate_id": "JIC", "candidate": "2D Joint-Invariant Coupling", "requirement": "R4",
"reported_evidence": "The reported C_tilde expression is static.",
"mathematical_finding": "No sequence is specified in the expression as reported.",
"reported_assessment": "NOT_PRESENT_IN_INSPECTED_SCOPE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Applies only to the reported expression, not hypothetical extensions.",
},
{
"source_record_id": "SRC_JIC", "candidate_id": "JIC", "candidate": "2D Joint-Invariant Coupling", "requirement": "R5",
"reported_evidence": "No delay is specified in the reported static expression.",
"mathematical_finding": "No delayed response is specified in the expression as reported.",
"reported_assessment": "NOT_PRESENT_IN_INSPECTED_SCOPE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Applies only to the reported expression, not hypothetical extensions.",
},
{
"source_record_id": "SRC_JIC", "candidate_id": "JIC", "candidate": "2D Joint-Invariant Coupling", "requirement": "R6",
"reported_evidence": "No reciprocal update law is specified in the reported expression.",
"mathematical_finding": "No reciprocal update is specified in the expression as reported.",
"reported_assessment": "NOT_PRESENT_IN_INSPECTED_SCOPE",
"independent_source_assessment": "SOURCE_NOT_INSPECTED",
"pib_correspondence": "CORRESPONDENCE_UNRESOLVED",
"limitation": "Applies only to the reported expression, not hypothetical extensions.",
},
]
# ------------------------------------------------------------
# 8. VALIDATE SOURCE AND REQUIREMENT INVENTORIES
# ------------------------------------------------------------
VALID_ASSESSMENTS = {
"PRESENT_AS_WRITTEN",
"PARTIAL_ANALOGUE",
"NOT_PRESENT_IN_INSPECTED_SCOPE",
"CORRESPONDENCE_UNRESOLVED",
"SOURCE_NOT_INSPECTED",
}
VALID_CORRESPONDENCE = {
"CORRESPONDENCE_UNRESOLVED",
"SOURCE_NOT_INSPECTED",
"PRESENT_AS_WRITTEN",
}
VALID_DEPENDENCY_STATUS = {
"COMPLETE",
"PARTIAL",
"NOT_INSPECTED",
"REPORTED_SELF_CONTAINED_NOT_INDEPENDENTLY_VERIFIED",
}
source_validation_errors = []
source_ids = [s["source_record_id"] for s in source_inventory]
if len(source_ids) != len(set(source_ids)):
source_validation_errors.append("Duplicate source_record_id detected.")
if set(source_ids) != {"SRC_CFS", "SRC_JIC"}:
source_validation_errors.append("Source inventory does not contain exactly the two expected candidates.")
source_id_set = set(source_ids)
for source_record in source_inventory:
if source_record["reported_dependency_audit_status"] not in VALID_DEPENDENCY_STATUS:
source_validation_errors.append(
f"{source_record['source_record_id']}: invalid dependency audit status."
)
expected_pairs = {
(candidate_id, requirement)
for candidate_id in ("CFS", "JIC")
for requirement in requirement_definitions
}
actual_pairs = [
(r["candidate_id"], r["requirement"])
for r in requirement_inventory
]
if len(actual_pairs) != len(set(actual_pairs)):
source_validation_errors.append("Duplicate candidate/requirement pair in requirement inventory.")
if set(actual_pairs) != expected_pairs:
missing_pairs = expected_pairs - set(actual_pairs)
unexpected_pairs = set(actual_pairs) - expected_pairs
if missing_pairs:
source_validation_errors.append(f"Missing candidate/requirement pairs: {sorted(missing_pairs)}")
if unexpected_pairs:
source_validation_errors.append(f"Unexpected candidate/requirement pairs: {sorted(unexpected_pairs)}")
for item in requirement_inventory:
if item["source_record_id"] not in source_id_set:
source_validation_errors.append(
f"{item['candidate_id']} {item['requirement']}: unknown source_record_id."
)
if item["requirement"] not in requirement_definitions:
source_validation_errors.append(
f"{item['candidate_id']}: invalid requirement {item['requirement']}."
)
if item["reported_assessment"] not in VALID_ASSESSMENTS:
source_validation_errors.append(
f"{item['candidate_id']} {item['requirement']}: invalid reported assessment."
)
if item["independent_source_assessment"] not in VALID_ASSESSMENTS:
source_validation_errors.append(
f"{item['candidate_id']} {item['requirement']}: invalid independent source assessment."
)
if item["pib_correspondence"] not in VALID_CORRESPONDENCE:
source_validation_errors.append(
f"{item['candidate_id']} {item['requirement']}: invalid Πβ correspondence status."
)
all_validation_errors = validation_errors + source_validation_errors
# Source inspection is incomplete because original candidate notebook bytes
# and independently traceable source excerpts are not included in this script.
source_comparison_status = (
"INCOMPLETE — ORIGINAL SOURCE EVIDENCE NOT INDEPENDENTLY AUTHENTICATED"
)
stage_2_status = (
"INCOMPLETE — SOURCE-PROVENANCE COMPARISON REMAINS OPEN"
)
if all_validation_errors:
# A source-inventory defect invalidates the audit record but does not
# retroactively change the mathematical result of an individual test.
audit_record_integrity_status = "INVALID — VALIDATION ERRORS PRESENT"
else:
audit_record_integrity_status = "VALID WITH DECLARED SOURCE LIMITATIONS"
# ------------------------------------------------------------
# 9. PRINT SOURCE COMPARISON AND THREE AUDIT STATUSES
# ------------------------------------------------------------
print("\n" + "=" * 78)
print("REQUIREMENT-LEVEL SOURCE COMPARISON")
print("=" * 78)
for item in requirement_inventory:
print(
f"\n{item['candidate']} | {item['requirement']}\n"
f" Reported assessment: {item['reported_assessment']}\n"
f" Independent source status: {item['independent_source_assessment']}\n"
f" Πβ correspondence: {item['pib_correspondence']}\n"
f" Finding: {item['mathematical_finding']}\n"
f" Limitation: {item['limitation']}"
)
print("\n" + "=" * 78)
print("THREE AUDIT STATUSES")
print("=" * 78)
print(f"1. SYNTHETIC TEST SUITE: {synthetic_status}")
print(f"2. SOURCE COMPARISON: {source_comparison_status}")
print(f"3. STAGE 2 OVERALL: {stage_2_status}")
print(f"AUDIT RECORD INTEGRITY: {audit_record_integrity_status}")
print("=" * 78)
# ------------------------------------------------------------
# 10. AUDIT CLOSURE CHECKLIST — CURRENT EVIDENCE STATE
# ------------------------------------------------------------
closure_checklist = [
{"item": "Authoritative R1-R6 meanings kept separate from synthetic operationalizations.", "status": "DOCUMENTED"},
{"item": "Synthetic R1-R6 tests executed with complete authorization.", "status": "NOT_RUN" if not authorization_is_complete() else "SEE TEST RECORDS"},
{"item": "Expected mathematical outcomes independently recomputed in a separate implementation.", "status": "NOT_PERFORMED"},
{"item": "Original candidate notebook hashes authenticated.", "status": "NOT_VERIFIED"},
{"item": "Candidate dependency closure independently inspected.", "status": "NOT_VERIFIED"},
{"item": "All source findings linked to original source bytes and excerpts.", "status": "NOT_VERIFIED"},
{"item": "Synthetic, source and FRCMΠD establishment verdicts kept separate.", "status": "DOCUMENTED"},
{"item": "Original source notebooks and archived artifacts modified.", "status": "NO — NOT AUTHORIZED"},
]
# ------------------------------------------------------------
# 11. JSON EXPORT — NEW FILE ONLY, WITH EXTERNAL CHECKSUM
# ------------------------------------------------------------
authorization_status = (
"GRANTED_WITH_REFERENCE"
if authorization_is_complete()
else "NOT_GRANTED_OR_INCOMPLETE"
)
script_status = "COMPLETED — REPORT GENERATION REACHED JSON EXPORT"
if not authorization_is_complete():
synthetic_execution_status = "NOT_RUN — EXECUTION NOT AUTHORIZED"
elif all(r["execution_status"] == "COMPLETED" for r in test_registry):
synthetic_execution_status = "ALL_REGISTERED_TESTS_COMPLETED"
else:
synthetic_execution_status = "PARTIAL_OR_FAILED — SEE INDIVIDUAL TEST RECORDS"
audit_record = {
"audit_metadata": {
"audit_version": AUDIT_VERSION,
"draft_revision": DRAFT_REVISION,
"previous_draft": PREVIOUS_DRAFT,
"run_id": RUN_ID,
"script_status": script_status,
"synthetic_execution_status": synthetic_execution_status,
"execution_authorized": EXECUTION_AUTHORIZED,
"authorization_status": authorization_status,
"authorization_reference": AUTHORIZATION_REFERENCE,
"authorization_timestamp_utc": AUTHORIZATION_TIMESTAMP_UTC,
"run_timestamp_utc": RUN_TIMESTAMP_UTC,
"notebook_filename": NOTEBOOK_FILENAME,
"notebook_sha256": NOTEBOOK_SHA256,
"source_code_sha256": SOURCE_CODE_SHA256,
"python_version": PYTHON_VERSION,
"mpmath_version": MPMATH_VERSION,
"platform": platform.platform(),
"architecture": platform.machine(),
"precision_dps": mp.mp.dps,
"tolerance": str(TOL),
"r6_finite_difference_epsilon": str(R6_EPSILON),
},
"authoritative_requirement_definitions": requirement_definitions,
"test_operationalizations_and_records": test_registry,
"test_to_requirement_mapping": TEST_TO_REQUIREMENT,
"validation": {
"test_validation_errors": validation_errors,
"source_inventory_validation_errors": source_validation_errors,
"all_validation_errors": all_validation_errors,
"validation_events": validation_events,
"is_valid": len(all_validation_errors) == 0,
"audit_record_integrity_status": audit_record_integrity_status,
},
"aggregate_results": aggregate_results,
"audit_statuses": {
"synthetic_test_suite": synthetic_status,
"source_comparison": source_comparison_status,
"stage_2_overall": stage_2_status,
},
"source_inventory": source_inventory,
"requirement_inventory": requirement_inventory,
"closure_checklist": closure_checklist,
"boundary": (
"This audit does not select or establish a Πβ candidate. Synthetic demonstrations "
"do not establish FRCMΠD specification or ontology. Original source inspection "
"remains incomplete unless independently authenticated source evidence is supplied."
),
}
json_filename = f"FRCMPID_AUDIT_{RUN_ID}.json"
checksum_filename = f"{json_filename}.sha256"
json_export_status = "NOT_WRITTEN"
json_sha256 = None
try:
# Exclusive creation prevents overwriting any previous evidence artifact.
with open(json_filename, "x", encoding="utf-8") as json_file:
json.dump(audit_record, json_file, indent=2, ensure_ascii=False, default=str)
json_export_status = "WRITTEN"
print(f"\nJSON record saved: {json_filename}")
with open(json_filename, "rb") as json_file:
json_sha256 = hashlib.sha256(json_file.read()).hexdigest()
print(f"JSON SHA-256: {json_sha256}")
try:
with open(checksum_filename, "x", encoding="utf-8") as checksum_file:
checksum_file.write(f"{json_sha256} {os.path.basename(json_filename)}\n")
print(f"Checksum sidecar saved: {checksum_filename}")
except FileExistsError:
print(f"[WARNING] Checksum sidecar already exists; not overwritten: {checksum_filename}")
try:
from google.colab import files
files.download(json_filename)
print("JSON download triggered.")
try:
files.download(checksum_filename)
print("Checksum download triggered.")
except Exception as download_error:
print(f"[WARNING] Checksum download failed: {download_error}")
except ImportError:
print("Not running in Google Colab; JSON and checksum remain in the current directory.")
except Exception as download_error:
print(f"[WARNING] JSON download failed, but the saved artifact remains: {download_error}")
except FileExistsError:
json_export_status = "REFUSED — FILE ALREADY EXISTS"
print(f"[ERROR] Refusing to overwrite existing JSON: {json_filename}")
except Exception:
json_export_status = "ERROR — EXPORT FAILED"
print("[ERROR] JSON export failed:")
print(traceback.format_exc())
print("\n" + "=" * 78)
print("FINAL SCRIPT SUMMARY")
print("=" * 78)
print(f"Run ID: {RUN_ID}")
print(f"Authorization: {authorization_status}")
print(f"Synthetic status: {synthetic_status}")
print(f"Source comparison: {source_comparison_status}")
print(f"Stage 2 overall: {stage_2_status}")
print(f"JSON export: {json_export_status}")
print(f"JSON SHA-256: {json_sha256 or 'NOT_COMPUTED'}")
print("Original source notebooks: NOT MODIFIED BY THIS SCRIPT")
print("Workbench Cell 6: NOT ACCESSED OR MODIFIED")
print("=" * 78)