Repository navigation
feat(tools): scripts and runbook for the AutoCAD trial (#119, #348, #375) - #383
Conversation
) A generator for the SAVEAS and DXF scripts of the 22 R13 re-save twins and of the controlled drawings, AutoLISP builders for the drawings of AUTOCAD-TODO sections 2 to 4, a checker that reads each DWG magic and DXF version and code page against a manifest, and a runbook with a manual checklist for what AutoLISP cannot create.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11c1e2950b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…me, keep --work (#383) check.py counted ASCII bytes as high bytes; a stale .FAILED.dwg kept the checker failing and was picked up as a drawing; --resume treated empty or wrong outputs as done; the recovery command dropped --work. The generator now saves its options in session.json for --resume, and gains --scripted-only and --keyword-prefix. The runbook has the Russian and Japanese code-page run.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31ad45470a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # CLEANROOM.md
An export older than the master or staged input it came from is STALE in the checker and is saved again by --resume (a source column in the manifest). The builders' error handler saves the failed drawing through *push-error-using-command* and *pop-error-mode*, with command-s when they are missing. The annotative text style carries its AcadAnnotative payload under the -3 sentinel.
# Conflicts: # CLEANROOM.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9fd4f0d80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…branch holds The landed PR's head and the stacked branch can have several merge bases, a commit of the landed PR and a main commit, and `git merge-base` returns one. When the branch merged main after taking the landed PR's commits, merging against that PR's commit drops the main history the branch already holds, and a change main later reverted comes back. refresh.sh now considers every merge base, and takes one only when each of the branch's ordinary merge bases with main is its ancestor; otherwise the branch merges as it always has. Reproduced in a scratch repository: with the landed PR's commit as base the merge kept the reverted f=1, the new rule rejects that base and git merge gives f=0; a plain stack still takes the PR's commit and merges cleanly where git merge conflicts. On the real branches #331, #332 and #341 still take a47e1bf (#330), and #383 takes none.
… written yet generate.py writes items/save-<item>.scr only for a master that exists when it runs, so with one to three masters built since the last run check.py recommended scripts that did not exist. It now lists `generate.py --resume` first, naming the scripts it will write, whenever one it recommends is missing. Reproduced with a scripted-only section 4 session and an s4-latin1 master added after generation: the checker named save-s4-latin1.scr, which did not exist; it now lists the --resume run first, and after that run the script exists and the step is gone.
… landed PR below it (#422) * fix(ci): merge a stacked PR against the newest commit it holds of the landed PR below it Every time a PR of a stack landed, the train refused every PR above it: their merge base was an old main commit, so the train's own commits on the landed PR (its merges of main, the renumbered section, the measured baselines) conflicted with the stacked copies of the same lines. After #329 landed, #330 to #341 all refused on examples/probe_dim_assoc.rs, and a lane hand-merged each with `git merge-tree --merge-base=<newest commit of the landed PR it holds>`. refresh.sh now finds that base itself (the head of each PR main squashed since the merge base, its merge base with the branch, the nearest one main does not hold), merges against it with git merge-recursive and the usual conflict handling, and writes it to merge-base.sha for the oracle comparison. A PR that is not stacked merges exactly as before. arch.py renumber also rewrites references in the PR's lines to a section main renumbered when the PR below landed, matched by title. * fix(ci): report a section move only when it rewrote a line arch.py renumber printed every section main had renumbered under a stacked PR's base, even when none of the PR's lines cited one; refresh.sh then ran `git commit -qam` with nothing to commit and refused a mergeable PR. It now prints only the moves that rewrote a line, nothing when none did, and refresh.sh commits the renumber only when the tree changed. Checked at a47e1bf against main: the old script printed "§7bh->§7bi §7bi->§7bj" with no change, the new one prints nothing; at #331's head it prints only 7bj->7bk, at #332's 7bj->7bk 7bk->7bl §7bi->§7bj. * fix(ci): use a stacked base only when it holds every main commit the branch holds The landed PR's head and the stacked branch can have several merge bases, a commit of the landed PR and a main commit, and `git merge-base` returns one. When the branch merged main after taking the landed PR's commits, merging against that PR's commit drops the main history the branch already holds, and a change main later reverted comes back. refresh.sh now considers every merge base, and takes one only when each of the branch's ordinary merge bases with main is its ancestor; otherwise the branch merges as it always has. Reproduced in a scratch repository: with the landed PR's commit as base the merge kept the reverted f=1, the new rule rejects that base and git merge gives f=0; a plain stack still takes the PR's commit and merges cleanly where git merge conflicts. On the real branches #331, #332 and #341 still take a47e1bf (#330), and #383 takes none.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 593533018e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Autodesk documents CMDACTIVE as a bitmask: 1 an ordinary command, 2 a transparent one, 4 a script. Under a build script bit 4 stays set, so dwgrs:finish kept sending Enter after TEXT ended, which can start TEXT again and hand the builder's next arguments to the wrong prompt, and dwgrs:cancel-all kept cancelling. Both now test the low two bits through dwgrs:command-p. Not run: this changes what the builders send inside AutoCAD, which the trial session will be the first to exercise.
# Conflicts: # CLEANROOM.md
…till skipped (#424) CHANGELOG gains the table objects (#313, #316, #317, #319), the nineteen classes derived from AutoCAD's output (#326 to #341), the DIMENSION scorer (#387), the BLOCK fixtures (#407), the maintainer tools (#406, #383) and the merge train's stack handling (#421 to #423). README said every skipped type had a decoder in review; only SHAPE (#310) and the VIEWPORT entity header (#311) do, and the rest are twelve custom classes in the BookViewerApp3 drawings with no DXF export yet, now named. STATUS's pending section says its counts are the 2026-08-30 snapshot.
Summary
Adds
tools/autocad/: a generator for the AutoCAD.scrscripts, AutoLISP builders for the controlled drawings, a checker and a runbook, so a session with AutoCAD for Mac open only executes the trial work list (sections 1 to 4).Spec reference
None: tooling only, no decoder or encoder change. Refs #119, #323, #345 (section 1, R13 re-save twins), #348, #329, #331, #332, #335, #337, #358, #285, #290 (controlled drawings) and #375 (code-page text, following #370 and #374).
What is in it:
generate.pyreadstools/corpus/pins.tsvand a corpus folder, stages theAC1012drawings under ASCII names (sha256 checked), and writes00-start.scr,s1-all.scr(OPEN, SAVEAS R2000,SAVEAS DXF V 2000 16, CLOSE per drawing),build-*.scr(NEW, load a builder, build, save a master),save-*.scr(reopen each master, every release plus its ASCII DXF, R14 asLT98with an R12 DXF twin), per-piece scripts for retries, a two-page PDF, a PNG andmanifest.tsv. FILEDIA and CMDDIA are set to 0 and restored before the final CLOSE; paths with spaces are quoted.lisp/*.lsp: core AutoLISP only (novla-,vlax-orvl-). 28 builders: code-page text (Pre-R2007 code pages beyond 1251/1252, proven on real drawings (#370 follow-up) #375), annotative TEXT (feat(objects): decode ACDB_TEXTOBJECTCONTEXTDATA_CLASS from AutoCAD's own DWG and DXF output (#152) #337), DIMASSOC (feat(objects): decode DIMASSOC from AutoCAD's own DWG and DXF output (#152) #329), ACSH solids and extrusions, seven PERSSUBENTMANAGER drawings, WIPEOUTVARIABLES, DBCOLOR, PDF underlays and clips, MATERIAL and SUN (attempts), saved UCS (UCS reads its base-UCS handle inline and skips OrthographicType on R2000-R2004 (§20.4.62) #285), xref host and source (R2007+ table entries: are the two bits after the prefix B 64-flag and B Xdep, or a lone BS xrefindex+1? #290), PLINEGEN and a polygon mesh (feat(dxf): write the ENTITIES section of 15 kinds, paired with AutoCAD's export (#126) #358).check.pyreads each DWG's six-byte magic and each DXF's$ACADVERand$DWGCODEPAGEas bytes, compares them with the manifest, counts the record types each item should produce, and lists what is missing as next steps.README.mdis the session runbook (order, outputs, which may be pinned by licence);MANUAL-CHECKLIST.mdholds the click-by-click steps for what AutoLISP cannot create (dynamic blocks, MATERIAL maps, DATATABLE, SUN fallback, typed code-page text) and the OS-language repeat that needs the maintainer's agreement.Not run against AutoCAD: nothing here executes it. Every command sequence not confirmed without AutoCAD carries a
VERIFY:comment (grep -rn VERIFY tools/autocad). Until #323 lands onmain,generate.py --pinsmust point at that branch'spins.tsv: main has noAC1012rows.Test plan
cargo fmt,clippy,cargo test,cargo doc: not applicable, no Rust or doc-comment change and no build was run.feat/r13-reader'spins.tsvand a corpus folder holding the 22 pinned R13 files (SketchUp Cabin and 21 Sovol, Chinese names with spaces): 22 staged, sha256 verified, 380 manifest rows, scripts inspected by eye; also with a work folder whose path has a space, with--sections 4 --char-mode escape, with--resume, with main's pins (prints that section 1 has no rows) and with a missing pins file..FAILED.dwg), then the folder was deleted: each case reported with the right status and next step..lspparses with balanced parentheses, novl-,vla-orvlax-name, everycommandcall carries_.; plus a dry run of all 31 entry commands in a small AutoLISP evaluator with stubbedcommand,entmakeandgetvar, which checks function arity, undefined names, group-code value types and the emitted command sequences.Source-provenance declaration
By submitting this PR I certify that my contribution does not incorporate executable code from any source whose license is incompatible with Apache-2.0. Specifically:
CLEANROOM.md).dwg-rsis Apache-2.0 and must remain compatible.My contribution is based on:
CLEANROOM.md.See
CLEANROOM.mdfor the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.Disclosure of one reading, for
CLEANROOM.md: to confirm the SAVEAS and DXF prompt sequences, I readsamples/sample_base/save_samples.lspofDomCR/ACadSharpat the pinned commitc30a97ce(MIT) once more. It is the AutoCAD command script that saved the pinnedsample_basetwins and is already recorded in the 2026-10-26 "Public corpus" entry (it contains no DWG or DXF implementation). It confirmed the SAVEAS keywords2018to2000andLT98, and the formSAVEAS DXF V <version> 16 <file>includingR12; the scripts and builders here are written independently and copy nothing from it. Nothing under ACadSharp'ssrc/or its test data was opened. The AutoLISP and command vocabulary otherwise comes from Autodesk's public product documentation, recalled.Developer Certificate of Origin
By submitting this PR, I certify that the contribution complies with the
Developer Certificate of Origin 1.1.
Specifically, I affirm that the contribution is my own work (or rightfully
licensed to me) and that it can be distributed under the project's Apache-2.0
license.
I will sign off commits with
git commit -swhen asked, which adds aSigned-off-bytrailer to the commit message asserting the DCO.