Skip to content

Studio map: c-includes, the reader and next-to-the-file includes (#806) #807

Done

Description

@danielrispler

Parent

#806

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-includes is registered and reads the thirteen extensions in any case (.C and .HPP included); .m, .mm, .cu and .inc are 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; # include and # include pair; a backslash-continued directive pairs; #include MACRO, #include_next and #import give nothing; both #if/#else branches and #if 0 pair.
  • Empty paths, absolute paths and paths with a backslash give nothing; . segments are removed.
  • The skipped-file cases hold: files under tests/, Test/ and fuzz/, and x_test.cc and test_x.c, make no pairs and don't make a part read. testutil.cc and bench/x.cc are read.
  • Detection: the check suggests c-includes for a repository with a production .c file, and not when every C file is a test or ignored.
  • One --commit case 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 MalformedConfig skip.
  • Tests are behaviour tests in a new system-map/tests/c.rs, table-shaped where a behaviour has several cases (prior art tests/php.rs).
  • plotkeeper's own system-map check and system-map imports print the same standard output before and after (it tracks no C or C++ file).
  • docs/studio/behaviour/map.md has the c-includes section's first half.
  • npm run check passes.

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/ and system-map/src/extract/java/mod.rs: prior art for a reader with a lexer, and for the MalformedConfig skip.

Touches

  • Files: new system-map/src/extract/c/mod.rs, new system-map/src/extract/c/lexer.rs, system-map/src/extract/mod.rs, system-map/src/extract/registry.rs, new system-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

  1. added
    ready-for-agent
    on Nov 28, 2026
  2. danielrispler commented on Nov 28, 2026

    @danielrispler
    OwnerAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready-for-agent

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions