# Behavior traces — krahets/hello-algo

> Canonical page: https://codevetter.com/unpack/hello-algo/behavior-traces

# Behavior traces — krahets/hello-algo

Scanned commit 28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9 (2026-08-18). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Key flows traced end-to-end: (1) the Docker build that produces and serves the five-locale site; (2) the Python CI lane that lints then executes every sample via a glob-and-subprocess harness; (3) a reader's page view, where markdown tabs, animation frames, MathJax and giscus all hydrate client-side; (4) adding a Rust sample, which requires a manual [[bin]] registry entry before cargo run works; and (5) the Go lane where driver code lives in _test.go files executed by 'go test'.
- Docker site-build trace: FROM python:3.10.0-alpine → ENV PIP_INDEX_URL → pip install mkdocs-material==9.5.5 mkdocs-glightbox → COPY overrides ./build/overrides and docs ./build/docs → mkdocs build → for each locale COPY <loc>/docs ./build/<loc>/docs + <loc>/mkdocs.yml → mkdocs build → WORKDIR site → EXPOSE 8000 → CMD python -m http.server 8000. — [Dockerfile#L1-38](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/Dockerfile#L1-L38)
- Python CI trace (python.yml): paths filter on codes/python/** and en/codes/python/** → matrix os×python-version×code-dir → actions/checkout@v4 → setup-python 3.10 → pip install black → 'black <code-dir>' lint → 'cd <code-dir> && python test_all.py' which globs and subprocess-runs every chapter_*/*.py. — [.github/workflows/python.yml#L6-46](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/workflows/python.yml#L6-L46) [codes/python/test_all.py](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/python/test_all.py)
- Reader page-view trace: mkdocs renders the .md page → pymdownx.tabbed emits per-language code tabs and <N> frame tabs → glightbox plugin enables image zoom → mathjax.js re-typesets formulas on navigation → '??? pythontutor' renders a collapsible link → if page.meta.comments, comments.html injects giscus and syncs its theme to the palette. — [mkdocs.yml#L96-155](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/mkdocs.yml#L96-L155) [overrides/javascripts/mathjax.js](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/overrides/javascripts/mathjax.js) [overrides/partials/comments.html](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/overrides/partials/comments.html) [docs/chapter_array_and_linkedlist/array.md#L129](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/docs/chapter_array_and_linkedlist/array.md#L129)
- Add-a-Rust-sample trace: create codes/rust/chapter_x/foo.rs with a fn main() driver → register a [[bin]] block ('name' + 'path') in codes/rust/Cargo.toml → run 'cargo run --bin foo' locally → CI rust.yml runs 'cargo build' and 'cargo build --release' on ubuntu/macos/windows with the nightly toolchain. — [codes/rust/Cargo.toml#L7-45](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/rust/Cargo.toml#L7-L45) [.github/workflows/rust.yml](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/workflows/rust.yml) [codes/rust/chapter_array_and_linkedlist/array.rs](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/rust/chapter_array_and_linkedlist/array.rs)
- Go sample trace: sample logic lives in chapter_*/*.go as package chapter_* functions (e.g. randomAccess/extend/insert/remove in array.go); the 'Driver Code' is a TestXxx(t *testing.T) func in a sibling _test.go file that fmt.Printlns each step → 'go build ./...' + 'go test -v ./...' in go.yml exercises it. — [codes/go/chapter_array_and_linkedlist/array.go#L1-45](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/go/chapter_array_and_linkedlist/array.go#L1-L45) [codes/go/chapter_array_and_linkedlist/array_test.go#L16-40](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/go/chapter_array_and_linkedlist/array_test.go#L16-L40) [.github/workflows/go.yml](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/workflows/go.yml)
- C build trace: root codes/c/CMakeLists.txt sets C11, includes ./utils (or include dir), and add_subdirectory's each chapter; each chapter CMakeLists declares add_executable(<name> <name>.c) per sample → CI c.yml runs cmake -B build with gcc/clang/cl matrix → cmake --build → ctest. — [codes/c/CMakeLists.txt](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/c/CMakeLists.txt) [codes/c/chapter_array_and_linkedlist/CMakeLists.txt](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/c/chapter_array_and_linkedlist/CMakeLists.txt) [.github/workflows/c.yml#L60-85](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/workflows/c.yml#L60-L85)
- TypeScript check trace: chapter .ts files are plain scripts with a '// Driver Code' tail; tsconfig.json includes only 'chapter_*/*.ts' with noEmit → 'npm run check' invokes bare tsc → typescript.yml runs npm install + npm run check per OS per code-dir (codes/typescript and en/codes/typescript). — [codes/typescript/tsconfig.json](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/typescript/tsconfig.json) [codes/typescript/package.json](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/typescript/package.json) [.github/workflows/typescript.yml](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/workflows/typescript.yml) [codes/typescript/chapter_array_and_linkedlist/array.ts](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/typescript/chapter_array_and_linkedlist/array.ts)
- Docs contribution trace: reader clicks the edit icon rendered by partials/actions.html → edit_uri jumps to github.com/.../tree/main/docs → fork → edit markdown → PR opened → pull_request_template.md forces a checklist choice (translation vs code) and demands console output parity with the Python/Java reference for code PRs. — [overrides/partials/actions.html#L1-30](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/overrides/partials/actions.html#L1-L30) [mkdocs.yml#L11](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/mkdocs.yml#L11) [.github/pull_request_template.md](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/pull_request_template.md) [docs/chapter_appendix/contribution.md](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/docs/chapter_appendix/contribution.md)
- Translation pipeline trace: per en/CONTRIBUTING.md, Chinese source docs → AI/LLM first-pass translation → human optimization → PR with two-reviewer approval → merged en/docs tree consumed by the en mkdocs build stage in the Dockerfile. — [en/CONTRIBUTING.md](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/en/CONTRIBUTING.md) [.github/pull_request_template.md](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/pull_request_template.md) [Dockerfile#L24-26](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/Dockerfile#L24-L26)
- Locale-code divergence trace: en/codes mirrors codes/ file-for-file (same 89 .py files for python) but with English comments/docstrings — e.g. en array.py translates '随机访问元素' to 'Random access to element' while keeping identical logic — so every code edit must be applied twice. — [en/codes/python/chapter_array_and_linkedlist/array.py](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/en/codes/python/chapter_array_and_linkedlist/array.py) [codes/python/chapter_array_and_linkedlist/array.py](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/python/chapter_array_and_linkedlist/array.py)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
