Auditing Python Guards under Explicit Semantic Contracts

Guard edits can change syntax without changing rejecting inputs, while finite test domains can omit new restrictions. We study these distinctions under explicit Python analysis contracts. A frozen pilot comprises 66 paired programs from 22 authored templates with correlated threshold variants. On byte lengths 0–64, a relational prototype returns 57 correct decisions and nine abstentions; a retained lexical-binding failure motivates a recorded amendment. A second block uses six same-family guard origins from two pinned repositories and 420 dependent authored activation cells. Interval and independently encoded Z3 relations agree under supplied mathematical premises, while a representation counterexample requires an explicit bounded-domain amendment. We separately execute two purpose-selected historical maintainer changes in urllib3 and aiohttp. Five unchanged upstream tests and separately labeled authored probes reproduce before/after behavior, with initial test-environment failure retained. The original analyzers abstain on these historical changes rather than supplying a shared detection rate. The evidence distinguishes source inventories, authored mechanism diagnostics, and actual repository behavior. Results support reproducible conditional diagnoses; they do not establish general Python correctness, natural-change accuracy, policy intent, technical novelty, or coding-agent improvement. Exploratory preprint of the 21-page author manuscript submitted to ACM Transactions on Software Engineering and Methodology on 9 October 2026, manuscript ID TOSEM-2026-1315. Submitted, not accepted or published by the journal; no independently confirmed external peer review. This is a distinct semantic-contract study, not a replacement version of the rule-lifecycle study at https://zenodo.org/records/23234126 (JAIR submission 25131). The related study and differences were disclosed to TOSEM. The frozen supplementary ZIP preserves authored fixtures, probes, original observations and pinned-source provenance, including initial failures and bounded-domain amendments. Original paper text and original figures are CC BY 4.0. The code, fixtures, records and data receive no additional blanket licence; retained third-party terms remain in force. See RIGHTS_AND_THIRD_PARTY_NOTICES.md inside the ZIP. OpenAI Codex assisted with research planning, code implementation, fixture and probe construction, compilation, data analysis, literature retrieval, and manuscript drafting and editing. These automated checks are not independent human review. The named author reports personal participation and full final-manuscript review and approved this submission. The work was personally self-funded with no external grant. Repository: https://github.com/Linxiushen/coding-agent-rule-audit. The new semantic-contract code and evidence are provided in the named supplementary ZIP; the repository v0.8 belongs to the earlier rule-lifecycle study.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-10-09
DOI
https://doi.org/10.5281/zenodo.23260833
Primary Topic
Software Engineering Research
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Auditing Python Guards under Explicit Semantic Contracts

Xulin Chen
Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
preprint

Auditing Python Guards under Explicit Semantic Contracts

Xulin Chen
preprint en

Abstract

Guard edits can change syntax without changing rejecting inputs, while finite test domains can omit new restrictions. We study these distinctions under explicit Python analysis contracts. A frozen pilot comprises 66 paired programs from 22 authored templates with correlated threshold variants. On byte lengths 0–64, a relational prototype returns 57 correct decisions and nine abstentions; a retained lexical-binding failure motivates a recorded amendment. A second block uses six same-family guard origins from two pinned repositories and 420 dependent authored activation cells. Interval and independently encoded Z3 relations agree under supplied mathematical premises, while a representation counterexample requires an explicit bounded-domain amendment. We separately execute two purpose-selected historical maintainer changes in urllib3 and aiohttp. Five unchanged upstream tests and separately labeled authored probes reproduce before/after behavior, with initial test-environment failure retained. The original analyzers abstain on these historical changes rather than supplying a shared detection rate. The evidence distinguishes source inventories, authored mechanism diagnostics, and actual repository behavior. Results support reproducible conditional diagnoses; they do not establish general Python correctness, natural-change accuracy, policy intent, technical novelty, or coding-agent improvement. Exploratory preprint of the 21-page author manuscript submitted to ACM Transactions on Software Engineering and Methodology on 9 October 2026, manuscript ID TOSEM-2026-1315. Submitted, not accepted or published by the journal; no independently confirmed external peer review. This is a distinct semantic-contract study, not a replacement version of the rule-lifecycle study at https://zenodo.org/records/23234126 (JAIR submission 25131). The related study and differences were disclosed to TOSEM. The frozen supplementary ZIP preserves authored fixtures, probes, original observations and pinned-source provenance, including initial failures and bounded-domain amendments. Original paper text and original figures are CC BY 4.0. The code, fixtures, records and data receive no additional blanket licence; retained third-party terms remain in force. See RIGHTS_AND_THIRD_PARTY_NOTICES.md inside the ZIP. OpenAI Codex assisted with research planning, code implementation, fixture and probe construction, compilation, data analysis, literature retrieval, and manuscript drafting and editing. These automated checks are not independent human review. The named author reports personal participation and full final-manuscript review and approved this submission. The work was personally self-funded with no external grant. Repository: https://github.com/Linxiushen/coding-agent-rule-audit. The new semantic-contract code and evidence are provided in the named supplementary ZIP; the repository v0.8 belongs to the earlier rule-lifecycle study.

Zenodo (CERN European Organization for Nuclear Research)
Lynx (Italy) (IT)
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.