AIASM-13: permissive enum warnings for NHI metadata properties#1201
Closed
jmountifield wants to merge 3 commits into
Closed
AIASM-13: permissive enum warnings for NHI metadata properties#1201jmountifield wants to merge 3 commits into
jmountifield wants to merge 3 commits into
Conversation
…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>
4 tasks
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>
Author
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a permissive-enum warning channel to
EntityValidatorso integration teams canship NHI subtypes and AI platforms without waiting for a
@jupiterone/data-modelrelease.
_nhiType,_nhiOwnerStatus,_aiConfidenceenum violations →warnings(entity accepted)errorsnew EntityValidator({ permissiveEnumProperties: [...] })toMatchDataModelSchemajest matcher surfaces warnings viaconsole.warnand passes the assertionWhy
Strict enums in
@jupiterone/data-modelblock integration teams from emitting new NHIsubtypes 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
@jupiterone/data-model(M004 / AIASM-15)Test plan
integration-sdk-entity-validatorjest suite greenintegration-sdk-testingjest suite greentsc --noEmitclean across both packages🤖 Generated with Claude Code