Skip to content

established.py is a MODULE — declare it, and record why an import scan says it is dead - #605

Merged
jobordu merged 1 commit into
mainfrom
teamlead/established-module
Sep 6, 2026
Merged

established.py is a MODULE — declare it, and record why an import scan says it is dead#605
jobordu merged 1 commit into
mainfrom
teamlead/established-module

Conversation

@jobordu

@jobordu jobordu commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

established.py was scored UNVERIFIABLE"it accepts --zzz-not-a-flag and exits 0." That is
true, and it describes a module, not a defective argument surface.

established.py    87 lines · 0 argparse · no __main__ · never reads argv
                  class NotEstablished · def established · def zero_is_a_finding

Declared # NOT-EXECUTABLE:, the form runmarker.py already carries.

BEFORE   ran 60 subject(s): 41 passed · 3 UNESTABLISHED · 7 UNVERIFIABLE
AFTER    ran 59 subject(s): 41 passed · 3 UNESTABLISHED · 6 UNVERIFIABLE
         established.py(not-executable)

⚠ The part worth keeping is a false zero of my own

An AST sweep over ast.Import / ast.ImportFrom reports 0 importers for this module — non-test
and test. ⚠ CONTROL: the same sweep scores runmarker at 14 and a nonexistent symbol at
0, so the probe works.

Its user is tools/job-log.py, at :71-75:

_m = types.ModuleType("established"); _m.__file__ = _est
established, NotEstablished = _m.established, _m.NotEstablished

A runtime module load is not an import node. AST cannot see it.

I switched to AST earlier today specifically to escape grep's use/mention problem — a
docstring usage example counted as an import, a line-anchored grep scoring two 200-line suites at
zero controls. AST fixed those and introduced the opposite blind spot: grep found this dependency
and AST did not.

⇒ Neither predicate is correct alone. Textual sees mentions as uses; structural sees only the uses
the language spells as structure.
The declaration now records this in the file, so the next import
census does not conclude the module is dead and delete it.

⚠ Not fixed here

The other six UNVERIFIABLE instruments — daintree-control, discriminates, fleet-identity,
pane-census, pipe-exit-scan, pretooluse-guard. Two real shapes:

A (4)  accepts `--zzz-not-a-flag` and exits 0     ⇒ no argument surface at all
B (2)  `--self-test --zzz-not-a-flag` exits 0     ⇒ flag matched, remainder DISCARDED

Both mean --self-test exiting 0 establishes nothing. The remedy already exists in this repo
(merge-guard.py, disposition-ratchet.py refuse unrecognised arguments alongside --self-test),
but these are other roles' tools and changing six argument surfaces in one PR is not this change.
Reported separately.

Verification

gate-selftests.sh --self-test exit 0
scripts/exit-code-gate.sh tools 'test_*.py' exit 0
scripts/check-tools-index.py exit 0
test_established.py exit 0
test_job_log.py exit 0 — its consumer, run because this file moved

🤖 Generated with Claude Code

https://claude.ai/code/session_01DTMf4EvaTEnDKXY47efRZZ

…n says it is dead

The gate scored it UNVERIFIABLE: "it accepts `--zzz-not-a-flag` and exits 0."
That is TRUE, and it describes a module rather than a defective argument surface.

    established.py    87 lines · 0 argparse · no __main__ · no argv read at all
                      class NotEstablished · def established · def zero_is_a_finding

⇒ Declared `# NOT-EXECUTABLE:`, the form runmarker.py already carries. Measured:

    BEFORE  ran 60 subject(s): 41 passed · 3 UNESTABLISHED · 7 UNVERIFIABLE
    AFTER   ran 59 subject(s): 41 passed · 3 UNESTABLISHED · 6 UNVERIFIABLE
            established.py(not-executable)

⚠ AND THE PART WORTH KEEPING IS A FALSE ZERO OF MY OWN.

An AST sweep over ast.Import / ast.ImportFrom reports **0 importers** for this
module — non-test AND test. The control says the probe works: runmarker scores 14
on the same sweep, a nonexistent symbol scores 0.

Its user is tools/job-log.py, which loads it at job-log.py:71-75 with

    _m = types.ModuleType("established"); _m.__file__ = _est
    established, NotEstablished = _m.established, _m.NotEstablished

⇒ A runtime module load is not an import node. AST cannot see it.

⛔ I switched to AST EARLIER TODAY specifically to escape grep's use/mention
problem — a docstring usage example counted as an import, a line-anchored grep
scoring two 200-line suites at zero controls. AST fixed those and introduced the
opposite blind spot: grep found this dependency and AST did not.

⇒ Neither predicate is correct alone. Textual sees mentions as uses; structural
sees only the uses the language spells as structure. The declaration now says so
in the file, so the next import census does not conclude this module is dead.

⚠ NOT FIXED HERE: the other six UNVERIFIABLE instruments. They are two real
argument-surface shapes — four accept ANY flag and exit 0; two match `--self-test`
and DISCARD the remainder — and they are other roles' tools. Reported separately.

gate --self-test 0 · exit-code-gate 0 · check-tools-index 0 ·
test_established 0 · test_job_log 0 (its consumer, run because this file moved).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTMf4EvaTEnDKXY47efRZZ
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 9dd48ca6-8540-43ce-ae1e-b2a504689fef

📥 Commits

Reviewing files that changed from the base of the PR and between d6dd175 and b91764b.

📒 Files selected for processing (1)
  • tools/established.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jobordu
jobordu merged commit e616eae into main Sep 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant