Commit aaea7a5
feat: detect duplicate CREATE in mxcli check (MDL-DUPDEF)
Phase 1 (mxcli check): CheckScriptDuplicates walks the AST in order,
tracking live names per document type. Flags a second plain CREATE of
the same qualified name as MDL-DUPDEF. CREATE OR MODIFY/REPLACE is
never flagged. DROP clears the name so CREATE/DROP/CREATE is clean.
RENAME removes the old name and registers the new one; module renames
cascade across all tracked names. RENAME DRY RUN leaves the registry
unchanged.
Phase 2 (mxcli check --references): CheckProjectConflicts loads the
project's existing documents once and errors on any plain CREATE that
targets a name already present in the project. Names created earlier
in the same script are excluded (Phase 1 owns those conflicts).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 3742709 commit aaea7a5
4 files changed
Lines changed: 1003 additions & 0 deletions
File tree
- cmd/mxcli
- mdl/executor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
162 | 169 | | |
163 | 170 | | |
164 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
194 | 202 | | |
195 | 203 | | |
196 | 204 | | |
| |||
0 commit comments