Skip to content

feat(ossie/ai): synonym resolution + custom_extensions passthrough (#1408, #1409) - #1415

Merged
buggtb merged 1 commit into
developmentfrom
feature/1408-1409-ai-context-surface
Jul 9, 2026
Merged

feat(ossie/ai): synonym resolution + custom_extensions passthrough (#1408, #1409)#1415
buggtb merged 1 commit into
developmentfrom
feature/1408-1409-ai-context-surface

Conversation

@buggtb

@buggtb buggtb commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Wires the OSI ai_context.synonyms and custom_extensions[] blocks
through the DTO layer, the AI schema view, and the query validator so
agents can refer to entities by synonym and consumer-side tooling can
carry vendor annotations without dropping them.

saiku#1408 — synonyms

  • OssieModelDto gains fieldAliases / metricAliases / datasetAliases
    maps. OssieDiscoverService populates them via the library's
    bi.saiku.ossie.OssieSynonymIndex — dogfooding the ossie-core helper
    we shipped in feat: OssieSynonymIndex + strict-version-check ossie#4.
  • OssieAiSchemaProjector copies the alias maps to the AI schema view
    so they surface on GET /ai/ossie/schema.
  • OssieAiValidator resolves synonyms before rejecting names on
    POST /ai/ossie/query:
    • Dataset synonyms rewrite ref.dataset in place; downstream code sees
      the canonical name only.
    • Metric synonyms rewrite ref.metric similarly.
    • Field synonyms only rewrite when the alias resolves to a field on
      the SAME dataset the caller asked for — cross-dataset synonyms
      (ambiguous by design) get rejected instead of silently misrouting.

saiku#1409 — custom_extensions

  • New CustomExtensionDto in org.saiku.service.ossie — thin wire model
    carrying vendor_name + parsed JSON data.
  • OssieModelDto.Field / Dataset / Metric gain customExtensions lists;
    discover service parses each extension's opaque data string into a
    JsonNode once so consumers walk it structurally.
  • 'visibility: internal' filter: any extension whose parsed data
    declares visibility=internal is dropped at the discover-service
    boundary. That's the standard escape hatch for tooling-private
    metadata (Saiku's own annotations, dbt's tool-only bookkeeping)
    that shouldn't reach an agent-facing view.
  • OssieAiSchema.Field / Dataset / Metric gain customExtensions
    passthrough; projector copies straight across.

Verification

  • Full reactor tests: BUILD SUCCESS
  • saiku-service: 769/769 (was 760; +9 new tests)
    • OssieAiValidatorTest: +4 synonym-resolution cases (metric alias
      rewrite, dataset alias rewrite, field alias rewrite when dataset
      matches, field alias IGNORED when cross-dataset)
    • OssieAiSchemaProjectorTest: +3 (alias maps carry through, custom
      extensions carry through on field, on dataset + metric)
    • OssieDiscoverServiceTest: +2 (synonym aliases populated from
      ai_context, visibility:internal extensions filtered)
  • saiku-sql: SaikuOssieConnectionTest still 2/2
  • Zero behavioural regressions on existing tests

Docs

docs/AI-OSSIE-API.md gains two new subsections under Step 2:

…1408, #1409)

Wires the OSI ai_context.synonyms and custom_extensions[] blocks
through the DTO layer, the AI schema view, and the query validator so
agents can refer to entities by synonym and consumer-side tooling can
carry vendor annotations without dropping them.

## saiku#1408 — synonyms

- OssieModelDto gains fieldAliases / metricAliases / datasetAliases
  maps. OssieDiscoverService populates them via the library's
  bi.saiku.ossie.OssieSynonymIndex — dogfooding the ossie-core helper
  we shipped in spiculedata/ossie#4.
- OssieAiSchemaProjector copies the alias maps to the AI schema view
  so they surface on GET /ai/ossie/schema.
- OssieAiValidator resolves synonyms before rejecting names on
  POST /ai/ossie/query:
  - Dataset synonyms rewrite ref.dataset in place; downstream code sees
    the canonical name only.
  - Metric synonyms rewrite ref.metric similarly.
  - Field synonyms only rewrite when the alias resolves to a field on
    the SAME dataset the caller asked for — cross-dataset synonyms
    (ambiguous by design) get rejected instead of silently misrouting.

## saiku#1409 — custom_extensions

- New CustomExtensionDto in org.saiku.service.ossie — thin wire model
  carrying vendor_name + parsed JSON data.
- OssieModelDto.Field / Dataset / Metric gain customExtensions lists;
  discover service parses each extension's opaque data string into a
  JsonNode once so consumers walk it structurally.
- 'visibility: internal' filter: any extension whose parsed data
  declares visibility=internal is dropped at the discover-service
  boundary. That's the standard escape hatch for tooling-private
  metadata (Saiku's own annotations, dbt's tool-only bookkeeping)
  that shouldn't reach an agent-facing view.
- OssieAiSchema.Field / Dataset / Metric gain customExtensions
  passthrough; projector copies straight across.

## Verification

- Full reactor tests: BUILD SUCCESS
- saiku-service: 769/769 (was 760; +9 new tests)
  - OssieAiValidatorTest: +4 synonym-resolution cases (metric alias
    rewrite, dataset alias rewrite, field alias rewrite when dataset
    matches, field alias IGNORED when cross-dataset)
  - OssieAiSchemaProjectorTest: +3 (alias maps carry through, custom
    extensions carry through on field, on dataset + metric)
  - OssieDiscoverServiceTest: +2 (synonym aliases populated from
    ai_context, visibility:internal extensions filtered)
- saiku-sql: SaikuOssieConnectionTest still 2/2
- Zero behavioural regressions on existing tests

## Docs

docs/AI-OSSIE-API.md gains two new subsections under Step 2:
- "AI-context synonyms (#1408)" — shows fieldAliases/metricAliases/
  datasetAliases shape + describes the request-rewriting behaviour +
  documents the cross-dataset ambiguity guard
- "Custom extensions passthrough (#1409)" — shows the customExtensions
  shape + the visibility:internal filter with a YAML example
@buggtb
buggtb merged commit 1631fbe into development Jul 9, 2026
6 checks passed
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.

1 participant