The Python curriculum uses match statements (structural pattern matching), which require Python 3.10+ — e.g. the seeded reference solutions in CurriculumBookCatalog.cs / CurriculumTextSeed.cs. On any deployment whose CodeExecution.PythonExecutable resolves to an older interpreter (observed locally with Python 3.9.6), students hit SyntaxError: invalid syntax on match event: for those lessons — with no operator signal.
Gap
PythonInterpreterProbeHostedService (in SpikerSoft.EventHandlers.CodeExecution) is a good boot-time degrade-loudly guard, but it only checks that the interpreter runs — it logs the version string and returns. It does not assert the version is new enough for the curriculum. So an old-but-present Python passes the probe, then silently fails kids mid-lesson. There is no MinimumPythonVersion config or version gate anywhere.
Fix (this ticket)
Add CodeExecution:MinimumPythonVersion config (default 3.10, documenting the curriculum's match requirement).
A pure, unit-tested PythonVersionGate helper: parse the python --version output (Python 3.11.2 → 3.11; handles stdout/stderr, junk, nulls) and compare to the configured floor.
Wire it into the boot probe: when the resolved interpreter is below the floor, log a loud, actionable WARNING naming the required version (non-fatal, matching the existing probe design so C# lessons keep working) instead of the current bare "ready" info line.
This is the same honesty/degrade-loudly posture as the Redis healthcheck (#372) and NodeAgent (#375) work: surface a silent failure at boot so ops (or a future auto-remediation sweep) can act, rather than letting students be the detector.
Not in scope
Making the probe fatal (kept non-fatal by design); bumping the actual deployed interpreter (that's an infra/Dockerfile action, surfaced by the new warning).
## Symptom
The Python curriculum uses `match` statements (structural pattern matching), which require **Python 3.10+** — e.g. the seeded reference solutions in `CurriculumBookCatalog.cs` / `CurriculumTextSeed.cs`. On any deployment whose `CodeExecution.PythonExecutable` resolves to an older interpreter (observed locally with Python 3.9.6), students hit `SyntaxError: invalid syntax` on `match event:` for those lessons — with no operator signal.
## Gap
`PythonInterpreterProbeHostedService` (in `SpikerSoft.EventHandlers.CodeExecution`) is a good boot-time degrade-loudly guard, but it only checks that the interpreter **runs** — it logs the version string and returns. It does **not** assert the version is new enough for the curriculum. So an old-but-present Python passes the probe, then silently fails kids mid-lesson. There is no `MinimumPythonVersion` config or version gate anywhere.
## Fix (this ticket)
- Add `CodeExecution:MinimumPythonVersion` config (default `3.10`, documenting the curriculum's `match` requirement).
- A pure, unit-tested `PythonVersionGate` helper: parse the `python --version` output (`Python 3.11.2` → `3.11`; handles stdout/stderr, junk, nulls) and compare to the configured floor.
- Wire it into the boot probe: when the resolved interpreter is below the floor, log a **loud, actionable WARNING** naming the required version (non-fatal, matching the existing probe design so C# lessons keep working) instead of the current bare "ready" info line.
This is the same honesty/degrade-loudly posture as the Redis healthcheck (#372) and NodeAgent (#375) work: surface a silent failure at boot so ops (or a future auto-remediation sweep) can act, rather than letting students be the detector.
## Not in scope
Making the probe fatal (kept non-fatal by design); bumping the actual deployed interpreter (that's an infra/Dockerfile action, surfaced by the new warning).
Resolved in spikersoft-backend PR #91 (merged to master). Added the pure PythonVersionGate (parse python --version, compare by major.minor), a CodeExecution:MinimumPythonVersion floor (default 3.10), and wired it into PythonInterpreterProbeHostedService — below-floor now logs a loud actionable WARNING at boot (non-fatal) instead of letting students hit SyntaxError on match. 21 new tests. Closing.
Follow-up (infra, not this ticket): ensure the CodeExecution worker's base image ships python3 ≥ 3.10 — the new boot warning makes a too-old interpreter visible in Seq if any deployment doesn't.
Resolved in spikersoft-backend PR #91 (merged to `master`). Added the pure `PythonVersionGate` (parse `python --version`, compare by major.minor), a `CodeExecution:MinimumPythonVersion` floor (default 3.10), and wired it into `PythonInterpreterProbeHostedService` — below-floor now logs a loud actionable WARNING at boot (non-fatal) instead of letting students hit `SyntaxError` on `match`. 21 new tests. Closing.
Follow-up (infra, not this ticket): ensure the CodeExecution worker's base image ships python3 ≥ 3.10 — the new boot warning makes a too-old interpreter visible in Seq if any deployment doesn't.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Symptom
The Python curriculum uses
matchstatements (structural pattern matching), which require Python 3.10+ — e.g. the seeded reference solutions inCurriculumBookCatalog.cs/CurriculumTextSeed.cs. On any deployment whoseCodeExecution.PythonExecutableresolves to an older interpreter (observed locally with Python 3.9.6), students hitSyntaxError: invalid syntaxonmatch event:for those lessons — with no operator signal.Gap
PythonInterpreterProbeHostedService(inSpikerSoft.EventHandlers.CodeExecution) is a good boot-time degrade-loudly guard, but it only checks that the interpreter runs — it logs the version string and returns. It does not assert the version is new enough for the curriculum. So an old-but-present Python passes the probe, then silently fails kids mid-lesson. There is noMinimumPythonVersionconfig or version gate anywhere.Fix (this ticket)
CodeExecution:MinimumPythonVersionconfig (default3.10, documenting the curriculum'smatchrequirement).PythonVersionGatehelper: parse thepython --versionoutput (Python 3.11.2→3.11; handles stdout/stderr, junk, nulls) and compare to the configured floor.This is the same honesty/degrade-loudly posture as the Redis healthcheck (#372) and NodeAgent (#375) work: surface a silent failure at boot so ops (or a future auto-remediation sweep) can act, rather than letting students be the detector.
Not in scope
Making the probe fatal (kept non-fatal by design); bumping the actual deployed interpreter (that's an infra/Dockerfile action, surfaced by the new warning).
Resolved in spikersoft-backend PR #91 (merged to
master). Added the purePythonVersionGate(parsepython --version, compare by major.minor), aCodeExecution:MinimumPythonVersionfloor (default 3.10), and wired it intoPythonInterpreterProbeHostedService— below-floor now logs a loud actionable WARNING at boot (non-fatal) instead of letting students hitSyntaxErroronmatch. 21 new tests. Closing.Follow-up (infra, not this ticket): ensure the CodeExecution worker's base image ships python3 ≥ 3.10 — the new boot warning makes a too-old interpreter visible in Seq if any deployment doesn't.