Skip to content

Studio map: c-includes, path-ending match, system names, Unsure and the folder tie-break (#806) #808

Done

Description

@danielrispler

Parent

#806

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_PREFIX and WIN), 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 it or several files match it, with every candidate. They relax only the links to the candidates' parts and are listed under unsure in --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 art tests/dart.rs for Unsure).
  • plotkeeper's own system-map check and system-map imports print the same standard output before and after.
  • docs/studio/behaviour/map.md's c-includes section is complete and names the research note, ADR 0004 and the trial set.
  • npm run check passes.

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, new system-map/src/extract/c/resolve.rs, new system-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

  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 (4093815), in PR #814; closes when it merges.

    Route outcome: medium·medium claude/sonnet → pass | 9m

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