redhat-et / redhat-et/ripwire

A file refused for pathological nesting becomes invisible — no `--skipped` row, nothing on a warm run, and `--match` parses it anyway

Open
#157 0 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
C++
Stars
2.1k
Forks
125
Avg merge
5h 42m
Merged PRs (30d)
136

Description

## What is wrong

ripwire deliberately refuses pathologically nested JSON, YAML and Markdown before parsing. For YAML
and Markdown the refusal protects memory: those vendored grammars' scanners write past a 1024-byte
buffer at roughly 250 levels deep. The refusal is right. Its visibility is not — it is one line of
stderr on cold runs only, `--skipped` never lists the refused file, and a warm run (the default,
because ripwire caches per root) prints nothing at all. Worse, `--match` parses the refused file
anyway, in the same run that refused it, so the two-layer safety design quietly becomes one layer.
An agent asking "why is this file missing from the map?" gets no answer.

## The evidence

Two gates carry KNOWN GAP blocks pinning exactly this, each on its own generated fixture — a
300-level `deep.yml` and a 300-marker `deepquote.md`. Four arms apiece:

- a warm run's stderr says nothing about the file;
- cold `--skipped` has no row for it;
- warm `--skipped` has no row for it;
- `--match='(block_mapping_pair)'` (and `--match='(block_quote)'` for Markdown) returns hits inside
it, in the same run whose ingest refused it.

A presence guard — cold refusal note, warm map equal to cold, sibling file indexed — keeps each
block from passing vacuously, and the `--match` arm is judged only on a clean exit so a crash cannot
pass it. All arms pass today. **Flipping them is the finish line.**

Confirm on a plain dev build with `bash test/yamllangcheck.sh` and `bash test/mdsectioncheck.sh`.

## Size

**Medium**, in two parts that land separately: the `--skipped` rows with the warm-cache fix, and a
single shared refusal predicate applied at the `--match`, `--pattern` and span-tier parse sites. The
tricky parts are making an old cache stop hiding refused files, and choosing the disclosure
attribute for `--match`. Expect a cache version bump with its mirror.

## Where to start

`prompts/help-wanted/nesting-refusals-visible.md` is a self-contained prompt for a coding agent. It
carries the file pointers — the three prescans, where they run relative to the cache-hit path, and
every unguarded parse site — plus the reproductions, the design space and constraints, the
acceptance criteria, the known traps, and what the fix PR's description should contain. Like every
prompt in `prompts/`, **it ends by writing a plan and stopping** — a maintainer agrees the plan
before any code is written.

Worth checking first: PR #126 (Kotlin) carries the same mechanism for its own Kotlin guard —
itemized `why="nest-refused"` rows and the warm-cache fix. If it has landed, generalize its class
rather than adding a second one. It is a pattern reference, not a dependency; the gap is on `main`
today.

Comment here to claim it.

Contributor guide

Open the contributing guide

Research direction

Read prompts/help-wanted/nesting-refusals-visible.md first; it identifies the prescans, cache-hit path, parse sites, reproductions, and acceptance criteria. Check PR #126 for the Kotlin refusal pattern, then run bash test/yamllangcheck.sh and bash test/mdsectioncheck.sh. Done means the known-gap arms flip: refused files are visible in cold and warm --skipped output and are not parsed by --match, --pattern, or span-tier paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, cpp
Domain
cli, devtools, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.