Skip to content

feat(engine): fileSignals op for data-flow metrics, findings and work packets - #398

Merged
byronwall merged 1 commit into
mainfrom
dataflow/engine-file-signals
Nov 21, 2026
Merged

byronwall merged 1 commit into
mainfrom
dataflow/engine-file-signals

Conversation

@byronwall

@byronwall byronwall commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

The data-flow engine can now produce tsx-data-flow's reporting for srcly: per-file data-flow metrics, two finding rules (impossible-defense and repeated-fork), and the old CLI's work packets as one dataflow.md. This layer adds the engine op; #399 makes srcly report --dataflow use it.

What you'll see

  • Nothing in the app or CLI yet. The new fileSignals op builds the legacy render-path report once (tier 2) and returns:
    • per TS/TSX file: impossible defenses, relay hops, fan-out, shape changes and path depth;
    • one impossible-defense finding per type-impossible ?? or ?., in the file that holds it, and one repeated-fork finding per component that tests the same discriminant at several sibling branch sites (Solid <Show> and <Match> too);
    • dataflow.md: the old CLI's work-packets, defensive-ledger, repeated-forks, prop-relay, context-relay and fan-out views, 8 items each, with srcly's provenance and rerun line.
  • The Python mirror and the emitted JSON Schema and client types come with it.

Proof

Each dataflow.md section matches the archived tsx-data-flow CLI byte for byte. I ran tsx-dataflow --root examples/bad-ish-solid --view <view> --max-items 8 in ~/Projects/tsx-data-flow (archived, 93a9052) and compared it with the op's output on engine/examples/bad-ish-solid (dates and the provenance/footer lines that name the tool aside):

work-packets identical
defensive-ledger identical
repeated-forks identical
prop-relay identical
context-relay identical
fan-out identical

The findings on the same example, from engine/test/srcly/file-signals.test.ts:

impossible-defense  src/DashboardShell.tsx:12   `route.toolbar.theme ?? "light"` guards a value whose type `"light" | "dark"` is never null or undefined, so the fallback never runs.
impossible-defense  … 11 more in src/DashboardShell.tsx (13, 51, 52, 53, 68 ×2, 110, 111, 133, 134, 135)
repeated-fork       src/Chart.tsx:37            `Chart` tests `props.type` at 4 sibling branch sites (lines 37, 38, 45, 48). Split it into one sub-component per branch (`bar`, `line`).

These are the same 12 impossible guards as the old defensive ledger, and the same fork as its repeated-forks view. scripts/check.sh passes (client, engine, server).

Limits

  • The legacy report records a defense's line and column but not its file. The op places each one in the first file on its sink's path whose text at that spot is the defense, and counts any it cannot place in unplacedDefenses instead of guessing. The old defensive-ledger view keeps its own labeling, so a defense inside a helper shows the sink's file there (an upstream quirk, unchanged).
  • The checked-in examples/bad-ish-solid/reports/*.md goldens are stale against the current analysis (for example Chart's max depth 9 vs 10). Both repos produce the same current output, so I compared with the live CLI, not the goldens.

Survey moves: server: traces +4, outcome partial +4, stops +55 (budget-exhausted +1, external-code +43, untraced +11). The new Python exports in server/ (the Pydantic mirror here, dataflow/signals.py in #399) enter the survey's hash sample; no analysis code changed.

Stack: data-flow reporting

What splits: Bring tsx-data-flow's reporting into srcly (M7): the engine op, then the server and CLI wiring with metrics and marks, then docs and the skill.
Why it splits: The engine op is a self-contained contract that can be checked against the old CLI on its own. The server layer is the user-visible change with screenshots. Docs follow the shipped behavior.
Why this split: I rejected one PR per finding rule: both rules, the metrics and dataflow.md all come from one legacy report build, so splitting them would mean three ops that each build it.

  1. feat(engine): fileSignals op for data-flow metrics, findings and work packets #398: engine fileSignals op, contract and Python mirror.
  2. feat: srcly report --dataflow, data-flow metrics and code-viewer marks #399: srcly report --dataflow, srcly compare --dataflow, six data-flow metrics, treemap and code-viewer marks.
  3. docs: data-flow reports in the skill, site and code map #400: skill reading rules, site pages, catalog and code map.

🤖 Generated with Claude Code

… packets

One tier-2 op builds the legacy report once and returns per-file metrics,
impossible-defense and repeated-fork findings, and dataflow.md (the old
CLI's work-packets, defensive-ledger, repeated-forks, prop-relay,
context-relay and fan-out views).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@byronwall
byronwall added this pull request to stack #401 November 21, 2026 14:47
@byronwall
byronwall marked this pull request as ready for review November 21, 2026 14:52
@byronwall
byronwall merged commit 252092b into main Nov 21, 2026
7 checks passed
@byronwall
byronwall deleted the dataflow/engine-file-signals branch November 21, 2026 14:53
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