Add loop pattern library: five templates + wizard Template Mode (v0.3.0)#15
Merged
Conversation
templates/loops/ ships five named, pre-designed loops the wizard
customizes instead of starting blank: security-scan (promoted from the
real hermes-ecosystem run), code-review, bug-hunt, docs-sync, and
research-synthesis. Each is a complete, compiler-validated loop.yaml
with {{PLACEHOLDER}} slots, a README (use-when, placeholder table,
customization notes), and helper check scripts where needed.
- /looper [target-dir] --template <name>: compressed interview that
asks only for placeholders, models, and paths; critique, structural
rules, privacy statement, and preview still run.
- looper.py compile now warns on unresolved {{PLACEHOLDER}} tokens;
the wizard treats the warning as an emit blocker.
- scan-secrets.py: streaming secret/PII sweep (worktree + git history),
vendor paths skipped, masked excerpts only.
- Tests 16 -> 18: every template must compile with the expected
placeholder warning and appear in the catalog; the warning must
disappear after substitution.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
High-effort review of PR #15 surfaced real defects in the new template scripts. Fixes: scan-secrets.py - Match underscore-joined credential names (SECRET_KEY, DB_PASSWORD, client_secret) — the trailing \b rejected exactly those. - Drop over-broad "test"/"sample"/"dummy"/"fake" placeholder markers that suppressed real secrets (e.g. Contest2024!). - Dedupe on a hash of the raw value, not the masked form, so distinct secrets that mask alike are no longer silently collapsed; mask no longer leaks exact length. - Prune skipped dirs in the walk (os.walk) instead of rglob-then-filter; drop dead "*.ipynb checkpoints" glob (skip .ipynb_checkpoints dir). Checker scripts (all five) - Fix PLACEHOLDERS regex so a standalone "???" is actually caught (\b can't bound a non-word char). - Waive required-field validation only for a genuine empty report — a standalone no-findings line AND no finding signal (severity/file:line/ status) — closing the incidental-substring bypass in check-findings, check-review, check-drift-report. - check-citations: require cited paths resolve to a file UNDER the sources dir (reject drafts/same-basename files elsewhere). Templates / compiler / docs - bug-hunt: REPRO_CMD/TEST_CMD are string-form checks (compiler shlex-splits) so a substituted multi-word command yields a valid argv, not an unexecutable one-element list. - find_placeholders scans dict keys too. - SKILL.md: existing loop.yaml (edit/resume) takes precedence over --template; commands/looper.md: target dir may contain spaces. Tests 18 -> 27: scanner detection/dedupe/masking and checker gate-bypass regressions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the pattern library (roadmap Part 3 #1): named, pre-designed loops the wizard customizes instead of starting from a blank interview.
templates/loops/— five templates, each a complete, compiler-validatedloop.yamlwith{{PLACEHOLDER}}slots, a README (use-when, placeholder table, customization notes), and helper check scripts where the pattern needs them:security-scan— promoted from the real run that produced hermes-ecosystem's security fixes; ships a fresh streamingscan-secrets.py(worktree + git history, vendor paths skipped, masked excerpts only)code-review,bug-hunt,docs-sync,research-synthesis/looper [target-dir] --template <name>— Template Mode in SKILL.md: a compressed interview (placeholders, model selection, paths) that keeps the full critique, structural rules, privacy statement, and ASCII preview. A template is a pre-answered interview, not a bypass.compilewarns on unresolved{{PLACEHOLDER}}tokens; the wizard treats the warning as an emit blocker, so CI can compile raw templates while a half-customized loop can't ship silently.Test plan
python -m unittest discover -s tests— 18/18 green (16 existing + 2 new: every template compiles with the expected placeholder warning and is listed in the catalog; the warning disappears after substitution)check-review.pyfails a TBD-laden report and passes a well-formed onescan-secrets.pystandalone: detects seeded AWS-key/email candidates with masked excerpts, skipsnode_modules, history mode verified against a repo with a deleted secret🤖 Generated with Claude Code