The big idea
- Tests gate every commit. A Claude Code hook (
.claude/hooks/pre-commit-tests.sh, which Cursor runs too) runspython3 -m pytest -qon a copy of exactly what the commit will contain, and refuses the commit if anything fails. - The tests check rules, not just code: contracts in the docs equal contracts in the code;
config/follows its rules; no script types a ticker, event, year or path thatconfig/orcommon/defines; the clean files match their contracts; the streaming logic, the batch study, the comparison, the model’s features, the dashboard, the live feed, the recording and the published data each have their own tests. - These docs stay in sync the same way:
scripts/build_docs.pyregenerates the site, andtests/test_docs_site.pyfails if the site is out of date or a file has no place in the tour. - Shared AI context:
AGENTS.md(the team’s rules for any assistant),CLAUDE.md(Claude Code specifics), project skills (/sync,/handoff,/decision), a session-start hook that prints the team’s status, and a contract-checker subagent.
Read these files in this order
tests/test_contracts.py
tests/test_config.py
tests/test_event_calendar.py
tests/test_expand_events.py
tests/test_clean_files.py
tests/test_no_hardcoding.py
tests/test_streaming_signals.py
tests/test_eventstudy.py
tests/test_compare.py
tests/test_ml_features.py
tests/test_dashboard.py
tests/test_hosting.py
tests/test_docs_site.py
tests/test_ai_usage.py
tests/test_commit_hook.py
pyrightconfig.json
.gitignore
AGENTS.md
CLAUDE.md
.claude/settings.json
.claude/hooks/session-brief.sh
.claude/hooks/pre-commit-tests.sh
git commit, run the test suite on exactly what will be committed and block the commit if it fails. Exit code 2 tells Claude Code to block the tool call and show stderr to Claude. Read itscripts/build_docs.py
scripts/sync_docs_site.sh
scripts/sync_dashboard_app.sh
scripts/sync_live_stream.sh
project branch of the team’s private live-stream repository on github.com (decision 0015), so its workflow needs no access to github.sfu.ca. The copy is only what scripts/demo_live.sh needs: src/, config/, clean/master.parquet (the replay’s input), the demo script, requirements.txt and pyproject.toml. The model comes from Hugging Face. Read itscripts/install_git_hooks.sh
scripts/install_workflows.sh
project branch (scripts/sync_live_stream.sh). Read itCITATION.cff
Questions you should be able to answer
How do you know the project works?
How do you know the project works?
What happens when someone adds a new file?
What happens when someone adds a new file?
tests/test_docs_site.py fails until the file is placed in a chapter of docs-site/reading_order.json and the site is rebuilt, so the tour always covers the whole codebase.Why run git add and git commit separately?
Why run git add and git commit separately?
git add x && git commit the add has not happened yet, so the tests would miss it; the hook refuses that form.Ideas to improve it
- Run the same tests in CI on every push, so commits made without the hook are checked too.
- Add a small end-to-end test: replay a month of data through the job and compare with the batch study.