Skip to content

feat(kernel): ✨ Improve environment schema validation - #17

Closed
haskou wants to merge 1 commit into
mainfrom
feat/kernel-quality-improvements
Closed

feat(kernel): ✨ Improve environment schema validation#17
haskou wants to merge 1 commit into
mainfrom
feat/kernel-quality-improvements

Conversation

@haskou

@haskou haskou commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add typed environment schema choices with runtime validation and literal TypeScript inference.
  • Document environment schema metadata and adapter-specific install/import paths.
  • Keep coverage focused on runtime kernel files instead of excluding all src/kernel.
  • Narrow Kernel type imports to concrete adapter base classes instead of adapter barrels.

Validation

  • yarn typecheck
  • yarn lint
  • yarn build
  • yarn test:coverage
  • yarn docs:build
  • yarn format:check
  • yarn --cwd example typecheck

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a740a0c43a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +8 to +12
TChoices extends readonly KernelEnvironmentValue[] | undefined =
| readonly KernelEnvironmentVariablePrimitive<TType>[]
| undefined,
> {
readonly choices?: TChoices;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bind choices to the declared variable type

When a schema is passed through KernelEnvironmentSchema/new Kernel, TType defaults to the full union, so choices?: TChoices accepts any KernelEnvironmentValue[] rather than choices that match the entry's type. For example, { HTTP_PORT: { type: 'number', choices: ['3000'] } } type-checks, but the runtime parses HTTP_PORT=3000 to the number 3000 and then includes compares it with the string choice, so validation always throws for that config. Please correlate choices with KernelEnvironmentVariablePrimitive<TType> so invalid schemas are rejected at compile time.

Useful? React with 👍 / 👎.

@haskou

haskou commented Jun 29, 2026

Copy link
Copy Markdown
Owner Author

Replaced by the breaking-change branch and PR because the kernel registration contract changes are intentionally breaking.

@haskou haskou closed this Jun 29, 2026
@haskou
haskou deleted the feat/kernel-quality-improvements branch June 29, 2026 10:00
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.

2 participants