Skip to content

_style_anchor finds no exemplars in any repo not laid out as a src/ package #13

Description

@lorenzoliuzzo

Found while running my-coder for real against an external target repo (a flat-layout Python project: model.py, main.py at the root, no src/).

_style_anchor filters candidate exemplars to paths under src/ or tests/ (coder.py:225):

exemplars = sorted(
    (p for p in listed if p.endswith(".py") and (p.startswith(("src/", "tests/")))),
    ...
)

Every fleet repo is scaffolded from my-template and so has src/, which is why this has never shown. Any other repo gets either the literal fallback

Existing code: (none yet — this is an early/greenfield repo).

on a repo full of code, or — as measured here — a single trivial file.

Measured, dumping the real prompt for an issue about model.py: the sole "representative existing file" was a 7-line tests/test_model.py. model.py — the file the issue is about, and the largest module in the repo — was not shown, while my-searcher had correctly ranked it first. The prompt then instructs the session to "match the conventions of the existing code shown above", so it matches a 7-line test.

Acceptance criteria

  • Exemplar selection is layout-agnostic: a flat-layout repo yields its real modules.
  • Directories that are noise rather than house style stay excluded (vendored code, generated files, the existing .venv/__pycache__ exclusions).
  • A test covering a flat-layout repo (no src/) that asserts a root-level module is picked as an exemplar.
  • The existing src/-layout behaviour is unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions