Skip to content

AIASM-13: permissive enum warnings for NHI metadata properties#1201

Closed
jmountifield wants to merge 3 commits into
mainfrom
AIASM-13/permissive-enum-warnings
Closed

AIASM-13: permissive enum warnings for NHI metadata properties#1201
jmountifield wants to merge 3 commits into
mainfrom
AIASM-13/permissive-enum-warnings

Conversation

@jmountifield
Copy link
Copy Markdown

What

Adds a permissive-enum warning channel to EntityValidator so integration teams can
ship NHI subtypes and AI platforms without waiting for a @jupiterone/data-model
release.

  • _nhiType, _nhiOwnerStatus, _aiConfidence enum violations → warnings (entity accepted)
  • Type mismatches on the same properties → still hard errors
  • Configurable via new EntityValidator({ permissiveEnumProperties: [...] })
  • toMatchDataModelSchema jest matcher surfaces warnings via console.warn and passes the assertion

Why

Strict enums in @jupiterone/data-model block integration teams from emitting new NHI
subtypes the same day they appear. The data-model release cycle becomes a bottleneck.
This moves strictness from "blocking" to "observable" for a small, explicitly-permissive
set of properties — without weakening the underlying JSON Schema.

Out of scope

  • Publishing @jupiterone/data-model (M004 / AIASM-15)
  • Multi-class entity validation proof (M003 / AIASM-14)
  • Applying NHI to existing integrations (PPR-128/PPR-129)

Test plan

  • integration-sdk-entity-validator jest suite green
  • integration-sdk-testing jest suite green
  • tsc --noEmit clean across both packages
  • New tests cover: clean entity, permissive-only violation, hard-error-only, mixed warnings+errors, opt-out via empty list

🤖 Generated with Claude Code

jmountifield and others added 2 commits April 29, 2026 13:26
…schema

S01: validator partitions ajv errors into hard errors vs permissive-enum
warnings (NHI _nhiType / _aiPlatform / _nhiOwnerStatus). Returns
{ errors, warnings } and exposes setSchemaSingleton for test injection.

S02: toMatchDataModelSchema matcher consumes the new shape — fails only
on hard errors, emits a single console.warn summarising warnings across
all entities. Adds tests for warning-only, mixed, and clean cases.
Document the EntityValidator class-level contract (additive warnings,
default permissive set, opt-out via []) and the toMatchDataModelSchema
matcher behavior (console.warn passthrough, jest.spyOn guidance) so
callers can discover the surface from IDE hover without reading the test
suite.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tracks data-model PR #104 review: NHI properties (nhiType, isAi,
aiConfidence, aiPlatform, nhiOwnerStatus) no longer use the underscore
prefix, since underscore is conventionally reserved for system-managed
fields (_class, _type, _key, _rawData) and domain metadata follows
bare-name conventions elsewhere (User.username, AccessKey.fingerprint).

Updates DEFAULT_PERMISSIVE_ENUM_PROPERTIES, JSDoc @example, and all
test fixtures + assertions to use the renamed property names.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jmountifield
Copy link
Copy Markdown
Author

jmountifield commented Apr 30, 2026

Closing — see AIASM-13 for rationale. Short version: the permissive-enum warning channel was a bridge for the gap between data-model npm releases and integrations emitting new NHI subtypes. With NHI live on api.us.jupiterone.io/data-model/schemas/classes (deployed via AIASM-15) and the SDK validator fetching schemas from there at runtime, that bridge no longer has a problem to solve.

The branch AIASM-13/permissive-enum-warnings is preserved on origin if this ever needs to be revived.

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