Skip to content

Fix project type detection and analyzer schema validation#1

Merged
leandigital merged 3 commits intomainfrom
fix/detection-and-schema-validation
Feb 23, 2026
Merged

Fix project type detection and analyzer schema validation#1
leandigital merged 3 commits intomainfrom
fix/detection-and-schema-validation

Conversation

@leandigital
Copy link
Owner

Summary

  • Fixed project type detection for vanilla JS/CSS frontend projects (no React/Vue/Angular) by adding signals for CSS build tooling, UI libraries, SCSS/HTML source files, and PostCSS/Tailwind configs
  • Broadened backend detection to cover Go, Rust, Ruby, .NET, additional JS frameworks (Hono, Elysia, H3, Hapi), and frameworkless backends using DB/auth/server-utility dependencies
  • Added generic documentation generator as fallback for unrecognized project types — no more crash on "unknown"
  • Fixed cost analyzer Zod schemaz.coerce.number() for string-to-number coercion, z.null() for nullable viability field
  • Fixed quality analyzer Zod schemaz.union([z.string(), z.object(...)]) for compliance violations
  • Added CI badge to README

Test plan

  • npm run build passes
  • All 408 tests pass
  • Verified lusis (vanilla JS marketing site) now detects as frontend
  • Verified no regression on existing project type detection

…alidation

Three bugs found when running `lean-intel full` on a vanilla JS marketing site:

1. Docs generation crashed with "Unsupported project type: unknown" because the
   detector only recognized framework-based frontends (React, Vue, Angular). Added
   vanilla frontend signals (CSS build tooling, UI libraries, SCSS/HTML source files,
   PostCSS/Tailwind configs) and broadened backend detection (Go, Rust, Ruby, .NET,
   additional JS frameworks, database/auth/server-utility dependencies). Also added
   a generic documentation generator as fallback so unknown types no longer crash.

2. Cost analyzer Zod validation failed because LLMs returned string numbers ("1000")
   and null for viability. Fixed with z.coerce.number() and z.null() in union.

3. Quality analyzer Zod validation failed because LLMs returned plain strings
   instead of objects for compliance violations. Fixed with z.union([z.string(),
   z.object(...)]).

Also added CI status badge to README.
Triggers on GitHub Release creation, runs build + lint + test,
then publishes to npm with provenance attestation.
Requires NPM_TOKEN secret in repo settings.
GitHub Actions checks out in detached HEAD mode, so local branch
refs like 'main' don't exist. Handle this gracefully by catching
the pathspec error in CI environments.
@leandigital leandigital merged commit 1f824f1 into main Feb 23, 2026
1 check passed
@leandigital leandigital deleted the fix/detection-and-schema-validation branch February 23, 2026 20:50
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