You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Architectural overview for AI assistants working with this codebase.
4
4
5
-
> **Maintenance rule:**Whenever this file is changed, update both `CLAUDE.md` and `ARCHITECTURE.md` in the same directory to reflect relevant changes. `CLAUDE.md` is a bullet-point summary and `ARCHITECTURE.md` is the top-level architecture index; both must stay in sync with this guidance.
5
+
> **Maintenance rule:**`AGENTS.md` is the canonical AI-agent guidance. When this file changes, update `ARCHITECTURE.md` in the same directory if the architecture index or durable engineering guidance needs to reflect the change. `CLAUDE.md` is only a compatibility shim that points here.
6
6
7
7
## Critical: single_include/csv.hpp Is A Shim
8
8
@@ -52,6 +52,7 @@ For detailed file mapping, parser data flow, and component relationships, see `A
52
52
8. **Opportunistic rewrites/refactors are allowed when they are safe and justified.** Keep them separated from build-fix urgency where possible, and avoid bundling unrelated churn with compiler triage unless explicitly requested.
53
53
9. **When proposing changes that affect compile-time behavior, explain the tradeoff clearly.** Call out any impact to codegen, performance, portability, and readability before applying the change.
54
54
10. **If a build fix appears to require more than ~3 files or ~60 changed lines, pause and confirm scope first.** Provide a short justification before expanding further.
55
+
11. **`CSVReader::iterator` is intentionally single-pass.** Do not cache all `RawCSVDataPtr` chunks to make it behave like a forward iterator; that defeats bounded-memory streaming for large CSV files. Algorithms that need multi-pass access should first materialize rows into a container such as `std::vector<CSVRow>`.
55
56
56
57
See `tests/AGENTS.md` for test strategy, checklist, and conventions.
57
58
@@ -71,6 +72,9 @@ See `tests/AGENTS.md` for test strategy, checklist, and conventions.
71
72
- **Consolidation:** If a `.cpp` would be under ~100 lines *and* the split causes excessive comment duplication between the two files, prefer a single `.hpp` with definitions marked `inline` (free functions and methods alike). Do not use `CSV_INLINE` for consolidated definitions — `CSV_INLINE` expands to empty in multi-header mode, which would produce ODR violations across TUs. Do not consolidate just for brevity — only when duplication is the dominant cost.
72
73
7. **Prefer LF (`\n`) line endings for tracked source, test, CMake, and Markdown files.** When you touch a file with mixed line endings, normalize the edited file to LF unless there is a file-specific reason not to. Avoid introducing mixed CRLF/LF endings in the same file.
73
74
8. **Keep preprocessor directives flush left.** `#define`, `#if`, `#ifdef`, `#else`, and `#endif` should start at column 0. Code inside multi-line macros should be indented exactly as the equivalent non-macro code would be; do not add extra indentation just because it lives inside a macro body.
75
+
9. **Keep constructor initializer lists in declaration order.** C++ initializes bases and members in declaration order, not initializer-list order. When adding or editing a constructor, order its initializer list to match the class declaration exactly so GCC/Clang `-Wreorder` stays clean and readers do not infer a false initialization dependency.
76
+
10. **Internal folder namespaces should match folder structure.** When adding or moving files under `include/internal/`, place their contents in the matching nested namespace when practical. For example, `include/internal/speculative/` maps to `csv::internals::speculative`, and `include/internal/parser/` maps to `csv::internals::parser`. Do not churn existing files solely for this rule unless the namespace move is part of an intentional architecture cleanup.
77
+
11. **Do not accidentally pass large objects by value.** Use `const&` for observation, `&` for mutation, and `&&` / by-value-with-an-explicit-`std::move` for ownership transfer. If passing a large object by value is intentional, make the consuming semantics obvious at the call site or add a brief comment.
74
78
75
79
### Rules for Comments
76
80
1. **Always update or remove incorrect comments.**
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ Primary architecture document:
7
7
8
8
Subsystem deep-dive:
9
9
- include/internal/THREADSAFE_DEQUE_DESIGN.md
10
+
- BOMStrippingRefactor.md
10
11
11
12
Operational/testing guidance:
12
13
- AGENTS.md
@@ -23,7 +24,9 @@ Notes:
23
24
- Private member naming should prefer trailing underscores; when editing mixed-style code, normalize the touched region toward that convention.
24
25
- Prefer LF (`\n`) line endings for tracked source, test, CMake, and Markdown files; when touching a file with mixed endings, normalize it to LF unless there is a file-specific reason not to.
25
26
- Keep preprocessor directives flush left; `#define`, `#if`, `#ifdef`, `#else`, and `#endif` should start at column 0, and code inside multi-line macros should be indented as if the macro wrapper were not present.
26
-
- Compatibility macros defined in `common.hpp` must only be referenced after including `common.hpp`. See AGENTS.md and CLAUDE.md for details.
27
+
- Keep constructor initializer lists in the same order as base/member declarations so GCC/Clang `-Wreorder` remains clean and initialization dependencies stay obvious.
28
+
- Internal folder namespaces should match folder structure when practical; for example `include/internal/parser/` maps to `csv::internals::parser`.
29
+
- Compatibility macros defined in `common.hpp` must only be referenced after including `common.hpp`. See AGENTS.md for details.
27
30
- API constraints should be user-friendly: do not over-constrain templates unless needed for correctness, safety, or a measured performance win.
28
31
-`CSVReader` is intentionally non-copyable and move-enabled; use explicit ownership transfer patterns (`std::move`, `std::unique_ptr`) at API boundaries.
- If a build fix appears to require more than ~3 files or ~60 changed lines, pause and confirm scope first.
34
37
- Apply the 5/2 anti-duplication rule: if equivalent behavior exists in 2+ code paths and each copy is ~5+ meaningful lines, extract a shared helper; if duplication remains, document why and keep regression coverage for each path.
0 commit comments