Commit 62ec5f97595e7e94bb8da77cb525e9343398e974

Authored by tangwang
1 parent 092804bc

docs

Showing 2 changed files with 37 additions and 0 deletions   Show diff stats
AGENTS.md 0 → 100644
@@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
  1 +# Repository Guidelines
  2 +
  3 +## Project Structure & Module Organization
  4 +
  5 +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.
  6 +
  7 +## Build, Test, and Development Commands
  8 +
  9 +Run commands from the repository root unless noted:
  10 +
  11 +```bash
  12 +python3 -m pip install -r requirements.txt
  13 +make -C offline_tasks/collaboration
  14 +make -C offline_tasks/collaboration clean
  15 +python3 -m py_compile offline_tasks/scripts/i2i_swing.py
  16 +cd offline_tasks && python3 scripts/i2i_swing.py --lookback_days 7 --top_n 50 --debug
  17 +```
  18 +
  19 +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.
  20 +
  21 +## Coding Style & Naming Conventions
  22 +
  23 +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.
  24 +
  25 +## Testing Guidelines
  26 +
  27 +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.
  28 +
  29 +## Commit & Pull Request Guidelines
  30 +
  31 +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.
  32 +
  33 +## Security & Configuration
  34 +
  35 +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.
offline_tasks/sleep_and_run.sh 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +sleep 5h
  2 +sh run.sh > logs/log.run.0815 2>&1