@kernlang/test 3.4.3-canary.9.1.62aecb74 → 3.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,7 +4,6 @@ import { existsSync, readdirSync, readFileSync, statSync } from 'fs';
4
4
  import { dirname, join, relative, resolve } from 'path';
5
5
  import { inspect, isDeepStrictEqual } from 'util';
6
6
  import { createContext, Script } from 'vm';
7
- import { isRuntimeBindingName } from './generated/safety-checks.js';
8
7
  const DISCOVERY_SKIP_DIRS = new Set([
9
8
  '.git',
10
9
  '.next',
@@ -2014,7 +2013,13 @@ function evaluateImportedKernRoundtrip(kern, options = {}) {
2014
2013
  message: `Imported KERN does not reparse at ${parseError.line}:${parseError.col}: ${parseError.message}`,
2015
2014
  };
2016
2015
  }
2017
- const parseWarning = reparsed.diagnostics.find((diagnostic) => diagnostic.severity === 'warning');
2016
+ // Slice α-4: NATIVE_KERN_ELIGIBLE is an opt-in suggestion, not a roundtrip
2017
+ // defect. Imported KERN with raw `<<<…>>>` handler bodies that the
2018
+ // classifier accepts will trigger this code at warning level — that is the
2019
+ // intended IDE/LSP signal, not a contract violation. Filter it here the
2020
+ // same way `shared.ts`, `review/src/index.ts`, and `import.ts` do at their
2021
+ // consumer sites.
2022
+ const parseWarning = reparsed.diagnostics.find((diagnostic) => diagnostic.severity === 'warning' && diagnostic.code !== 'NATIVE_KERN_ELIGIBLE');
2018
2023
  if (parseWarning && !options.allowWarnings) {
2019
2024
  return {
2020
2025
  passed: false,
@@ -2183,9 +2188,9 @@ function unsafeRuntimeWorkflowReason(source) {
2183
2188
  return `unsupported token '${unsafeToken}'`;
2184
2189
  return undefined;
2185
2190
  }
2186
- // First slice of self-hosting: `isRuntimeBindingName` lives in
2187
- // `src/kern/safety-checks.kern`. Edit the .kern file, then run
2188
- // `pnpm --filter @kernlang/test kern:compile` to regenerate the facade.
2191
+ function isRuntimeBindingName(value) {
2192
+ return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value);
2193
+ }
2189
2194
  function transformRuntimeCodeSegments(source, transform) {
2190
2195
  let output = '';
2191
2196
  let segmentStart = 0;