Skip to content

safety contract (#2869): stated sentence + corollaries, 15 rules edited, two open cells to zero, golden masters re-blessed - #2873

Merged
squid-protocol merged 1 commit into
mainfrom
fix/2869-safety-contract
Sep 8, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/2869-safety-contract

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

Roadmap Phase 3 (epic #2812): the safety row goes draft → stated (10/68). One layer: rule regexes + their strict pins + the sheet + the doc.

Closes #2869

The contract

A site that handles or forestalls a runtime failure at the value level — a guarded region's opener or its typed handler, a runtime assertion or validation call, a fallback or handled-absence form, an installed failure handler or watchdog, or a hardening instruction — in a form an ordinary identifier, type annotation or constructor cannot match.

docs/safety_rule_contract.md (corollaries C1–C6, the 46-row audit table, known limits, deferred menu #2870). Sheet row flipped in gitgalaxy/standards/signal_contracts.py; how_to_add_a_language.md's safety comment now contains the sentence; signal_contract_audit.py --ci green with a smaller baseline (59 findings). Cross-language pins: tests/extraction/languages/test_safety_contract_2869.py (51 tests, incl. ReDoS detonations and the deliberate-dual pins).

The two open cells (both extraction, now 0)

  • embedded_python 4 → 2 — b.py's two bare except: (the safety_bypasses plant) counted as safety. except now counts only in its typed-handler form (except ValueError:); blanket forms stay bypasses' (C3). python's rule got the twin fix (the test has no stated contract: c and embedded_python count safety's planted assert, and perl's Test::More::ok( fires the rule twice #2852 twin-parity lesson) — python's own cell never showed it only because python's bypass plant uses Any/cast.
  • haskell 3 → 2 — a.hs's plant was only a type signature (probeSafety :: Maybe Int -> Either Int Int, counted via the Maybe/Either constructors: the typescript-type-keywords-count-as-safety question, generalized as C1) and c.hs's finally was cleanup's plant counting twice (haskell-finally-dual-cleanup-safety, resolved: cleanup owns bracket|finally|onException, verified).

Measured with no red cell, fixed in the same layer (15 rules edited)

cobol END-* block closers 2500 → 68 (DECLARATIVES/VALIDATE/CHECK stay, hyphen-guarded; ON ERROR/AT END stay branch's per #2822's disposition); shell quoted-expansion 2985 → 777 (${VAR:-fallback} stays — it is the value-level fallback form); rust type/constructor tokens 3182 → 316 (keeps if-let/while-let/let-else, the unwrap_or family, None => arms); lua error(/type/iteration 4438 → 3660; scala 321 → 1 (Try counts in call/block form only); python drops declaration-level tokens and bare getattr (reflection_metaprogramming's); go drops errors.New (C2), sync.* (C3), context.Context (C1); java/groovy drop bare Optional, @Immutable, @Transactional; kotlin drops error/sealed/Result/fold; livecode drops throw (C2 — panics_and_aborts keeps the raise, batch4's last safety-side dual retires); objective-c drops bare nil/Nil/NSError (31 → 0, an honest zero) and assembly drops frame mechanics for the hardening instructions (54 → 0, same shape).

Bless scope (golden masters re-blessed from crucible v1.2.0)

1429 diffs, 0 topological, newly parsed/excluded none. Leaf keys: Defensive Programming Constructs, Error & Exception Exposure, safety_score/avg_safety_score, verification/Testing Exposure (_calc_verification reads safety per-function — verified in source), and the high_risk×safety dampener trio (Mitigated Danger / High-Risk Weighted View / Contextual Mitigations) — exactly the signal and the formulas that read it.

Gauntlet

Full suite green except the two known-baseline items (security_auditor ML deps; test_committed_fidelity_table_is_fresh_against_the_corpus, stale on main since keyword-rosetta#74 — the epic's housekeeping item, not this layer). ruff/mypy/dead-key audits: no new findings. rosetta_audit vs the corpus branch: 46/46.

Cross-repo

Corpus re-bless PR: squid-protocol/keyword-rosetta#101 — re-plants for the six plants authored to removed tokens (haskell value-level, rust fallback forms, go recover()×2 keeping context.Context for encapsulation 4, assembly hardening instructions, scala require/assume, groovy assert, livecode catch tError — a bare try line shifts livecode's lens block structure and creates a phantom api_orphan_credit, found by one-file scans), the two manifest cell moves, and the ledger verdicts. Merge order: engine first.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y6GxeANZdsik3h7xNzophv

…s corollaries, re-bless

One hit is a site that handles or forestalls a runtime failure at the
value level -- a guarded region's opener or its typed handler, a runtime
assertion or validation call, a fallback or handled-absence form, an
installed failure handler or watchdog, or a hardening instruction -- in a
form an ordinary identifier, type annotation or constructor cannot match.

The two open cells: embedded_python counted the safety_bypasses plant's
bare except: as safety (typed-handler form now, twin-fixed in python);
haskell counted a type-signature plant (Maybe/Either constructors, C1)
and cleanup's finally (C3, ledger dual resolved). Sheet row stated
(10/68), doc + 51 contract pins added, golden masters re-blessed (scope:
safety + its formulas only, newly parsed/excluded none).

Closes #2869

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y6GxeANZdsik3h7xNzophv
@squid-protocol squid-protocol added the rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 02d7ec3 into main Sep 8, 2026
44 of 45 checks passed
@squid-protocol
squid-protocol deleted the fix/2869-safety-contract branch September 8, 2026 02:21
squid-protocol added a commit to squid-protocol/keyword-rosetta that referenced this pull request Sep 8, 2026
…level re-plants, ledger duals resolved (#101)

* safety contract re-bless (gitgalaxy#2869): two cells to the median, six value-level re-plants, ledger verdicts

embedded_python 4->2 (bare except: is safety_bypasses' alone), haskell
3->2 (type-signature plant re-planted as fromMaybe catch; finally is
cleanup's). rust/go/scala/assembly/groovy/livecode plants were authored
to removed tokens and re-planted at the value level, each screened so
only safety moves. haskell-finally-dual-cleanup-safety resolved;
safety-contract-2869 added. Report regenerated at full precision:
open-defect share 19 -> 17 of 2639, safety row uniform at 2.

Cross-repo: engine first (squid-protocol/gitgalaxy#2873).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y6GxeANZdsik3h7xNzophv

* orphan audit: scope batch4's safety token down (gitgalaxy#2869 left every safety cell in band)

The CI orphan-token audit flags batch4-dual-keyword-overlaps/safety as
newly orphaned -- correct, the contract removed the last safety-side
dual (livecode throw) and every comparable safety cell is in band, so
the token excuses nothing. Dropped from the entry's signal union with
the why recorded; baseline regenerated (16 -> 15, also absorbing the
resolved haskell-finally-dual-cleanup-safety/cleanup token).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y6GxeANZdsik3h7xNzophv

* docs: regenerate bias artifacts against engine main (gitgalaxy#2873)

Full-precision regen post-merge of keyword-rosetta#100; 0 unexplained
out-of-band cells; ledger_orphan_check/ledger_issue_check clean.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012zPD39y58Bfrr2Q45Z6djL

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge

Projects

None yet

1 participant