Skip to content

v4.193.0

@jessegall jessegall tagged this 25 Jul 07:57
v4.192.0 made the emission green by collapsing every namespace into its outermost
ancestor. Green, and worthless: run it on a tree with a class in the root namespace and
201 namespaces become ONE layer permitting everything. Correct and useless is still
useless, and the docs I wrote for it were wrong within the hour.

The real cause was narrower. `$arrows` deliberately drops a reference between a
namespace and its own subtree — for dependency DIRECTION the two are one unit — and
`mayUse` was read from it, so nested traffic was invisible and came out illegal. The
graph now keeps a second, complete map (`$references`) and the shape reads mayUse from
there. Every namespace keeps its own layer, and `App\Ai` <-> `App\Ai\Contracts` is
simply permitted both ways.

Two further defects the real tree exposed, neither of them in the emission:

- The DETECTOR judged references to classes the scan never found — an import left
  behind by a class that moved, or a vendor class under a prefix you declared. Nothing
  there can be depended on, and judging it made the rule disagree with the graph that
  proposes declarations, which is exactly how a fresh config failed its own judge.
- `--floor` measured a namespace's own references, but declaring one makes it absorb
  every descendant nobody declared, inheriting theirs: `App\Ai` looked like a floor
  while `App\Ai\Tools` reached `App\Base`. The floor is now a whole-subtree question.

Both are now shapes in the invariant provider, so they fail loudly if reintroduced, and
a new property test pins granularity — the guard that would have caught the collapse.

Real trees, emit -> judge: workflows 201 layers / 0, floor 28 / 0; smart-farmers-pos
477 / 0; prep-labels 108 / 0.
Assets 2
Loading