Skip to content

v0.10.0

Choose a tag to compare

@Kidkender Kidkender released this 13 Nov 04:42
· 10 commits to main since this release

Added

  • @kidkender/archmind-go-parser 0.4.0: tenant isolation for Gin + GORM. On a route that resolves a tenant (a tenant middleware, c.Get("tenant_id"), an accessor such as GetTenantID(c), a tenant-named function handed the context such as TenantScope(c), or a field such as claims.TenantID), an ir:tenant_context node and every query in the handler and two calls below it as ir:scoped_query or ir:unscoped_query / ir:unscoped_write; the explainer reports unscoped ones as missing_tenant_scope. Calls are followed through struct fields, typed locals, package-level registries and embedded structs; DAO / repository / model wrappers count as queries, judged at the call site when they take their conditions as arguments; GORM callbacks that set the tenant, shared tables without a tenant field and Preload("Tenant") are taken into account. Routes that resolve no tenant get none of these nodes. archmind.json isolation.tenantSignals / isolation.tenantContextKeys (protocol 0.6.0).
  • @kidkender/archmind-springboot-parser 0.5.0: archmind.json guards. Annotation names under guards.auth_gate emit ir:auth_gate, under guards.authz_check ir:auth_gate → ir:authz_check, ahead of the built-in rules (a listed Shiro @RequiresRoles is no longer ir:unknown_middleware).
  • @kidkender/archmind-express-parser 0.1.0 (new package): Express.js, JavaScript and TypeScript. One graph per route: routers mounted across files (require / module.exports, ES modules, router.route() chains, routers mounted from arrays in a forEach, registrar functions handed the app); the middleware chain in Express order, classified by npm package, name and — for project middleware — body into ir:auth_gate, ir:authz_check and ir:validation_gate (rate limiting, optional auth and CSRF as ir:unknown_middleware with that role; body parsers, logging, CORS left out); the handler through controller modules, class methods and wrappers; service calls, including class controllers with constructor-injected services; transactions (Sequelize, TypeORM, Prisma, Mongoose, Knex) in the handler or one call below, with the writes inside them as ir:txn_write; ownership checks from archmind.json.
  • analysis, the CLI and the MCP server detect an Express project (package.json depends on express, not NestJS; at the root or one directory down when the root is not another backend) after every other framework. The MCP server caches Express graphs and re-parses when a JS/TS file changes; archmind_get_dependents indexes Express service calls (userService / userService::createUser).
  • research/cross-framework: Express versions of auth-only, auth-authz, auth-validation, auth-service-call and auth-transaction; Express matches NestJS and Laravel on each.
  • research/express-corpus: the projects, commits, scripts and results the parser was measured with.

Changed

  • analysis: a route counts as throttled when a node has role rate_limiting (Express rate limiters, Laravel throttle:), not only when an auth node is named so; without it every rate-limited login route reported no_rate_limiting.
  • @kidkender/archmind-laravel-parser: each file is parsed once per run and method lookups no longer walk whole trees. On invoiceninja the CLI ran for over 10 minutes and ran out of memory once files over 32 KiB were parsed; it now takes 22 s.

Measured, with limits

  • On six projects read while building it: 163 of 163 route registration sites (regex count). On six it had not seen: 101 of 101 real registrations (the regex also counted three HTTP client calls), every route that opens a transaction in a production Sequelize app (sfbrigade/bats-server), and 9 of 15 security middleware classified correctly blind, 15 of 15 after fixes made on that same set.
  • Decorator-based routing (routing-controllers, tsoa) is not read: such a project yields no routes. Not extracted: tenant isolation, side effects, response shaping. Not yet through the LLM accuracy benchmark.

Fixed

  • @kidkender/archmind-explainer: input validation outside Laravel is no longer counted as an authorization layer. over_authorized_route counted every ir:validation_gate as a third authorization layer ("FormRequest::authorize") and delegated_validation reported validators as delegating authorization. Both describe Laravel's FormRequest::authorize(); a NestJS ValidationPipe, Spring @Valid, Gin binding or Express celebrate / express-validator only checks the input, so ordinary authenticated, role-checked, validated routes on those frameworks got these findings. The FormRequest meaning now applies when the graph's framework is laravel or unset. Outside Laravel a route has at most two authorization layers, so over_authorized_route does not fire there.
  • @kidkender/archmind-nestjs-parser: writes inside a transaction were linked to it by within_transaction, which is not an IR relation, so validateGraph reported it as unknown. They are now linked by ir:wraps, as in Laravel graphs. New conformance suite on a transaction fixture.
  • @kidkender/archmind-laravel-parser: the transaction, isolation, audit-log and nested service-call passes inside a service method, and a queued job's handle(), swallowed any error silently. The parsers already turn unreadable files into empty results, so what reached these catches was a bug that read as "nothing found". It is now reported on stderr ([archmind] laravel-parser: <pass> skipped for <file>: <error>) and the pass is skipped as before.
  • Flaky tests in retrieval, nestjs-parser and mcp-server: their tests load the tree-sitter parsers, whose module-level parser fails intermittently when Jest reuses one worker process across test files. Each test file now gets its own process (maxWorkers), as laravel-parser already did. Measured: retrieval with every file in one process failed 5 of 5 runs; with the fix it passed 10 of 10, as did nestjs-parser.
  • npm run trace at the repository root pointed at apps/cli/dist/index.js; the CLI builds to index.cjs.
  • laravel-parser and springboot-parser: controllers and services over 32 KiB produced no auth, transaction, isolation or guard nodes. tree-sitter 0.21 rejects input past its default buffer and only route parsing sized it; every read and parse now sizes the buffer to the source. A parse failure is printed on stderr with the file path instead of reading as an empty file.
  • laravel-parser: output could differ between identical runs (koel 1943 / 1946 / 1943 nodes) because tree-sitter nodes were compared by object identity; they are compared by position now.
  • @kidkender/archmind-go-parser: route paths were the plain concatenation of the group prefixes, so Group("api").Group("v1").POST("device") came out as apiv1device. Paths are joined the way Gin joins them (233 of 267 routes on one project were malformed, now none).
  • The CLI did not detect a Gin project whose go.mod is one directory down (analysis and the MCP server already did).
  • archmind visualize ignored archmind.json ignoreFindings.
  • A clean checkout did not build: npm run build built the workspaces in alphabetical order, before the packages they depend on. It builds them in dependency order now, and CI passes on a fresh clone.

Release notes

  • Versions: CLI 0.10.0, express-parser 0.1.0 (new), go-parser 0.4.0, springboot-parser 0.5.0, protocol 0.6.0, analysis 0.3.0, mcp-server 0.8.0, explainer 0.3.4, laravel-parser 0.5.3, nestjs-parser 0.7.2, lsp 0.1.4, lens 0.2.1 (needs go-parser ^0.4.0). Packages that depended on protocol ^0.5 now need ^0.6.0.
  • lsp 0.1.4 loads analysis from its own install instead of bundling it (analysis pulls in go-parser's native tree-sitter-go, which cannot be bundled), so analysis ^0.3.0 is now a dependency of lsp.
  • Publish order: protocol, laravel-parser, springboot-parser, nestjs-parser, go-parser, express-parser, explainer, lens, analysis, lsp, mcp-server, CLI.