Part III. Code base
An OpenEik model is a folder of files: one record per file, at a path derived from the record, in a fixed text form. A folder and a stored version are the same format (Part VI), and the folder works with git, editors and an agent's file tools as a code base does.
1. The folder
eik.json format and units
AGENTS.md conventions for agents (text)
project/project.json the project
project/levels.json the levels, in order
project/order.json the order of the record lists
project/materials/<id>.json and grids, scope-boxes, dimension-styles,
detail-families, title-blocks, images,
originals, copies
project/circuits/<id>.json circuits (Part XIII), and project/people/<id>.json
the people of the registry (Part XIV)
types/<discipline>/<category>/<id>.json types
<discipline>/<level>/<category>/<id>.json elements: architecture, structure, ventilation,
plumbing, electrical, sprinkler, site
drawings/<discipline>/views/<kind>/<id>/view.json
a view
drawings/<discipline>/views/<kind>/<id>/details/<n>.json
its detail items, in chunks
drawings/<discipline>/sheets/<id>.json sheets (Part XIV)
documents/<list>/<id>.json reports, renders, deviations,
area-adjustments, references (application records)
fabrication/pieces/<id>.json pieces and joints (fabrication profile)
fabrication/joints/<id>.json
<prefix>/… an application's own files (section 7.7; Part I, 11.3)
anything else kept files (section 7)
.eik/, .git/, … hidden: not part of the model
examples/one-storey-house is a complete folder of 34 files.
This is the owners' layout of 0.2: section 4.4 puts each element, type, view and sheet in the folder of the discipline that owns it, one of eight. A folder of 0.1 files them by category in four folders, architecture, structure, systems and site, its views under drawings/views/ and its sheets, application records of 0.1, under drawings/sheets/ (section 4.1). A reader of 0.2 reads either layout (section 4.4, rule 7).
- A file or folder whose name starts with
.is hidden. It is not part of the model; readers MUST skip it and writers MUST NOT remove it. Two hidden paths have a defined use:.eik/derived/, the optional derived layer of Part IV, section 1.1, and.eik/remotes.json, a folder's remote-tracking refs (Part VI, 6.1). - A name that starts with
~is reserved (Part VI uses it for shard folders). Writers MUST NOT create one in a folder.
Reference: readFolder in server/eikSession.ts (skips names starting with a dot); keptPath in src/core/model/extras.ts.
2. Path segments
Some names in a record's path are made from ids: an element's level folder from its levelId, a view's folder from the view's id, and every other record's file from its id, followed by .json (sections 3 and 4.2). Each is the id as a path segment: the id with some of its characters written as their escape, % followed by the two hexadecimal digits of the character's code point, so that every id gives one name that common file systems take and read as it is written. Rules 1 to 6 make an id's segment, in this order, each rule applied to what the rules before it give:
- Every
%is escaped as%25, first: the%of an escape is never escaped again. - Every character that a common file system refuses in a name is escaped:
/as%2F,\as%5C,:as%3A,*as%2A,?as%3F,"as%22,<as%3C,>as%3E,|as%7C, and each control character, U+0000 to U+001F, as%00to%1F. - A leading
.is escaped as%2E, and a leading~as%7E. Readers skip a hidden name and writers make no reserved one (section 1), so a record with the id.xwould otherwise be lost. - A trailing
.is escaped as%2E, and a trailing space as%20: some file systems drop them. - The first character of a segment that is a device name of a common operating system is escaped. What is compared is the segment's part before its first
.(the whole segment where it has none), without the spaces that end that part; it is a device name when it isCON,PRN,AUX,NUL,COM0toCOM9,LPT0toLPT9, orCOMorLPTfollowed by¹,²or³, compared without regard to ASCII case. A record's file, its segment followed by.json, has the same part before its first., so one comparison serves the segment and the file, and a device name is escaped with or without an extension: the idscon,Aux.1andlpt¹make the files%63on.json,%41ux.1.jsonand%6Cpt¹.json. - The hexadecimal digits of an escape are upper case.
- A reader reads a segment back by decoding, in one pass from left to right, every
%followed by two hexadecimal digits, of either case, as the character of that code point (U+0000 to U+00FF). Any other%stands for itself. - A writer MUST write each name made from an id as the id's segment. A reader MUST read each such name by rule 7.
- A name that reads by rule 7 as its record's id, or as an element's
levelId, but is not its segment, as a name written before these rules with a:in it, is at the record's path in an older form, and does not disagree with the record (section 4.2). A reader SHOULD warn about such a name, naming the path these rules give. A writer writes the record at that path, and removes the file it was read from (section 13, rule 4). A name that starts with.or~is hidden or reserved (section 1), and is never read as a record, whatever it decodes to.
A valid id holds no / (Part I, 6.4). Rule 2 escapes it all the same, so that every string has exactly one segment, and so that a reader can read a folder that breaks the rule and name the record it refuses. A category and a view's kind are names of the format, and are not escaped: a category is a plain name (Part II, 6.2, rule 1), and a view's kind one of the five its schema lists. Nor is a kept file's path escaped, which is its own: it holds no name that rules 2 to 5 would escape (section 7, rule 8). Part I, 6, rule 8 bounds a segment's length, and section 4.3 says when two names fold to one, which Part I, 6, rule 7 keeps two records' paths from doing.
Reference: segment and unsegment in src/core/versions/layout.ts, rules 1 to 7, and manifestOfFolder in src/core/versions/eikFolder.ts, rule 9, since Stomra 506 (live since 15 October 2026, main a34cc1a1); before it they escaped and decoded only %, / and a leading ~.
3. File kinds and their schemas
| Path | Holds | Schema |
|---|---|---|
eik.json | {format, units} | eik.schema.json |
AGENTS.md | text | none |
project/project.json | {project, projectInformation?, schemaVersion?} (schemaVersion deprecated in 0.2, Part I, 9.3) | project/project.schema.json |
project/levels.json | the list of levels | project/levels.schema.json |
project/order.json | list name → ids | project/order.schema.json |
project/grids/<id>.json | a grid | project/grid.schema.json |
project/scope-boxes/<id>.json | a scope box | project/scope-box.schema.json |
project/materials/<id>.json | a material | project/material.schema.json |
project/dimension-styles/<id>.json | a dimension style | project/dimension-style.schema.json |
project/detail-families/<id>.json | a detail family | project/detail-family.schema.json |
project/title-blocks/<id>.json, project/images/<id>.json | application records | application-record.schema.json |
project/originals/<id>.json, project/copies/<id>.json | an original, a copy | project/original.schema.json, project/copy.schema.json |
project/circuits/<id>.json | a circuit (Part XIII, 3) | project/circuit.schema.json |
project/people/<id>.json | a person or an agent of the registry (Part XIV, 5) | project/person.schema.json |
types/<discipline>/<category>/<id>.json | a type | types/<category>.schema.json |
<discipline>/<level>/<category>/<id>.json | an element | elements/<category>.schema.json |
drawings/<discipline>/views/<kind>/<id>/view.json | a view without its detail items | drawings/view-record.schema.json |
drawings/<discipline>/views/<kind>/<id>/details/<n>.json | a chunk of detail items | drawings/view-details.schema.json |
drawings/<discipline>/sheets/<id>.json | a sheet (Part XIV, 2) | drawings/sheet.schema.json |
documents/reports/<id>.json, documents/renders/<id>.json, documents/deviations/<id>.json, documents/area-adjustments/<id>.json, documents/references/<id>.json | application records | application-record.schema.json |
fabrication/pieces/<id>.json, fabrication/joints/<id>.json | a piece, a joint | fabrication/piece.schema.json, fabrication/joint.schema.json |
These are the paths of the owners' layout of 0.2 (section 4.4): <discipline> is the record's owner, one of eight, and a view and a sheet are under their owner's folder. In 0.1's layout (section 4.1), <discipline> is one of four, a view is at drawings/views/<kind>/<id>/view.json, its chunks beside it, and a sheet, an application record of 0.1, at drawings/sheets/<id>.json, of the same depths below drawings/. The schemas are those of 0.2, in schemas/0.2/; 0.1's are in schemas/.
Part XIII adds the electrical records of 0.2, which are not 0.1's: the elements and types of the categories electrical, cableCarrier and cable, and the circuits at project/circuits/<id>.json. Part XIV adds the drawing files of 0.2, which are not 0.1's either: sheets as standard records, people and agents at project/people/<id>.json, the drawing profile, issued drawings, registers, issues and reviews under drawings/, and assets by digest at assets/<sha256>.<ext>. Part XV says how a version and a store keep those assets: a pointer in the version's tree, and the bytes beside it. Part XVI adds project/owners.json (project/owners.schema.json), and Part XVIII a model's reviews and terms accepted. Part XIX, from 0.5, adds project/ground.json, the ground, which a reader of a model of 0.4 keeps as a kept file unless it is asked for the proposal ground.
- A path is a record's path only when it has exactly the depth shown: an element is three segments under a discipline folder (its level, its category and its file), a type three under
types(its discipline, its category and its file), a list record one segment under its list folder. Any other file is a kept file (section 7), even if it ends in.json. - Every record file MUST validate against its schema, that of its model's version.
schemas/0.2/index.jsonlists the same mapping for tools, andschemas/index.json0.1's. An element or a type of a category that has no schema of its own here, one a later version adds, validates againstelements/element.schema.jsonortypes/type.schema.json(Part I, 10, rule 5).
Reference: leafPlace in src/core/versions/tree.ts; recordFile in src/core/versions/eikFolder.ts.
4. Where a record goes
A record's path is derived from the record. Its identity is its id, never its path: an element moved to another level is the same element in a new file.
4.1 Disciplines in 0.1
This section is 0.1's layout, which a writer of 0.1 writes and a reader of 0.2 reads (section 4.4, rule 7). A writer of 0.2 writes the owners' layout of section 4.4, whose rules replace this table and rules 1 and 2.
An element's discipline folder is its category's, with two exceptions:
| Discipline | Categories |
|---|---|
structure | beam, column, foundation, slabEdge, rebar, mesh |
systems | pipe, duct, terminal |
site | terrain, grading, propertyLine |
architecture | every other category |
- An element that carries
frameHost(a materialised framing member or truss) goes instructure. - A
componentelement goes instructurewhen it isstructural, or when its type is a plate (component.familyis"plate"), a cast-in item (insert) or a connector of the writer's own library; otherwise inarchitecture. Acomponenttype goes instructurewhen it is a plate, a cast-in item or a connector, otherwise inarchitecture.
Walls, slabs and roofs stay in architecture even when they bear: the folder follows who places them, not what they carry.
- A writer of 0.1 MUST place records by these rules, and a writer of 0.2 by section 4.4.
- A reader MUST NOT derive a record's meaning from its folder. It MUST accept a
componentrecord in eitherarchitectureorstructure, since which components are connectors is the writer's library. A reader reads a record wherever its folder puts it, by its own members, while a validator reports a record outside the folder its category or its owner gives it as an error (path-discipline; section 4.4, rule 7): the two do not conflict, since the finding is the writer's to fix, and the reading is the same wherever the record lies. - A
genericelement goes in the folder itsgeneric.disciplinenames (its own, else its type's), and inarchitecturewhen neither names one; agenerictype goes in the folder its owngeneric.disciplinenames, else inarchitecture(Part II, 6.6). A reader MUST accept agenericrecord in any discipline folder. - A reader MUST accept an element or a type of a category it does not know (Part I, 10, rule 5) in any discipline folder. A writer MUST write it back at the path it was read from, and, where it has none (the single-file form), under
architecture:architecture/<level>/<category>/<id>.json,types/architecture/<category>/<id>.json.
Reference: categoryDiscipline, elementDiscipline and typeDiscipline in src/core/versions/layout.ts.
Section 4.4 replaces this table and rules 1 and 2 in 0.2: there a record's folder is the discipline that owns it, one of eight, and rules 4 to 6 hold for the eight folders.
4.2 Element, type and view paths
- An element:
<discipline>/<segment(levelId)>/<category>/<segment(id)>.json. - A type:
types/<discipline>/<category>/<segment(id)>.json. - A view:
drawings/<discipline>/views/<kind>/<segment(id)>/view.json, wherekindis the view'skind. - A sheet:
drawings/<discipline>/sheets/<segment(id)>.json.
<discipline> is the record's owner (section 4.4). In 0.1's layout (section 4.1) it is the discipline of section 4.1, a view is at drawings/views/<kind>/<segment(id)>/view.json and a sheet at drawings/sheets/<segment(id)>.json.
A writer MUST write each record at its path. A reader SHOULD report a record whose file name, level folder or category folder disagrees with the record; the record's own members win. A validator MUST report such a record as an error, naming its file, and a view whose folder or kind folder disagrees with it too.
4.3 Names that fold to one
Some file systems ignore letter case, and some Unicode normalisation too: there Wall-A.json and wall-a.json are one file, and so are two names that differ only in how an accented letter is encoded, as one code point or as a letter and a combining mark. A folder that holds both names cannot be written there, nor checked out there (Security and privacy, 6.2).
- The fold of a name is the name in Normalization Form D (UAX #15, revision 50, of Unicode 13.0.0), each of its characters replaced by its full case folding, and the result in Normalization Form C, each step as Unicode 13.0.0 defines it. The full case folding is that of the Unicode Character Database's
CaseFolding.txtof that version: its mappings of status C and F, and not those of status T, which are for Turkic languages. A code point that Unicode 13.0.0 does not assign has, in that version, no case folding and no decomposition, and is a starter that composes with no other character: it stays as it is. Two names fold to one when their folds are equal: they are then canonical caseless matches (the Unicode Standard, section 3.13, D145). - Two paths fold to one when they differ and, compared name by name from the first, the first two names in which they differ fold to one: where names fold, the two are one file, or lie in one folder that they spell in two ways.
architecture/level-0/wall/Wall-A.jsonandarchitecture/level-0/wall/wall-a.jsonfold to one, and so doarchitecture/Level-1/wall/a.jsonandarchitecture/level-1/roof/b.json.
Part I, 6, rule 7 keeps two records' paths from folding to one, and section 7, rule 8 a kept file's path from folding to one with another of the model's.
4.4 Folders that follow owners
Part of 0.2, with Part XVI. It writes open question 85, which the steward decided on 27 October 2026 for 0.2 ("85y"). OpenEik 0.1 had it with the proposal ownership: a 0.1 writer writes the folders of section 4.1, and a 0.1 reader keeps a file in a folder that only this section gives, ventilation/, plumbing/, electrical/, sprinkler/, setup/ or drawings/<discipline>/, as a kept file (section 7).
Section 4.1 files a record by its category, and keeps a wall, a slab or a roof in architecture even when it bears: the folder follows who places a record. Part XVI gives ownership by path, and its parties work in eight disciplines (Part XVI, 2, rule 4). In this section a record's discipline folder is the discipline that owns it, one of the eight: architecture, structure, ventilation, plumbing, electrical, sprinkler, site and setup. So a party owns its discipline's folders, and an owners file says who owns what by a plain glob (Part XVI, 3.1). One set of rules, rules 1 to 5, gives a record's owner and so its folder: the application that checks a change, the host that holds it for approval and a tool that knows only paths give the same answer.
An owner set by hand. An element, a type and a view MAY carry
owner, one of the eight disciplines, set by hand. It wins over every rule below. A validator MUST report anownerthat is none of the eight as an error;schemas/0.2/ownership/owner.schema.jsonstates this rule.An element's owner. An element that carries no
owneris owned, by the first of these that holds:structure: an element that carriesframeHost(a materialised framing member or truss); a wall, a slab or a roof that isstructural; a stair that isstructural, or that carries nostructuraland whose type'sstair.constructionisconcreteCast,concretePrecastorclt; an element of the categoriesbeam,column,foundation,slabEdge,rebarandmesh, andmember(Part II, 6.2.1); and acomponentthat section 4.1, rule 2 puts instructurebecause it isstructuralor because its type is a plate or a cast-in item;ventilation: aduct, and aterminalthat is an air device (rule 3);plumbing: apipe, and every otherterminal;electrical: an element of the categorieselectrical,cableCarrierandcable(Part XIII);site: an element of the categoriesterrain,grading,propertyLine,planting,roadandparking;- a
genericelement:structureorsitewhere thegeneric.disciplinethat section 4.1, rule 5 reads (its own, else its type's) names it, elsearchitecture; - a
provision(Part II, 6.10): its asker's, the owner this rule gives the run itsprovision.forIdsnames first, elsesetup; architecture: every other element.
A
componentthat this rule gives no owner, which may be a connector of its writer's library (section 4.1, rules 2 and 4), and an element of a category the reader does not know (Part I, 10, rule 5), stay in the folder they were read from where that is one of the eight, and arearchitecture's where it is not or where they have none (section 4.1, rule 6).An air device. A terminal is an air device when its type's
terminal.kindis a component in a duct (damper,fireDamper,smokeDamper,flowRegulator,silencerorductFan; Part II, 6.9),transferAirorftxUnit; when the kind isheatPumpand one of its type's connections carries air; and otherwise when its system carries air (Part II, 6.9's table). A component's system is its run's (Part II, 6.9): the run'smep.system, else its type'spipe.systemorduct.system, and a duct carries air where neither gives one. Any other terminal's system is its type'sterminal.system, else the system of its type's first connection. A terminal type is an air device by its kind, as above, or, where itsterminal.mountis notpipe, by its own system. A terminal without a type is no air device.A type's owner is its
owner. Else it isstructurefor a wall, slab, roof or stair type that an element uses which bears by its own members, a wall, a slab or a roof that isstructuralor a stair as rule 2 says, and which carries noowner: the type's layers, or its flights, are the bearing build-up. Else it is the owner its category gives: aterminaltypeventilationwhen it is an air device (rule 3), elseplumbing; acomponenttypestructurewhen it is a plate or a cast-in item, else, as an element of its type, where it was read from (rule 2); agenerictype by its owngeneric.discipline, as rule 2 says; aprovisiontypearchitecture's; and the type of any other category as rule 2 gives an element of that category. So a type's folder follows its elements: a wall type moves totypes/structure/when a wall that uses it is madestructural, and back when none is.A view's and a sheet's owner. A view's owner is its
owner, elsesetup. A sheet's owner is that of its discipline code: itsdiscipline(Part XIV, 2.1), else the letters itsnumberbegins with, one to four of the letters A to Z, Å, Ä and Ö in either case, where a-, a space or a.follows them or the number ends, in upper case.AandBRarearchitecture's,Kstructure's,VandVEventilation's,VSplumbing's,Eelectrical's, andM,LandGthesite's; any other code, and none,setup's.sprinklerandsetupown an element or a type only by itsowner, but for a provision that names no run of the model, which issetup's (rule 2).The folders. In the owners' layout:
- an element:
<owner>/<segment(levelId)>/<category>/<segment(id)>.json; - a type:
types/<owner>/<category>/<segment(id)>.json; - a view:
drawings/<owner>/views/<kind>/<segment(id)>/view.json, with its detail items in chunks beside it (section 10); - a sheet:
drawings/<owner>/sheets/<segment(id)>.json.
The other lists keep their folders (section 1):
project/is the project setup's,fabrication/structure's,project/circuits/electrical's (Part XIII, 3.1), anddocuments/holds the records any writer adds. This replaces section 4.1's table and its rules 1 and 2; its rules 3 to 6 hold for the eight folders and fortypes/of each, witharchitecturewhere 4.1 says it.architecture,structureandsiteare folders of both layouts;systems,drawings/views/anddrawings/sheets/are 0.1's alone;ventilation,plumbing,electrical,sprinkler,setupanddrawings/<discipline>/the owners' alone, and Part I, 11.1, rule 2 reserves them.- an element:
Reading and writing. A writer of 0.2 writes the owners' layout, each record at its path in it, and writes a folder in one layout. A reader MUST accept a record in either layout, 0.1's or the owners': no path is a record's in both layouts with two meanings, and section 4.1, rule 4 already forbids reading meaning from a folder. A folder read in either layout gives the same model, record for record and hash for hash. A validator MUST report a record in a folder that neither layout gives it as an error (section 4.2), and SHOULD warn about a folder that holds records in both: one where only 0.1's layout puts it, and another where only the owners' does.
The change of layout. The first version a writer makes of a building in the owners' layout moves every record whose folder changes, once, a view with its detail chunks: for a building of 0.1, the version that migrates it to 0.2, in one write (Part I, 9.8, rule 1); for a folder of 0.2 still in 0.1's folders, a version that only moves. Its message says that it changes the layout. It SHOULD change no record but by moving it, and but those Part I, 9.8 rewrites, so that its diff shows each other record moved (Part VI, 4, rule 3). A record it moves touches the path it leaves and the path it takes (Part XVI, 4, rule 1), so it needs the owners of both by the owners file as it stood before; it SHOULD be made by a party that owns
**. In the same version, a writer rewritesproject/owners.json, where the building has one, for the new folders (Part XVI, 3.1). Every later version has the paths of its records' owners. Versions already stored are never rewritten (Part VI, 3, rule 2), and a reader reads each in its own layout (rule 7).What changes, and what stays. The change of layout moves records and changes none; the migration to 0.2 in the same version rewrites only what Part I, 9.8 says. Each record's id, its members, the GlobalId an export gives it (Part VIII) and its hash (section 6) stay what they were: its object is the same object in every version. What changes is each moved record's path, so every tree that holds one, and the root tree of the migrating version and of every version after it; and every digest of pairs (Part VI, 8.3), whose paths are leaf paths. A reader that compares a pair with a version (Part VI, 8.4; Part XIV, 9) compares it with the record its path names in either layout, its list and its id, so that a record that only moved, its hash the same, is unchanged.
Reference: elementOwner, typeOwner, bearingTypeIds and sheetOwner in src/core/access/owners.ts, terminalIsAir and terminalTypeIsAir in src/core/elements/mep.ts, stairCarries in src/core/views/disciplines.ts and sheetDiscipline in src/core/sheets/disciplines.ts (the reference implementation's work 670, at its main f2bc53d2), which decide a record's owner; the reference implementation still writes the folders of section 4.1 (open questions, section 2). In this repository, modelOwners in packages/openeik/src/layout.js, migrateFiles and migrateFolder in src/migrate.js.
5. The stored form
Every JSON file a writer writes is in the stored form, so that the same record always gives the same bytes and a changed value is a one-line diff:
- UTF-8 without a byte-order mark, and a final newline.
- Object members sorted by name, comparing UTF-16 code units; members whose value is undefined are left out.
- An object with members is written as
{, a newline, one member per line indented two spaces deeper than the object as"name": value, the members separated by,and a newline, a newline, and}at the object's own indent. An empty object is{}. - An array whose items are all scalars (strings, numbers, booleans,
null) is written on one line:[the items separated by,]. An empty array is[]. Any other array has one item per line, indented as object members are. - Scalars are written as ECMAScript's
JSON.stringifywrites them: strings with its escapes, numbers in the shortest form that reads back as the same double,-0as0.
A point list is therefore one point per line, and a point is one line:
{
"category": "wall",
"height": 2700,
"id": "wall-south",
"profile": [
[10000, 0],
[0, 0]
],
"top": {
"attach": {
"face": "underside",
"hostId": "roof-main"
},
"constraint": "unconnected"
}
}
(abridged from examples/one-storey-house/architecture/level-0/wall/wall-south.json.)
- A writer MUST write the stored form. A reader MUST accept any layout of a record, its white space and its members' order, that is I-JSON (RFC 7493): the form is for diffs, not for parsing. A reader SHOULD refuse a record that is not I-JSON, as Security and privacy, 7.3, rule 1 asks: an object with a member name twice, a string with an unpaired surrogate, or a number that expresses more magnitude or precision than a double provides, as that rule says. A validator MUST report a JSON file of the model's own that is not in the stored form, a record's,
project/order.jsonoreik.json, as an error, naming the file: a reader reads it all the same.
Reference: eikText in src/core/versions/eikFolder.ts; tools/lib/stored-form.mjs in this repository is an independent implementation, used by tools/check.mjs.
6. Canonical form and hashes
- The canonical form of a JSON value is the JSON Canonicalization Scheme of RFC 8785: no white space, members sorted by UTF-16 code units, scalars as ECMAScript writes them.
- A record's hash is the SHA-256 of the UTF-8 bytes of its canonical form, written as 64 lowercase hexadecimal digits.
- The stored form and the canonical form of a record differ only in white space, so a record's hash does not depend on how its file is laid out.
- A kept file's hash is the hash of its text as a JSON string (the canonical form of the string).
Reference: canonicalJson in src/core/versions/canonical.ts (keys sorted, numbers as JavaScript writes them, absent values left out); sha256 in src/core/versions/sha256.ts.
7. Kept files
A folder may hold files that are not records: another tool's results, requirements, a README. They travel with the model.
- A kept file is a file at a plain relative path (no segment starting with
.or~, no\and no NUL) that is noteik.json, notAGENTS.mdand not at a record's path. Rule 8 keeps some plain paths from kept files too. - A kept file of at most 1 MiB (1 048 576 bytes) that is valid UTF-8 without NUL bytes is read as text and kept with the model. A writer MUST write it back unchanged where it was. A larger or binary file is left alone: not part of the model, never removed.
- A writer of the model MUST NOT remove or rewrite a kept file, and MUST remove only the files of records that went. The application that owns a kept file may change or remove it.
- A kept file MUST NOT occupy a record's path, that path without
.json(the record's leaf in a version tree, Part VI, 2), or a folder a record needs; a reader MUST refuse such a folder and name the path. - In the single-file form (section 11) kept files are the
extrasmember: text by path. - A kept file is not a record, and the units of Part I do not bind it. An application that keeps results in a folder (an analysis, a quantity take-off) MUST state their units in the files themselves; they need not be millimetres.
- An application keeps its own files in a folder of its own at the top of the model's folder,
<application>/, which Part I, 11.3 says to name by its prefix, with a model folder for each model of its own,<application>/<model>/(for exampleacme/frame-a/). Part VI, 8, says how it keeps its results, with their result manifests, and its proposals there. - A kept file's path is not escaped, and MUST NOT hold a name that a file system refuses or reads otherwise, which section 2 escapes in a name made from an id (its rules 2 to 5: a character a common file system refuses, a leading
.or~, a trailing.or space, a device name), nor fold to one (section 4.3) with a record's path, witheik.jsonorAGENTS.md, whether or not the folder holds them, or with another kept file's path, nor pass througheik.jsonorAGENTS.md, or a name that folds to one with either, as through a folder: each is a file at the top of the model's folder (section 8). A writer MUST NOT write such a kept file: it refuses the model, naming the path, before it writes anything. A file at such a path in a folder is no kept file, and a reader MUST NOT refuse the folder for it. It leaves the file alone, as rule 2 leaves a larger or binary file: not part of the model, and never removed. It SHOULD warn, naming the path, and reads on. It takes the records' paths,eik.jsonandAGENTS.mdfirst, and then the kept files in the order of their paths by UTF-16 code units, and leaves alone each kept file whose path folds to one with a path it took before it, or that passes througheik.jsonorAGENTS.md. A validator MUST report each such file of a folder as a warning, and each such entry of theextrasof a model in the single-file form as an error, naming its path. A reader of versions MUST refuse a version that holds such a kept file, naming it (Security and privacy, 5.3, rule 2), unless its caller asks it to repair the version, when it reads the version, leaves the file out and gives it back, losing nothing (5.3, rule 4).
Reference: keptPath and extrasSchema in src/core/model/extras.ts; textOf and KEPT_MOST in server/eikSession.ts; manifestOfFolder ("a record of the model is kept at that name"); writeFolder.
8. The engine files
8.1 eik.json
{"format": "openeik/0.1-draft", "units": "mm"}, in the stored form. Part I, 9.2, says what a reader does with it. Writers MAY add members in later versions; readers MUST ignore members they do not know.
A writer MUST keep the members of eik.json that it does not know: writing into a folder or a version whose eik.json it read, it writes them back as it read them, beside the format it writes (Part I, 9.2, rule 2) and units. No application adds one (Part I, 11.2, rule 8).
8.2 AGENTS.md
The conventions an agent cannot read off the files: units, level semantics, the meaning of profiles, that nothing derived is stored, that a hand edit adds 1 to the revision, and how to check the folder.
- A writer MUST write
AGENTS.mdwhen the folder has none, and MUST NOT overwrite one that exists: a person's edits to it stay. - A reader MUST NOT read model data from it.
Reference: AGENTS_TEXT in src/core/versions/eikFolder.ts; writeFolder writes it only where there is none.
9. Order
project/order.jsonmaps the name of each record list other thanelementsthat the model has (types,views,materials,sheetsand so on) to its ids in order.- A reader orders each list by it. Records it does not name follow, in path order; ids it names without a record are ignored.
- The order of elements is not part of a model. Implementations MUST NOT give it meaning.
- Levels keep their order in
project/levels.json. project/order.jsonis an index of the record lists, not a record: it names lists and their ids, and nothing else (Part I, 11.2, rule 8), and the single-file form has no counterpart for it (section 11, rule 4). Part I, 10, rule 1 does not hold for a member of it that names no record list the reader knows: a reader MAY drop such a member, and SHOULD warn when it does. A validator SHOULD warn about one, and MUST NOT refuse the folder for it.
Reference: buildTree and readManifest in src/core/versions/tree.ts.
10. A view's detail items
A view's 2D items (lines, texts, dimensions, tags and the rest) can number tens of thousands. They are stored in chunks beside the view, so that an edit rewrites one chunk:
- When a view has detail items,
view.jsonholds the view without them, and the items go into chunk filesdetails/<n>.json, in order. A view with an empty list keeps"details": []inview.json. - A chunk ends after an item whose id's hash is 0 modulo 64, or when it holds 256 items. The hash is 32-bit FNV-1a over the id's UTF-16 code units: start from
0x811c9dc5; for each code unit, XOR it in, then multiply by0x01000193modulo 2³². This is not quite the FNV-1a of RFC 9923, which hashes octets: the two agree only for ids of ASCII characters. - Chunks are named by their index from 0 in decimal, zero-padded to the width of the largest index or 4 digits, whichever is more:
0000.json,0001.json, …. - A writer MUST chunk by this rule. A reader MUST join a view's chunks in name order and MUST accept any chunking.
Reference: detailChunks and HashCache.viewParts in src/core/versions/tree.ts.
11. The single-file form
A model may also travel as one JSON object, for exchange and email. It is the folder's content without the layout:
{format, units, project, projectInformation?, levels, grids?, scopeBoxes?, materials?, dimensionStyles?, detailFamilies?, titleBlocks?, images?, types, elements, views, sheets?, circuits?, people?, reports?, renders?, deviations?, areaAdjustments?, references?, pieces?, joints?, originals?, copies?, extras?}
In 0.1 the object began with schemaVersion and named no format; 0.2 deprecates schemaVersion (Part I, 9.3).
Lists hold their records in order; views hold their detail items inline;
extrasholds the kept files.schemas/model.schema.jsonvalidates it.A reader that reads folders MUST also read the single-file form. Reading a folder and writing it as one file, or the reverse, MUST lose nothing but the order of elements, the files a reader leaves alone (section 7, rules 2 and 8), the members of
project/order.jsonthat name no record list (section 9, rule 5) and the members ofeik.jsonother thanformatandunits(section 8.1), since the single-file form holds those two only (rule 5).project/project.jsonholds the members of the single-file object other than its record lists,levels,extras,formatandunits:project,projectInformation, and any other member at the top of either (schemaVersionamong them, where a model gives it), a member a reader does not know or an extension member (Part I, 10 and 11.2). Reading and writing carry such a member from the one to the other.project/order.jsonhas no counterpart in the single-file object: there the order of a list is the order of its records (section 9), and the file, an index and not a record, holds nothing else (section 9, rule 5; Part I, 11.2, rule 8).The object names its format and its units at its top,
formatandunits, aseik.jsondoes for a folder (section 8.1; Part I, 9.2). A writer of 0.2 MUST write both. A reader reads the object's version fromformatand refuses one it does not implement, as it refuses such a folder (Part I, 9.2, rule 3), and refusesunitsother than"mm"(Part I, 3, rule 7). An object withoutformatis one of 0.1, which named none.
Reference: ek import (folder to one file) and ek export (one file to folder) in server/ek.ts; the manifest type in src/core/model/model.ts. The reference implementation writes no format in its single-file models yet (open questions, section 2).
11.1 The file extension and the media type
- A file that holds a model in the single-file form SHOULD have a name that ends in
.eik.json(one-storey-house.eik.json): it ends in.json, so that every tool opens it as JSON, and.eikcomes before that, so that people and tools tell a model from other JSON. - Its media type is
application/vnd.openeik+json: JSON text (RFC 8259) in UTF-8, with the+jsonstructured syntax suffix (RFC 6839), and without parameters. A server, a store or a tool that labels a model in the single-file form with a media type (an HTTPContent-Type, an upload, an attachment) SHOULD use it. - A reader MUST read the single-file form whatever its file is called and however it is labelled (as
application/json, say, or in a file named after the application that wrote it): a name and a label say what a file is meant to hold, and its content decides. - The media type is not registered with IANA yet. Its registration is planned before 1.0 (
GOVERNANCE.md), with the template of section 11.2.
11.2 The media type's registration template (informative)
This section is informative. It is the template to be sent to IANA to register the media type of section 11.1 in the vendor tree (RFC 6838, sections 3.2 and 5.6), and the template of the media type of section 11.3, of 0.5, to be sent with it. Neither has been sent.
Type name: application
Subtype name: vnd.openeik+json
Required parameters: none
Optional parameters: none
Encoding considerations: binary. The content is JSON text (RFC 8259),
which is UTF-8 when it is exchanged (RFC 8259, section 8.1).
Security considerations: A model is data: JSON text, which names no
resource outside itself that a reader must fetch. The security
considerations of JSON (RFC 8259, section 12) apply. A model can be large
(many records, points, detail items and meshes); a reader bounds the
memory and the time it spends on one. Some of its strings are
expressions that a compiler evaluates: the arithmetic of the framing
families (OpenEik, Part II, section 5.4), a closed language of numbers,
names, the four operations and eight functions, with no loops, no calls
out of it and no state, at most 240 characters long; an implementation
evaluates them by that grammar alone, never as a programming language's
code. Its kept files (the member "extras") are other applications' text
by path; a reader keeps their text and does not run it, and an
application that interprets one treats it as untrusted input. Written
out as a folder, a model names the paths of its files: a record's is
made of its id, its level's id, its category and, for a view, its kind
(OpenEik, Part III, sections 2 and 4), and a kept file's is its own. A
kept file is a file at a plain relative path: no name in it starts with
"." or "~", so none is "..", and it holds no "\" and no NUL (Part III,
section 7.1). A conforming writer, and any tool that writes a model's
files (a clone, a pull, the single-file form written out as a folder),
writes no file outside the model's folder (OpenEik, Security and
privacy considerations, section 6.1): it escapes each name it makes
from an id or a level's id (Part III, section 2); a category and a
view's kind are plain names by their schemas; and it refuses the
model, before it writes anything, where a kept file's path is not
plain, holds a name that a file system refuses or reads otherwise
(as a drive, a device or a second stream of a file, or with a
trailing dot or space dropped), folds to one with another of the
model's paths where a file system ignores case and Unicode
normalisation, or passes through "eik.json" or "AGENTS.md" as
through a folder (Part III, sections 4.3 and 7). So no path that such
a tool builds from a model resolves outside the model's folder, and
no two of them are one file. Content hashes (SHA-256) name
content; they do not say who wrote it. A model may hold personal data,
such as its authors' names and email addresses and a site's position,
and gives it no protection of its own: whoever shares a model shares
them.
Interoperability considerations: A model in this form holds the same
content as an OpenEik folder (OpenEik, Part III, sections 1 and 11).
Readers keep the members they do not know (Part I, section 10) and accept
any JSON layout (Part III, section 5). Files written before this
registration may be named "*.json", or after the application that wrote
them; a reader reads the form whatever its file is called.
Published specification: OpenEik, Part III, section 11, "The single-file
form" (https://openeik.org/). The URL of the published version is given
at registration.
Applications that use this media type: building modelling and design
applications, model checkers and validators, agent hosts, and exporters
that read or write OpenEik models.
Fragment identifier considerations: as for application/json (RFC 6839,
section 3.1). OpenEik defines none.
Additional information:
Deprecated alias names for this type: none
Magic number(s): none
File extension(s): .eik.json
Macintosh file type code(s): none
Person & email address to contact for further information: the steward of
OpenEik (GOVERNANCE.md); the address is given at registration.
Intended usage: COMMON
Restrictions on usage: none
Author: the editors of OpenEik
Change controller: the steward of OpenEik, and the body that holds OpenEik
after it (GOVERNANCE.md)
The second template, of 0.5 with section 11.3, registers the media type of an archive of a folder in the same tree. The steward decided on 5 November 2026 that it is registered together with the first, at 1.0 (open questions, 20). It has not been sent either.
Type name: application
Subtype name: vnd.openeik+zip
Required parameters: none
Optional parameters: none
Encoding considerations: binary. The content is a zip archive (PKWARE's
APPNOTE.TXT, version 6.3.10), as for the +zip suffix (RFC 6839,
section 3.6).
Security considerations: An archive holds an OpenEik folder: its records,
its kept files and its assets, each a file at its path in the folder.
The security considerations of application/vnd.openeik+json apply to
the model it holds, and its assets (PDF renditions, fonts, pictures,
signed containers) are binary files that a reader never runs (OpenEik,
Security and privacy considerations, section 11; Part XV, section 10).
Zip archives have carried attacks of their own, which a reader of an
archive guards against (OpenEik, Part III, section 11.3, rule 11, and
Security and privacy, section 6.5): it reads the archive as the folder
it holds, and refuses an entry whose name would lead out of the folder
(empty, absolute, beginning with a drive, or holding "\", NUL, ".",
".." or an empty name), a link or a special file, two entries of one
name or of names that fold to one where a file system ignores case
and Unicode normalisation, a central directory that disagrees with its
local headers, entries whose bytes overlap, an entry encrypted or of a
method other than stored and deflated, and one whose bytes do not give
its size and CRC-32. It bounds every entry's size, and the sizes of all
of them, before it inflates anything; refuses a deflated entry that
claims more than 1 032 times its compressed size, which deflate cannot
give; and inflates no entry past the size its central directory gives.
It does not open an archive held in an archive (a signed container
among the assets) as an archive of a folder. A tool that writes the
folder onto a disk writes it as a writer writes a folder, not by
unpacking the entries as they are. An archive holds no hidden file
of the folder, such as its remote-tracking refs or a git repository.
A model may hold personal data, such as its authors' names, a site's
position and the photographs attached to its reviews, and gives it no
protection of its own: whoever shares an archive shares them.
Interoperability considerations: An archive is a zip that any zip tool
opens, and unpacked it is an OpenEik folder (OpenEik, Part III,
sections 1 and 11.3). Its entries are stored, not deflated, its first
entry is eik.json, and its bytes are a function of the folder's
version, so that one folder gives one archive, byte for byte, in every
implementation. A reader reads an archive that another zip tool wrote,
deflated entries included, as the folder it holds.
Published specification: OpenEik, Part III, section 11.3, "An archive of
a folder" (https://openeik.org/). The URL of the published version is
given at registration.
Applications that use this media type: building modelling and design
applications, model checkers and validators, agent hosts, version
stores, and exporters that read or write OpenEik models.
Fragment identifier considerations: as for application/zip (RFC 6839,
section 3.6). OpenEik defines none.
Additional information:
Deprecated alias names for this type: none
Magic number(s): 50 4B 03 04 at offset 0, and "eik.json"
(65 69 6B 2E 6A 73 6F 6E) at offset 30
File extension(s): .eik.zip
Macintosh file type code(s): none
Person & email address to contact for further information: the steward of
OpenEik (GOVERNANCE.md); the address is given at registration.
Intended usage: COMMON
Restrictions on usage: none
Author: the editors of OpenEik
Change controller: the steward of OpenEik, and the body that holds OpenEik
after it (GOVERNANCE.md)
11.3 An archive of a folder
Part of 0.5. OpenEik 0.4 had it as the proposal archives (open questions, 20): what it asks is a reader's and a writer's of a folder of any version. The steward decided on 5 November 2026 that a folder may travel as one zip archive of it, laid out as this part lays out the folder, deterministic so that the same folder gives the same bytes, with the file extension .eik.zip and the media type application/vnd.openeik+zip, registered with that of section 11.1; and that the registration is made at 1.0, as planned. What an archive holds and in which form are the editors' (question 126). It changes no rule of a folder, of a version or of the single-file form: an archive holds a folder, which a reader reads as it reads that folder, and a model is held to its own version's rules in it. No schema describes a zip: 0.5's index names the rule in its rules (schemas/0.5/index.json), and Security and privacy, 6.5 says what a reader of one guards against.
The single-file form holds a model's records and kept files as one JSON object, and carries no asset (Part XV, 9, rule 1). An archive is a folder in one file: a zip archive (PKWARE's APPNOTE.TXT, version 6.3.10) of the files a version of the folder holds (Part VI, 2), each at its path in the folder, with each asset's bytes in place of its pointer (Part XV, 3). Any zip tool opens it, and unpacked it is the folder; it carries a model's assets, its PDFs, fonts, pictures and signed containers, where the single-file form cannot.
- What it holds. An archive's entries are the files of its folder's version, each at its path in the folder:
eik.json, each record's file, each kept file (section 7) and each asset, atassets/<sha256>.<ext>(Part XV, 2). It holds nothing else: noAGENTS.md, which no version holds (section 8.2; Part VI, 2, rule 1); no hidden or reserved name (section 1),.eik/and.git/among them; no file a reader of the folder leaves alone (section 7, rules 2 and 8; Security and privacy, 6.4); and no entry for a folder, which the files under it make. Its entries are at the folder's own paths,eik.jsonat its top, and not under a folder of the folder's name. - What each entry holds. Each entry holds the bytes that writing the version into a folder writes at its path (Part VI, 6.4, rule 3; Part XV, 3, rule 5):
eik.jsonand each record's file in the stored form (section 5), each kept file its text in UTF-8, unchanged (section 7, rule 2), and each asset its bytes (Part XV, 2, rule 2). So a folder whose records are not in the stored form, and a folder in the stored form of the same version, give one archive. - The order.
eik.jsonis the first entry. The others follow it in the order of their paths by UTF-16 code units, as section 7, rule 8 orders kept files; the central directory names them in the same order. - Each entry's form. Each entry is stored as it is, uncompressed (compression method 0), and its local file header and its central directory header give:
- the version needed to extract 1.0 (10), or 4.5 (45) for an entry that rule 5 gives a ZIP64 field; and in the central header, the version made by 4.5 on MS-DOS (45, host 0), so that no entry carries a system's permissions;
- the general purpose flags 0x0800: bit 11 alone, its name in UTF-8 (APPNOTE, appendix D); no data descriptor, no encryption;
- the last modification time 0 and date 0x0021: 00:00:00 on 1 January 1980, the earliest a zip can give;
- its CRC-32, and its compressed and uncompressed sizes, which are its length;
- its name, its path in the folder, in UTF-8, its names separated by
/, with no leading/; - no extra field but rule 5's, no comment, the internal and external attributes 0, and the disk 0.
- ZIP64. An entry whose local header begins 0xFFFFFFFF bytes or more into the archive gives 0xFFFFFFFF for its offset in its central header, and a ZIP64 extended information extra field (header 0x0001, APPNOTE 4.5.3) that holds its offset in 8 bytes, and nothing else. An archive of 65 535 entries or more, or whose central directory begins 0xFFFFFFFF bytes or more into it or is that long or longer, ends with a ZIP64 end of central directory record (made by and needing 4.5, with no extensible data) and its locator, before the end of central directory record. No other entry and no other archive uses ZIP64. No entry needs it for its sizes: none is 4 GiB long (Part XV, 4, rule 2).
- The end. The entries follow each other from the archive's first byte, and the central directory follows the last of them; then the end of central directory record, on disk 0 with every entry on it, each value it cannot hold given as 0xFFFF or 0xFFFFFFFF and held in the ZIP64 record of rule 5, and no comment. Nothing comes before the first entry, between two entries, or after the end.
- Writing it. A writer that writes an archive MUST write it by rules 1 to 6. An archive's bytes are then a function of its folder's version alone: two folders of one version, or one folder written twice, give the same bytes, and the archive of a model in the single-file form is the archive of the folder a writer writes of it (section 13).
- Known by its bytes. An archive begins with the bytes 50 4B 03 04 (
PK, a zip's first local header) and has its first entry's name,eik.json, at byte 30, and that entry's bytes,eik.jsonin the stored form, at byte 38, which name the folder's format: as an EPUB's first entry,mimetype, gives its media type at byte 38 (EPUB 3's Open Container Format). A reader that is given a file that begins withPK03 04 reads it as an archive, whatever the file is called and however it is labelled (section 11.1, rule 3). - File extension and media type. A file that holds an archive SHOULD have a name that ends in
.eik.zip(one-storey-house.eik.zip): it ends in.zip, so that every tool opens it as a zip, and.eikcomes before that, as in.eik.json. Its media type isapplication/vnd.openeik+zip, with the+zipstructured syntax suffix (RFC 6839, 3.6), and without parameters. A server, a store or a tool that labels an archive with a media type (an HTTPContent-Type, an upload, an attachment) SHOULD use it. It is registered with IANA together with that of section 11.1, at 1.0 (section 11.1, rule 4;GOVERNANCE.md), with the second template of section 11.2. - Reading it. A reader that reads folders MUST also read archives. It reads one as the folder it holds (section 12): each entry is a file at its name, of the bytes the entry holds, stored, or inflated where it is deflated (method 8). It reads an archive that rules 3 to 6 do not hold, one that another zip tool wrote, as it reads one that they hold: its entries in another order, deflated, of another time or flags, with extra fields, comments or data descriptors. It reads an entry that rule 1 keeps out as a reader of a folder reads such a file:
AGENTS.mdas no file of the model, a hidden or reserved name skipped, a file a reader leaves alone left alone; and a folder's entry as no file. It performs the whole-model check where it does for a folder (section 12, rule 5), and refuses what it refuses of a folder. - What a reader refuses. Besides what it refuses of a folder, a reader MUST refuse an archive, naming the entry where there is one, before it reads any entry's bytes as the folder's:
- that is no zip that every reader reads alike: one without an end of central directory record, on more than one disk, or encrypted; whose central directory does not fill the room it says it takes; with a central header whose local header is not where it says, or disagrees with it on the entry's name, its method, its flags or, where no data descriptor follows the entry, its CRC-32 or its sizes; with a ZIP64 record that disagrees with the end record, or an extra field that names the entry otherwise (Info-ZIP's Unicode path field, 0x7075); with two entries whose bytes overlap; with an entry of a method other than 0 and 8; or with an entry whose bytes do not give its size and its CRC-32;
- that holds an entry whose name is not UTF-8, or would lead out of the folder: one that is empty, begins with
/or a drive (C:), or holds\, NUL, or a name that is empty,.or..; - that holds two entries of one name, a name that is a file's and a folder's at once, or two entries, neither of them hidden or reserved, whose paths fold to one (section 4.3): on a system where names fold, one file would stand for two;
- that holds an entry that is a link or a special file, by the mode its external attributes give where its version made by names Unix (host 3) or macOS (host 19): no folder holds one as a file of the model (Security and privacy, 6.4);
- past a bound of Security and privacy, 6.5, rule 2.
- Checking it. A validator MUST report, as an error naming the entry, each entry that rule 1 keeps out of an archive and each way the archive is not as rules 3 to 6 say; a reader reads such an archive all the same (rule 10), and SHOULD warn, as it reads a record that is not in the stored form (section 5, rule 6). It reports each of rule 11's refusals as an error, and checks the folder the archive holds as it checks a folder.
- Writing out its folder. A tool that writes the folder an archive holds onto a disk writes it as a writer writes a folder (section 13; Security and privacy, 6.1), from what it read, and
AGENTS.mdwhere the folder has none (section 8.2): it does not unpack an entry as it is. Whoever unpacks an archive with a tool that knows nothing of OpenEik relies on that tool to keep every entry inside the folder and to make no link (Security and privacy, 6.1).
12. Reading a folder
A reader:
- reads
eik.jsonand checks the format (Part I, 9.2); - walks the folder, skipping hidden names, and sorts each file into a record, an engine file or a kept file (sections 3 and 7);
- parses each record file, and refuses a file that is not JSON, naming its path;
- assembles the model: the project, the levels, each list ordered by
project/order.json, each view joined with its chunks, the kept files; - performs the whole-model check, where it does (below): validates every record against its schema and the whole model against Parts I and II, and refuses the folder, naming the file and the rule, when any fails; a record of a category it does not know it validates against the common schema only, keeps and warns about (Part I, 10, rule 5).
The whole-model check of rule 5 is required of the validator class, which reports what fails it (Conformance, 1), and a reader SHOULD perform it. A reader that performs the check MUST refuse a folder that fails it. A reader that does not perform the check reads the folder as it is. Every reader MUST refuse what it cannot read, which is what this list names; a reader that does not perform the check need refuse nothing else:
- a folder whose
eik.jsonis not JSON, has noformat, names a version it does not implement or givesunitsother than"mm", or that has noeik.jsonwhere Part I, 9.2, rule 5 does not let it read it asopeneik/0.1-draft(Part I, 3, rule 7, and 9.2); - a project whose
schemaVersionit does not implement (Part I, 9.3), or that givesunitsother than"mm"or anupAxisother than"Z"(Part I, 3, rule 7); - a record file that is not JSON (rule 3), or that holds a number that is not finite (Part I, 3, rule 5);
- a record file,
eik.jsonor a model in the single-file form that is not valid UTF-8 (section 5, rule 1): no text, which it cannot read; - two records of one id in a list that Part I, 6, rule 1 names: elements, types, views, levels, grids, sheets or linked references;
- a kept file at a record's path or where a record needs a folder (section 7, rule 4);
- a file it cannot read whole, and a folder, a version or a model past a bound it sets on the number of files, records, a view's chunks or a store's objects, or on the depth of trees (Security and privacy, 7.2, rules 2 and 4);
- from 0.5, an archive that section 11.3, rule 11 refuses, and one past a bound of Security and privacy, 6.5, rule 2;
- an object or a tree from a store that Security and privacy, 5.3 refuses, among them a version that holds a name that no folder gives, a hidden one or one that starts with
~and is no shard, or a kept file that a reader of a folder leaves alone or reads as another file (section 7, rules 1, 2, 4 and 8), unless it is asked to repair the version (Security and privacy, 5.3, rule 4).
A reader SHOULD also refuse a model's file that is not I-JSON, with or without the check: an object that repeats a member name, a string with an unpaired surrogate, or a number that expresses more magnitude or precision than a double provides (section 5, rule 6; Security and privacy, 7.3, rule 1).
A reader MUST NOT add, change or drop records while reading, except as Part II says for legacy members (6.4) and as this part says for kept files. It MUST keep members it does not know, and records of categories it does not know (Part I, section 10).
Types are in the folder. A conforming folder contains a type record for every type any of its records names. A reader MAY rely on types/** alone for types; it MUST NOT need a built-in library to read a conforming folder.
Reference: modelOfFiles and readFolder in server/eikSession.ts; manifestOfFolder in src/core/versions/eikFolder.ts; parseImport in src/core/model/store.ts.
13. Writing a folder
A writer:
- writes every record at its path (section 4) in the stored form (section 5);
- writes every type that any record names, and SHOULD NOT write library records the model does not use (below);
- writes
eik.json, keeping the members of the folder's own that it does not know (section 8.1), andAGENTS.mdwhen there is none; - removes the file of each record that is no longer in the model, or no longer at that path (a record moved to another level, or read at a name in an older form, section 2, rule 9), and no other file;
- SHOULD write only the files whose bytes change, so that a version control system sees exactly what changed.
Reference: writeFolder in server/eikSession.ts; EikMirror in src/core/versions/eikFolder.ts (writes only records whose content hash changed).
A library record is a type, title block, detail family, image or other record that a writer takes from its own built-in library rather than from the model. A writer SHOULD NOT write a library record that no record of the model names. A record the model holds of its own, such as a type made for the project that no element uses yet, is the model's and is written.
14. Editing by hand
People and agents may edit record files with any tool.
- Whoever changes a record by hand MUST add 1 to its revision (Part I, section 8).
- After an edit, a reader that performs the whole-model check (section 12, rule 5) MUST perform it again before it accepts the folder, and MUST refuse a folder that no longer checks, naming the file and the rule. A reader that does not perform the check reads the edited folder as it is, and refuses it only for what section 12 lists. An agent host checks the folder whole after an edit, as Part VII, 6, rule 4 says.
- A hand edit that sets a size a type sets (Part II, 5.3) makes a folder that fails the whole-model check: a validator reports it, and a reader that performs the check refuses the folder (rule 2).
Reference: EikSession.sync in server/eikSession.ts (re-reads edited files and checks the whole model; keeps the last good model while an edit is wrong); typeSetInFiles.
15. Weight
Part of 0.5. OpenEik 0.4 had it as the proposal weight (open questions, 138): a model of 0.4, read by 0.4's rules (Part I, 9.6, rule 3), is read by the members it adds only where a caller asks for it (decision D12). The steward asked on 5 November 2026 that the forms which made large models of the reference implementation slow be covered, so that every writer and every agent that draws in OpenEik avoids them; its shape is the editors' (question 126). It changes no rule of validity of 0.4's members: every rule here is a recommendation for a writer, a reader, a host or a caller of commands, and the findings of it that a validator or a command processor gives are warnings, never refusals (sections 15.7 and 15.8), but for what it makes of the members it adds, a detail item's exact arcs (bulges, section 15.2, rule 4), which a validator holds to its schema and to its points, and the heavy forms a record keeps on purpose (weightAccepted, section 15.7, rule 5), which it holds to its schema. A model that keeps a heavy form is as valid as one that does not. Its members' schemas are in schemas/0.5/weight/, and guides/weight.md gives it as tips for writers and agents.
A model's weight is the bytes its files take and the work a reader, a host and a renderer do to read and draw them. One building can weigh a thousand times more in one model than in another, by how it is said: a hatch as its strokes or as a pattern, a circle as its chords or as a circle, fifty flats as fifty sets of elements or as one group and its copies. The format allows every one of these forms. These rules say which to choose, so that a model stays light for every tool that reads it, and a writer that keeps a heavy form keeps it because it chose to.
15.1 Say what a thing is, not its strokes
- A writer SHOULD write a thing by the item or the member that names it, not by the lines a drawing of it is made of:
- a hatch, as a
regionwith apattern, or, where it is the cut of a material or a layer, by that material's or layer'spattern(Part II, 4 and 5.1), which every cut of it draws; - insulation, as an
insulationitem: its two ends, itswidthand itsinsulationKind; - a full circle or an ellipse, as an item of the kind
circle: its box; - a mark, a fixture or a part drawn more than once, as a
symbol, acomponentor a detail family's instance (familyInstance), and a row of them as one item withrepeat; - a material's courses, boards, tiles or seams in elevation, as the material's
surface, not as detail lines.
- a hatch, as a
- A writer SHOULD write a path as one item: segments of one style that meet end to end are one
linewith itspoints, and a filled shape with its outline one item (filled), not two. - A writer SHOULD NOT write an item that repeats another item of its view exactly, but for its id: drawn twice, it draws nothing more.
- A converter, which writes a drawing of another format as detail items (a view whose
sourcenames the file and the page it was converted from), SHOULD do the same of what it converts: join a path's segments into one line, keep a fill with its outline, and write a hatch it recognises by its pattern.
15.2 Curves stay exact; straight pieces are output's
Where the format has an exact form for a curve or a body, a writer SHOULD write it: a
customsection's rounded corners andthroughentries (Part II, 5.2, rules 8 to 10), aroundor aCHSsection, a pipe's circle, an item of the kindcircle, a detail item's arc by itsbulges(rule 4), and a declared body of one outline between two heights as aprism, a round one as acylinder(Part II, 12.1), not as ameshor apolyhedron. The straight pieces and the triangles that draw it are output's: a compiler, a bridge or a renderer MAY draw an arc as straight pieces (Part II, 5.2, rule 10; Part IV, 12.3, rule 5), and a writer SHOULD NOT store them in its place.Where it has none, as for an element's plan points or a terrain's points, and for a detail item whose writer keeps an arc's chords, a writer SHOULD write a curve's chords no finer than what is drawn of it: each chord within 0.1 mm of its arc on the paper at the largest scale its view is drawn at, and, for an element, within 1 mm of it, 0.1 mm on the paper at 1 : 10. An arc of radius
rthrough an angleθneedsθ / (2 arccos(1 − t / r))chords withintof it: a circle of radius 1 000 mm, 32 chords at 1 : 50 (t= 5 mm), 100 at 1 : 5 and 71 for an element.A writer SHOULD mark a detail line whose points stand for an arc or a circle with
curveKind, so that a reader knows the curve and need not guess it from the chords.A detail item's arcs, exact. A detail item of the kind
line,regionormaskthat gives itspointsMAY give itsbulges: one number for each point, the bulge of the segment from that point to the next, and for the last point of a region, a mask or a closed line the segment back to the first. A bulge is the tangent of a quarter of the angle the segment's arc turns through, positive where it turns counter-clockwise in the view's own coordinates (u along, v up, Part XIV, 6.2), negative where it turns clockwise, and 0 for a straight segment: 1 is a half circle, and the arc's height over its chord is the bulge times half the chord. Its schema isschemas/0.5/weight/bulges.schema.json, each bulge between −100 and 100 (an arc of at most 357.7°).- A writer SHOULD write a detail item's arc so, by the points where it begins and ends and its bulge, not as its chords, and SHOULD write a bulge to nine decimals: within a thousandth of a millimetre of its arc over a chord of a kilometre. A bulge is no length, and section 15.3's three decimals are not its.
bulgeshas as many numbers aspoints, and the last of an open line's is 0, since no segment follows its last point; an item of another kind gives none. A validator reports either as an error (bulges-points), and one of a model of 0.4 where it applies the proposal. The item'saandbare its first and last points as before, and every rule that reads its points, its anchors and what it follows (Part II, 14.4) reads them as before: a rigid move keeps each bulge.- An item whose arcs are its bulges gives no
curveKind: its points are no chords. - A reader draws a segment whose bulge
bis not 0, fromptoq, its chordclong, as the arc of radiusc (1 + b²) / 4|b|about the point(1 − b²) / 4bchords to the left of the chord's middle, fromptoq, turning as its sign says; a reader of a model of 0.4 that does not apply the proposal draws its chord. - An issuer draws such an item as a
pathwhosedgives each segment with a bulge as an elliptical arc,A r r 0 L S x y:rthe radius of rule 4.4,L1 where|b|> 1 and else 0, andS1 wherebis positive and else 0, SVG's positive angle in the coordinates the path is given in, the viewport's own, v up; each straight segment asL; andZafter the segment back to the first point of a region, a mask or a closed line. Part XIV, 6.4 allowsAin a path'sd, its numbers to three decimals like every other, and its validator reads it (6.12, rule 26). detail.draw'stangentArcandfillet(Part XIV, 17.1.2), which continue an item, keep its bulges on the points they keep, a 0 for each segment they draw; each refuses an item whose segment it draws from is an arc: a tangent arc's last segment, a fillet's corner's two sides.
Why bulges (informative). The editors chose the exact form common practice already writes for such paths, DXF's polyline bulge (group code 42 of an LWPOLYLINE), over SVG's elliptical arc and IFC's arc of three points (
IfcArcIndex). A bulge is one number for each point, besidepoints, so the points stay the item's own and every rule and tool that reads them reads them as before; it says an arc exactly in one number where SVG'sAtakes five, two of them flags, and can name a radius its ends do not allow, and where an arc of three points adds a point inside each arc; and it is what a CAD file a converter reads already carries, so a converter writes what it reads (rule 15.1.4). The cost is a reader without the proposal, which draws the chords between the points: one of 0.5 draws the arcs.
15.3 Numbers
- A writer SHOULD write a length, a coordinate or a line weight that it works out to no more than three decimals of a millimetre: a thousandth of a millimetre says as much of a building and of a drawing as seventeen digits do, in a third of the bytes or less.
- A writer SHOULD NOT round a number it read and does not change: the record keeps its value and its hash (Part I, 10; section 6).
15.4 Repeated parts and types
- A writer SHOULD write a group of elements that stands, as it is, at more than one place as an original and its copies (Part II, 10), not as the elements of each place: the copies' elements are derived, and never stored.
- A writer SHOULD place a part that repeats along a line or over an area by the rule or the item that repeats it (a framing family, a layer's
drawing, a detail item'srepeat), where the format has one, not as each of its copies. - A writer SHOULD write one type for each build-up its elements share, not a type for each element.
- A writer SHOULD choose for a thing a category and a kind whose body draws what the thing is: a kind that derives detail the thing does not have weighs on every view, print and bridge of the model.
- A writer SHOULD declare a shape that every element of a type has once, on the type (Part II, 12.1), not on each element.
15.5 Issued drawings and prints
- An issuer SHOULD draw a hatch as a
patternindefs, which a region fills byurl(#…), not stroke by stroke; a shape drawn more than once (a mark, a symbol, a fixture) as one group indefsand auseat each place; and an arrowhead, a tick or a dot at a line's end as amarker(Part XIV, 6.3 to 6.5). - An issuer SHOULD draw a circle as a
circleor anellipse, and an arc as a path's arc (A), not as chords: a detail item's bulges as rule 15.2.4.5 says. - An issuer SHOULD draw nothing that a viewport does not show (Part XIV, 6.12, rule 26), and no hatch finer than its paper shows: a hatch's strokes or waves at least 1 mm apart on the paper.
- A picture on a sheet SHOULD hold no more pixels than its paper shows: at most 24 to the millimetre of paper it covers (600 dots an inch). A picture is held in each file that shows it (Part XIV, 6.3), so a title block's logo is paid for on every sheet.
15.6 Readers and hosts
- A reader SHOULD read what it is asked for: a version's tree first, and of its records those the task needs, fetched by their hashes (Part VI); a host SHOULD NOT send a whole model where a part is asked for (Part VII, 5).
- A store or a host SHOULD keep a version as its tree, each record once for every version that holds it (Part VI, 2), not as a whole copy of the model for each version. An undo, a redo or an import is a version of the records it changed.
- A host that lists versions, records or objects SHOULD page the list and say where there are more, and SHOULD NOT stop at a limit without saying so.
- A host that tells whether an issued drawing is current SHOULD compare its read set with the model (Part XIV, 9.4), not draw the sheet again.
- A reader SHOULD hold a model's lists, its elements, a view's items and a mesh's triangles in a form that does not fail below the sizes the format allows: a view holds up to 50 000 items, and a building hundreds of thousands of bodies.
15.7 Warnings
A validator MAY warn of a form these rules recommend against. A warning of weight never makes a model invalid (Conformance, 2), and SHOULD name the form that says the same and what it saves, so that a person or an agent can change it in one step. It SHOULD warn only where a form is far heavier than the compact one, so that a model written in the compact forms gets none.
An agent that writes a model SHOULD check it for weight after it writes (Part VII, 6), and change a heavy form it wrote to the compact one the warning names.
A writer MAY keep a heavy form on purpose: a survey's points, a scanned or converted drawing's strokes, elements that are to change apart. A validator that warns of weight SHOULD let it say so once, everywhere or under a path, after which it does not warn of it. An agent SHOULD NOT change a heavy form it did not write on a warning alone: it puts it to its person.
A warning of weight that a validator or a command processor gives SHOULD carry one of the codes below for the form it names, with the rule of this section as its
rule. A form these codes do not name, or a finding of one application's own, carries that application's prefix (Part I, 11.1; Part XVII, 10.1), asacme:copied-geometry.Kept in the model. A writer MAY say in the model that a record keeps a heavy form on purpose, so that every tool that reads it knows, where
accept(rule 3) is one check's: an element, a type or a detail item MAY giveweightAccepted, a list of 1 to 20 entries{code, reason, by?, at?}, held toschemas/0.5/weight/accepted.schema.json:code, the code of the warning of weight it keeps, one of the thirteen below or an application's own under its registered prefix (Part I, 11.1), asacme:copied-geometry;reason, why, for people, 1 to 200 characters: a survey's points, a drawing kept as it was traced, elements that are to change apart;by, who keeps it, as a detail item's provenance says who made it (Part XIV, 3.2):{person}, a person by their id, or{agent: {name, version}, actingFor}, an agent and the person it acts for; andat, when, in UTC (Part XIV, 7.2).
A record that keeps a code keeps the heavy form of that code it is part of: a set of like strokes, a path cut into segments, an item and the one it repeats, an item's points on a circle, an item's numbers, a group that stands again, a declared body, a set of elements of one shape on their type, a set of types that are one. It is said once, on any one of the form's records. A validator that warns of weight SHOULD NOT warn of a form one of whose records keeps its code, and warns of the others of its view or its model as before; a command processor SHOULD NOT give an advisory of a code on a record that keeps it (15.8). An agent SHOULD NOT write
weightAcceptedfor a heavy form it did not write but on its person's word (rule 3), and SHOULD say whom it acts for. A validator holds the member to its schema, and one of a model of 0.4 where it applies the proposal; a check of weight honours it, of any version, asaccept.
The codes. The codes of weight, each with the rule it names, what it finds, and the compact form it names. A validator gives the first eleven, of a folder or a model; a command processor the last two, of a session (section 15.8). The thresholds are @openeik/tools' (its README), which finds none of them on the examples of this repository or in the conformance suite. An application whose own copy command writes a group's copies out as elements, so that what it saves is commands rather than stored records, gives the same finding under weight-copies, its compact naming its own command.
| Code | Rule | Finds | The compact form |
|---|---|---|---|
weight-hatch-strokes | 15.1.1 | 100 or more strokes of a view, parallel and of one length | a region with a pattern; a material's or a layer's pattern; an insulation item |
weight-split-path | 15.1.2 | 200 or more points of a view where two lines of one style meet end to end | one line for each path, with its points |
weight-duplicate-items | 15.1.3 | 10 or more items of a view that repeat another exactly, but for their ids | each item once (detail.remove of the others) |
weight-arc-points | 15.2.2 | 64 or more points of one item on one circle: a full circle, or an arc whose chords are four times finer than its paper | an item of the kind circle; the arc exact, its ends and its bulges (15.2.4) |
weight-mesh-prism | 15.2.1 | 10 or more declared bodies, meshes or polyhedra, of one outline between two heights | a prism |
weight-precision | 15.3.1 | 1 000 or more numbers of a view's items to more than three decimals | three decimals |
weight-copies | 15.4.1 | a group of elements that stands again as it is at 3 places or more, each at one offset (in plan, on its level or onto another), its records 24 or more in all (places × elements), of any number of kinds | an original and a copy at each other place (original.make, copy.place) |
weight-shared-shape | 15.4.5 | 10 or more elements of one type that carry the same declared geometry of their own | the shape declared once on the type |
weight-same-types | 15.4.3 | 20 or more types that are another type again, but for their ids and names | one type for each build-up |
weight-svg-path | 15.5.1 | an issued SVG path of 20 000 or more segments | a pattern, a use, arcs (A) |
weight-svg-hatch | 15.5.1 | 500 or more like strokes of an issued SVG, outside its patterns | one pattern in defs, filled url(#…) |
weight-rebuild | 15.8.1 | in one session, a record deleted and one nearly the same created again | an update of the record in place |
weight-full-replace | 15.8.2 | a command that sends a whole set, a record, a list or a chunk's items, to change a few of it | a patch of what changes (Part V, 4) |
@openeik/tools gives the first eleven with openeik check --quality (quality: true), and --accept <code>[:<path>] (accept) keeps a heavy form on purpose (rule 3), as a record's weightAccepted does (rule 5); its detectors are pure functions of records an application can call, weightOfDetails, weightOfElements and weightOfSvg, each finding with the compact form ready to write.
15.8 Commands
A caller SHOULD change a record in place, by an
update(Part V, 2.1), not delete it and create one nearly the same: the record keeps its id, its revision's history and what names it, and a diff and a merge see one change, not two.A caller SHOULD send a patch of what changes (Part V, 4), not a whole record, a whole list or every item of a chunk to change a few of them: a command that resends a whole set writes it whole, and its answer, its log and every version's diff carry it.
A command processor MAY answer a command or a session that does either with an advisory in its answer's
warnings(Part V, 9),weight-rebuildorweight-full-replace, naming the records and the command that would do the same in place. An advisory never refuses a command: the command is accepted as it would be without it. A processor that gives them:- Judges against the state before the write, not the command alone: it compares what a command sends with the record as it was before the command. A member or an item resent as the record holds it is unchanged, and a command that changes none of what it resends, as one that repeats what the processor itself wrote earlier, is no full replace. What the processor writes itself on every write, a record's revision and an agent's detail item's provenance (Part XIV, 3.2), is not counted as sent.
weight-rebuild. Gives it where a record that adeleteor adetail.removetook earlier in the batch or the session, as it was before, is made again nearly the same by acreateor adetail.place: of the same list, and for an item of the same view; of the same category or kind; and of their other members but the id, the revision, the name and the provenance, three quarters or more alike. The compact form is theupdateor thedetail.updateof the record deleted, at its revision as read, whose patch makes it the one made.weight-full-replace. Gives it where anupdateor adetail.updatesends 6 members or more, three quarters or more of the record's, and changes one of them or more and a quarter of them at most; or where aview.upsertof a view that stands sends 20 items or more and changes, adds or removes one of them or more and a quarter of them at most. The compact form is the patch of what changes; for a view, thedetail.update,detail.placeanddetail.removeof the items that change (Part XIV, 17.1 and 17.1.1), where the view's own members do not change. A kind that writes its record whole by definition, astype.upsert,material.upsertandlevel.upsert, has nothing lighter to send, and gets none.- Never suggests grouping records that are distinct model elements. It pairs a record made with one deleted, one to one, and never with one that stands; and no advisory or weight line names an original and its copies: whether elements are a group is a whole model's check (
weight-copies, 15.7). - Advises once per code per record in a session, and counts the repeats. An advisory is about one record or one view, its target (
elements/<id>,views/<id>,views/<id>/details/<item>), and comes once for each code and target in a session; each time it comes again, the processor counts it and says nothing inwarnings. A session is what the caller keeps between batches and gives again, or the batch where it keeps none; it takes only a batch applied. - Says it in full. The warning carries its code and rule, what the command did, the command or the batch that does the same lighter, ready to run, where there is one, what that saves, and the guide's topic,
guides/weight.md, Commands; the answer's weight line carries the same as data (Part V, 9.1). - Gives no advisory of a code on a record that keeps it (15.7, rule 5).
The thresholds are
@openeik/tools' (WEIGHT_LIMITS:replaceMembers,replaceItems,replaceShare,rebuildShare).A command processor MAY give an accepted batch its running weight line, the answer's
weight(Part V, 9.1): the records it wrote by kind, and the heavy forms the checks of section 15.7 find in what it wrote, each with its compact form, so that a caller sees what a batch weighs as it writes, and not only when a model is checked.