navid/veins / commit
04a6f304c4a4
Navid M <navidmomtahen@gmail.com> · 2026-11-26
parents: 2fe47dbfffde
Browse files at this commit · Download source
--- a/docs/SPECIFICATION_V1.adoc+++ b/docs/SPECIFICATION_V1.adoc@@ -51,6 +51,8 @@ === Conventions The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are used as described in RFC 2119. Byte order is little-endian unless stated. Sections marked _informative_ do not impose requirements.++Command-line options use Plan 9 style: a long option is a single dash followed by its name (for example `-message`, `-rev`, and `-verbose`). Short aliases MAY also be accepted. An unrecognized option MUST be reported as an error and MUST NOT be treated as an operand. `--` terminates option parsing; every argument after it is an operand. === Terminology @@ -482,8 +484,16 @@ The working copy is represented by a commit (conventionally `@`) recorded in the view per workspace. Before each command that reads or writes the working copy, veins MUST snapshot the files on disk into `@` (creating a new commit with the same change ID, and an operation if anything changed). Consequences: * There is no staging area and no stash. Every on-disk edit is captured in history and can be restored through the operation log.-* `vn new` starts a new empty change on top of `@`. `vn describe` sets a message. `vn commit -m <msg>` is `describe` followed by `new`.+* `vn new` starts a new empty change on top of `@`. `vn describe -message <msg>` sets a message. `vn commit -message <msg>` is `describe` followed by `new`. * Checking out a revision means making it (or a new empty child of it) the working-copy commit, then updating the files.++=== Empty changes++`@` has changes when its root tree differs from the root tree of its first parent. A working-copy commit with no parents has changes when its root tree is not empty; it is compared with the empty tree.++`vn describe` MUST NOT create a commit or operation when `@` has no changes and the requested message is identical to the current message.++`vn commit` MUST NOT create a commit or operation when `@` has no changes, regardless of the requested message. It MUST instead report that there is nothing to commit and leave the repository unchanged. In particular, veins does not create empty commits implicitly. === Snapshotting @@ -603,7 +613,7 @@ . Sidecar files are *never snapshotted* while their path is conflicted. Snapshotting skips any file whose name matches `<conflicted path>.(base|ours|theirs|theirsN|baseN)`. . If materializing a sidecar would overwrite a different tracked or untracked file, the command MUST fail before modifying the working copy and report the colliding path. . A file-versus-directory conflict is materialized with `<path>` set to the `ours` side and the other side written as `<path>.theirs` (a file or directory tree).-. `vn conflicts` lists each conflicted path, its kind, and for text conflicts the line ranges of the conflicting hunks within `<path>` and within each sidecar. The `--porcelain` format MUST be stable, tab-separated, and documented. An editor integration can use it.+. `vn conflicts` lists each conflicted path, its kind, and for text conflicts the line ranges of the conflicting hunks within `<path>` and within each sidecar. The `-porcelain` format MUST be stable, tab-separated, and documented. An editor integration can use it. . `vn status` shows conflicted paths and the number of conflicted commits in the ancestry of `@`. . Edits to `<path>` while the conflict is unresolved are *drafts*. The snapshot stores the draft as a blob, referenced from `.veins/working_copy/` and from the view of the working-copy operation, so that the edit is recorded and survives undo and checkout. A draft never alters the stored conflict. @@ -610,10 +620,10 @@ === Resolving * `vn resolve <path>` accepts the current content of `<path>` as the resolution, replacing the conflict entry with that blob.-* `vn resolve --take ours|theirs|base <path>` resolves to one term.-* `vn resolve --tool <cmd> <path>` runs an external merge tool with the sidecars and `<path>` as arguments (`$BASE`, `$OURS`, `$THEIRS`, `$OUTPUT` placeholders), then resolves from `$OUTPUT` if the tool exits successfully.+* `vn resolve -take ours|theirs|base <path>` resolves to one term.+* `vn resolve -tool <cmd> <path>` runs an external merge tool with the sidecars and `<path>` as arguments (`$BASE`, `$OURS`, `$THEIRS`, `$OUTPUT` placeholders), then resolves from `$OUTPUT` if the tool exits successfully. * On resolution, the sidecars for the path are deleted, and descendants are automatically rebased. Where the conflict cancels (for instance the same conflict appears in descendants), the descendants resolve without further user action.-* `vn resolve --list` is an alias of `vn conflicts`.+* `vn resolve -list` is an alias of `vn conflicts`. Resolution never requires every conflict to be handled at once. Conflicts can be partially resolved, and the working copy is always usable. @@ -729,7 +739,7 @@ === Leaving veins -`vn git export --all` followed by copying `.veins/git` to a normal `.git` directory MUST yield a git repository whose working tree is identical to the veins working copy, and whose history contains all exported commits, plus any conflict-free state. No other conversion is required. Users MAY keep using veins afterwards.+`vn git export -all` followed by copying `.veins/git` to a normal `.git` directory MUST yield a git repository whose working tree is identical to the veins working copy, and whose history contains all exported commits, plus any conflict-free state. No other conversion is required. Users MAY keep using veins afterwards. === Invariants @@ -752,9 +762,9 @@ |=== | URL form | Transport | Notes -| `ssh://[user@]host[:port]/path` | SSH. The client runs `ssh host vn serve --stdio <path>`. | Secure. No channel binding is available.-| `veins://host[:port]/repo` | TCP with TLS 1.3 (`vn serve --listen`). | Secure. Channel binding is the TLS exporter value. The client validates the server certificate against the system trust store, or against a pinned fingerprint set in `remote.<name>.tls-pin`.-| `file:///path` | Local. The client spawns `vn serve --stdio <path>`. | Secure (local process).+| `ssh://[user@]host[:port]/path` | SSH. The client runs `ssh host vn serve -stdio <path>`. | Secure. No channel binding is available.+| `veins://host[:port]/repo` | TCP with TLS 1.3 (`vn serve -listen`). | Secure. Channel binding is the TLS exporter value. The client validates the server certificate against the system trust store, or against a pinned fingerprint set in `remote.<name>.tls-pin`.+| `file:///path` | Local. The client spawns `vn serve -stdio <path>`. | Secure (local process). |=== Other transports (for example HTTP/2) MAY be added. A transport is *secure* if it provides confidentiality and integrity and authenticates the server to the client. Plain, unencrypted transports MAY be provided, but are *insecure* and subject to the restrictions in <<sec-auth,Authentication and authorization>>.@@ -805,7 +815,7 @@ . `HELLO`, then `AUTH` (omitted for an anonymous read of a repository that allows it), then `LIST_REFS`. . `NEGOTIATE` (for a clone, `haves` is empty and the server can skip to step 3). . `FETCH_SKELETON`. The client writes the records into a pack as they arrive, builds the index in one pass, and verifies each record's hash in parallel with receipt. Hashing uses multiple threads.-. The client chooses a chunk policy (`vn clone --blobs <policy>`):+. The client chooses a chunk policy (`vn clone -blobs <policy>`): * `head` (default): fetch all chunks needed to check out the target commit. * `none`: fetch no chunks. Everything is promised. * `all`: fetch every chunk in history.@@ -812,7 +822,7 @@ . For `head` or `all`, the client computes the set of chunk IDs it lacks from the received manifests and issues `GET_CHUNKS`. On an initial clone with `all`, the server MAY satisfy this directly by streaming its packs, because it knows the client has nothing. . In incremental fetches, the client sends `GET_CHUNKS` only for chunk IDs it does not already hold (found by index lookup). Revisions of a regenerated file share most chunks, so only the changed chunks cross the wire. -The client MAY verify hashes lazily in the background (`--verify=lazy`) but the default is eager. Failed verification MUST abort the operation and discard the received data.+The client MAY verify hashes lazily in the background (`-verify=lazy`) but the default is eager. Failed verification MUST abort the operation and discard the received data. [[sec-lazy]] === Lazy chunk fetching@@ -839,8 +849,8 @@ Two modes exist: -. `vn serve --stdio <repo>` serves one repository over standard input and output. It is used by the SSH and local transports.-. `vn serve --listen <addr:port> --root <dir> --tls-cert <file> --tls-key <file>` serves every repository under `<dir>` over TLS. The repository named in `HELLO` MUST be resolved relative to `<dir>`. Names containing `..`, absolute paths, or NUL MUST be rejected.+. `vn serve -stdio <repo>` serves one repository over standard input and output. It is used by the SSH and local transports.+. `vn serve -listen <addr:port> -root <dir> -tls-cert <file> -tls-key <file>` serves every repository under `<dir>` over TLS. The repository named in `HELLO` MUST be resolved relative to `<dir>`. Names containing `..`, absolute paths, or NUL MUST be rejected. Each repository's access policy is read from its own `.veins/access` file. @@ -892,7 +902,7 @@ * On POSIX systems `vn` MUST refuse to use a private key file that is readable or writable by group or others. * Private keys MUST NOT be written to repositories, configuration files, logs, or error messages. * A remote selects its key with `remote.<name>.key = <key name>`. The default key name is `default`.-* `vn key import --openssh <file>` MAY be offered to import an OpenSSH Ed25519 private key.+* `vn key import -openssh <file>` MAY be offered to import an OpenSSH Ed25519 private key. === Server access file @@ -925,7 +935,7 @@ |=== | Command | Effect -| `vn access add --role read\|write --key <public key or file> [--name <name>]` | Add a key.+| `vn access add -role read\|write -key <public key or file> [-name <name>]` | Add a key. | `vn access list` | List keys with role, name, and fingerprint, and whether anonymous read is on. | `vn access remove <fingerprint or name>` | Remove a key (revocation). | `vn access anonymous on\|off` | Add or remove the `anonymous read` directive.@@ -940,7 +950,7 @@ | `vn key generate <name>` | Create a key pair and print the public key and fingerprint. | `vn key list` | List local keys with fingerprints. | `vn key show <name>` | Print the public key.-| `vn key import --openssh <file>` | Import an OpenSSH Ed25519 key (optional feature).+| `vn key import -openssh <file>` | Import an OpenSSH Ed25519 key (optional feature). | `vn whoami [<remote>]` | Connect and report the role and key fingerprint the server grants. |=== @@ -1035,7 +1045,7 @@ === Deployment notes (informative) -* *Over SSH.* An SSH account that has a shell, or file access to the repository directory, can read and write the store directly and bypass veins' authorization entirely. To enforce read-only access, give users a restricted account whose only permitted command is the server, for example an `authorized_keys` entry of the form `command="vn serve --stdio /srv/veins/project",restrict ssh-ed25519 ...`. Then the veins keys, not the SSH accounts, decide each client's role.+* *Over SSH.* An SSH account that has a shell, or file access to the repository directory, can read and write the store directly and bypass veins' authorization entirely. To enforce read-only access, give users a restricted account whose only permitted command is the server, for example an `authorized_keys` entry of the form `command="vn serve -stdio /srv/veins/project",restrict ssh-ed25519 ...`. Then the veins keys, not the SSH accounts, decide each client's role. * *Public repositories.* Add `anonymous read` and serve over the TLS transport. Authenticated keys then matter only for pushing. * *Revoking a key.* Run `vn access remove`. If the key was used to push something undesirable, history in the repository can still be rewritten or abandoned by an operator with local access. @@ -1048,16 +1058,16 @@ | Command | Description | `vn init [path] [-git-import:<gitdir>]` | Create a repository, optionally importing an existing git repo.-| `vn clone <url> [--blobs head\|none\|all]` | Clone via the native protocol.+| `vn clone <url> [-blobs head\|none\|all]` | Clone via the native protocol. | `vn status` | Working-copy changes, conflicts, files needing regeneration.-| `vn log [-r <revset>]` | Show history, flagging conflicted and divergent changes.-| `vn show <rev>`, `vn diff [-r <rev>]` | Display a commit or a diff.-| `vn new [<rev>...]`, `vn describe`, `vn commit` | Create and describe changes.+| `vn log [-rev <revset>]` | Show history, flagging conflicted and divergent changes.+| `vn show <rev>`, `vn diff [-rev <rev>]` | Display a commit or a diff.+| `vn new [<rev>...]`, `vn describe [-message <message>]`, `vn commit -message <message>` | Create and describe changes. `vn commit` does nothing when the working copy has no changes. | `vn mv`, `vn rm` | Move or remove tracked files, recording renames. | `vn merge <rev>...` | Create a merge commit. Never fails; may produce conflicts. | `vn rebase -s <rev> -d <rev>` | Rewrite commits onto a new parent, auto-rebasing descendants. | `vn squash`, `vn split`, `vn abandon` | Rewrite or remove changes.-| `vn conflicts [--porcelain]` | List conflicts with hunk line ranges.+| `vn conflicts [-porcelain]` | List conflicts with hunk line ranges. | `vn resolve` | See <<sec-merge,Merging and conflicts>>. | `vn regenerate` | Run configured regeneration commands for `merge=regenerate` paths. | `vn undo`, `vn op log`, `vn op restore <op>`, `vn op revert <op>` | Operation log commands.@@ -1064,12 +1074,13 @@ | `vn bookmark set\|list\|delete`, `vn tag` | Manage named pointers. | `vn fetch`, `vn push` | Native protocol. | `vn git import [-source:<gitdir>] [path]`, `vn git export`, `vn git fetch`, `vn git push`, `vn git remote` | Git bridge.-| `vn serve --stdio <repo>`, `vn serve --listen <addr:port> --root <dir> ...` | Run the native server over stdio or TLS.+| `vn serve -stdio <repo>`, `vn serve -listen <addr:port> -root <dir> ...` | Run the native server over stdio or TLS. | `vn key generate\|list\|show\|import` | Manage client keys. | `vn access add\|list\|remove\|anonymous` | Manage a served repository's access file (server side, local only). | `vn whoami [<remote>]` | Report the role and key fingerprint the server grants.-| `vn fsck`, `vn gc` | Verification and garbage collection.+| `vn fsck [-verbose]`, `vn gc` | Verification and garbage collection. | `vn config` | Read and write configuration.+| `vn help [<command>]`, `vn -help`, `vn version`, `vn -version` | Show usage or version information. |=== All commands that change state MUST be atomic with respect to the operation log: they either produce one operation or leave the repository unchanged.@@ -1178,7 +1189,7 @@ | M2 | Working copy snapshotting, `status`, `log`, `diff`, `describe`, `new`, operation log, `undo`, `op restore`, git export. | Round-trip SHA invariants hold. Crash-injection tests pass. | M3 | Conflict algebra, tree merge, file merge, renames, materialization with sidecars, `resolve`, rebase with auto-rebase, resolution memory. | Algebra property tests pass. Merge corpus replay explained. | M4 | Git import-back, refs, fetch/push through the mirror, pull request workflow. | A contributor pull request can be imported, merged, and shown as merged on the host.-| M5 | Native protocol: serve over stdio and TLS, authentication and authorization (`vn key`, `vn access`, `vn whoami`, anonymous read), clone, fetch, push, lazy chunks, `--blobs` policies. | P3 and P4 measured. Hostile-input tests pass. The authorization matrix tests pass: anonymous and `read` sessions never mutate the repository, and a revoked key loses access.+| M5 | Native protocol: serve over stdio and TLS, authentication and authorization (`vn key`, `vn access`, `vn whoami`, anonymous read), clone, fetch, push, lazy chunks, `-blobs` policies. | P3 and P4 measured. Hostile-input tests pass. The authorization matrix tests pass: anonymous and `read` sessions never mutate the repository, and a revoked key loses access. | M6 | Path policies (`regenerate`), gc, pack compaction, operation expiry, polish. | Long-running soak test with gc has no data loss. |=== @@ -1201,5 +1212,5 @@ . *Key lifetime.* Expiry dates on keys, and whether a time-limited key is worth the added file format. . *Signed refs and commit signing.* Authenticating ref values on insecure transports and attributing commits cryptographically. . *HTTPS transport.* Whether to add an HTTP/2 transport, which would help with proxies and firewalls and would need its own channel-binding definition.-. *Default TLS port and URL scheme.* No default port is specified for `vn serve --listen`.+. *Default TLS port and URL scheme.* No default port is specified for `vn serve -listen`. . *Line endings.* No `autocrlf`-style conversion exists. Users who work on mixed platforms and mirror to git may need a policy.--- a/docs/SPECIFICATION_V1.html+++ b/docs/SPECIFICATION_V1.html@@ -491,8 +491,9 @@ <li><a href="#sec-wc">6. Working copy</a> <ul class="sectlevel2"> <li><a href="#_model_review">6.1. Model <strong>(review)</strong></a></li>-<li><a href="#_snapshotting">6.2. Snapshotting</a></li>-<li><a href="#_checkout_safety">6.3. Checkout safety</a></li>+<li><a href="#_empty_changes">6.2. Empty changes</a></li>+<li><a href="#_snapshotting">6.3. Snapshotting</a></li>+<li><a href="#_checkout_safety">6.4. Checkout safety</a></li> </ul> </li> <li><a href="#sec-merge">7. Merging and conflicts</a>@@ -515,11 +516,12 @@ <li><a href="#_the_mirror_repository">8.1. The mirror repository</a></li> <li><a href="#_id_mapping">8.2. ID mapping</a></li> <li><a href="#_import_git_to_veins">8.3. Import (git to veins)</a></li>-<li><a href="#_export_veins_to_git">8.4. Export (veins to git)</a></li>-<li><a href="#_refs">8.5. Refs</a></li>-<li><a href="#_pull_request_workflow">8.6. Pull request workflow</a></li>-<li><a href="#_leaving_veins">8.7. Leaving veins</a></li>-<li><a href="#_invariants">8.8. Invariants</a></li>+<li><a href="#_lazy_git_backed_import_m1">8.4. Lazy git-backed import (M1)</a></li>+<li><a href="#_export_veins_to_git">8.5. Export (veins to git)</a></li>+<li><a href="#_refs">8.6. Refs</a></li>+<li><a href="#_pull_request_workflow">8.7. Pull request workflow</a></li>+<li><a href="#_leaving_veins">8.8. Leaving veins</a></li>+<li><a href="#_invariants">8.9. Invariants</a></li> </ul> </li> <li><a href="#sec-protocol">9. Native protocol</a>@@ -674,7 +676,10 @@ <div class="paragraph"> <p>The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are used as described in RFC 2119. Byte order is little-endian unless stated. Sections marked <em>informative</em> do not impose requirements.</p> </div>+<div class="paragraph">+<p>Command-line options use Plan 9 style: a long option is a single dash followed by its name (for example <code>-message</code>, <code>-rev</code>, and <code>-verbose</code>). Short aliases MAY also be accepted. An unrecognized option MUST be reported as an error and MUST NOT be treated as an operand. <code>--</code> terminates option parsing; every argument after it is an operand.</p> </div>+</div> <div class="sect2"> <h3 id="_terminology">1.6. Terminology</h3> <table class="tableblock frame-all grid-all stretch">@@ -1572,7 +1577,7 @@ <p>There is no staging area and no stash. Every on-disk edit is captured in history and can be restored through the operation log.</p> </li> <li>-<p><code>vn new</code> starts a new empty change on top of <code>@</code>. <code>vn describe</code> sets a message. <code>vn commit -m <msg></code> is <code>describe</code> followed by <code>new</code>.</p>+<p><code>vn new</code> starts a new empty change on top of <code>@</code>. <code>vn describe -message <msg></code> sets a message. <code>vn commit -message <msg></code> is <code>describe</code> followed by <code>new</code>.</p> </li> <li> <p>Checking out a revision means making it (or a new empty child of it) the working-copy commit, then updating the files.</p>@@ -1581,7 +1586,19 @@ </div> </div> <div class="sect2">-<h3 id="_snapshotting">6.2. Snapshotting</h3>+<h3 id="_empty_changes">6.2. Empty changes</h3>+<div class="paragraph">+<p><code>@</code> has changes when its root tree differs from the root tree of its first parent. A working-copy commit with no parents has changes when its root tree is not empty; it is compared with the empty tree.</p>+</div>+<div class="paragraph">+<p><code>vn describe</code> MUST NOT create a commit or operation when <code>@</code> has no changes and the requested message is identical to the current message.</p>+</div>+<div class="paragraph">+<p><code>vn commit</code> MUST NOT create a commit or operation when <code>@</code> has no changes, regardless of the requested message. It MUST instead report that there is nothing to commit and leave the repository unchanged. In particular, veins does not create empty commits implicitly.</p>+</div>+</div>+<div class="sect2">+<h3 id="_snapshotting">6.3. Snapshotting</h3> <div class="ulist"> <ul> <li>@@ -1606,7 +1623,7 @@ </div> </div> <div class="sect2">-<h3 id="_checkout_safety">6.3. Checkout safety</h3>+<h3 id="_checkout_safety">6.4. Checkout safety</h3> <div class="paragraph"> <p>A checkout or update that would overwrite or delete a file MUST do so only if the file’s current content matches the snapshot (i.e., it was snapshotted first). Because every command snapshots first, local edits are never lost.</p> </div>@@ -1854,7 +1871,7 @@ <p>A file-versus-directory conflict is materialized with <code><path></code> set to the <code>ours</code> side and the other side written as <code><path>.theirs</code> (a file or directory tree).</p> </li> <li>-<p><code>vn conflicts</code> lists each conflicted path, its kind, and for text conflicts the line ranges of the conflicting hunks within <code><path></code> and within each sidecar. The <code>--porcelain</code> format MUST be stable, tab-separated, and documented. An editor integration can use it.</p>+<p><code>vn conflicts</code> lists each conflicted path, its kind, and for text conflicts the line ranges of the conflicting hunks within <code><path></code> and within each sidecar. The <code>-porcelain</code> format MUST be stable, tab-separated, and documented. An editor integration can use it.</p> </li> <li> <p><code>vn status</code> shows conflicted paths and the number of conflicted commits in the ancestry of <code>@</code>.</p>@@ -1873,16 +1890,16 @@ <p><code>vn resolve <path></code> accepts the current content of <code><path></code> as the resolution, replacing the conflict entry with that blob.</p> </li> <li>-<p><code>vn resolve --take ours|theirs|base <path></code> resolves to one term.</p>+<p><code>vn resolve -take ours|theirs|base <path></code> resolves to one term.</p> </li> <li>-<p><code>vn resolve --tool <cmd> <path></code> runs an external merge tool with the sidecars and <code><path></code> as arguments (<code>$BASE</code>, <code>$OURS</code>, <code>$THEIRS</code>, <code>$OUTPUT</code> placeholders), then resolves from <code>$OUTPUT</code> if the tool exits successfully.</p>+<p><code>vn resolve -tool <cmd> <path></code> runs an external merge tool with the sidecars and <code><path></code> as arguments (<code>$BASE</code>, <code>$OURS</code>, <code>$THEIRS</code>, <code>$OUTPUT</code> placeholders), then resolves from <code>$OUTPUT</code> if the tool exits successfully.</p> </li> <li> <p>On resolution, the sidecars for the path are deleted, and descendants are automatically rebased. Where the conflict cancels (for instance the same conflict appears in descendants), the descendants resolve without further user action.</p> </li> <li>-<p><code>vn resolve --list</code> is an alias of <code>vn conflicts</code>.</p>+<p><code>vn resolve -list</code> is an alias of <code>vn conflicts</code>.</p> </li> </ul> </div>@@ -1999,7 +2016,7 @@ </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">blobs</p></td>-<td class="tableblock halign-left valign-top"><p class="tableblock">veins blob ID <→ git blob SHA-1 (cached, because computing it requires hashing the full content)</p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock">veins blob ID <→ git blob SHA-1. Lazy IDs embed the SHA-1, but the mapping is still recorded for materialization and export.</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">raw</p></td>@@ -2043,8 +2060,31 @@ </div> </div> <div class="sect2">-<h3 id="_export_veins_to_git">8.4. Export (veins to git)</h3>+<h3 id="_lazy_git_backed_import_m1">8.4. Lazy git-backed import (M1)</h3> <div class="paragraph">+<p>To keep import time independent of blob count and blob size, the M1 importer uses lazy blob IDs. It converts commits, trees, refs, the view, and the operation log, but it does not read, chunk, hash, or recompress blob bodies. A blob referenced by an imported tree is represented by a 32-byte lazy ID:</p>+</div>+<div class="literalblock">+<div class="content">+<pre>`"veins-gitoid"` (12 bytes) followed by the 20-byte git SHA-1</pre>+</div>+</div>+<div class="paragraph">+<p>The body remains in the <code>.veins/git</code> mirror. Tree entries keep their normal file, executable, or symlink kind, but the target is a lazy blob ID instead of a canonical veins blob ID.</p>+</div>+<div class="paragraph">+<p>Reading a lazy blob reads the corresponding git object from the mirror. <code>vn checkout</code> uses this path, so an imported repository checks out to the same bytes as git. <code>vn fsck</code> treats lazy blob references as promised objects; they are not errors merely because they are absent from <code>.veins/store</code>.</p>+</div>+<div class="paragraph">+<p>Lazy IDs are deterministic for a given git blob. The <code>blobs</code> mapping table records them so that a later materialization pass can replace lazy references with canonical chunked veins blobs. Materialization is a separate operation and will rewrite the affected tree, commit, and view IDs. Deleting <code>.veins/git</code> while lazy references remain makes those blobs unavailable.</p>+</div>+<div class="paragraph">+<p>Lazy import is an importer fast path. Repositories created by a native veins clone use canonical chunked blobs and do not depend on a git mirror.</p>+</div>+</div>+<div class="sect2">+<h3 id="_export_veins_to_git">8.5. Export (veins to git)</h3>+<div class="paragraph"> <p><code>vn git export</code> writes the commits reachable from bookmarks and tags into the mirror.</p> </div> <div class="olist arabic">@@ -2083,13 +2123,13 @@ </div> </div> <div class="sect2">-<h3 id="_refs">8.5. Refs</h3>+<h3 id="_refs">8.6. Refs</h3> <div class="paragraph"> <p>Bookmarks map to git branches (<code>refs/heads/<name></code>), and tags to git tags. A bookmark’s remote tracking state is stored in <code>remote_refs</code> of the view and mirrored under <code>refs/remotes/<remote>/</code> in the mirror. Fetching moves remote refs, not local bookmarks. Local bookmarks move on explicit command or merge.</p> </div> </div> <div class="sect2">-<h3 id="_pull_request_workflow">8.6. Pull request workflow</h3>+<h3 id="_pull_request_workflow">8.7. Pull request workflow</h3> <div class="olist arabic"> <ol class="arabic"> <li>@@ -2111,13 +2151,13 @@ </div> </div> <div class="sect2">-<h3 id="_leaving_veins">8.7. Leaving veins</h3>+<h3 id="_leaving_veins">8.8. Leaving veins</h3> <div class="paragraph">-<p><code>vn git export --all</code> followed by copying <code>.veins/git</code> to a normal <code>.git</code> directory MUST yield a git repository whose working tree is identical to the veins working copy, and whose history contains all exported commits, plus any conflict-free state. No other conversion is required. Users MAY keep using veins afterwards.</p>+<p><code>vn git export -all</code> followed by copying <code>.veins/git</code> to a normal <code>.git</code> directory MUST yield a git repository whose working tree is identical to the veins working copy, and whose history contains all exported commits, plus any conflict-free state. No other conversion is required. Users MAY keep using veins afterwards.</p> </div> </div> <div class="sect2">-<h3 id="_invariants">8.8. Invariants</h3>+<h3 id="_invariants">8.9. Invariants</h3> <div class="paragraph"> <p>Conforming implementations MUST satisfy:</p> </div>@@ -2164,17 +2204,17 @@ <tbody> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>ssh://[user@]host[:port]/path</code></p></td>-<td class="tableblock halign-left valign-top"><p class="tableblock">SSH. The client runs <code>ssh host vn serve --stdio <path></code>.</p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock">SSH. The client runs <code>ssh host vn serve -stdio <path></code>.</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Secure. No channel binding is available.</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>veins://host[:port]/repo</code></p></td>-<td class="tableblock halign-left valign-top"><p class="tableblock">TCP with TLS 1.3 (<code>vn serve --listen</code>).</p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock">TCP with TLS 1.3 (<code>vn serve -listen</code>).</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Secure. Channel binding is the TLS exporter value. The client validates the server certificate against the system trust store, or against a pinned fingerprint set in <code>remote.<name>.tls-pin</code>.</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="file:///path" class="bare">file:///path</a></code></p></td>-<td class="tableblock halign-left valign-top"><p class="tableblock">Local. The client spawns <code>vn serve --stdio <path></code>.</p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock">Local. The client spawns <code>vn serve -stdio <path></code>.</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Secure (local process).</p></td> </tr> </tbody>@@ -2295,7 +2335,7 @@ <p><code>FETCH_SKELETON</code>. The client writes the records into a pack as they arrive, builds the index in one pass, and verifies each record’s hash in parallel with receipt. Hashing uses multiple threads.</p> </li> <li>-<p>The client chooses a chunk policy (<code>vn clone --blobs <policy></code>):</p>+<p>The client chooses a chunk policy (<code>vn clone -blobs <policy></code>):</p> <div class="ulist"> <ul> <li>@@ -2319,7 +2359,7 @@ </ol> </div> <div class="paragraph">-<p>The client MAY verify hashes lazily in the background (<code>--verify=lazy</code>) but the default is eager. Failed verification MUST abort the operation and discard the received data.</p>+<p>The client MAY verify hashes lazily in the background (<code>-verify=lazy</code>) but the default is eager. Failed verification MUST abort the operation and discard the received data.</p> </div> </div> <div class="sect2">@@ -2380,10 +2420,10 @@ <div class="olist arabic"> <ol class="arabic"> <li>-<p><code>vn serve --stdio <repo></code> serves one repository over standard input and output. It is used by the SSH and local transports.</p>+<p><code>vn serve -stdio <repo></code> serves one repository over standard input and output. It is used by the SSH and local transports.</p> </li> <li>-<p><code>vn serve --listen <addr:port> --root <dir> --tls-cert <file> --tls-key <file></code> serves every repository under <code><dir></code> over TLS. The repository named in <code>HELLO</code> MUST be resolved relative to <code><dir></code>. Names containing <code>..</code>, absolute paths, or NUL MUST be rejected.</p>+<p><code>vn serve -listen <addr:port> -root <dir> -tls-cert <file> -tls-key <file></code> serves every repository under <code><dir></code> over TLS. The repository named in <code>HELLO</code> MUST be resolved relative to <code><dir></code>. Names containing <code>..</code>, absolute paths, or NUL MUST be rejected.</p> </li> </ol> </div>@@ -2522,7 +2562,7 @@ <p>A remote selects its key with <code>remote.<name>.key = <key name></code>. The default key name is <code>default</code>.</p> </li> <li>-<p><code>vn key import --openssh <file></code> MAY be offered to import an OpenSSH Ed25519 private key.</p>+<p><code>vn key import -openssh <file></code> MAY be offered to import an OpenSSH Ed25519 private key.</p> </li> </ul> </div>@@ -2586,7 +2626,7 @@ </thead> <tbody> <tr>-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn access add --role read|write --key <public key or file> [--name <name>]</code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn access add -role read|write -key <public key or file> [-name <name>]</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Add a key.</p></td> </tr> <tr>@@ -2631,7 +2671,7 @@ <td class="tableblock halign-left valign-top"><p class="tableblock">Print the public key.</p></td> </tr> <tr>-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn key import --openssh <file></code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn key import -openssh <file></code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Import an OpenSSH Ed25519 key (optional feature).</p></td> </tr> <tr>@@ -2817,7 +2857,7 @@ <div class="ulist"> <ul> <li>-<p><strong>Over SSH.</strong> An SSH account that has a shell, or file access to the repository directory, can read and write the store directly and bypass veins’ authorization entirely. To enforce read-only access, give users a restricted account whose only permitted command is the server, for example an <code>authorized_keys</code> entry of the form <code>command="vn serve --stdio /srv/veins/project",restrict ssh-ed25519 …​</code>. Then the veins keys, not the SSH accounts, decide each client’s role.</p>+<p><strong>Over SSH.</strong> An SSH account that has a shell, or file access to the repository directory, can read and write the store directly and bypass veins' authorization entirely. To enforce read-only access, give users a restricted account whose only permitted command is the server, for example an <code>authorized_keys</code> entry of the form <code>command="vn serve -stdio /srv/veins/project",restrict ssh-ed25519 …​</code>. Then the veins keys, not the SSH accounts, decide each client’s role.</p> </li> <li> <p><strong>Public repositories.</strong> Add <code>anonymous read</code> and serve over the TLS transport. Authenticated keys then matter only for pushing.</p>@@ -2853,7 +2893,7 @@ <td class="tableblock halign-left valign-top"><p class="tableblock">Create a repository, optionally importing an existing git repo.</p></td> </tr> <tr>-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn clone <url> [--blobs head|none|all]</code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn clone <url> [-blobs head|none|all]</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Clone via the native protocol.</p></td> </tr> <tr>@@ -2861,16 +2901,16 @@ <td class="tableblock halign-left valign-top"><p class="tableblock">Working-copy changes, conflicts, files needing regeneration.</p></td> </tr> <tr>-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn log [-r <revset>]</code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn log [-rev <revset>]</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Show history, flagging conflicted and divergent changes.</p></td> </tr> <tr>-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn show <rev></code>, <code>vn diff [-r <rev>]</code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn show <rev></code>, <code>vn diff [-rev <rev>]</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Display a commit or a diff.</p></td> </tr> <tr>-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn new [<rev>…​]</code>, <code>vn describe</code>, <code>vn commit</code></p></td>-<td class="tableblock halign-left valign-top"><p class="tableblock">Create and describe changes.</p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn new [<rev>…​]</code>, <code>vn describe [-message <message>]</code>, <code>vn commit -message <message></code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock">Create and describe changes. <code>vn commit</code> does nothing when the working copy has no changes.</p></td> </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn mv</code>, <code>vn rm</code></p></td>@@ -2889,7 +2929,7 @@ <td class="tableblock halign-left valign-top"><p class="tableblock">Rewrite or remove changes.</p></td> </tr> <tr>-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn conflicts [--porcelain]</code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn conflicts [-porcelain]</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">List conflicts with hunk line ranges.</p></td> </tr> <tr>@@ -2917,7 +2957,7 @@ <td class="tableblock halign-left valign-top"><p class="tableblock">Git bridge.</p></td> </tr> <tr>-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn serve --stdio <repo></code>, <code>vn serve --listen <addr:port> --root <dir> …​</code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn serve -stdio <repo></code>, <code>vn serve -listen <addr:port> -root <dir> …​</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Run the native server over stdio or TLS.</p></td> </tr> <tr>@@ -2933,7 +2973,7 @@ <td class="tableblock halign-left valign-top"><p class="tableblock">Report the role and key fingerprint the server grants.</p></td> </tr> <tr>-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn fsck</code>, <code>vn gc</code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn fsck [-verbose]</code>, <code>vn gc</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Verification and garbage collection.</p></td> </tr> <tr>@@ -2940,6 +2980,10 @@ <td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn config</code></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Read and write configuration.</p></td> </tr>+<tr>+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>vn help [<command>]</code>, <code>vn -help</code>, <code>vn version</code>, <code>vn -version</code></p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock">Show usage or version information.</p></td>+</tr> </tbody> </table> <div class="paragraph">@@ -3248,7 +3292,7 @@ </tr> <tr> <td class="tableblock halign-left valign-top"><p class="tableblock">M5</p></td>-<td class="tableblock halign-left valign-top"><p class="tableblock">Native protocol: serve over stdio and TLS, authentication and authorization (<code>vn key</code>, <code>vn access</code>, <code>vn whoami</code>, anonymous read), clone, fetch, push, lazy chunks, <code>--blobs</code> policies.</p></td>+<td class="tableblock halign-left valign-top"><p class="tableblock">Native protocol: serve over stdio and TLS, authentication and authorization (<code>vn key</code>, <code>vn access</code>, <code>vn whoami</code>, anonymous read), clone, fetch, push, lazy chunks, <code>-blobs</code> policies.</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">P3 and P4 measured. Hostile-input tests pass. The authorization matrix tests pass: anonymous and <code>read</code> sessions never mutate the repository, and a revoked key loses access.</p></td> </tr> <tr>@@ -3314,7 +3358,7 @@ <p><strong>HTTPS transport.</strong> Whether to add an HTTP/2 transport, which would help with proxies and firewalls and would need its own channel-binding definition.</p> </li> <li>-<p><strong>Default TLS port and URL scheme.</strong> No default port is specified for <code>vn serve --listen</code>.</p>+<p><strong>Default TLS port and URL scheme.</strong> No default port is specified for <code>vn serve -listen</code>.</p> </li> <li> <p><strong>Line endings.</strong> No <code>autocrlf</code>-style conversion exists. Users who work on mixed platforms and mirror to git may need a policy.</p>@@ -3327,7 +3371,7 @@ <div id="footer"> <div id="footer-text"> Version 0.1-draft<br>-Last updated 2026-11-25 00:14:30 UTC+Last updated 2026-11-26 01:38:50 UTC </div> </div> </body>