Files
Bo c1a46cee26 chore: scrub all jsm references — external ref only, patterns kept (soc-wnic7 #scrub-jsm) (#501)
## What

Operator directive (soc-wnic7): scrub ALL references to "jsm" from
AgentOps. jsm was only an external reference corpus we learned patterns
from. The absorbed **patterns stay** (skill-quality rubric, SELF-TEST
shape, system-tuning methodology, bug-hunt patterns, attribution
patterns, marketplace-export profile) — only the jsm **name**,
jsm-dedicated docs, and jsm export tooling are removed.

## Deleted (8 files)

- `docs/reference/jsm-agentops-gap-audit.md`
- `docs/reference/jsm-clean-room-extraction-policy.md`
- `docs/reference/jsm-cli-capability-map.md`
- `docs/reference/jsm-pilot-upgrade-backlog.md`
- `docs/reference/jsm-skill-absorption.md`
- `docs/reference/jsm-skill-standards.md`
- `scripts/check-jsm-export.sh`
- `scripts/inventory-jsm-skills.sh`

## Renamed (kept methodology, stripped jsm)

`skills/standards/references/jsm-attribution.md` →
`external-source-attribution.md` (+ skills-codex + cli/embedded
mirrors). The attribution methodology (Pattern A/B, choice rule, mkdocs
constraint, clean-room hygiene) is a kept pattern — renamed and de-named
rather than deleted, so the standards skill keeps a repoint target.

## Edited

- De-catalogued the 6 deleted docs from `docs/documentation-index.md`
and `docs/reference/index.md`; de-named the kept skill-quality-rubric
entries.
- Genericized every footer/credit per the scope rule:
- `Adapted from jsm / \`x\`` → `Adapted from an external skill corpus /
\`x\``
- `(jsm/ACFS skill corpus)` → `(ACFS skill corpus)` — **ACFS/gstack
credits left intact**
- jsm-only credits (system-tuning, hooks-authoring) → "external skill
corpus", keeping the methodology-only/no-verbatim hygiene clause
- Genericized: "JSM-Style/Marketplace Export Profile", hexagonal-map
adapter node, domain-evolution BDD/plan gherkin steps, CHANGELOG
entries, skill-auditor validation-terms tuple.
- Removed dead `check-jsm-export` blocks from 4 SELF-TEST.md files.

## Regen + gates (all green)

`make sync-hooks` · `regen-codex-hashes.sh` · `generate-registry.sh`
re-run. Verified: `grep -ri jsm` empty (per exclusions);
`regen-codex-hashes --check` OK; `generate-registry --check` OK;
`validate-embedded-sync` in sync; `validate-context-map-drift` OK;
`check-docs-learning-references` PASS; `heal.sh --strict` clean;
`audit-codex-parity` PASS; `go build ./...` OK; no dangling punctuation;
no broken links to deleted files.

Closes-scenario: soc-wnic7#scrub-jsm
Bounded-context: BC1-Corpus
Evidence: docs/documentation-index.md
2026-05-23 22:41:56 -04:00

3.5 KiB

rg-optimized — Building ripgrep from source with PCRE2

A short operator note for when the system rg is not enough.

Why build from source

Most distro packages ship ripgrep with the default Rust regex engine only. That engine is fast and Unicode-aware, but it deliberately omits a few features that PCRE2 supports:

  • Lookahead and lookbehind ((?=...), (?<=...))
  • Atomic groups ((?>...))
  • Backreferences (\1, \2, ...)
  • Some Unicode property escapes used by editor-style regex

When rg -P 'pattern' returns PCRE2 is not available in this build of ripgrep, the binary on PATH was compiled without the pcre2 feature. Building from upstream BurntSushi/ripgrep with --features pcre2 enables the -P flag and links the system libpcre2. A release build at the same time gives you a binary tuned to the local toolchain and CPU.

When to run

Use this script when any of the following is true:

  • rg -P fails with a "PCRE2 is not available" error.
  • The packaged rg --version is older than 14.x and you need recent fixes.
  • You want a single, reproducible local rg across machines without trusting whatever the distro pinned.
  • You need maximum throughput on large repos and the packaged build was compiled with conservative defaults.

If rg --version already prints PCRE2 ... is available, you can skip this entirely.

Install

From the repo root:

bash scripts/build-rg.sh

This clones BurntSushi/ripgrep at the pinned tag (default 14.1.1), runs cargo build --release --features 'pcre2', and installs the resulting binary to ~/.local/bin/rg. Re-running the script is safe; it updates the source tree, rebuilds against the requested tag, and replaces the installed binary atomically.

Common overrides:

Variable Default Effect
RG_VERSION 14.1.1 Upstream git tag to check out
RG_INSTALL_DIR ~/.local/bin Where the rg binary is written
RG_SRC_DIR ~/.cache/agentops/ripgrep-src Where the source clone lives
ASSUME_YES 0 Set to 1 to skip the rustup install confirmation

The script aborts on Windows with a pointer to winget / choco. If cargo is missing, it asks before running rustup.

Verify

which rg
rg --version
rg -P '(?<=foo)bar' /dev/null   # should not error; PCRE2 lookbehind

A working build prints a features: line that mentions +pcre2 and a PCRE2 ... is available line at the bottom of rg --version. The script fails with a non-zero exit code if either is missing, so a clean script run is itself the verification.

If ~/.local/bin is not on your PATH, the script prints a reminder. Add it to your shell rc (export PATH="$HOME/.local/bin:$PATH") so the new rg shadows the system copy.

Troubleshooting

  • cargo not found — let the script invoke rustup, or install Rust first via your usual channel.
  • Linker error about pcre2 — on Linux install libpcre2-dev (Debian/Ubuntu) or pcre2-devel (Fedora/RHEL); on macOS install pcre2 via Homebrew. The pcre2 cargo feature still vendors the library when system headers are missing, but a system install gives a faster, cleaner build.
  • Text file busy during install — close any process using rg (file watchers, editors) and re-run.
  • Upstream README: https://github.com/BurntSushi/ripgrep
  • The rg-optimized external skill — pattern source for this doc and the build script.

Pattern adopted from rg-optimized (ACFS skill corpus). Methodology only — no verbatim text.