3.3 KiB
3.3 KiB
Contributing
Thanks for considering a contribution.
Before you start
- Read DISCLAIMER.md and SECURITY.md.
- Do not commit secrets or local runtime files.
- Prefer small, focused pull requests.
Development setup
git clone https://github.com/dengyie/ai-register-machine.git
cd ai-register-machine
# outsider path (Grok simple config)
bash scripts/setup_simple.sh
# or full template
uv sync --extra dev
cp config.example.json config.json
# optional: mail_credentials for live mail tests only
bash scripts/doctor_secrets.sh # hygiene; never prints secret contents
Python 3.13 is required (requires-python in pyproject.toml). Install via uv: uv python install 3.13.
Repo layout (multi-provider) — see ARCHITECTURE.md:
register_cli.py/grok_register_ttk.py/cpa_xai/— Grok production path (root until migrate)providers/mimo/— MiMo production path (Node)providers/_template/— copy-me for new products (docs/ADDING_PROVIDER.md)register_core/— layered orchestration (not a browser rewrite)./register.sh/Makefile— unified hub + dev targetsapps/,docs/,examples/,tests/— entry map, how-tos, samples, unit tests
Tests
Offline (default, used by CI):
make test # or: uv run python -m pytest -q
make test-unit
make syntax
bash -n scripts/setup_simple.sh scripts/doctor_secrets.sh register.sh
bash scripts/doctor_secrets.sh || test $? -eq 2
Live Hotmail REST (needs real mail_credentials.txt, not for CI):
GROK_REGISTER_LIVE=1 uv run python test_hotmail_rest_code.py
Syntax check (CI also compiles grok_register_ttk.py and scripts):
uv run python -m py_compile register_cli.py grok_register_ttk.py cpa_export.py account_backup.py cpa_xai/*.py
Coding guidelines
- Match existing style; avoid drive-by refactors in
grok_register_ttk.py(~5k lines). Prefer extract-with-tests if you must split; do not “clean up while here.” - Keep changes scoped to the bug/feature
- Add or extend offline tests when fixing logic (prefer behavior tests over source-string contracts when practical)
- Never log raw passwords, refresh tokens, or access tokens
- Document user-facing config keys in
config.example.json/config.simple.example.jsoncomment keys - SSO handling: only use
cpa_xai.accounts.normalize_sso_cookie/format_account_line. Do not invent a second strip rule. Normalize must stay at mint core + ledger write (CLI/GUI). - CPA export path: production register and default backfill go through
cpa_export.export_cpa_xai_for_accountso remote inject / backup hooks stay consistent. Do not reintroduce “mint only” as the default backfill path. - Chat gate: free Build product success requires chat probe when enabled;
entitlement_deniedmust not soft-pass or remint-spin. - Config booleans: use
_config_bool(or equivalent) so string"false"is false.
Pull requests
- Describe what and why
- Note how you tested (offline / live)
- Confirm no secrets are included (
git status, diff review) - Link related issues when applicable
Issue reports
Include OS, Python version, proxy yes/no, headed/headless, and redacted logs. Do not paste SSO cookies, OIDC tokens, or mailbox refresh tokens.