Layer-by-Layer Results

Detailed breakdown of the three verification layers (Syntactic, Structural, Behavioral), failure codes, transition criteria, and implementation metrics. All results reflect Phase I at v0.2.0-implementation.

Summary

✅
Phase I Complete: 118/118 tests passing · flake8 = 0 errors · all 3 invariant layers implemented and verified.

Layer I_s — Syntactic Invariants (S1–S6)

Formal validity of the transformed program representation. Verified via LibCST parser and signature comparison.

Code Condition Check Tests Status
S1P₁ parses as valid Modulecst.parse_module2PASS
S2Exactly one top-level FunctionDefnode count3PASS
S3Function name unchangedname compare2PASS
S4Signature unchangedparams compare3PASS
S5No new decoratorsdecorator set3PASS
S6No new imports inside functionImport scan3PASS
Composite verdict5PASS

Layer I_t — Structural Invariants (T1–T5)

Relational integrity of the transformed program. Verified via dependency graph analysis and scope resolution.

Code Condition Check Tests Status
T1Every used Name has a bindingscope analysis5PASS
T2No invalid dependency cyclesDFS cycle detection3PASS
T3No orphan variablesliveness diff3PASS
T4No new global statementsAST scan3PASS
T5Local call targets resolvesymbol table4PASS
Composite verdict5PASS

Layer I_b — Behavioral Invariants (B1–B4)

Observable behavior over a defined corpus. B1–B3 use differential testing; B4 uses runtime enforcement.

Code Condition Check Tests Status
B1Return values matchdifferential test2PASS
B2Exceptions matchdifferential test2PASS
B3stdout traces matchdifferential test2PASS
B4No new side effectsruntime enforcement7PASS
Composite verdict5PASS
⚠ B4 scope: Monkeypatching is not a security sandbox. It detects accidental side effects introduced by transformations, not hostile code.

Decision Policy

The admissibility condition for any candidate P₁.

# Acceptance Accept(P₁) ⟺ I_s(P₁) ∧ I_t(P₁) ∧ I_b(P₁) # Rejection Reject(P₁) ⟺ ¬I_s ∨ ¬I_t ∨ ¬I_b # Golden rule Inconclusive ≠ Accepted # default to rejection when in doubt

Failure Codes

Each rejection returns a specific failure code for debugging.

syntactic:parse
P₁ does not parse as valid Python.
syntactic:signature
Function signature changed.
structural:undefined_name
A name is used without a binding.
structural:cycle
An invalid dependency cycle was detected.
behavioral:return_mismatch
Return value differs from P₀.
behavioral:exception_mismatch
Exception differs from P₀.
behavioral:timeout
Timeout exceeded during differential test.
behavioral:side_effect
A blocked side effect was triggered (B4).

Transition Criteria — Function to Module Level

Extending to module-level rewriting is conditional. All four criteria must be met during the pilot study.

Mechanism Stability
TSR ≥ 90%
on valid transformations
Unsafe Detection
UDR ≥ 95%
on injected failures
Computational Cost
OH ≤ 2×
overhead vs baseline
Recovery Fidelity
SRF = 100%
in controlled tests
ℹ These are proposed engineering gates for this research, not established scientific laws. They will be revised based on baseline calibration.

Hypotheses

Four hypotheses are defined for empirical evaluation.

ID Statement Status
H1Isolated candidate execution reduces failure propagation compared to non-isolated execution.Not yet tested
H2Structural validation combined with differential testing detects more injected behavioral regressions than structural validation alone.Not yet tested
H3Controlled activation and rollback reduce deployment disruption compared to conventional replacement.Not yet tested
H4Successful rollback does not necessarily imply complete restoration of required execution state.Not yet tested
⚠ Numerical thresholds will be established after baseline measurements and pilot calibration, not assumed before.

Metrics (Defined, Not Yet Measured)

The pilot will collect the following metrics.

Metric Definition Measurement
TSRTransformation Success Ratedecision count
UDRUnsafe-change Detection Ratefailure injection
FPRFalse Positive Rateground-truth compare
FNRFalse Negative Rateground-truth compare
OHRuntime Overheadtime.perf_counter
MTTRMean Time to Recoveryrollback timing
SRFState Restoration Fidelitydeferred (Phase III)

Threats to Validity

Explicit limitations of the current scope.

Type Concern Mitigation
ConstructObservation model determines what differential testing can detectExplicit corpus + documented observables
InternalResults may reflect implementation detailsFixed hardware, versions, workloads
ExternalPython-only results may not generalizeScope explicitly restricted
StatisticalPilot too small for general claimsFeasibility only; variance for future study
SecurityMultiprocessing is not a hardened sandboxDocumented; not claimed