Skip to content

v0.1.2

Choose a tag to compare

@github-actions github-actions released this 21 Oct 15:11
3807579

Added

  • After a write in Claude Code, mnema after-a-write copies a note of the host's own memory into the private tree,
    and names the door of a file that holds decisions.
    A PostToolUse hook on Write|Edit runs it behind a shell that
    reads the path out of the payload and starts nothing for any other path (about 6 ms per common write on a loaded
    machine). A note under this project's own memory directory in Claude Code (projects/<project>/memory/*.md, with <project> the
    main working tree's path as the host names it, so every worktree of a repository shares it, under $CLAUDE_CONFIG_DIR or
    ~/.claude, or where autoMemoryDirectory points in your own settings or the project's .claude/settings.local.json)
    is recorded as a memory in this machine's private tree, with a marker naming the file and a hash of its content, once
    per content, under a new channel, host-memory-mirror, which starts ON (mnema switch off host-memory-mirror stops it):
    the one channel that writes without a verb and begins on, by a recorded decision. A note in
    another project's directory, the index MEMORY.md and a note of type: user are never copied, and nothing goes to the public tree. A file under
    docs/adr/, docs/decisions/ or an adr/ directory, or a CLAUDE.md, AGENTS.md, GEMINI.md, host rules file,
    plan, handoff or ledger whose new lines open as Ruling:, Decision: or a correction does, gets one line naming
    mnema decision import <the directory or file> or record_decision when the record cites it nowhere, once per session and file; it records
    nothing, and mnema switch off decision-file-written stops it. The line at Stop now also counts the notes copied
    since the session opened. readHostMemory in @mnema/core is the one reading of a memory file, for this and for
    decision import --format claude-memory. Two limits are known and left as they are: a project path longer than 200
    characters is compared by its first 200 (the host cuts the name there and adds a hash this does not compute), so two
    such projects that share those 200 are not told apart; and the name pattern *plan*.md also matches a name such as
    explanation.md, whose new lines still have to open as a decision does before any line is given.
  • The record carries an .editorconfig, and mnema doctor and the brief warn of the other tools that would rewrite it. .mnema/.editorconfig
    sets insert_final_newline, trim_trailing_whitespace, end_of_line, charset, indent_style and indent_size to unset
    (no root = true, so nothing else of the folders above is cut); it is written where the README is (the founding, the init
    that completes a founded project, and the first signed write that grows a record with none), never over an existing file and
    never by a read or a refused write, and it is not part of the proof (FORMAT.md section 4). mnema doctor and the hook's brief
    also name a .pre-commit-config.yaml with a rewriting hook, a Biome, dprint or lint-staged configuration that does not leave
    .mnema/ out, each with the line to add, and say when a file could not be read well enough to confirm; none of those files is
    edited. The .prettierignore is now written where prettier is declared: the project's own directory or the nearest one above it up to
    the git root, instead of the git root alone.
  • After a question the agent asked the person is answered, the agent is told which tool records the choice. A new verb,
    mnema settled, answers a hook after the host's question tool ran with one sentence of fact beside the answer: that a
    question was answered, that record_decision records a choice it settled with the options not taken as alternatives,
    and that nothing was recorded from it. It records nothing and reads which tool ran, never the answer. The plugin declares it
    as a PostToolUse hook on AskUserQuestion, behind a shell that starts no process for any other tool (VS Code runs the
    plugin's hooks whatever their matcher says); the hooks files of Codex (request_user_input), Copilot CLI
    (AskUserQuestion), Gemini CLI (ask_user, AfterTool) and OpenCode (question, tool.execute.after) carry the same
    hook, documented and not measured. A new channel, choice-settled, is on until mnema switch off choice-settled. Held in
    Claude Code against the real binary, where the sentence arrives inside the question's result.
  • With user-corrections switched on, the answers the person gave to the agent's questions are proposals too. At
    Stop, besides the openings that correct, mnema corrections records the option the person chose in the host's question
    tool (read from the result the host writes in the transcript, which the reader passed over before) and the prompt typed
    right after a response that ended in a question mark, each quoted with its question, as a proposed decision in this
    machine's private tree, titled Answer: …, with an email address in the title replaced by <email> as in the body. An
    answer that only assents or refuses ("yes", "ok", "go ahead", "pode") is not recorded. The channel is still off until
    somebody switches it on.
  • A subagent that begins is handed the brief of the session. The plugin gains a SubagentStart hook that runs
    mnema brief --hook and hands the document to the subagent as it starts, byte for byte what the opening hands the session,
    under the event the host routes the reply by. It is the opening's channel and the opening's switch (mnema switch off brief-document stops both), and it is silent where there is no project. It is held against the real Claude Code binary; VS
    Code documents the event and reads the same hooks file, and was not measured on it.
  • docs/evidence.md carries a presence map. For each host and each moment of the work (a choice settled with the person, the
    host's own memory, a plan or decision file, the opening, an edit, the end of a response, a subagent's start and stop) it says
    whether the host offers something the plugin could ride, and how that is known: held by a test, documented and not measured,
    no channel, or not read. It is generated from the host table, and a copy edited by hand is red.
  • A project founded before the README completes it on its first signed write. The first write to a public record that has no
    .mnema/README.md (any verb, or any MCP tool) leaves the same page mnema init leaves and says so in one line, on stderr for a
    verb and in the tool's reply for the server. It is made only after the record grew: a read, a refused write and a write to a
    tree that does not travel leave the folder as it was, and a README that is already there is never replaced. Only the README is
    written this way, and only inside .mnema/: the .prettierignore is still edited by mnema init alone. The session brief
    (mnema brief --hook, never the file a person redirects it into) gains one line where mnema doctor would add the line .mnema/ to the
    .prettierignore (the same function), saying the formatter can rewrite the signed record and that mnema init protects it.
  • mnema decision review goes through the decisions awaiting a judgement, one by one, at a terminal, with no id to copy. It
    lists what is proposed in the order mnema status lists it, shows each one's ADR, title, reason and what it turned down,
    and asks: accept, reject, skip or quit. It asks for one note at the start (the default says the date and that it was reviewed
    with the verb), used for every verdict unless a note is written after the letter, and ends with how many were accepted,
    rejected and skipped. Each verdict is the move decision move makes, through the same gate, key and refusal codes; a refusal
    on one decision is said and the review goes on. It is a person's: it signs with your own key, refuses --which, and says
    when MNEMA_AGENT_KEY is set that it does not use it. Without a terminal it writes nothing, refuses with
    DECISION_REVIEW_NEEDS_A_PERSON and prints the decision move accept <ids> --note command that rules the same
    decisions; with nothing awaiting, it says so and exits 0.
  • A plugin and a mnema of different versions now say so. A mnema older than the plugin is the pair that breaks: the
    plugin may ask it for something it never learned, and a refused hook was silence. The hook that opens a session now compares
    the version mnema --identify answers with the plugin's own and, when the binary is the older, adds one line after the
    document (or alone, where the binary printed nothing) saying the two do not match and giving the command that fixes it,
    npm i -g @mnema/code@<the plugin's version>. The hook still exits 0 and blocks nothing. mnema doctor says the same for
    the plugin Claude Code lists as installed, in the direction that applies: a binary older than the plugin gets the npm
    command, and a binary newer than the plugin (which works) gets claude plugin update. A binary newer than the plugin adds
    nothing to the session.
  • mnema init leaves a README.md in .mnema/ and keeps prettier away from the record. The page says what the folder is,
    that the record changes with the work and each change goes in the same commit as the work it describes, that nothing in it
    is edited or reformatted, that the private keys are not there, and how to verify it. It is not part of the proof: both readers
    ignore it, and FORMAT.md section 4 lists it beside .gitignore. Where the repository has a .prettierignore or declares
    prettier (a dependency, a prettier key in package.json, or a .prettierrc* at the root), init adds the line .mnema/
    to the .prettierignore at the root of the repository, creating it only when prettier is declared, and says so; a repository
    with no prettier is left as it is. The session brief gains one line saying that recording changes .mnema/ and that the change
    goes in the same commit as the work. Run again in a project that is already founded, init adds what that project
    lacks of the README and the .prettierignore line, says what it added and touches nothing else of the record, and
    mnema doctor points at either when it is missing (it writes nothing; the fix it names is mnema init).
  • mnema usage --tools counts how many times each MCP tool was called, from a file this machine keeps. For each call
    the server answers and counts it appends one line (the instant, the tool's name, whether the tool writes, and ok or the code of
    the refusal) to <data directory>/tool-calls/<digest of the project>.jsonl, in the home and never in the repository.
    Never an argument, a word an agent wrote or a record's id; no event, no signature, no change of format, and verify
    does not read it. The verb prints, per tool, the calls, the refusals and the first and last date, and says it counts
    only what the MCP server on this machine answered. A call refused while validating its arguments (they do not match the
    tool's input schema) never reaches the tool and is not counted. It is on until mnema switch off tool-call-count; on a machine
    with no key of its own yet nothing is kept and no directory is made.

Changed

  • A write over MCP says the directory of the project it fell in, whether or not it named one. In the project at <path>. followed only a write that carried a project. It now follows every write that landed in a project's tree
    (not the global one), a move by id (task_transition, decision_transition, skill_transition) and a retraction
    included: after a reload the workspace can hold another checkout of the same repository, and an id the clone also holds
    used to move there without a word.

  • The agent a fact names, and a relation, are asked what a recipe prints in their place. --which "<name>" was
    recorded as the executor; --rel src/a.ts as the relation. Both are refused with NOT_A_REFERENCE, by the door
    every write passes (a which that is a marker; a relation that is a path: one that starts with /, ./ or ../, or has a separator and a file extension, or names a file or directory that exists in the project; and/or and v1.2 stay labels).

  • resume, focus and the resume inside bootstrap read the runs of every project of the workspace. A session that
    wrote first in a project its client listed second was answered lastRun: null and no open run. While no identity signs
    for the session (a machine with no key, before the first write) the sentence about the connection now also says that
    actor is empty because of that.

  • read_record and bootstrap say when a record was moved twice out of one state by machines that had not seen each
    other.
    show and the brief said it; the agent was served the last state alone. The sentence is the same
    function's, as a block beside the payload.

  • The server's instructions say to record here even what is also kept elsewhere. The handshake text now asks that a decision or a note be recorded as the work happens and also when the same thing is already in a plan, a ledger, CLAUDE.md or the host's own memory, because this is the signed copy and the one later sessions read back. To stay under 2,048 characters (the text is now 2,013) it drops the sentence that the record outlasts the session, a parenthesis about the mnid, and shortens the last paragraph; the recording-decisions skill says the same in one sentence.

  • In VS Code and Cursor, a write no rule can meet no longer starts mnema. The gate there is a process per write, and most
    of its cost was loading mnema, paid even in a project whose record addresses no path. The plugin's handler now reads the
    stored lines of the project's committed tree, of its private tree and of the machine's global tree itself, and where none
    holds a link under governs, asks-for-a-person or refuses-a-write it answers what mnema would answer there, nothing,
    without starting it. A canonical line holds that relation byte for byte, so the search cannot miss one. Every doubt starts
    mnema as before: a tree it cannot list, a line that is not UTF-8, not canonical, or not of a kind, a version and a shape
    the first published reader declared (the plugin carries a copy of those declarations, held to the reader's by a test), so a
    record mnema cannot read still refuses every write. Nothing is kept between two writes, so a rule that arrives by git pull is met at the next one. Measured on one Linux machine under load, 50 runs each, in a project with one accepted rule and
    no address: the handler went from about 330 ms (Cursor) and 290 ms (VS Code) at the median to about 50 ms; with a rule that
    refuses, it costs what it did. Claude Code's hook, a call into the server, is unchanged.

  • The links check after the merge reads docs/ too, and osv-scanner runs weekly. The job that asks the network for every address of the READMEs once a change is on main now also reads every Markdown page under docs/; it is still never a check on a pull request, and still opens one issue for the broken ones. osv-scanner now also runs on Mondays against the unchanged lockfile, so an advisory published against a dependency nobody touched shows up; a finding fails that run and shows in the Actions tab, and opens nothing else. gitleaks stays on pull requests and on main.

  • Two scanners now read the repository in CI, outside the required checks. gitleaks reads the whole history for a committed credential and osv-scanner reads pnpm-lock.yaml for a dependency with a published advisory, on every pull request and on main. Both are release binaries pinned by version and SHA-256. The first reading found no credential: every match was a public test vector, a made-up fixture or a fingerprint, and .gitleaks.toml names each class and why. It found no advisory.

Fixed

  • A title made only of spaces is refused, like one made only of punctuation. task create " " recorded a task
    named with blanks (and a decision, a skill, an observation topic): NOT_A_TITLE, in words that do not echo the spaces.
    The empty string stays refused as it was.
  • retract and the retract_note and skills tools take an ADR-<n> label like every other verb that takes an
    id.
    The label became the decision's id, which retract then names as a decision; a label two trees both carry is
    refused with both ids (AMBIGUOUS_LABEL).
  • The release job that tags waits for npm to serve the five packages. npm can take minutes to serve a version it has just
    accepted, and the single check right after the publish failed the 0.1.1 run. The job now asks every 30 seconds, up to
    20 times (about ten minutes), goes on as soon as all five answer, and otherwise fails saying how long it waited.
  • mnema check run --key refuses a key that is not Ed25519, as key restore --agent and key request --agent --key do. A
    P-256 or an RSA key file was accepted and then failed further on; it is now refused up front with UNREADABLE_KEY and
    the same account of what is wrong with the key (an agent's key is an Ed25519 one), ending with the way to make a checker key, and nothing is recorded.
  • Both verifiers check a tail's proof of ownership under the key the tail id names, and nothing else. The Python
    verifier looked the key up by the proof's own signerFp, so a tailproof.json that another key of the record signed
    over the tail's id was verified there and refused by mnema verify. mnema verify checked the signature under the
    tail's key without comparing that key with the proof's signerFp, so a proof the tail's key signed naming another key
    was accepted there and refused by the Python verifier. Both now refuse a proof whose signerFp is not the fingerprint
    the tail id begins with, as signer-mismatch. mnema verify also recomputes the fingerprint of the key file it checks
    a tail proof under, as it already did for a checkpoint's key: a tail with no checkpoint yet, whose key file held
    another key that signed the proof, verified there and was refused by the Python verifier. No record a mnema binary
    writes is touched: a tail's proof is signed at birth by the key its id is named for.
  • mnema verify and the page mnema site writes refuse a committed key file whose name is not its key, as the Python
    verifier does.
    A keys/<name>.pub that no tail, checkpoint, enrolment or tail proof uses, and whose material does not
    hash to <name>, was read as a committed key with no tail, a note, and the record verified; the Python verifier refused
    it. Both now refuse it, in the same words: the file is named for a fingerprint its own material does not hash to
    (FORMAT.md section 6). A key nothing uses whose name is its fingerprint is still a note. No record a mnema binary writes
    is touched: every key file is written under the fingerprint of the key it holds, which records written by 0.1.1 and by
    this version, with a person, an agent key, a checker, a second machine and a restored and protected key, were checked for.

Changed

  • What verify says of a file when it is given a base commit is a sentence. A file the record held at the base commit and no longer
    holds, and a file that no longer begins with the bytes it held there, are said as since <rev> (<commit>): <file> was in the record there and is not here and since <rev> (<commit>): <file> no longer begins with the bytes it held there, without the gone: and rewritten: labels. The exit code and the JSON reading are unchanged.
  • The pages say what the rules hook costs per edit, host by host. Measured on one machine (version 0.1.1, a sandbox,
    50 runs each, without the real host): about 1 ms at the median per edit in Claude Code, where the hook is a call on a
    server already running (the server's own start, 270 to 350 ms, is paid once per session), and about 200 ms at the
    median per edit in Cursor and VS Code, which start a process per edit even where no rule addresses the file. Before,
    the pages gave only the orders of magnitude.
  • The step that checks the manifest signature of Claude Code, and the steps that read a host's version, in the
    host-contract workflow no longer rely on a pipe.
    A host that printed more than one line could fail the step on a
    broken pipe, and a signature check that reads its own output through a quiet grep could do the same.
  • The Python reader no longer carries type aliases it never checked, and its comments no longer say how many vectors
    carry a field.
    The comments say how many were published when the finding was made (October 2026).

npm: https://www.npmjs.com/package/@mnema/code/v/0.1.2