Skip to content

update method layout docs and add a CI check for it - #219

Merged
lacava merged 1 commit into
devfrom
docs-and-layout-guardrail
Aug 13, 2026
Merged

update method layout docs and add a CI check for it#219
lacava merged 1 commit into
devfrom
docs-and-layout-guardrail

Conversation

@lacava

@lacava lacava commented Aug 13, 2026

Copy link
Copy Markdown
Member

CONTRIBUTING.md and the PR template still describe the old single-directory layout, from before regressor.py moved into experiment/methods/ (b5c5c96, july 2024). back then CI copied the files over for you via scripts/copy_algorithm_files.sh, so contributors only touched algorithms/. that script is gone but the docs never got updated.

nothing catches the mistake either. the build-and-test matrix comes from ls algorithms/, so a method added only under experiment/methods/ never gets a job and the PR still goes all green. that's #211, which has 29 checks where a correct submission has 30. #212 is missing the init.py that copy_algorithm_files.sh used to create automatically.

docs:

  • CONTRIBUTING.md gets a section on where files go and why it's split that way, plus the commands to test locally. also fixes the regressor.py path, points at base_environment.yml instead of a nonexistent environment.yml, and defines the [metadata]/[regressor] links, which were never defined and have been rendering as literal text on the website.
  • PR template reorganized around the two directories.
  • local_ci.sh was still running the old conda flow and copying regressor.py in the obsolete direction, so it failed for any current submission. now it wraps the docker build/test commands.
  • small fixes in user_guide.md and README.md.

check:

  • scripts/check_method_layout.py verifies the two directories agree, that regressor.py defines est and model, and that install files aren't misplaced. it parses with ast so it doesn't need the method's dependencies.
  • runs in CI as validate-layout and gates build-and-test, so a misplaced submission fails in seconds instead of after ~27 docker builds.
  • legacy experiment/methods/ dirs and the 10 empty metadata.yml files are grandfathered so it passes on the current tree.

a few real problems it turned up, fixed here:

  • algorithms/eql/metadata.yml isn't valid yaml, the description block is unindented
  • experiment/methods/xgboost/init.py was missing
  • gplearn's regressor.py uses an invalid escape sequence, '(' -> r'('

Since b5c5c96 (2024-07) a method has spanned two directories: algorithms/
holds the install spec that is baked into the docker image, and
experiment/methods/ holds regressor.py, which is bind-mounted at run time.
Before that, CI copied regressor.py from algorithms/ into experiment/methods/
via scripts/copy_algorithm_files.sh, so contributors only touched one place.
That script is gone, but CONTRIBUTING.md and the PR template were never
updated and still describe the old single-directory flow.

Nothing catches the mistake. The build-and-test matrix is generated from
`ls algorithms/`, so a method added only under experiment/methods/ never gets
a matrix job and the PR shows a full set of green checks -- see #211, which
has 29 checks where a correct submission has 30.

Docs:
- CONTRIBUTING.md gains a "Where your files go" section with the layout, the
  reason for the split, and local test commands. Fixes the regressor.py
  location, points at base_environment.yml, lists the recognized eval_kwargs
  keys and the five time-limit attribute names, and defines the [metadata]
  and [regressor] reference links, which were never defined and rendered as
  literal text.
- The PR template is restructured around the two directories.
- local_ci.sh ran the retired conda flow and copied regressor.py in the
  obsolete direction; it now wraps the docker build/test commands.
- Small factual fixes in user_guide.md and README.md.

Guardrail:
- scripts/check_method_layout.py validates that the two directories agree,
  that regressor.py defines `est` and `model` (parsed via ast, so no
  dependencies are needed), and that install files are not misplaced.
  Legacy method dirs with no algorithms/ counterpart and the 10 empty
  metadata.yml files are grandfathered so the check passes on the current
  tree; new methods must satisfy both.
- A validate-layout job runs it and gates build-and-test, so a misplaced
  submission fails in seconds instead of after ~27 docker builds.

Three real problems this surfaced, fixed here:
- algorithms/eql/metadata.yml was not valid YAML (unindented block scalar)
- experiment/methods/xgboost/__init__.py was missing
- gplearn's regressor.py used an invalid escape sequence, '\(' -> r'\('

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lacava lacava changed the title docs: document the two-directory method layout, and enforce it in CI update method layout docs and add a CI check for it Aug 13, 2026
@lacava
lacava merged commit 64789c6 into dev Aug 13, 2026
30 checks passed
@lacava
lacava deleted the docs-and-layout-guardrail branch August 13, 2026 14:54
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