stelling 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stelling-0.1.0/.github/scripts/tripwire_canary.py +130 -0
- stelling-0.1.0/.github/workflows/ci.yml +1323 -0
- stelling-0.1.0/.github/workflows/nightly-jax-canary.yml +125 -0
- stelling-0.1.0/.github/workflows/release.yml +402 -0
- stelling-0.1.0/.gitignore +227 -0
- stelling-0.1.0/.license-header.txt +2 -0
- stelling-0.1.0/.pre-commit-config.yaml +335 -0
- stelling-0.1.0/ARCHITECTURE.md +110 -0
- stelling-0.1.0/CHANGELOG.md +67 -0
- stelling-0.1.0/CITATION.cff +19 -0
- stelling-0.1.0/CONTRIBUTING.md +130 -0
- stelling-0.1.0/DCO +34 -0
- stelling-0.1.0/DOCUMENTATION_ARCHITECTURE.md +3256 -0
- stelling-0.1.0/LICENSE +201 -0
- stelling-0.1.0/LICENSES/Apache-2.0.txt +201 -0
- stelling-0.1.0/LICENSES/LicenseRef-DCO.txt +6 -0
- stelling-0.1.0/LICENSES/LicenseRef-stelling-marks.txt +22 -0
- stelling-0.1.0/PKG-INFO +410 -0
- stelling-0.1.0/README.md +378 -0
- stelling-0.1.0/REUSE.toml +56 -0
- stelling-0.1.0/SECURITY.md +34 -0
- stelling-0.1.0/SOUNDNESS.md +5080 -0
- stelling-0.1.0/assets/favicon_io/android-chrome-192x192.png +0 -0
- stelling-0.1.0/assets/favicon_io/android-chrome-512x512.png +0 -0
- stelling-0.1.0/assets/favicon_io/apple-touch-icon.png +0 -0
- stelling-0.1.0/assets/favicon_io/favicon-16x16.png +0 -0
- stelling-0.1.0/assets/favicon_io/favicon-32x32.png +0 -0
- stelling-0.1.0/assets/favicon_io/favicon.ico +0 -0
- stelling-0.1.0/assets/favicon_io/site.webmanifest +1 -0
- stelling-0.1.0/assets/stelling_logo.png +0 -0
- stelling-0.1.0/corpus/category_probes.py +150 -0
- stelling-0.1.0/corpus/declaration_emptiness_sweep.py +605 -0
- stelling-0.1.0/corpus/interrogate_census.py +498 -0
- stelling-0.1.0/corpus/la_census.py +590 -0
- stelling-0.1.0/corpus/rule_provenance.py +265 -0
- stelling-0.1.0/corpus/run_census.py +523 -0
- stelling-0.1.0/corpus/supply/affine_holdout/README.md +40 -0
- stelling-0.1.0/corpus/supply/affine_holdout/SCOUT_CASES.md +483 -0
- stelling-0.1.0/corpus/supply/affine_holdout/case1_REFINED.py +187 -0
- stelling-0.1.0/corpus/supply/affine_holdout/case1_mime_symmetry.py +187 -0
- stelling-0.1.0/corpus/supply/affine_holdout/case2_REFINED.py +82 -0
- stelling-0.1.0/corpus/supply/affine_holdout/case2_conditioning_dependency.py +82 -0
- stelling-0.1.0/corpus/supply/affine_holdout/probe_case4_refined.py +42 -0
- stelling-0.1.0/corpus/supply/affine_holdout/probe_case5_refined.py +31 -0
- stelling-0.1.0/corpus/supply/census_hit386.py +94 -0
- stelling-0.1.0/corpus/supply/cf_run.py +136 -0
- stelling-0.1.0/corpus/supply/e2a_417.py +99 -0
- stelling-0.1.0/corpus/supply/e2a_hit386.py +107 -0
- stelling-0.1.0/corpus/supply/exhibit_632.py +94 -0
- stelling-0.1.0/corpus/supply/hit1360_divergence.py +66 -0
- stelling-0.1.0/corpus/supply/hit368_invariant.py +80 -0
- stelling-0.1.0/corpus/supply/hit386_termination.py +97 -0
- stelling-0.1.0/corpus/supply/la_contract_probe.py +94 -0
- stelling-0.1.0/corpus/supply/layer_newton.py +86 -0
- stelling-0.1.0/corpus/supply/layer_pid.py +82 -0
- stelling-0.1.0/corpus/supply/lineax_preconditions.py +710 -0
- stelling-0.1.0/corpus/supply/maddening_cfl.py +284 -0
- stelling-0.1.0/corpus/supply/maddening_preconditions.py +327 -0
- stelling-0.1.0/corpus/supply/mime_fvm.py +345 -0
- stelling-0.1.0/corpus/supply/mime_fvm_regional.py +347 -0
- stelling-0.1.0/corpus/supply/precision_decompose.py +158 -0
- stelling-0.1.0/corpus/supply/pytree_probe.py +115 -0
- stelling-0.1.0/corpus/supply/second_bill.py +101 -0
- stelling-0.1.0/corpus/supply/tautology_test.py +59 -0
- stelling-0.1.0/design/affine-disclosure.md +95 -0
- stelling-0.1.0/design/affine-refinement.md +112 -0
- stelling-0.1.0/design/any-pytree-build.md +144 -0
- stelling-0.1.0/design/any-pytree-probe.md +144 -0
- stelling-0.1.0/design/archaeology-probe.md +137 -0
- stelling-0.1.0/design/array-emission-payoff.md +226 -0
- stelling-0.1.0/design/assume-registration.md +47 -0
- stelling-0.1.0/design/attribution-probe.md +127 -0
- stelling-0.1.0/design/census-interrogation.md +89 -0
- stelling-0.1.0/design/ci-readiness.md +383 -0
- stelling-0.1.0/design/constraining-assume.md +359 -0
- stelling-0.1.0/design/control-flow-census.md +129 -0
- stelling-0.1.0/design/control-flow-hypothesis.md +170 -0
- stelling-0.1.0/design/corpus-expansion.md +152 -0
- stelling-0.1.0/design/corpus-limits.md +108 -0
- stelling-0.1.0/design/d4-wrap-disclosure.md +281 -0
- stelling-0.1.0/design/e2a-registration.md +319 -0
- stelling-0.1.0/design/e2a-run.md +81 -0
- stelling-0.1.0/design/equinox-empty-check.md +62 -0
- stelling-0.1.0/design/finding-conjunction.md +104 -0
- stelling-0.1.0/design/founding.md +113 -0
- stelling-0.1.0/design/guard-experiment.md +107 -0
- stelling-0.1.0/design/harness-fidelity.md +163 -0
- stelling-0.1.0/design/ieee-reexamination.md +273 -0
- stelling-0.1.0/design/ieee-semantics.md +247 -0
- stelling-0.1.0/design/index-bounds-round.md +254 -0
- stelling-0.1.0/design/jax-verification-categories.md +664 -0
- stelling-0.1.0/design/la-and-stack-probes.md +237 -0
- stelling-0.1.0/design/la-attachment.md +136 -0
- stelling-0.1.0/design/la-contract-build.md +152 -0
- stelling-0.1.0/design/layer-probe.md +140 -0
- stelling-0.1.0/design/lessons-ledger.md +599 -0
- stelling-0.1.0/design/maddening-archaeology.md +179 -0
- stelling-0.1.0/design/maddening-cfl-job.md +224 -0
- stelling-0.1.0/design/maintenance-treadmill.md +142 -0
- stelling-0.1.0/design/mime-fvm-job.md +236 -0
- stelling-0.1.0/design/mwe-census.md +128 -0
- stelling-0.1.0/design/obligation-vacuity.md +199 -0
- stelling-0.1.0/design/open-primitive-set.md +53 -0
- stelling-0.1.0/design/portability-pass.md +123 -0
- stelling-0.1.0/design/precision-probe.md +152 -0
- stelling-0.1.0/design/precondition-class.md +254 -0
- stelling-0.1.0/design/primitive-census.md +249 -0
- stelling-0.1.0/design/private-jax-boundary.md +243 -0
- stelling-0.1.0/design/private-track-criterion.md +197 -0
- stelling-0.1.0/design/property-recheck.md +115 -0
- stelling-0.1.0/design/regional-obligation.md +460 -0
- stelling-0.1.0/design/registration-rules-and-capacity.md +157 -0
- stelling-0.1.0/design/release-criteria.md +32 -0
- stelling-0.1.0/design/roadmap.md +149 -0
- stelling-0.1.0/design/rule-provenance.md +64 -0
- stelling-0.1.0/design/scatter-rows.md +104 -0
- stelling-0.1.0/design/second-bill.md +160 -0
- stelling-0.1.0/design/semantics-classification.md +134 -0
- stelling-0.1.0/design/semantics-drift-probe.md +166 -0
- stelling-0.1.0/design/socket-decoupling.md +67 -0
- stelling-0.1.0/design/solver-hardening.md +114 -0
- stelling-0.1.0/design/solver-integration-build.md +254 -0
- stelling-0.1.0/design/soundness-audit.md +144 -0
- stelling-0.1.0/design/supply-probe.md +152 -0
- stelling-0.1.0/design/tracker-probe-2.md +120 -0
- stelling-0.1.0/design/tracker-probe-classification.md +309 -0
- stelling-0.1.0/design/tracker-probe.md +233 -0
- stelling-0.1.0/design/transparent-primitives.md +177 -0
- stelling-0.1.0/design/unknown-triage.md +167 -0
- stelling-0.1.0/design/value-model-v2.md +182 -0
- stelling-0.1.0/design/value-model.md +223 -0
- stelling-0.1.0/docs/README.md +43 -0
- stelling-0.1.0/docs/choosing-a-solver-backend.md +237 -0
- stelling-0.1.0/docs/gauge-coverage.md +175 -0
- stelling-0.1.0/docs/gen_supported_primitives.py +710 -0
- stelling-0.1.0/docs/harness-api.md +717 -0
- stelling-0.1.0/docs/norms.md +1005 -0
- stelling-0.1.0/docs/overflow-tripwire.md +327 -0
- stelling-0.1.0/docs/preconditions.md +296 -0
- stelling-0.1.0/docs/proposed-declaration-dtype-check.md +159 -0
- stelling-0.1.0/docs/proposed-decline-messages.md +168 -0
- stelling-0.1.0/docs/proposed-div-straddle-decline.md +119 -0
- stelling-0.1.0/docs/proposed-int-literal-convert.md +92 -0
- stelling-0.1.0/docs/proposed-solver-selection.md +247 -0
- stelling-0.1.0/docs/proposed-tier-clause.md +126 -0
- stelling-0.1.0/docs/proposed-unit-mechanism.md +137 -0
- stelling-0.1.0/docs/quickstart.md +281 -0
- stelling-0.1.0/docs/reading-a-verdict.md +641 -0
- stelling-0.1.0/docs/reproducing-a-witness.md +405 -0
- stelling-0.1.0/docs/state-0.1.0.md +642 -0
- stelling-0.1.0/docs/supported-primitives.md +280 -0
- stelling-0.1.0/docs/verdict-ledger.md +113 -0
- stelling-0.1.0/pyproject.toml +197 -0
- stelling-0.1.0/src/stelling/__init__.py +36 -0
- stelling-0.1.0/src/stelling/__main__.py +120 -0
- stelling-0.1.0/src/stelling/_bound_spelling.py +185 -0
- stelling-0.1.0/src/stelling/_cvc5_driver.py +160 -0
- stelling-0.1.0/src/stelling/_jax_compat.py +1620 -0
- stelling-0.1.0/src/stelling/_optional.py +144 -0
- stelling-0.1.0/src/stelling/_tripwire/__init__.py +306 -0
- stelling-0.1.0/src/stelling/_tripwire/_adapter_jax.py +704 -0
- stelling-0.1.0/src/stelling/_tripwire/_probe.py +47 -0
- stelling-0.1.0/src/stelling/_tripwire/plugin.py +395 -0
- stelling-0.1.0/src/stelling/_tripwire/record.py +494 -0
- stelling-0.1.0/src/stelling/_tripwire/report.py +481 -0
- stelling-0.1.0/src/stelling/affine.py +1193 -0
- stelling-0.1.0/src/stelling/census.py +130 -0
- stelling-0.1.0/src/stelling/contracts.py +1022 -0
- stelling-0.1.0/src/stelling/coverage.py +260 -0
- stelling-0.1.0/src/stelling/exactness.py +279 -0
- stelling-0.1.0/src/stelling/fidelity.py +247 -0
- stelling-0.1.0/src/stelling/harness.py +65 -0
- stelling-0.1.0/src/stelling/interval.py +2535 -0
- stelling-0.1.0/src/stelling/ir.py +756 -0
- stelling-0.1.0/src/stelling/obligation.py +2590 -0
- stelling-0.1.0/src/stelling/overflow.py +89 -0
- stelling-0.1.0/src/stelling/preconditions.py +468 -0
- stelling-0.1.0/src/stelling/propagate.py +8237 -0
- stelling-0.1.0/src/stelling/py.typed +0 -0
- stelling-0.1.0/src/stelling/reproduce.py +1865 -0
- stelling-0.1.0/src/stelling/smt.py +755 -0
- stelling-0.1.0/src/stelling/solvers.py +2607 -0
- stelling-0.1.0/src/stelling/vacuity.py +201 -0
- stelling-0.1.0/src/stelling/verdict.py +1589 -0
- stelling-0.1.0/tests/conftest.py +1249 -0
- stelling-0.1.0/tests/property/README.md +628 -0
- stelling-0.1.0/tests/property/_corpus.py +210 -0
- stelling-0.1.0/tests/property/_grammar.py +1187 -0
- stelling-0.1.0/tests/property/_profiles.py +103 -0
- stelling-0.1.0/tests/property/_runner.py +183 -0
- stelling-0.1.0/tests/property/positive_controls.py +514 -0
- stelling-0.1.0/tests/property/test_cross_series.py +179 -0
- stelling-0.1.0/tests/property/test_cvc5_protocol.py +774 -0
- stelling-0.1.0/tests/property/test_generator_floor.py +445 -0
- stelling-0.1.0/tests/property/test_metamorphic.py +677 -0
- stelling-0.1.0/tests/property/test_oracle.py +373 -0
- stelling-0.1.0/tests/property/test_suite_disclosure.py +1391 -0
- stelling-0.1.0/tests/reproduce_subjects.py +344 -0
- stelling-0.1.0/tests/reproduce_subjects_bound.py +75 -0
- stelling-0.1.0/tests/test_affine.py +1459 -0
- stelling-0.1.0/tests/test_affine_jax.py +341 -0
- stelling-0.1.0/tests/test_any_pytree.py +243 -0
- stelling-0.1.0/tests/test_array_acceptance.py +479 -0
- stelling-0.1.0/tests/test_array_emission.py +1893 -0
- stelling-0.1.0/tests/test_assume_constrain.py +2065 -0
- stelling-0.1.0/tests/test_audit_findings.py +561 -0
- stelling-0.1.0/tests/test_bar_walk_parity.py +666 -0
- stelling-0.1.0/tests/test_branch_reachability.py +477 -0
- stelling-0.1.0/tests/test_budget_message.py +147 -0
- stelling-0.1.0/tests/test_by_name_gates.py +191 -0
- stelling-0.1.0/tests/test_census.py +81 -0
- stelling-0.1.0/tests/test_constant_fold_portfolio.py +1038 -0
- stelling-0.1.0/tests/test_constrained_refusal_message.py +145 -0
- stelling-0.1.0/tests/test_contracts.py +1004 -0
- stelling-0.1.0/tests/test_contracts_nojax.py +324 -0
- stelling-0.1.0/tests/test_controlflow.py +100 -0
- stelling-0.1.0/tests/test_convert_decline_text.py +405 -0
- stelling-0.1.0/tests/test_coverage.py +124 -0
- stelling-0.1.0/tests/test_declaration_dtype.py +1540 -0
- stelling-0.1.0/tests/test_declaration_routes_agree.py +495 -0
- stelling-0.1.0/tests/test_decline_provenance.py +282 -0
- stelling-0.1.0/tests/test_doc_examples.py +713 -0
- stelling-0.1.0/tests/test_dot_general_interval.py +346 -0
- stelling-0.1.0/tests/test_dropped_assume.py +147 -0
- stelling-0.1.0/tests/test_escalation_invariant.py +151 -0
- stelling-0.1.0/tests/test_exact_recording.py +713 -0
- stelling-0.1.0/tests/test_exactness_lift.py +878 -0
- stelling-0.1.0/tests/test_face_asymmetry.py +136 -0
- stelling-0.1.0/tests/test_fidelity.py +184 -0
- stelling-0.1.0/tests/test_from_dict_absent_params.py +161 -0
- stelling-0.1.0/tests/test_harness.py +339 -0
- stelling-0.1.0/tests/test_ieee_escalation_guard.py +249 -0
- stelling-0.1.0/tests/test_ieee_f32_band.py +394 -0
- stelling-0.1.0/tests/test_ieee_semantics.py +1373 -0
- stelling-0.1.0/tests/test_ieee_subnormal.py +388 -0
- stelling-0.1.0/tests/test_import_hygiene.py +959 -0
- stelling-0.1.0/tests/test_index_bounds.py +1235 -0
- stelling-0.1.0/tests/test_interval.py +400 -0
- stelling-0.1.0/tests/test_ir.py +166 -0
- stelling-0.1.0/tests/test_membership_idiom_hint.py +912 -0
- stelling-0.1.0/tests/test_nonempty_certificate.py +792 -0
- stelling-0.1.0/tests/test_obligation_slice.py +489 -0
- stelling-0.1.0/tests/test_optimize_mode_guards.py +64 -0
- stelling-0.1.0/tests/test_optional.py +104 -0
- stelling-0.1.0/tests/test_preconditions.py +308 -0
- stelling-0.1.0/tests/test_probe_witness.py +1079 -0
- stelling-0.1.0/tests/test_propagate.py +235 -0
- stelling-0.1.0/tests/test_prose_hygiene.py +642 -0
- stelling-0.1.0/tests/test_readme_claims.py +157 -0
- stelling-0.1.0/tests/test_release_doc_claims.py +531 -0
- stelling-0.1.0/tests/test_release_gates.py +794 -0
- stelling-0.1.0/tests/test_replay_census.py +57 -0
- stelling-0.1.0/tests/test_reproduce.py +741 -0
- stelling-0.1.0/tests/test_reproduce_acceptance.py +1483 -0
- stelling-0.1.0/tests/test_reuse_pins.py +232 -0
- stelling-0.1.0/tests/test_scatter_add_row_gates.py +169 -0
- stelling-0.1.0/tests/test_scatter_emission_reach.py +412 -0
- stelling-0.1.0/tests/test_scatter_gauge_jax.py +2543 -0
- stelling-0.1.0/tests/test_scatter_row_gates.py +154 -0
- stelling-0.1.0/tests/test_scatter_rows.py +1062 -0
- stelling-0.1.0/tests/test_sdist_contents.py +2557 -0
- stelling-0.1.0/tests/test_sign_rem_rows.py +380 -0
- stelling-0.1.0/tests/test_size0_assume.py +267 -0
- stelling-0.1.0/tests/test_skip_inventory.py +3376 -0
- stelling-0.1.0/tests/test_slice_renumbering.py +152 -0
- stelling-0.1.0/tests/test_smt_emission.py +333 -0
- stelling-0.1.0/tests/test_solver_acceptance.py +203 -0
- stelling-0.1.0/tests/test_solver_audit_findings.py +1531 -0
- stelling-0.1.0/tests/test_solver_dispatch.py +551 -0
- stelling-0.1.0/tests/test_solver_structural.py +316 -0
- stelling-0.1.0/tests/test_soundness_wrap_reproducer.py +509 -0
- stelling-0.1.0/tests/test_sqrt_row.py +353 -0
- stelling-0.1.0/tests/test_square_acceptance_jaxfluids.py +316 -0
- stelling-0.1.0/tests/test_square_complex.py +108 -0
- stelling-0.1.0/tests/test_square_row.py +422 -0
- stelling-0.1.0/tests/test_square_row_gauge_jax.py +914 -0
- stelling-0.1.0/tests/test_supported_primitives_doc.py +148 -0
- stelling-0.1.0/tests/test_three_rows.py +2254 -0
- stelling-0.1.0/tests/test_three_rows_acceptance.py +470 -0
- stelling-0.1.0/tests/test_tier_clause.py +226 -0
- stelling-0.1.0/tests/test_top_despite_coverage.py +484 -0
- stelling-0.1.0/tests/test_transcribe.py +242 -0
- stelling-0.1.0/tests/test_transfers.py +1396 -0
- stelling-0.1.0/tests/test_transfers_jax.py +796 -0
- stelling-0.1.0/tests/test_tripwire_arm.py +851 -0
- stelling-0.1.0/tests/test_tripwire_gate.py +178 -0
- stelling-0.1.0/tests/test_tripwire_plugin.py +575 -0
- stelling-0.1.0/tests/test_tripwire_record.py +686 -0
- stelling-0.1.0/tests/test_tripwire_xdist.py +261 -0
- stelling-0.1.0/tests/test_undecided_detail.py +462 -0
- stelling-0.1.0/tests/test_unsupported_emission_message.py +265 -0
- stelling-0.1.0/tests/test_vacuity.py +129 -0
- stelling-0.1.0/tests/test_vacuity_depth.py +175 -0
- stelling-0.1.0/tests/test_vacuous_refutation.py +782 -0
- stelling-0.1.0/tests/test_verdict.py +283 -0
- stelling-0.1.0/tests/test_verified_bar.py +4478 -0
- stelling-0.1.0/tests/test_zero_dep_import_discipline.py +1056 -0
- stelling-0.1.0/tools/property_check.py +744 -0
- stelling-0.1.0/tools/property_venv.sh +175 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Nicholas Ehsan Roy
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Arm the SHIPPED tripwire, print what it attached to, and say whether it worked.
|
|
5
|
+
|
|
6
|
+
Used by `.github/workflows/nightly-jax-canary.yml` for both legs — the nightly
|
|
7
|
+
and the pinned control — so the two are the same probe by construction and a
|
|
8
|
+
red nightly beside a green control means upstream, not us.
|
|
9
|
+
|
|
10
|
+
IT CALLS `stelling._tripwire.arm()`. That is the entire design constraint: it
|
|
11
|
+
is the same call `pytest_configure` makes, so a canary that goes green is a
|
|
12
|
+
statement about the code that ships rather than about a re-implementation of
|
|
13
|
+
it that drifted. Everything else here is printing.
|
|
14
|
+
|
|
15
|
+
Exit codes: 0 armed; 1 with `--require` and not armed. Without `--require` it
|
|
16
|
+
reports and exits 0, which is the shape a human wants when running it by hand
|
|
17
|
+
to see what a given jax does.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import argparse
|
|
23
|
+
import os
|
|
24
|
+
import sys
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def main() -> int:
|
|
28
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
29
|
+
parser.add_argument(
|
|
30
|
+
"--require",
|
|
31
|
+
action="store_true",
|
|
32
|
+
help="exit non-zero if the tripwire could not arm (what the canary uses)",
|
|
33
|
+
)
|
|
34
|
+
args = parser.parse_args()
|
|
35
|
+
|
|
36
|
+
from stelling import _tripwire
|
|
37
|
+
from stelling._tripwire import _adapter_jax as adapter
|
|
38
|
+
|
|
39
|
+
status, recorder = _tripwire.arm()
|
|
40
|
+
|
|
41
|
+
# A LIVE POSITIVE CONTROL, in this process, after arming. Without it the
|
|
42
|
+
# canary's own figures are the beautiful zero this project keeps finding:
|
|
43
|
+
# `arm()` deliberately leaves the recorder empty (its self-check must not
|
|
44
|
+
# inflate a user's denominator), so a canary that printed the recorder
|
|
45
|
+
# straight after arming would print `0 invocations` on a perfectly live
|
|
46
|
+
# hook and on a dead one alike.
|
|
47
|
+
#
|
|
48
|
+
# `_probe.over` and `_jax_compat` rather than an `import jax`: the shipped
|
|
49
|
+
# probe is the program whose narrowing is already known, and this script
|
|
50
|
+
# keeps the same jax boundary the package does.
|
|
51
|
+
control = "not run"
|
|
52
|
+
if status.armed:
|
|
53
|
+
try:
|
|
54
|
+
from stelling._jax_compat import jax as _jax
|
|
55
|
+
from stelling._jax_compat import jnp as _jnp
|
|
56
|
+
from stelling._tripwire import _probe
|
|
57
|
+
|
|
58
|
+
_jax.make_jaxpr(_probe.over)(_jnp.zeros((7,), _jnp.int8))
|
|
59
|
+
found = recorder.sorted_findings()
|
|
60
|
+
control = (
|
|
61
|
+
f"{len(found)} finding over {recorder.int_narrowings} "
|
|
62
|
+
f"narrowing(s)"
|
|
63
|
+
+ (
|
|
64
|
+
f"; {found[0].written} -> {found[0].became} "
|
|
65
|
+
f"({found[0].to_dtype})"
|
|
66
|
+
if found
|
|
67
|
+
else " -- THE CONTROL DID NOT FIRE"
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
except Exception as exc: # noqa: BLE001
|
|
71
|
+
control = f"raised {type(exc).__name__}: {exc}"
|
|
72
|
+
|
|
73
|
+
disarmed = _tripwire.disarm()
|
|
74
|
+
|
|
75
|
+
hash_note = "as tested"
|
|
76
|
+
if status.rule_hash and status.rule_hash != adapter._KNOWN_HASH:
|
|
77
|
+
hash_note = f"CHANGED from {adapter._KNOWN_HASH} — read the rule before trusting"
|
|
78
|
+
|
|
79
|
+
rows = [
|
|
80
|
+
("status", status.code),
|
|
81
|
+
("jax", status.jax_version or "?"),
|
|
82
|
+
("rule", status.rule_name or "?"),
|
|
83
|
+
("rule sha1", f"{status.rule_hash or '?'} ({hash_note})"),
|
|
84
|
+
("registry size", str(status.registry_size)),
|
|
85
|
+
("locate()", adapter.locate()),
|
|
86
|
+
("live control", control),
|
|
87
|
+
("disarm()", disarmed),
|
|
88
|
+
("detail", status.explanation),
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
for name, value in rows:
|
|
92
|
+
print(f"{name}: {value}")
|
|
93
|
+
|
|
94
|
+
summary = os.environ.get("GITHUB_STEP_SUMMARY")
|
|
95
|
+
if summary:
|
|
96
|
+
verdict = "ARMED" if status.armed else f"NOT ARMED [{status.code}]"
|
|
97
|
+
with open(summary, "a", encoding="utf-8") as handle:
|
|
98
|
+
handle.write(f"### nightly jax canary: {verdict}\n\n")
|
|
99
|
+
handle.write("| what | value |\n|---|---|\n")
|
|
100
|
+
for name, value in rows:
|
|
101
|
+
handle.write(f"| {name} | {value} |\n")
|
|
102
|
+
handle.write(
|
|
103
|
+
"\nThe rule sha1 is RECORDED and never gated on: a cosmetic "
|
|
104
|
+
"edit upstream must not disable the tool. It is here so a red "
|
|
105
|
+
"run is diagnosable from this page without re-running it.\n"
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
if args.require and not status.armed:
|
|
109
|
+
print(
|
|
110
|
+
f"\ncanary: the tripwire could not arm [{status.code}].\n"
|
|
111
|
+
"If the control leg on the pinned series is GREEN, this is "
|
|
112
|
+
"upstream: jax moved the const-fold registry, the rule keyed on "
|
|
113
|
+
"convert_element_type, or the semantics the probe checks. If the "
|
|
114
|
+
"control is RED TOO, it is this repository.",
|
|
115
|
+
file=sys.stderr,
|
|
116
|
+
)
|
|
117
|
+
return 1
|
|
118
|
+
if status.armed and "DID NOT FIRE" in control:
|
|
119
|
+
print(
|
|
120
|
+
"\ncanary: the tripwire armed and its live control did not fire. "
|
|
121
|
+
"`arm()` says the hook is attached; the control says nothing "
|
|
122
|
+
"reached it. Treat the armed status as unverified.",
|
|
123
|
+
file=sys.stderr,
|
|
124
|
+
)
|
|
125
|
+
return 1
|
|
126
|
+
return 0
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
if __name__ == "__main__":
|
|
130
|
+
raise SystemExit(main())
|