Skip to content

Commit be768dd

Browse files
committed
Update contributor docs for parse API
1 parent b8f69f9 commit be768dd

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ Linux (CI runs on Ubuntu without issue).
5050

5151
## Architecture
5252

53-
Trailmark has a three-layer architecture:
53+
Trailmark has a parse layer followed by a three-layer analysis stack:
5454

55+
0. **Parse API** (`src/trailmark/parse.py`) -- public entry point for
56+
parsing files or directories into a raw `CodeGraph`. Lazily imports
57+
the appropriate language parser. Used directly for parse-only
58+
workflows and internally by `QueryEngine`.
5559
1. **CodeGraph** (`src/trailmark/models/graph.py`) -- mutable data
5660
container holding nodes, edges, annotations, and entrypoints.
5761
2. **GraphStore** (`src/trailmark/storage/graph_store.py`) -- wraps
@@ -75,6 +79,7 @@ Trailmark has a three-layer architecture:
7579

7680
1. Create `src/trailmark/parsers/<lang>/parser.py` implementing the
7781
`BaseParser` protocol from `src/trailmark/parsers/base.py`.
78-
2. Register the language in `src/trailmark/parsers/__init__.py`.
82+
2. Register the parser in `_PARSER_MAP` and its file extensions in
83+
`_LANGUAGE_EXTENSIONS`, both in `src/trailmark/parse.py`.
7984
3. Add tests in `tests/test_<lang>_parser.py`.
8085
4. Update the language table in `README.md`.

0 commit comments

Comments
 (0)