orthonym.rules.sulfonamides#

Note

Internal API. Names and behaviour may change between releases.

N-substituted sulfonamides — (chalcogen-acid amides).

THE DEFECT THIS CLOSES#

secondary_sulfonamide / tertiary_sulfonamide were perceived (perception/functional_groups.py:236-238) and carried a SUFFIX_FORMS row (rules/seniority.py:562-564), but no producer ever rendered the N-substituent. Every path that reached one emitted a name for a DIFFERENT molecule and was killed downstream by the OPSIN self-consistency gate:

  • CS(=O)(=O)NC -> methanesulfonamide (N-methyl carbon DROPPED)

  • c1ccccc1S(=O)(=O)NC -> sulfanylbenzene (both =O, N and C dropped)

  • C1CCCCC1S(=O)(=O)NC -> carbamoylcyclohexane-1-sulfonamide (fabricated)

So the class did not “fail closed by design” — it fail-closed by ACCIDENT, one gate downstream of a wrong-constitution producer.

BLUE BOOK AUTHORITY#

**** “Sulfonamides, sulfinamides, and related selenium and tellurium amides” (the Blue Book Blue Book):

“Sulfonamides, sulfinamides, and the analogous selenium and tellurium amides are named substitutively using the following suffixes: -SO2-NH2 sulfonamide (preselected suffix)… These suffixes may be assigned to any position of a parent hydride.”

with CH3-SO2-NH2 methanesulfonamide (PIN) (:32752).

**** “N-Substitution” / **** (:32774) — the sentence that governs the italic locant, quoted with its operative clause:

“Substituted primary amides, with general structures such as R-CO-NHR’ and R-CO-NR’R’’, AND THE CORRESPONDING AMIDES DERIVED FROM CHALCOGEN ACIDS are named by citing the substituents R’ and R’’ as prefixes preceded by the locant N when one amide group is present.”

A sulfonamide is an amide of a sulfur (chalcogen) acid, so the N- locant is REQUIRED — this is derived from the rule, not inferred from the carbamate pattern. The Blue Book’s own sulfonamide (PIN) rows confirm the spelling: N^3-ethyl-N^1-methylnaphthalene-1,3-disulfonamide (PIN) (:32805), 3-chloro-N-(2-chlorophenyl)naphthalene-2-sulfonamide (PIN) (:32881), N-carbamoylbenzenesulfonamide (PIN) (:33362), N-hydroxymethanesulfonamide (PIN) (:38338).

:32881 also fixes the negative boundary: it cites 2',3-dichloronaphthalene-2-sulfonanilide as the NON-preferred alternative, so the anilide contraction must never be emitted for an N-phenyl sulfonamide.

DESIGN — no count stands in for a structure proof#

Per internal notes the parent is never derived from an atom count. Instead the N-substituent branches are EXCISED from the real molecule and the residual R-SO2-NH2 is named by re-entering the naming pipeline, exactly as handlers/hydroximic_acid.py:92 does. That has three consequences worth stating:

  • the parent spelling is whatever the already-verified PRIMARY sulfonamide path produces — methanesulfonamide, benzenesulfonamide, cyclohexane-1-sulfonamide — so the parent name is never spelled twice here (the second documented anti-pattern);

  • any parent the pipeline cannot name makes the whole name fail closed;

  • recursion terminates: the excised parent is a strictly smaller molecule whose principal group is primary_sulfonamide, a different class from the one this module owns.

MEASURED CLASS BOUNDARY (fails closed outside it)#

  • acyclic amide N only. A RING nitrogen (CS(=O)(=O)N1CCCCC1) is refused — its PIN is 1-(methanesulfonyl)piperidine, a sulfonyl PREFIX on a ring parent, not an N-substituted sulfonamide.

  • exactly one sulfonamide unit. Di- and polysulfonamides need the superscripted N^1/N^3 locants of, which are not built here.

  • sulfur only. Sulfinamides (-SO-NH2) and the Se/Te analogues have NO functional group perception in this tree at all, so even the UNSUBSTITUTED methanesulfinamide is unnameable; that is a separate unbuilt class.

  • carbon-attached N-substituents only.

MEASURED GUARD REDUNDANCY (do not “simplify” this away without re-measuring)#

12 mutations were applied to this module. Only THREE are killable at all – disabling _parent_hydride_is_unsubstituted, dropping the N- prefix, and allowing a heteroatom N-substituent. The other nine (ring N, >1 sulfonamide unit, the parent-suffix check, the empty-branch check, the sultam loop-back, >2 branches, branch disjointness, the two-=O count, branch ORDER) are EQUIVALENT MUTANTS: over a 33-molecule probe set covering every one of their target shapes, no input distinguishes mutant from original, because each is masked by an earlier guard – e.g. a ring nitrogen is rejected by IsInRing before the sultam loop-back can see it, and branch order is irrelevant because format_n_substitution sorts internally.

They are kept deliberately: each names a distinct refusal reason at the point a reader would look for it. But NONE of them is individually load-bearing today, so a test asserting one of them in isolation cannot fail, and a future edit that removes an EARLIER guard silently promotes a later one to load-bearing.

orthonym.rules.sulfonamides.n_substituted_sulfonamide_name(mol, style='pin')#

Return the PIN for an N-substituted sulfonamide, else None.

N-methylmethanesulfonamide, N,N-dimethylbenzenesulfonamide, N-phenylmethanesulfonamide. Fails closed on every shape outside the class documented in this module’s docstring.