Skip to content

Feat/check cli#417

Merged
cukas merged 6 commits into
mainfrom
feat/check-cli
Jun 11, 2026
Merged

Feat/check cli#417
cukas merged 6 commits into
mainfrom
feat/check-cli

Conversation

@cukas

@cukas cukas commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What

Why

How

Checklist

  • tsc -b passes
  • pnpm test passes
  • pnpm test:kern passes
  • pnpm lint passes
  • kern review packages/ --recursive checked

cukas and others added 6 commits June 11, 2026 18:24
Add the workspace dependency and tsconfig project reference so the cli
package can call the nominal type-checker (checkProgram/checkCalls/
checkReturns) from @kernlang/check.

Co-Authored-By: kern-agon <kern-agon@users.noreply.github.com>
`kern check [path]` runs the @kernlang/check nominal type-checker
(declaration / call / return rules) over a file or directory, with an
opt-in --with-semantics pass for @kernlang/core semantic validation.

- Stable JSON contract (schemaVersion 1.0) under --json; ESLint-style
  grouped human output otherwise; --quiet prints only the summary.
- Report-and-continue on parse errors: a bad file is excluded from
  type-checking but every other file still runs.
- Deterministic diagnostic sort (file, category, rule, message).
- Pure exitCodeFor(summary, strict): errors -> 1; warnings only -> 0
  unless --strict; operational failures (bad path/flag) -> 2.
- Discovery mirrors self-coverage SKIP_DIRS and drops *.kern directories
  (the repo has a .kern/ config dir) so the per-file read never hits
  EISDIR.

Co-Authored-By: kern-agon <kern-agon@users.noreply.github.com>
Locks the schemaVersion 1.0 JSON shape, exit-code matrix (clean/0,
return-violation/1, warnings+strict/1, operational/2), parse-failure
continuation, build/ discovery filtering, opt-in --with-semantics, and
returnChecksRun telemetry.

Fixtures are generated into a tmpdir at runtime rather than committed:
@kernlang/check's repo-wide ZERO-FP acceptance wall walks every committed
.kern and pins the exact parse-failing / validator-rejected / checker-
offender sets, so any committed bad fixture would break that read-only
wall. Runtime generation keeps them out of the scanned corpus (mirrors
the existing self-coverage.test.ts pattern).

Co-Authored-By: kern-agon <kern-agon@users.noreply.github.com>
Co-Authored-By: kern-agon <kern-agon@users.noreply.github.com>
…guarantee

Co-Authored-By: kern-agon <kern-agon@users.noreply.github.com>
- 'up to 85% fewer tokens / 7 LLMs verified' -> measured 69.5% vs generated
  Express TS and 81.4% vs both backends (gpt-tokenizer cl100k over the
  dual-target-clean example corpus; bench preserved outside the repo)
- Quick Example used stale machine syntax (event= and missing state
  declarations) that silently compiles to BROKEN TypeScript on current
  main (empty state union, duplicate function names) — replaced with the
  test-suite syntax, which produces 40 valid lines, not '140+'

Co-Authored-By: kern-agon <kern-agon@users.noreply.github.com>
@cukas cukas merged commit 0f3862d into main Jun 11, 2026
4 checks passed
@cukas cukas deleted the feat/check-cli branch June 11, 2026 17:16
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