SEP: which severity decides blocking when `valid`, `severity` and `messages[].severity` disagree?

Aperta
#51 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, go, python

Direzione di ricerca

Start with the SEP sections at docs/sep.md lines 336-342, 784, 825-826 and 1310, then read the three current rules: csharp/sdk/src/ModelContextProtocol.Interceptors/Client/InterceptorChainOrchestrator.cs, go/sdk/interceptors/chain/chain.go, and the Python path landed in #30. The deliverable is a decision, not a patch: one stated rule for which signal decides blocking, what a severity-less invalid result does, and whether the summary is counted by the same rule, recorded in the SEP and then applied in all three SDKs with tests mirroring the four-row table. Expect working-group discussion on the issue first; #45 must be updated to match whatever is chosen.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A ValidationResult carries three signals that can disagree: valid, the top-level severity, and a severity on each entry in messages (interface). The SEP says that only severity: "error" blocks (summary, key semantics) and that the invoker rejects "if any has severity: error" (error handling). It does not say which of the signals decides, and the three SDKs each chose a different rule.

  • C# blocks when valid is false and the top-level severity is error (InterceptorChainOrchestrator.cs). Message severities are only counted.
  • Go blocks when valid is false and some message has severity error (chain.go). The top-level severity is not consulted.
  • Python (#30) uses the top-level severity when present, otherwise the messages, and blocks an invalid result that carries no severity at all.

The same result therefore gets different verdicts:

Result C# Go Python (#30)
valid: false, severity: "error", no messages blocks passes blocks
valid: false, no severity, one error message passes blocks blocks
valid: false, severity: "warn", one error message passes blocks passes
valid: false, no severity, no messages passes passes blocks

The C# and Go columns come from reading the code linked above. In the Python column, the third row was run and the fourth is covered by a test in #30; the first two come from reading the code.

Questions for the WG.

  1. Which signal decides blocking: the top-level severity, any message, or either?
  2. Does valid: false with no severity anywhere block (fail-secure) or pass?
  3. Is valid: true with severity: "error" malformed, or simply non-blocking?
  4. Should the validation summary be counted by the same rule as the verdict, so that a result cannot report an error and still pass?

#45 depends on the answer: it describes valid: false with severity: "error" as "an ordinary blocking error", which holds in C# and Python today but not in Go unless a message also carries error.

Found while reviewing #30.

🤖 Generated with Claude Code

Lingua principale
C#
Stelle
24
Fork
16
Merge medio
3m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/experimental-ext-interceptors

Tutte le issue di modelcontextprotocol/experimental-ext-interceptors

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.