Part VI. History
A model's history is kept as git keeps code: content-addressed objects, trees that mirror the folder, versions that point at a tree and at the versions before them, and named refs. Two lines of work merge by record and by field, never by text.
The requirements of sections 1 to 5 apply to an implementation that keeps versions of a model (the version store class in Conformance), and those of section 6 when it exchanges versions with another store; those of section 6.8, from 0.5, bind a store that serves the store protocol and a client that speaks it. A folder alone needs none of them: a folder may be versioned by any tool, git included. Section 8 applies to an application that keeps results or proposals in a model's folder, and to an implementation that reads them.
1. Objects
- Every record, every kept file and every tree is an object, named by its hash: the SHA-256 of the UTF-8 bytes of its canonical form (Part III, section 6), as 64 lowercase hexadecimal digits.
- A record's object is the record's canonical JSON. A kept file's object is its text as a canonical JSON string.
- Two equal records anywhere, in any version, are one object. An object is never changed; a changed record is a new object.
Reference: HashCache.record and buildTree in src/core/versions/tree.ts; sha256 in src/core/versions/sha256.ts.
2. Trees
A tree object is the canonical JSON of {"tree": [[name, kind, hash], …]}:
nameis one path segment;kindis"t"for a sub-tree and"b"for a leaf (a record or a kept file);- the entries are sorted by
name, comparing UTF-16 code units.
- A model's tree has the folder's layout (Part III), with these differences: a record's leaf is named without
.json(architecture/level-0/wall/wall-south), andAGENTS.mdand hidden files are not in it. The project record is the leafproject/project, the levelsproject/levels, the orderproject/order; a view isdrawings/views/<kind>/<id>/viewwith its chunks underdetails/. A kept file is a leaf at its own path, with its own name. eik.jsonbelongs in every stored version's tree, as the leafeik.jsonwhose object is its canonical JSON, so that a version says which format it is in.- A tree with more than 4096 entries is split into shard sub-trees named
~followed by the first two hexadecimal digits, lowercase, of the SHA-256 of each entry's name. A shard holds the folder's entries whose names give it, and never a shard: shards are not nested. Shards are not part of any path: a reader of a tree MUST read through them, and MUST NOT treat a~name as a folder of the model. - The hash of a model's root tree identifies the model's state: two models with the same root hash hold the same records and kept files.
Reference: buildTree, SHARD_LIMIT, listLeaves and readManifest in src/core/versions/tree.ts. The reference reader reads a folder by building these objects from its files and reading them as a version (manifestOfFolder in src/core/versions/eikFolder.ts): a folder and a version are one format.
3. Versions and refs
- A version is a commit object, the canonical JSON of
{"commit": {tree, parents, kind, at, author, name?, note?, summary, records}}, and from 0.2 itsagents(Part XVII, 4.3) and from 0.3 itsapp(section 3.5) where it gives them:tree: the root tree's hash;parents: the hashes of the versions it follows (none for the first, two for a merge);kind:start,auto,named,restore,mergeoralternative;at: an ISO 8601 time;author: who made it;name,note: for a named version;summary: a summary of the changes (its form is implementation-defined in 0.1);records: the number of records in the version: one for each record of a record list of the single-file form (Part III, 11), its elements, types, views and the rest, a view with its detail chunks counted once; the project record, the levels,project/order.json,eik.jsonand kept files are not counted, so that two stores that save one folder with one summary give it one id (rule 2).
- A version's id is its object's hash. Versions are never rewritten: restoring an older state makes a new version on top.
- A ref names the newest version of a line of work:
main, andalternatives/<slug>for an alternative design. A ref MUST be moved only by compare-and-swap: the writer names the version it expects the ref to point at, and the move fails if it points elsewhere. - An automatic version of a model whose tree has not changed SHOULD NOT be made.
Reference: Commit, VersionHistory.save (the refs main and alternatives/<slug>, and the retry when a ref moved meanwhile) in src/core/versions/history.ts; VersionBackend.setRef in src/core/versions/objects.ts.
3.5 The application that wrote a version
Part of 0.3. OpenEik 0.2 had it as the proposal commitApp (open questions, 125): a model of 0.2, read by 0.2's rules (Part I, 9.6, rule 3), is read by it only where a caller asks for it (decision D12).
A version names the application that wrote it, beside the person who made it, its author, and the agents whose operations it holds (Part XVII, 4.3). A writer of a version of 0.3 writes it where its caller gives it; one of a version of 0.2 only where the proposal is asked for, without which a version's commit object of 0.2 is rule 1's; and a version of a model of 0.1 never names one.
- The member. A version's commit object MAY carry
app,{name, version?}: the application that wrote the model the version holds,name1 to 100 characters andversion, where given, 1 to 50, as an agent is named (Part XVII, 4.3), and no other member:{"commit": {tree, parents, kind, at, author, app?, name?, note?, summary, records}}. It names one application: of a model two applications' work went into, the one that wrote it as it is. - What its writer says. It is what the version's writer says, as
authoris: the application that wrote the model, which need not be the one that sends the version to a store, as a command-line tool pushes a version an authoring tool wrote. A reader and a host show it and verify nothing by it, and a host MUST NOT refuse a version because itsappis not the client that sends it. - In its id. It is part of the commit object, and so of the version's id (rule 2): a version is never rewritten to add or to change it.
- Without it. A version without
appnames no application, and a reader MUST NOT name one for it, from itsauthor, itsnoteor the client that sent it. No version written before the proposal names one. - The other applications named. A result manifest's
app,{name, version}(section 8.2), and a proposal file'sby.app, a text (section 8.7), keep their forms: this member is a commit object's alone.
Reference: the reference implementation does not write it yet; it asked for it (open questions, 125). In @openeik/tools: commitApp, and pushVersion and push with app on a folder of 0.3, and with proposals: ["commitApp"] too on one of 0.2, in packages/openeik/src/store.js and packages/openeik/src/remote.js; openeik push --app <name>[@<version>] --proposal commitApp.
4. Diff
- A diff between two versions compares their trees. Sub-trees with equal hashes on both sides are equal and SHOULD be skipped without being read.
- Changes are reported by record: the list, the id, whether it was
added,removed,changedormoved, and the top-level fields that differ (the revision left out). For a view, the counts of detail items added, removed and changed. - A record that moved to another folder (a wall to another level) is one changed record, found by its id, not a removal and an addition, with the path it left and the path it took. A record whose path alone changed, its object the same, is
moved: one record, both its paths, no field. The change of layout of Part III, 4.4 moves records so, and so does a file renamed to the form of Part III, 2, rule 9.
Reference: treeDelta and diffTrees in src/core/versions/diff.ts.
5. Merge
A merge joins two lines of work, ours and theirs, against the version both started from, the base.
- Records are matched by id, list by list, never by path or by text.
- For each record:
- changed on one side only: that side's record is taken;
- added on one side only: it is taken;
- deleted on one side and unchanged on the other: it is deleted;
- changed on both sides: it is merged member by member (rule 3);
- changed on one side and deleted on the other: a conflict (
changed and deleted); - added on both sides with different content: a conflict (
added twice).
- A member changed on one side only takes that side's value. Objects merge member by member, recursively. A list whose items are all objects with an
id(a type's layers, a view's detail items, a sheet's viewports) merges item by item by id: our order, with their new items placed after the item that precedes them on their side. Any other value (a number, a point, a list without ids) changes as a whole. A member changed differently on both sides is a conflict (both changed), reported by its path. - A record merged from both sides gets the revision
max(ours, theirs) + 1. - The project record and the project information merge as one record each; the levels merge as a list by id, and a conflict in them is settled for the whole list; kept files merge file by file. A kept file of one side at a path that the other side's records or kept files need, as a file or as a folder (Part III, 7.4), or whose path folds to one with a path of the other side's (Part III, 4.3, and 7, rule 8), is a conflict (
in the way), reported with both sides' paths: the merged model could not be written as a folder otherwise. Of two kept files whose paths fold to one, the conflict is on the later in the order of their paths by UTF-16 code units, which a reader would leave alone. - A conflicted record keeps our side until a person chooses ours or theirs for it. A record settled by a choice, which both sides hold, keeps the chosen side's revision when that revision is the higher of the two, and otherwise gets
max(ours, theirs) + 1(rule 4): either way, no earlier read of either side's record names the settled one, so a command based on it is refused (Part V, 3). - The merged model MUST pass the whole-model check (Parts I and II) before it is accepted. A merge that leaves a host missing or a type deleted under its elements MUST be refused, naming the records, never applied silently.
Reference: mergeManifests, mergeObject, mergeKeyed and resolveMerge in src/core/versions/merge.ts; the store's restore checks the merged model whole.
6. Remotes, push and pull
A model's versions may be kept in more than one store: an application's own store and a repository on a host, two hosts, or a folder and a host. This section says how two stores of one model exchange versions, as git's remotes do: work stays local until it is pushed, and what others pushed is pulled and merged.
Sections 6.1 to 6.7 say what a fetch, a push, a pull and a clone do, not how objects and refs travel between two stores: up to 0.4, OpenEik defines no protocol between stores (Security and privacy, 1). The steward deferred such a protocol to a later version on 15 October 2026 (open questions, 28). 0.5 writes one, as the proposal storeProtocol of 0.4 did: section 6.8 is the protocol that @openeik/tools speaks, version 0, so that any store can serve it and any client speak it.
6.1 Remotes and tracking refs
- A remote is another store that holds a repository of the same model. The local side gives it a name (
origin). - A remote-tracking ref records, for one remote and one of its refs, the version last fetched from it or pushed to it:
{remote, ref, version, tree}, wheretreeis that version's root tree. A tracking ref MUST record the version and the tree. An implementation MAY add members: when, by whom, the repository. - Tracking refs are kept apart from the local refs (section 3): they are never written to the shared repository, and no version's tree holds them. Where an implementation keeps them is its own choice, except in a folder.
- A folder keeps its tracking refs in the hidden file
.eik/remotes.json,{"<remote>": {"url": …, "repo": …, "refs": {"<ref>": {"version": …, "tree": …}}}}, which is not part of the model or of any version's tree (Part III, 1, rule 1). A reader of.eik/remotes.jsonMUST keep the members it does not know (Part I, 10).
6.2 Fetch
A fetch of a remote ref reads every object reachable from the remote ref's version that the local store lacks (versions, trees, records and kept files: section 1), and then sets the tracking ref to that version and its tree. A fetch that is part of a pull sets the tracking ref only once the pull's result is recorded (6.4), so that a pull that stops at a conflict leaves the tracking ref, and with it the next pull's base, where it was. A fetch moves no local ref.
6.3 Push
A push sends a local line of work to a ref of a remote.
- By compare-and-swap from the tracked version. It moves the remote ref only by compare-and-swap (section 3, rule 3), from the version the tracking ref records (from none, for a ref the remote does not have yet). If the remote ref has moved since, nothing is written on the remote: the pusher pulls first (6.4), and pushes again.
- A published version is never rewritten. The pushed version MUST descend from the tracked remote version: that version is in its history, through its parents. So the remote ref only moves forward, and no version the remote holds is rewritten or dropped. A squashed version (rule 3) has the tracked remote version as its first and only parent.
- Automatic versions stay local. A version of kind
autoMUST NOT be pushed to a shared ref. A tool MAY squash its local versions that are not on the remote into one version of kindnamed, with the push's message as itsname, whose tree is the newest local tree and whose only parent is the tracked remote version: no other kind of version is needed. It MUST NOT squash a version that is on the remote already. - The pushed version's
summarycovers every change since the tracked remote version. - Only the objects the remote lacks are sent.
- A push MUST NOT drop the members of records that the pusher does not know, nor kept files it did not change (Part I, 10; Part III, 7): the pushed tree holds them as the local one does.
6.4 Pull
- A pull fetches the remote ref (6.2), then merges the remote version into the local version (section 5). The base is the version the tracking ref recorded before this pull: the remote version the local line last took in or sent out. Only where none is tracked is the base the newest version both lines have, found from their parents. The tracked version, not a version found from the parents, is the base because a line that squashed its pushes (6.3, rule 3) does not hold the version it pushed, and an ancestor found from the parents would count that push's changes twice. The pull checks the result whole (section 5, rule 7) and records a merge version whose parents are the local version and the remote version, in that order. Conflicts are settled as in any merge (section 5, rule 6).
- When the local line holds the tracked remote version itself and has no version of its own after it, a pull MAY move the local ref to the remote version (a fast-forward) instead of recording a merge version. A line that squashed its pushes does not hold the remote version, so its pull records a merge version even when nothing local changed.
- A folder that keeps no history of its own pulls by merging the remote version into its current files, with the tracked version as the base, writing the result as a writer does (Part III, 13), and then setting its tracking ref to the remote version. When its files still hold the tracked version's tree, it writes the remote version as it is (a fast-forward).
- Kept files merge file by file (section 5, rule 5). A kept file that the remote line removed, and the local line did not change, is removed by the pull: the removal was made by the application that owns the file (Part III, 7.3), and keeping it would bring it back with the next push. Files a reader leaves alone (Part III, 7, rules 2 and 8) are never touched.
6.5 Clone
A clone fetches the refs asked for from a remote, main when none is named (6.2), sets each local ref to its version, and records a tracking ref for each ref it fetched and for no other (6.1). A clone into a folder fetches one ref, since a folder holds one version (Part III). A store or an application that keeps several refs MAY clone every ref of the remote.
Reference: clone in this repository's packages/openeik/src/remote.js clones one ref into a folder, main by default. Stomra 500 (live since 14 October 2026, main cd7173c9) clones main, a single-ref clone, into a new project connected to the repository as its remote.
6.6 Which versions are shared
Versions of kind start, named, merge, restore and alternative belong in a shared history. Versions of kind auto stay local (6.3, rule 3).
Reference: Stomra 495 (live since 14 October 2026, main a7b7b13b) pushes and pulls one remote ref, and keeps its tracking ref in the project's settings, with the repository, the version and the tree, and when and by whom it was set. It does not clone yet.
6.7 The formats a store reads
Part of 0.4. OpenEik 0.3 had it as the proposal storeFormats (open questions, 128): what it asks is a store's, of every version it reads.
A store says which versions of OpenEik it reads, and refuses a version it does not, so that a writer writes one the store can use. It defines no protocol between stores, which is deferred (open questions, 28): how a request asks for what it states, and how a refusal travels, is the store API's. From 0.5, section 6.8 says both: a store states reads in its answers to GET <base>/v0 and to a repository's (6.8.4, rules 1 and 2), and refuses a move of a ref with 409 format-unread (6.8.5, rule 4).
- What it states. A store that reads the models it holds, that draws, checks, reviews or merges them, states the formats it reads,
reads, a list ofopeneik/<major>.<minor>, among what it tells of itself; and MAY state them among what it tells of each repository, which then repeats the store's or names fewer. A pre-release,openeik/0.3-draft, is read as its version,openeik/0.3. - What it refuses. It MUST refuse a pushed version whose format is not one of
readsbefore it moves a ref (section 6.3, rule 1), with the codeformat-unread, naming the format it found,version, andreads. A version's format is its tree'seik.json's (Part I, 9.2); a tree with none is read asopeneik/0.1-draft(Part I, 9.2, rule 5). - What a writer does. A writer that writes more than one version MAY write the newest that it writes and the store reads. Since a store states
readsof itself, a writer learns it before it makes a repository, and makes none the store cannot read.
Reference: none in the reference implementation. The host EikHub states reads of itself and of each repository, and refuses with format-unread, since 1 November 2026. In @openeik/tools: storeReads, readsOfStore, newestShared, notThere and a connected store's storeInfo in packages/openeik/src/store.js and versions.js; a refusal reaches its caller as the error store-format-unread, its version and reads with it.
6.8 The store protocol
Part of 0.5. OpenEik 0.4 had it as the proposal storeProtocol (open questions, 28): what it asks is a store's and a client's, whatever version of OpenEik the store reads. It adds nothing to a model, and a validator checks nothing of it: its rules bind a store that serves the protocol and a client that speaks it.
Sections 6.1 to 6.7 say what a fetch, a push, a pull and a clone do. This section says how they travel: the calls over HTTP by which a client reads and writes a repository's refs, objects, settings and assets' bytes in a store, version 0 of the protocol, v0. Any store can serve it and any client can speak it, so that a client that speaks it works with every store that serves it.
A store here is a version store that serves the protocol at a base URL, and keeps repositories, each the versions of one model (6.1, rule 1). A client is an implementation that makes its calls: a version store that fetches from, pushes to, pulls from or clones a remote, a reader of versions, or an application. Who may read and write a repository, how a person signs in, how a credential is issued, and how a repository is made and shared are each store's own (Security and privacy, 1, rule 3): the protocol carries a credential, and says what a store answers without one, and nothing more.
In what follows, {repo} stands for a repository's path, <base>/v0/repos/{owner}/{name}. The schemas of each call's body and answer, and of every refusal, are in schemas/0.5/storeProtocol/, and schemas/0.5/index.json's rules names them by call.
| Call | Body | Answer | Section |
|---|---|---|---|
GET <base>/v0 | {ok, api, reads?} | 6.8.4 | |
GET {repo} | {ok, repo: {owner, name, visibility?, source?, reads?}, limits} | 6.8.4 | |
GET {repo}/refs | {ok, refs: [{name, hash}]} | 6.8.5 | |
GET {repo}/refs/{name} | {ok, hash}, null where the ref names no version | 6.8.5 | |
POST {repo}/refs/{name} | {hash, expected} | {ok, moved, current}: a compare-and-swap | 6.8.5 |
POST {repo}/objects/has | {hashes} | {ok, present} | 6.8.6 |
POST {repo}/objects/get | {hashes} | {ok, objects: {<hash>: <text>}} | 6.8.6 |
POST {repo}/objects/put | {objects: {<hash>: <text>}} | {ok, stored} | 6.8.6 |
POST {repo}/objects/{hash}/uploads | {} | 201 {ok, upload, partSize, most?} | 6.8.7 |
PUT {repo}/objects/{hash}/uploads/{upload}/{n} | part n's bytes | {ok, part, etag} | 6.8.7 |
POST {repo}/objects/{hash}/uploads/{upload} | {parts: [{part, etag}]} | {ok, stored} | 6.8.7 |
DELETE {repo}/objects/{hash}/uploads/{upload} | {ok} | 6.8.7 | |
POST {repo}/log | {heads, limit} | {ok, objects: {<hash>: <text>}} | 6.8.8 |
GET {repo}/meta/{key} | {ok, value} | 6.8.9 | |
PUT {repo}/meta/{key} | {value} | {ok} | 6.8.9 |
POST {repo}/assets/has | {hashes} | {ok, present, withheld} | 6.8.10 |
PUT {repo}/assets/{sha256} | the asset's bytes | 200 or 201 {ok, stored} | 6.8.10 |
GET {repo}/assets/{sha256} | the asset's bytes | 6.8.10 |
6.8.1 Calls and answers
- The base and the paths. A store is reached at a base URL,
https, or plainhttpto a loopback address only (6.8.3, rule 5), with no user information, query or fragment (6.8.3, rule 1). Each call's path is the base's path followed by the path the table gives:<base>/v0for the store, and{repo}and the paths under it for a repository. A client takes any/that ends a base away. - Names in a path. A repository is named
owner/name, two names; a ref by its name (section 3, rule 3), each segment of the name a segment of the path; a setting by its key, one segment; an object by its hash, an asset by its SHA-256, and an upload by the id its store gave it. A client MUST percent-encode each segment (RFC 3986, 2.1), and MUST NOT make a call whose names have a segment that is empty, is.or.., or holds/,\or NUL: a URL resolves dot segments, so that such a name would reach another call, with the credential. A store MUST read a ref's name alike whether its/comes as a separator of segments or percent-encoded (alternatives%2Fsouth-wing). - Bodies. A call's body, where it has one, is a JSON object in UTF-8 (RFC 8259), sent as
application/json; but the bytes of a part of an object (6.8.7) and of an asset (6.8.10), which are sent as they are, asapplication/octet-stream. - Answers. A store answers every call with a JSON object in UTF-8,
application/json, but a read of an asset's bytes that it answers with them: on success{"ok": true, …}, with the call's members and the status 200, or 201 where the table says so; on refusal{"ok": false, "error": {"code", "message", "details"?}}, with a status of 400 or more (6.8.2). - What a client takes as an answer. A client MUST take as a refusal an answer whose status is not one of 2xx, or whose body is not a JSON object with
oktrue. It MUST refuse an answer whose bytes are not UTF-8, and never read them with a replacement character in their place (Part III, 5, rule 1, and 12): the objects an answer carries are a model's files. - Members not known. A client MUST ignore an answer's members that it does not know, and a store a body's, so that a later version of the protocol can add members. Neither gives a member this section names another meaning.
- A store's own calls. A store MAY answer calls of its own, under a prefix of its own: to make a repository, for people, sign-in, reviews and the like. It MUST NOT give a path this section names another meaning. A client MUST NOT need a call this section does not name to fetch, push, pull or clone; a later version of the protocol names its calls under a version of its own (
v1).
6.8.2 Refusals
Status and code. A refusal's
codenames it, itsmessagesays it to a person, and itsdetails, an object where the store gives them, say more. A store MUST answer each refusal the table names with the table's status, and SHOULD give the table's code; it MUST givehash_mismatchto an upload whose whole does not hash to its name (6.8.7, rule 4), andasset-missingandformat-unread, with theirdetails, to a move of a ref (6.8.5, rule 4), since a client acts on them. A client reads a refusal by its status, and by its code where this rule makes the code a MUST.Status Code When 400 bad_requesta body that is not JSON, or a member missing or of another form; a log's limitout of range (6.8.8, rule 2)400 bad_namea name that is no repository's, ref's or key's a store writes (6.8.5, rule 5) 400 bad_hasha hash that is not 64 lowercase hexadecimal digits 400 hash_mismatchan object whose text, or an upload whose bytes, do not hash to its name (6.8.6, rule 5; 6.8.7, rule 4) 400 utf8_invalidan object's text that is no well-formed Unicode, or an upload's bytes that are no UTF-8 400 not_canonicalan object's text that is not the canonical form of its value (6.8.6, rule 5) 400 nulan upload's text that holds U+0000, which no canonical form holds (6.8.7, rule 4) 400 commita commit sent in parts (6.8.7, rule 4) 400 bad_part,bad_partsa part of no bytes, or numbered out of range; a completion's parts that are not every part, in order, as answered (6.8.7) 400 ref_reserveda move of a reserved ref (6.8.5, rule 5) 400 asset-hashan asset's bytes that do not hash to its SHA-256 (6.8.10, rule 2) 401 unauthorizedno credential where one is needed, or one the store does not accept (6.8.3) 403 forbiddena credential that may read the repository and not do what it asks 404 not_foundno such repository, or one the caller may not read (6.8.3, rule 4); no such call 404 upload_missingan upload that is not open (6.8.7) 404 asset-missingan asset whose bytes the store does not hold (6.8.10, rule 3) 405 method_not_alloweda path this section names, with another method 409 missing_objecta move of a ref to a version the store does not hold (6.8.5, rule 4) 409 asset-missinga move of a ref to a version that names an asset whose bytes the store neither holds nor has withheld, details.assetseach{sha256, path, bytes}(6.8.5, rule 4; Part XV, 5, rule 2)409 format-unreada move of a ref to a version of a format the store does not read, details{version, reads}(6.8.5, rule 4; section 6.7, rule 2)410 asset-withheldan asset the store has withheld (6.8.10; Part XV, 7) 413 too_largea call over a limit (6.8.11), a part larger than its upload's partSize, a whole larger than its upload'smost413 asset-too-largean asset larger than the store takes (6.8.10, rule 2) 429 the store's too many calls: a client MAY call again later 500, 503 internal,unavailablethe store's own trouble Their form. The codes are written as the stores of version 0 write them, some with
_and some with-: changing one would break a client that reads it. A later version of the protocol may give them one form.Codes of a store's own. A store MAY answer a refusal the table does not name with a code of its own and a fitting status. A client MUST NOT read a refusal it does not know as a success, nor a code it does not know as one it knows.
The message is text. A
messageand thedetailsare what the store says: a client shows them as text, and never evaluates them or shows them as markup (Security and privacy, 11).
6.8.3 Credentials
- A bearer token, in its header. A client sends a credential as a bearer token in the
Authorizationheader,Authorization: Bearer <token>(RFC 6750, 2.1), and in no other way: never in a URL, its user information, its query or its fragment, and never in a body. A URL is written into histories and logs, and travels in links. A store MUST NOT take a credential from a URL's query (RFC 6750, 2.3) or from a body. - Without one. A call without a credential is anonymous. A store MAY answer an anonymous call that reads a repository it lets anyone read, a public one; it answers its own
GET <base>/v0to anyone (6.8.4, rule 1). It MUST refuse an anonymous call that writes, with 401, or with 404 where the repository is one the caller may not read (rule 4). - One it does not accept. A store MUST answer 401 to a call whose credential it does not accept, an
Authorizationheader that is no bearer token among them, even where it would answer the call made anonymously: a caller that sends a credential means to be someone, and learns that the credential failed. - What the caller may not read. A store SHOULD answer a call about a repository that the caller may not read as it answers one that is not there, 404
not_found, so that its name does not show (Security and privacy, 9, rule 5); and a call that the caller may read the repository but not make, 403. - Only over TLS. A client MUST NOT send a credential other than over
https, with the store's certificate validated, except to a loopback address of its own computer:localhost, 127.0.0.0/8 or[::1](Security and privacy, 9, rule 2). It refuses such a base before it sends anything. - Only to the store it is for. A client MUST NOT send a credential to a store the person does not trust: to a base that it did not get from the person or record itself, or that changed since it last sent the credential there, without the person's confirmation (Security and privacy, 9, rule 1). A base that comes with a folder, in its
.eik/remotes.json(6.1, rule 4), in a link (section 8.1.1, rule 3), or in a store's answer, is not one the person gave. A client SHOULD bind each credential to the origin it was issued for, its scheme, host and port, and MUST then send it to no other origin: it refuses a base of another origin before it sends anything. - No redirect. A store answers each call itself, never by a redirect (3xx). A client MUST NOT send a credential on to another origin when a call is redirected.
- What a credential may do is the store's to say: who may read a repository, push to a ref or settle a review, and for how long. A store that keeps several repositories answers for each only to a caller who may read it, about its objects (Security and privacy, 9, rule 5) and its assets (Part XV, 5, rule 4).
6.8.4 The store and its repositories
- The store. A store MUST answer
GET <base>/v0, to anyone and without a credential, with what it tells of itself:{ok: true, api: "v0", reads?},apithe version of the protocol it serves andreads, where it states them, the formats it reads (section 6.7, rule 1). It MAY answerGET <base>/alike, and MAY add members of its own, a name for itself among them. A client reads<base>/v0, and reads a 404 there as a store that tells nothing of itself: a store written before this section may answer so. - A repository.
GET {repo}answers{ok: true, repo, limits}.repoholds the repository'sownerandname; itsvisibilitywhere the store says,publicwhere anyone may read it; itssource(rule 3); and itsreads, the formats the store reads for it, which repeat the store's or name fewer (section 6.7, rule 1).limitssays what the store takes of the repository (6.8.11, rule 1). A repository that is not there, or that the caller may not read, is 404 (6.8.3, rule 4). - A repository of an authoring application. A store MAY say that a repository belongs to the project of an authoring application: its
sourceis then an object whosekindnames the application, and otherwisenullor none. Its main line is that application's: a client SHOULD NOT push to itsmainunless it is that application or the person asks it to, and pushes an alternative instead (section 8.7, rule 5), which a person merges.
6.8.5 Refs
- Every ref.
GET {repo}/refsanswers{ok: true, refs}: each ref of the repository that names a version,{name, hash}, in any order. - One ref.
GET {repo}/refs/{name}answers{ok: true, hash}: the version the ref names, ornullwhere it names none. A ref that names no version is no refusal. - The compare-and-swap.
POST {repo}/refs/{name}with{hash, expected}, each a version's id ornull, moves the ref, and answers{ok: true, moved, current}. A store MUST move the ref tohashonly where it namesexpectedwhen it moves it,nullmeaning no version, and nothing may move the ref between its comparison and its move (section 3, rule 3): it then answersmovedtrueandcurrenthash. Where the ref names another version, it MUST move nothing, and answersmovedfalseandcurrentthe version the ref names, ornull, with the status 200: the call was answered as asked. Ahashofnullremoves the ref. A body without both members is refused (400bad_request). - What a ref moves to. A store MUST refuse to move a ref to a version it does not hold (409
missing_object); to one that names an asset whose bytes it neither holds at the pointer's length nor has withheld (409asset-missing, Part XV, 5, rule 2); and, where it statesreads, to one whose format is not one of them (409format-unread, section 6.7, rule 2). A client sends every object of a version, and every asset's bytes, that the store lacks before it moves a ref to it (6.3, rule 5; Part XV, 6, rule 1), so that a ref never names a version the store does not hold whole. - The refs a store writes. A store MUST take a move of
mainand ofalternatives/<slug>,<slug>1 to 80 of the lettersatoz, digits and-, not starting with-; a client writes no other. The names underproposals/,agent/,shares/andreleases/are reserved: a read of one answersnull, and a move of one is refused (400ref_reserved). A store refuses any other name it does not write (400bad_name). - A client's move. A client moves a ref only from the version it read (6.3, rule 1). Where the answer is
movedfalse, nothing moved: the client readscurrent, pulls (6.4) and pushes again, and MUST NOT move the ref fromcurrentwithout having merged whatcurrentholds.
For example, a push whose ref moved meanwhile (the hashes cut short here):
POST /v0/repos/example-owner/terrace-house/refs/main
Authorization: Bearer …
Content-Type: application/json
{"expected":"4b7e…","hash":"9f2c…"}
200 {"ok":true,"moved":false,"current":"a1d0…"}
6.8.6 Objects
- Which it holds.
POST {repo}/objects/haswith{hashes}answers{ok: true, present}: those of the hashes whose objects the store holds. - Reading.
POST {repo}/objects/getwith{hashes}answers{ok: true, objects}: each object the store holds of those asked for,{<hash>: <text>}, its text exactly as the store took it; those it lacks are left out. - Checked as they enter a client. A client MUST check each object an answer gives as it enters, as Security and privacy, 5.3, rule 1 says, whatever the store checked: that its text hashes to its name, and that it is the canonical form of the JSON it parses to (Part III, 6). It SHOULD refuse, before it parses it, a text longer than any file it reads takes as an object (Security and privacy, 7.2): for a file of 64 MiB, 6 × 64 MiB + 2 characters, the longest canonical JSON string of 64 MiB. It refuses a version that holds an object that fails, naming the object.
- Writing.
POST {repo}/objects/putwith{objects},{<hash>: <text>}, stores each object and answers{ok: true, stored}, the number of objects the call carried, each of which the store holds now. Storing an object the store holds already changes nothing. - Checked as they enter a store. A store MUST check each text of a put against its name, the SHA-256 of its UTF-8 bytes as 64 lowercase hexadecimal digits (section 1, rule 1): one that fails refuses the whole call, and no object of it is stored (400
hash_mismatch). It MUST refuse a text that is no well-formed Unicode, holding a lone surrogate, which has no UTF-8 (400utf8_invalid). It SHOULD refuse a text that is not the canonical form of the JSON it parses to (400not_canonical): a store that checks it holds only objects that Security and privacy, 5.3, rule 1 lets in, and one that does not holds what every client checks as it reads it (rule 3). - A commit is an object whose text starts with
{"commit":. A store may read a commit's parents as it takes it, for the log (6.8.8), so a commit goes byobjects/put, never in parts.
6.8.7 Large objects, in parts
A store MAY take an object larger than one put carries in parts, as an upload. It says so in a repository's limits (6.8.11, rule 1); a store that takes no uploads answers their calls 404.
- Opening an upload.
POST {repo}/objects/{hash}/uploadswith{}opens an upload of the object{hash}, to a caller who may write the repository, and answers 201{ok: true, upload, partSize, most?}: the upload's id, the size in bytes of each part but the last, and, where the store says, the most bytes the upload takes. - A part.
PUT {repo}/objects/{hash}/uploads/{upload}/{n}with partn's bytes answers{ok: true, part, etag}:partisn, andetaga text that names the bytes the store took. Parts are numbered from 1 to at most 10 000, each holds at least one byte and at mostpartSize, and a part sent again replaces it. A store refuses a part of no bytes or numbered out of range (400bad_part), one larger thanpartSize(413too_large), and one of an upload that is not open (404upload_missing). - What a client sends. A client sends the object's UTF-8, each part the next slice of it, each but the last exactly
partSizebytes. It MUST check that the upload's id is one segment of a path (6.8.1, rule 2) before it puts it into a path with its credential, and sends nothing more where it is not. - Completing it.
POST {repo}/objects/{hash}/uploads/{upload}with{parts}, every part from 1 in order with theetagits answer gave, completes the upload. The store puts the parts together and checks the whole as it checks a put's text (6.8.6, rule 5): that it hashes to{hash}(400hash_mismatch), that it is UTF-8 (400utf8_invalid), that it holds no U+0000 (400nul), that it is no commit (400commit), and that it is at mostmostbytes (413too_large); then it stores it and answers{ok: true, stored: 1}. A list that is not every part in order, as answered, is refused (400bad_parts). A store that refuses the whole lets the upload go, and a client then opens another to try again. - Aborting it.
DELETE {repo}/objects/{hash}/uploads/{upload}lets the upload and its parts go, and answers{ok: true}; an upload that is not open is 404 (upload_missing). A client aborts an upload that failed, whatever the abort answers. A store lets an upload that is never completed go, in its own time. - What a client sends so. A client sends an object in parts where its UTF-8 is larger than the repository's
putObjectBytesand the store takes uploads (6.8.11, rule 1). It MUST NOT send a commit in parts, nor an object larger thanobjectBytesor an upload'smost, nor one that would take more than 10 000 parts: it refuses such an object before it sends it. Reading needs none of this:objects/getgives a large object whole.
6.8.8 The log
- The history.
POST {repo}/logwith{heads, limit}answers{ok: true, objects}: the commits reachable fromheadsthrough theirparents,{<hash>: <text>}, at mostlimitof them. A store walks them breadth-first from the heads, each once, and writes them nearest first, so that alimitkeeps the nearest. A head or a parent that the store does not hold, or that is no commit, is left out. - Its bounds.
limitis a whole number from 0 to 20 000, and a store refuses another (400bad_request);headsholds at most 1000 hashes (6.8.11, rule 2). - What a client does. A client checks each commit as an object (6.8.6, rule 3). A JSON object's members have no order (RFC 8259, 4), so a client that needs the commits' order SHOULD work it out from their parents; it reads a longer history by asking again from the parents of the oldest it has.
6.8.9 Settings
- A setting.
GET {repo}/meta/{key}answers{ok: true, value}: a small setting of the repository, any JSON value, andnullwhere the key has none.PUT {repo}/meta/{key}with{value}sets it,{value: null}removes it, and it answers{ok: true}. Reading one needs the right to read the repository, and writing one the right to write it. - Outside every version. A setting is the repository's, and no version holds it: a store keeps no history of it, and a fetch, a push, a pull or a clone carries none. A key is one segment (6.8.1, rule 2); a client SHOULD keep to 1 to 200 of the letters
AtoZandatoz, digits,:,.,_and-, which every store takes, and a store MAY refuse another (400bad_name). A store MAY refuse a value larger than it keeps (413too_large).
6.8.10 Assets
A store that keeps the bytes of assets beside its objects (Part XV, 5) answers three calls more; one that keeps none answers them 404.
- Which it holds.
POST {repo}/assets/haswith{hashes}, SHA-256 digests, answers{ok: true, present, withheld}: those whose bytes the store holds for the repository, and those it has withheld (Part XV, 7). It answers for the repository alone, and MAY answer only a caller who may push to it (Part XV, 5, rule 4). - Writing.
PUT {repo}/assets/{sha256}with the asset's bytes stores them, and answers{ok: true, stored: true}, 201 where the bytes are new and 200 where the store held them. A store MUST refuse bytes that do not hash to{sha256}(400asset-hash), more bytes than it takes (413asset-too-large), and a digest it has withheld (410asset-withheld). It checks their length against the pointers that name them when a ref moves to a version (6.8.5, rule 4; Part XV, 5, rules 1 and 2). - Reading.
GET {repo}/assets/{sha256}answers the bytes, to a caller who may read the repository, asapplication/octet-stream, withContent-Disposition: attachmentandX-Content-Type-Options: nosniff, so that no browser shows them as a page. A store refuses with 404asset-missingwhere it lacks them, and 410asset-withheldwhere it has let them go (Part XV, 5, rule 3; 7); it never answers with other bytes. - What a client does. A client sends the bytes the store lacks before the objects and the ref (Part XV, 6, rule 1), and checks each asset it reads against the pointer that names it, its SHA-256 and its length, before it writes anything (Part XV, 5, rule 1; 6, rule 3).
6.8.11 Limits and batches
What a repository takes. A repository's
limitsis an object whose members, each a whole number of bytes greater than 0, say what the store takes of it; a store MAY leave any of them out:assetBytes: the most bytes of one asset, at most 64 MiB (Part XV, 4). Where it is not given, a client takes 64 MiB.putObjectBytes: the most UTF-8 bytes of one object's text that oneobjects/putcarries. Where it is not given, 40 MiB.objectBytes: the most UTF-8 bytes of an object, sent in parts where it is larger thanputObjectBytes. A client takes it as no more than 6 × 64 MiB + 2, the longest object a file of 64 MiB makes (6.8.6, rule 3).uploadPart: the size of an upload's parts.
A store that gives
uploadPart, or anobjectByteslarger thanputObjectBytes, takes objects in parts (6.8.7). A store that gives none of them takes objects of up to 40 MiB in one put, and none larger.What every store takes. Every store MUST take calls up to these sizes, and a client makes none larger:
Call At most objects/get400 hashes objects/has,assets/has1000 hashes objects/putof several objectsa body of 4 MiB objects/putof one objectits text of putObjectBytes, its body as JSON writes itlog1000 heads, and a limitof 20 000A store MAY take more. One that refuses a call over a size it takes answers 413
too_large.Batches. A client asks about more hashes than a call takes in several calls, each of at most the limit. It puts objects in batches whose bodies stay under the limit, and an object whose body alone reaches it in a call of its own;
@openeik/toolskeeps each batch under 2 MiB, half the limit (LIMITS). The protocol has no pages:refsanswers every ref, and a client reads a longer log by asking again (6.8.8, rule 3).
6.8.12 Fetch, push, pull and clone
- A fetch (6.2) reads the remote ref (
GET {repo}/refs/{name}), then its commit and its trees a level at a time byobjects/get, through shards (section 2, rule 3), never asking for an object it holds already, and checks each as it enters (6.8.6, rule 3). - A push (6.3) reads the repository (
GET {repo}: its limits and itssource) and the remote ref, which MUST be the tracked version (6.3, rule 1); asks which of the version's objects the store holds (objects/has); sends the bytes of the assets the store lacks (assets/has,PUT {repo}/assets/{sha256}); puts the objects the store lacks, a large one in parts; puts the commit; and moves the ref by compare-and-swap from the tracked version (6.8.5, rules 3 and 6). Until the last call, nothing a reader sees has changed: objects and bytes name nothing until a ref names them. - A pull (6.4) is a fetch, and a merge of what it read, which is the client's: it makes no call more.
- A clone (6.5) reads the refs it fetches (
GET {repo}/refs, orGET {repo}/refs/{name}for each), and fetches each. A clone or a pull into a folder reads the bytes of every asset of the version it writes (GET {repo}/assets/{sha256}; Part XV, 6, rule 3).
6.8.13 Conformance
- A store that claims the protocol answers each call of sections 6.8.4 to 6.8.10 as they say, and meets sections 6.8.1 to 6.8.3 and 6.8.11 in each answer; it may answer the calls of 6.8.7 and of 6.8.10 with 404 where it takes no uploads or keeps no assets' bytes.
- A client that claims it makes only the calls this section names, as it says them, and meets 6.8.1, rules 2 and 5; 6.8.3, rules 1 and 5 to 7; 6.8.6, rule 3; 6.8.7, rules 3 and 6; and 6.8.11, rule 2.
- The runner.
tools/run-conformance-store-protocol.mjsdrives a store's base URL through the protocol's calls, with a credential that may write a repository the store keeps, and checks each answer against the schemas and against the rules of this section, each check naming its rule and whether it is a MUST, a SHOULD or a MAY. It writes only objects of its own, refs underalternatives/protocol-check-and a setting of its own, and removes the refs and the setting when it is done. No class requires it while the protocol is proposed; a store MAY state that it passes it.
Reference: the reference implementation is a client: it keeps the versions of its shared projects in a store of this protocol (src/versions/). In @openeik/tools: connectStore, its calls, and LIMITS, checkObject, notThere and readsOfStore in packages/openeik/src/store.js; sendAssets and fetchAssets in assets.js; clone, push, pull and fetchHead in remote.js. The store of the package's tests, packages/openeik/test/support/memory-api.mjs, serves the protocol in memory.
6.8.14 What a client checks
Part of 0.6. OpenEik 0.5 had it as the proposal storeClients (open questions, 148). It adds nothing to a model, and a validator checks nothing of it: its rules bind a client of the protocol, and one of them a store. A client applies it whatever the version of the models it reads and writes, since it binds a client and no model.
Sections 6.8.1 to 6.8.3 say what a client takes as an answer and where it sends a credential, and 6.8.13, rule 2 what a client that claims the protocol meets; 6.8.13, rule 3 drives a store through the protocol. Nothing ran a client against a store that answers otherwise than the protocol says: a redirect, a page of HTML with the status 200, a refusal's status with ok: true, bytes that are no UTF-8, an object that does not hash to its name, an answer without end. This section says three things more that a client checks, and how a client is run against such a store.
- No redirect at all. A client MUST take an answer of a status 3xx as a refusal, and follow no redirect, to another origin or to its own, with a credential or without. A store answers each call itself (6.8.3, rule 7): a redirect serves nothing, and one to the store's own origin can reach another call, with the credential, past the checks of 6.8.1, rule 2.
- The members it reads. A client MUST check that each member it reads of an answer has the form that the call's answer schema gives it (
schemas/0.6/storeProtocol/, named by call inschemas/0.6/index.json'srules), and take an answer whose member does not as a refusal, acting on nothing of it: amovedthat is no boolean, ahashor acurrentthat is neither a version's id nornull,refs,presentorwithheldthat is no list of the form its schema gives,objectsthat is no object of texts,repothat is no object. Amovedread as true where it is the text"false"would tell a writer that its push landed. A member it does not read it ignores (6.8.1, rule 6). - Answers bounded. A store MUST NOT answer a call with more than 16 MiB, but
objects/get,logand the read of an asset's bytes, whose answers carry objects and bytes. A client MUST bound the bytes it reads of each answer, and refuse one as soon as it passes its bound, reading no more of it: what a store sends is read into the client's memory before any check can be made, and a store that answers without end would hold it. Its bound MUST NOT refuse an answer that this section lets a store give: 16 MiB for a call of the first kind; forobjects/getandlog, what the objects asked for can be, each a text of at mostobjectBytes(6.8.11, rule 1) written as a JSON string, at most three times its bytes; and for an asset's bytes, the length its pointer gives (Part XV, 5, rule 1), or 64 MiB where it reads one it has no pointer of. - The harness.
tools/run-conformance-store-client.mjsruns a client, through an adapter that reads a ref's version whole and pushes a version, against a store on the same computer that keeps one repository of one version and misbehaves on purpose, a call at a time: a redirect to another origin and to its own, a page of HTML with the status 200,{"ok": false}with 200, the status 409 with{"ok": true}, bytes that are no UTF-8, an object that does not hash to its name, a version one of whose objects hashes to its name and is not its value's canonical form, a member of another form, and an answer of 64 MiB to a call that carries no object; and, once each, a store that behaves, which the client must read and push to. Each check names its rule and its level, and fails where the client takes the misbehaving answer as a success, or sends its credential to the other origin. No class requires it; a client MAY state that it passes it.
Reference: none in the reference implementation, which is a client of a store of its own (6.8.13, its reference). In @openeik/tools: storeTransport(options), the calls connectStore makes, which an application that makes a store's own calls too (6.8.1, rule 7) takes as they are: its credential a token or a function that gives the current one before each call, a store's own call's body sent as the type it takes (type), a segment that holds /, \ or NUL refused whether or not it is percent-encoded (bad-path; 6.8.1, rule 2), a redirect refused (store-redirect), each answer bounded (ANSWER_MOST, objectsAnswerMost; answer-too-large), and the members connectStore reads held to their form (store-answer), in packages/openeik/src/store.js; connectStore passes the harness's twelve checks.
7. Git and other hosts (informative)
A folder is plain files, so it can be kept in git or any other version control system and in any object store, and pushed, pulled and reviewed there. Git's push and pull move git's commits, by git's rules; section 6 is the push and pull of OpenEik's own versions. A text merge of two stored-form files is often correct, because each member is one line, but it does not know records: it can join two edits that are each valid into an invalid model, and it cannot merge a moved record. An implementation SHOULD merge with the rules of section 5 and check the result whole. No git merge driver is specified in 0.1.
Forks that remember their origin are planned and not specified. A host's proposals (changes offered for review, as pull requests are) come from an envelope in 0.2 (Part XVII, 6.3), and ownership by discipline folder is Part XVI's. Where no host offers proposals, an application offers its changes in a proposal file (section 8.7).
8. Applications' results and proposals
An application that works beside a model's author (a structural analysis, a daylight study, a quantity take-off, a supplier's tool) keeps its own work in the model's folder as kept files (Part III, 7): its own model of the building, the results it computes and the changes it proposes. It never writes them into the model's records. This section fixes where they go, the result manifest, which says what a set of results was computed from, and the proposal file, which offers changes to the records as commands. Kept with the model, they travel with it through every copy, version, restore and merge (sections 2 and 5).
From 0.6, and in a model of 0.5 with the proposals costSchedules and workSchedules, a model's cost and work schedules are the standard's own files, which every tool reads (Part XXII); an estimating or a planning application keeps here only what is its own, and never a project's rates or prices, which stay apart from the model (Part XXII, 4.3, rule 3).
8.1 The application's folder
An application keeps its files in a folder of its own at the top of the model's folder, with one model folder for each model of its own that it keeps there:
<application>/<model>/ the model folder: one model of the application's
<application>/<model>/source.json what the model was built from (8.4)
<application>/<model>/… the application's intent files: its model, settings, assumptions …
<application>/<model>/results/<run>/manifest.json a result set's manifest (8.2)
<application>/<model>/results/<run>/… the result set's files
<application>/<model>/proposals/<id>.json a proposal (8.7)
For example, an analysis whose prefix is acme keeps acme/frame-a/model.json, acme/frame-a/source.json, acme/frame-a/results/r-5d1c0e9a7b32/manifest.json with its results beside it, and acme/frame-a/proposals/p-header-deeper.json.
- An application MUST keep its result sets and its proposals in this layout: each result set in a run folder
results/<run>/of a model folder, with its manifest atresults/<run>/manifest.json, and each proposal atproposals/<id>.jsonof a model folder.<application>is the application's folder, which Part I, 11.3 says to name by its prefix (acme);<model>,<run>and<id>are its own ids as path segments (Part III, 2). As kept files, these files MUST NOT take a record's path or a folder a record needs (Part III, 7.4): an application's folder is never a discipline folder or a record list's folder. - The intent files of a model folder are its kept files outside its
results/andproposals/folders: what the application keeps of its own,source.jsonincluded. OpenEik does not define them, beyondsource.json(8.4). - Every file of an application's folder is a kept file only if it is UTF-8 text of at most 1 MiB at a path a kept file may have (Part III, 7, rules 1 and 8); any other file is left alone and is not part of the model (Part III, 7.2). An application SHOULD write its JSON files in the stored form (Part III, 5), one item per file, so that a change is a small diff and a merge goes file by file (section 5, rule 5).
- Results and intent files state their own units (Part III, 7.6).
8.1.1 Opening an application's folder
Part of 0.5. OpenEik 0.4 had it as the proposal appOpen (open questions, 135): what it asks is a host's and an application's, of a building of any version.
A host that shows a building's application folders can open one in its application, where the person gets a working copy of their own. It adds nothing to a model, and a validator checks nothing of it: its rules bind a host and an application. Where an application opens its folders is the registry's to say (Part I, 11.1): an entry of registry/extensions.json MAY carry open, an https URL with no query and no fragment, the endpoint at which the application opens one of its folders. The registry is not versioned, so an entry may carry open before 0.5.
What a host offers. A host that shows a building's application folders (section 8.1) MAY offer to open each in its application, where the registry's entry of the folder's prefix (Part I, 11.3) has an
openand is not withdrawn. It names the application by the entry'sregistrant. For a folder whose prefix has noopen, or is withdrawn, it offers none.The query. The host opens
openwith this query, each value percent-encoded asapplication/x-www-form-urlencoded:store: thehttpsbase URL of the API of the store that holds the building, with no user information, query or fragment;building: the building as that store names it,owner/name;version: the id of the version whose folder it opens (section 3), 64 lowercase hexadecimal digits;model: the name of the model folder under the prefix (section 8.1),frame-aforacme/frame-a/;run: optional, the run id of one of the model folder's result sets (section 8.5),r-and 12 lowercase hexadecimal digits.
No other parameter carries meaning.
The application treats every parameter as untrusted input. Anyone can write such a URL, so the application:
- reads the version with the person's own credentials, and MUST NOT send a credential or a token to a store it does not already trust: for a store it does not know, it refuses, or asks the person;
- SHOULD show the person the store and the building before it reads;
- reads only: it opens a working copy that is the person's own, and writes into the building only when the person publishes, as it would otherwise. The building holds only what is published;
- refuses with a message a
versionthat the store does not hold, amodelfolder that the version does not hold, and arunthat the model folder does not hold. It never guesses: it does not open the newest version, or another folder or run, in their place.
For example, a host opens the folder acme/frame-a/ of a version, and its result set r-2e13b39cbc7a, where the registry's entry of acme has "open": "https://acme.example/open" (the store, the building and the version are illustrative):
https://acme.example/open?store=https%3A%2F%2Fapi.store.example&building=example-owner%2Fterrace-house&version=4c8e0a1d3f5b7c9e2a4d6f8b0c1e3a5d7d1e9f3b2c4a6e8d0f1b3c5e7a9d2f4b&model=frame-a&run=r-2e13b39cbc7a
Reference: none in the reference implementation. In @openeik/tools: REGISTRY, the registry as the package was built with it, registration(prefix) and openUrl(entry, {store, building, version, model, run}), which checks each value and gives the URL of rule 2 (@openeik/tools/registry).
8.2 The result manifest
A result set is the files of one run folder: its manifest and the results themselves, in a form the application chooses. The manifest is a JSON object (schema applications/result-manifest.schema.json):
| Member | Meaning |
|---|---|
format | "openeik-result/0.1" |
kind | what the results are, in the application's words: structural-analysis, daylight, quantities … |
app | the application that made them: {name, version} |
computedFrom | what they were computed from: {version, versionKind, inputs, model, upstream} (below) |
engine | optional: what else decides the results, in the application's terms (a kernel, a code pack and its edition) |
made | {at, by}: when they were made, as an ISO 8601 date and time with seconds and an offset (2026-10-11T18:20:00Z), and by whom: the id or email of the person who made them, not only a display name. A run that no person started, as an application or an agent makes one unattended, names that application or agent instead, by an id of its own |
summary | optional: the few values a reviewer looks at first, in the application's terms |
The members of computedFrom:
| Member | Meaning |
|---|---|
version | the version of the model that was read: a version's id (section 3; versionKind "openeik"), a git commit's id ("git"), or null for a folder that is under no version control. It is the version before the results were saved: the version that saves them is a child of it |
versionKind | "openeik" or "git"; null exactly when version is null |
inputs | {count, digest}: how many records the application read, and their digest (8.3) |
model | the digest of the model folder's intent files (8.3). Its source.json is one of them (8.4, rule 1), so a writer always has a digest to write. null says that the folder had no intent files, and so no source.json: a reader reads it, and never calls those results current (8.4, rule 3) |
upstream | null on a model's main line. On a fork or an alternative (a simplified model on a line of its own): {repository, ref, version}, where the line started: the repository (a URL or owner/name; null for the same repository), the ref it started from (main) and that ref's version when it did |
- A writer MUST write
formatasopeneik-result/0.1. A reader MUST readopeneik-result/0.1-proposalas the same format: manifests written before 14 October 2026 carry that id. A manifest of any otherformatis not one this version defines, and a reader MUST NOT say whether its results are current. format,kind,app,madeandcomputedFrom, with all five of its members, are required.engineandsummaryare the application's; OpenEik does not define their members. A reader ignores members it does not know. An application's own data goes inengineandsummary, and in the other objects of the manifest only as extension members (Part I, 11.2, rules 1 and 8).- A result set on a fork or an alternative names a version of that line in
computedFrom.version, and the version of the line it started from inupstream. When the line is merged back, its result sets come along, and theirupstreamstill says on which line they were computed.
Example (engine, made and summary as an analysis might give them; the hashes are illustrative):
{
"app": {"name": "an-analysis-app", "version": "0.5.0"},
"computedFrom": {
"inputs": {"count": 41, "digest": "3b0f6c2e9d41a8f07e2c5b19d6a4f0c8e7b3a2d1c9f8e7d6c5b4a3f2e1d0c9b8"},
"model": "a41e0c7d5b3f2e1d9c8b7a6f5e4d3c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d",
"upstream": null,
"version": "7d1e9f3b2c4a6e8d0f1b3c5e7a9d2f4b6c8e0a1d3f5b7c9e2a4d6f8b0c1e3a5d",
"versionKind": "openeik"
},
"engine": {"kernel": "an-analysis-app 0.5.0"},
"format": "openeik-result/0.1",
"kind": "structural-analysis",
"made": {"at": "2026-10-11T18:20:00Z", "by": "jane@example.com"},
"summary": {"maxUtilisation": 1.08}
}
8.2.1 A result set's reports
Part of 0.5. OpenEik 0.4 had it as the proposal reports (open questions, 133): a model of 0.4, read by 0.4's rules (Part I, 9.6, rule 3), is read by it only where a caller asks for it (decision D12).
A result manifest names the reports printed of its result set, so that a report is kept with the results it prints and the version they were computed from, and the asset that holds it is used.
- What a report is. A report is a print of a result set, for people to read, such as a report PDF. It is not the results: they are the result set's own files (section 8.2), and nothing is read back from a report. A result manifest MAY carry
reports, 1 to 20 entries{asset, title?}, each a report of its result set, kept as an asset (Part XV). - Its asset.
assetis an asset's path,assets/<sha256>.<ext>, the form in which Part XIV names an unlinked drawing'sfile.asset(Part XV, section 8, rule 1), and the asset MUST be in the model (Part XV, section 8, rule 2; 8.1). A validator MUST report anassetthat is no asset's path, such as a bare digest, as an error (report-asset), and one whose asset the model does not hold as an error (report-missing). An entry names no media type: the asset's is its extension's, by Part XV, section 4's table of kinds. - Its title.
title, where it is given, is text of 1 to 200 characters that names the report for people, such asEnergy balance, issue A. Nothing is decided by it. - The format stays. A manifest that carries
reportsis of the formatopeneik-result/0.1: a reader of a model of 0.4 that does not apply the proposal ignores the member, as rule 2 of section 8.2 has it, and a validator of one warns of a member it does not know (Part I, 10). Nor is the report a rendition to it: Part XIV, 15.2, rule 1 binds a rendition, and a PDF that a kept file names by its path is an application's asset, which Part XV, 8 governs. A version that holds a report is valid to a validator of 0.4 with or without the proposal.
For example, the manifest of section 8.2 with the report its application printed of the results:
"reports": [
{"asset": "assets/9c1f0e8d7b6a5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d.pdf", "title": "Frame A, utilisation"}
]
Reference: none in the reference implementation. In @openeik/tools: the validator holds reports to schemas/0.5/reports/reports.schema.json, which the result manifest's schema of 0.5 names, counts each asset it names as used, and reports report-asset and report-missing; for a model of 0.5, and asked for with proposals: ["reports"] on a model of 0.4.
8.3 Digests
A digest names a set of files by their content, so that it is the same on a disk, in git and in any store:
- Each file gives one pair
[path, hash]: its leaf's path in a version's tree (section 2) and the hash of its object (section 1). For a record, that is its path without.json(architecture/level-0/wall/wall-south,project/levels) and the SHA-256 of its canonical JSON (Part III, 6); a view's pair is itsview.json's, without its detail chunks. For a kept file, it is its own path (acme/frame-a/model.json) and the SHA-256 of its text as a canonical JSON string. - The pairs are sorted by
path, comparing UTF-16 code units, each path once. - The digest is the SHA-256, as 64 lowercase hexadecimal digits, of the canonical JSON of the sorted list: an array of two-string arrays.
computedFrom.inputs.digestis the digest of the records the application read, andinputs.countthe number of their pairs.project/order.jsonis never an input.computedFrom.modelis the digest of the model folder's intent files (8.1, rule 2),source.jsonamong them. A model folder without intent files, which a writer that meets 8.4, rule 1 never leaves, hasmodelnull, not the digest of an empty list.
For example, the south wall and the levels of examples/one-storey-house give the pairs [["architecture/level-0/wall/wall-south","fe517b8853f582a78162d5e56ca5353b943c01b18caf6858099404d0c42b411c"],["project/levels","29da0824e3f9d2392427e4ffa02ccdd7a2f41bad6fb1bfdcb19d7ad35dfcd948"]], which is also their canonical JSON, and the digest 075c94e68d1ab7fbbde6248eebadffb2d558044cebbf39219c3915334e64a23a (count 2).
Reference: recordInputs, inputsDigest, intentInputs, runId and resultStatus in this repository's packages/openeik/src/result.js compute the pairs, the digests, the run id (8.5) and the test of 8.4.
8.4 When results are current
The selection. Which records an application reads is its selection. An application that writes results MUST keep it in the model folder's
source.json, a JSON object with at least:select:{categories?, lists?, ids?, paths?}, each a list of strings: the elements whosecategoryis incategories; every record of each list inlists, named as the single-file form names it (Part III, 11), withprojectfor the project record andlevelsfor the levels; the records whoseidis inids, in any list but the project, the levels and the order; and the records whose leaf path is inpaths, a path naming its record in either layout of Part III, 4.4. A record that any of them names is selected.inputs: the pairs (8.3) of the records the selection selected when the application last read the model: the list behindcomputedFrom.inputs.
Its other members are the application's.
source.jsonis an intent file, so a change to the selection, or a new reading of the model, changescomputedFrom.model.Current or stale. A result set is current in a version or a folder when both hold there:
- the records its application's selection selects give
computedFrom.inputs.digest; - the model folder's intent files give
computedFrom.model.
Otherwise it is stale. Comparing
computedFrom.versionwith the newest version is not enough: the version that saves the results is a child of the one they were computed from, and later versions that change no input leave them current.- the records its application's selection selects give
A reader that says whether a result set is current MUST decide it by rule 2, and rule 5. Without a
selectinsource.jsonit cannot: it MUST NOT call the results current.Where a result set is stale, comparing
source.json'sinputswith the pairs of the records at those paths now says which inputs changed, were added or went. A pair is compared with the record its path names, by its list and id in either layout of Part III, 4.4 (its rule 9), so that a record that only moved is the same input.Records that only moved. Where the digests differ, a result set is current all the same when the pairs of
source.json'sinputsgivecomputedFrom.inputs.digestand name, record by record (rule 4), exactly the records the selection selects now, each with the hash its pair gives: the records moved, as the change of layout moves them (Part III, 4.4, rule 8), and none changed. A reader MUST NOT call such a result set stale for that reason alone.
8.4.1 Files a selection names
Part of 0.6. OpenEik 0.5 had it as the proposal fileInputs (open questions, 147). It adds one member to the selection of source.json, an application's file, and no member, no value and no file to a model's records; a validator checks nothing of it. A reader of a model of 0.6 applies it always, and one of a model of 0.5 only where it is asked for (decision D12) or the model lists it (Part I, 9.12).
Section 8.4's selection names records: elements by their category, record lists, records by their ids and by their leaf paths. A file of the model that holds no record is none of them: project/ground.json, the ground of Part XIX, which a settlement or a bearing reads before anything else, is one file at a fixed path (Part XIX, 2, rule 2), and no record. So a result set computed from the ground has no pair of it among its inputs, and a reader calls it current after the ground changed. This section lets a selection name such a file, whole.
files. A selection MAY carryfiles, a list of 1 to 1000 paths:selectis then{categories?, lists?, ids?, paths?, files?}. Each is the path of a file of the model's folder that holds no record and that a version's tree keeps as a leaf at its own path (section 2, rule 1), written with its extension and/between its segments: a kept file (Part III, 7), or a file of the standard at a fixed path that holds no record,project/ground.json(Part XIX, 2) andproject/owners.json(Part XVI, 2) among them. A path of a record's file, ofeik.json, ofAGENTS.mdor of a hidden file names no such file, and selects nothing. An application names no file of its own model folder: its intent files arecomputedFrom.model's already (8.3), and its results and proposals are written after its inputs are read, so that one it named would make its result set stale as soon as it is written.- What it selects. A path of
filesselects the file at that path where the folder holds one, and nothing where it holds none: a file added at a selected path, and one removed from it, change the inputs. - Its pair. A selected file gives one pair as section 8.3, rule 1 gives a kept file's: its own path,
project/ground.json, and the hash of its leaf's object, the SHA-256 of its text as a canonical JSON string (section 1, rule 2). Its pair is among the pairs ofinputsand ofcomputedFrom.inputs, sorted with the records' and counted with them (8.3, rules 2 and 3). - Current or stale. Section 8.4, rule 2 reads "the records its application's selection selects" as the records and the files it selects. A result set whose selection names a file is current only where that file's pair is as it was: where the file changed, was added at its path or went, the result set is stale, and rule 4 names it among the inputs that changed, were added or went. A file has its own path in either layout of Part III, 4.4, so rule 5's records that only moved are records alone.
- Whole files. A selection names a file whole, never a part of it. Part XIX's profiles, pits and loads are items of one file and are not selected one by one: the ground at a point is read from every profile and from the ground's levels (Part XIX, 5), so a result that reads the ground anywhere reads the whole file.
- An application that reads such a file. An application that applies this section and writes a result set computed from a file of rule 1, the ground above all, MUST name the file in its selection's
files. - A reader that does not apply it.
filesis a member of the selection that section 8.4, rule 1 does not name. A reader that does not apply this section works out the selection without it: its pairs lack the file's, and so give another digest thancomputedFrom.inputs.digest, and rule 5 does not hold, sinceinputsnames a pair that the selection does not select. It calls the result set stale, and never current.
For example, a settlement analysis whose prefix is acme reads the foundations, the slabs, the levels, the types and the ground, and keeps in acme/settlement-a/source.json, the records' pairs left out here:
{
"inputs": [["project/ground.json", "0854816223c0fd77bcb3a13fac9c87800ad7c64d4070aa8053abf5c7ae0dfb2c"], …],
"select": {"categories": ["foundation", "slab"], "files": ["project/ground.json"], "lists": ["levels", "types"]}
}
where the ground was {"ground": {"groundLevel": 0, "groundwater": -1800}}, in the stored form. When the groundwater is raised to −1500, the file's pair is ["project/ground.json", "b1f661faf35903811e7540034178b015c48e704261a036716e75992b1b5d13e0"], the digest of the inputs changes, and the result set is stale, with project/ground.json named as changed (rule 4). Before this section, the selection could not name the file, and the result set stayed current.
Reference: none in the reference implementation, which writes no result sets. In @openeik/tools: recordInputs(folder, select, {proposals: ["fileInputs"]}) gives the pairs of the records and the files a selection selects, and resultSetStatus(folder, manifestPath, {proposals: ["fileInputs"]}) says whether a result set of the folder is current, reading its model folder's source.json and its manifest, and which inputs changed, were added or went (packages/openeik/src/result.js).
8.5 The run id
A run folder's name is its run id. It SHOULD be r- followed by the first 12 hexadecimal digits of the SHA-256 of the canonical JSON of {"engine": …, "inputs": …, "model": …}, whose members are the manifest's: its engine (left out when it has none), computedFrom.inputs, the object {count, digest} as it stands, and computedFrom.model, a digest or null. The manifest of the example in 8.2 gives
{"engine":{"kernel":"an-analysis-app 0.5.0"},"inputs":{"count":41,"digest":"3b0f6c2e9d41a8f07e2c5b19d6a4f0c8e7b3a2d1c9f8e7d6c5b4a3f2e1d0c9b8"},"model":"a41e0c7d5b3f2e1d9c8b7a6f5e4d3c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d"}
and so the run id r-2e13b39cbc7a. The same inputs on the same engine give the same run id: a run made again goes to the same run folder. Where the application is deterministic, it gives the same results, and a manifest that differs from the first only in made, and in computedFrom.version where it read a later version that changed none of its inputs.
- An application that makes a run again into a run folder that exists SHOULD leave the folder as it is when the run gives the same results and a manifest that differs only in
madeandcomputedFrom.version: the first manifest stays, with itsmadeand itsversion, which still say truly when, by whom and from what the results were computed, and the version does not change. Where anything else differs, it replaces the folder's files, the manifest among them.
8.6 Old results
An application that writes results into a folder SHOULD keep there the latest result set of each model and every set that is named or signed, and remove the others: the history keeps them. Removing a run folder is an ordinary change.
8.7 The proposal file
Until a host offers proposals (section 7), an application offers changes to a model's records in a proposal file, <application>/<model>/proposals/<id>.json, never by writing the records itself. It is a JSON object (schema applications/proposal.schema.json):
| Member | Meaning |
|---|---|
format | "openeik-proposal/0.1" |
intent | what the change is for, in a sentence a person reads first |
base | what it was made against: {version, records}. version names a version as computedFrom.version does (8.2), or is null; records gives, by id, each record that the commands change as it was there: {hash, revision}, its hash (Part III, 6) and its revision (Part I, 8) |
by | {app, person}: the application that made it, with its version ("an-analysis-app 0.5.0"), and the person it was made for: an id or an email |
commands | the change: one or more commands of Part V, in order |
dryRun | optional: the last dry run of commands (Part V, 7.3), {at, by, ok}: when, by which command processor and version, and whether it passed; or null when none was made |
evidence | optional: why, in the application's terms: a check, the values before and after, the result set that found it by its manifest's path |
- A writer MUST write
formatasopeneik-proposal/0.1. A reader MUST readopeneik-proposal/0.1-proposalas the same format: proposals written before 14 October 2026 carry that id. An implementation MUST NOT apply a proposal whoseformatit does not implement. format,intent,base,byandcommandsare required. A reader ignores members it does not know. An application's own data goes inevidence, and in the other objects of the proposal only as extension members (Part I, 11.2, rules 1 and 8).commandsis a batch (Part V, 7): applied in order, all or nothing, and checked as any batch is (Part V, 6). Each command that changes a record SHOULD carry its kind's precondition (expectedRevision…) matchingbase, so that a command made against a record that has changed since is refused rather than applied over the change.- A person accepts a proposal. Writing a proposal changes no record. The person, or a command processor or host acting on the person's word, runs
commandsas one batch on the line of work the person chooses, after a dry run if they like; or the person merges a line of work (an alternative, a branch) on which the commands were applied (section 5). A refused batch changes nothing, and the proposal stays as it was. - An application MUST NOT apply its own proposal to a line of work that a person edits, unless that person accepts it. It MAY apply it on a line of its own, made for the proposal, for the person to review and merge.
dryRunandevidenceinform the person; they decide nothing. The batch run on acceptance decides.- A proposal file MUST NOT carry costs, prices or quotes: it is part of the model, and they are not (Part II, 12).
Example, a deeper beam proposed after an analysis (the hashes are illustrative):
{
"base": {
"records": {
"outdoor-header-0": {"hash": "a825935f50e8ecccaeb45f691fde75f186dea325a1cd8c1490399d48ae9174e3", "revision": 0}
},
"version": "7d1e9f3b2c4a6e8d0f1b3c5e7a9d2f4b6c8e0a1d3f5b7c9e2a4d6f8b0c1e3a5d"
},
"by": {"app": "an-analysis-app 0.5.0", "person": "jane@example.com"},
"commands": [
{"expectedRevision": 0, "id": "outdoor-header-0", "kind": "update", "patch": {"height": 270, "typeId": "type-beam-glulam-90x270"}}
],
"dryRun": {"at": "2026-10-11T18:30:00Z", "by": "a command processor 1.0", "ok": true},
"evidence": {"after": 0.81, "before": 1.08, "run": "acme/frame-a/results/r-5d1c0e9a7b32/manifest.json"},
"format": "openeik-proposal/0.1",
"intent": "Deeper header: bending utilisation 1.08"
}