Skip to content

v0.2.0

Latest

Choose a tag to compare

@jakekaplan jakekaplan released this 18 Oct 18:37
· 10 commits to main since this release
5afd285

loq 0.2.0

Features

  • Approximate token budgets: max_tokens rules limit prompts and other agent-facing files by an estimated token count (bytes / 4, rounded up) instead of by line count.
  • default_max_tokens: sets a default token budget for files that no rule matches. Set either default_max_lines or default_max_tokens, not both.

Fixes

  • baseline, relax and tighten now find the config file the same way check does. When run from a subdirectory, they update the nearest loq.toml above it with paths relative to that file, and only scan the current directory. Rules for files outside that directory stay as they are.
  • baseline keeps token rules, and the edit commands no longer touch token-governed files.
  • Directory walks always skip .git, so you no longer need .git/** in exclude.
  • check now warns about paths that don't exist, and CLI warnings are clearer.

Upgrading

Configs that worked on 0.1.0 work unchanged on 0.2.0. A few changes are visible:

  • JSON output includes metric ("lines" or "tokens") and approximate on every violation. Token violations report tokens and max_tokens in place of lines and max_lines.
  • Subdirectory runs of baseline/relax/tighten used to create a new loq.toml in the current directory. They now update the project's existing config instead. If you have a stray loq.toml from that old behavior, it's still used, because it's the nearest config file.
  • .git contents are no longer checked, even if your exclude doesn't list them.

Other

  • Internal refactors and expanded test coverage.

What's Changed

Full Changelog: v0.1.0...v0.2.0