|
| 1 | +# Task Plan: Remove Debug Attribute from Deref Macro Output |
| 2 | + |
| 3 | +### Goal |
| 4 | +* Remove the `#[automatically_derived]` attribute from the debug output generated by the `Deref` derive macro in the `derive_tools_meta` crate, as it is considered a "debug attribute" that should not appear in production-related logs. The actual generated code will retain this attribute. |
| 5 | + |
| 6 | +### Ubiquitous Language (Vocabulary) |
| 7 | +* **Debug Attribute:** Refers to the `#[debug]` attribute that can be placed on input structs to trigger diagnostic output from the procedural macro. |
| 8 | +* **Automatically Derived Attribute:** Refers to the `#[automatically_derived]` attribute that Rust compilers add to code generated by derive macros. This is a standard attribute and should remain in the actual generated code. |
| 9 | + |
| 10 | +### Progress |
| 11 | +* **Roadmap Milestone:** N/A |
| 12 | +* **Primary Editable Crate:** `module/core/derive_tools_meta` |
| 13 | +* **Overall Progress:** 1/1 increments complete |
| 14 | +* **Increment Status:** |
| 15 | + * ✅ Increment 1: Remove `#[automatically_derived]` from debug output. |
| 16 | + * ⚫ Finalization Increment: Final review and verification. |
| 17 | + |
| 18 | +### Permissions & Boundaries |
| 19 | +* **Mode:** code |
| 20 | +* **Run workspace-wise commands:** false |
| 21 | +* **Add transient comments:** false |
| 22 | +* **Additional Editable Crates:** |
| 23 | + * None |
| 24 | + |
| 25 | +### Relevant Context |
| 26 | +* Control Files to Reference (if they exist): |
| 27 | + * N/A |
| 28 | +* Files to Include (for AI's reference, if `read_file` is planned): |
| 29 | + * `module/core/derive_tools_meta/src/derive/deref.rs` |
| 30 | +* Crates for Documentation (for AI's reference, if `read_file` on docs is planned): |
| 31 | + * N/A |
| 32 | +* External Crates Requiring `task.md` Proposals (if any identified during planning): |
| 33 | + * None |
| 34 | + |
| 35 | +### Expected Behavior Rules / Specifications |
| 36 | +* Rule 1: The `diag::report_print` output, which is triggered by the `#[debug]` attribute on the input struct, should no longer contain the `#[automatically_derived]` attribute. |
| 37 | +* Rule 2: The actual code generated by the `Deref` derive macro should continue to include the `#[automatically_derived]` attribute. |
| 38 | + |
| 39 | +### Crate Conformance Check Procedure |
| 40 | +* **Step 1: Run Tests.** Execute `timeout 90 cargo test -p derive_tools_meta --all-targets`. If this fails, fix all test errors before proceeding. |
| 41 | +* **Step 2: Run Linter (Conditional).** Only if Step 1 passes, execute `timeout 90 cargo clippy -p derive_tools_meta -- -D warnings`. |
| 42 | + |
| 43 | +### Increments |
| 44 | +(Note: The status of each increment is tracked in the `### Progress` section.) |
| 45 | +##### Increment 1: Remove `#[automatically_derived]` from debug output. |
| 46 | +* **Goal:** Modify the `deref.rs` file to prevent the `#[automatically_derived]` attribute from appearing in the debug output generated by `diag::report_print`. |
| 47 | +* **Specification Reference:** Rule 1 in `### Expected Behavior Rules / Specifications`. |
| 48 | +* **Steps:** |
| 49 | + * Step 1: Use `search_and_replace` to remove the exact string `#[ automatically_derived ]` from lines 143-144 within the `debug` format string in `module/core/derive_tools_meta/src/derive/deref.rs`. |
| 50 | + * Step 2: Perform Increment Verification. |
| 51 | + * Step 3: Perform Crate Conformance Check. |
| 52 | +* **Increment Verification:** |
| 53 | + * Step 1: Execute `timeout 90 cargo build -p derive_tools_meta` via `execute_command` to ensure the crate still compiles. |
| 54 | + * Step 2: Manually inspect the `module/core/derive_tools_meta/src/derive/deref.rs` file to confirm the `#[ automatically_derived ]` line has been removed from the `debug` string. (This step cannot be automated by the AI, but is a necessary check for the human reviewer). |
| 55 | +* **Data Models (Optional):** |
| 56 | + * N/A |
| 57 | +* **Reference Implementation (Optional):** |
| 58 | + * N/A |
| 59 | +* **Commit Message:** feat(derive_tools_meta): Remove automatically_derived from debug output |
| 60 | + |
| 61 | +##### Finalization Increment: Final review and verification. |
| 62 | +* **Goal:** Perform a final, holistic review and verification of the entire task's output, ensuring all requirements are met and no regressions were introduced. |
| 63 | +* **Specification Reference:** N/A |
| 64 | +* **Steps:** |
| 65 | + * Step 1: Perform Crate Conformance Check. |
| 66 | + * Step 2: Self-critique against all requirements and expected behaviors. |
| 67 | +* **Increment Verification:** |
| 68 | + * Step 1: Execute `timeout 90 cargo test -p derive_tools_meta --all-targets` via `execute_command`. |
| 69 | + * Step 2: Execute `timeout 90 cargo clippy -p derive_tools_meta -- -D warnings` via `execute_command`. |
| 70 | +* **Data Models (Optional):** |
| 71 | + * N/A |
| 72 | +* **Reference Implementation (Optional):** |
| 73 | + * N/A |
| 74 | +* **Commit Message:** chore(derive_tools_meta): Finalize debug attribute removal task |
| 75 | + |
| 76 | +### Task Requirements |
| 77 | +* Do not remove the `#[debug]` feature attribute (i.e., the ability to use `#[debug]` on input structs). |
| 78 | +* Do not run commands for the whole workspace. |
| 79 | + |
| 80 | +### Project Requirements |
| 81 | +* (This section is reused and appended to across tasks for the same project. Never remove existing project requirements.) |
| 82 | + |
| 83 | +### Assumptions |
| 84 | +* The user's request to "remove debug attribute in production code" specifically refers to the `#[automatically_derived]` string appearing in the `diag::report_print` output when the `#[debug]` attribute is used on an input struct. |
| 85 | +* The `#[automatically_derived]` attribute itself is a standard Rust attribute and should remain in the actual generated code. |
| 86 | + |
| 87 | +### Out of Scope |
| 88 | +* Removing the `#[automatically_derived]` attribute from the actual code generated by the macro. |
| 89 | +* Modifying any other derive macros or files. |
| 90 | + |
| 91 | +### External System Dependencies (Optional) |
| 92 | +* N/A |
| 93 | + |
| 94 | +### Notes & Insights |
| 95 | +* N/A |
| 96 | + |
| 97 | +### Changelog |
| 98 | +* [Increment 1 | 2025-07-05 19:47 UTC] Removed `#[automatically_derived]` from the debug output string in `deref.rs` to prevent it from appearing in production-related logs, as per task requirements. |
0 commit comments