Skip to content

Releases: chenhz01/loop-gate

v0.1.3 — SPDX headers + a fence that closes

Choose a tag to compare

@chenhz01 chenhz01 released this 20 Oct 07:26

What changed

1. gate.py now carries an SPDX header.

# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 chenhz01 — see LICENSE, LICENSE-SPEC and NOTICE

The repo already shipped LICENSE, LICENSE-SPEC and NOTICE, and the README
described the dual license — but the code file itself had no machine-readable
identifier. Attribution lived only on the page, so a single copied file arrived
with no provenance. Comments only: behaviour is byte-identical to v0.1.2.

2. Fixed a code fence that closed itself.

The sample output below the fold is wrapped in a fenced block. This gate's own
output contains a triple backtick (the "code block not closed" rule quotes it),
which closed the fence early and turned the remaining lines into body text —
[PLACEHOLDER](project_custom) rendered as a link and 404'd on the repo page.
The fence is now sized to the content (four backticks here, three elsewhere).

A gate that reports "code block not closed" had an unclosed code block in its own
README. Found by extracting and HTTP-checking every link in all 15 READMEs.

Exit codes for this gate

The bundled example exits 1 (it detects stasis in the trajectory).

v0.1.2 — accurate no-args hint

Choose a tag to compare

@chenhz01 chenhz01 released this 20 Oct 06:14

What changed

The no-args warning in action.yml said args: check path/to/your/file on every
gate. check is only loop-gate's subcommand — the correct usage for this gate is:

- uses: chenhz01/loop-gate@v0.1.2
  with:
    args: "check path/to/trajectory.jsonl --window 6 --repeat-threshold 3"

Nothing else changed: gate.py is byte-identical to v0.1.1.

Why it matters

If you mount the action without args, it prints help and exits 0 — a green
check that inspected nothing. The warning annotation now quotes this gate's real
usage, so the fix is one copy-paste away instead of a wrong hint.

Pin the newest tag

The README used to pin @v0.1.0. That version predates the fix that makes a
mistyped path exit 2 instead of silently scanning zero files and passing.
Use @v0.1.2.

Exit codes for this gate

The bundled example exits 1 (it detects stasis in the trajectory).

v0.1.1

Choose a tag to compare

@chenhz01 chenhz01 released this 20 Oct 05:48

v0.1.1 — exit codes documented truthfully

Agent loop detector: find where an AI agent looped and burned tokens, before it runs again. Zero-dependency CLI.

What changed

  • Each gate now documents its own exit codes (0 / 1 / 2). The previous wording —
    "0 = clean, 1 = findings" — was wrong for gates that measure rather than judge.
  • leak-gate: a mistyped path used to print scanned 0 file(s) and exit 0. A typo in
    CI meant a permanently green gate. It now exits 2 with error: path not found, and also
    errors when nothing was scannable.
  • A contract test now asserts, for every gate: bundled example exit code = documented value,
    and a non-existent path exits 2.

About the bundled example

It exits 1: the bundled input is deliberately broken — that is the demo, not a bug

License

Code: Apache-2.0 · Spec & docs: CC BY 4.0

v0.1.0

Choose a tag to compare

@chenhz01 chenhz01 released this 20 Oct 05:17

v0.1.0 — first public cut

Agent loop detector: find where an AI agent looped and burned tokens, before it runs again. Zero-dependency CLI.

Run it

python gate.py check examples/trajectory.jsonl --window 6 --repeat-threshold 3

The bundled examples/ are designed to fail — that is the demo, not a bug.

What is verified (not claimed)

  • Zero dependencies: one file, standard library only, Python 3.9+
  • Every output quoted in the README is real stdout from this repo, not a mock-up
  • CI runs this gate on every push — the badge at the top is live, click it and read the log
  • Exit code is meaningful: 0 clean, non-zero when it finds something

What it does not do

  • It does not intercept live calls — it reads what already happened.

License

Code: Apache-2.0 · Spec & docs: CC BY 4.0