Repository navigation
Description
Parent
What to build
The first slice of c-includes: a C or C++ repository's quoted includes of a file next to the including file become pairs, so a part whose files include their siblings is read and its links are checked. The reader is registered beside the other extractors and detected by the default rule.
It reads the spec's thirteen extensions in any case, lexes each file once and resolves only step 1 ("Next to the file"). Angle-bracket includes and root-relative paths give nothing until the next ticket. Its test files are skipped by c-includes' own patterns. It works in commit mode and passes the contract cases. docs/studio/behaviour/map.md gets the start of its c-includes section: what it reads, the lexing rules, skipped files and step 1.
All of it is settled in #806, "Implementation Decisions": "The module", "What it reads", "Finding includes", "Paths", step 1 of "Resolution, per include", "Skipped files", "Detection".
Acceptance criteria
-
c-includesis registered and reads the thirteen extensions in any case (.Cand.HPPincluded);.m,.mm,.cuand.incare not read. - A quoted include of a tracked, non-ignored, non-skipped file next to the including file pairs,
"../x.h"included, with the directive's line. An adjacent ignored or skipped file gives no pair. - The lexer cases of Studio map: the C/C++ extractor, c-includes #806, "Testing Decisions" ("Lexing") hold: comments, strings and raw strings hide includes;
# includeand# includepair; a backslash-continued directive pairs;#include MACRO,#include_nextand#importgive nothing; both#if/#elsebranches and#if 0pair. - Empty paths, absolute paths and paths with a backslash give nothing;
.segments are removed. - The skipped-file cases hold: files under
tests/,Test/andfuzz/, andx_test.ccandtest_x.c, make no pairs and don't make a part read.testutil.ccandbench/x.ccare read. - Detection: the check suggests
c-includesfor a repository with a production.cfile, and not when every C file is a test or ignored. - One
--commitcase gives the same pairs as the working tree. - The contract cases run through the fixture kit as Studio map: the C/C++ extractor, c-includes #806, "Testing Decisions" ("The contract cases") sets out, with the
MalformedConfigskip. - Tests are behaviour tests in a new
system-map/tests/c.rs, table-shaped where a behaviour has several cases (prior arttests/php.rs). - plotkeeper's own
system-map checkandsystem-map importsprint the same standard output before and after (it tracks no C or C++ file). -
docs/studio/behaviour/map.mdhas thec-includessection's first half. -
npm run checkpasses.
Reading
- Studio map: the C/C++ extractor, c-includes #806, "Implementation Decisions" and "Testing Decisions": the settled rules and the test cases this ticket owns.
docs/studio/research/c-cpp-extractor.md: the research behind the rules, and the scanned-extensions line under "Results: curl".docs/adr/0002-extractors-read-text-only.md: extractors read text and run no build tool.- Studio: Spec: an extractor contract, so each language is one module #529, "Testing Decisions": the extractor contract and its fixture kit.
system-map/src/extract/php/andsystem-map/src/extract/java/mod.rs: prior art for a reader with a lexer, and for theMalformedConfigskip.
Touches
- Files: new
system-map/src/extract/c/mod.rs, newsystem-map/src/extract/c/lexer.rs,system-map/src/extract/mod.rs,system-map/src/extract/registry.rs, newsystem-map/tests/c.rs,system-map/tests/main.rs,docs/studio/behaviour/map.md - Session: auto mode
- Route: medium · effort medium — settled by the spec and outside the risk areas, but a new module with its lexer, the registry, a new test file and docs, about six files
Activity
Studio map: c-includes reads quoted includes next to the file (#807)
danielrispler commentedon Nov 28, 2026
Done on the integration branch
issue-806-c-includes(03cd7bc), in PR #814; closes when it merges.Route outcome: medium·medium claude/sonnet → pass | 8m
Studio map: the C/C++ extractor, c-includes (#806) (#814)