This standard keeps Orchid Ranker focused, maintainable, and easy to use as an outcome-driven adaptive recommender.
Orchid does one public job:
- fit chronological user outcomes;
- rank an application-provided candidate set;
- observe the result and adapt; and
- log decisions safely when evaluation requires it.
Do not introduce additional package-root models, policy selectors, domain engines, or tuning APIs. Lower-level algorithms may support the implementation and research, but they are not separate product surfaces.
- Start every new user-facing workflow from
AdaptiveRanker. - Keep
orchid_ranker.__all__limited toAdaptiveRanker. - Treat lower-level modules as implementation details, not alternate products.
- Keep the normal install complete:
pip install orchid-rankermust run the supported workflow without an extra. - Do not add compatibility shims or deprecated aliases. Make breaking changes explicitly and update the supported documentation in the same change.
- Use Python 3.11+ syntax that is accepted by the configured
mypyandruffsettings. - Type public functions, dataclasses, and return values. Avoid expanding
ignore_errorscoverage unless there is a concrete migration plan. - Use
logging.getLogger(__name__)in library code. Do not addprint()calls outside examples or scripts. - Prefer explicit validation errors over silent coercion for user-provided schema, tensor shape, and policy configuration.
- Keep randomness reproducible in tests and examples through
random_state, local RNG instances, or seeded torch/numpy calls. - Prefer small, direct functions over speculative abstractions.
- Use structured pandas, numpy, sklearn, and torch APIs rather than ad hoc string parsing or manual dtype guessing.
- Preserve chronological splits for fitting and policy evaluation. Do not leak future user outcomes into training examples or candidate features.
- Report policy quality with support diagnostics, clipped weights, and confidence intervals when making rollout claims.
- Treat benchmark results as evidence artifacts: include command, dataset shape, seeds, metrics, and limitations.
Every public change should have focused tests. Expand to the full suite when a change touches shared policy behavior, package exports, docs navigation, install contracts, or CI.
Local gates:
python -m ruff check .
python -m mypy src/orchid_ranker
python -m pytest tests -q
python -m mkdocs build --strict
python -m buildUse ./scripts/run_full_tests.sh --quick during development and
./scripts/run_full_tests.sh before review.
- Put the fastest successful path first: install, data shape, fit, recommend, observe, evaluate.
- Link runnable examples from guides.
- Update
README.md,docs/README.md,docs/index.md, andmkdocs.ymlwhen adding or moving public guides. - Keep benchmark and comparison claims precise. If evidence is not published, say what the benchmark is designed to measure instead of claiming a result.
A change is ready when it strengthens the single adaptive recommendation loop, uses neutral public terminology, has tests for public behavior, keeps docs discoverable, and passes the required quality gates.