Files
cadcraft/apps/cadcraft-cli/tests
code-compliantandClaude Fable 5.2 5f751ee30d AutoLISP: entnext reaches an INSERT's ATTRIBs and SEQEND (#1660) (#3396)
* AutoLISP: entnext reaches an INSERT's ATTRIBs and SEQEND (#1660)

- lisp: name an INSERT's ATTRIB and SEQEND records; entnext walks them, then the next main
  entity, and entget lists a record with its owner in group -2 (#1660)
- lisp: entmod of an ATTRIB takes its value (group 1) only, as one undo step; another property,
  a SEQEND, entdel and entmake of one return nil and change nothing (#1660)
- doc: the handles LISP named, shared with the drawing's snapshots and never given out by
  new_handle; 65,536 names, 1,024 probes past taken handles (#1660)
- io: entity_sub_record, one record of an INSERT at a time, never its other records (#1660)
- engine: an optional host hook for that record, so EntityCodec is unchanged (#1660)
- cli, web, app: install the hook; CLI tests for the walk, the value edit, the name bounds and
  the refusals (#1660)
- docs: autolisp.md on the records, their names, when a name ends, and the value-only edit (#1660)
- reused from #1753 (closed), with thanks: the entity_list extraction with the -2 owner, the
  writer's record splitting, and the entnext_walks_an_inserts_attribs test skeleton

* Keep AutoLISP's attribute names within their drawing

- Hold an INSERT's attribute names in the session's LISP state, not in
  cadcraft_doc::Drawing: comparing drawings is plain data again and takes no
  lock. The session reserves the handles in the drawing before any change, so
  new_handle still never gives one out, also after a drawing swap.
- End the names when the Block Editor closes: its drawing starts from the
  host's handles, so a name given there must never resolve to a host record.
- End only the erased reference's names on ERASE. Erasing another object
  leaves an attribute name holding, and OOPS still revives none.
- Go on to the next entity when an INSERT has no record provider installed.
- Refuse an ATTRIB edit whose outer list ends in an atom.

* Keep issued attribute names out of the drawing.

A copied drawing could reuse a name, and storing the names in the drawing marked a saved drawing changed.

* Name an INSERT's ATTRIBs and SEQEND apart from drawing handles

An ATTRIB or SEQEND has no handle of its own in the drawing, so the
name AutoLISP gives it is now a value of its own (an entity name for
`type`), numbered from one count for the whole process that never
gives a number twice. No handle of any drawing, of a copy of one, of
another session or of another thread can be such a name, so nothing
is reserved in the handle space any more: cadcraft-doc, `new_handle`
and the copy-then-install paths are as on main, and naming or reading
a record changes neither the drawing nor its saved state.

What a name stands for (reference, place, tag) stays in the engine's
LISP state, by document. Names end on Undo, Redo, ATTSYNC,
-BLOCKREPLACE, on opening and closing the Block Editor, and when a
change is taken back; erasing a reference ends only its names, and
OOPS or `entdel` bringing it back revives none. `entupd` of a record
answers its name; selection sets and `command` take no record.

Tests cover other sessions, documents and threads giving out handles
in a drawing copy, the copy paths (INSERT from a file, XATTACH, AUDIT,
REFCLOSE), and the AutoLISP behaviour of the names.

* Keep one ATTDEF index per state of a block's entities

EntityStore gets a content token: a clone has its store's, and every
edit gives the store one that no store has had. The DXF writer keys
its ATTDEF index on that token and keeps the indexes of several
blocks, up to a fixed number of tags in all. Two copies edited apart,
or a different edit after Undo, never read each other's definition
properties, in AutoLISP reads or in a saved file, and reads that
alternate between references of different blocks examine each
definition once.

* End record names when a command puts an earlier drawing back.

MOCORO Undo restored its history drawing, handle seed included, so the next Copy could reuse the removed reference's handle. That restore now advances the name epoch. An ATTDEF index that would pass the tag budget is not stored.

* Match an oversized ATTDEF definition in full and remember it is too large to index

* Count record names with try_update, not the deprecated fetch_update

Rust 1.100 deprecates fetch_update and names try_update in its place, so
clippy with -D warnings stopped the gate at RecordName::fresh. It is the
same operation: the checked increment and the None once the count runs
out are unchanged. try_update compiles on Rust 1.95, the workspace's
minimum.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* Record tests check the objects they rely on

Five tests could pass without the state they are about.

The two ATTDEF index tests changed only a layer, so both states of the
block gave T the same handle, and an index kept for the wrong state
still read the right layer. One state now keeps T on the first ATTDEF
and the other passes T to the second, on another layer. With one index
shared by every store, the old tests passed and these fail.

The MOCORO and grip Copy tests did not check that a copy was made, or
that the copy after the Undo took the removed copy's handle. They now
check both, and that the name read the first copy before the Undo.

The walk at the top of the handle range compared two values that are
both nil when the line at FFFFFFFFFFFFFFFF is not in the drawing. It
now reads that line first.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* Test that entdel preserves unrelated ATTRIB names

* Fix AutoLISP record lifetime and REFEDIT edits

* Run attribute name cases in engine integration suite

* Fix text fixtures after main merge

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-02 00:34:42 +01:00
..