redhat-et / redhat-et/ripwire

Carry the member-macro re-parse past ALL-CAPS, and route `--match`/`--lint`/`--slice` through the repaired tree

Open
#156 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 missing

A semicolon-less macro invocation used as a struct member derails a C/C++ parse, and everything
filed after it lands in the wrong place. PR #135 taught ripwire to disclose those rows
(`extent_suspect=`) and to repair the commonest case. It left four gaps open on purpose, and
disclosed each one:

- the scanner blanks only **ALL-CAPS** invocations in class bodies;
- `--match`, `--lint` and `--slice` still parse files themselves, so they see the **derailed** tree;
- a partial repair is adopted, and `err=` can rise while `err_ratio` falls;
- most flagged rows remain.

## The evidence

Before the repair, a 14-line memgraph function reported `cx=749` and ranked #4 in `--hotspots`.

After it, the flagged rows that remain: **241 definitions in 9 files on memgraph**, and
**1,650 → 1,483** on an llvm-project checkout.

This is a measurement-led round for a reason. #135's own scanner header records that lowercase and
namespace-scope widenings removed **nothing** on the corpora it measured. So the kit starts by
classifying what still derails before anything widens. The verb-routing gap, by contrast, has a
certain payoff regardless of what the classification finds.

## Size

**Large.** STEP 0 is a measurement on a real corpus; STEP 1 is a shared parse-and-adopt helper plus
three verb routes; STEP 2's size depends on what STEP 0 finds; STEP 3 is the partial-repair
disclosure. A parser version bump and a schema re-pin are likely.

## Prerequisites

- **PR #135 merged.** The prompt checks this itself and stops if the code is absent.
- Comfort with C/C++ preprocessor idioms and tree-sitter error recovery, an llvm-project checkout
for measurement, clang, CMake, and an ASan build.

There are no known-gap arms in this kit: the code they would pin is not on `main` yet. The prompt
tells the contributor to add red-first arms to the existing `test/macroreparsecheck.sh` and
`test/extentcheck.sh`.

## Where to start

`prompts/help-wanted/member-macro-reparse-beyond-allcaps.md` is a self-contained prompt for a coding
agent. It carries the evidence, file pointers into #135's code, the four steps above, the
constraints, the acceptance criteria, the traps and the PR checklist — including the requirement
that each widening be proven on llvm/lib with byte-identity for every file whose first parse is
clean. Like every prompt in `prompts/`, **it ends by writing a plan and stopping** — a maintainer
agrees the plan before any code is written.

Comment here to claim it.

Contributor guide

Open the contributing guide

Research direction

Read prompts/help-wanted/member-macro-reparse-beyond-allcaps.md and verify PR #135 is merged before starting. Follow its measurement instructions on an llvm-project checkout, inspect the referenced parser code, and add red-first cases to test/macroreparsecheck.sh and test/extentcheck.sh. Done initially means producing the required plan for maintainer review; implementation must meet that prompt's acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, shell
Domain
cli, compilers, devtools, testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.