Skip to content

guidestar_lens.py: orphaned README execution-trigger scanner (_extract_execution_triggers) never wired in #513

Closed

Description

@squid-protocol

What I found

While improving test coverage for gitgalaxy/core/guidestar_lens.py (part of a broader core-engine coverage/stress-testing pass), I found two related pieces of dead code:

  • GuideStarLens.README_TARGET_HEADERS (guidestar_lens.py:49) — a compiled regex meant to locate README section headers like Usage, Installation, CLI, Getting Started, etc.
  • GuideStarLens._extract_execution_triggers() (guidestar_lens.py:321) — a method that scans a block of text for command-line invocation patterns (python3 foo.py, node bar.js, ./script.sh, cargo run ..., go run ...) and, for each match, calls _inject_intent_lock(filename, predicted_lang, 0.85, "Execution Trigger (...)").

Both look like a deliberate, half-built feature: infer a file's language/intent from usage examples in a project's README, the same way the engine already does for package.json/Makefiles/.gitattributes via _scan_package_manifests, _scan_gitattributes, etc.

The problem: neither symbol is referenced anywhere else in gitgalaxy/ or tests/ (confirmed via grep -rn). scan_project_config() — the main orchestration method — only dispatches to:

  1. _scan_package_manifests()
  2. _scan_gitattributes()
  3. _scan_gitignore_evasion()
  4. _calculate_documentation_coverage()

There is no step that ever finds a README file, extracts its text, and calls _extract_execution_triggers() on it. The method and its regex are fully functional in isolation (I added a direct unit test, test_extract_execution_triggers_in_isolation, to lock in current behavior) but are unreachable in the real scanning pipeline.

Decision needed

This needs a product call, not just a code fix:

  1. Wire it up — add a step to scan_project_config() that locates README files (which ones? README.md only, case-insensitive variants, recursive vs. root-only?), extracts their text, and calls _extract_execution_triggers(). This would let the engine infer intent locks from usage examples the same way it does from manifests.
  2. Remove it — if this was an abandoned experiment, delete README_TARGET_HEADERS and _extract_execution_triggers() as dead code.

I didn't make this call myself since it involves scope decisions (which files count as "the README", root-only vs. recursive, confidence weighting vs. existing manifest-based locks) rather than a mechanical fix.

Context

Found during a broader pass improving gitgalaxy/core/* test coverage and stress-testing error paths. guidestar_lens.py itself is now at 100% coverage (up from 79%) as part of that work.

Activity

  1. added
    refactor
    core-engine
    priority: low
    on Oct 3, 2026
  2. added
    scope:infra
    on Oct 16, 2026
  3. removed this from the Side Quests 🗺️ milestone on Oct 16, 2026
  4. squid-protocol commented on Oct 24, 2026

    @squid-protocol
    OwnerAuthor

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

  5. squid-protocol commented on Oct 24, 2026

    @squid-protocol
    OwnerAuthor

    Closing: the orphaned scanner, its header regex and config key were removed in #5438, and the last stale mock key in #6358; git grep finds none of the symbols on main.

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

    claim:melekcore-enginepriority: lowrefactorscope:infra

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions