Skip to content

docs(spec): add ai_context to the Relationship node in spec.yaml - #350

Open
kayemkim wants to merge 2 commits into
apache:mainfrom
kayemkim:fix/spec-yaml-relationship-ai-context
Open

docs(spec): add ai_context to the Relationship node in spec.yaml#350
kayemkim wants to merge 2 commits into
apache:mainfrom
kayemkim:fix/spec-yaml-relationship-ai-context

Conversation

@kayemkim

Copy link
Copy Markdown
Contributor

Summary

Relationship was the only node where the two core-spec files disagreed on whether a field exists: the JSON schema's $defs/Relationship carries ai_context, and the spec.md property table lists it, but the relationships: block in spec.yaml omitted it. Every other node lists it in both files.

This adds the property to the block, placed before custom_extensions with the comment style of the sibling nodes. spec.yaml still parses.

Related Issues

Fixes #340.

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have been discussed on the mailing list or in a linked issue
  • Breaking changes to the spec are clearly called out in the summary

Ontology

  • Ontology changes in ontology/ are consistent with spec changes
  • New or modified terms are defined and documented

Converters

  • Converter logic in converters/ is updated to reflect spec or ontology changes
  • New converters include tests under the converter's test directory

Validation

  • Validation rules in validation/ are updated if the spec changed
  • New validation cases are covered by tests

Documentation

  • docs/ is updated to reflect any user-facing changes
  • New features or behaviors are documented with examples where appropriate
  • CONTRIBUTING.md is updated if the contribution process changed

Examples

  • examples/ are added or updated for any new spec constructs or converter support

Tests

  • All existing tests pass (pytest / CI green)
  • New functionality is covered by tests

Compliance

  • ASF license headers are present on all new source files
  • No third-party dependencies are added without PMC/IPMC approval

@jbonofre
jbonofre self-requested a review August 31, 2026 14:03
Relationship was the only node where spec.yaml and the JSON schema
disagreed on whether a field exists at all: the schema's
$defs/Relationship carries ai_context (as does the spec.md table),
but the spec.yaml relationships block omitted it. Every other node
lists it in both files.

Comment style and placement (before custom_extensions) follow the
sibling nodes.

Signed-off-by: km <kayemkim@gmail.com>
Generated-by: Claude Code
@kayemkim
kayemkim force-pushed the fix/spec-yaml-relationship-ai-context branch from 425ea55 to 509e849 Compare September 1, 2026 00:11
Comment thread core-spec/spec.yaml

# Optional: Additional context for AI tools (e.g., synonyms, business context)
# Helps LLMs understand when and why the datasets should be joined
ai_context: string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schema, spec.md, the Python models, and the TPC-DS example all treat relationship ai_context as string-or-object. This PR fixes "field is missing" and introduces "field has the wrong type" (corresponding to #141).

I think it's worth changing to reflect both forms before merge, since spec.yaml handles nested shapes elsewhere (expressions, dimensions).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Pushed a change that documents the object form (instructions/synonyms/examples) in a comment above the field, the way primary_key and unique_keys show their alternate shapes. I kept the live value as ai_context: string to stay in line with the sibling nodes, since reworking the string-only notation across the file is what #141 tracks; or I can switch the live value to the nested form if you'd rather lead with it here.

Review feedback: the schema's AIContext is string-or-object, so a bare
"ai_context: string" traded the missing-field drift for a wrong-type
drift. Document the object form (instructions/synonyms/examples) in a
comment, the same way primary_key and unique_keys show their alternate
shapes, keeping the live value in line with the sibling nodes until
the string-only notation is reworked across the file.

Signed-off-by: km <kayemkim@gmail.com>
Generated-by: Claude Code
@kayemkim
kayemkim requested a review from jbonofre September 1, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core-spec/spec.yaml omits ai_context on Relationship, while the JSON schema defines it

2 participants