Skip to content

chore: repo skeleton, tooling and GET /healthz - #1

Merged
RohanReddy44 merged 11 commits into
mainfrom
chore/skeleton
Sep 23, 2026
Merged

RohanReddy44 merged 11 commits into
mainfrom
chore/skeleton

Conversation

@RohanReddy44

Copy link
Copy Markdown
Collaborator

What

The Experience API's skeleton. An installable package that boots, and answers GET /healthz. Five gates run on every commit and in CI: ruff, ruff format, pyright, vulture and pytest.

  • create_app() with a lifespan, which is the composition root.
  • GET /healthz, for Docker and the front proxy. It does not probe the DSS, and it is not in the OpenAPI document.
  • tests/test_boundaries.py enforces the architecture's dependency rule (§4.1). It reads imports from the AST, resolving relative and dynamic ones, and ruff also bans relative imports. A service may import only its own domain and ports. Config reaches it as plain values, so only app.py reads settings.
  • pre-commit runs lint, types and dead code on every commit, and the test suite before every push.
  • A README with run and check instructions, and a CHANGELOG.

Why

This is the first phase of the build. The tooling and the dependency rule are in place before any feature code arrives.

Testing

  • Every commit is green on its own under all the gates that exist at that commit.
  • The boundary checker is tested on temporary trees: one tree that uses every allowed import, plus 14 ways to break the rule.
  • Run locally: uv run uvicorn --factory experience_api.app:create_app --port 8078, then curl -i localhost:8078/healthz.

🤖 Generated with Claude Code

- `scripts` in ruff's paths and isort, and pytest's `pythonpath`, served DSS folders.
- This repo has neither, so the settings and their comments explained nothing.
- The e2e marker named an env var from before the prefix was settled.
- The composition root, with nothing wired yet.
- `asgi-lifespan` (dev) runs the lifespan, which httpx's ASGI transport does not.
- For Docker and the front proxy. Not in the contract, so not in the OpenAPI document.
- Says the process is up. It does not probe the DSS, so an outage keeps it in rotation.
- Architecture §4.1 as an AST walk: each module's layer, by path, limits its imports.
- Relative and dynamic imports are resolved; a module that fits no layer fails too.
- A service takes config as plain values; only app.py may read Settings.
- A second feature is reachable only through its package, never its insides.
- ruff bans relative imports, so the easy bypass is never written.
- Same workflow as the DSS: uv sync --locked, ruff check, ruff format --check, pytest.
- Ruff and the usual hygiene hooks on commit; the test suite on push.
- `pre-commit` is a dev dependency: hooks install with `uv run`, no global tool.
- `standard` mode, on every commit and in CI. Ruff does not check types; this does.
- The hook runs whatever changed, since pyproject.toml alone can loosen the check.
- Unused functions, classes, imports and variables fail every commit and CI.
- A route's HTTP-verb decorator counts as a use, since FastAPI calls it, not our code.
- `vulture_whitelist.py` is one of vulture's paths, so a name it lists counts as used.
- Ruff ignores B018 and F821 there; the file is outside pyright's `include`.
- Ships empty; its docstring says how to add an entry.
@RohanReddy44
RohanReddy44 merged commit 8273368 into main Sep 23, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant