No description
  • Go 43.1%
  • Rust 24.5%
  • Python 12.3%
  • TypeScript 10.7%
  • Shell 9.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-26 01:46:17 +03:00
go ecd-id rung 4a, car r1: ten Role constants and Registry.KindsByRole, with TestRegistryRoles, TestRegistryKindsByRole and TestRegistryKindsByRoleCoversTheFiles 2026-11-26 00:58:39 +03:00
model vectors: car b of 0.10.1, lease.tsv and stream_invalid.tsv gain the 2^53 and 2^64 - 1 lease numbers and the negative stream ids, from model/vectors.go 2026-11-25 00:42:38 +03:00
py ecd-id v0.11.0: version lines (crate eid, fiberfx-eid) and the release note: Go Role constants and Registry.KindsByRole; the control row eid-registry-roles-control; twelve kinds of the system kan (cal, car, cmt, ded, est, hlp, ntc, row, rpl, sig, ssn, trn) 2026-11-26 01:46:17 +03:00
registry ecd-id registry: the system kan registers cal, est, ntc and sig for the second run of the analytics Entities (the Operator, 25 Nov 2026: "Opt in with strongest", read by the Architect as approving them; landing waits for the Director on his word) 2026-11-26 01:22:40 +03:00
rows ecd-id rung 4a, car r2: the control row eid-registry-roles-control and the README paragraph on Role and KindsByRole 2026-11-26 00:58:00 +03:00
rs ecd-id v0.11.0: version lines (crate eid, fiberfx-eid) and the release note: Go Role constants and Registry.KindsByRole; the control row eid-registry-roles-control; twelve kinds of the system kan (cal, car, cmt, ded, est, hlp, ntc, row, rpl, sig, ssn, trn) 2026-11-26 01:46:17 +03:00
spec EID_LEASE L3a and the judge's findings on befeb45 (run 20261124T011503Z): activePoll unexported (the one change that cannot follow the tag); TakeLease takes a LeaseStore, so take.go needs no build tag and Sleeper and ManualClock.Sleep exist on every platform; spec/cli.md: mint --store releases the store when TakeLease returns, before minting; a lease handed to a process at its start lasts its whole life only without a route to a fresh lease; the default active wait is one attempt then 100 more 30 ms apart; spec/lease.md: the allocator is asked at each process start and, with a route to a fresh lease, past half the term; the exec rule's repeated sentence removed; eid-bin prints the linux-amd64 binary as well (fv's rows stage it); eid-casefold names rows/eid-casefold.sh 2026-11-24 04:27:10 +03:00
ts ts/test: car b of 0.10.1, api tests for fromStreamId with a negative ms or seq (stream-range) and newLease from 2^53 (lease-writer, lease-window) to 2^64 (lease-syntax) 2026-11-25 00:46:54 +03:00
vectors vectors: car b of 0.10.1, lease.tsv and stream_invalid.tsv gain the 2^53 and 2^64 - 1 lease numbers and the negative stream ids, from model/vectors.go 2026-11-25 00:42:38 +03:00
.gitignore Reference model and vector generator in Go; the Python model is removed 2026-11-22 19:35:25 +03:00
README.md ecd-id v0.11.0: version lines (crate eid, fiberfx-eid) and the release note: Go Role constants and Registry.KindsByRole; the control row eid-registry-roles-control; twelve kinds of the system kan (cal, car, cmt, ded, est, hlp, ntc, row, rpl, sig, ssn, trn) 2026-11-26 01:46:17 +03:00

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 brd is 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 eid at ~/.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_STORE and EID_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, RoleCorrelation and RoleRequest, and Registry.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 with registry-role as before. The system kan gains twelve kinds since 0.10.1: the entities car (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) and sig (error signature, the redacted template of a tool error); the runs hlp (helper run) and row (rows run of flow:row-container); the transaction ded (deed of a KAN tool's Ecd Runtime store); the activation ssn (session of Claude Code); the streams ntc (notice, a system record or a command of a transcript) and trn (transcript); and the request cal (tool call with its result, in a transcript). Rows: eid-registry-roles-control. A running eid reads the registry folder at each start, so a host takes the kinds when its EID_REGISTRY copy is replaced. No Rust, TypeScript or Python code and no vector changed; the crate eid and fiberfx-eid take 0.11.0, and the Go module github.com/fiberfx/ecd-id/go takes v0.11.0.
  • 0.10.1 makes the TypeScript package agree with the spec and the other three packages at two boundaries: fromStreamId refuses a negative ms or seq with stream-range (it wrapped a negative time to 2^48 - 1), and newLease takes whole numbers below 2^64, so one from 2^53 is refused with lease-writer or lease-window as the spec says, not lease-syntax. A JavaScript number is exact only to 2^53: the largest it holds below 2^64 is 2^64 - 2048, and 2 ** 64 - 1 evaluates to 2^64, which newLease refuses with lease-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.tsv 31 rows, stream_invalid.tsv 18), and ts/test/api.test.ts checks the typed calls the vectors cannot reach. Python annotates with builtins.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 in model/ emits the new vector rows; no Go or Rust library code and no registry row changed; the crate eid and fiberfx-eid take 0.10.1.
  • 0.10.0 adds the Python package eid under py/ (distribution fiberfx-eid 0.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.sh runs 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 crate eid takes 0.10.0.
  • 0.9.2 changes the registry only; no code changed. The system kan gains the kinds aus (agentic user story), fea (features catalogue), spc (specification or contract), epc (epic), rng (rung), pgm (program node), prj (project node) and trk (track node), all entities, beside doc; every other record of the KAN home's specs stays doc. 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 running eid reads the registry folder at each start, so a host takes the kinds when its EID_REGISTRY copy is replaced; no rebuild.
  • 0.9.1 changes the registry only; no code changed. mxe (mx-echo applications) names m5 as its home, and gains the kinds itm (entity: an item key in an mx-echo application's store) and sto (store: that store), beside cor and req. 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.