Skip to content

fix: explainer FormRequest semantics, NestJS ir:wraps, silent Laravel pass errors, flaky test workers - #13

Merged
Kidkender merged 5 commits into
mainfrom
fix/minor-issues
Nov 13, 2026
Merged

Kidkender merged 5 commits into
mainfrom
fix/minor-issues

Conversation

@Kidkender

@Kidkender Kidkender commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Small fixes found while working on the other open PRs. Merge after #12 — main does not build on a clean checkout until then.

Changes

  • explainer — validation is an authorization layer only in Laravel. 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. The FormRequest meaning now applies when the graph's framework is laravel or unset. Behaviour change: outside Laravel a route has at most two authorization layers, so over_authorized_route no longer fires on NestJS / Spring Boot / Go. One NestJS detector test asserted the old behaviour and is updated.
  • nestjs-parser — ir:wraps instead of within_transaction. Writes inside a transaction were linked by a relation that is not in the IR, so validateGraph reported it as unknown; no conformance fixture opened a transaction, which is how it went unnoticed. New conformance suite on a transaction fixture (fails on the old emitter). Nothing reads the old relation.
  • laravel-parser — no more silent pass failures. The transaction, isolation, audit-log and nested service-call passes inside a service, and a queued job's handle(), swallowed every error. The parsers already turn unreadable files into empty results, so what reached these catches was a bug that read as "nothing found". Now reported on stderr with the pass and file; the pass is still skipped. New test makes one pass throw and checks the warning, that the rest of the graph is built, and that later passes still run.
  • Flaky tests. retrieval, nestjs-parser and mcp-server load the tree-sitter parsers, whose module-level parser fails intermittently when Jest reuses a worker across files. maxWorkers: 50 (one process per test file), as laravel-parser already has.
  • npm run trace pointed at apps/cli/dist/index.js; the CLI builds to index.cjs.
  • CHANGELOG [Unreleased] entry for the above.

Verified

  • Clean worktree with fix/build merged in: npm ci, build (22 workspaces), npm test — all pass.
  • Flaky-test fix: retrieval with every test file in one process (--runInBand) failed 5 of 5 runs (29–44 tests each); with the fix 0 of 10, and nestjs-parser 0 of 10.
  • npm run trace -- --project research/cross-framework/auth-only/laravel runs.

Merge note

feat/express-parser also adds a CHANGELOG [Unreleased] section at the same spot; whichever merges second needs the two sections combined.

On real projects

Before/after on shallow clones (graphs unchanged in every case):

…pass catches

- package.json: `npm run trace` pointed at apps/cli/dist/index.js; the CLI
  builds to index.cjs.
- retrieval, nestjs-parser, mcp-server: maxWorkers 50 so each test file gets
  its own process. Their tests load the tree-sitter parsers (Laravel, Spring
  Boot, Go), whose module-level Parser fails intermittently when Jest reuses a
  worker across files — retrieval's cross-framework test failed 15 cases once
  and passed on rerun. Same fix laravel-parser already has.
- laravel-parser graph-augmenter: the transaction, isolation, audit-log and
  nested service-call passes, and a queued job's handle(), no longer swallow
  errors silently. The parsers already turn unreadable files into empty
  results, so what reaches these catches is a bug; it is now reported on
  stderr with the pass and file, and the pass is skipped as before.
…ported and skipped

The isolation parser is made to throw for the service file only; the test
checks the stderr warning names the pass, the file and the error, that the
rest of the graph (the service's calls, the transaction) is still built, and
that later passes of the same service (its guard clause) still run.
…n_transaction"

"within_transaction" is neither an IR relation nor a tracked legacy one, so
validateGraph reported it as unknown. None of the conformance fixtures opened a
transaction, which is how it went unnoticed. Writes now hang off the
transaction by ir:wraps, as in Laravel and Express graphs (nothing reads the
old relation). New conformance suite on the auth-transaction fixture; it fails
on the old emitter.
… 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 are about Laravel's
FormRequest::authorize(); a NestJS ValidationPipe, Spring @Valid, Gin binding
or Express celebrate / express-validator only checks the input. They fired on
ordinary authenticated, role-checked, validated routes outside Laravel (on one
Express project: 5 over_authorized_route, 12 delegated_validation).

The FormRequest meaning now applies when graph.framework is "laravel" or unset
(legacy and hand-built graphs keep their behaviour). Outside Laravel a route has
at most two authorization layers, so over_authorized_route does not fire there.
The NestJS detector test that asserted the old behaviour is updated.
@Kidkender
Kidkender merged commit 230dba1 into main Nov 13, 2026
1 check failed
@Kidkender
Kidkender deleted the fix/minor-issues branch November 13, 2026 04:45
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