Repository navigation
Let a project inherit another repository's decisions at a pinned commit - #690
Merged
Merged
Conversation
…ts own brief section
…and register it with the surface's guards
…n the pinned commit is not there The committed pointer names a URL anyone could have chosen, and the session-start hook has 15 seconds. Only `inherit set` and `inherit update` reach the origin, with a 10 second limit.
…exempting them A call passes with the config file or with both `-c` settings on its own command line.
Refuse transport helpers (ext::) and other schemes by name, and pin the protocols git may speak.
…-at-a-commit # Conflicts: # packages/code/tests/the-command-handed-over-runs-as-handed.test.ts
felipesauer
added a commit
that referenced
this pull request
Oct 5, 2026
…it (#690) ## What A project can now inherit another repository's decisions, pinned to one commit. - `.mnema/inherit.json` (committed) holds the origin (a git URL or a path) and a full commit hash. - `mnema inherit set <origin> [--at <revision>]` and `mnema inherit update [--to <revision>]` print what would be inherited (for `update`, what changes between the current and the new commit) and write the pointer only with `--write`. - `mnema brief` prints the inherited decisions in force in a section of their own that names the origin and the commit. They are read, never signed by the project, and the project's `verify` does not cover them. - The record is verified at the pinned commit. One that does not verify, or that this machine cannot read, prints no decision, and the brief says which. - Git is run through `execFile` with an argument array. The copy lives under the mnema home, outside the project tree. Only `set`, `update`, and a brief that finds its pinned commit missing touch the network; with no network and no copy the brief says so and the rest still prints. Inheriting is trusting that repository at that commit; the help and the brief say only that. ## Tests - `commands/inherit.test.ts`: local origin repositories, no network. Covers plan without `--write`, the pointer file, the section, a record that does not verify, an unreachable origin with no copy, and update showing the change before moving the pointer. - `tests/a-project-inherits-a-record.test.ts`: the same through the built binary, with the project's own record held byte-identical across `set` and `update --write`. - Mutations: skipping the verification makes the tampered-record case fail; writing the pointer without `--write` makes the plan cases fail. The surface's registries and goldens (verbs, completions, help page, censuses) are updated for the new verb. The guard on automatic git maintenance now exempts shipped modules, which call git with `-c maintenance.auto=false` themselves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A project can now inherit another repository's decisions, pinned to one commit.
.mnema/inherit.json(committed) holds the origin (a git URL or a path) and a full commit hash.mnema inherit set <origin> [--at <revision>]andmnema inherit update [--to <revision>]print what would be inherited (forupdate, what changes between the current and the new commit) and write the pointer only with--write.mnema briefprints the inherited decisions in force in a section of their own that names the origin and the commit. They are read, never signed by the project, and the project'sverifydoes not cover them.execFilewith an argument array. The copy lives under the mnema home, outside the project tree. Onlyset,update, and a brief that finds its pinned commit missing touch the network; with no network and no copy the brief says so and the rest still prints.Inheriting is trusting that repository at that commit; the help and the brief say only that.
Tests
commands/inherit.test.ts: local origin repositories, no network. Covers plan without--write, the pointer file, the section, a record that does not verify, an unreachable origin with no copy, and update showing the change before moving the pointer.tests/a-project-inherits-a-record.test.ts: the same through the built binary, with the project's own record held byte-identical acrosssetandupdate --write.--writemakes the plan cases fail.The surface's registries and goldens (verbs, completions, help page, censuses) are updated for the new verb. The guard on automatic git maintenance now exempts shipped modules, which call git with
-c maintenance.auto=falsethemselves.