Skip to content

flowfig 0.8.0

Choose a tag to compare

@iamalvisng iamalvisng released this 05 Oct 05:14
· 116 commits to main since this release
079d5b0

flowfig verify now checks the arrows, not only the names. It tells you which edges of a figure the code really makes, so a reviewer can see which parts to trust.

npx flowfig verify docs/login.svg
# docs/login.svg: 7 of 7 boxes defined; edges: 9 found, 0 not found, 1 unsure, 1 not checked

New

  • Edge check. verify gives each edge one result:
    • found: the caller code calls or references the callee, through an import, the same file or a typed receiver.
    • not found: the code does not make that call. verify prints a warning, and --strict makes it an error.
    • unsure: verify cannot decide, for example when a receiver has no declared type. It lists the edge with the reason and never fails CI.
    • not checked: the edge has no code to check, or the file is in a language that verify does not read.
  • Languages. Edge checks work in TypeScript, JavaScript, Python, Go, Java, C# and Rust.
  • Methods. A source can name a method: src/auth/session.ts#Session.refresh.
  • via for edges across a process. Set via to the route, queue, topic, table, file or key that both sides use, for example "via": "order-paid". For a via edge, "found" means that the caller code and the callee file both use that name. It does not prove that a handler serves it.
  • Counts everywhere. The CLI, the MCP verify tool and the GitHub Action comment show the box and edge counts. verify --json adds a coverage list with the counts and the unsure edges.
  • Agent guide. The instructions that flowfig init installs teach agents to set edge sources and via, and to fix each edge that verify does not find.

Improvements

  • Box check. In a code file, a box symbol must be defined, not only mentioned. A name in a comment or a string no longer passes.
  • flowfig/verify exports verifyReport, which returns the findings and the counts. verify keeps its signature.

Requirements

  • Node 18 or later.
  • React 18 or later, only for the <Flow /> player.
  • flowfig gif uses Chrome, Edge, Chromium or Brave from your machine, and needs a little-endian CPU (x64 or ARM).

Upgrade

  • A box source whose symbol the file only mentions, and does not define, now fails verify with symbol not defined. Point the source at the file that defines the symbol, or use path#Owner.name for a method.
  • Edges that verify cannot find give warnings, not errors, unless you use --strict. Run npx flowfig verify <figure> once after the upgrade and fix the edges it reports.
  • If your GitHub workflow uses the flowfig Action, change it to iamalvisng/flowfig@v0.8.0.

Full Changelog: v0.7.0...v0.8.0