|
1 | | -# Project Plan: Unilang Codestyle and Documentation Review |
| 1 | +# Project Plan: Unilang Test File Documentation |
2 | 2 |
|
3 | 3 | ### Goal |
4 | | -* Iterate through each file of the `unilang` crate, ensuring all code adheres to the established codestyle rules and has concise, accurate documentation. |
| 4 | +* Add comprehensive documentation to all test files, including references to the Test Matrix, to ensure clarity and maintainability. |
5 | 5 |
|
6 | 6 | ### Progress |
7 | | -* ✅ Codestyle Review Complete |
| 7 | +* ✅ Test Documentation Complete |
8 | 8 |
|
9 | 9 | ### Target Crate |
10 | 10 | * module/move/unilang |
11 | 11 |
|
12 | 12 | ### Relevant Context |
13 | 13 | * Files to Include (for AI's reference, if `read_file` is planned, primarily from Target Crate): |
14 | | - * All `.rs` files within `module/move/unilang/src` and `module/move/unilang/tests`. |
| 14 | + * `module/move/unilang/tests/inc/phase1/full_pipeline_test.rs` |
15 | 15 |
|
16 | 16 | ### Expected Behavior Rules / Specifications (for Target Crate) |
17 | | -* All files must pass `cargo clippy` with the workspace lint settings without warnings. |
18 | | -* All public items should have clear, concise documentation. |
19 | | -* Code formatting should be consistent across the entire crate. |
| 17 | +* Test functions should have doc comments explaining their purpose. |
| 18 | +* Each test function should reference the Test Matrix row(s) it covers. |
20 | 19 |
|
21 | 20 | ### Target File Structure (If Applicable, within Target Crate) |
22 | 21 | * No changes to the file structure are planned. |
23 | 22 |
|
24 | 23 | ### Increments |
25 | 24 |
|
26 | | -* ✅ Increment 1: Review `src/lib.rs` |
27 | | - * Detailed Plan Step 1: Read the content of `src/lib.rs`. |
28 | | - * Detailed Plan Step 2: Apply codestyle fixes, including adding documentation for all public modules. |
29 | | - * Detailed Plan Step 3: Use `mod_interface` to structure the crate's public API. |
30 | | - * Pre-Analysis: The `lib.rs` file is the entry point to the crate and should be well-documented and structured. |
31 | | - * Crucial Design Rules: [Structuring: Modules with `mod_interface`](#structuring-modules-with-mod_interface), [Comments and Documentation](#comments-and-documentation) |
32 | | - * Relevant Behavior Rules: N/A |
33 | | - * Verification Strategy: Run `cargo build -p unilang` to ensure the changes compile. |
34 | | - * Commit Message: "style(unilang): Clean up and document src/lib.rs" |
35 | | -* ✅ Increment 2: Review `src/data.rs` |
36 | | - * Detailed Plan Step 1: Read the content of `src/data.rs`. |
37 | | - * Detailed Plan Step 2: Apply codestyle fixes (spacing, newlines, etc.). |
38 | | - * Detailed Plan Step 3: Add concise documentation to all public structs and their fields. |
39 | | - * Detailed Plan Step 4: Re-enable the `former` crate derive macros and attributes and fix any resulting compilation errors. |
40 | | - * Pre-Analysis: The file contains core data structures. The `former` derive is currently commented out and needs to be re-enabled and fixed. |
41 | | - * Crucial Design Rules: [Comments and Documentation](#comments-and-documentation) |
42 | | - * Relevant Behavior Rules: N/A |
43 | | - * Verification Strategy: Run `cargo build -p unilang` to ensure the changes compile without errors or warnings. |
44 | | - * Commit Message: "style(unilang): Clean up and document src/data.rs" |
45 | | -* ✅ Increment 3: Review `src/error.rs` |
46 | | - * Detailed Plan Step 1: Read the content of `src/error.rs`. |
47 | | - * Detailed Plan Step 2: Apply codestyle fixes (spacing, newlines, etc.). |
48 | | - * Detailed Plan Step 3: Add concise documentation to the `Error` enum and its variants. |
49 | | - * Pre-Analysis: The file contains the basic error enum. It needs proper documentation and formatting. |
50 | | - * Crucial Design Rules: [Error Handling: Use a Centralized Approach](#error-handling-use-a-centralized-approach), [Comments and Documentation](#comments-and-documentation) |
51 | | - * Relevant Behavior Rules: N/A |
52 | | - * Verification Strategy: Run `cargo build -p unilang` to ensure the changes compile. |
53 | | - * Commit Message: "style(unilang): Clean up and document src/error.rs" |
54 | | -* ✅ Increment 4: Review `src/help.rs` |
55 | | - * Detailed Plan Step 1: Read the content of `src/help.rs`. |
56 | | - * Detailed Plan Step 2: Apply codestyle fixes (spacing, newlines, etc.). |
57 | | - * Detailed Plan Step 3: Add concise documentation to the `HelpGenerator` struct and its methods. |
58 | | - * Pre-Analysis: The file contains the basic help generator. It needs proper documentation and formatting. |
59 | | - * Crucial Design Rules: [Comments and Documentation](#comments-and-documentation) |
60 | | - * Relevant Behavior Rules: N/A |
61 | | - * Verification Strategy: Run `cargo build -p unilang` to ensure the changes compile. |
62 | | - * Commit Message: "style(unilang): Clean up and document src/help.rs" |
63 | | -* ✅ Increment 5: Review `src/interpreter.rs` |
64 | | - * Detailed Plan Step 1: Read the content of `src/interpreter.rs`. |
65 | | - * Detailed Plan Step 2: Apply codestyle fixes (spacing, newlines, etc.). |
66 | | - * Detailed Plan Step 3: Add concise documentation to the `Interpreter` and `ExecutionContext` structs and their methods. |
67 | | - * Pre-Analysis: The file contains the basic interpreter. It needs proper documentation and formatting. |
68 | | - * Crucial Design Rules: [Comments and Documentation](#comments-and-documentation) |
69 | | - * Relevant Behavior Rules: N/A |
70 | | - * Verification Strategy: Run `cargo build -p unilang` to ensure the changes compile. |
71 | | - * Commit Message: "style(unilang): Clean up and document src/interpreter.rs" |
72 | | -* ✅ Increment 6: Review `src/parsing.rs` |
73 | | - * Detailed Plan Step 1: Read the content of `src/parsing.rs`. |
74 | | - * Detailed Plan Step 2: Apply codestyle fixes (spacing, newlines, etc.). |
75 | | - * Detailed Plan Step 3: Add concise documentation to all public items (`Token`, `Lexer`, `Parser`, `Statement`, `Program`) and their methods/variants/fields. |
76 | | - * Pre-Analysis: The file contains the lexer and parser. It's a large file and will require careful review to ensure all items are documented and formatted correctly. |
77 | | - * Crucial Design Rules: [Comments and Documentation](#comments-and-documentation), [New Lines for Blocks](#new-lines-for-blocks), [Spaces Around Symbols](#spaces-around-symbols). |
78 | | - * Relevant Behavior Rules: N/A |
79 | | - * Verification Strategy: Run `cargo build -p unilang` to ensure the changes compile. |
80 | | - * Commit Message: "style(unilang): Clean up and document src/parsing.rs" |
81 | | -* ✅ Increment 7: Review `src/registry.rs` |
82 | | - * Detailed Plan Step 1: Read the content of `src/registry.rs`. |
83 | | - * Detailed Plan Step 2: Apply codestyle fixes (spacing, newlines, etc.). |
84 | | - * Detailed Plan Step 3: Add concise documentation to the `CommandRegistry` struct, `CommandRegistryBuilder` struct, and their methods. |
85 | | - * Pre-Analysis: The file contains the command registry. It needs proper documentation and formatting. |
86 | | - * Crucial Design Rules: [Comments and Documentation](#comments-and-documentation) |
87 | | - * Relevant Behavior Rules: N/A |
88 | | - * Verification Strategy: Run `cargo build -p unilang` to ensure the changes compile. |
89 | | - * Commit Message: "style(unilang): Clean up and document src/registry.rs" |
90 | | -* ✅ Increment 8: Review `src/semantic.rs` |
91 | | - * Detailed Plan Step 1: Read the content of `src/semantic.rs`. |
92 | | - * Detailed Plan Step 2: Apply codestyle fixes (spacing, newlines, etc.). |
93 | | - * Detailed Plan Step 3: Add concise documentation to the `VerifiedCommand` and `SemanticAnalyzer` structs and their methods. |
94 | | - * Pre-Analysis: The file contains the semantic analyzer. It needs proper documentation and formatting. |
95 | | - * Crucial Design Rules: [Comments and Documentation](#comments-and-documentation) |
96 | | - * Relevant Behavior Rules: N/A |
97 | | - * Verification Strategy: Run `cargo build -p unilang` to ensure the changes compile. |
98 | | - * Commit Message: "style(unilang): Clean up and document src/semantic.rs" |
99 | | -* ✅ Increment 9: Review `src/ca/` directory |
100 | | - * Detailed Plan Step 1: Read all files in `src/ca/` and its subdirectories. |
101 | | - * Detailed Plan Step 2: Refactor `src/ca/mod.rs`. |
102 | | - * Detailed Plan Step 3: Refactor `src/ca/parsing/mod.rs`. |
103 | | - * Detailed Plan Step 4: Refactor `src/ca/parsing/engine.rs`. |
104 | | - * Detailed Plan Step 5: Refactor `src/ca/parsing/error.rs`. |
105 | | - * Detailed Plan Step 6: Refactor `src/ca/parsing/input.rs`. |
106 | | - * Detailed Plan Step 7: Refactor `src/ca/parsing/instruction.rs`. |
107 | | - * Pre-Analysis: This directory seems to contain a secondary parsing engine or a more complex command architecture (`ca`). It needs to be reviewed for consistency with the rest of the crate. |
108 | | - * Crucial Design Rules: [Comments and Documentation](#comments-and-documentation), [New Lines for Blocks](#new-lines-for-blocks), [Spaces Around Symbols](#spaces-around-symbols). |
109 | | - * Relevant Behavior Rules: N/A |
110 | | - * Verification Strategy: Run `cargo build -p unilang` after refactoring all files in the directory. |
111 | | - * Commit Message: "style(unilang): Clean up and document src/ca/**" |
112 | | -* ✅ Increment 10: Review `tests/` directory |
113 | | - * Detailed Plan Step 1: Read all files in `tests/` and its subdirectories. |
114 | | - * Detailed Plan Step 2: Refactor `tests/tests.rs`. |
115 | | - * Detailed Plan Step 3: Refactor `tests/inc/mod.rs`. |
116 | | - * Detailed Plan Step 4: Refactor `tests/inc/phase1/mod.rs`. |
117 | | - * Detailed Plan Step 5: Refactor `tests/inc/phase1/foundational_setup.rs`. |
118 | | - * Detailed Plan Step 6: Refactor `tests/inc/phase1/full_pipeline_test.rs`. |
119 | | - * Pre-Analysis: The test files need to be reviewed for clarity, documentation, and adherence to codestyle. |
120 | | - * Crucial Design Rules: [Comments and Documentation](#comments-and-documentation) |
| 25 | +* ✅ Increment 1: Document `tests/inc/phase1/full_pipeline_test.rs` |
| 26 | + * Detailed Plan Step 1: Read the content of `tests/inc/phase1/full_pipeline_test.rs`. |
| 27 | + * Detailed Plan Step 2: Add documentation to each test function, linking it to the corresponding Test Matrix rows from the previous plan. |
| 28 | + * Pre-Analysis: The integration test file lacks documentation. |
| 29 | + * Crucial Design Rules: [Testing: Plan with a Test Matrix When Writing Tests](#testing-plan-with-a-test-matrix-when-writing-tests), [Comments and Documentation](#comments-and-documentation) |
121 | 30 | * Relevant Behavior Rules: N/A |
122 | 31 | * Verification Strategy: Run `cargo test -p unilang` to ensure all tests still pass. |
123 | | - * Commit Message: "style(unilang): Clean up and document tests/**" |
124 | | -* ✅ Increment 11: Final Verification |
125 | | - * Detailed Plan Step 1: Run `cargo clippy -- -D warnings` to ensure there are no warnings. |
126 | | - * Detailed Plan Step 2: Run `cargo test` to ensure all tests pass. |
127 | | - * Pre-Analysis: All files have been reviewed. A final check is needed to ensure the entire crate is clean. |
128 | | - * Crucial Design Rules: N/A |
129 | | - * Relevant Behavior Rules: N/A |
130 | | - * Verification Strategy: All checks must pass. |
131 | | - * Commit Message: "chore(unilang): Final verification of codestyle changes" |
| 32 | + * Commit Message: "docs(unilang): Add test matrix documentation to integration tests" |
132 | 33 |
|
133 | 34 | ### Task Requirements |
134 | | -* Systematically review every `.rs` file. |
135 | | -* Apply codestyle fixes and add documentation as needed. |
| 35 | +* Add documentation to test files. |
136 | 36 |
|
137 | 37 | ### Project Requirements |
138 | 38 | * Maintain consistency with the overall workspace codestyle. |
139 | 39 |
|
140 | 40 | ### Notes & Insights |
141 | | -* This is a good opportunity to improve the overall quality and maintainability of the crate. |
142 | | -* The `former` crate usage is still disabled and should be noted for future work. |
| 41 | +* This will significantly improve the test suite's readability. |
0 commit comments