git_policy_cli/lib.rs
1//! What:
2//! Internal native cli-git implementation,
3//! not yet the production executable.
4//! Why:
5//! The Rust rewrite preserves Git's own argument,
6//! repository and transaction semantics.
7//!
8//! In TS you'd write (pseudocode):
9//! ```ts
10//! // Internal modules used by the forthcoming native entry point and consumer verification.
11//! ```
12
13/// The decision one invocation ends in:
14/// become Git,
15/// or print and exit.
16pub mod action;
17
18/// The four top-level spellings after which the wrapper announces itself,
19/// and the text it prints once Git has answered.
20pub mod announced_query;
21
22/// Variables added to every real-Git child:
23/// lock PID injection and the forward-target marker.
24pub mod child_environment;
25
26/// The one failure type for rejected configuration content or files.
27pub mod config_error;
28
29/// Repository-root discovery and bounded reading of `cli-git.config.jsonc`.
30pub mod config_file;
31
32/// Lazy configuration loading for known inspection versus mutation/ambiguous commands.
33pub mod config_loading;
34
35/// Whole-document JSONC validation into typed settings.
36pub mod config_parse;
37
38/// Validation of the `policies` section and per-policy options.
39mod config_policies;
40
41/// The `rulesFile` option:
42/// a repository-relative name that stays inside the repository.
43pub mod config_rules_file;
44
45/// Typed settings and their defaults.
46pub mod config_schema;
47
48/// One `git config --list` read, parsed, and the lookups the commit path makes against it.
49pub mod config_snapshot;
50
51/// Key-naming typed readers over parsed JSONC values.
52mod config_values;
53
54/// JSONL event rendering for wrapper-made diagnostics.
55pub mod diagnostics;
56
57/// Worktree target classification for worktree-enforcing policies.
58pub mod effective_target;
59
60/// The per-invocation decision the thin executable performs.
61pub mod entry;
62
63/// Spellings of the wrapper-only escape hatches shared by several modules.
64pub mod escape_hatch;
65
66/// Starting real Git with unchanged arguments,
67/// streams and exit status.
68pub mod forwarding;
69
70/// Captured read-only real-Git queries over raw bytes.
71pub mod git_metadata;
72
73/// Git 2.56.0 global-argument boundaries over unchanged operating-system strings.
74pub mod global_arguments;
75
76/// Configuration of the repository one invocation selects.
77pub mod invocation_config;
78
79/// The `git cli-git` decision:
80/// help,
81/// retired commands,
82/// and direct `check`/`fix`.
83pub mod management;
84
85/// The `git cli-git` argument grammar.
86pub mod management_arguments;
87
88/// The refusal of a direct command whose `--policy` selects a policy that is off.
89pub mod management_selection;
90
91/// The fixed registry of shipped policies.
92pub mod policy_registry;
93
94/// PATH resolution of the real Git executable.
95pub mod real_git;
96
97/// Wrapper self-exclusion for one PATH candidate.
98pub mod real_git_candidate;
99
100/// Disposable fixtures shared by unit tests;
101/// never part of the release executable.
102#[cfg(test)]
103mod test_support;
104
105/// A Git stand-in that logs each start and runs the real Git;
106/// never part of the release executable.
107#[cfg(test)]
108#[cfg(unix)]
109mod recording_git;
110
111/// The Git starts of the layout questions for a user whose own file holds `core.fsmonitor = true`;
112/// never part of the release executable.
113#[cfg(test)]
114#[cfg(unix)]
115mod reader_fsmonitor_tests;
116
117/// Repository and worktree identity as reported by real Git.
118pub mod worktree_identity;
119
120/// Git 2.56.0 `parse-options` tokenization of one command's argument region.
121pub mod command_options;
122
123/// Long-option matching:
124/// exact names,
125/// unique abbreviations and `no-` negation.
126mod command_options_long;
127
128/// Final-state and position questions over a tokenized region.
129pub mod command_options_query;
130
131/// Short-option clusters and their attached or following values.
132mod command_options_short;
133
134/// The shared decision of which bytes are an option's value.
135mod command_options_value;
136
137/// Real-Git fixtures and table oracles for command tests;
138/// never in the release build.
139#[cfg(test)]
140mod command_test_support;
141
142/// Per-case copies of a pristine fixture and worker threads for independent test cases;
143/// never in the release build.
144#[cfg(test)]
145mod command_test_cases;
146
147/// Differential harness over `git rev-parse --parseopt`;
148/// never in the release build.
149#[cfg(test)]
150mod command_test_parseopt;
151
152/// Table oracle over `--git-completion-helper-all`;
153/// never in the release build.
154#[cfg(test)]
155mod command_test_completion;
156
157/// Facts about the arguments after `git commit`.
158pub mod command_commit;
159
160/// The complete Git 2.56.0 option table of `git commit`.
161pub mod command_commit_table;
162
163/// The shared result and builder of transforms that add tokens to a command line.
164pub mod rule_argument_rewrite;
165
166/// Pure core of the index-against-`HEAD` check.
167pub mod rule_commit_index;
168
169/// The query and reading of "does this worktree hold uncommitted state?".
170pub mod rule_worktree_dirty;
171
172/// Pure decision of the commit-only transform.
173pub mod rule_commit_only;
174
175/// User-facing diagnostics of the commit-only transform.
176pub mod rule_commit_only_message;
177
178/// Pure core of the merge,
179/// cherry-pick and revert conclusion check.
180pub mod rule_commit_sequencer;
181
182/// The Git 2.56.0 option table of `git push` and its facts.
183pub mod command_push;
184
185/// The Git 2.56.0 option table of `git status`,
186/// its facts and the advice-key reading.
187pub mod command_status;
188
189/// Pure decision of the atomic-push transform.
190pub mod rule_atomic_push;
191
192/// Pure decision of the status-hints transform.
193pub mod rule_status_hints;
194
195/// The Git 2.56.0 option table of `git add` and its bulk-staging facts.
196pub mod command_add;
197
198/// The Git 2.56.0 option table of `git clean` and its deletion facts.
199pub mod command_clean;
200
201/// The Git 2.56.0 option table of `git reset` and its mode.
202pub mod command_reset;
203
204/// `git stash` subcommand dispatch and wrapper-flag positions.
205pub mod command_stash;
206
207/// The commands that can overwrite or delete uncommitted state, read as Git reads them.
208pub mod command_discard;
209
210/// The `checkout` and `restore` command lines that take one side of a conflicted file.
211pub mod command_conflict_side;
212
213/// Conflicted paths, the decision on a command line that names them, and the saved copy of each file.
214pub mod conflict_sides;
215
216/// The linked-worktree policy's carve-out for conflicted files during a merge, rebase, cherry-pick or revert.
217pub mod conflict_side_guard;
218
219/// The Git 2.56.0 option tables of every `git stash` subcommand.
220pub mod command_stash_table;
221
222/// Branch-creation facts of `git branch`,
223/// `git checkout` and `git switch`.
224pub mod command_branch_create;
225
226/// Which action a tokenized `git branch` region selects.
227mod command_branch_mode;
228
229/// The complete Git 2.56.0 option table of `git branch`.
230pub mod command_branch_table;
231
232/// Explicit creation and the remote-guess candidate of `git checkout` and `git switch`.
233mod command_branch_target;
234
235/// The complete Git 2.56.0 option tables of `git checkout` and `git switch`.
236pub mod command_checkout_table;
237
238/// The Git 2.56.0 option groups of `git config`.
239pub mod command_config_table;
240
241/// The form and file scope of a `git config` region.
242pub mod command_config;
243
244/// Pure decision of the require-root policy.
245pub mod rule_require_root;
246
247/// Whether a `git worktree` invocation creates or moves a worktree.
248pub mod command_worktree;
249
250/// Wrapper-only control spellings,
251/// their meanings,
252/// and removal before the subcommand.
253pub mod wrapper_controls;
254
255/// Removal of every wrapper control from one invocation,
256/// by position.
257pub mod wrapper_invocation;
258
259/// Lifecycle triggers and the trigger set of every shipped policy.
260pub mod policy_trigger;
261
262/// Policy events and their JSON Lines rendering.
263pub mod policy_events;
264
265/// A pathname as events report it:
266/// text,
267/// plus base64 `pathBytes` when it is not UTF-8.
268pub mod event_path;
269
270/// Exact repository path bytes as the operating system takes them, and as text for messages.
271pub mod path_bytes;
272
273/// Ordered policy execution for one lifecycle point.
274pub mod policy_engine;
275
276/// Slice 6: writes one corrected file into the private commit index as a blob and an index entry.
277pub mod private_index_stage;
278
279/// Slice 6: the commit path's bounded policy convergence over the private index.
280pub mod commit_convergence;
281
282/// The commit transaction in the incumbent's order, up to the settled policies.
283pub mod commit_transaction;
284
285/// The conclusion of a settled commit transaction: preparation, landing and post-landing completion.
286pub mod commit_conclusion;
287
288/// The normalization-only transaction for a correction that removed every change.
289pub mod commit_no_change;
290
291/// The finding for a staged deletion that an explicit-path commit cannot record.
292pub mod commit_staged_additions;
293pub mod commit_staged_deletions;
294
295/// The `git commit` command: the transaction, the settled events, the post-commit gate and the backup.
296pub mod commit_command;
297
298/// Rule facts from the real repository with candidates read from the private index.
299pub mod commit_facts;
300
301/// The worktree completion records of selected corrections and of hook changes.
302pub mod commit_worktree_records;
303
304/// The bounded loop that repeats a pass after corrections changed candidate content.
305pub mod policy_convergence;
306
307/// The one query for repository identity,
308/// top level and the path below it.
309pub mod repository_location;
310
311/// Lazily fetched repository facts behind one interface,
312/// with the real-Git provider.
313pub mod repository_facts;
314
315/// Pure decision of the linked-worktree-only policy.
316pub mod rule_linked_worktree;
317
318/// The rejection texts of the linked-worktree-only policy.
319pub mod rule_linked_worktree_messages;
320
321/// The append-only record of every command form that can discard uncommitted state.
322pub mod discard_audit;
323
324/// The record of where one wrapped commit spent its time,
325/// appended beside the discard audit.
326pub mod commit_timing;
327
328/// The intent-guessing hint that follows a finding, an engine failure or a notice.
329pub mod event_hints;
330
331/// Pure decision of the branch-worktree-only policy and its one-query remote guess.
332pub mod rule_branch_worktree;
333
334/// Pure decision of the add-explicit policy.
335pub mod rule_add_explicit;
336
337/// The repository content the dependent-version planner reads, and its two failure kinds.
338pub mod dependent_version_content;
339
340/// Which paths the dependent-version planner reads: manifests, configuration, source.
341pub mod dependent_version_paths;
342
343/// Strict JSON reading of a manifest's name, version and dependency names.
344pub mod dependent_version_manifest;
345
346/// Patch bumps of plain release versions and `JSON.stringify` quoting.
347pub mod dependent_version_release;
348
349/// The byte-preserving rewrite of a manifest's top-level version.
350pub mod dependent_version_text;
351
352/// Publishable package names from the generated registry configuration.
353pub mod dependent_version_publishable;
354
355/// Whether source text imports a package.
356pub mod dependent_version_imports;
357
358/// The dependency walk and the plan of dependent bumps.
359pub mod dependent_version_graph;
360
361/// Every workspace manifest at both states, and which versions were raised.
362pub mod dependent_version_states;
363
364/// Which development dependencies each dependent bundles.
365pub mod dependent_version_bundled;
366
367/// The dependent-version plan with exact manifest bytes before and after.
368pub mod dependent_version_plan;
369
370/// The decision and findings of `mono/dependent-version-bump`.
371pub mod dependent_version_policy;
372
373/// The dependent-version planner's view of a prepared candidate state.
374pub mod dependent_version_lifecycle;
375
376/// Whether a direct fix may change a tracked file it did not select.
377pub mod policy_added_path;
378
379/// The `mono/dependent-version-bump` check over a lifecycle's candidate state.
380pub mod policy_dependent_version;
381
382/// An in-memory workspace that records reads; never in the release build.
383#[cfg(test)]
384mod dependent_version_test_support;
385
386/// Differential fixture reading and canonical results; never in the release build.
387#[cfg(test)]
388mod dependent_version_fixture_json;
389
390/// Canonical renderings of the native planner's results; never in the release build.
391#[cfg(test)]
392mod dependent_version_fixture_output;
393
394/// One differential case evaluated by the native planner; never in the release build.
395#[cfg(test)]
396mod dependent_version_fixture_cases;
397
398/// The native planner against the incumbent's recorded results; never in the release build.
399#[cfg(test)]
400mod dependent_version_differential_tests;
401
402/// The shipped policies as checks over rule cores and repository facts.
403pub mod policy_checks;
404
405/// What a lifecycle offers content policies,
406/// and its candidates once prepared.
407pub mod policy_content;
408
409/// The built-in final-newline policy:
410/// canonical final LF,
411/// preserved paths,
412/// findings.
413pub mod policy_final_newline;
414
415/// The optional root-context policy:
416/// no top-level `CONTEXT.md` enters the index.
417pub mod policy_root_context;
418
419/// The optional catalog-specifier policy over the shared rule crate:
420/// every dependency in a tracked `package.json` is a catalog or workspace reference.
421pub mod policy_catalog_specifiers;
422
423/// The optional forbidden-strings policy over the linked scanner,
424/// with redacted findings.
425pub mod policy_forbidden_strings;
426
427/// What one in-process linter run produced:
428/// the fixed source and the findings left,
429/// or why it is unusable.
430pub mod markdown_linter_output;
431
432/// The one-rule linter configuration document.
433pub mod markdown_linter_config;
434
435/// The gitignore-syntax `exclude` patterns of `markdown/autofix`,
436/// matched as the linter matches them.
437pub mod markdown_exclude;
438
439/// The `markdown/autofix` policy over candidates,
440/// behind its linter interface.
441pub mod policy_markdown;
442
443/// The executable's linter for that policy:
444/// `monochromatic-lint` linked in-process,
445/// guarded by a deadline,
446/// once per candidate.
447pub mod markdown_linter;
448
449/// A job on a thread of its own with a deadline and panic containment.
450pub mod markdown_linter_guard;
451
452/// The executable's panic hook:
453/// where an internal error happened,
454/// never its message.
455pub mod panic_notice;
456
457/// Installing a direct fix's corrections into the worktree,
458/// all or none.
459pub mod direct_fix_install;
460
461/// The direct fix:
462/// converge corrections in memory,
463/// then install them.
464pub mod direct_fix;
465
466/// The fixed argument transforms of a forwarded command,
467/// in order.
468pub mod policy_transforms;
469
470/// One complete pass:
471/// built-in policies,
472/// fixed transforms,
473/// optional policies.
474pub mod policy_pass;
475
476/// The names of the commands built into Git 2.56.0.
477pub mod git_builtins;
478
479/// The work of the installed cli-git that is not ported,
480/// and the refusal notice.
481pub mod unported;
482
483/// The lifecycle of one wrapped Git command,
484/// from refusals to forwarding.
485pub mod wrapped_command;
486
487/// A scripted repository-facts provider for unit tests;
488/// never in the release build.
489#[cfg(test)]
490mod policy_test_support;
491
492/// The one failure type of the candidate layer and its closed list of causes.
493pub mod candidate_error;
494
495/// Validated Git object names and the file modes a candidate can carry.
496pub mod candidate_object;
497
498/// Pure framing of one `git cat-file --batch` reply.
499pub mod candidate_batch;
500
501/// Pure parsing of raw NUL-delimited changed-path records.
502pub mod candidate_record;
503
504/// The long-lived object reader that answers every blob read of an invocation.
505pub mod candidate_reader;
506
507/// Immutable candidate versions:
508/// identity,
509/// pathname,
510/// mode,
511/// change and object per path.
512pub mod candidate_version;
513
514/// Per-invocation listing,
515/// lazy bytes and invalidation of candidate versions.
516pub mod candidate_store;
517
518/// Pure parsing of `git ls-files --stage` records and the delta between two index states.
519pub mod candidate_stage;
520
521/// The files of a commit's tree with their modes and objects.
522pub mod candidate_tree;
523
524/// A private,
525/// timestamp-preserving copy of the real index,
526/// removed when dropped.
527pub mod candidate_private_index;
528
529/// Which candidate paths have their `text` Git attribute unset,
530/// read from the state the candidates were listed from.
531pub mod candidate_attribute;
532
533/// What `git add` would stage,
534/// and the worktree files a direct command selects.
535pub mod candidate_prediction;
536
537/// Which candidates hold content that a parent commit's tree already holds,
538/// found by exact object name.
539pub mod candidate_known_content;
540
541/// The linked forbidden-strings scanner:
542/// one load per invocation,
543/// typed redacted findings.
544pub mod scanner_adapter;
545
546/// Rules-file precedence and which candidates the scanner is given.
547pub mod scanner_selection;
548
549/// One scan pass over a candidate version's exact bytes.
550pub mod scanner_run;
551
552/// Which engine failure code each candidate and scanner failure carries.
553pub mod scanner_failure_code;
554
555/// Process isolation and rule fixtures for scanner controls;
556/// never in the release build.
557#[cfg(test)]
558mod scanner_test_support;
559
560/// Private,
561/// crash-safe file primitives shared by every durable record.
562pub mod private_storage;
563
564/// Where short-lived private files live:
565/// the per-user scratch directory and the repository scratch directory,
566/// never the system temporary directory.
567pub mod scratch_location;
568
569/// Compact JSON records read and written with the incumbent's `JSON` semantics.
570pub mod json_record;
571
572/// Random identifiers in the layout of the incumbent's `randomUUID`.
573pub mod random_id;
574
575/// Text operations with the exact semantics of JavaScript's built-ins.
576pub mod js_text;
577
578/// The PID namespace an owner record names, and the rule for owners of another one.
579pub mod pid_namespace;
580
581/// Process-birth identities in the incumbent's exact spelling.
582pub mod process_identity;
583
584/// The owner record inside every owner-lock directory.
585pub mod owner_lock_record;
586
587/// Line-oriented debug and warning diagnostics on standard error.
588pub mod diagnostic_log;
589
590/// The fail-closed failure of reading or recovering durable transaction state.
591pub mod recovery_error;
592
593/// The owner record of one commit-transaction directory and its liveness rule.
594pub mod transaction_owner;
595
596/// The schema-version-2 journal records of one commit transaction and their filenames.
597pub mod transaction_journal;
598
599/// UTC timestamps in the exact form of JavaScript's `toISOString`.
600pub mod iso_time;
601
602/// Running real Git for transaction,
603/// recovery and landing work.
604pub mod transaction_git;
605
606/// Lexical path normalization.
607pub mod lexical_path;
608
609/// The ban on Git starting the wrapper for a hook: no entry writer, no start-name dispatch.
610#[cfg(test)]
611#[path = "hook_self_invocation_tests.rs"]
612mod hook_self_invocation_tests;
613
614/// What `git cli-git doctor` reports from the configuration: configured hooks and the retired `hooks` key.
615pub mod doctor_config;
616
617/// The configured external hooks, read from the snapshot, and the loud report that none runs.
618pub mod external_hooks;
619
620/// The non-blocking warning for a configured `core.hooksPath`, decided from the configuration snapshot alone.
621pub mod traditional_hook_warning;
622
623/// `git cli-git doctor`: the traditional hooks a repository holds, which are unsupported.
624pub mod doctor;
625
626/// When a push needs the Git LFS upload, and the texts the parent prints around it.
627pub mod lfs_pre_push;
628
629/// What the Git LFS upload sends: the remote and the refs, read from the push and the configuration Git would read.
630pub mod lfs_upload_plan;
631
632/// The configuration the Git LFS upload plan reads, and the default remote derived from it.
633pub mod lfs_upload_settings;
634
635/// Hides the credentials inside URLs in the text relayed from `git-lfs`.
636pub mod lfs_output_mask;
637
638/// Which failed `git-lfs push` runs are tried again (server errors only), after how long, and the notice.
639pub mod lfs_server_retry;
640
641/// Whether a blob is a Git LFS pointer, decided as `git-lfs` decides it.
642pub mod lfs_pointer;
643
644/// The LFS objects a push introduces, found in process from the commits to be pushed.
645#[cfg(unix)]
646pub mod lfs_pointer_scan;
647
648/// The upload plan narrowed to the objects the push introduces, or to nothing.
649pub mod lfs_object_plan;
650
651/// The parent's bounded or interactive run of the Git LFS upload.
652pub mod lfs_upload;
653
654/// The Git LFS step before a push the caller typed: pre-check, plan and upload with the caller's streams.
655pub mod lfs_interactive;
656
657/// The check that `git-lfs` can start, made before a push that is preceded by the upload.
658pub mod lfs_push_precheck;
659
660/// The auto-push's bounded `git push`, preceded by the upload, its pre-check and its explanation.
661pub mod lfs_bounded_push;
662
663/// The push of a merge that integrated a lost race, planned and run inside the running wrapper.
664pub mod stacked_merge_push;
665
666/// Every real-Git start of the wrapper carries `core.hooksPath` pointing at a directory that never exists.
667pub mod hooks_off;
668
669/// No-follow file operations recovery and landing share.
670pub mod recovery_files;
671
672/// Test-only transaction phase markers, compiled into the release executable and armed only by an environment variable.
673pub mod transaction_phase;
674
675/// Git commands run against a transaction's shadow repository.
676pub mod shadow_git;
677
678/// Native conclusion cleanup reproduced in the owning worktree.
679pub mod conclusion_cleanup;
680
681/// Replay: the unified-diff parser of subsumption (`replay_patch`).
682pub mod replay_patch;
683
684/// Replay: the exact strict reverse check of subsumption (`replay_reverse_apply`).
685pub mod replay_reverse_apply;
686
687/// Replay: the one-sided extension of subsumption over zero-context hunks (`replay_containment`).
688pub mod replay_containment;
689
690/// Replay: capture order over the landed first-parent history and the per-path decision (`replay_capture_order`).
691pub mod replay_capture_order;
692
693/// Replay: the shadow-repository Git runner that every replay step uses (`replay_shadow`).
694pub mod replay_shadow;
695
696/// Replay: shared paths of the landed history and the prepared commit, with their three entries (`replay_shared_paths`).
697pub mod replay_shared_paths;
698
699/// Replay: the text half of subsumption over index-named blobs and hunks (`replay_subsumption_text`).
700pub mod replay_subsumption_text;
701
702/// Replay: subsumption rules and the synthetic merge base (`replay_subsumption`).
703pub mod replay_subsumption;
704
705/// Replay: the merge tree, the first conflicting landed commit, and the replayed commit rebuild (`replay_merge`).
706pub mod replay_merge;
707
708/// The empty tree's object name under each known object format.
709pub mod empty_tree;
710
711/// Files-backend ref reads that answer without a Git process or decline.
712pub mod ref_files;
713
714/// Proof, without a Git process, that a sequencer marker names nothing on the files ref storage.
715pub mod sequencer_marker;
716
717/// The invocation capture:
718/// repository layout, symbolic `HEAD`, conclusion kind, ref backend and base.
719pub mod capture_invocation;
720
721/// The private index and object store a commit's preparation selects, and the Git request that carries them.
722pub mod private_index_request;
723
724/// The shadow repository `config` file and the copied repository format.
725pub mod shadow_config;
726
727/// The shadow repository links to the real shared entries.
728pub mod shadow_links;
729
730/// The shadow ref store: snapshot, private target, symbolic refs and `HEAD`.
731pub mod shadow_refs;
732
733/// The shadow conclusion copies at preparation.
734pub mod conclusion_copy;
735
736/// Argument transforms of native preparation: normalisation, global split, `-a` removal and private arguments.
737pub mod commit_args;
738
739/// The private commit index: copies, selection modes, pathspec files and listings.
740pub mod commit_index;
741
742/// Native `git commit` in the shadow, the prepared commit read back and `prepared.json`.
743pub mod commit_preparation;
744
745/// Creation of the shadow repository of one transaction.
746pub mod shadow_create;
747
748/// The entries of an empty bare repository, created in-process instead of by `git init`.
749pub mod shadow_skeleton;
750
751/// A read of the assume-unchanged and skip-worktree marks of an index file.
752pub mod index_flags;
753
754/// Loading many blobs through one `git cat-file --batch`.
755pub mod blob_batch;
756
757/// Bringing added paths' worktree copies to their landed bytes.
758pub mod worktree_completion;
759
760/// The startup step of a command: isolated merges whose process died, and what an earlier release left behind.
761pub mod startup_gate;
762
763/// Process start times for lock owners,
764/// read from `/proc`,
765/// `ps` or the Windows process table.
766pub mod process_start;
767
768/// The Git version check run once before work that depends on Git's behavior.
769pub mod git_version;
770
771/// The private per-user cache of the version text, keyed by the Git executable's identity.
772pub mod git_version_cache;
773
774/// Processes holding a lock file open,
775/// found by device and inode.
776pub mod index_lock_holders;
777
778/// Parsers of `lsof -F pcDi` records and Restart Manager lines,
779/// matched by device and inode.
780pub mod index_lock_holder_parsers;
781
782/// Evidence about a foreign `index.lock` and the verdict it supports.
783pub mod index_lock_evidence;
784
785/// The Git command a forwarded invocation runs,
786/// after ordinary alias expansion.
787pub mod forwarded_command;
788
789/// Index-writer classification and the commands that coordinate with a landing.
790pub mod index_writer_commands;
791
792/// Waiting for a foreign index.lock under the classification rules and Git's backoff schedule.
793pub mod index_lock_wait;
794
795/// The landing location a forwarded index writer coordinates with:
796/// the real index and the registry.
797pub mod landing_location;
798
799/// Running a coordinated forwarded index writer:
800/// the landing lock held while real Git runs as a child.
801pub mod index_writer_forward;
802
803/// The `git merge` command lines the wrapper completes in isolation, and those it leaves to native Git.
804pub mod merge_options;
805
806/// The durable intent record of an isolated merge.
807pub mod merge_isolation_journal;
808
809/// The raw differences of an isolated merge and the worktree state of each changed path.
810pub mod merge_isolation_changes;
811
812/// Recovery of an isolated merge whose process died.
813pub mod merge_isolation_recovery;
814
815/// The commit message of an isolated merge.
816pub mod merge_isolation_message;
817
818/// The refusal findings of an isolated merge.
819pub mod merge_isolation_report;
820
821/// A true merge completed in isolation while the index holds staged changes.
822pub mod merge_isolation;
823
824/// Automatic maintenance decision: config record parsing and the enable and detach rules.
825pub mod maintenance_decision;
826
827/// Running automatic maintenance after a landing: the config read, then `git maintenance run --auto`.
828pub mod maintenance_run;
829
830/// Catching SIGINT, SIGTERM, SIGHUP and SIGQUIT while a Git child runs, and relaying only process-sent signals.
831pub mod signal_relay;
832
833/// The per-branch file name of the push failure notice: a reversible, flat, case-safe key.
834pub mod auto_push_branch_key;
835
836/// How long a command waits for the commit service's hold on the index, and the variable that sets it.
837pub mod wait_limit;
838
839/// The shared clock of every wait notice: the grace, the repeat interval and a queued commit's place in line.
840pub mod wait_progress;
841
842/// A watcher for waits that block on a child process: notices at the cadence and the child stopped at the bound.
843pub mod child_watch;
844
845/// The classes of Git step a commit starts for itself, with the bound and the notice grace of each.
846pub mod child_class;
847
848/// Read-only Git queries of the auto-push, each with a deadline and separate output streams.
849pub mod bounded_query;
850
851/// The auto-push's real `git push` with a deadline and its low-speed abort.
852pub mod bounded_push;
853
854/// The processes of this host that use a directory or a file.
855pub mod process_use;
856
857/// The processes below one process, read before it is stopped and signalled only while they are still the ones found.
858pub mod process_tree;
859
860/// The real Git of a push, its query runner and the failure types of a push.
861pub mod auto_push_single_flight;
862
863/// Where a plain `git push` of one named branch goes, from the configuration and the local refs.
864pub mod auto_push_destination;
865
866/// The push a merge, pull, cherry-pick, revert or am hands to the service when it leaves the branch ahead of its upstream.
867#[cfg(unix)]
868pub mod auto_push_trigger;
869
870/// The record of each decision of the push trigger: handed over, or declined with its reason.
871pub mod push_trigger_log;
872
873/// Publishing a landed commit that a moved remote branch rejected: the merge is made from objects alone and pushed.
874pub mod auto_push_reconcile;
875
876/// The paths of a dirty worktree and of a fast-forward, and their overlap.
877pub mod auto_push_dirty_paths;
878
879/// Post-commit auto-push of a landed commit: the push argv, the surfaced output and the failure reporting.
880pub mod auto_push;
881
882/// The post-commit gate over a landed commit: its events, its blocking and the backup it allows.
883pub mod post_commit;
884
885/// Authoritative manual-push updates discovered by a private dry-run push and confirmed with ls-remote.
886pub mod manual_push_porcelain;
887
888/// The updates a manual `git push` would send, learned from Git's own dry-run report and confirmed against the remote.
889pub mod manual_push_probe;
890
891/// Published-set and range computation for manual-push scans: which pushed commits a remote does not have.
892pub mod manual_push_range;
893
894/// An explicit push that lost a race: run as a child, merge in what landed on the remote and publish the merge.
895pub mod push_stacking;
896
897/// Starting a child again when the operating system refuses it for lack of processes, within a bounded wait.
898pub mod start_retry;
899
900/// The manual-push candidate scope of one push: the commits and trees the destination lacks.
901pub mod manual_push_lifecycle;
902/// The one failure type of the linked-worktree ignored-state copy and its diagnostics.
903pub mod worktree_copy_error;
904
905/// Which linked worktrees a worktree-creating Git command registered, before and after it ran.
906pub mod worktree_copy_registry;
907
908/// The ignored source paths a linked-worktree copy selects, and the path validation every selection passes.
909pub mod worktree_copy_selection;
910
911/// The deterministic parent-first manifest of a copy, and the mode application to a staged copy.
912pub mod worktree_copy_manifest;
913
914/// Exact comparison of manifest entries against the filesystem, and the source stability check after staging.
915pub mod worktree_copy_compare;
916
917/// The private, validated stage of one source's ignored state beside a destination worktree.
918pub mod worktree_copy_stage;
919
920/// The exclusive creation of one destination entry from the stage, and the identity captured after it.
921#[cfg(unix)]
922pub mod worktree_copy_install_entry;
923
924/// Installation of a validated stage into a new worktree, with preflight, batches and rollback on failure.
925#[cfg(unix)]
926pub mod worktree_copy_install;
927
928/// Removal of the paths a failed installation created, only where their identity and content still prove them cli-git's own.
929#[cfg(unix)]
930pub mod worktree_copy_rollback;
931
932/// The durable journal of one copy: exact encoding, strict validation, private storage and removal.
933#[cfg(unix)]
934pub mod worktree_copy_journal;
935
936/// The durable claim on a stage container's name, and the removal of stages an interrupted copy left behind.
937#[cfg(unix)]
938pub mod worktree_copy_stage_claim;
939
940/// The append-only install log of one stage: per-batch intents and creations, with resumption.
941#[cfg(unix)]
942pub mod worktree_copy_install_log;
943
944/// One journaled installation to an end, resumption from the log, and synchronization of a created worktree.
945#[cfg(unix)]
946pub mod worktree_copy_transaction;
947
948/// The settlement lock that serializes copy installation and recovery, its owner record, and inherited leases.
949#[cfg(unix)]
950pub mod worktree_copy_lock;
951
952/// Recovery of interrupted copies: registration checks, discards with notices, resumption, and the pending check.
953#[cfg(unix)]
954pub mod worktree_copy_recovery;
955
956/// The linked-worktree ignored-state copy around one forwarded Git invocation: the integrator's entry point.
957#[cfg(unix)]
958pub mod worktree_copy;
959
960/// Which forwarded invocations the copy applies to, and the child run that carries its settlement lease.
961pub mod worktree_copy_forward;
962
963/// The system configuration file a real Git executable reads, learned once per executable identity.
964pub mod git_system_config;
965
966/// In-process repository reads: the plain-text configuration reader that gives up on any spelling it cannot prove.
967pub mod repo_read_config_text;
968
969/// In-process repository reads: proof that no configuration scope sets `core.bare` or `core.worktree`.
970pub mod repo_read_config_scan;
971
972/// In-process repository reads: proof that every configuration value Git types at startup is one Git accepts silently.
973pub mod repo_read_config_typed;
974
975/// In-process repository reads: the location, Git paths and object format found from the file system.
976pub mod repo_read_layout;
977
978/// In-process repository reads: the layout turned into the shapes the wrapper's existing queries answer with.
979pub mod repo_read_adapter;
980
981/// In-process repository reads: object kinds, names and the zlib step shared by loose objects and packs.
982pub mod repo_read_object;
983
984/// In-process repository reads: one pack, its index lookup and delta resolution.
985#[cfg(unix)]
986pub mod repo_read_pack;
987
988/// In-process repository reads: the object database of a repository, its packs and alternates.
989#[cfg(unix)]
990pub mod repo_read_odb;
991
992/// The abbreviated object name Git prints (`core.abbrev`, the automatic length, uniqueness), computed without starting Git.
993#[cfg(unix)]
994pub mod object_abbreviation;
995
996/// In-process repository reads: trees, flattened trees and commit fields.
997#[cfg(unix)]
998pub mod repo_read_tree;
999
1000/// In-process repository reads: the entries of an index file, versions 2 to 4.
1001pub mod repo_read_index;
1002
1003/// In-process repository reads: the difference between two sorted entry lists and the output spellings.
1004#[cfg(unix)]
1005pub mod repo_read_diff;
1006
1007/// In-process repository reads: the files ref storage, one ref by name, a symbolic chain and the list of all refs.
1008#[cfg(unix)]
1009pub mod repo_read_refs;
1010
1011/// In-process repository reads: the merged configuration listing with includes and environment entries.
1012pub mod repo_read_config_list;
1013
1014/// In-process repository reads: answers to the exact read-only command lines the wrapper issues.
1015#[cfg(unix)]
1016pub mod repo_read_query;
1017
1018/// In-process repository reads: answers for the reference and configuration command lines.
1019#[cfg(unix)]
1020pub mod repo_read_query_refs;
1021
1022/// In-process repository reads: the two runner entry points that try the answers before starting Git.
1023pub mod repo_read_hook;
1024
1025/// The standards-review shadow run: JavaScript text behaviors the log depends on (UTF-16 lengths, number text).
1026pub mod standards_review_text;
1027
1028/// The standards-review shadow run: a file's changed old-side ranges read from the patch.
1029pub mod standards_review_patch;
1030
1031/// The standards-review shadow run: which commits get an entry, and the capped model input.
1032pub mod standards_review_input;
1033
1034/// The standards-review shadow run: the Decisions API request body and the answer reading.
1035pub mod standards_review_request;
1036
1037/// The standards-review shadow run: log entry rendering and appending.
1038pub mod standards_review_entry;
1039
1040/// The standards-review shadow run: the in-process HTTPS call to the decisions gateway, with a total deadline.
1041pub mod standards_review_client;
1042
1043/// The standards-review shadow run: the two real-Git reads (patch and file texts) of a landed commit.
1044pub mod standards_review_source;
1045
1046/// The standards-review shadow run, end to end, and its bounded runner. Nothing calls it yet.
1047pub mod standards_review_run;
1048
1049/// A loopback HTTP server for the standards-review tests; never in the release build.
1050#[cfg(test)]
1051mod standards_review_mock;
1052
1053/// The durable work-item record for asynchronous work (review, push, maintenance) left for a resident consumer.
1054pub mod work_item;
1055pub mod work_item_recovery;
1056
1057/// The clocks a claim's lease is judged by.
1058pub mod claim_time;
1059
1060/// The repositories the service looks at again when a claim another instance holds may have run out.
1061pub mod service_retry;
1062
1063/// Messages between the wrapper and the resident commit service.
1064pub mod service_protocol;
1065
1066/// What the user is told when the commit service cannot land a commit.
1067pub mod service_messages;
1068
1069/// The commit service's journal and its restart decisions.
1070pub mod service_journal;
1071
1072/// Test-only fault points of the commit service.
1073pub mod service_fault;
1074
1075/// The commit service's serialized step.
1076pub mod service_land;
1077
1078/// What the commit service's landing does once the branch has moved: index entries and conclusion state.
1079pub mod service_land_follow;
1080
1081/// The commit service's hold on Git's index lock across a landing.
1082pub mod service_index_lock;
1083
1084/// The attempts and the wait of an acquisition of the index lock.
1085pub mod service_index_attempts;
1086
1087/// The marker the service writes into the index lock and the questions asked of a marker.
1088pub mod service_index_marker;
1089
1090/// The marker of the next batch's index lock, made and flushed while the service is idle.
1091pub mod service_index_prestage;
1092
1093/// What an acquisition of the index lock found when it had to wait, for the service's log.
1094pub mod service_index_found;
1095
1096/// Who a marker's holder is: the identity a process writes, and the answers a reader gives (gone, running, unknown).
1097pub mod service_index_identity;
1098
1099/// The service's hold on a placed index lock: the check that it is still the holder's, the release and the removal.
1100pub mod service_index_hold;
1101
1102/// Whether the index lock is still the file the holder placed, and the record of a lock that could not be settled.
1103pub mod service_index_ownership;
1104
1105/// The staging files of the index lock.
1106pub mod service_index_staging;
1107
1108/// How the service's marked file becomes the index lock, and the cleanup of staging files.
1109pub mod service_index_placement;
1110
1111/// The inotify watch the wait for the index lock blocks on.
1112pub mod service_index_watch;
1113
1114/// The preparation of a commit that the service lands, for every command line.
1115pub mod service_prepare;
1116
1117/// The `discardedCopies` section of `cli-git.config.jsonc`.
1118pub mod config_discarded;
1119
1120/// The bound on the folder of saved copies of conflicted files: age, size, audit and doctor report.
1121pub mod discarded_prune;
1122
1123/// The native journal protocol and the standard error fallback the service's entries go through.
1124pub mod journald_native;
1125
1126/// The lines the commit service writes about its life and about the time each request took.
1127pub mod service_timing;
1128
1129/// The line the commit service writes when a signal ends it.
1130pub mod service_signal;
1131
1132/// The commit service's loop.
1133pub mod service_server;
1134
1135/// The wrapper's side of a commit through the commit service.
1136pub mod service_client;
1137
1138/// Which commit command lines the commit service covers, and the message they stand for.
1139pub mod service_commit_args;
1140
1141/// The one summary line a landed commit prints, with the abbreviated name Git would print.
1142pub mod landed_summary;
1143
1144/// The wait of a wrapped index writer for the commit service's own hold on the index.
1145pub mod service_index_wait;
1146
1147/// A forwarded index writer started again when the commit service took the index before its Git did.
1148pub mod service_hold_retry;
1149
1150/// The commit command's path through the commit service.
1151pub mod service_commit;
1152
1153/// The service's memory of when the bytes of the commits it landed were captured, per worktree.
1154pub mod service_captures;
1155
1156/// The retry of a commit the service sent back: the captured change merged onto the branch, never prepared again from the worktree.
1157pub mod service_replay;
1158
1159/// Which way a commit goes: through the service, set up first, or the earlier path.
1160pub mod service_route;
1161
1162/// The wrapper's own provisioning of the commit service's socket activation.
1163pub mod service_provision;
1164
1165/// A minimal D-Bus client for the user session bus, for the provisioning's two calls.
1166pub mod systemd_dbus;
1167
1168/// The message and identities of a service commit, made as native `git commit` makes them.
1169pub mod service_message;
1170
1171/// What an amend takes from the commit it replaces: parents, message and author.
1172pub mod service_amend;
1173
1174/// The commits real Git builds for the service: an editor, a signature, and what the service does not embed.
1175pub mod service_native;
1176
1177/// The renewal that keeps the claims of a shared work directory from looking abandoned while their holder works.
1178pub mod service_claim_renewal;
1179
1180/// The service's consumer of after-commit push and upkeep work.
1181pub mod service_work;
1182
1183/// The wrapper's side of after-commit work: records and the wake.
1184pub mod service_handoff;
1185
1186/// Which commit service instance belongs to a worktree: its name, socket and unit instances.
1187pub mod service_instance;
1188
1189/// Whether a worktree's head still names the branch a commit was prepared on.
1190pub mod service_head;
1191
1192/// How a commit headed for the service notices that its prepared content was removed before it landed.
1193pub mod service_pruned;
1194
1195/// The record of a failed backup push and the rule for when a wrapper command shows it.
1196pub mod push_failure_notice;
1197
1198/// What becomes of the unshown push notices and unfinished pushes of a linked worktree that Git removes.
1199pub mod worktree_removal_rescue;
1200
1201/// The words that say how to change the push deadline, for the terminal and for the resident commit service.
1202pub mod push_deadline_advice;
1203
1204/// The mechanical ban: no release code starts the wrapper, passes it management words or writes shell text.
1205#[cfg(test)]
1206#[path = "no_self_invocation_tests.rs"]
1207mod no_self_invocation_tests;
1208
1209/// The structural check that the review's network client is reachable only from the service run; never in the release build.
1210#[cfg(test)]
1211mod standards_review_boundary_tests;
1212
1213/// The standards-review shadow run: appending an entry to the shared log without a lock, once per commit, with repair.
1214pub mod standards_review_append;
1215
1216/// The service's handler for a review work item, bounded by a call deadline and a total budget.
1217pub mod service_review;
1218
1219/// The standards-review credential: redacted when printed, read from the wrapper's environment, sent in the work message.
1220pub mod service_review_key;
1221
1222/// The typed failure of one Linux filesystem primitive:
1223/// the call, the path and the error number.
1224#[cfg(target_os = "linux")]
1225pub mod fs_primitive_error;
1226
1227/// Which filesystem holds a path (btrfs, overlayfs, other) and whether a directory is a btrfs subvolume root.
1228#[cfg(target_os = "linux")]
1229pub mod fs_kind;
1230
1231/// The mount of a path read from `/proc/self/mountinfo`, with its options (`user_subvol_rm_allowed`).
1232#[cfg(target_os = "linux")]
1233pub mod fs_mount_options;
1234
1235/// The btrfs ioctls that create, snapshot and destroy a subvolume, called in process.
1236#[cfg(target_os = "linux")]
1237pub mod fs_btrfs_ioctl;
1238
1239/// `FICLONE` of one file into another and the atomic `RENAME_EXCHANGE` of two paths.
1240#[cfg(target_os = "linux")]
1241pub mod fs_clone_exchange;
1242
1243/// The btrfs fixture root of the primitive and migration controls, and the loud report where there is none.
1244#[cfg(all(test, target_os = "linux"))]
1245mod fs_btrfs_test_support;
1246
1247/// SHA-1 and SHA-256, for the checksum of a rewritten Git index.
1248#[cfg(target_os = "linux")]
1249pub mod subvolume_sha;
1250
1251/// The stat rewrite of a Git index file's bytes.
1252#[cfg(target_os = "linux")]
1253pub mod subvolume_index;
1254
1255/// The linked worktrees of a main checkout and the index stat rewrite applied to files.
1256#[cfg(target_os = "linux")]
1257pub mod subvolume_index_files;
1258
1259/// The failure type of the subvolume migration and its simulated-kill hook.
1260#[cfg(target_os = "linux")]
1261pub mod subvolume_error;
1262
1263/// The operating-system operations of the migration behind one trait, and the Linux implementation.
1264#[cfg(target_os = "linux")]
1265pub mod subvolume_platform;
1266
1267/// Copying owner, permissions, times and extended attributes onto a copy.
1268#[cfg(target_os = "linux")]
1269pub mod subvolume_sync_attrs;
1270
1271/// One idempotent pass that makes a directory tree match another, in process.
1272#[cfg(target_os = "linux")]
1273pub mod subvolume_sync;
1274
1275/// The index locks the migration holds, marked with a token that names the migration.
1276#[cfg(target_os = "linux")]
1277pub mod subvolume_lock;
1278
1279/// An open directory that every operation inside it is addressed through, so a replaced path cannot redirect them.
1280#[cfg(target_os = "linux")]
1281pub mod subvolume_anchor;
1282
1283/// Removal of a directory tree whose directories may lack owner write permission.
1284#[cfg(target_os = "linux")]
1285pub mod subvolume_remove;
1286
1287/// The migration journal beside the checkout.
1288#[cfg(target_os = "linux")]
1289pub mod subvolume_journal;
1290
1291/// The paths of a migration and the refusals that stop it before anything is created.
1292#[cfg(target_os = "linux")]
1293pub mod subvolume_preflight;
1294
1295/// The state a migration command carries between its steps.
1296#[cfg(target_os = "linux")]
1297pub mod subvolume_run;
1298
1299/// Converting a main checkout into a btrfs subvolume, resumably.
1300#[cfg(target_os = "linux")]
1301pub mod subvolume_migrate;
1302
1303/// Undoing a migration and deleting the old tree.
1304#[cfg(target_os = "linux")]
1305pub mod subvolume_rollback;
1306
1307/// The grammar of `git cli-git migrate-to-subvolume`.
1308pub mod subvolume_arguments;
1309
1310/// `git cli-git migrate-to-subvolume`: root discovery, modes and exit statuses.
1311#[cfg(target_os = "linux")]
1312pub mod subvolume_command;
1313
1314/// The stand-in platform and fixture checkouts of the subvolume migration controls.
1315#[cfg(all(test, target_os = "linux"))]
1316mod subvolume_test_support;
1317
1318/// The migration controls that need the real btrfs ioctls, `FICLONE` and exchange.
1319#[cfg(all(test, target_os = "linux"))]
1320mod subvolume_btrfs_tests;
1321
1322/// Quoting of bytes printed inside a shell command for a person to run.
1323#[cfg(target_os = "linux")]
1324pub mod shell_quote;
1325
1326/// The filesystem section of `git cli-git doctor`: btrfs subvolume, overlayfs, the removal mount option and its commands.
1327#[cfg(target_os = "linux")]
1328pub mod doctor_filesystem;