Contributing
Contributing
Read when: changing tlnt's code, docs or release process.
Development setup
Use Python 3.11–3.14 and uv:
uv sync --group dev --group docs
uv run tlnt --help
Preview the documentation locally:
uv run --group docs mkdocs serve
Checks
Run the focused documentation contract and the complete verification set:
uv run pytest tests/test_docs_contract.py -q
uv run --group docs mkdocs build --strict
uv run pytest
uv build
Tests use fakes, temporary session paths, and mocked
HTTP transports. They must not contact Talenta, use real credentials, or
submit attendance. tests/conftest.py also stubs the Google Play, PyPI and
status.mekari.com lookups and their cache path, so no test reaches any of
them or the real user cache.
Architecture
tlnt signs in once through a browser, keeps a mobile OAuth token in a
private session file, and calls Talenta's mobile API with it. Each package has
one job:
| Package | Responsibility |
|---|---|
src/tlnt/cli/ |
Typer app, shared options, prompts, confirmation, output and require_writable (the TALENTA_READONLY guard). |
src/tlnt/cli/commands/ |
One module per command group; flags, validation and the call into a service. |
src/tlnt/core/ |
MekariClient and its result codes (client.py), endpoints and DEFAULT_APP_VERSION (mekari.py), session file, config and models. |
src/tlnt/core/services/ |
Token, session and company resolution in front of the client; the thin wrappers are the seam CLI tests patch. |
src/tlnt/browser/ |
Login: Playwright with installed Chrome or Edge, a running browser over CDP, or the ego and Yab scripts; PKCE. |
Data flows one way: command → service → MekariClient → HTTP. Only login
writes the session file, and only setup writes config.json.
Compatibility boundaries
Command names, flags, environment variables, JSON fields, result codes and the
session file format are contracts. Keep them when reorganizing internals, and
let release-please's changelog announce any intended change. The nightly
approver depends on notification attendance-list, notification
timeoff-list, attendance approve and timeoff approve, their flags, and the
codes attendance_approved, timeoff_approved, *_approval_cancelled and
no_pending_approvals; treat those as fixed.
Public behavior to preserve
The public command families are setup, login, logout, status, profile,
attendance clock-in, attendance clock-out,
attendance approve, notification count, notification list,
notification attendance-list, notification timeoff-list,
notification detail, timeoff approve, and update.
The general options are --version, --verbose, --config, and
--json where supported. --config selects a file for one invocation.
Repeat it when a later command needs settings from a non-default file;
environment variables and the default OS config path need no flag.
Attendance supports --dry-run, --notes, and --selfie; notification lists
support --page, --query, and --status.
Keep these boundaries unchanged:
- Login is explicit and runs through Playwright (Chrome/Edge, or a running browser attached over CDP); credentials are entered on Mekari's page, by you or typed there by tlnt from
--email, and are never stored. - Session files stay outside the repository with
0700/0600permissions. - Passwords, bearer tokens, cookies, authorization codes, CSRF values, request bodies, and selfie contents never appear in logs or JSON.
- Live attendance and approval remain human-confirmed.
TALENTA_READONLY=1refuses every command that would change Talenta or local state.- The Google Play, PyPI and status.mekari.com checks write to stderr only, are
skipped for
update, and fail silently. - Stable JSON result codes remain unchanged.
When changing public behavior, update the README, canonical docs, and
skills/tlnt-cli/SKILL.md together.
Talenta app version
.github/workflows/app-version.yml runs every Monday, and on demand with
gh workflow run app-version.yml. It reads the latest Talenta version from
Google Play and, when it is newer than DEFAULT_APP_VERSION in
src/tlnt/core/mekari.py, opens a fix(config) pull request
that changes only that fallback. It runs pytest first, because GitHub does not
run CI on pull requests opened with the workflow token. It fails when Google Play
cannot be read, so a changed page format is noticed. tlnt setup writes that
fallback into new config files, so no doc carries a version to bump.