Skip to content

Correct the stop_reason 'Other' examples in the ai_status object - #1779

Merged
floydtree merged 4 commits into
ocsf:mainfrom
Levaj2000:fix/ai-status-stop-reason-examples
Oct 16, 2026
Merged

floydtree merged 4 commits into
ocsf:mainfrom
Levaj2000:fix/ai-status-stop-reason-examples

Conversation

@Levaj2000

Copy link
Copy Markdown
Contributor

Related Issue:

Follow-up to #1704 — review comment from @mikeradka:
#1704 (comment)

Description of changes:

The stop_reason description in objects/ai_status.json offered end_turn and
max_tokens as examples of the native label carried when stop_reason_id is
Other (99). Both of those map cleanly onto defined values — end_turn →
End of Turn (1), max_tokens → Token Limit (2) — so under the rule stated in
the same sentence they populate stop_reason with the enum caption, never the
native label. The examples contradicted the rule they illustrated.

Left as-is, a producer following the example would write max_tokens where
another writes Token Limit for the identical condition, which makes the sibling
string unqueryable. That is the drift the caption-normalization rule exists to
prevent.

This replaces them with one example per branch: a caption for the mapped case,
and two genuinely unmapped native labels for the Other case.

Before

Normalized to the caption of the stop_reason_id value; when the value is
'Other', this carries the event source's native label (e.g. end_turn,
max_tokens).

After

Normalized to the caption of the stop_reason_id value (e.g. Token Limit);
when the value is 'Other', this carries the event source's native label
(e.g. recitation, malformed_function_call).

recitation and malformed_function_call have no home in the seven-value
taxonomy, so they are correct illustrations of the Other case. Deliberately
avoided refusal / content_filter / guardrail_intervened (all Content
Filter (5)) and stop_sequence (End of Turn (1), per that value's own
description).

Why this is separate from #1704

Split out by agreement with @mikeradka so a one-line description change didn't
reset that PR's three approvals before the 1.10 cutoff. #1704 has since merged.

Scope

  • Description text only. No attribute, enum, requirement or structural change.
  • objects/ai_status.json only. The generic stop_reason in dictionary.json
    carries no examples and needs nothing; permission_result has the same
    sentence shape but no examples.

Validation

  • Validators not run locally (Homebrew Python / PEP 668); relying on CI, which
    runs the same metaschema, compile and compatibility checks.
  • No compatibility impact — description text is not part of the data contract.

The examples for the Other (99) case were end_turn and max_tokens, which both
map to defined values (End of Turn (1), Token Limit (2)) and therefore carry the
enum caption, not the source's native label. Replaced with a caption example for
the mapped branch and two genuinely unmapped native labels for Other.

Addresses the review comment from mikeradka on ocsf#1704.

Signed-off-by: Levaj2000 <120221487+Levaj2000@users.noreply.github.com>
@Levaj2000 Levaj2000 added v1.1.0 Changes marked for v1.1.0 of OCSF v1.10.0 Issues/PRs scoped for v1.10.0 labels Oct 13, 2026
@github-actions

Copy link
Copy Markdown

Schema Description Review

Automated suggestions for improving description clarity for LLM consumption. These are advisory — not required changes.

✅ No description issues found — descriptions look clear for LLM consumption.

Signed-off-by: Levaj2000 <120221487+Levaj2000@users.noreply.github.com>
@floydtree floydtree removed the v1.1.0 Changes marked for v1.1.0 of OCSF label Oct 14, 2026
Comment thread CHANGELOG.md Outdated
stop_reason shipped in the current dev version under its own changelog entry, so this bugfix PR needs no separate entry. Per floydtree's review.

Signed-off-by: Levaj2000 <120221487+Levaj2000@users.noreply.github.com>
@floydtree
floydtree merged commit a7e16ed into ocsf:main Oct 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1.10.0 Issues/PRs scoped for v1.10.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants