Repository navigation
Description
Parent
What to build
The rest of c-includes' resolution: an include that isn't next to the including file is matched against the ends of tracked paths. One live match gives a pair. A tie is settled by the implied folder that at least 5 unique matches use. Where it can't be settled, the include is Unsure and names its candidates. An angle-bracket include of a standard, POSIX, platform or Windows header gives nothing. An ignored copy among the candidates keeps the include Unsure (ADR 0004).
This is step 1's fall-through and steps 2 to 4 of #806, "Resolution, per include", plus "The system-header list" and "Speed". The docs/studio/behaviour/map.md section is completed: the resolution steps, Unsure and its two reasons, ignored and why it differs from java-imports, and the under- and over-counts, with the over-count wording from #806, "Implementation Decisions" ("Docs").
Acceptance criteria
- The system-header list is a checked-in constant holding exactly Studio map: the C/C++ extractor, c-includes #806's list (the research's
STD,PLATFORM,SYS_PREFIXandWIN), and its comment names each group's source. It applies to angle-bracket includes only. - One suffix index of the tracked files is built once per run. Candidates are the tracked files equal to the include's path or ending in
/followed by it, less skipped files, with ignored files kept. - Next to the file, a sibling that exists wins over a root-relative match elsewhere. An adjacent ignored or skipped file gives nothing and stops resolution, with no fall-through to a match elsewhere.
- A path with a
..segment that doesn't resolve next to the file gives nothing, even when a tracked path ends with it. - The "Path-ending match", "System names", "Unsure", "Tie-break" and "Ignored" cases of Studio map: the C/C++ extractor, c-includes #806, "Testing Decisions" hold, and a tie between a production header and a
tests/one resolves to the production one. - Unsure findings carry reason
an ignored copy matches itorseveral files match it, with every candidate. They relax only the links to the candidates' parts and are listed underunsurein--json. - Evidence is counted over the whole repository before any tie is settled, so the result doesn't depend on file order. N = 5.
- Tests are new rows and tables in
system-map/tests/c.rs(prior arttests/dart.rsfor Unsure). - plotkeeper's own
system-map checkandsystem-map importsprint the same standard output before and after. -
docs/studio/behaviour/map.md'sc-includessection is complete and names the research note, ADR 0004 and the trial set. -
npm run checkpasses.
Reading
- Studio map: the C/C++ extractor, c-includes #806, "Implementation Decisions" (from "Resolution, per include" to "Docs") and "Testing Decisions": the settled rules and this ticket's cases.
docs/adr/0004-c-includes-an-ignored-copy-keeps-an-include-unsure.md: why an ignored copy blocks a match even when the tie-break would pick a live one.docs/studio/research/c-cpp-extractor.md, rounds 2 to 4 and their method sections: the system-header lists (STD,PLATFORM,SYS_PREFIX,WIN) and the evidence rule's measurements.- Studio map: the C/C++ extractor, c-includes #806, "Further Notes": the follow-up round's variant table.
system-map/src/extract/python/: prior art for a checked-in standard-library list.
Touches
- Files:
system-map/src/extract/c/mod.rs, newsystem-map/src/extract/c/resolve.rs, newsystem-map/src/extract/c/system_headers.rs,system-map/tests/c.rs,docs/studio/behaviour/map.md - Session: auto mode
- Route: medium · effort medium — settled by the spec and ADR 0004, and outside the risk areas, but a new resolution module and constant with their tests and docs
Activity
Studio map: c-includes path-ending match, system names, Unsure and th…
danielrispler commentedon Nov 28, 2026
Done on the integration branch
issue-806-c-includes(4093815), in PR #814; closes when it merges.Route outcome: medium·medium claude/sonnet → pass | 9m
Studio map: the C/C++ extractor, c-includes (#806) (#814)