AGENTS.md 3.02 KB

Repository Guidelines

Project Structure & Module Organization

The main code lives in offline_tasks/. Put algorithms in offline_tasks/scripts/, shared settings in offline_tasks/config/offline_config.py, and operational notes in offline_tasks/doc/. C++11 Swing code is under offline_tasks/collaboration/, with sources, headers, utilities, and binaries in src/, include/, utils/, and bin/. DeepWalk and Session Word2Vec experiments live in graphembedding/; refers/ contains reference integrations. Diagnostic scripts are in offline_tasks/test/ and offline_tasks/test_*.py. Generated data, models, logs, and outputs must remain untracked.

Build, Test, and Development Commands

Run commands from the repository root unless noted:

python3 -m pip install -r requirements.txt
make -C offline_tasks/collaboration
make -C offline_tasks/collaboration clean
python3 -m py_compile offline_tasks/scripts/i2i_swing.py
cd offline_tasks && python3 scripts/i2i_swing.py --lookback_days 7 --top_n 50 --debug

The first command installs Python dependencies; make builds or removes the three C++ binaries. Use a short lookback and debug mode during development. offline_tasks/run.sh is production-oriented: it uses hard-coded paths, terminates matching task processes, contacts external services, and loads Redis. Confirm all targets before running it.

Coding Style & Naming Conventions

Use four-space indentation and PEP 8 conventions for Python: snake_case for modules, functions, and variables; PascalCase for classes; and UPPER_SNAKE_CASE for constants. Algorithm scripts generally expose an argparse-driven main() and separate fetch, process, and save steps. Preserve C++11 compatibility and surrounding style. No formatter or linter is configured.

Testing Guidelines

There is no centralized test runner or coverage threshold. Tests are standalone diagnostic scripts and often require live infrastructure. Run the in-memory check with cd offline_tasks && python3 test_new_dimensions.py; use python3 test_connection.py for MySQL/Redis and python3 scripts/test_es_connection.py for Elasticsearch only when approved service targets are available. Name new focused checks test_*.py; database exploration scripts follow check_*.py or query_*.py under offline_tasks/test/. Report commands and observed results in the PR.

Commit & Pull Request Guidelines

Follow the recent type(scope): summary style, for example fix(offline): handle empty item IDs. Keep commits focused; explain rationale, operational impact, and validation in the body for broad changes. PRs should summarize affected modules and behavior, link relevant issues, list validation results, and call out configuration, data-format, resource, or rollout effects.

Security & Configuration

Do not add credentials or copy existing secrets into documentation, logs, fixtures, or commits. Prefer environment variables or ignored local configuration for new settings, and verify database, Redis, and Elasticsearch destinations before any integration run.