From 2ebf867961b1e58d930e67cf812b2ebd3012612c Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 4 Nov 2026 10:31:19 +0000 Subject: [PATCH 1/7] fix: enforce evidence boundaries and record adversarial audit --- benches/pons_bench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benches/pons_bench.sh b/benches/pons_bench.sh index ba9c2e3..a433a24 100755 --- a/benches/pons_bench.sh +++ b/benches/pons_bench.sh @@ -72,7 +72,7 @@ while [ "$#" -gt 0 ]; do done REPS=5 -BIN="target/release/pons" +BIN="${CARGO_TARGET_DIR:-target}/release/pons" echo "bench: building pons-cli (release)" if ! cargo build --release --locked -p pons-cli; then From 99363f7bb59ad150677cfdd0a959ded76138e9d8 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 4 Nov 2026 10:31:29 +0000 Subject: [PATCH 2/7] fix: enforce evidence boundaries and record adversarial audit --- crates/pons-rules/src/t1/read_before_init.rs | 40 ++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/crates/pons-rules/src/t1/read_before_init.rs b/crates/pons-rules/src/t1/read_before_init.rs index 2ea1a12..cbdc3dd 100644 --- a/crates/pons-rules/src/t1/read_before_init.rs +++ b/crates/pons-rules/src/t1/read_before_init.rs @@ -11,14 +11,11 @@ use tree_sitter::Node; const LANGUAGES: &[Lang] = &[Lang::Python]; -/// Rule 10: a read of a local that some path reaches before the name is -/// bound — Python raises `UnboundLocalError`. `WARN` uniformly in v0.1.0: -/// raising the every-path case to `ERROR` would need a must-analysis, which -/// ADR-0002 declines. Python has no default initialisation, so the rule has -/// no counter-condition. Opacity and scope are handled by the OPAQUE hatch and -/// the locals pre-pass; the analysis is also path-insensitive, so correlated -/// guards and loops over non-empty literals yield infeasible-path false -/// positives that ADR-0002 does not yet name (#47). +/// Rule 10: a local read may precede binding in the abstract CFG. +/// WARN denotes a dataflow finding, not a proven feasible Python execution. +/// Correlated guards, exceptional paths and opaque constructs limit precision. +/// The bounded pruning pass accepts plain names only, never attributes whose +/// descriptor evaluation may change between reads. pub struct ReadBeforeInit; impl ReadBeforeInit { @@ -47,7 +44,8 @@ impl Rule for ReadBeforeInit { } /// Reports possible unbound local reads in analysable functions as `WARN`, - /// without counter-conditions. Opaque functions produce no findings. + /// with an explicit path-feasibility counter-condition. Opaque functions + /// produce no findings. /// Offsets selected by the bounded correlated-guard pass are omitted. fn check(&self, ctx: &RuleCtx) -> Vec { let mut findings = Vec::new(); @@ -73,10 +71,10 @@ impl Rule for ReadBeforeInit { "local may be read before it is assigned", format!( "on at least one path through `{}`, `{name}` is read here before it \ - is assigned — Python raises `UnboundLocalError`", + is assigned in the abstract CFG; path feasibility is not established", cfg.name() ), - None, + Some("Correlated conditions, exceptional control flow or other model limitations may make this abstract path infeasible.".into()), )); } } @@ -86,8 +84,8 @@ impl Rule for ReadBeforeInit { /// Extract a textual base and polarity from an `is None` or `is not None` /// suffix with exactly that spacing. The trimmed base may contain only ASCII -/// letters, digits, underscores and dots; calls are rejected. This is a -/// syntactic filter and does not establish that attribute access is pure. +/// letters, digits and underscores. Attribute access is rejected because a +/// Python descriptor may return a different value on every read. fn guard_key(cond: Node<'_>, text: &str) -> Option<(String, String)> { let raw = &text[cond.byte_range()]; let (base, polarity) = if let Some(base) = raw.strip_suffix(" is not None") { @@ -97,11 +95,7 @@ fn guard_key(cond: Node<'_>, text: &str) -> Option<(String, String)> { (base, "none") }; let base = base.trim(); - if base.is_empty() - || !base - .chars() - .all(|c| c.is_ascii_alphanumeric() || matches!(c, '_' | '.')) - { + if base.is_empty() || !base.chars().all(|c| c.is_ascii_alphanumeric() || c == '_') { return None; } Some((base.to_string(), polarity.to_string())) @@ -300,7 +294,7 @@ mod tests { #[test] fn a_correlated_guard_read_is_pruned_but_a_mismatched_guard_is_not() { - let correlated = "def pack(self):\n if self.name is not None:\n name = 1\n if self.name is not None:\n MonsterAddName(name)\n"; + let correlated = "def pack(value):\n if value is not None:\n name = 1\n if value is not None:\n MonsterAddName(name)\n"; assert!( check(correlated).is_empty(), "identical pure guard was not pruned" @@ -314,6 +308,14 @@ mod tests { ); } + #[test] + fn attribute_guards_are_not_assumed_pure_or_stable() { + let src = "def pack(self):\n if self.name is not None:\n name = 1\n if self.name is not None:\n return name\n"; + let findings = check(src); + assert_eq!(findings.len(), 1, "a descriptor can change between reads"); + assert!(findings[0].counter_condition().is_some()); + } + #[test] fn a_mutation_between_identical_guards_disables_pruning() { let src = "def pack(self):\n if self.name is not None:\n name = 1\n self = other\n if self.name is not None:\n MonsterAddName(name)\n"; From 1668133b2b5a958dc546f370dc3fee841f2f600d Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 4 Nov 2026 10:31:45 +0000 Subject: [PATCH 3/7] fix: enforce evidence boundaries and record adversarial audit --- fixtures/read-before-init/negative/correlated_guard.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fixtures/read-before-init/negative/correlated_guard.py b/fixtures/read-before-init/negative/correlated_guard.py index 40aa1b8..2f84bfd 100644 --- a/fixtures/read-before-init/negative/correlated_guard.py +++ b/fixtures/read-before-init/negative/correlated_guard.py @@ -1,6 +1,7 @@ -# The same pure None guard bounds both the definition and the use. +# Snapshot the descriptor once; subsequent local identity tests are stable. def pack(self): - if self.name is not None: + value = self.name + if value is not None: name = 1 - if self.name is not None: + if value is not None: MonsterAddName(name) From 9c55381ec0dec5cae8a035ed07755a7022279f6f Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 4 Nov 2026 10:31:53 +0000 Subject: [PATCH 4/7] fix: enforce evidence boundaries and record adversarial audit --- docs/ASSURANCE-AUDIT-2026-11-04.adoc | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 docs/ASSURANCE-AUDIT-2026-11-04.adoc diff --git a/docs/ASSURANCE-AUDIT-2026-11-04.adoc b/docs/ASSURANCE-AUDIT-2026-11-04.adoc new file mode 100644 index 0000000..006f365 --- /dev/null +++ b/docs/ASSURANCE-AUDIT-2026-11-04.adoc @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 += Assurance audit repair — 2026-11-04 + +Base `84f58f910de7020b79450f2c2643599fe7760f73` passed 250 Rust tests. +The expanded suite passes 251. Tests are not proofs of analysis soundness. + +== Descriptor counterexample + +The former negative `read-before-init/correlated_guard.py` repeats +`self.name is not None`. Python descriptors may return None on the first access +and a value on the second. With MonsterAddName bound to a harmless function, +executing that specimen raises UnboundLocalError before the call. + +The exact original specimen is retained in `positive/attribute_guard.py`. +The corrected negative snapshots `self.name` into a local once. The optimisation +now refuses attribute guards, and finding evidence states that abstract CFG +paths may be infeasible. This does not close general path-sensitivity issue #47, +exception modelling or the other limits of the remaining plain-name pruning. + +== Other evidence + +Both scanners ran against cicd-suite and proven-tests-and-benches. Strict scans +were partial: Pons analysed 1 and 8 files respectively. Those repositories' +shell/configuration/Idris source is not certified by these runs. The shared suite +contains the reproducible bounded parser/report controls and detailed audit. + +The benchmark harness now locates the binary under CARGO_TARGET_DIR when set. +Exploratory timings on modified worktrees are not accepted regression baselines; +source commit, dirty state, binary/toolchain and workload identity must accompany +any comparison. Mathematical source-to-model soundness and independent oracle +coverage remain open. From 24365507501debd245d04698afa6d0b0cb99016d Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 4 Nov 2026 10:32:02 +0000 Subject: [PATCH 5/7] fix: enforce evidence boundaries and record adversarial audit --- fixtures/read-before-init/positive/attribute_guard.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 fixtures/read-before-init/positive/attribute_guard.py diff --git a/fixtures/read-before-init/positive/attribute_guard.py b/fixtures/read-before-init/positive/attribute_guard.py new file mode 100644 index 0000000..40aa1b8 --- /dev/null +++ b/fixtures/read-before-init/positive/attribute_guard.py @@ -0,0 +1,6 @@ +# The same pure None guard bounds both the definition and the use. +def pack(self): + if self.name is not None: + name = 1 + if self.name is not None: + MonsterAddName(name) From a98c9b576745767b82a6142d474411000cd8a63e Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 4 Nov 2026 10:42:16 +0000 Subject: [PATCH 6/7] fix: address hosted audit policy and metadata failures --- docs/ASSURANCE-AUDIT-2026-11-04.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/ASSURANCE-AUDIT-2026-11-04.adoc b/docs/ASSURANCE-AUDIT-2026-11-04.adoc index 006f365..fdba510 100644 --- a/docs/ASSURANCE-AUDIT-2026-11-04.adoc +++ b/docs/ASSURANCE-AUDIT-2026-11-04.adoc @@ -1,3 +1,4 @@ +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) // SPDX-License-Identifier: CC-BY-SA-4.0 = Assurance audit repair — 2026-11-04 From 719ee65a81de6503ab217ee012d2571bca494a8e Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 15:01:43 +0000 Subject: [PATCH 7/7] docs(pons-rules): clarify guard_key return values and source requirements --- crates/pons-rules/src/t1/read_before_init.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/pons-rules/src/t1/read_before_init.rs b/crates/pons-rules/src/t1/read_before_init.rs index cbdc3dd..cc200a3 100644 --- a/crates/pons-rules/src/t1/read_before_init.rs +++ b/crates/pons-rules/src/t1/read_before_init.rs @@ -86,6 +86,9 @@ impl Rule for ReadBeforeInit { /// suffix with exactly that spacing. The trimmed base may contain only ASCII /// letters, digits and underscores. Attribute access is rejected because a /// Python descriptor may return a different value on every read. +/// Returns the base and `none` or `not-none` polarity, or `None` if the +/// suffix or non-empty base does not match. This is a textual filter, not +/// Python identifier validation. `text` must be the source for `cond`. fn guard_key(cond: Node<'_>, text: &str) -> Option<(String, String)> { let raw = &text[cond.byte_range()]; let (base, polarity) = if let Some(base) = raw.strip_suffix(" is not None") {