Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

sdk: caller-side label requirements are all-of in the SDKs, any-of in sam-node

クローズ
#508 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, javascript, python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
926
フォーク
138
平均マージ
9時間 26分
マージ済み PR(30日)
129

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/sam のほかの issue

google/sam の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。