Skip to content

state-flux ×3 branch-context weighting: undocumented, and phantom-triggered by branch keywords inside string literals #2546

Closed

Description

@squid-protocol

Summary

Behavior mapped by the #1096 control corpus, splitting into a deliberate half and an FP half:

  1. Deliberate: state_mutation is recorded ×3 when the mutation's enclosing function has branch context ("flux" weighting — micro-repro: one ada := inside a real if records 3; with no branch, 1). Scope is per-function, not per-file (go evidence: a file recorded 11 = one function's 3 raw ×3 + another function's 2 raw ×1).
  2. FP amplifier: because string literals are not shielded for branch (prism/detector: string-literal shielding is selective by signal family (if/try/open count inside a literal, eval does not) #2535), a branch keyword inside a string creates phantom branch context and triples unrelated real mutations in the same function. Micro-repro: an ada procedure with two real := and the literal "while" records state 6; with "plain words" it records 2.

Impact

Half 2 means one log message or SQL fragment containing if/while/for triples a function's measured state flux — feeding directly into risk_state_flux/cognitive-load scoring. Reproduced in 15 of the 23 corpus languages (every one whose state rule has raw hits alongside the decoy literal).

Ask

Document half 1 (it's invisible today — the corpus had to discover it by micro-repro); half 2 is fixed for free by whichever direction #2535 lands, but is called out separately because it's the highest-leverage scoring consequence of the literal-shielding question.

References

#1096 ledger state-flux-branch-weighting; #2535.

Activity

  1. added
    core-engine
    on Aug 31, 2026
  2. squid-protocol commented on Aug 31, 2026

    @squid-protocol
    OwnerAuthor

    Batch-4 addendum — three cleaner per-function scope proofs: matlab main.m records state 12 = one function's 3 raw ×3 + three functions' 1 raw ×1; powershell c.ps1's probe_debt stays ×1 (no return/branch in that function) while its sibling has context; dockerfile scopes flux per RUN instruction (4 = 1×3 + 1×1). The per-function claim in this issue is now confirmed in 5 independent shapes.

  3. added
    documentation
    metrics
    on Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-enginedocumentationmetrics

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions