Files
ruflo/plugins/ruflo-mods/scripts
21c24d3218 fix(learning-loop): help/list runs are not verifiers; never store part of a secret (#5067) (#5068)
* fix(learning-loop): help/list runs are not verifiers; never store part of a secret

An edit followed by a test command that only printed help or listed tests
(`npm test --help`, `npx vitest list`, `npx jest --listTests`,
`pytest --collect-only`, `cargo test --no-run`, `go test -list .`) was
recorded as verified-success: classify() matched the command head and
ignored the rest, and those commands exit 0 without running a check.

- classify(): a verifier segment whose bash words ask for help, version,
  a listing, a config dump, a dry run or a compile-only build is not a
  verifier; `vitest list` / `cargo nextest list` likewise. Words are split
  as bash does, so a quoted argument that contains `--help` (a test-name
  pattern) still verifies. A command with a shell comment is refused:
  `npm run build # && npm test` ran only the build.
- Verifier evidence is screened for secret shapes; a command carrying one
  keeps its kind and outcome and is stored as `[redacted]`. Evidence reaches
  SONA feedback, the ledger and learned lessons.
- taskText() screened only the first 300 characters, after the cut, so a
  key the cut split was stored in part (`ghp_ABCDEFGHIJKLMNO`). It now
  screens the kept text plus 1 KiB, cuts at a word boundary so a long key
  (JWT) is dropped whole, and reads at most 64 KiB of the prompt
  (32M-character prompt: ~6 ms, against ~1.4 s unbounded).

Regenerated both learning-loop.cjs copies. helpers.manifest.json needs a
maintainer re-sign for the new bytes.

Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_01GLQCdgnsuwts6j51rwcqgB

* fix(learning-loop): per-runner no-run flags, raw screening, SONA skips [redacted] (0.17.5)

Third adversarial review of #5068:

- More commands that exit 0 without a check are not verifiers: tsc -v,
  --listFilesOnly, -b --dry, --init; eslint -v, --env-info; vitest/jest
  -v; make -n/-q (and clusters); go test -c/-n; dotnet test -t; pytest
  --fixtures/--markers/--setup-plan; npm/pnpm/yarn/bun --if-present.
  Flags are read for the program actually run (past npx, pnpm exec,
  python -m, uv/poetry run), so `pytest -v` stays a run and
  `jest --testNamePattern vitest list` is not taken for `vitest list`.
- Bash removes a backslash-newline outright; classify() now joins without
  a space (`--ver\<newline>sion` is --version). An escaped space no longer
  starts a word, so `a\ #b` is not a comment.
- shellWords()/hasComment() move to hooks/loop/words.ts; narrows() uses
  them, so a partly quoted --passWithNoTests still taints (ADR-503).
- Evidence and task text are screened as given as well as normalised: a
  line separator or control character inside a key hid it from the
  folded screen. A kept key-block header ("-----BEGIN") is refused.
- Ingest counts a task stored as [redacted] and never trains SONA with
  it (it learned `coder:redacted`).
- ruflo-mods 0.17.5 with a CHANGELOG entry (version-bump check).

Every guard is covered: reverting any one of the 12 fails a test.

Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_01GLQCdgnsuwts6j51rwcqgB

* chore(helpers): re-sign helpers.manifest.json for the rebuilt learning-loop.cjs (#5067)

Rebuilt learning-loop.cjs from source with build-learning-loop-helper.mjs;
the bytes match the committed bundle (sha256 0a39ee1d50d3349d...).

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
Co-authored-by: RuFlo <ruv@ruv.net>
2026-11-22 14:46:02 -05:00
..