Skip to content

Commit 1711b6f

Browse files
authored
docs: clarify architecture and code organization; document partial CLI-to-crate unification and export duplication in AGENTS.md (#23)
* docs: clarify architecture and code organization; document partial CLI-to-crate unification and export duplication in AGENTS.md * docs: correct test attribute statistics and per-file counts in AGENTS.md; remove unsupported passing claim * docs: fix coderabbitAI inaccuracy * docs: clarify test coverage in AGENTS.md, remove statistics - Remove explicit test counts from architecture section - Add statement about comprehensive test coverage across key modules - No changes to code or logic * docs: fix minor formatting in Documentation section of AGENTS.md
1 parent d82343a commit 1711b6f

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Copilot Instructions for RUST Project
22

33
## General
4-
- **Entry Point:** Maintain source as `src/main.rs`.
4+
- **Entry Point:** Maintain CLI source as `src/main.rs` and library core as `src/lib.rs`.
5+
- **Binary Structure:** CLI uses feature flag `cli` and entry point is built via default features or explicit `--features=cli`.
56
- **Comments:**
67
- Do not remove or modify comments unless the related code is changed.
78
- Only add comments that explain code functionality; no AI instructional comments.
@@ -10,14 +11,26 @@
1011
- **Build Quality:** Ensure `cargo build --release` has no errors or warnings.
1112
- **File Editing:** Always edit files inline; do not use `cat` to write to files.
1213

14+
## Architecture & Code Organization
15+
- **Library-first design:** Core logic in `src/lib.rs` and CLI entry point in `src/main.rs`.
16+
- **Shared code:** Parser modules (`src/parser/`) are used by both library and CLI (`parse_frames`, `parse_headers_from_text`).
17+
- **Duplicated code:** Export implementations exist separately in `src/export.rs` (library) and `src/main.rs` (CLI). CLI does NOT use library export functions.
18+
- **Current state:** **Partial unification** — parsing shared, export duplicated (~1800 lines in `src/main.rs`).
19+
- **Decision criteria:** "Is this needed by crate consumers?" determines placement — shared logic in library, CLI-only logic in `src/main.rs`.
20+
- **Feature flags:** `csv`, `cli`, `json`, `serde` control optional dependencies; default: `csv` + `cli`.
21+
- **CRATE_USAGE.md reference:** See `CRATE_USAGE.md` for library API examples with feature flags.
22+
- **Code quality goals:** Reduce duplication by migrating CLI export logic to use library `export_to_csv()`, `export_to_gpx()`, `export_to_event()` functions.
23+
- **Testing:** Comprehensive tests distributed across `src/main.rs`, `src/conversion.rs`, `src/parser/stream.rs`, and `src/parser/helpers.rs`.
24+
- **Public API:** `parse_bbl_file()`, `parse_bbl_bytes()`, `BBLLog`, `ExportOptions`, conversion utilities, parser helpers.
25+
1326
## Algorithms
1427
- **Method Selection:**
1528
- When choosing math or scientific methods, compare alternatives for accuracy and efficiency.
1629
- Fact-check method decisions.
1730

1831
## Documentation
1932
- **Readme:** Maintain a proper `README.md` file.
20-
- **Overview** Maintain a proper `OVERVIEW.md` file
33+
- **Overview:** Maintain a proper `OVERVIEW.md` file
2134
- **Summaries:**
2235
- Output final summaries to `./INFORMATION/*.md` (not in git).
2336
- Use date-prefixed, uppercase filenames (e.g., `2025-06-25_SUMMARY.md`).

0 commit comments

Comments
 (0)