Skip to content

Python: struct_decorators is 0 for every function (decorated_by is filled) #8857

Closed

Description

@squid-protocol

What is wrong

struct_decorators is 0 for every Python function, although the function rows already know their decorators: decorated_by is filled for 4,156 of 72,044 functions in GitGalaxy's own code (staticmethod 1,952, property 728, classmethod 621, contextlib.contextmanager 391). The Python rule decorators (^[ \t]*@[\w.]+) exists and recorders/record_keeper.py maps decorators -> struct_decorators, so the column should count them.

Reproduce

class K:
    @staticmethod
    def deco():
        return 1

    @property
    def prop(self):
        return 2

Scan it: both functions have decorated_by set and struct_decorators == 0.

Expected

struct_decorators equals the number of decorators on the function (or the column is documented as intentionally unused and dropped from analysis_lens, which still lists "Decorators, Annotations & Attributes" and a log_density_struct_decorators feature).

Notes

This looks like a data-flow gap (the hit vector for the function is not carrying the rule), not a keyword gap. Worth checking whether other languages are also zero: across the 110 function columns only 54 ever fire on this repo, so some of the rest may be the same kind of break.

How this was found

A pilot that compares each function_data signal with what Python's own ast says the function does (72,044 functions of GitGalaxy's own code; see the pilot note, with corrections and one-function-per-case reproductions in temporal-crucible PR #188). This is part of the keyword-family validity epic (linked below once filed).

Rules for the fix

  • Any change to a keyword list adds or removes regex work, so time it: CPU seconds on keyword-rosetta and language-crucible before and after, and say the number in the PR.
  • If keyword-rosetta counts move, label the PR rosetta:rebless-owed and rebless as usual.
  • Add the case below as a test (one function per case, so a regression names itself).

Activity

  1. added
    bug
    data-integrity
    core-engine
    on Nov 21, 2026
  2. squid-protocol commented on Nov 21, 2026

    @squid-protocol
    OwnerAuthor

    Part of #8863 (keyword-family validity epic).

  3. squid-protocol commented on Nov 21, 2026

    @squid-protocol
    OwnerAuthor

    Claimed by promoter-bot host melek, lease renewed 2026-11-21T19:51Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:melek label.

  4. squid-protocol commented on Nov 21, 2026

    @squid-protocol
    OwnerAuthor

    Leftover sibling gap: TypeScript decorated class methods (@Input() f()) get no decorators hit in the function hit_vector (same cause: decorator above the function start). JavaScript and other languages with a decorators rule were not probed.

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

    bugclaim:melekcore-enginedata-integritypriority: medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions