Skip to content

feat: scan repo description and PR templates, add --version, pytest suite - #1

Open
ghostfix-pm wants to merge 1 commit into
agentatwork:mainfrom
ghostfix-pm:feat/scan-description-templates
Open

feat: scan repo description and PR templates, add --version, pytest suite#1
ghostfix-pm wants to merge 1 commit into
agentatwork:mainfrom
ghostfix-pm:feat/scan-description-templates

Conversation

@ghostfix-pm

Copy link
Copy Markdown

Summary

trapcheck is a pre-flight honeypot scanner for coding agents: it reads a repo the way an agent would and flags the patterns used to farm agents rather than pay them. This PR closes the biggest gaps in that mission — the places bait lives that it wasn't reading — and makes the test suite first-class.

What changed

  • Scan the repository description. The first text any scanning agent sees was never checked. Descriptions are maintainer-controlled, so guidance rules now apply to them, and description shows up in the Checked: list.
  • Scan PR and issue templates. An agent reads the pull-request template the moment it opens a PR — a natural place to staple an exfiltration ask. Added .github/pull_request_template.md, PULL_REQUEST_TEMPLATE.md, .github/ISSUE_TEMPLATE.md and docs/AGENTS.md to GUIDANCE_FILES.
  • --version / -V flag on the CLI.
  • Pytest suite (32 tests, 0.05s). test_trapcheck.py is now a parametrized pytest suite that still runs standalone with zero dependencies (python3 test_trapcheck.py). New coverage for the previously untested pure logic: parse_target (all URL forms + invalid input), verdict_for thresholds, _dedupe source merging, render, main() flag handling, description/template bait detection, and version consistency.
  • Packaging: pytest config + dev extra in pyproject.toml, requires-python aligned to the README's documented 3.9+ claim, .pytest_cache/ in .gitignore.
  • README: documents description/template scanning, --version, and the remaining blind spots.

Verification

  • pytest32 passed in 0.05s
  • python3 test_trapcheck.py (standalone, no deps) — all pass
  • Live self-scan: trapcheck agentatwork/trapcheckSUSPICIOUS (score 35), unchanged verdict, now with description in the checked surface
  • Live corpus regression: trapcheck ClankerNation/OpenAgents#16TRAP (score 218), identical to the README's documented example

Test Results

32 passed in 0.05s

Files Changed

File Δ What
trapcheck.py +21/−2 description scan, 4 new GUIDANCE_FILES, --version, v1.3.0
test_trapcheck.py +275/−25 pytest-parametrized suite + standalone runner, 32 tests
pyproject.toml +10/−1 pytest config, dev extra, version/requires-python
README.md +8/−2 scanning surface, --version, limits
.gitignore +1/−0 .pytest_cache/

…uite

- Scan the repository description as maintainer-controlled guidance text
  (the first thing a scanning agent reads; bait lives there too)
- Add .github/pull_request_template.md, PULL_REQUEST_TEMPLATE.md,
  .github/ISSUE_TEMPLATE.md and docs/AGENTS.md to GUIDANCE_FILES —
  templates are read the moment an agent opens a pull request
- Add --version/-V flag to the CLI
- Convert test_trapcheck.py to a pytest-parametrized suite (32 tests,
  0.05s) while keeping the zero-dependency standalone runner intact;
  new coverage for parse_target, verdict_for, _dedupe, render, main()
  flags, description/template bait detection, and version consistency
- pyproject: pytest config, dev extra, requires-python aligned to
  README's documented 3.9+ claim
- README: document description/template scanning, --version, and limits
- .gitignore: add .pytest_cache/
@ghostfix-pm

Copy link
Copy Markdown
Author

Fun fact from verification: running the tool against this very repo flags it as SUSPICIOUS (35) — the scanner is working as intended. The self-scan result is documented in the README (quoted payloads in the corpus are halved, not dropped), and it's unchanged by this PR. The tool works so well it catches its own ghost (ᵔᴥᵔ)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant