Published November 23, 2026 | Version v0.3.1

long-term-memory-structure/long-term-memory-structure: long-term-memory-structure 0.3.1

Authors/Creators

Description

  • ltms records <folder>: the loop the message gives holds the folder's name as written; a name with $&, $` or $$ in it was changed by the pattern rules of the replace that built the message.
  • Every command: when a file cannot be opened for a reason other than the four named ones (a symbolic link loop, a name too long), Node's own words, which repeat the path, are printed with their control characters escaped; they were printed raw. The path ltms quotes before them is escaped by ltms records alone, so in the other commands a newline in a path still splits that message (Known limits).
  • ltms shapes --vocabulary: the closing line says to read the words of the vocabulary given, naming its file as it was given, beside the report's allowed list, as the README and --help say; it named the allowed list alone.
  • ltms shapes --vocabulary: a kinds.sub entry for a kind that values does not list at kinds.path is taken, as before, and applies once --allow lists the kind there (the route --unlisted suggests); a run in which neither lists it now gets a warning on stderr naming the entry, since such records print as (unlisted) before their sub-kind is read.
  • README, ltms shapes: the order of a map's keys is stated as ltms writes it and --check holds it: the keys that are array indices (a whole number from 0 to 4294967294 written without leading zeros, such as a value 200 given with --allow) first, in numeric order, then the others by their text; it said "in ltms's order", and the code's comment "by their text". The format is unchanged (ltms-shapes/0).
  • ltms shapes: a directory met again under a path given (the same device and inode as one already entered in that path's walk, as a bind mount of a directory inside itself makes) is counted in a warning, each once, in the words search prints for the same case (one function writes them for both); it was passed over without a word. Each directory is now entered once per path given, as search enters it, and its entries are still counted once.
  • ltms shapes: a path given through a symbolic link to a directory is known by that directory's device and inode, as search knows it, not by the link's: a directory met again under it is counted (above), and the directory given also as itself is listed once, where each of its entries was counted twice (one FIFO named .jsonl made "2 entries").
  • Every message that calls an error a bug in ltms (an internal error in search, index, skeleton, stats, shapes, records and pin; a shapes report refused at the write; records' count that does not balance) says where to report it: "a bug in ltms (report it at https://github.com/long-term-memory-structure/long-term-memory-structure/issues; an issue there is public)", package.json's bugs, written once in the code. They named no place.
  • ltms shapes --check: a report whose first line's allowed list holds an entry that --allow refuses (a path that breaks the rule for a name, a value that breaks the label rule, a value with : at the kind path or at a sub-kind's path) is refused with a line for each such entry, naming it by its index (allowed[0]) and the rule it breaks, never by its text; one message stood for any such entry, naming neither.
  • The receiver's validator, test/shapes-validate.mjs (in the repository; the package does not ship it): at a kind it takes only the vocabulary's kinds, the allowed list's and the format's four words for a kind, (none), (not a string), (unlisted) and (all); its check of the token took any word of the format there (int, (rare), version), and only its check of the line refused one. Its verdict on a report is the same.
  • ltms shapes, at the write and with --check, and the receiver's validator: a path line with a first version and no last, or a last and no first, one whose first is later than its last (in the versions' numeric order), and one whose n is in a lower bucket than its files (n 2-3 in files 4-7: each file a path occurs in holds it once at least) are refused, by the line, each in words of its own, as the README's "Before you send one" now says; ltms never writes such a line, and each passed both checks.
  • dist/shapes.js exports vcmp, the comparison under the order of versions, for the tests alone: no report reaches its tie-break (versions equal as numbers ordered by their text), since the version rule gives each version one spelling, so a unit test holds it. It is not a part of the module's use.
  • ltms records and ltms shapes: the line that says a write to stdout failed puts the number of lines written in agreement with its words, in one function both commands use: "after 1 of their lines was written" (records, whose first write is its header), "after 0 of its 1 line were written" (a shapes list of one line); it said "1 of their lines were written" and "its 1 lines".
  • ltms records: the README and --help give the balance line in full, with every form it takes: line, record and root in the singular for 1, (the last without a newline), no list of kinds when no record was written, and THE COUNT DOES NOT BALANCE; the README gave one example of it, and --help named its parts in words. A path records prints on stderr, on the balance line and on every other, has its control characters escaped (\n, \t and \r, any other as \xHH), so a path that holds a newline no longer splits a line in two.
  • ltms records' folder loop (the README, --help, and the messages for a folder or no path; one loop in all of them): its status is 1 when a run failed, where it was 0 (its last command was an echo), set by its last command, never by exit, which would close the shell it is pasted into; it names on stderr each entry named .jsonl that is not a regular file (a FIFO, a directory), which it skips (skipped, not a regular file: <path>), where it passed over them without a word; and zsh runs it over a folder with no .jsonl file, where zsh stopped it with "no matches found" (the loop sets zsh's nullglob in its own subshell). The tests run it as written by bash, zsh and sh.
  • ltms records: a record that has a parentUuid and no uuid that is a string (none, or a number) gets its parent link as any record does: parent, the address of the record its parentUuid names, or null; parent_by "supplied"; and supplier.parent, by the label rule, counted among the balance line's parents; it got parent_by "none", and its parentUuid was not printed. records' --help and the README's Privacy give the label rule as 1 to 64 characters (an empty value prints (withheld)); they said "at most 64".
  • ltms records: a uuid link (parent, leaf, logical_parent) is the address of the first record with a uuid and a parentUuid that carries the id, else of the first record without a parentUuid (a sidecar, such as an ai-title record) that carries it; an id that only a sidecar carries was null and counted on the balance line as not in this file. A sidecar that only repeats a record's uuid never takes its links. dup_of still goes by the records with both.
  • ltms records --help gives the check of the balance for a file still being written, as the README does: count only the bytes the header names, head -c <bytes> <file> | wc -l (plus one when last_line_unterminated is true); it gave only the file's wc -l, which reports a false imbalance once the file has grown since the run.
  • ltms records --help's time row says which stamps get a utc, as the README's does: an ISO 8601 date and time in the extended format (2026-01-05T09:00:00, a fraction allowed) with its zone (Z or z, or an offset of hours and minutes); it said "an ISO 8601 date and time with its zone", which 2026-01-01T10:00Z, 2026-01-01T10:00:00+02 and 20260101T100000Z are, and none gets one.
  • README, ltms records: the calls row says it is on a user record of any kind that holds tool_result blocks; its "(a tool result's)" gave the kind as tool result, where a record whose first block is text, and so of kind input, holds one too.
  • ltms records into a pipe whose reader keeps up is about as fast as into a file: a full pipe is waited on 0.1 ms at first, the wait doubling up to 5 ms while it stays full, and 0.1 ms again once a write goes through; it was waited on 5 ms at a time, which made it up to about twice as slow. Measured on one machine, a file of 120 MB (274,853 lines), the median of 3 runs each: into | cat > file 4.87 s (5 ms a wait: 8.01 s; into a file: 4.81 s), into | wc -l 4.64 s (5.52 s), into a reader that waits 3 s before it reads 6.70 s (10.49 s), with records' own CPU time no more than with the fixed wait (into | cat, 4,765 ms against 4,895).
  • ltms search and ltms index: a directory's entries are listed with their names as bytes, as ltms shapes lists them, and a name is used as text only when its text gives its bytes back: a name that is not valid UTF-8 is reported with its bytes written as \xHH and counted as failed, as before, and a twin beside it, a valid name that decodes the same (U+FFFD.jsonl beside \xff.jsonl: a file, a directory, or a symbolic link, counted as any link), is read as any other name; it was passed over without a word (found 1, read 0, failed 1, and a twin link not counted). search and shapes read the same files again, as the README says (index reads them too, but for what the README says it counts and does not read: a session's own files, set-aside copies, a pin directory), but where a bind mount or two hard links reach one transcript (Known limits).
  • ltms search and ltms index: what the walk counts under the directories given is counted once however many of the paths given reach it (a folder given twice, or with its parent), as ltms shapes counts it, each by the directory it was met in (its device and inode) and its name, so that two names of one inode (hard links) are two: a symbolic link (files.symlinks); an entry named .jsonl that is not a regular file (a FIFO, a socket), not counted again in the warning line when a no-.jsonl warning named it; a directory met again; a name that is not valid UTF-8, reported and counted as failed once. A folder holding two FIFOs, given twice, made "4 entries"; a directory met again, with its folder given twice, "2 directories"; and a name that is not UTF-8 was reported twice and counted as 2 failed; two names of one symbolic link were 1 link.
  • ltms search and ltms index: --max and --skip take a whole number from 0 to 9007199254740991 (2^53 - 1), as --help, the README and the usage message now say, the rule ltms shapes --floor takes; a larger one is a usage error (exit 2) that names the value. They took any run of digits, and applied and printed the nearest number a double holds: --skip 9007199254740993 printed --skip 9007199254740992 passes over all, and --skip 99999999999999999999999, --skip 1e+23.
  • The address prefix, every command's (records' source.id and ids too), is a file name's first 8 characters counted in code points (for an agent's transcript, agent- and the 8 code points after it), computed by one function, which the library now exports as addressPrefix(name) (docs/library.md) for the prefix of searchTranscript and indexTranscript. It was the first 8 UTF-16 code units, so a character outside the Basic Multilingual Plane at the 8th place was cut in two: the ids of a file named abcdefg and an emoji, .jsonl, held a lone \ud83d, and jq refused ltms records' output (exit 5, at its header); at the 1st or the 7th place, the prefix held 7 characters. A name whose first 8 code points are all in the Basic Multilingual Plane, as a session id is, keeps its prefix byte for byte.
  • Tests: 771 → 807 (801 passing, 0 failing, 6 skipped: 0.3.0's six).

Known limits

Each was run on this release's code with a synthetic input (S377).

  • skeleton and stats print an internal error met while reading their arguments, or after the files while checking for shared address prefixes, as Node prints it, with its message and stack, and no line calls it a bug in ltms (exit 1).
  • skeleton's ek drops the hook's name (a plain hook-block) for a bracket longer than 300 UTF-16 code units, not 300 characters: a bracket of 161 characters, 140 of them emoji, is over it.
  • search and index read a transcript twice when two paths given reach it through a bind mount (a folder and a bind mount of it inside itself, both given): they tell files apart by their real path, which a bind mount does not change; their warning still says the directory met again was not read again, and shapes reads the transcript once.
  • Two hard links of one transcript under a directory are read twice by search and index and once by shapes; ltms index counts the two names once in sessionParts, in setAside and in a session's agents, where its other counts of the walk count names, so its found is not search's on the same folder.
  • search and index count as one link a symbolic link named by the single byte FF (not UTF-8) and a link beside it named ff, that byte written in hex; shapes, and 0.3.0, count two. A regression of this release, in a warning's count.
  • search and index print the warning that a folder holds no .jsonl file once for each time the folder is given, each naming the entries named .jsonl there that are not regular files (shapes prints one).
  • The window command that ltms search --help and the README give counts its 600 characters in UTF-16 code units, as a hit's at is counted, so a window can start or end inside a character outside the Basic Multilingual Plane (an emoji), which then prints as U+FFFD.
  • shapes reports an internal error met while it walks a directory given, and --check one met while it reads the report, as cannot read '<path>' (<kind> at <place>), without calling it a bug in ltms or saying where to report it.
  • shapes words its count of the symbolic links met under the directories given apart from search and index, and not as a warning (1 symbolic link met under the directories given was not followed.).
  • A vocabulary given with --vocabulary may list a value holding : at the kind path or at a sub-kind's path, which --allow refuses: records with that value print as the kind and sub-kind it spells, so two kinds of record share one line.
  • ltms shapes --check holds a path line's n against its files, and no other count the buckets decide: within a line, a version or kind line whose records is in a lower bucket than its files (or than one of its versions), or a rare line whose n is in a lower bucket than its paths; across lines, a kind line in more files than the first line's files.read, or a path line in more files than its kind's line. Such a report passes; ltms never writes one.
  • ltms shapes --check prints one line for each entry of a report's allowed list that --allow refuses, with no cap (1,000 such entries gave 1,001 lines), where it shows at most 20 problems of any other kind.
  • records escapes a path's control characters on stderr but not its backslashes, so a path holding a backslash and n prints as one holding a newline, and U+2028 or U+2029 prints as it is; the commands its messages give (cat '<path>' > transcript.jsonl for a FIFO) name the escaped text, not the file.
  • ltms records --help says memory holds a piece of 1 MiB, the line that crosses it and the uuids, and gives no factor for a long line, which costs several times its length while it is read (measured: a line of 32 MiB, about 287 MiB at the peak; with one Hebrew letter in it, about 383 MiB).
  • skeleton, stats, search, index, shapes and pin print a path given that holds a newline as given in the message that it cannot be read (it does not exist, it is a symbolic link loop), so that message splits across lines; records escapes it.
  • shapes' closing line with --vocabulary prints the vocabulary's path as it was given, so a path holding a newline splits that line (the --check command after it is quoted, and runs as printed).
  • ltms --help says an internal error is reported by its kind and where in ltms it happened, not that its line also says where to report it (the README's What it reads does); it gives the label rule's length as at most 64, as the message for an --allow value that breaks the rule does, where the rule is 1 to 64 (an empty label prints (withheld), and --allow .type= is refused); and it names package.json among the files skill reads, where records reads it too, for its version (the README's What it reads says so).
  • ltms shapes --help and ltms records --help call a report refused at the write and a count that does not balance a bug in ltms without saying where to report it (the messages themselves say).
  • records gives a utc to a stamp with a lowercase t between its date and its time, which the time row does not name, and none to one whose fraction is written with a comma, which ISO 8601 allows.
  • In the library's dist/records.d.ts, time.as_written is described as the stamp as written and group as the requestId or message id; each is (withheld) when it fails the label rule, as ltms records prints it.
  • 0.3.0's Known limits stand but its last eleven: nine are repaired here (shapes' closing line with --vocabulary; a name that is not UTF-8 beside its twin, a directory met twice, a FIFO counted once for each argument; where to report a bug, but for the two cases above; the address prefix in code points; --max and --skip bounded; records' folder loop; records' parentUuid on a record without a uuid, and its stderr path; records into a pipe whose reader keeps up; leaf and logical_parent); a kinds.sub entry for a kind the vocabulary does not list is still taken, as decided, and a run where it cannot apply now warns; and the order of a count map's keys is unchanged, and now stated in the README.

Files

long-term-memory-structure/long-term-memory-structure-v0.3.1.zip

Files (1.0 MB)

Additional details