- Go 43.1%
- Rust 24.5%
- Python 12.3%
- TypeScript 10.7%
- Shell 9.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| go | ||
| model | ||
| py | ||
| registry | ||
| rows | ||
| rs | ||
| spec | ||
| ts | ||
| vectors | ||
| .gitignore | ||
| README.md | ||
ecd-id
The Ecd ID, eid for short, version 1: a 16-byte identifier that names the system that minted it, the kind of thing it names, the Unix millisecond of the mint, the writer and a count. Its one text form is 28 lowercase characters:
emq_job_23obzcbapvupu2272222 system emq, kind job, 2026-11-21T14:30:00.123Z, writer 895287301, count 0
- Ordered. Text order equals byte order: system, kind, time, writer, count.
- Minted locally. A producer holds a lease (one writer number and a window of id-time) and mints with no round trip per id. Two ids of one registered system are never equal while the allocation premises hold.
- Strict. One case, one spelling, fixed length, no aliases; every refusal has a named reason.
- Stream ids. Each id maps to a Valkey stream entry id
<ms>-<system<<48 | writer<<18 | count>, unique across systems that share a stream, and back again given the stream's kind. - Retired code. The code
brdis retired: its row stays in the registry, and nothing mints under it. Its ids are embeddings of brd14 ids, computed both ways without a table (spec/registry.md).
Layout
| Path | What |
|---|---|
| spec/id.md | Binary layout, alphabet, canonical text, strict parse and its refusals |
| spec/stream.md | The Valkey stream-id mapping and its inverse |
| spec/lease.md | Leases, writer numbers, the allocator, the minter, the pid guard, detached minting and the door |
| spec/registry.md | The systems and kinds files, roles, classes, retirement, the kind-only check of lease-free ids and the brd14 embedding |
| spec/mxdb.md | mxdb's store, database and owner identities; the lineage |
| spec/cli.md | The command eid: parse, validate and mint from a shell, from a store or from a lease; take a lease for a process (eid lease) |
registry/ |
systems.tsv and kinds.tsv |
model/ |
The reference model (eid.go), the vector generator (vectors.go) and the seeded random source of the generated vectors (mt.go): a Go module of its own, standard library only, independent of go/ |
vectors/ |
Language-neutral TSV vectors, generated by the model in model/; never edited by hand |
rs/ |
Rust workspace, crate eid: standard library only, unsafe forbidden |
go/ |
Go module github.com/fiberfx/ecd-id/go (package eid): standard library only; go/cmd/eid is the command, go/filestore.go the lease store in a directory |
ts/ |
TypeScript package @fiberfx/eid (private): parse, format, binary, leases and stream ids over the same vectors, and the brd14 embedding; no runtime dependencies, no minting, no registry (ts/README.md) |
py/ |
Python package eid (distribution fiberfx-eid): parse, format, binary, leases and stream ids over the same vectors, and the brd14 embedding; standard library only, no minting, no registry (py/README.md) |
rows/eid.rows.sh |
The gates, run from the root of the tree: the checks above and each property with its control, as one row per property |
rows/eid-ts.rows.sh |
The TypeScript package's rows: bun test over every vector row, the brd14 embedding, tsc --noEmit (strict) and three planted mutants |
rows/eid-py.rows.sh |
The Python package's rows: python3 3.12 or later, unittest over every vector row, the brd14 embedding, three planted mutants and a tampered vector (eid-py-tampered-vector) |
Go module
The module path is github.com/fiberfx/ecd-id/go; the package name is eid. Go requires the version tag of a module in a subdirectory to carry its path, so the module's versions are the tags go/vX.Y.Z, beside the repository's own ecd-id-vX.Y.Z tags.
go get github.com/fiberfx/ecd-id/go@vX.Y.Z # in go.mod: require github.com/fiberfx/ecd-id/go vX.Y.Z
go install github.com/fiberfx/ecd-id/go/cmd/eid@latest # the command
import eid "github.com/fiberfx/ecd-id/go"
ID implements encoding.TextMarshaler and TextUnmarshaler, driver.Valuer and sql.Scanner, and json.Unmarshaler,
so an id is stored and sent without a wrapper; NullID serves nullable columns and JSON null. The zero ID is refused
when encoded, and a JSON null is refused when decoded into an ID; a missing JSON field leaves an ID unchanged, so
nullable or optional fields use NullID. The encodings refuse with zero (the zero ID encoded, or JSON null decoded
into an ID), scan-type (a Scan source that is not []byte) and json-type (a JSON value that is neither a string nor,
for NullID, null).
Role is the role of a kind (spec/registry.md). Its ten values are the constants
RoleEntity, RoleActivation, RoleCommand, RoleRun, RoleStream, RoleStore, RoleDatabase, RoleTransaction,
RoleCorrelation and RoleRequest, each the text of its role in kinds.tsv; the loader refuses any other text with
registry-role. Registry.KindsByRole(system, role) returns the kinds of one system that have the role, in code order
and in every state, as KindsOf does, and none for a system without a row or a role outside the list. Rust's
Role enum names the same ten roles; Rust has no kinds_by_role.
Running the checks
(cd model && go run . --check) # the committed vectors equal the model's output
(cd rs && cargo test --release) # Rust: conformance and behaviour
(cd go && go test ./...) # Go: conformance and behaviour
(cd go && go build ./cmd/eid) # the command, as ./eid
sh rows/eid.rows.sh # every gate as one row, each with its control, and the builds of eid
sh rows/eid-ts.rows.sh # TypeScript: bun test over the vectors, tsc --noEmit, mutants
sh rows/eid-py.rows.sh # Python: unittest over the vectors, brd14, mutants
(cd model && go run .) regenerates vectors/.
Test names carry the property they check: Rust tests start with g1_ to g11_ and g14_, Go tests with TestG01 to
TestG14, and the registry tests with registry_ and TestRegistry (they include the kind-only check of detached ids, that every kind of a retired system is retired, and in Go the role constants and KindsByRole); g12 and g13 exist in Go only.
| Prefix | Property |
|---|---|
g1 |
Vectors: both directions, and every invalid input refused with its reason |
g2 |
Order: random ids sort the same as text and as bytes; an unsorted alphabet does not |
g3 |
Burst: unique and strictly rising per writer under load; borrowing past 262,144 in a millisecond |
g4 |
Stream ids: distinct across systems on one writer and millisecond; the inverse; Valkey's append rule |
g5 |
Restart: an allocator restarted many times, some inside one second, never reissues a live writer |
g6 |
Clock set back and store restored: no repeat with a correct clock; repeats counted when both faults meet |
g7 |
Fenced clone and the pid guard |
g9 |
mxdb identities |
g10 |
The door: detached ids bound as command tokens, never stored as the system's own |
g11 |
One-case text |
g12 |
The file store: the record is on disk, one activation per system, 2 processes × 1,000 grants give 2,000 distinct writers; the control without the lock repeats them (Go only) |
g13 |
The command eid: its output, exit status and refusals against vectors/cli.tsv; stores, eid lease, detached ids (Go only) |
g14 |
brd14 ids: every row of vectors/brd14.tsv both ways, pure and through the registry layer, with every refusal; byte order equals brd14 order; random ids return |
Each property has a violating case beside its good case: a control input that the check refuses, or a fault whose
effect the test counts. The Rust test g4_valkey_live runs against a Valkey server when EID_VALKEY names its
address (127.0.0.1:6399); without it, the stream tests check the arithmetic against Valkey's documented append
rule.
The Linux container of the rows cannot check directory names on a case-folding file system (NTFS, APFS); there the
g11 tests assert that every canonical text in the vectors is one case, so no two of them can fold together.
rows/eid-casefold.sh makes the check on such a host: one directory for each distinct id text of the vectors, and a
control that the file system folds case. On APFS, measured on 24 Nov 2026: 400 distinct id texts gave 400 directories,
and the upper-case twin of one id opened its directory.
On APFS, measured on 22 Nov 2026: creating one directory for each of 2,428 mixed-case KAN document ids made 2,355 directories, because ids that differ only by letter case name one directory; creating one for each of the 2,428 corresponding Ecd ids made 2,428. NTFS is not measured.
A home host
A host that runs a system's supervisor (a system whose home in registry/systems.tsv names that host) is set up
once:
- the binary
eidat~/.local/bin/eid; - the registry, a copy of a released
registry/kept outside any shared mount; - the store, a directory outside any shared mount, one for the home;
EID_HOME(the host's own name in the registry),EID_STOREandEID_REGISTRY(the two directories), set only in that host's own launch environment, such as its shell profile or its service manager's unit. A supervisor takes no lease unless all three are set (spec/registry.md).
A process takes its lease with eid lease SYSTEM --store "$EID_STORE" (spec/cli.md).
Release notes
- 0.11.0 adds to the Go module the ten role constants
RoleEntity,RoleActivation,RoleCommand,RoleRun,RoleStream,RoleStore,RoleDatabase,RoleTransaction,RoleCorrelationandRoleRequest, andRegistry.KindsByRole(system, role), the kinds of one system that have one role, in code order and in every state; the loader's role set is built from the constants and refuses any other text withregistry-roleas before. The systemkangains twelve kinds since 0.10.1: the entitiescar(car, one brief of a rung),cmt(git commit, keyed by its sha),est(estimate, one size given to a rung, an increment or a car),rpl(reply, one copy of a model reply in a transcript) andsig(error signature, the redacted template of a tool error); the runshlp(helper run) androw(rows run of flow:row-container); the transactionded(deed of a KAN tool's Ecd Runtime store); the activationssn(session of Claude Code); the streamsntc(notice, a system record or a command of a transcript) andtrn(transcript); and the requestcal(tool call with its result, in a transcript). Rows:eid-registry-roles-control. A runningeidreads the registry folder at each start, so a host takes the kinds when itsEID_REGISTRYcopy is replaced. No Rust, TypeScript or Python code and no vector changed; the crateeidandfiberfx-eidtake 0.11.0, and the Go modulegithub.com/fiberfx/ecd-id/gotakes v0.11.0. - 0.10.1 makes the TypeScript package agree with the spec and the other three packages at two boundaries:
fromStreamIdrefuses a negativemsorseqwithstream-range(it wrapped a negative time to 2^48 - 1), andnewLeasetakes whole numbers below 2^64, so one from 2^53 is refused withlease-writerorlease-windowas the spec says, notlease-syntax. A JavaScript number is exact only to 2^53: the largest it holds below 2^64 is 2^64 - 2048, and2 ** 64 - 1evaluates to 2^64, whichnewLeaserefuses withlease-syntax; the text form (parseLease) reads the exact value. The vectors gain the lease numbers 2^53 - 1, 2^53 and 2^64 - 1 and the negative stream ids (lease.tsv31 rows,stream_invalid.tsv18), andts/test/api.test.tschecks the typed calls the vectors cannot reach. Python annotates withbuiltins.bytes, so its annotations hold under 3.14's deferred evaluation; the READMEs name the tampered-vector row and state the scope. The Go model inmodel/emits the new vector rows; no Go or Rust library code and no registry row changed; the crateeidandfiberfx-eidtake 0.10.1. - 0.10.0 adds the Python package
eidunderpy/(distributionfiberfx-eid0.10.0, Python 3.12 or later, standard library only): parse, format, strict text, binary, the lease arithmetic, stream ids and the brd14 embedding with its registry layer, the scope of the TypeScript package; no minting, no registry files, no lease store, no command.rows/eid-py.rows.shruns its tests over every data row of seven vector files, three planted mutants and a tampered vector. No Go, Rust or TypeScript code, vector or registry row changed; the crateeidtakes 0.10.0. - 0.9.2 changes the registry only; no code changed. The system
kangains the kindsaus(agentic user story),fea(features catalogue),spc(specification or contract),epc(epic),rng(rung),pgm(program node),prj(project node) andtrk(track node), all entities, besidedoc; every other record of the KAN home's specs staysdoc. Vector rows:mint-kan-aus,mint-kan-fea,mint-kan-spc,mint-kan-epc,mint-kan-rng,mint-kan-pgm,mint-kan-prj,mint-kan-trk,mint-kan-kind-not-registered. A runningeidreads the registry folder at each start, so a host takes the kinds when itsEID_REGISTRYcopy is replaced; no rebuild. - 0.9.1 changes the registry only; no code changed.
mxe(mx-echo applications) namesm5as its home, and gains the kindsitm(entity: an item key in an mx-echo application's store) andsto(store: that store), besidecorandreq. Vector rows:mint-mxe-itm,mint-mxe-sto,mint-mxe-kind-not-registered,lease-mxe-other-home.
Status
Version 1 holds the format, the reference model, the vectors and the Rust and Go libraries. An Elixir library, generated kind constants and subsystem adoption are out of scope for version 1; the tree holds no Elixir code.
The TypeScript package (ts/) and the Python package (py/) follow the same vectors with a narrower scope: they parse,
format and convert ids, leases and stream ids, and embed brd14 ids; they do not mint and hold no registry. Both are
private until a publish is decided.