Skip to main content

Python First Verification

The first Python verification should prove async execution through a real provider, not just import generated modules.

1. Static package checks​

From the generated console directory, with the virtual environment and package installed as described in Python Quick Start:

python -m compileall app

Add application tests and declare their test dependencies before running python -m pytest -q; the generated console does not itself supply this suite. Use scoped Assist for exact terminal signatures instead of searching generated library source. Execution must receive trusted context; a second data-service argument must be rejected.

2. SQLite round trip​

Run the shared School SQLite example from a checkout of teaql-io-site:

npm run verify:school -- --language python

The complete Python application uses the same School model as the other six runtimes. The runner generates and builds the workspace, checks root/constant bootstrap twice, saves a school with an audit reason, then starts a new process to read it back. An independent SQLite checker verifies persisted fields and relationships after every phase. Logs, exit codes and row snapshots are retained under artifacts/school/.

3. Loaded-state check​

Run a partial projection containing a nullable field. Prove that a loaded null differs from an unselected field through the generated E facade. This prevents application logic from treating “not fetched” as a database null.

4. Governance failures​

Add tests for missing comment, missing purpose, uninitialized context, missing audit_as, stale version, unknown dynamic field/operator, invalid range/paging, and attempts to supply tenant, actor, permissions, provider, or policy in JSON. Expected behavior is an explicit error, never an empty or broader query.

with pytest.raises(TypeError):
await executable.execute_for_list(context, data_service)

The explicit arity test protects the context-only API from regression.

5. Native SQL check​

Retain a masked trace showing bound parameters, stable ordering, native aggregate SQL, and exact per-parent limits across at least two parents. Depending on runtime policy, SQLite can use bounded probes instead of a window plan. Rows, count, sum, and facets must share the same active filter.

6. Regeneration check​

Add a field, regenerate the whole package, reinstall it, compile, and rerun tests. Confirm centralized plural/predicate naming remains correct. Never preserve a manual edit under generated models/ or requests/.

Record Python/runtime/generator/provider versions, model hash, commands, exit codes, masked native response, and SQL shape as the baseline evidence.