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 Git 2.56.0 option tables of every `git stash` subcommand.
205pub mod command_stash_table;
206
207/// Branch-creation facts of `git branch`,
208/// `git checkout` and `git switch`.
209pub mod command_branch_create;
210
211/// Which action a tokenized `git branch` region selects.
212mod command_branch_mode;
213
214/// The complete Git 2.56.0 option table of `git branch`.
215pub mod command_branch_table;
216
217/// Explicit creation and the remote-guess candidate of `git checkout` and `git switch`.
218mod command_branch_target;
219
220/// The complete Git 2.56.0 option tables of `git checkout` and `git switch`.
221pub mod command_checkout_table;
222
223/// The Git 2.56.0 option groups of `git config`.
224pub mod command_config_table;
225
226/// The form and file scope of a `git config` region.
227pub mod command_config;
228
229/// Pure decision of the require-root policy.
230pub mod rule_require_root;
231
232/// Whether a `git worktree` invocation creates or moves a worktree.
233pub mod command_worktree;
234
235/// Wrapper-only control spellings,
236/// their meanings,
237/// and removal before the subcommand.
238pub mod wrapper_controls;
239
240/// Removal of every wrapper control from one invocation,
241/// by position.
242pub mod wrapper_invocation;
243
244/// Lifecycle triggers and the trigger set of every shipped policy.
245pub mod policy_trigger;
246
247/// Policy events and their JSON Lines rendering.
248pub mod policy_events;
249
250/// A pathname as events report it:
251/// text,
252/// plus base64 `pathBytes` when it is not UTF-8.
253pub mod event_path;
254
255/// Exact repository path bytes as the operating system takes them, and as text for messages.
256pub mod path_bytes;
257
258/// Ordered policy execution for one lifecycle point.
259pub mod policy_engine;
260
261/// Slice 6: writes one corrected file into the private commit index as a blob and an index entry.
262pub mod private_index_stage;
263
264/// Slice 6: the commit path's bounded policy convergence over the private index.
265pub mod commit_convergence;
266
267/// The commit transaction in the incumbent's order, up to the settled policies.
268pub mod commit_transaction;
269
270/// The conclusion of a settled commit transaction: preparation, landing and post-landing completion.
271pub mod commit_conclusion;
272
273/// The landing loop with replay, revalidation and the starvation reservation.
274pub mod commit_landing_loop;
275
276/// The landing lock a landing attempt takes, with the recovery every acquisition runs first.
277pub mod commit_landing_lock;
278
279/// Revalidation of a replayed tree outside both landing locks.
280pub mod commit_revalidation;
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/// The disposable, recoverable workspace of one commit transaction.
293pub mod commit_workspace;
294
295/// Rule facts from the real repository with candidates read from the private index.
296pub mod commit_facts;
297
298/// The worktree completion records of selected corrections and of hook changes.
299pub mod commit_worktree_records;
300
301/// The replay-relevant commit options.
302pub mod commit_replay_options;
303
304/// Slice 9 skeleton: the order around a landed commit and a guarded Git child; not reachable until landing is merged.
305pub mod commit_lifecycle;
306
307/// The bounded loop that repeats a pass after corrections changed candidate content.
308pub mod policy_convergence;
309
310/// The one query for repository identity,
311/// top level and the path below it.
312pub mod repository_location;
313
314/// Lazily fetched repository facts behind one interface,
315/// with the real-Git provider.
316pub mod repository_facts;
317
318/// Pure decision of the linked-worktree-only policy.
319pub mod rule_linked_worktree;
320
321/// The rejection texts of the linked-worktree-only policy.
322pub mod rule_linked_worktree_messages;
323
324/// The append-only record of every command form that can discard uncommitted state.
325pub mod discard_audit;
326
327/// The intent-guessing hint that follows a finding, an engine failure or a notice.
328pub mod event_hints;
329
330/// Pure decision of the branch-worktree-only policy and its one-query remote guess.
331pub mod rule_branch_worktree;
332
333/// Pure decision of the add-explicit policy.
334pub mod rule_add_explicit;
335
336/// The repository content the dependent-version planner reads, and its two failure kinds.
337pub mod dependent_version_content;
338
339/// Which paths the dependent-version planner reads: manifests, configuration, source.
340pub mod dependent_version_paths;
341
342/// Strict JSON reading of a manifest's name, version and dependency names.
343pub mod dependent_version_manifest;
344
345/// Patch bumps of plain release versions and `JSON.stringify` quoting.
346pub mod dependent_version_release;
347
348/// The byte-preserving rewrite of a manifest's top-level version.
349pub mod dependent_version_text;
350
351/// Publishable package names from the generated registry configuration.
352pub mod dependent_version_publishable;
353
354/// Whether source text imports a package.
355pub mod dependent_version_imports;
356
357/// The dependency walk and the plan of dependent bumps.
358pub mod dependent_version_graph;
359
360/// Every workspace manifest at both states, and which versions were raised.
361pub mod dependent_version_states;
362
363/// Which development dependencies each dependent bundles.
364pub mod dependent_version_bundled;
365
366/// The dependent-version plan with exact manifest bytes before and after.
367pub mod dependent_version_plan;
368
369/// The decision and findings of `mono/dependent-version-bump`.
370pub mod dependent_version_policy;
371
372/// The dependent-version planner's view of a prepared candidate state.
373pub mod dependent_version_lifecycle;
374
375/// Whether a direct fix may change a tracked file it did not select.
376pub mod policy_added_path;
377
378/// The `mono/dependent-version-bump` check over a lifecycle's candidate state.
379pub mod policy_dependent_version;
380
381/// An in-memory workspace that records reads; never in the release build.
382#[cfg(test)]
383mod dependent_version_test_support;
384
385/// Differential fixture reading and canonical results; never in the release build.
386#[cfg(test)]
387mod dependent_version_fixture_json;
388
389/// Canonical renderings of the native planner's results; never in the release build.
390#[cfg(test)]
391mod dependent_version_fixture_output;
392
393/// One differential case evaluated by the native planner; never in the release build.
394#[cfg(test)]
395mod dependent_version_fixture_cases;
396
397/// The native planner against the incumbent's recorded results; never in the release build.
398#[cfg(test)]
399mod dependent_version_differential_tests;
400
401/// The shipped policies as checks over rule cores and repository facts.
402pub mod policy_checks;
403
404/// What a lifecycle offers content policies,
405/// and its candidates once prepared.
406pub mod policy_content;
407
408/// The built-in final-newline policy:
409/// canonical final LF,
410/// preserved paths,
411/// findings.
412pub mod policy_final_newline;
413
414/// The optional root-context policy:
415/// no top-level `CONTEXT.md` enters the index.
416pub mod policy_root_context;
417
418/// The optional catalog-specifier policy over the shared rule crate:
419/// every dependency in a tracked `package.json` is a catalog or workspace reference.
420pub mod policy_catalog_specifiers;
421
422/// The optional forbidden-strings policy over the linked scanner,
423/// with redacted findings.
424pub mod policy_forbidden_strings;
425
426/// One child program run with a time bound and output caps,
427/// through files instead of pipes.
428pub mod bounded_child;
429
430/// What one in-process linter run produced:
431/// the fixed source and the findings left,
432/// or why it is unusable.
433pub mod markdown_linter_output;
434
435/// The one-rule linter configuration document.
436pub mod markdown_linter_config;
437
438/// The gitignore-syntax `exclude` patterns of `markdown/autofix`,
439/// matched as the linter matches them.
440pub mod markdown_exclude;
441
442/// The `markdown/autofix` policy over candidates,
443/// behind its linter interface.
444pub mod policy_markdown;
445
446/// The executable's linter for that policy:
447/// `monochromatic-lint` linked in-process,
448/// guarded by a deadline,
449/// once per candidate.
450pub mod markdown_linter;
451
452/// A job on a thread of its own with a deadline and panic containment.
453pub mod markdown_linter_guard;
454
455/// The executable's panic hook:
456/// where an internal error happened,
457/// never its message.
458pub mod panic_notice;
459
460/// Installing a direct fix's corrections into the worktree,
461/// all or none.
462pub mod direct_fix_install;
463
464/// The direct fix:
465/// converge corrections in memory,
466/// then install them.
467pub mod direct_fix;
468
469/// The fixed argument transforms of a forwarded command,
470/// in order.
471pub mod policy_transforms;
472
473/// One complete pass:
474/// built-in policies,
475/// fixed transforms,
476/// optional policies.
477pub mod policy_pass;
478
479/// The names of the commands built into Git 2.56.0.
480pub mod git_builtins;
481
482/// The work of the installed cli-git that is not ported,
483/// and the refusal notice.
484pub mod unported;
485
486/// The lifecycle of one wrapped Git command,
487/// from refusals to forwarding.
488pub mod wrapped_command;
489
490/// A scripted repository-facts provider for unit tests;
491/// never in the release build.
492#[cfg(test)]
493mod policy_test_support;
494
495/// The one failure type of the candidate layer and its closed list of causes.
496pub mod candidate_error;
497
498/// Validated Git object names and the file modes a candidate can carry.
499pub mod candidate_object;
500
501/// Pure framing of one `git cat-file --batch` reply.
502pub mod candidate_batch;
503
504/// Pure parsing of raw NUL-delimited changed-path records.
505pub mod candidate_record;
506
507/// The long-lived object reader that answers every blob read of an invocation.
508pub mod candidate_reader;
509
510/// Immutable candidate versions:
511/// identity,
512/// pathname,
513/// mode,
514/// change and object per path.
515pub mod candidate_version;
516
517/// Per-invocation listing,
518/// lazy bytes and invalidation of candidate versions.
519pub mod candidate_store;
520
521/// Pure parsing of `git ls-files --stage` records and the delta between two index states.
522pub mod candidate_stage;
523
524/// The files of a commit's tree with their modes and objects.
525pub mod candidate_tree;
526
527/// A private,
528/// timestamp-preserving copy of the real index,
529/// removed when dropped.
530pub mod candidate_private_index;
531
532/// Which candidate paths have their `text` Git attribute unset,
533/// read from the state the candidates were listed from.
534pub mod candidate_attribute;
535
536/// What `git add` would stage,
537/// and the worktree files a direct command selects.
538pub mod candidate_prediction;
539
540/// Which candidates hold content that a parent commit's tree already holds,
541/// found by exact object name.
542pub mod candidate_known_content;
543
544/// The linked forbidden-strings scanner:
545/// one load per invocation,
546/// typed redacted findings.
547pub mod scanner_adapter;
548
549/// Rules-file precedence and which candidates the scanner is given.
550pub mod scanner_selection;
551
552/// One scan pass over a candidate version's exact bytes.
553pub mod scanner_run;
554
555/// Which engine failure code each candidate and scanner failure carries.
556pub mod scanner_failure_code;
557
558/// Process isolation and rule fixtures for scanner controls;
559/// never in the release build.
560#[cfg(test)]
561mod scanner_test_support;
562
563/// Private,
564/// crash-safe file primitives shared by every durable record.
565pub mod private_storage;
566
567/// One journal record written whole, followed by the syncs its durability level names.
568pub mod journal_record;
569
570/// Where short-lived private files live:
571/// the per-user scratch directory and the repository scratch directory,
572/// never the system temporary directory.
573pub mod scratch_location;
574
575/// Compact JSON records read and written with the incumbent's `JSON` semantics.
576pub mod json_record;
577
578/// Random identifiers in the layout of the incumbent's `randomUUID`.
579pub mod random_id;
580
581/// Text operations with the exact semantics of JavaScript's built-ins.
582pub mod js_text;
583
584/// The PID namespace an owner record names, and the rule for owners of another one.
585pub mod pid_namespace;
586
587/// Process-birth identities in the incumbent's exact spelling.
588pub mod process_identity;
589
590/// The owner record inside every owner-lock directory.
591pub mod owner_lock_record;
592
593/// Rename-published owner locks with dead-owner retirement and an unbounded wait.
594pub mod owner_lock;
595
596/// Line-oriented debug and warning diagnostics on standard error.
597pub mod diagnostic_log;
598
599/// The fail-closed failure of reading or recovering durable transaction state.
600pub mod recovery_error;
601
602/// The owner record of one commit-transaction directory and its liveness rule.
603pub mod transaction_owner;
604
605/// The per-worktree registry of commit-transaction directories.
606pub mod transaction_registry;
607
608/// The length and hash of an index snapshot that a landing record keeps.
609pub mod content_digest;
610
611/// The schema-version-2 journal records of one commit transaction and their filenames.
612pub mod transaction_journal;
613
614/// The exact encoding of every journal record.
615pub mod transaction_journal_encode;
616
617/// Strict parsers of every journal record.
618pub mod transaction_journal_parse;
619
620/// UTC timestamps in the exact form of JavaScript's `toISOString`.
621pub mod iso_time;
622
623/// The filesystem identity recorded with every real `index.lock` a transaction creates.
624pub mod filesystem_identity;
625
626/// The Linux filesystem UUID of a path read from the mount table and the udev database instead of `findmnt`.
627#[cfg(target_os = "linux")]
628pub mod filesystem_identity_mount;
629
630/// The Linux `f_fsid` of a path asked of the kernel in-process instead of by starting `stat`.
631#[cfg(target_os = "linux")]
632pub mod filesystem_identity_fsid;
633
634/// Running real Git for transaction,
635/// recovery and landing work.
636pub mod transaction_git;
637
638/// The preparation and landing leases nested wrapper invocations inherit.
639pub mod transaction_lease;
640
641/// Lexical path normalization.
642pub mod lexical_path;
643
644/// The ban on Git starting the wrapper for a hook: no entry writer, no start-name dispatch.
645#[cfg(test)]
646#[path = "hook_self_invocation_tests.rs"]
647mod hook_self_invocation_tests;
648
649/// What `git cli-git doctor` reports from the configuration: configured hooks and the retired `hooks` key.
650pub mod doctor_config;
651
652/// The configured external hooks, read from the snapshot, and the loud report that none runs.
653pub mod external_hooks;
654
655/// The non-blocking warning for a configured `core.hooksPath`, decided from the configuration snapshot alone.
656pub mod traditional_hook_warning;
657
658/// `git cli-git doctor`: the traditional hooks a repository holds, which are unsupported.
659pub mod doctor;
660
661/// When a push needs the Git LFS upload, and the texts the parent prints around it.
662pub mod lfs_pre_push;
663
664/// What the Git LFS upload sends: the remote and the refs, read from the push and the configuration Git would read.
665pub mod lfs_upload_plan;
666
667/// The configuration the Git LFS upload plan reads, and the default remote derived from it.
668pub mod lfs_upload_settings;
669
670/// Hides the credentials inside URLs in the text relayed from `git-lfs`.
671pub mod lfs_output_mask;
672
673/// Which failed `git-lfs push` runs are tried again (server errors only), after how long, and the notice.
674pub mod lfs_server_retry;
675
676/// Whether a blob is a Git LFS pointer, decided as `git-lfs` decides it.
677pub mod lfs_pointer;
678
679/// The LFS objects a push introduces, found in process from the commits to be pushed.
680#[cfg(unix)]
681pub mod lfs_pointer_scan;
682
683/// The upload plan narrowed to the objects the push introduces, or to nothing.
684pub mod lfs_object_plan;
685
686/// The parent's bounded or interactive run of the Git LFS upload.
687pub mod lfs_upload;
688
689/// The Git LFS step before a push the caller typed: pre-check, plan and upload with the caller's streams.
690pub mod lfs_interactive;
691
692/// The check that `git-lfs` can start, made before a push that is preceded by the upload.
693pub mod lfs_push_precheck;
694
695/// What a waiting notice says about the lock holder: its age, its command and the limits.
696pub mod lock_holder_facts;
697
698/// The auto-push's bounded `git push`, preceded by the upload, its pre-check and its explanation.
699pub mod lfs_bounded_push;
700
701/// The push of a merge that integrated a lost race, planned and run inside the running wrapper.
702pub mod stacked_merge_push;
703
704/// Every real-Git start of the wrapper carries `core.hooksPath` pointing at a directory that never exists.
705pub mod hooks_off;
706
707/// No-follow file operations recovery and landing share.
708pub mod recovery_files;
709
710/// Durable evidence a dead transaction left:
711/// attempt records,
712/// owned locks and Git's PID file.
713pub mod recovery_evidence;
714
715/// The reflog search that proves which commit an interrupted transaction landed.
716pub mod recovery_reflog;
717
718/// Deciding whether a landing landed,
719/// and installing its recorded post-index.
720pub mod recovery_completion;
721
722/// The check that an index snapshot still holds the bytes the landing wrote.
723pub mod recovery_snapshot;
724
725/// The steps that finish a retained transaction by hand.
726pub mod recovery_manual_steps;
727
728/// The failure of a journal record that cannot be read, with its path and ways out named.
729pub mod recovery_record_failure;
730
731/// The refusal to discard a transaction whose branch moved but whose records say otherwise.
732pub mod recovery_contradiction;
733
734/// The `.keep` files protecting a landing's migrated pack.
735pub mod pack_keep;
736
737/// Test-only transaction phase markers, compiled into the release executable and armed only by an environment variable.
738pub mod transaction_phase;
739
740/// Landing target comparison, nonce reflog message and compare-and-swap.
741pub mod landing_support;
742
743/// Migration of a prepared commit's shadow objects into a kept pack of the real store.
744pub mod landing_objects;
745
746/// Post-index a landing installs, computed against the real index at landing.
747pub mod landing_index;
748
749/// The check that a landing changed no staged entry outside the paths it committed.
750pub mod landing_invariant;
751
752/// One landing attempt inside the landing critical section, and its outcome.
753pub mod landing_attempt;
754
755/// The `concurrent-commit` finding for a landing that landed nothing.
756pub mod landing_findings;
757
758/// Git commands run against a transaction's shadow repository.
759pub mod shadow_git;
760
761/// Native conclusion cleanup reproduced in the owning worktree.
762pub mod conclusion_cleanup;
763
764/// The per-worktree capture store:
765/// location,
766/// sequence and identity.
767pub mod capture_store;
768
769/// `captured.json`,
770/// landed-capture records,
771/// their recording and pruning.
772pub mod capture_records;
773
774/// Replay: the unified-diff parser of subsumption (`replay_patch`).
775pub mod replay_patch;
776
777/// Replay: the exact strict reverse check of subsumption (`replay_reverse_apply`).
778pub mod replay_reverse_apply;
779
780/// Replay: the one-sided extension of subsumption over zero-context hunks (`replay_containment`).
781pub mod replay_containment;
782
783/// Replay: raw commit objects as bytes, the unsigned rewrite and signed-rebuild inputs (`replay_object`).
784pub mod replay_object;
785
786/// Replay: capture order over the landed first-parent history and the per-path decision (`replay_capture_order`).
787pub mod replay_capture_order;
788
789/// Replay: the starvation reservation of the next landing slot (`replay_reservation`).
790pub mod replay_reservation;
791
792/// Replay: the shadow-repository Git runner that every replay step uses (`replay_shadow`).
793pub mod replay_shadow;
794
795/// Replay: shared paths of the landed history and the prepared commit, with their three entries (`replay_shared_paths`).
796pub mod replay_shared_paths;
797
798/// Replay: the text half of subsumption over index-named blobs and hunks (`replay_subsumption_text`).
799pub mod replay_subsumption_text;
800
801/// Replay: subsumption rules and the synthetic merge base (`replay_subsumption`).
802pub mod replay_subsumption;
803
804/// Replay: capture-order history and the per-path decisions from the transaction's and landed records (`replay_capture_history`).
805pub mod replay_capture_history;
806
807/// Replay: the merge tree, the first conflicting landed commit, and the replayed commit rebuild (`replay_merge`).
808pub mod replay_merge;
809
810/// Replay: the replayed index, the shadow HEAD move, and the pre-commit re-run decision of revalidation (`replay_revalidation`).
811pub mod replay_revalidation;
812
813/// Replay: one replay of a prepared commit onto a moved target, the integrator's replay result (`replay_commit`).
814pub mod replay_commit;
815/// The empty tree's object name under each known object format.
816pub mod empty_tree;
817
818/// Files-backend ref reads that answer without a Git process or decline.
819pub mod ref_files;
820
821/// Proof, without a Git process, that a sequencer marker names nothing on the files ref storage.
822pub mod sequencer_marker;
823
824/// The invocation capture:
825/// repository layout, symbolic `HEAD`, conclusion kind, ref backend and base.
826pub mod capture_invocation;
827
828/// The capture under capture order:
829/// the capture lock, the store identity, the sequence and `captured.json`.
830pub mod capture_order;
831
832/// The shadow repository `config` file and the copied repository format.
833pub mod shadow_config;
834
835/// The shadow repository links to the real shared entries.
836pub mod shadow_links;
837
838/// The shadow ref store: snapshot, private target, symbolic refs and `HEAD`.
839pub mod shadow_refs;
840
841/// The shadow conclusion copies at preparation.
842pub mod conclusion_copy;
843
844/// Argument transforms of native preparation: normalisation, global split, `-a` removal and private arguments.
845pub mod commit_args;
846
847/// The private commit index: copies, selection modes, pathspec files and listings.
848pub mod commit_index;
849
850/// Native `git commit` in the shadow, the prepared commit read back and `prepared.json`.
851pub mod commit_preparation;
852
853/// Creation of the shadow repository of one transaction.
854pub mod shadow_create;
855
856/// The entries of an empty bare repository, created in-process instead of by `git init`.
857pub mod shadow_skeleton;
858
859/// A read of the assume-unchanged and skip-worktree marks of an index file.
860pub mod index_flags;
861
862/// Loading many blobs through one `git cat-file --batch`.
863pub mod blob_batch;
864
865/// Bringing added paths' worktree copies to their landed bytes.
866pub mod worktree_completion;
867
868/// The processes of this host that use a directory or a file.
869pub mod process_use;
870
871/// Whether a published transaction directory without an owner record is abandoned.
872pub mod ownerless_directory;
873
874/// The release of a real index lock that a dead wrapper's PID file announces without a lock record.
875pub mod recovery_unrecorded_lock;
876
877/// Where a dead owner's real index lock is found, and the release of the locks its surviving records prove.
878pub mod recovery_dead_owner_locks;
879
880/// Owner inspection of registry entries and the oldest-first order.
881pub mod recovery_inspect;
882
883/// Recovery of one dead-owner transaction.
884pub mod recovery_landing;
885
886/// Disposal of a landed transaction: shadow removal, directory removal, then landed-capture pruning.
887pub mod landed_disposal;
888
889/// Post-landing completion of one landed commit: worktree copies, disposal, maintenance, then `post-commit`.
890pub mod post_landing;
891
892/// Recovery across every transaction directory of one worktree.
893pub mod recovery_scan;
894
895/// Startup recovery of interrupted commit transactions.
896pub mod commit_recovery;
897
898/// Startup recovery as a step of a wrapped or direct command.
899pub mod transaction_gate;
900
901/// Process start times for lock owners,
902/// read from `/proc`,
903/// `ps` or the Windows process table.
904pub mod process_start;
905
906/// The Git version check run once before work that depends on Git's behavior.
907pub mod git_version;
908
909/// The private per-user cache of the version text, keyed by the Git executable's identity.
910pub mod git_version_cache;
911
912/// Processes holding a lock file open,
913/// found by device and inode.
914pub mod index_lock_holders;
915
916/// Parsers of `lsof -F pcDi` records and Restart Manager lines,
917/// matched by device and inode.
918pub mod index_lock_holder_parsers;
919
920/// Evidence about a foreign `index.lock` and the verdict it supports.
921pub mod index_lock_evidence;
922
923/// The Git command a forwarded invocation runs,
924/// after ordinary alias expansion.
925pub mod forwarded_command;
926
927/// Index-writer classification and the commands that coordinate with a landing.
928pub mod index_writer_commands;
929
930/// Waiting for a foreign index.lock under the classification rules and Git's backoff schedule.
931pub mod index_lock_wait;
932
933/// The host side effects of the index-lock wait:
934/// /proc reads,
935/// sleeps,
936/// randomness and standard error.
937pub mod index_lock_wait_host;
938
939/// The landing location a forwarded index writer coordinates with:
940/// the real index and the registry.
941pub mod landing_location;
942
943/// Coordination of a forwarded index writer:
944/// the landing lock,
945/// the wait for a foreign lock and the lease.
946pub mod index_writer_coordination;
947
948/// Running a coordinated forwarded index writer:
949/// the landing lock held while real Git runs as a child.
950pub mod index_writer_forward;
951
952/// The `git merge` command lines the wrapper completes in isolation, and those it leaves to native Git.
953pub mod merge_options;
954
955/// The durable intent record of an isolated merge.
956pub mod merge_isolation_journal;
957
958/// The raw differences of an isolated merge and the worktree state of each changed path.
959pub mod merge_isolation_changes;
960
961/// Recovery of an isolated merge whose process died.
962pub mod merge_isolation_recovery;
963
964/// The commit message of an isolated merge.
965pub mod merge_isolation_message;
966
967/// The refusal findings of an isolated merge.
968pub mod merge_isolation_report;
969
970/// A true merge completed in isolation while the index holds staged changes.
971pub mod merge_isolation;
972
973/// The real index.lock a landing creates,
974/// identifies and releases only while it is the same file.
975pub mod real_index_lock;
976/// Automatic maintenance decision: config record parsing and the enable and detach rules.
977pub mod maintenance_decision;
978
979/// Running automatic maintenance after a landing: the config read, then `git maintenance run --auto`.
980pub mod maintenance_run;
981
982/// Catching SIGINT, SIGTERM, SIGHUP and SIGQUIT while a Git child runs, and relaying only process-sent signals.
983pub mod signal_relay;
984
985/// Exact removal of retired hk hook registrations from one explicit Git configuration scope.
986pub mod maintenance_hk_config;
987
988/// The per-branch push coordination file name: a reversible, flat, case-safe key.
989pub mod auto_push_branch_key;
990
991/// The per-branch `last-pushed` record: validation, tolerant reads and atomic publication.
992pub mod auto_push_record;
993
994/// Waiting for a lock a live process holds: a slow-wait notice naming the holder and a configurable backstop.
995pub mod live_lock;
996
997/// The shared clock of every wait notice: the grace, the repeat interval and a queued commit's place in line.
998pub mod wait_progress;
999
1000/// A watcher for waits that block on a child process: notices at the cadence and the child stopped at the bound.
1001pub mod child_watch;
1002
1003/// The classes of Git step a commit starts for itself, with the bound and the notice grace of each.
1004pub mod child_class;
1005
1006/// Read-only Git queries of the auto-push, each with a deadline and separate output streams.
1007pub mod bounded_query;
1008
1009/// One time budget for everything a lock holder does under the push lock.
1010pub mod holder_budget;
1011
1012/// The auto-push's real `git push` with a deadline, its low-speed abort and the lock wait limit derived from it.
1013pub mod bounded_push;
1014
1015/// The processes below one process, read before it is stopped and signalled only while they are still the ones found.
1016pub mod process_tree;
1017
1018/// Single-flight push coordination per branch: owner lock, record joins and the push itself.
1019pub mod auto_push_single_flight;
1020
1021/// Publishing a landed commit that a moved remote branch rejected: the merge is made from objects alone and pushed.
1022pub mod auto_push_reconcile;
1023
1024/// The paths of a dirty worktree and of a fast-forward, and their overlap.
1025pub mod auto_push_dirty_paths;
1026
1027/// Post-commit auto-push of a landed commit: the push argv, the surfaced output and the failure reporting.
1028pub mod auto_push;
1029
1030/// The post-commit gate over a landed commit: its events, its blocking and the backup it allows.
1031pub mod post_commit;
1032
1033/// Authoritative manual-push updates discovered by a private dry-run push and confirmed with ls-remote.
1034pub mod manual_push_porcelain;
1035
1036/// The updates a manual `git push` would send, learned from Git's own dry-run report and confirmed against the remote.
1037pub mod manual_push_probe;
1038
1039/// Published-set and range computation for manual-push scans: which pushed commits a remote does not have.
1040pub mod manual_push_range;
1041
1042/// An explicit push that lost a race: run as a child, merge in what landed on the remote and publish the merge.
1043pub mod push_stacking;
1044
1045/// Starting a child again when the operating system refuses it for lack of processes, within a bounded wait.
1046pub mod start_retry;
1047
1048/// The manual-push candidate scope of one push: the commits and trees the destination lacks.
1049pub mod manual_push_lifecycle;
1050/// The one failure type of the linked-worktree ignored-state copy and its diagnostics.
1051pub mod worktree_copy_error;
1052
1053/// Which linked worktrees a worktree-creating Git command registered, before and after it ran.
1054pub mod worktree_copy_registry;
1055
1056/// The ignored source paths a linked-worktree copy selects, and the path validation every selection passes.
1057pub mod worktree_copy_selection;
1058
1059/// The deterministic parent-first manifest of a copy, and the mode application to a staged copy.
1060pub mod worktree_copy_manifest;
1061
1062/// Exact comparison of manifest entries against the filesystem, and the source stability check after staging.
1063pub mod worktree_copy_compare;
1064
1065/// The private, validated stage of one source's ignored state beside a destination worktree.
1066pub mod worktree_copy_stage;
1067
1068/// The exclusive creation of one destination entry from the stage, and the identity captured after it.
1069#[cfg(unix)]
1070pub mod worktree_copy_install_entry;
1071
1072/// Installation of a validated stage into a new worktree, with preflight, batches and rollback on failure.
1073#[cfg(unix)]
1074pub mod worktree_copy_install;
1075
1076/// Removal of the paths a failed installation created, only where their identity and content still prove them cli-git's own.
1077#[cfg(unix)]
1078pub mod worktree_copy_rollback;
1079
1080/// The durable journal of one copy: exact encoding, strict validation, private storage and removal.
1081#[cfg(unix)]
1082pub mod worktree_copy_journal;
1083
1084/// The durable claim on a stage container's name, and the removal of stages an interrupted copy left behind.
1085#[cfg(unix)]
1086pub mod worktree_copy_stage_claim;
1087
1088/// The append-only install log of one stage: per-batch intents and creations, with resumption.
1089#[cfg(unix)]
1090pub mod worktree_copy_install_log;
1091
1092/// One journaled installation to an end, resumption from the log, and synchronization of a created worktree.
1093#[cfg(unix)]
1094pub mod worktree_copy_transaction;
1095
1096/// The settlement lock that serializes copy installation and recovery, its owner record, and inherited leases.
1097#[cfg(unix)]
1098pub mod worktree_copy_lock;
1099
1100/// Recovery of interrupted copies: registration checks, discards with notices, resumption, and the pending check.
1101#[cfg(unix)]
1102pub mod worktree_copy_recovery;
1103
1104/// The linked-worktree ignored-state copy around one forwarded Git invocation: the integrator's entry point.
1105#[cfg(unix)]
1106pub mod worktree_copy;
1107
1108/// Which forwarded invocations the copy applies to, and the child run that carries its settlement lease.
1109pub mod worktree_copy_forward;
1110
1111/// In-process repository reads: the plain-text configuration reader that gives up on any spelling it cannot prove.
1112pub mod repo_read_config_text;
1113
1114/// In-process repository reads: proof that no configuration scope sets `core.bare` or `core.worktree`.
1115pub mod repo_read_config_scan;
1116
1117/// In-process repository reads: the location, Git paths and object format found from the file system.
1118pub mod repo_read_layout;
1119
1120/// In-process repository reads: the layout turned into the shapes the wrapper's existing queries answer with.
1121pub mod repo_read_adapter;
1122
1123/// In-process repository reads: object kinds, names and the zlib step shared by loose objects and packs.
1124pub mod repo_read_object;
1125
1126/// In-process repository reads: one pack, its index lookup and delta resolution.
1127#[cfg(unix)]
1128pub mod repo_read_pack;
1129
1130/// In-process repository reads: the object database of a repository, its packs and alternates.
1131#[cfg(unix)]
1132pub mod repo_read_odb;
1133
1134/// In-process repository reads: trees, flattened trees and commit fields.
1135#[cfg(unix)]
1136pub mod repo_read_tree;
1137
1138/// In-process repository reads: the entries of an index file, versions 2 to 4.
1139pub mod repo_read_index;
1140
1141/// In-process repository reads: the difference between two sorted entry lists and the output spellings.
1142#[cfg(unix)]
1143pub mod repo_read_diff;
1144
1145/// In-process repository reads: the files ref storage, one ref by name, a symbolic chain and the list of all refs.
1146#[cfg(unix)]
1147pub mod repo_read_refs;
1148
1149/// In-process repository reads: the merged configuration listing with includes and environment entries.
1150pub mod repo_read_config_list;
1151
1152/// In-process repository reads: answers to the exact read-only command lines the wrapper issues.
1153#[cfg(unix)]
1154pub mod repo_read_query;
1155
1156/// In-process repository reads: answers for the reference and configuration command lines.
1157#[cfg(unix)]
1158pub mod repo_read_query_refs;
1159
1160/// In-process repository reads: the two runner entry points that try the answers before starting Git.
1161pub mod repo_read_hook;
1162
1163/// The standards-review shadow run: JavaScript text behaviors the log depends on (UTF-16 lengths, number text).
1164pub mod standards_review_text;
1165
1166/// The standards-review shadow run: a file's changed old-side ranges read from the patch.
1167pub mod standards_review_patch;
1168
1169/// The standards-review shadow run: which commits get an entry, and the capped model input.
1170pub mod standards_review_input;
1171
1172/// The standards-review shadow run: the Decisions API request body and the answer reading.
1173pub mod standards_review_request;
1174
1175/// The standards-review shadow run: log entry rendering and appending.
1176pub mod standards_review_entry;
1177
1178/// The standards-review shadow run: the in-process HTTPS call to the decisions gateway, with a total deadline.
1179pub mod standards_review_client;
1180
1181/// The standards-review shadow run: the two real-Git reads (patch and file texts) of a landed commit.
1182pub mod standards_review_source;
1183
1184/// The standards-review shadow run, end to end, and its bounded runner. Nothing calls it yet.
1185pub mod standards_review_run;
1186
1187/// A loopback HTTP server for the standards-review tests; never in the release build.
1188#[cfg(test)]
1189mod standards_review_mock;
1190
1191/// The durable work-item record for asynchronous work (review, push, maintenance) left for a resident consumer.
1192pub mod work_item;
1193
1194/// Messages between the wrapper and the resident commit service.
1195pub mod service_protocol;
1196
1197/// What the user is told when the commit service cannot land a commit.
1198pub mod service_messages;
1199
1200/// The commit service's journal and its restart decisions.
1201pub mod service_journal;
1202
1203/// Test-only fault points of the commit service.
1204pub mod service_fault;
1205
1206/// The commit service's serialized step.
1207pub mod service_land;
1208
1209/// The commit service's loop.
1210pub mod service_server;
1211
1212/// The wrapper's side of a commit through the commit service.
1213pub mod service_client;
1214
1215/// Which commit command lines the commit service covers, and the message they stand for.
1216pub mod service_commit_args;
1217
1218/// The commit command's path through the commit service.
1219pub mod service_commit;
1220
1221/// Which way a commit goes: through the service, set up first, or the earlier path.
1222pub mod service_route;
1223
1224/// The wrapper's own provisioning of the commit service's socket activation.
1225pub mod service_provision;
1226
1227/// A minimal D-Bus client for the user session bus, for the provisioning's two calls.
1228pub mod systemd_dbus;
1229
1230/// The message and identities of a service commit, made as native `git commit` makes them.
1231pub mod service_message;
1232
1233/// The service's consumer of after-commit push and upkeep work.
1234pub mod service_work;
1235
1236/// The wrapper's side of after-commit work: records, wake and notices.
1237pub mod service_handoff;
1238
1239/// The mechanical ban: no release code starts the wrapper, passes it management words or writes shell text.
1240#[cfg(test)]
1241#[path = "no_self_invocation_tests.rs"]
1242mod no_self_invocation_tests;
1243
1244/// The structural check that the review's network client is reachable only from the service run; never in the release build.
1245#[cfg(test)]
1246mod standards_review_boundary_tests;
1247
1248/// The standards-review shadow run: appending an entry to the shared log without a lock, once per commit, with repair.
1249pub mod standards_review_append;
1250
1251/// The service's handler for a review work item, bounded by a call deadline and a total budget.
1252pub mod service_review;