sdk: caller-side label requirements are all-of in the SDKs, any-of in sam-node
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go, javascript, python
Direzione di ricerca
Start with sdk/README.md:40, api/datalog.go:641, sdk/python/src/agent_mesh/mcp_client.py:58, and sdk/js/src/mcp.ts:117. Run internal/node/labels_gate_test.go:77 and compare the same inputs against both SDK predicates. Confirm which semantics is authoritative, then make the affected checks and tests agree for empty, full, partial, and total matches.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The parity matrix in sdk/README.md:40 lists "Caller-side label requirements on the provider's credential" as yes for both SDKs. The semantics differ: sam-node treats the caller's required labels as any-of, both SDKs treat them as all-of.
The divergence
| semantics | code | |
|---|---|---|
sam-node |
any-of | api/datalog.go:641 — strings.Join(clauses, " or "), via checkPeerLabels |
| Python SDK | all-of | sdk/python/src/agent_mesh/mcp_client.py:58 |
| JS SDK | all-of | sdk/js/src/mcp.ts:117 |
Proof
Running the inputs from the Go test's own any-of requirement matches one key case (internal/node/labels_gate_test.go:77, expectErr: false) through the SDK predicate:
provider: {region: na-us, team: platform}
required: {region: eu, team: platform}
sam-node -> allowed (labels_gate_test.go:77 - observed PASS)
SDK -> LabelsNotSatisfiedError: missing region=eu
The two agree everywhere else. An empty requirement, a full match and a total mismatch all behave identically; the only divergence is more than one required pair with a partial match.
Impact
The SDKs are the stricter side, so this fails closed — all-of is a subset of any-of, and no SDK call is admitted that sam-node would refuse. The effect is availability: an agent that passes more than one required label is refused a provider the mesh would have allowed, and the same call succeeds through the sidecar.
Which side is authoritative
I read Go as the contract — the behaviour is pinned by a test case named for it, and mcp_client.py:49 documents itself as checkPeerLabels. But that is the question worth settling before either side moves: if all-of was the intent, then the Go check, its test and the header contract are what should change.
Offer
Happy to send the patch in whichever direction you pick — SDKs to any-of, or Go to all-of. Two files plus tests either way.
- Lingua principale
- Go
- Stelle
- 926
- Fork
- 138
- Merge medio
- 10h 37m
- PR unite (30g)
- 125
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/sam
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
google/sam#484 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Testnet hub is unhealthyApertatestnet-health
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
I maintainer di solito rispondono entro 1 giorno
-
PEP storyAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
-
Observability storyAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Database data migrationAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
enhancement low priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
eugenioenko/ttt#674 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Remove obsolete ipAllocationPolicy field from containernodepool-subnetworkref test dependencyAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
GoogleCloudPlatform/k8s-config-connector#13462 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
vavallee/bindery#2793 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno