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