cli-git native cutover runbook #
Purpose and how to use this document #
This document is the runbook for the cutover of the Git policy wrapper:
publishing the native crate,
installing it as a cargo: mise tool,
migrating consumers,
documentation,
and retirement of the TypeScript implementation.
The user's standing decision is that there is no hybrid and the old TypeScript goes
(doc/handover/cli-git-rust-implementation.md,
queue item "Commit path,
run as parallel lanes",
and the section User decisions 2026-10-05).
A read-only scout wrote it on 2026-10-12 against main at e1890fb471.
The publish-prep lane (branch feat/cli-git-native-publish-prep,
from main at beb44949e7) prepared the
publication on 2026-10-13 and rewrote Publishing the native crate to the state it reached.
It was updated on 2026-10-13 after the user's answers,
against main at f7a4d08160.
Between the two,
package/git-policy/cli changed only in tests
(0c4d65094e,
dfcab2b44e,
5717784913:
binary_commit_tests.rs and commit_convergence_tests.rs).
Facts measured on 2026-10-12 carry that date;
facts measured on 2026-10-13 say so.
Nothing in the real installation was installed,
replaced,
or published by either author;
the probes are listed in Evidence basis.
Terms:
the incumbent is the TypeScript wrapper (every file of package/git-policy/cli outside src/native/);
native is the Rust executable cli-git-native built from package/git-policy/cli/src/native/.
Paths starting with src/,
bin/,
e2e/,
perf/ or native-interop/ are relative to package/git-policy/cli/;
every other path is repository-relative.
file:line citations were read in this checkout.
How to use it:
Decisions lists what is settled and what is open to veto.
Publishing the native crate is the prerequisite of the install.
Installation sequence with rollback and Order of the retirement commits give the order of work.
Not established lists the facts no probe settled.
Decisions #
Decided by the user on 2026-10-13 #
- Install route:
publish the native crate to crates.io and install it as a
cargo:mise tool, like the published lintermonochromatic-lint(rootmise.no-env.toml,package/linter/monochromatic-lint). The answer is the approval for this crate's first publication. Thecargo publishitself is run by the orchestrator after the verification described inSteps that remain; the owner-only parts are the API token and the Trusted Publishing form. Carried out inPublishing the native crate. - Hk cleanup:
retire the task
cleanup:hk-git-configanddoc/runbook/remove-retired-hk-git-config.mdnow.src/maintenance/hk-config-cleanup*.ts, its fixture test and the tasktest:hk-config-cleanupgo withsrc/. The troubleshooting document that points at the task is rewritten to the manual removal (seeDocumentation). - Rollback window:
it ends right after the installed wrapper is verified.
The incumbent's shim,
distand dependency links stay only until that verification passes. Afterwards rollback is versioned (pin the previous published crate version); returning to the incumbent then means a fresh install from the pinned revision (seeRollback). - First native workflow: Linux only. Hosted macOS and Windows runners wait for the trailing Windows checks.
Adopted without asking on 2026-10-13, open to veto #
- Stale worktrees:
switch after the worktrees in active use have merged
main, runmise run sync:filesand runmise install; stale worktrees fail with the migration message quoted under hazard 3. - Verification tools with the incumbent as reference:
pin the last incumbent revision (its hash goes in the retirement commit and the behavior ledger);
delete the commit,
configuration and dependent-version differentials;
keep
native:interopand give it an incumbent-provisioning step from the pinned revision. - Release and CI jobs:
build the crate from the checkout with
cargo build --release --lockedand putgitfirst onPATHfor the step. - The four authoring and policy packages (
package/git-policy/{api,forbidden-strings,markdown-lint,repository}): delete after their consumers have moved. - Performance:
keep
perf/*.json, delete the harness, its tasks andcli-git-performance.ymlnow. - Package
build: becomes the release build ofcli-git-native. - Crate name:
monochromatic-git-policy-cli(rationale and cost underName). - Location of the
gitlink: a gitignored per-worktree directory.cache/cli-git-bin, first inPATH(rationale underInstall the published tool).
Evidence basis #
Read-only probes run for this document, all on 2026-10-12:
command -v git,type -a git,git --version,git cli-git --help,git cli-git status,mise env --json(PATH only),mise exec -- command -v gitandmise exec -- git --versionin this worktree.ls,sha256sumandrgover the main checkout'spackage/git-policy/cli/dist,node_modulesand.git.findover.gitfor transaction directories and locks, andpgrepfor running wrapper processes.gh apiGET calls for branch protection and rulesets ofAquaticat/Monochromatic.- A scratch repository under
${HOME}/temp/agentdriven through a private PATH entry that linked the integration worktree's debugcli-git-nativeasgit; it was deleted afterwards and nothing production was shadowed. It produced the exact refusal texts quoted underCoordination hazards and detection. - Reads of the handover, planning and decision documents named in the citations.
Read-only or throwaway probes run on 2026-10-13, after the user's answers:
GET https://crates.io/api/v1/crates/<name>for the candidate names and for the dependency crates.- Downloads of
forbidden-strings0.4.1,forbidden-regex0.1.1 andmonochromatic-jsonc-edit0.1.1 from crates.io into a scratch directory, compared with the local sources. cargo package,cargo package --list,cargo publish --dry-runandcargo checkin the package and in throwaway copies under${HOME}/temp/agent, withCARGO_TARGET_DIRoutside the repository. No upload happened.cargo build --release --locked --offline --bin cli-git-nativeinto a scratch target directory.mise2026.10.0 in a throwawayMISE_DATA_DIR, state directory and project, with a real install ofmonochromatic-lint0.1.1 standing in for the crate (no published crate of this package exists yet).mise env --json,mise install,mise exec,mise reshim.git diffbetween the gated commit and the current head forpackage/git-policy/cli.
How the wrapper is installed and run today #
The installed incumbent #
The git that a session in this repository resolves is a pnpm shim,
not a wrapper binary:
command -v gitprints/var/home/user/Monochromatic/node_modules/.bin/git;type -a gitthen lists/usr/bin/gitand/bin/git.git --versionprintsgit version 2.55.0.- That shim is a 2,314-byte POSIX script (dated Sep 22) whose last lines
exec nodeonnode_modules/@monochromatic-dev/git-policy-cli/dist/final/node/index.mjs.node_modules/@monochromatic-dev/git-policy-cliis a symlink to../../package/git-policy/cli. - So the program every session runs is
package/git-policy/cli/dist/final/node/index.mjsof the main checkout: 1,439,660 bytes, built Oct 10 14:48, SHA-256d7c26d53eb463d8f3d0137905931d59bac5164915e81301a7e8206fb83dc0b47.dist/is ignored (.gitignore:53), so the artifact is not in any commit. - The bundle is not standalone.
dist/final/node/index.mjs:18to:21importvalibot,yuku-parser,yuku-astandignoreas bare specifiers. They resolve through the symlinks inpackage/git-policy/cli/node_modules/(intonode_modules/.pnpm). The incumbent therefore runs only while the cli package's ownnode_moduleslinks exist. - The shim exists because the root manifest depends on the package (
package.json:36"@monochromatic-dev/git-policy-cli": "workspace:*") and the package declaresbin.git(package/git-policy/cli/package.json:17).pnpm installlinks that bin intonode_modules/.bin/git; the shim is an install-state file, not a tracked file.
git cli-git trust and the trust registry #
- The incumbent's management commands are
trust,untrust,status,check,fix(git cli-git --help).git cli-git statusin this worktree prints a JSONtrust-statusevent with"trusted":truefor the worktree'scli-git.config.ts. - Trust is consent to run the executable configuration
cli-git.config.ts. Records live outside the repository in~/.local/state/cli-git/trust/v1(the directory exists; its contents were not read). - A changed config needs
git cli-git trust --yesbefore the incumbent runs it again. The linter cutover did exactly that after the user approved it (doc/handover/unified-linter-cutover.md, sectionLanding choreography, step 3). - The native executable retires these commands:
git cli-git trustandgit cli-git statusprint "git cli-git trust is retired. cli-git now reads cli-git.config.jsonc as data ..." and exit 0, change nothing, and leave the old records in place and unread (observed with the integration worktree's debug build; decision indoc/handover/cli-git-rust-implementation.md,User decisions 2026-10-05). This difference is the cheapest way to tell which wrapper agitis: the incumbent prints JSON forstatus.
Tasks that build or install the incumbent #
mise run //package/git-policy/cli:build(templatebuildinmise.no-env.toml:536-538, fan-out tobuild:js, thenbuild:js:node, which runsrolldown --configLoader native --config rolldown.node.config.ts) producesdist/. The rootmise run buildfans out to every package'sbuild(mise.no-env.toml:690-693,vars.fanout_packages), andprepareAndBuildispreparethenbuild(mise.no-env.toml:1086).pnpm install(root taskprepare:pnpm:install) creates thenode_modules/.bin/gitshim.mise run //package/git-policy/cli:pack:npm(package/git-policy/cli/mise.toml:141) builds the unpublished tarballdist/pack/monochromatic-dev-git-policy-cli-0.0.1.tgz; the e2e image, the perf tasks and the packed-trust test depend on it.- The previous wrapper replacement was manual:
build
distin a branch worktree, then copy it over the live one by rename (doc/handover/unified-linter-cutover.md,Landing choreography, step 3).
PATH mechanics on this host #
- The root
mise.tomlis generated frommise.no-env.tomlby file-enforcer (mise.toml:1-5); the[env]block with_.pathis written bygenerateMiseTomlinfile-enforcer.config.ts:656-720._.pathlistsnode_modules/.binfirst (file-enforcer.config.ts:680) and then everypackage/*/*/node_modules/.binfound on disk, all relative to the config root. mise env --jsonrun in this worktree gives a PATH whose first mise entries are this worktree'snode_modules/.bin, then the other package bin directories, then the mise tool directories, so_.pathentries precede tool directories and/usr/bin. Probed on 2026-10-13 in a throwaway project (mise 2026.10.0):{{env.HOME}}and~in_.pathboth expand to the home directory, a relative entry resolves against the config root, and_.pathentries precede toolbindirectories.- This session's PATH instead names the main checkout's
node_modules/.binfirst, because the session was started from the main checkout. PATH is fixed when a process starts; changingmise.tomldoes not change running sessions. - A worktree has its own
node_modules/.bin/gitshim pointing at its ownpackage/git-policy/cli/dist. In this worktree nodistexists, somise exec -- git --versionfails withCannot find module '.../cli-git-lane-cutover-scout/package/git-policy/cli/dist/final/node/index.mjs'. The same failure is recorded forghindoc/troubleshooting/gh-implicit-repository-git-wrapper.md. Sessions in worktrees only work because they inherit the main checkout's PATH. - Real Git is
/usr/bin/git2.55.0. The incumbent's debug output in this session shows it resolving/usr/bin/gitthrough common-platform-path priority.
The native executable and how it is built #
- The crate is
package/git-policy/cli/Cargo.toml(name = "monochromatic-git-policy-cli",version = "0.1.0", publishable since8285d98844on the publish-prep branch; seePublishing the native crate). Its binary iscli-git-native([[bin]], pathsrc/native/main.rs), deliberately not namedgit; the manifest comment says the repository's mise tool entry links it asgitafter installing it.Cargo.tomlis managed by file-enforcer (generateCargoManifests,file-enforcer.config.ts:1777), so comment edits are followed bymise run sync:files. - Host build:
mise run //package/git-policy/cli:native:buildrunscargo build --locked --offline --bin cli-git-native, a debug build for differentials (package/git-policy/cli/mise.toml:36-38). The integration worktree's debug binary is 93,671,240 bytes. No task builds or installs a host release binary. The host Rust toolchain isrust = nightly(mise.no-env.toml:101). The user's~/.cargo/config.tomlsetsbuild-dir(doc/decision/cargo-build-dir-host-cache.md), so intermediates are outside the package'starget/. - Container build:
mise run //package/git-policy/cli:test:e2e:concurrent:native:image(package/git-policy/cli/mise.toml:413,bin/e2e-native-container.mjs) compilescargo build --offline --locked --release --bin cli-git-nativeinrust:1.97-bookwormfrom a mount-free snapshot ofCargo.toml,Cargo.lock,README.md,src/nativeand the path dependencies, then adds it to the imagelocalhost/cli-git-concurrent-e2e-native:<tag>as/opt/native/cli-git-nativewith/opt/native/bin/gitlinked to it. That image starts fromlocalhost/cli-git-concurrent-e2e:latest, whose build packs the incumbent (package/git-policy/cli/e2e/concurrent-commits.Containerfile:56-59). Imagelocalhost/cli-git-concurrent-e2e:latesthas idb7cf6d8c1786;localhost/cli-git-concurrent-e2e-native:integrationhas idd04ea26e5350. - The container gate (
native:test:container) and the end-to-end suite passed on0ff1379f7d(doc/handover/cli-git-native-integration.md,Results).git diff 0ff1379f7d e1890fb471 -- package/git-policy/cliis empty, so currentmainhas the gated crate. - There is no release artifact yet:
the crate is unpublished and no workflow builds it.
A
git-named symlink to the executable is the form the binary tests use (src/native/binary_support.rs:74-75), so a symlinked install is a tested shape. - Runtime prerequisites the native wrapper finds itself:
real Git on PATH after the wrapper (floor 2.55.0,
src/native/git_version.rs:26),monochromatic-linton PATH (a mise shim at~/.local/share/mise/shims/monochromatic-lint; pinned"cargo:monochromatic-lint" = "0.1.1"atmise.no-env.toml:120),cli-git.config.jsoncat the repository top level, and.cache/forbidden-strings.rules.txtin each worktree (cli-git.config.jsoncnames it throughrulesFile). The scanner is linked in-process and needs no lookup.
What installing replaces #
Replaced:
the git that sessions resolve (today the shim to dist/final/node/index.mjs),
the trust workflow,
the executable configuration cli-git.config.ts,
and every Node process the incumbent starts per Git command.
Not replaced:
/usr/bin/git,
the user's trust records (left inert),
the monochromatic-lint shim,
the scanner source,
and .git/cli-git* state,
which both wrappers read
(doc/handover/cli-git-rust-implementation.md,
Adopted without a question,
first item).
Consumer inventory #
Every reference found with rg --hidden over the checkout (which honors .gitignore),
excluding .git,
node_modules,
target and pnpm-lock.yaml,
then classified.
Searched patterns:
git-policy-cli,
git-policy/cli,
cli-git.config.ts,
cli-git/ts,
hk-git-config,
hk-config-cleanup,
CLI_GIT_,
git cli-git,
git-executable,
dist/final/node/index.mjs.
Hidden directories searched:
.github,
.changeset,
.idea,
.agents,
.pi,
.serena,
.opencodereview,
.out-of-scope,
.claude-plugin.
No hits in .idea,
.agents,
.pi,
.serena,
.opencodereview,
.out-of-scope,
.claude-plugin,
tsconfig.json,
oxlint.config.ts,
socket.json,
.pnpmfile.mjs,
.pnpmfile.policies.json,
forbidden-strings.append.txt,
pnpm-workspace.yaml (its packages glob is
package/*/*,
pnpm-workspace.yaml:420-421,
so no workspace entry names the package).
The main checkout's .claude/settings.json has no hit;
*.local.* files were not read.
Root configuration and tasks #
package.json:36, the root devDependency on@monochromatic-dev/git-policy-cli: delete the line. This is the line that makespnpm installcreatenode_modules/.bin/git. Land it only in the final retirement commit (seeOrder of the retirement commits), because a laterpnpm installin the main checkout removes the incumbent's shim.mise.no-env.toml:678-684, taskcleanup:hk-git-config, runsnode package/git-policy/cli/src/maintenance/hk-config-cleanup-command.ts: delete it (the hk cleanup is retired; seeDecisions).mise.toml:679-685is the generated copy; edit onlymise.no-env.toml, thenmise run sync:files.mise.no-env.toml:1208-1212, taskchangeset:version, runsmise run //package/git-policy/repository:bump:dependents: migrate togit cli-git fix --all --policy mono/dependent-version-bump(release and CI jobs build the crate from the checkout; seeDecisions;doc/handover/cli-git-native-dependent-version.md, sectionWiring into the native executable, item "The release task"). The task's optional base-revision argument has no equivalent; the base isHEAD.cli-git.config.ts(root): delete after the native wrapper is installed and verified. It imports@monochromatic-dev/git-policy-cli/ts(cli-git.config.ts:11-12), the package's./tsexport, which issrc/authoring.tsand disappears withsrc/.cli-git.config.jsoncis its translation (all four optional policies andrulesFile). While both exist, nativegit cli-git checkprints alegacy-config-ignoredconfiguration warning (doc/handover/cli-git-native-config.md,Facts the integrator must know); deleting the TypeScript file ends it.cli-git.config.jsonc:2, the comment "Translated fromcli-git.config.ts": reword to state the file is the configuration, so the comment does not name a deleted file..changeset/config.json:21lists@monochromatic-dev/git-policy-cliunderignore: keep while the package name is kept. If the name goes, delete the line;@changesets/config4.0.1 filtersignorethroughglobMatch(node_modules/.pnpm/@changesets+config@4.0.1/node_modules/@changesets/config/dist/index.mjs:708-719,776) and does not reject unmatched names.pnpm-lock.yamlimporters: root.(:460-462) andpackage/git-policy/cli(:2044onward) change with the manifests. Regenerate through the package manager, inspect the diff, never hand-edit (LFW).package/config/pnpr/config.yaml:78lists@monochromatic-dev/git-policy-cli; the file is generated bygeneratePnprConfig(file-enforcer.config.ts:2062) from manifests that have an entry point, version and no exclusion. Removingmain,types,exportsandbinfrom the cli manifest drops the entry on the nextmise run sync:files.PNPR_EXCLUDED_PACKAGES(file-enforcer.config.ts:1884) names no git-policy package, so no exclusion edit is needed.slopo.ignore.txt:45,50,69,200,309,324,373carry duplicate-code dismissals whose subjects are deleted TypeScript orperf/files;:298namessrc/native/policy_registry.rsand stays. The file's own header (slopo.ignore.txt:40) already counts "10 dead pending a decision", so dead dismissals exist in it today and removal is cleanup, not a blocker.README.md:65("behind a side-effect-free policy authoring API") andREADME.md:262("policy authoring API, forbidden-strings policy"): reword; the authoring API is retired.AGENTS.md:1366andCLAUDE.md:1415say "Never preemptively bypassgit-policy-cliguards": the name is still the crate and package name, so keep.CLAUDE.mdis generated fromAGENTS.md.monochromatic-lint.config.jsonc:58-66scopes the native Rust path (package/git-policy/cli/src/native/**/*.rs): keep. Its comment cites a manual tasknative:lint:rustthat no longer exists inpackage/git-policy/cli/mise.toml; that staleness predates the cutover.
File-enforcer #
file-enforcer.config.ts:2276-2341: threePromise.allblocks (mirrorRepositoryPolicy,mirrorForbiddenStringsPolicy,mirrorMarkdownLintPolicy) copypackage/git-policy/{repository,forbidden-strings,markdown-lint}/srcintopackage/git-policy/cli/src/optional/. Delete all three in the same commit that deletessrc/optional/; otherwisemise run sync:filesregenerates the deleted files.package/dev-script/file-enforcer/src/generated-policy-contracts.unit.test.ts(76 lines, only these mirror fixtures at:49-55): delete with the mirrors.file-enforcer.config.ts:680: the static first_.pathentry..cache/cli-git-binis added here as the first entry (seeInstall the published tool), never by hand inmise.toml.generateCargoManifests(:1777) andgeneratePackageLicenseTexts(:534) keep working: the crate stays, itsLICENSES/followCargo.toml's license expression.
Continuous integration #
.github/workflows/cli-git-trust.yml: delete. It builds the TypeScript package at the Node floor, runsverify:supported-runtime, and exercises trust on three operating systems (ubuntu, macos and windows in the job matrix at:194-197; also:178,:187,:222-232); every job tests the retired trust subsystem. Itspathsfilterpackage/git-policy/**(:7,17) also means no native change ever triggered a native job: there is none..github/workflows/cli-git-performance.yml: delete (the performance harness and workflow go now;perf/*.jsonstays; seeDecisions). It triggers on version changes ofpackage/git-policy/cli/package.json(:5-11) and runsmise run //package/git-policy/cli:perf:lifecycle-latency, which depends onpack:npm..github/workflows/final-newline.yml:35-39: migrate. It installs the incumbent's dependency closure and runsnode package/git-policy/cli/src/trust/fixture/final-newline-workflow.ts, which clones the checkout and runs the incumbent's direct check. It needs the native executable in CI (built from the checkout, Linux only; seeDecisions) and a native replacement of that script..github/workflows/npm-release.yml:127runsmise run changeset:versionin a job that installs only node and pnpm (:100-118): afterchangeset:versioncallsgit cli-git fix, the job needs the native executable, built from the checkout (seeDecisions).- No workflow runs the native tests on macOS or Windows
(
doc/handover/cli-git-rust-implementation.md,Adopted without a question, item on hosted runners, is not implemented). - The first native workflow covers Linux only (see
Decisions)..github/workflows/cargo-publish.ymlhas the job groupgpc-*for the new crate on the publish-prep branch (Publishing the native crate,State); it never ran. - Branch protection of
main:required_status_checkshas emptycontextsandchecks, required signatures are on, and the only ruleset is "Copilot review" (gh api repos/Aquaticat/Monochromatic/branches/main/protectionand.../rulesets). Deleting workflows therefore strands no required check.
Sibling packages #
package/git/executable(the shared real-Git resolver,@monochromatic-dev/git-executable): migrate before install.package/git/executable/src/self-shim.ts:185-243isGitPolicySelfShimreturns "not a shim" for any ELF, PE or Mach-O header (:212), and the markers (:139-171) match only the incumbent's package name anddistpath. So the resolver would select the nativegitas "real Git" for its other consumers:resolveRealGitis called bypackage/pi-plugin/auto-mode/src/git-worktree-read-allowlist.ts:290and by the hk cleanup command (retired withsrc/; seeDecisions). On this host the common-path rule masks it (package/git/executable/src/resolve-real-git.tspromotes/usr/bin/gitwhen PATH exposes it), but not on a host whose Git is elsewhere. Reading whole binaries is not an option (doc/troubleshooting/starship-cli-git-command-timeout.md). Change: also treat a candidate whoserealpathbasename iscli-git-nativeas the wrapper, which holds because the installedgitis a symlink to the filecli-git-native(seeInstall the published tool). Keep the existing script markers, so a stale incumbent shim is still rejected. Tests to change:package/git/executable/src/native-executable.unit.test.ts:29(a marker inside an ELF must still not be scanned) andpackage/git/executable/src/resolve-real-git.unit.test.ts:79,92,102,540.package/git/executable/README.md:9documents the marker behavior. The native side already rejects the incumbent's markers (src/native/real_git_candidate.rs:91-94, testsrc/native/binary_resolution_tests.rs:206); keep them while stale shims can exist.package/git-policy/api,package/git-policy/forbidden-strings,package/git-policy/markdown-lint,package/git-policy/repository(the four authoring and policy packages): delete after the config, the release task and the cli mirrors are gone (seeDecisions). Their only consumers arecli-git.config.ts, the cli mirrors,package/git-policy/cli/bin/dependent-version-*.mjs(through@monochromatic-dev/git-policy-repository/ts),changeset:version, and their own READMEs (package/git-policy/repository/README.md:14-15,package/git-policy/markdown-lint/README.md:70-74).package/cli/forbidden-strings/README.md:118,:788-789,:799,:809: migrate text. They say rootcli-git.config.tsgives the policy the scanner path and that "the policy invokes the repository-built scanner directly"; the native wrapper links the scanner in-process and readsrulesFilefromcli-git.config.jsonc.package/cli/forbidden-strings/PERF.md:159,199-212cite incumbentperf/files and a packed tarball path: historical, keep.- In the package
package/oxlint-plugin/prefer-readonly-parameter-type, the comment at line 392 ofsrc/prefer-readonly-parameter-types/effect-member-result-relation.tscitespackage/git-policy/cli/src/policy-engine/manual-push-candidates.tsin a comment: replace the citation with the explanation it supports, since the file will not exist. package/ssg/aquati.cat/TODO.generalize-ssg.draft.md:286citespackage/git-policy/cli/package.json:8as a model for abinentry: cite another package that keeps abin.package/pi-plugin/auto-mode/README.md:371: no edit, it namesgit-executableonly.package/git-policy/cli.fuzz: keep. It depends on the crate by path (Cargo.toml:23) and copiesCargo.toml,Cargo.lock,README.mdandsrc/native(bin/planted-controls.mjs:21-24);src/controls.rs:30holds TypeScript pseudocode in a comment only.
Documentation #
- Live and wrong after the cutover:
package/git-policy/cli/SPEC.md(4,305 lines). It describes plugins, executable configuration and trust, and mentionscli-git.config.jsoncnowhere (measured on 2026-10-12: zero matches). The package README was rewritten for the native wrapper in4f5bc1d30cand needs no further change for the cutover. SPEC sections that exist for the retired surface, by heading and line:Public authoring declarations(:77),Authoring example(:628),Trust registry schema version 1(:1638),Trust consent protocol(:1796),Recursive enrollment and revocation(:1823),Relaxed-mode parser(:1895),TypeScript build contract(:1931),Package and user-boundary verification(:4268) andContract fixture verification(:4299).Configuration validation(:718) needs the JSONC schema. The native behavior ledger cites SPEC line numbers (doc/planning/cli-git-rust-behavior-ledger.md), so edit the SPEC in one commit and re-cite the ledger in the next, or cite by heading. The README must keep existing:Cargo.tomlreadmeandinclude,bin/test-native-container.mjs:62, andpackage/git-policy/cli.fuzz/bin/planted-controls.mjs:23read it. package/git-policy/cli/e2e/README.md:42-44: describesE2E_WRAPPERdefaulting toincumbentand the ELF-versus-script check.doc/runbook/remove-retired-hk-git-config.md: delete it with the task (seeDecisions).doc/troubleshooting/cli-git-hk-retirement-stale-hook-config.mdpoints at the runbook and the task: rewrite that section to the manual removal (git config --show-scope --get-regexp '^hook\.hk-'to list,git config <scope> --unset-all <key>to remove) and keep its root cause.doc/philosophy/agents.md:362citesDEFAULT_ALLOWED_WORKTREE_DIRSinpackage/git-policy/cli/src/allowed-worktree-dirs.ts: repoint todefault_allowed_worktree_dirsinpackage/git-policy/cli/src/native/effective_target.rs:118.doc/handover/cli-git-rust-implementation.mdqueue items at:1556-1558,:1593and the sentence "Current production tools remain active until cutover" (:1599), anddoc/handover/cli-git-native-integration.mdRemaining: update when the cutover lands; replace, do not append.- Historical records that cite incumbent paths and stay as written:
44 files in
doc/handover, 45 indoc/planning, 62 indoc/troubleshooting, 17 indoc/audit, 8 indoc/decision, 2 indoc/research, 1 indoc/artifact. Apply the repository's moved-identifier rule (WR6) only where a document is still read as current; put the retired incumbent's last commit hash (seeOrder of the retirement commits) at the top ofdoc/planning/cli-git-rust-behavior-ledger.mdso itssrc/...ts:NNcitations stay resolvable through Git history. package/git-policy/cli/doc/concurrent-commits-implementation-plan.md(1,388 lines, about 135 TypeScript path citations): historical implementation plan; keep.doc/runbook/forbidden-strings-out-of-band-rules.md:152(git cli-git check) anddoc/todo/forbidden-strings.md:18: still correct, no edit.
Retirement list #
Delete inside package/git-policy/cli #
src/exceptsrc/native/: 478 tracked files (188 inpolicy-engine/, 112 intrust/, 56 at the top level, 25 inworktree-copy/, 22 inparser/, 21 inoptional/, 17 inindex-lock/, 10 inrule/, 9 inshadow-repository/, 6 inhook-dispatch/, 6 inapi/, 4 inowner-lock/, 2 inmaintenance/), of which 110 are*.unit.test.ts.src/native/keeps its ownindex_lock_restart_manager.ps1anddependent_version_fixtures/unit_cases.json.rolldown.node.config.ts.perf/*.ts, the harness that installs a packed tarball (deleted now; seeDecisions);perf/*.jsonstays.dist/(ignored, on disk in the main checkout): remove after the verification passes, when the rollback window ends (seeDecisions).src/maintenance/goes withsrc/; the hk cleanup is retired with it (seeDecisions).- Tasks in
package/git-policy/cli/mise.toml:run(:74),build,build:js,build:js:node,watch:build,watch:build:js,watch:build:js:node(:78-95),verify:supported-runtime(:137),pack:npm(:141),test:built:trust(:153),test:hk-config-cleanup(:186),perf:lifecycle-latency(:190),perf:concurrent-commits(:255),test:e2e:concurrent(:378, the incumbent run) andtest:e2e:concurrent:native:surface(:428, compares incumbent with native). - Incumbent-bound verification bins (all need
src/index.ts,cli-git.config.ts, the packed incumbent or the planner inpackage/git-policy/repository):bin/differential-commit.mjs(runssrc/index.ts, line 388),bin/differential-config-*.mjsandbin/differential-repository-config.mjs(bin/differential-config-fixture.mjs:116-120,248-268copycli-git.config.ts, runsrc/index.ts, and trust the config), the 21bin/dependent-version-*.mjsfiles (import@monochromatic-dev/git-policy-repository/ts,bin/dependent-version-incumbent.mjs:23),bin/interop-native-container.mjsandnative-interop/*.mjs(copy the main checkout'sdistand/opt/cli-gitinto the image,bin/interop-native-container.mjs:55-79,146,211-212). The three differentials (commit, configuration, dependent-version) are deleted (seeDecisions). No surviving bin, e2e file or native test imports them (searchedbin,e2e,native-interop,mise.tomlandsrc/native: only the three tasksnative:config:differential,native:differential:commitandnative:differential:dependent-versionrun them). The interop binbin/interop-native-container.mjsandnative-interop/*.mjsstay, but copy the main checkout'sdistand/opt/cli-gitinto the image (bin/interop-native-container.mjs:55-79,146,211-212), so they cannot run unchanged until an incumbent-provisioning step from the pinned revision exists.
Keep inside package/git-policy/cli #
- The crate:
Cargo.toml,Cargo.lock,src/native/**(includingdependent_version_fixtures/unit_cases.json, which the native tests read and which stays as the recorded incumbent truth),README.md,SPEC.md,LICENSES/. - The end-to-end runner
e2e/(TypeScript run by Node inside the image) withe2e/commit-shape-trace.json. Edite2e/wrapper-selection-fixture.ts:16-26,60-80,167-219ande2e/wrapper-selection.unit.test.ts:26-57,68-87so the only wrapper kind is native and an unsetE2E_WRAPPERno longer selects the incumbent; deletee2e/wrapper-surface-probe.tsande2e/wrapper-surface-steps-fixture.tswith thesurfacetask; edite2e/concurrent-e2e-consumer.ts:12. Eight unit-test files remain undere2e/and keep running undertest:unit. - The native bins:
bin/test-native-container.mjs,bin/mutate-native-container*.mjs,bin/native-planted-controls.mjs,bin/native-*-snapshot.mjs,bin/native-verification-process.mjs,bin/build-git-test-image.mjs,bin/e2e-native-container.mjs(minus thesurfacesubcommand and the base-image coupling). perf/*.json(the incumbent's measured baselines): the accepted performance bar is "faster than the incumbent per scenario" (doc/handover/cli-git-rust-implementation.md,Adopted without a question), and the baselines are the incumbent side of that comparison. Theperf/*.tsharness runs a packed npm tarball (perf/manual-push-latency-contracts.ts:114,perf/lifecycle-latency-contracts.ts:144) and cannot run unchanged (deleted now; seeDecisions).- Tasks:
every
native:*task,test:git-image,e2e:concurrent:trace,test:e2e:concurrent:native:image,test:e2e:concurrent:native,native:lock:scanner, and the lint tasks named inWhat the manifest and tasks must become. - The fuzz sidecar
package/git-policy/cli.fuzzis untouched.
What the manifest and tasks must become #
package/git-policy/cli/package.jsonstays, becausee2e/andbin/still import workspace packages and the lint tasks need a manifest, but it stops being a published package:private: true; removemain,types,exports,bin,files,engines,publishConfig,sideEffects, and all runtimedependenciesthat onlysrc/used (ignore,rolldown,type-fest,typescript,yuku-ast,yuku-parser); keep the name soSGDholds and the.changeset/config.jsonentry stays valid. Imports measured in the survivinge2e/,perf/,bin/,native-interop/:@monochromatic-dev/module-test,@monochromatic-dev/module-caught-value,@monochromatic-dev/module-logger,nano-spawn(onlyperf/),valibot(onlybin/differential-config-compare.mjs:11), plus@monochromatic-dev/config-typescriptfortsconfig.jsonand@types/node. Dropnano-spawnandvalibottogether with the files that use them. The@monochromatic-dev/git-executable,...-git-policy-repository,...-config-rolldown,...-module-async-time,...-module-fs-id,...-module-fs-pathand...-ownership-marker-foreign-borroweddevDependencies go withsrc/. Removingvalibot,yuku-*andignorefrom this manifest also removes the incumbent's runtime closure (hazard 5).tsconfig.json(package/git-policy/cli/tsconfig.json):includelosessrc/**/*.tsand*.config.ts;e2e/**/*.ts(andperf/**/*.tsif kept) remain.package.jsonstays inincludeonly if JSON modules are imported.lintis a template fan-out to direct child tasks (mise.no-env.toml:611-613templatelint,vars.fanout); it throws when no child exists. Keeplint:oxlint,lint:typesandlint:oxlint:paths(:99-131), and addlint:clippyrunningcargo clippy --locked --offline --all-targets -- -D warnings, matching the sibling Rust CLIpackage/cli/forbidden-strings/mise.toml(lint:clippy). Todaylintdoes not run Clippy at all: the crate is checked only bynative:clippyand the container gate. Addinglint:clippymakes the rootmise run lintcompile the crate; its duration was not measured.test:unit(:134) keeps globbing**/*.unit.test.tsinside the package; after retirement it runs the eighte2e/unit tests. The authority for Rust remainsnative:test:container; there is notesttask for the crate.build: rootmise run buildruns every package's task namedbuildand throws only when no package has one.buildbecomes the release build ofcli-git-nativeby decision (cargo build --release --locked --offline --bin cli-git-native, as the siblingpackage/cli/forbidden-stringsdoes), soprepareAndBuildkeeps producing an artifact; every rootmise run buildthen compiles the crate (about 71 seconds in one run on this host; seePublishing the native cratefor why that is not a clean-machine figure). Do not leave the templates that runrolldownin place.test:e2e:concurrent:image(:349) losesdepends = ["pack:npm"], theTARBALLbuild argument and the contextdist/pack;e2e/concurrent-commits.Containerfile:13,56-59losesARG TARBALL,COPY ${TARBALL}andnpm install. The image keeps Node at the floor, Git 2.39.5, 2.40.0 and 2.55.0,ssh-keygenand thecaught-valuelink. Itsengines.nodecomment (:17) must name the Node version itself, sinceenginesis gone. The taglocalhost/cli-git-concurrent-e2e:latestand the task names with:nativecan stay (renaming them touches the rerun commands of every handover); do not rename in the cutover commits.
Places where deleting the TypeScript breaks something not obviously covered #
- Root
mise run build,watch:buildandlintfan out by task name; the cli package's templates runrolldownand a fan-out. Removingsrc/androlldown.node.config.tswithout removing or replacing the tasks makesmise run buildfail in this package. test:e2e:concurrent:imageand the native e2e image depend onpack:npm. The native image requireslocalhost/cli-git-concurrent-e2e:latestand refuses to build without it (bin/e2e-native-container.mjs,buildImage).E2E_WRAPPERunset means the incumbent (e2e/wrapper-selection-fixture.ts:73-80).- File-enforcer regenerates
src/optional/**unless its three mirror blocks go (file-enforcer.config.ts:2276-2341). pnpm installafter the manifest edits prunespackage/git-policy/cli/node_modules/{valibot,yuku-parser,yuku-ast,ignore}, which the installeddistneeds: the incumbent stops working for every session still using the shim. The samepnpm installremovesnode_modules/.bin/gitin that checkout oncepackage.json:36is gone.mise run //package/git-policy/cli:native:config:differentialneedscli-git.config.tsand the incumbent;native:differential:commitneedssrc/index.ts;native:differential:dependent-versionneedspackage/git-policy/repository;native:interopneeds the incumbentdistand the packed/opt/cli-git. All four are verification tools whose reference side is the incumbent (seeDecisions: the three differentials are deleted,native:interopstays and needs provisioning from the pinned revision).- The trailing gates in
doc/handover/cli-git-rust-implementation.md(Gates that trail the cutover) include the old-and-new interop matrix, which needs a runnable incumbent after the retirement. package/git/executabletreats native executables as real Git (seeSibling packages).cli-git.config.tsimports the./tsexport that the retirement deletes, so after the deletion nothing can load it: the native wrapper never reads a.tsconfiguration, and the incumbent could not import the missing export. It must be deleted. Once it is gone, any session still on the incumbent runs only the core policies (hazard 6).- The hk cleanup command imports
@monochromatic-dev/git-executable/tsand@monochromatic-dev/module-logger/ts(src/maintenance/hk-config-cleanup-command.ts:14,hk-config-cleanup.ts:7); its disposable-fixture test lives insrc/trust/fixture/hk-config-cleanup-consumer.tsand is run bytest:hk-config-cleanup. Both go withsrc/. final-newline.yml,npm-release.yml(throughchangeset:version) andcli-git-trust.ymlcall deleted paths.package/git-policy/cli/Cargo.toml:9-10("the TypeScript executable remains active meanwhile") and:17-18("at cutover") become false comments; reword and runmise run sync:files.
Publishing the native crate #
This section holds the state of the publication preparation (branch feat/cli-git-native-publish-prep,
worktree
.claude/worktrees/cli-git-lane-publish-prep,
based on main at beb44949e7,
prepared on 2026-10-13),
the evidence behind it and the exact steps that remain.
Nothing was published,
tagged,
dispatched or installed.
cargo publish ran only as a dry run,
in a throwaway clone under ${HOME}/temp/agent.
State #
Everything that does not itself publish is committed on the branch.
Commit efdcfb7a72 is an intermediate state that does not build the wrapper:
it raises forbidden-strings to 0.5.0 while the wrapper's manifest still requires ^0.4.1 of the path
dependency,
which Cargo then refuses to resolve (reproduced in a throwaway clone with cargo metadata --offline).
It was pushed before this was noticed and cannot be amended.
Branch feat/cli-git-native-publish-prep-step1,
one commit 263d89dcc0 on beb44949e7,
is the same bump plus the
raised requirement and the relocked wrapper and fuzz lockfiles,
and cargo metadata --locked --offline succeeds
in package/git-policy/cli and package/git-policy/cli.fuzz there.
Merging it into this branch is clean and yields the tree of this branch exactly (git merge-tree).
efdcfb7a72:package/cli/forbidden-stringsis0.5.0. Thelock:memberstask was added to it, topackage/cli/forbidden-strings.fuzzand topackage/rust-module/forbidden-regex.bench(cargo update --offline --workspace), and run in each, so their lockfiles record only the new version.8285d98844:package/git-policy/cli/Cargo.tomlismonochromatic-git-policy-cli0.1.0(library namegit_policy_cliand binarycli-git-nativeunchanged), withoutpublish = false, with theincludelist, withforbidden-strings0.5.0andmonochromatic-jsonc-edit0.1.1(path keys kept), and with the[package.metadata.binstall]table copied frommonochromatic-lint(tgz for every target; only Linux GNU archives exist). The fuzz sidecar's dependency key, the build assertion message insrc/native/scanner_adapter.rsand both lockfiles (package/git-policy/cli/Cargo.lock,package/git-policy/cli.fuzz/Cargo.lock) follow the rename. Thelock:memberstask ofpackage/git-policy/cli.fuzzwas added for it:lock:subjectreseeds from the subject's lock and driftedccfrom 1.6.0 to 1.8.0.4f5bc1d30c:package/git-policy/cli/README.mddescribes the native wrapper. Each claim was checked against the code or against a run of the built executable in a scratch repository, andmonochromatic-lintand a CommonMark render (pandoc) report no finding.3e67dbe1d8:.github/workflows/cargo-publish.ymlhas the job groupgpc-*(gpc-detect,gpc-publish-crate,gpc-build-binary,gpc-create-release), aworkflow_dispatchchoicemonochromatic-git-policy-cliand the push pathpackage/git-policy/cli/Cargo.toml.actionlint1.7.12 (mise exec actionlint@1.7.12 -- actionlint .github/workflows/cargo-publish.yml) reports nothing; the repository has no task for it. The workflow was not run.41bc87db00: theincludeentries/Cargo.toml,/Cargo.lockand/README.mdare anchored, because Cargoincludepatterns are gitignore-style andREADME.mdalso packagede2e/README.md.monochromatic-linthas the same unanchored pattern; its package was not inspected.
Differences of the new jobs from the ml-* jobs:
- The matrix has
x86_64-unknown-linux-gnuandaarch64-unknown-linux-gnuonly. - The archive is
monochromatic-git-policy-cli-<version>-<target>.tar.gzholdingmonochromatic-git-policy-cli-<version>-<target>/cli-git-nativeandREADME.md; the release tag ismonochromatic-git-policy-cli-v<version>. cargo package --lockedandcargo publish --lockedare used, and the binary is built with--bin cli-git-native.gpc-create-releasealso needsgpc-publish-crate(commit8e69f0401c), so a run that cannot publish creates no release.- A smoke step runs
cli-git-native cli-git --helpfrom each built target before it is archived. gpc-publish-cratefirst waits (60 attempts, 30 seconds apart) until the crates.io index lists theforbidden-stringsversion thatCargo.tomlrequires, so one push may carry both version bumps. The extraction (sed) and the index lookup were run against the real index withforbidden-strings0.4.1 (found) and 0.5.0 (absent) before this section was written.
Semver check of forbidden-strings 0.4.1 to 0.5.0:
cargo-semver-checks 0.51.0 (installed with cargo binstall --root into a scratch directory,
the repository does not pin it) compared the local source against the extracted published 0.4.1 crate
(cargo semver-checks --baseline-root,
because the sandbox could not reach the index for --baseline-version).
Result:
"202 checks:
202 pass,
58 skip",
"no semver update required".
The tool compares public Rust API only;
the command-line surface changed additively (the --name-path option,
pathname findings and a longer help text,
src/cli.rs),
and the fuzzing feature still exists.
The minor bump therefore stands for the new Scanner API.
Verification without publishing,
on branch head 41bc87db00:
- Container gate
GIT_POLICY_NATIVE_IMAGE_TAG=publish-prep mise run //package/git-policy/cli:native:test:containerthroughgate-slot.ts: exit 0, imagelocalhost/git-policy-native-test:publish-prepid7808a101642dc688e81c9cefe2dcde303f26241b87a206a56996c17cafb95492. Test result lines: library 1633 passed, 0 failed, 6 ignored;native_binary105 passed, 0 failed, 1 ignored;native_candidates1 passed; thecli-git-nativeunit target 0 tests. The gate's Clippy (-D warnings, all targets) finished without a diagnostic. mise run //package/git-policy/cli:native:clippythrough the slot limiter: exit 0, finished without a diagnostic. Commits after41bc87db00change only the workflow job dependency in8e69f0401cand this document.- In a clean
--depth 1clone of the branch head,cargo package --locked --listlists 537 entries before the include fix and 536 files after it, which aresrc/native/**/*.rs,src/native/dependent_version_fixtures/unit_cases.json,src/native/index_lock_restart_manager.ps1,Cargo.toml,Cargo.toml.orig,Cargo.lock,README.md,.cargo_vcs_info.jsonand the two files inLICENSES/. No path matches.local.,.env,secret,tokenorcredential, ande2e/is absent. cargo package --locked --no-verifyin the clone, without a patch, exits 101 with "failed to select a version for the requirementforbidden-strings = "^0.5.0"... candidate versions found which didn't match: 0.4.1, 0.4.0, 0.3.0". That is the expected state untilforbidden-strings0.5.0 is on crates.io.- With the config patch
--config 'patch.crates-io.forbidden-strings.path="<clone>/package/cli/forbidden-strings"'(the patch makesCargo.lockchange, so--lockedcannot be combined with it, and--allow-dirtyis needed):cargo packageprints "Packaged 536 files, 4.9MiB (1.1MiB compressed)", "Verifying monochromatic-git-policy-cli v0.1.0" and finishes the verification build in 1 minute 18 seconds, exit 0;cargo publish --dry-run --no-verifyprints "Packaged 536 files, 4.9MiB (1.1MiB compressed)", "Uploading monochromatic-git-policy-cli v0.1.0" and "warning: aborting upload due to dry run", exit 0. Cargo also prints "patchforbidden-strings v0.5.0was not used in the crate graph" for the repository-side resolution, which uses the path dependency; the verification build of the unpacked crate used the patch.
Steps that remain #
The orchestrator and the owner run these in order.
The order matters because the new jobs also start on the push that lands the manifest.
gpc-create-release needs gpc-publish-crate,
so landing the branch on main before the crate is published and its Trusted Publishing form is saved makes the run
fail at the authentication step and creates no release;
the archives are still built and kept as artifacts for seven
days,
and the run can be repeated by a dispatch once the crate exists.
- Release
forbidden-strings0.5.0. Push commit263d89dcc0of branchfeat/cli-git-native-publish-prep-step1tomain, notefdcfb7a72(seeState). Ifmainmoved, cherry-pick it ontomainand reruncargo metadata --locked --offlineinpackage/git-policy/cli. The unprefixed jobs of.github/workflows/cargo-publish.ymldetect the bump (package/cli/forbidden-strings/Cargo.tomlversiondiffers from the push'sbefore) and publish through Trusted Publishing. If the push did not start the run, or it failed before the upload, dispatch it:gh workflow run cargo-publish.yml --ref main -f crate=forbidden-strings -f dry-run=false. Thedetectjob publishes the version found inCargo.tomlat that ref forcrate=forbidden-strings(read in the workflow; the dispatch was not run), and the unprefixed publish step is not idempotent, so never dispatch it after the version reached crates.io. Checkcurl -sS https://crates.io/api/v1/crates/forbidden-strings/0.5.0andgh release view forbidden-strings-v0.5.0. - Verify without a patch,
in a clean clone of the branch head,
bounded:
cargo package --lockedand thencargo publish --dry-run --lockedinpackage/git-policy/cli. The second must print "aborting upload due to dry run". This is the check that failed on 2026-10-13 and can only pass after step 1. - Owner:
follow
doc/runbook/publish-crate-first-time.mdfor the new crate: token namemonochromatic-git-policy-cli-bootstrap, thepublish-newandpublish-updatescopes, the shortest expiration, thencargo login. Whether the credential stored on this host authorizes publishing was not established (the file was not read; the runbook records a 403 for it on 2026-09-25). - Orchestrator:
run
cargo publish --lockedinpackage/git-policy/clifrom the verified branch commit (--lockedand no--no-verify, so the packaged crate compiles against crates.io once more). Checkcurl -sS https://crates.io/api/v1/crates/monochromatic-git-policy-cli/0.1.0. - Owner:
save the Trusted Publishing form at
https://crates.io/crates/monochromatic-git-policy-cli/settings(ownerAquaticat, repositoryMonochromatic, workflowcargo-publish.yml, empty environment), then revoke the bootstrap token. - Land the branch on
main(merging step 1's branch first or at the same time is harmless). The push startsgpc-detect(version0.0.1before,0.1.0after), which authenticates, skips the existing upload, builds both Linux archives and creates the release. Checkgh release view monochromatic-git-policy-cli-v0.1.0lists two archives, and that the workflow run for the push shows no failed job. The publication commit and the landed commit must have equalpackage/git-policy/clicontents (comparegit diff <published> <landed> -- package/git-policy/cli). - Continue with
Ordered stepsinInstallation sequence with rollback: step 3 verifies the published artifact in isolation, step 4 adds the tool entry (Install the published tool) and runsmise run lock:mise.
A dry-run dispatch before step 6 was not tried:
# Run from the repository top level.
gh workflow run cargo-publish.yml --ref feat/cli-git-native-publish-prep \
-f crate=monochromatic-git-policy-cli -f dry-run=true
GitHub's documentation fetched on 2026-10-13 does not say whether a workflow absent from the default branch can be dispatched on another ref, so it may be refused.
Name #
- The crates.io API (read-only
GET https://crates.io/api/v1/crates/<name>) answered "does not exist" on 2026-10-13 forgit-policy-cli,cli-git-native,cli-git,cli-git-wrapper,monochromatic-git-policy-cli,monochromatic-cli-gitandmonochromatic-git-policy. Every candidate was free. - Repository precedent is mixed.
Published with the
monochromatic-prefix:monochromatic-jsonc-edit,monochromatic-lint,monochromatic-nested-wayland-session. Published bare:forbidden-strings,forbidden-regex(doc/research/unified-linter-naming.md, sectionRepository facts). The three prefixed crates are the newer ones. - Adopted,
open to veto (see
Decisions) and applied in8285d98844: the crate ismonochromatic-git-policy-cli. A published name cannot be renamed, the bare name is generic, and the prefix matches the newest releases. The library namegit_policy_clikeeps everygit_policy_cli::path inpackage/git-policy/cli.fuzz/src/*.rs. The mise tool name iscargo:monochromatic-git-policy-cli. - Keeping the bare name would need the rename reverted in
8285d98844and the name substituted wherever this document names the crate. - The binary stays
cli-git-native. Renaming it before first publication would touch 21 files outsidedoc/(counted withrg --files-with-matches); the word "native" loses its contrast with the incumbent after retirement, but the installedgitlink hides it.
Packaging evidence #
Registry state on 2026-10-13:
forbidden-strings 0.4.1 (published 2026-09-17),
forbidden-regex 0.1.1,
monochromatic-jsonc-edit 0.1.1 (2026-10-06),
monochromatic-lint 0.1.1.
cargo package --offlinefails when the local registry index cache lacks the required version ("failed to select a version for the requirementforbidden-strings = "^0.4.1"... candidate versions found which didn't match: 0.1.9" on 2026-10-13). This is not a manifest defect; do not use--offlinefor the packaging steps.- The published
forbidden-regex0.1.1 andmonochromatic-jsonc-edit0.1.1 are sufficient. A comment-insensitive comparison of theirsrcagainst the local sources found no code difference formonochromatic-jsonc-edit, and forforbidden-regexonly local-binding renames (for exampleNode::Repeat { node: body, .. }) plus a test-only change insrc/gate_tests.rs. Neither needs a republish. forbidden-strings0.4.1 on crates.io lacksCandidateScan,ScanFinding,ScannerandCacheWarning(commit0696e56c4c, 2026-10-04, is after that release), which is why the wrapper needs 0.5.0.cargo build --release --locked --offline --bin cli-git-nativein a fresh target directory finished in about 71 seconds on this host (one run,CARGO_BUILD_JOBS=4, behind the slot limiter, under unrelated load); the binary is 9,028,800 bytes. That bounds the cost of a source install through thecargo:backend on this host only: the user's~/.cargo/config.tomlsets a sharedbuild-dir(doc/decision/cargo-build-dir-host-cache.md), so a freshCARGO_TARGET_DIRdoes not guarantee cold intermediates, and the figure is not a clean-machine install time. The build script's slowness is contained by[profile.release.build-override] opt-level = 3, which applies because the crate declares its own[workspace].Cargo.tomlis managed by file-enforcer (generateCargoManifests) with present-seeded guards.mise run sync:filesafter the edits left the manifest unchanged, so a deletedpublish = falsestays deleted.
What does not block #
- The license (
LGPL-3.0-or-later) andLICENSES/LGPL-3.0-or-later.txt,LICENSES/GPL-3.0-or-later.txt. - The lockfile:
--lockedpackaging succeeded with the committedCargo.lock. description,repository,homepageandreadmefields are present.keywordsandcategoriesare absent and optional.- The path dependencies:
cargo drops
pathfrom the packaged manifest and resolves from crates.io, so thepathplusversionform stays in the repository. [[test]]targets and the compile-time files: theincludelist keepssrc/native/**/*.rs, the two non-Rust files and the lockfile.src/native/config_repository_tests.rs:36reads a path outside the crate, so the crate's own tests do not run from the unpacked archive; no consumer of the archive runs them.rust-versionis undeclared; the gates build with Rust 1.97 (bin/e2e-native-container.mjsimagerust:1.97-bookworm). Declaringrust-version = "1.97"is optional and records the tested toolchain, not a measured minimum.- Without the
[package.metadata.binstall]tablecargo-binstallfinds no archive and mise compiles from source (doc/troubleshooting/mise-cargo-binstall-falls-back-to-compiling.md); the table is present.
Install the published tool #
How the cargo: backend names things (mise 2026.10.0,
observed with the installed monochromatic-lint and a real
install into a throwaway MISE_DATA_DIR):
- The installed file is
<mise data>/installs/cargo-<crate>/<version>/bin/<bin name>, so the executable iscli-git-native, notgitand not the crate name. Thecargo:backend has no option to rename it, and abin_pathoption is ignored for this backend. - Never make the crate's binary or a link in that
bin/directory be namedgit. A probe with agitentry in an installed tool'sbin/mademise reshimcreate<mise data>/shims/git; on this host that directory comes before/usr/binin every shell, including outside the repository (positions 131 and 135 of this session'sPATH). - The wrapper behaves as the wrapper under any file name.
It recognizes itself through
current_exe(src/native/real_git.rs:453,src/native/commit_command.rs:167), and hook entries are symlinks to the canonical file, not to thegitlink (src/native/hook_dispatch_entries.rs:80). A relink ofgitmid-transaction is therefore harmless; removing the version directory it resolves to (mise prune, an uninstall, or reinstalling the same version) is not.
The git link comes from a tool-level postinstall that writes a symlink in a gitignored per-worktree directory,
and that directory is the first _.path entry.
Probed in a throwaway project with a real cargo:monochromatic-lint install (stand-in for the crate):
postinstall = { run = "...", when = "always" }runs onmise installeven when the tool is already installed (when = "always"creates the link in a new worktree where the tool was installed earlier). It does not run onmise exec,mise envor shell activation.- The postinstall's
PATHis not guaranteed to hold a workingnode: in a throwaway data directory without Node, a first attempt with an inline Node program failed with "node is not a valid shim". Use coreutils only. - Atomic relink:
create the link under a temporary name,
then
mv --no-target-directoryit overgit. Rerunning it repeatedly kept one valid link. _.path:{{env.HOME}}/...and~/...both expand to the home directory; a relative entry resolves against the config root;_.pathentries precede toolbindirectories inPATH. So a relative.cache/cli-git-binfirst entry works in every worktree.
The tool entry for mise.no-env.toml (the pin needs a comment,
as the repository requires for pins):
# mise.no-env.toml
# Pinned so a release of the wrapper reaches the repository only together with its configuration and policies.
# The postinstall links the executable as `git` in a gitignored per-worktree directory that `_.path` puts first.
# It never lives in the tool's own `bin/`, because mise would then create a global `git` shim.
# `os = ["linux"]` because only Linux archives are released and the code never compiled elsewhere.
"cargo:monochromatic-git-policy-cli" = { version = "0.1.0", os = ["linux"], postinstall = { run = "mkdir --parents \"$MISE_CONFIG_ROOT/.cache/cli-git-bin\" && ln --symbolic \"$MISE_TOOL_INSTALL_PATH/bin/cli-git-native\" \"$MISE_CONFIG_ROOT/.cache/cli-git-bin/.git.$$\" && mv --no-target-directory \"$MISE_CONFIG_ROOT/.cache/cli-git-bin/.git.$$\" \"$MISE_CONFIG_ROOT/.cache/cli-git-bin/git\"", when = "always" } }
The _.path change is in generateMiseToml in file-enforcer.config.ts (the array that starts with
'node_modules/.bin'):
put '.cache/cli-git-bin' before it,
then run mise run sync:files.
Never edit the generated mise.toml by hand.
Then mise run lock:mise records the version in mise.lock.
Why per worktree and not one user-level directory:
the pin and the link live in the same checkout,
so a worktree on an older pin keeps its own version,
and one worktree's mise install never repoints the link of another.
The cost is that .cache/cli-git-bin of the main checkout serves every session started from the main checkout,
in whatever worktree they later enter,
because the session's PATH is fixed at its start.
os = ["linux"] was probed:
on this Linux host os = ["macos"] made mise install install nothing ("all tools are installed"),
and os = ["linux"] made mise install --dry-run report "would install".
No workflow installs the tool by default:
every jdx/mise-action step in .github/workflows runs mise install with named tools,
so the entry reaches a runner only when a step names it.
Each checkout needs mise install once after it merges the change,
because the link directory is per worktree;
until then its PATH entry points at a missing directory and git resolves to /usr/bin/git without the wrapper.
That is the same failure mode the incumbent has when node_modules/.bin/git is missing.
Rollback is pinning the previous version,
running mise install in each worktree (the postinstall relinks),
and
mise run lock:mise.
The installed bytes are what the release workflow built with the runner's toolchain, not the bytes the container gate tested. User-boundary verification of the installed artifact is therefore the only proof for the installed file.
Installation sequence with rollback #
Preconditions #
- The crate is published,
its release archives exist,
and the published version passed the isolated verification
(steps 2 and 3 of
Ordered steps). - The published head's
package/git-policy/cliequals the gated one except for test files:git diff 0ff1379f7d <head> -- package/git-policy/clilists only*_tests.rsfiles (three commits on 2026-10-12 and 2026-10-13 do), and the container gate passes on<head>withGIT_POLICY_NATIVE_IMAGE_TAG=cutoverand every container command throughnode "${HOME}/temp/agent/gate-slot.ts". The installed bytes come from the release workflow's toolchain, not from that gate, so the user-boundary verification is the only proof for the installed file. - The incumbent identity is recorded:
main's
HEAD, thedist/final/node/index.mjsSHA-256, and the id oflocalhost/cli-git-concurrent-e2e:latest(values on 2026-10-12 are inHow the wrapper is installed and run today). The incumbent is not a single file (hazard 5); the rollback artifact before verification is the shim plus its install state, and afterwards the pinned revision. - The Git on the host is 2.55.0 or newer (it is 2.55.0;
src/native/git_version.rs:26). - Every worktree that will commit during or after the switch has merged
main, runmise run sync:filesand runmise install(hazards 3 and 4). Stale worktrees are not waited for (seeDecisions).
Coordination hazards and detection #
Detect first, in this order, all read-only; repeat the in-flight check immediately before the switch.
- In-flight incumbent transactions and locks.
One
findper class, from the repository's common git directory (here/var/home/user/Monochromatic/.git):
A published transaction directory (a UUID, not# run from the common git directory find . -maxdepth 4 -type d -regextype posix-extended \ -regex '\./(worktrees/[^/]+/)?cli-git-transactions/[0-9a-f-]{36}' find . -maxdepth 4 -type d -regextype posix-extended \ \( -name landing.lock -o -name reservation.lock -o -name capture.lock -o -name hook.lock \) find . -maxdepth 4 -name 'index.lock' ls cli-git/shadow cli-git-worktree-copy/v1*.pending), any*.lockdirectory, ashadow/<id>repository or anindex.lockmeans a commit is running or was killed (layout:package/git-policy/cli/SPEC.md:2085-2135). Names ending in.pendingare abandoned staging directories kept for diagnosis. State on 2026-10-12 from this host: one published transaction, a livecapture.lockinworktrees/cli-git-lane-rules-cache/cli-git-captures/that was gone on the next probe, threecli-git/shadowentries, two stalecli-git-transactions/*.pending(Oct 3 and Oct 4), four stalecli-git-worktree-copy/v1/settlement.lock.*.pending(Oct 6), 39cli-git-add-policy-*directories (Jul to Oct), and nocli-git-transactionlegacy directory. The probe is racy by nature: another session can start a commit right after it. - Running wrapper processes:
pgrep --list-full --full '^node .*git-policy[-/]cli/dist/final/node/index\.mjs'lists live incumbent Git commands. The character class matters: the main checkout's shim reaches the bundle throughnode_modules/@monochromatic-dev/git-policy-cli/dist/...(hyphen), while a package directory path hasgit-policy/cli(slash). The^nodeanchor keeps the shell that runspgrepfrom matching itself. Positive control on 2026-10-12: a scratchnodeprocess started on agit-policy-cli/dist/final/node/index.mjspath was listed, and so was a live incumbentcommitof this session through the main checkout shim. There is no native counterpart: for commands that do not wait on policy, the native wrapper replaces itself with/usr/bin/gitbyexec, so native processes look like plain Git. The publishedcli-git-transactionsdirectories and*.lockfiles in the common git directory are the authoritative signal for in-flight native work. - Stale and active worktrees.
git worktree list --porcelainshows 89 worktrees (23 under/var/mnt/encrypted/temp/agent/tr-fan, 18 under/var/home/user/worktrees, 18 under/var/home/user/temp/agent, 17 under/var/home/user/Monochromatic/.claude/worktrees, and others). A scratch script (not committed) over that list measured, at HEAD of each: 72 havecli-git.config.ts, 5 havecli-git.config.jsonc, 7 have.cache/forbidden-strings.rules.txt. Active means a process whose/proc/<pid>/cwdis inside the worktree or a reflog or index modified recently; read those two signals, do not guess. Under native, in a worktree whose HEAD has only the TypeScript config, a config-loading command such asgit addends with exit 2 and anengine-failureevent of codeconfig-invalid(observed). Its message starts with "Legacy configuration", then the worktree'scli-git.config.tspath, then "is not executed or read by the native cli-git. Translate its settings into", then the worktree'scli-git.config.jsoncpath (src/native/config_file.rs:152-170,303-351); read-onlygit statusstill works. In a worktree with the JSONC file but no.cache/forbidden-strings.rules.txt,git addends with exit 2 and anengine-failureevent of codepolicy-incomplete(observed). Its message starts "cli-git could not load the forbidden-strings rules, so no file was scanned: read rules", then the worktree's.cache/forbidden-strings.rules.txtpath, then ": No such file or directory" (doc/handover/cli-git-native-config.md,Rules file in a linked worktree). Under the incumbent a missing.cachefile did not stop commits in a worktree because its variable pointed at the main checkout's file; that is new fail-closed behavior. Remedy per worktree: mergemain, thenmise run sync:files, thenmise install(the link directory of the nativegitis created there). - Sessions with the old PATH.
PATH is inherited at start,
so after the switch,
sessions that started before the switch keep the TypeScript shim until restarted.
Read,
per process of the same user,
only the PATH value from
/proc/<pid>/environ(never print other variables; one environment contains tokens) and count those whose PATH namesnode_modules/.binbefore the worktree's.cache/cli-git-bindirectory. Both wrappers share.git/cli-git*state (adopted: locks and journals interoperate both ways), so a mixed fleet is the designed state, but only the incumbent-writes, native-reads direction has a recorded test (doc/handover/cli-git-native-transactions.md:629-631, trailing gate). - The incumbent's runtime closure (see
The installed incumbent) lives in install state: do not runpnpm installin the main checkout with the cli manifest reduced until the verification has passed and the hazard 4 count of sessions that still start the shim is zero. - The incumbent without
cli-git.config.tsruns only core policies: optional policies "remain disabled until trusted config registers them" (the formerpackage/git-policy/cli/README.md:210-212, replaced in4f5bc1d30c), so rolling back after deleting the file silently dropssecurity/forbidden-strings,markdown/autofix,mono/forbidden-root-contextandmono/dependent-version-bumpuntil the file is restored from Git history and trusted again. The same loss hits every session that still has the old PATH (hazard 4) the moment the file is deleted in the checkout it uses. - The generated hook entries are symlinks from each transaction's
hooks/directory to the wrapper executable (doc/handover/cli-git-native-hooks.md,hook_dispatch_entries.rs), so the installed file must keep a stable path for the length of any transaction. The executable that hook entries target is the canonical file under the miseinstallsdirectory, becausecurrent_exe(src/native/real_git.rs:453,src/native/commit_command.rs:167) resolves thegitlink. Relinkinggitduring a transaction is harmless;mise prune, an uninstall, or reinstalling the same version over that file during a transaction is not.
Ordered steps #
All commits go through the installed wrapper with explicit pathspecs (CLG,
CPN);
commit each step before the next (GCE).
-
Land the migrations that do not need the native wrapper installed and do not affect the incumbent: the
package/git/executablenative recognition and its tests; the CI additions (a Linux job that builds the crate from the checkout and runs the final-newline and dependent-version checks); the docs that are true under both wrappers; the retirements the user ordered "now" that touch no wrapper behavior: the hk cleanup (cleanup:hk-git-configinmise.no-env.toml,test:hk-config-cleanup,doc/runbook/remove-retired-hk-git-config.md, and the rewrite of the section ofdoc/troubleshooting/cli-git-hk-retirement-stale-hook-config.mdthat names the task), and the performance harness (perf/*.ts, theperf:*tasks,.github/workflows/cli-git-performance.yml).src/maintenance/stays untilsrc/goes. Keepcli-git.config.ts, the root dependency, the cli manifest andsrc/untouched. -
Publish the crate (
Publishing the native crate,Steps that remain, steps 1 to 6). The tool entry is not added to the repository until step 4 here. -
Verify the published artifact in isolation, with a throwaway data directory and project, before any repository file names the tool.
PROJECTholds amise.tomlwith the tool entry ofInstall the published tool(the real pin) and no other tool:# run by hand in a throwaway project; nothing production is touched V=$(mktemp --directory "${HOME}/temp/agent/cutover-isolated.XXXXXX") mkdir --parents "$V/proj" "$V/state" "$V/cfg" cp "$PROJECT" "$V/proj/mise.toml" cd -- "$V/proj" export MISE_DATA_DIR="$V/data" MISE_STATE_DIR="$V/state" MISE_CONFIG_DIR="$V/cfg" \ MISE_GLOBAL_CONFIG_FILE="$V/cfg/none.toml" MISE_CACHE_DIR="$V/cache" MISE_YES=1 MISE_TRUSTED_CONFIG_PATHS="$V" mise trust "$V/proj/mise.toml" mise install ls -la "$V/proj/.cache/cli-git-bin"Expected:
mise installtakes the prebuilt archive (a few seconds; a compile that takes a minute or more means the release archives were not found, seedoc/troubleshooting/mise-cargo-binstall-falls-back-to-compiling.md);.cache/cli-git-bin/gitis a symlink to$V/data/installs/cargo-monochromatic-git-policy-cli/<version>/bin/cli-git-native. Then run items 1 and 2 ofUser-boundary verificationwithBIN="$V/proj/.cache/cli-git-bin"(skip itsROOTline) andMAINset to the main checkout, and delete$V. -
Land the switch in one commit, made through the incumbent: the tool entry in
mise.no-env.toml, the.cache/cli-git-binfirst entry of_.pathinfile-enforcer.config.ts, the regeneratedmise.tomlandmise.lock(mise run sync:files, thenmise run lock:mise). Check thatmise env --jsonprints<root>/.cache/cli-git-binbefore anynode_modules/.bin. -
In the main checkout and in each active worktree: merge
main(the main checkout pulls it), runmise run sync:files, runmise install, then checkcommand -v git(identity item ofUser-boundary verification). Sessions started before this step keep the shim until restarted (hazard 4), and a session started from the main checkout takes its link from the main checkout, somise installthere is what switches such sessions; the shim anddiststay until step 8. -
Repeat the hazard 1 detection immediately before the first native commit. The switch is atomic per process start, so no quiet period is required by design (
doc/planning/cli-git-rust-open-decisions.md,Lock and journal interoperability across versions, option A), but the reverse direction is not tested, so prefer a moment with no transaction directories. -
Run
User-boundary verificationthrough the realPATH. -
When it passes, the rollback window is over (see
Decisions). Deletecli-git.config.tsand rewordcli-git.config.jsonc:2, only when the hazard 4 count of sessions on the oldPATHis zero (hazard 6 explains what those sessions lose otherwise). Commit through the native wrapper. -
Record the installation in
doc/handover/cli-git-rust-implementation.mdanddoc/handover/cli-git-native-integration.mdby replacing the superseded text; that commit is also the doc-only verification commit. -
Start the retirement (
Order of the retirement commits) at once; no waiting period follows the verification.
User-boundary verification #
Both checks use the installed git on the resolved PATH,
not an explicit executable path.
-
Identity.
command -v gitprints<root>/.cache/cli-git-bin/git, where<root>is the checkout whosemise.tomlset the session'sPATH(a session started from the main checkout uses the main checkout's link in every worktree it enters;mise exec -- sh -c 'command -v git'shows a worktree's own environment);readlink --canonicalize "$(command -v git)"ends incli-git-native;git --versionprintsgit version 2.55.0;git cli-git statusprints the "is retired" sentence, where the incumbent prints a JSONtrust-statusline. -
A real commit in a throwaway repository (sequence run end to end against a native debug build on 2026-10-12, with these results). Everything runs in a subshell with a disposable
HOMEand no system Git configuration, so no user configuration is read;/usr/bin/gitis used only for fixture setup, and the wrapper is found throughPATH:# run by hand; MAIN is the main checkout; the wrapper policies require a linked worktree and explicit paths ROOT=$(git rev-parse --show-toplevel) BIN="${ROOT}/.cache/cli-git-bin" V=$(mktemp --directory "${HOME}/temp/agent/cutover-verify.XXXXXX") mkdir --parents "$V/home" ( export HOME="$V/home" GIT_CONFIG_NOSYSTEM=1 export PATH="$BIN:${MAIN}/node_modules/.bin:/usr/bin:/bin" command -v git /usr/bin/git init --initial-branch=main "$V/repo" /usr/bin/git -C "$V/repo" config user.name Verify /usr/bin/git -C "$V/repo" config user.email verify@example.invalid /usr/bin/git -C "$V/repo" config commit.gpgsign false /usr/bin/git -C "$V/repo" commit --allow-empty --message seed /usr/bin/git -C "$V/repo" worktree add -b work "$V/wt" cd -- "$V/wt" echo hello > a.txt git add -- a.txt git commit --message 'verify native wrapper' -- a.txt git log --oneline find "$V/repo/.git" -name 'cli-git-transactions*' -o -name '*.lock' ) /usr/bin/git -C "$V/repo" worktree remove --force "$V/wt" rm --recursive --force "$V"Observed:
git add -- a.txtexits 0,git commit ... -- a.txtexits 0 andgit log --onelineshows the new commit,git add .is refused withadd-explicit/bulk-add-rejected, andgit commit -a -m xwithcommit-only/all-flag(both exit 1 with one JSONL finding on standard error; run them inside the subshell before the cleanup to see them). The finalfindmust print nothing after the commit: no published transaction directory and no lock (this check was not part of the 2026-10-12 run). The throwaway disables signing on purpose, because a hermeticHOMEhas no signing key; signing is checked by item 3 instead. -
A doc-only commit in this repository, from a linked worktree that has merged
mainand has runmise run sync:filesandmise install(socli-git.config.jsonc,.cache/forbidden-strings.rules.txtandmonochromatic-linton PATH all exist): edit one Markdown file underdoc/,git add -- <that file>,git commit -m '<type>(<scope>): <subject>' -- <that file>. Expect exit 0 and, if the Markdown autofix policy rewrites the file, the wrapper'sfixoutcome; then confirmgit status --shortis clean,git log -1shows the commit, and the common git directory has no new transaction directory or lock. Then check the signature:git log -1 --format='%h %G? %GK'must printGand the same key id asgit log -1 --format='%GK' main, because the branch protection onmainrequires signatures and the native wrapper must leave signing to Git, which the throwaway check cannot show. A failure here withconfig-invalidorpolicy-incompleteis hazard 3, not a defect. -
Auto-push: with auto-push enabled (
APG) the commit pushes the branch; a push failure is a result to read, not noise.
Rollback #
Before the verification passes (step 7 of Ordered steps),
the incumbent is still installed and rollback is a
change of PATH:
- Make sure no native transaction is in flight (hazard 1 detection returns nothing), because the incumbent reading native-written records is not tested. Let running native commits finish, or run any native read-only Git command in the affected repository, which runs recovery for interrupted transactions before it forwards.
- Remove or rename
.cache/cli-git-bin/gitin each affected worktree. Every process whosePATHcontains that directory then falls through to the nextgit. For a session started from the main checkout that is the main checkout'snode_modules/.bin/git, the incumbent, immediately and without a restart. A shell activated inside a worktree falls through to that worktree's own shim, which already fails today for lack of adist(seePATH mechanics on this host), so it loses nothing it had. Removing the main checkout's link rolls back every session started from the main checkout at once. Then revert the switch commit and runmise run sync:files, so new sessions stop adding the directory and the tool entry is gone. - Verify with
git cli-git status(JSONtrust-status,"trusted":true) and one commit in a throwaway repository with the incumbent.
After the verification passes the window is over,
by decision.
cli-git.config.ts is deleted,
and the shim and dist go in the retirement commits.
Rollback then has two shapes:
- To an earlier native version:
pin the previous published version in
mise.no-env.toml, runmise run lock:mise, and runmise installin each worktree (the postinstall relinksgitatomically). The first published version has no predecessor, so a fix after it is a new version through the same publication steps; the registry's yank operation was not examined. - To the incumbent:
create a worktree at the pinned incumbent revision,
install its dependencies with the package manager,
build
distwithmise run //package/git-policy/cli:build:js:node, put that worktree'snode_modules/.binfirst onPATH, restorecli-git.config.tsfrom Git history, and rungit cli-git trust --yesfor it with the user's approval (precedent:doc/handover/unified-linter-cutover.md,Landing choreography). That path was not exercised here and its duration was not measured.
Order of the retirement commits #
Start right after the verification of step 7. Each step is its own commit, made through the native wrapper:
- Record the pinned incumbent revision:
the last commit that contains the TypeScript,
in the commit body of step 2,
in
doc/planning/cli-git-rust-behavior-ledger.mdand in the handover queue. - Switch
changeset:versionto the nativefixand prove it on the release workflow's input before deleting the planner; delete the three differentials (bin/differential-*.mjs, the 21bin/dependent-version-*.mjsfiles and their tasks), because those bins import the planner and the TypeScript source; then deletepackage/git-policy/repositoryand the other three authoring packages withfile-enforcer.config.ts:2276-2341, the file-enforcer test, andsrc/optional/. - Delete
src/(exceptsrc/native/),rolldown.node.config.ts, the tasks and bins listed underRetirement list, reducepackage.jsonandtsconfig.json, edite2e/and the Containerfile, deletecli-git-trust.yml,src/maintenance/(withsrc/), rewrite theSPEC.mdsections ofDocumentation. - Remove
package.json:36and regeneratepnpm-lock.yaml,package/config/pnpr/config.yamlandmise.toml(pnpm install --lockfile-onlyormise run prepare:pnpm:install, thenmise run sync:files), inspecting each diff. Only now doespnpm installremovenode_modules/.bin/gitand the incumbent's closure. - Remove the main checkout's ignored leftovers (
package/git-policy/cli/dist,dist/pack,dist/perf): list them first withgit clean --dry-run -d -X(GCL,GC2) and check stray git-dir entries withls -dandgit check-ignore --verbose(GCR). Remove them by explicit path, never withgit clean -X: its listing includes.cache/cli-git-bin, the link every session depends on, and.cache/forbidden-strings.rules.txt. The rollback-window decision covers deleting them; the hazard 4 count of sessions still on the shim must be zero first. - After the trailing gates are recorded (interop matrix,
long fuzz,
non-core mutation,
pathBytes, Windows, release performance) and verified complete, the queue item "retirement of the old TypeScript implementation is verified complete" indoc/handover/cli-git-rust-implementation.mdcan be closed.
Not established #
- Whether the API token stored on this host still authorizes publishing:
the file was not read,
and
doc/runbook/publish-crate-first-time.mdrecords a 403 for it on 2026-09-25. - Everything that needs a published crate:
the release jobs
gpc-*in.github/workflows/cargo-publish.ymlwere linted but never ran; the prebuilt archive path ofmise installfor this crate (the probes usedmonochromatic-lint0.1.1 as a stand-in); and the glibc and Git versions of hosted runners against the 2.55.0 floor. The source-install fallback was measured only as a build: about 71 seconds, one run, 9,028,800 bytes, on a host with a shared cargobuild-dir. - Whether the unanchored
includeentries ofpackage/linter/monochromatic-lint/Cargo.tomlpackage a strayREADME.mdfrom a subdirectory (the new crate's list is anchored; that package was not inspected). - Whether
gh workflow runcan dispatch the new choice from a branch whose workflow file is absent frommain. - Whether the worktree setup flow of this repository runs
mise install. The link directory is created only bymise install(postinstallwithwhen = "always");mise exec,mise envand shell activation do not run it. - Which of the 89 worktrees are active,
and which sessions hold the old
PATH: the commands are given, not run against processes. - Whether
pnpm installprunes the cli package's links the moment its manifest drops them: inferred from the symlink layout, not run. - The reverse interoperability direction (incumbent reads records native wrote): untested by decision (trailing gate).
- Whether the native wrapper tolerates the four Oct 6
settlement.lock.*.pendingdirectories in.git/cli-git-worktree-copy/v1; the transaction staging names are ignored by design (package/git-policy/cli/SPEC.md:2085-2095). - The contents of
*.local.*files,~/.local/state/cli-git/trust/v1, and whether any of them name the shim ordist. - Windows and macOS behavior of anything native, which is why the release matrix of the new crate is Linux only.
- The duration of the Clippy addition to
lint. - Baseline results of
mise run //package/git-policy/cli:lintandlint:typesbefore and after the manifest reduction (not run: the package is large and the scout was read-only). - The exact
package.jsonfield list after reduction is derived from import counts, not from a type check of the reduced package.