feat(explore): U4 kallsted 2 - hostet explore_prompt, og whitelisten blir en TREDELING (ORDRE 20260823T204216Z) [skip-docs]
Kallsted (2) av oerkt 57s fire. explore_prompt + explore_contract whitelistes paa den hostede flaten. De er ikke run_project-parametre - utforskningen kjoerer FOERST og gir run_project et Mandate - saa de KONSUMERES i stedet for aa videresendes, og whitelisten er dermed en TREDELING (_REQUIRED / _OPTIONAL / _CONSUMED). Ett sted (_run_kwargs) avgjoer hvilke felt som naar signaturen: et konsumert felt som blir liggende i kwargs er et argument run_project ikke har, som containeren svarer 500 paa for det som egentlig er en wiring-feil. FASE 4e-REGELEN UTVIDET MED EN NEGATIV HALVDEL, og det var paakrevd: 4e-testen sender HVERT whitelistet felt gjennom den EKTE run_project og asserterer dekning mot _ALLOWED_FIELDS - en assert et konsumert felt ALDRI kan oppfylle. Den positive halvdelen dekker naa _REQUIRED|_OPTIONAL (hvert felt maalt mot inspect.signature(run_project)), og den negative at _CONSUMED er DISJUNKT fra samme signatur. Uten den ville et felt som glir fra konsumert til videresendt vaere nettopp driften 4e finnes for. Fire nekter, alle ved navn og alle paa KALLERENS kanal (400): explore_contract uten explore_prompt - explore_prompt uten explore_contract - explore_prompt uten bundle_dir - enable_plan_review=true. Den siste er nektet HER og ikke i explore(), som ogsaa nekter den: ExplorationError er en RuntimeError, saa aa overlate den til sloeyfa ville svart en kallers konfigurasjonsfeil paa KRASJ-kanalen (500) - samme sammenblanding BudgetExceeded fikk sin egen 429 for aa avslutte. U13-doera er dessuten SYNKRON: den blokkerer sloeyfa paa et menneske, og en HTTP-forespoersel har ingen - invocationen ville hengt i stedet for aa svare. TracingConfigError er derimot en ValueError, saa 400- armen dekket den alt (verifisert, ikke antatt). Load-bearing MAALT (tests/test_explore_callsites_loadbearing.py, 6 nye tester), fire mutasjoner alle roede mot HELE suiten + groenn kontroll 996/5: videresend de konsumerte feltene igjen (2 roede) - detach mandate=-wiringen (1 roed) - detach enable_plan_review-nekten (1) - detach bundle_dir-kravet (1). Golden-transkriptet byte-uendret (ea8c534773acdbe41ae68f2c55724d69aaf8be4f). mypy + ruff rene. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YRZhBJcxqTcqWyMW6hBttx
This commit is contained in:
parent
8ba824c96f
commit
234c8d138a
3 changed files with 242 additions and 14 deletions
|
|
@ -507,8 +507,15 @@ async def test_invocations_answers_through_the_real_run_project(
|
|||
to break that are invisible to a recorder and fatal in a container: naming a field
|
||||
``run_project`` does not take, and passing it an argument twice. Both surface here as a 500.
|
||||
|
||||
The payload names EVERY whitelisted field, and the coverage assertion below is what keeps that
|
||||
true: a field added to the whitelist later cannot slip past this test unexercised."""
|
||||
The payload names every FORWARDED field, and the coverage assertion below is what keeps that
|
||||
true: a field added to the whitelist later cannot slip past this test unexercised.
|
||||
|
||||
The whitelist became a THREE-way partition when U4's ``explore_prompt`` arrived: those fields
|
||||
are accepted by the surface and CONSUMED by it (the exploration runs first and hands
|
||||
``run_project`` a mandate), so they can never satisfy a "reaches ``run_project``" assertion.
|
||||
The consumed half has its own, negative proof in
|
||||
``tests/test_explore_callsites_loadbearing.py`` — without it a field sliding from consumed to
|
||||
forwarded is exactly the drift 4e exists to catch."""
|
||||
payload = {
|
||||
"project_id": _BUNDLE_PID,
|
||||
"docs_dir": str(_BUNDLE_DIR),
|
||||
|
|
@ -522,10 +529,14 @@ async def test_invocations_answers_through_the_real_run_project(
|
|||
"max_tokens": 100_000,
|
||||
"top_k": 3,
|
||||
}
|
||||
assert set(payload) == hosting._ALLOWED_FIELDS, (
|
||||
"the payload must exercise every whitelisted field — a field the whitelist accepts but "
|
||||
assert set(payload) == set(hosting._REQUIRED_FIELDS) | set(hosting._OPTIONAL_FIELDS), (
|
||||
"the payload must exercise every FORWARDED field — a field the whitelist forwards but "
|
||||
"this test never sends is a field no test proves ``run_project`` accepts"
|
||||
)
|
||||
assert hosting._ALLOWED_FIELDS == set(payload) | set(hosting._CONSUMED_FIELDS), (
|
||||
"the whitelist is a three-way partition and this arm covers the forwarded half; a field "
|
||||
"in neither half would be accepted by the surface with nothing proving what it does"
|
||||
)
|
||||
|
||||
status, body = await _post(served, "/invocations", payload)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue