Skip to content

Commit e34a9d2

Browse files
Clarify context selection policy and hash counts
1 parent 4e0c746 commit e34a9d2

5 files changed

Lines changed: 36 additions & 32 deletions

File tree

docs/gen-ai/gen-ai-events.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ This event is intended to answer whether an agent run loaded too much context be
320320
| [`gen_ai.context.selection.selected.count`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | int | The number of context inputs selected for delivery to a GenAI agent or model. [2] | `5` |
321321
| [`gen_ai.context.selection.suppressed.count`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | int | The number of candidate context inputs intentionally not delivered to a GenAI agent or model. [3] | `13` |
322322
| [`gen_ai.agent.id`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` when available | string | The unique identifier of the GenAI agent. | `asst_5j66UpCpwteGg4YSxUnt7lPY` |
323-
| [`gen_ai.context.selection.delivered_hash.count`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` when delivered hashes are available | int | The number of distinct privacy-preserving delivered-context hashes produced for selected context inputs. [4] | `5` |
324-
| [`gen_ai.context.selection.reason`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The implementation-specific reason or policy that selected and suppressed context inputs. [5] | `budget`; `relevance` |
323+
| [`gen_ai.context.selection.delivered_hash.count`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` when delivered hashes are available | int | The number of unique privacy-preserving delivered-context hashes produced for selected context inputs. [4] | `5` |
324+
| [`gen_ai.context.selection.policy`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The implementation-specific top-level policy or strategy used to select and suppress context inputs. [5] | `budget`; `hybrid_bm25_dense` |
325325
| [`gen_ai.conversation.id`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` when available | string | The unique identifier for a conversation (session, thread), used to store and correlate messages within this conversation. | `conv_5j66UpCpwteGg4YSxUnt7lPY` |
326326

327327
**[1] `gen_ai.context.selection.candidate.count`:** This count is intended to help operators detect over-selection without recording raw context content. It SHOULD include inputs discovered before policy, budget, relevance, or deduplication filters are applied.
@@ -330,9 +330,9 @@ This event is intended to answer whether an agent run loaded too much context be
330330

331331
**[3] `gen_ai.context.selection.suppressed.count`:** Suppression may be caused by budget limits, deduplication, policy, target-agent mismatch, relevance filtering, or another implementation-specific reason.
332332

333-
**[4] `gen_ai.context.selection.delivered_hash.count`:** This count lets telemetry report how many delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts.
333+
**[4] `gen_ai.context.selection.delivered_hash.count`:** This count lets telemetry report how many distinct delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts. It SHOULD count unique hashes, not total hash observations, so duplicate selected inputs can be detected by comparing this value with `gen_ai.context.selection.selected.count`.
334334

335-
**[5] `gen_ai.context.selection.reason`:** The value SHOULD have low cardinality. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `policy`, and `unknown`.
335+
**[5] `gen_ai.context.selection.policy`:** The value SHOULD have low cardinality and SHOULD describe the top-level selection policy rather than every internal retrieval stage. For hybrid or staged retrieval, use one stable name such as `hybrid_bm25_dense` or `rag_hybrid_v2`; detailed per-stage retrieval telemetry should be reported on retrieval spans or events. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `hybrid_bm25_dense`, and `unknown`.
336336

337337
<!-- prettier-ignore-end -->
338338
<!-- END AUTOGENERATED TEXT -->

docs/registry/attributes/gen-ai.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
| <a id="gen-ai-agent-name" href="#gen-ai-agent-name">`gen_ai.agent.name`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | Human-readable name of the GenAI agent provided by the application. | `Math Tutor`; `Fiction Writer` |
1313
| <a id="gen-ai-agent-version" href="#gen-ai-agent-version">`gen_ai.agent.version`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The version of the GenAI agent. | `1.0.0`; `2025-05-01` |
1414
| <a id="gen-ai-context-selection-candidate-count" href="#gen-ai-context-selection-candidate-count">`gen_ai.context.selection.candidate.count`</a> | ![Development](https://img.shields.io/badge/-development-blue) | int | The number of context inputs considered for possible delivery to a GenAI agent or model. [1] | `18` |
15-
| <a id="gen-ai-context-selection-delivered-hash-count" href="#gen-ai-context-selection-delivered-hash-count">`gen_ai.context.selection.delivered_hash.count`</a> | ![Development](https://img.shields.io/badge/-development-blue) | int | The number of distinct privacy-preserving delivered-context hashes produced for selected context inputs. [2] | `5` |
16-
| <a id="gen-ai-context-selection-reason" href="#gen-ai-context-selection-reason">`gen_ai.context.selection.reason`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The implementation-specific reason or policy that selected and suppressed context inputs. [3] | `budget`; `relevance` |
15+
| <a id="gen-ai-context-selection-delivered-hash-count" href="#gen-ai-context-selection-delivered-hash-count">`gen_ai.context.selection.delivered_hash.count`</a> | ![Development](https://img.shields.io/badge/-development-blue) | int | The number of unique privacy-preserving delivered-context hashes produced for selected context inputs. [2] | `5` |
16+
| <a id="gen-ai-context-selection-policy" href="#gen-ai-context-selection-policy">`gen_ai.context.selection.policy`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The implementation-specific top-level policy or strategy used to select and suppress context inputs. [3] | `budget`; `hybrid_bm25_dense` |
1717
| <a id="gen-ai-context-selection-selected-count" href="#gen-ai-context-selection-selected-count">`gen_ai.context.selection.selected.count`</a> | ![Development](https://img.shields.io/badge/-development-blue) | int | The number of context inputs selected for delivery to a GenAI agent or model. [4] | `5` |
1818
| <a id="gen-ai-context-selection-suppressed-count" href="#gen-ai-context-selection-suppressed-count">`gen_ai.context.selection.suppressed.count`</a> | ![Development](https://img.shields.io/badge/-development-blue) | int | The number of candidate context inputs intentionally not delivered to a GenAI agent or model. [5] | `13` |
1919
| <a id="gen-ai-conversation-id" href="#gen-ai-conversation-id">`gen_ai.conversation.id`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The unique identifier for a conversation (session, thread), used to store and correlate messages within this conversation. | `conv_5j66UpCpwteGg4YSxUnt7lPY` |
@@ -71,9 +71,9 @@
7171

7272
**[1] `gen_ai.context.selection.candidate.count`:** This count is intended to help operators detect over-selection without recording raw context content. It SHOULD include inputs discovered before policy, budget, relevance, or deduplication filters are applied.
7373

74-
**[2] `gen_ai.context.selection.delivered_hash.count`:** This count lets telemetry report how many delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts.
74+
**[2] `gen_ai.context.selection.delivered_hash.count`:** This count lets telemetry report how many distinct delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts. It SHOULD count unique hashes, not total hash observations, so duplicate selected inputs can be detected by comparing this value with `gen_ai.context.selection.selected.count`.
7575

76-
**[3] `gen_ai.context.selection.reason`:** The value SHOULD have low cardinality. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `policy`, and `unknown`.
76+
**[3] `gen_ai.context.selection.policy`:** The value SHOULD have low cardinality and SHOULD describe the top-level selection policy rather than every internal retrieval stage. For hybrid or staged retrieval, use one stable name such as `hybrid_bm25_dense` or `rag_hybrid_v2`; detailed per-stage retrieval telemetry should be reported on retrieval spans or events. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `hybrid_bm25_dense`, and `unknown`.
7777

7878
**[4] `gen_ai.context.selection.selected.count`:** This count SHOULD represent inputs selected after discovery and filtering, before or at delivery. It does not imply that the selected inputs were decision-relevant.
7979

model/gen-ai/events.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ events:
3535
- ref: gen_ai.context.selection.delivered_hash.count
3636
requirement_level:
3737
recommended: when delivered hashes are available
38-
- ref: gen_ai.context.selection.reason
38+
- ref: gen_ai.context.selection.policy
3939
requirement_level: recommended
4040

4141
- name: gen_ai.evaluation.result

model/gen-ai/registry.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -518,19 +518,23 @@ attributes:
518518
stability: development
519519
- key: gen_ai.context.selection.delivered_hash.count
520520
type: int
521-
brief: The number of distinct privacy-preserving delivered-context hashes produced for selected context inputs.
521+
brief: The number of unique privacy-preserving delivered-context hashes produced for selected context inputs.
522522
note: >
523-
This count lets telemetry report how many delivered context identities are available for later correlation
524-
without recording raw prompt text, tool output, memory bodies, or repository excerpts.
523+
This count lets telemetry report how many distinct delivered context identities are available for later
524+
correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts.
525+
It SHOULD count unique hashes, not total hash observations, so duplicate selected inputs can be detected by
526+
comparing this value with `gen_ai.context.selection.selected.count`.
525527
examples: [5]
526528
stability: development
527-
- key: gen_ai.context.selection.reason
529+
- key: gen_ai.context.selection.policy
528530
type: string
529-
brief: The implementation-specific reason or policy that selected and suppressed context inputs.
531+
brief: The implementation-specific top-level policy or strategy used to select and suppress context inputs.
530532
note: >
531-
The value SHOULD have low cardinality. Examples include `budget`, `relevance`, `dedupe`,
532-
`target_agent`, `policy`, and `unknown`.
533-
examples: ["budget", "relevance"]
533+
The value SHOULD have low cardinality and SHOULD describe the top-level selection policy rather than every
534+
internal retrieval stage. For hybrid or staged retrieval, use one stable name such as `hybrid_bm25_dense` or
535+
`rag_hybrid_v2`; detailed per-stage retrieval telemetry should be reported on retrieval spans or events.
536+
Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `hybrid_bm25_dense`, and `unknown`.
537+
examples: ["budget", "hybrid_bm25_dense"]
534538
stability: development
535539

536540
- key: gen_ai.retrieval.documents

schema-snapshot/registry.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -746,25 +746,25 @@ refinements:
746746
requirement_level: required
747747
stability: development
748748
type: int
749-
- brief: The number of distinct privacy-preserving delivered-context hashes produced for selected context inputs.
749+
- brief: The number of unique privacy-preserving delivered-context hashes produced for selected context inputs.
750750
examples:
751751
- 5
752752
key: gen_ai.context.selection.delivered_hash.count
753753
note: |
754-
This count lets telemetry report how many delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts.
754+
This count lets telemetry report how many distinct delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts. It SHOULD count unique hashes, not total hash observations, so duplicate selected inputs can be detected by comparing this value with `gen_ai.context.selection.selected.count`.
755755
provenance:
756756
path: ./model/gen-ai/registry.yaml
757757
requirement_level:
758758
recommended: when delivered hashes are available
759759
stability: development
760760
type: int
761-
- brief: The implementation-specific reason or policy that selected and suppressed context inputs.
761+
- brief: The implementation-specific top-level policy or strategy used to select and suppress context inputs.
762762
examples:
763763
- budget
764764
- relevance
765-
key: gen_ai.context.selection.reason
765+
key: gen_ai.context.selection.policy
766766
note: |
767-
The value SHOULD have low cardinality. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `policy`, and `unknown`.
767+
The value SHOULD have low cardinality and SHOULD describe the top-level selection policy rather than every internal retrieval stage. For hybrid or staged retrieval, use one stable name such as `hybrid_bm25_dense` or `rag_hybrid_v2`; detailed per-stage retrieval telemetry should be reported on retrieval spans or events. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `hybrid_bm25_dense`, and `unknown`.
768768
provenance:
769769
path: ./model/gen-ai/registry.yaml
770770
requirement_level: recommended
@@ -11934,23 +11934,23 @@ registry:
1193411934
path: ./model/gen-ai/registry.yaml
1193511935
stability: development
1193611936
type: int
11937-
- brief: The number of distinct privacy-preserving delivered-context hashes produced for selected context inputs.
11937+
- brief: The number of unique privacy-preserving delivered-context hashes produced for selected context inputs.
1193811938
examples:
1193911939
- 5
1194011940
key: gen_ai.context.selection.delivered_hash.count
1194111941
note: |
11942-
This count lets telemetry report how many delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts.
11942+
This count lets telemetry report how many distinct delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts. It SHOULD count unique hashes, not total hash observations, so duplicate selected inputs can be detected by comparing this value with `gen_ai.context.selection.selected.count`.
1194311943
provenance:
1194411944
path: ./model/gen-ai/registry.yaml
1194511945
stability: development
1194611946
type: int
11947-
- brief: The implementation-specific reason or policy that selected and suppressed context inputs.
11947+
- brief: The implementation-specific top-level policy or strategy used to select and suppress context inputs.
1194811948
examples:
1194911949
- budget
1195011950
- relevance
11951-
key: gen_ai.context.selection.reason
11951+
key: gen_ai.context.selection.policy
1195211952
note: |
11953-
The value SHOULD have low cardinality. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `policy`, and `unknown`.
11953+
The value SHOULD have low cardinality and SHOULD describe the top-level selection policy rather than every internal retrieval stage. For hybrid or staged retrieval, use one stable name such as `hybrid_bm25_dense` or `rag_hybrid_v2`; detailed per-stage retrieval telemetry should be reported on retrieval spans or events. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `hybrid_bm25_dense`, and `unknown`.
1195411954
provenance:
1195511955
path: ./model/gen-ai/registry.yaml
1195611956
stability: development
@@ -13812,25 +13812,25 @@ registry:
1381213812
requirement_level: required
1381313813
stability: development
1381413814
type: int
13815-
- brief: The number of distinct privacy-preserving delivered-context hashes produced for selected context inputs.
13815+
- brief: The number of unique privacy-preserving delivered-context hashes produced for selected context inputs.
1381613816
examples:
1381713817
- 5
1381813818
key: gen_ai.context.selection.delivered_hash.count
1381913819
note: |
13820-
This count lets telemetry report how many delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts.
13820+
This count lets telemetry report how many distinct delivered context identities are available for later correlation without recording raw prompt text, tool output, memory bodies, or repository excerpts. It SHOULD count unique hashes, not total hash observations, so duplicate selected inputs can be detected by comparing this value with `gen_ai.context.selection.selected.count`.
1382113821
provenance:
1382213822
path: ./model/gen-ai/registry.yaml
1382313823
requirement_level:
1382413824
recommended: when delivered hashes are available
1382513825
stability: development
1382613826
type: int
13827-
- brief: The implementation-specific reason or policy that selected and suppressed context inputs.
13827+
- brief: The implementation-specific top-level policy or strategy used to select and suppress context inputs.
1382813828
examples:
1382913829
- budget
1383013830
- relevance
13831-
key: gen_ai.context.selection.reason
13831+
key: gen_ai.context.selection.policy
1383213832
note: |
13833-
The value SHOULD have low cardinality. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `policy`, and `unknown`.
13833+
The value SHOULD have low cardinality and SHOULD describe the top-level selection policy rather than every internal retrieval stage. For hybrid or staged retrieval, use one stable name such as `hybrid_bm25_dense` or `rag_hybrid_v2`; detailed per-stage retrieval telemetry should be reported on retrieval spans or events. Examples include `budget`, `relevance`, `dedupe`, `target_agent`, `hybrid_bm25_dense`, and `unknown`.
1383413834
provenance:
1383513835
path: ./model/gen-ai/registry.yaml
1383613836
requirement_level: recommended

0 commit comments

Comments
 (0)