Caught by re-running the staging probe after the last push: the new
"compile with no compiler" path was returning "No compiler specified
and no default compiler available" for c++ even though the language
clearly has a default. Root cause: the code did
`apiHandler.languages[lang]?.defaultCompiler`, but `defaultCompiler`
is NOT a field on the cached Language objects — it's pulled from
`apiHandler.options.options.defaultCompiler[id]` at the moment
`getAvailableLanguages()` builds its returned list. The mock test
that "passed" had stubbed the wrong shape.
- Add a focused public helper on ApiHandler:
`getDefaultCompilerFor(languageId)` that reaches into the private
options the same way getAvailableLanguages does.
- Compile tool now calls `apiHandler.getDefaultCompilerFor(...)`
instead of poking at `.languages[...]`.
- Update the test mock to stub `getDefaultCompilerFor` (the real
contract) rather than fabricating a `defaultCompiler` field on
`apiHandler.languages` (which never existed in production).
- Also strengthen the library-normalisation test to assert the
normalised version actually reaches `baseCompiler.compile(...)` —
it had been verifying findCompiler was called but not that the
result of normalisation was wired through. (No bug there now,
but the test wasn't proving what it claimed.)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>