refactor Trim the public interface

Delete Commit.head, Commit.recent, and Reference.tags, which had no callers. Stop exporting repository_layout, Reference.branches, and Entry.is_readme, which are internal. Group the discovery helpers that only the test suite uses under a "For tests" heading.

Commit
c251b01c39f2823b0d93733a0cc849732ddf60e2
Author
Claude Fable 5 (high reasoning) <claude-fable-5@agents.anthropic.invalid>
Author date
Committer
Claude Fable 5 (high reasoning) <claude-fable-5@agents.anthropic.invalid>
Committer date
Changed files
lib/resolvers.ml
index eb9119bb..a30ce6c6 100644..100644
@@ -365,10 +365,6 @@
365 365 let* hash = hash_of_hex id in
366 366 of_hash repository hash
367 367
368 Removed: let head repository =
369 Removed: let* hash = resolve_head_hash repository in
370 Removed: of_hash repository hash
371 Removed:
372 368 (* A filtered walk with a rare predicate would otherwise traverse the whole
373 369 history on every request. The cap bounds that work; callers learn through
374 370 the second component of the result that older matches may exist beyond
@@ -426,9 +422,6 @@
426 422 recent_matching_from ?max_examined repository
427 423 (Store.Hash.to_hex head_hash)
428 424 count predicate
429 Removed:
430 Removed: let recent repository count =
431 Removed: Lwt_result.map fst (recent_matching repository count (Fun.const true))
432 425 end
433 426
434 427 module Reference = struct
@@ -476,7 +469,6 @@
476 469 |> Lwt_result.return
477 470
478 471 let branches repository = refs_by_prefix repository branch_name
479 Removed: let tags repository = refs_by_prefix repository tag_name
480 472
481 473 let of_id repository id =
482 474 let* branches = branches repository in
lib/resolvers.mli
index 303a9ee1..a887a50a 100644..100644
@@ -20,17 +20,6 @@
20 20 type repository_layout = { worktree : string; git_dir : string }
21 21 type repository
22 22
23 Removed: val is_repository : string -> bool
24 Removed:
25 Removed: val repository_layout : string -> (repository_layout option, error) result
26 Removed: (** Locate a repository's worktree and git directory. [Ok None] means the path
27 Removed: is readable but is not a repository; [Error _] means it could not be
28 Removed: inspected. *)
29 Removed:
30 Removed: val repository_layout_or_none : string -> repository_layout option
31 Removed: (** {!val-repository_layout} with unreadable paths collapsed to [None], for
32 Removed: callers that cannot act on the difference. *)
33 Removed:
34 23 val repositories : Config.t -> (string list, error) result
35 24
36 25 type repo_info = { repo_name : string; description : string }
@@ -48,9 +37,7 @@
48 37 (** {1 Repository metadata} *)
49 38
50 39 val default_repo_description : string
51 Removed: val read_description_file : string -> string
52 40 val short_hash : string -> string
53 Removed: val fallback_branch_candidates : Config.t -> string list
54 41
55 42 (** {1 Commits} *)
56 43
@@ -67,7 +54,6 @@
67 54 }
68 55
69 56 val of_id : repository -> string -> (t, error) Lwt_result.t
70 Removed: val head : repository -> (t, error) Lwt_result.t
71 57 val recent_from : repository -> string -> int -> (t list, error) Lwt_result.t
72 58
73 59 val recent_matching :
@@ -81,8 +67,6 @@
81 67 so a rare predicate cannot traverse an entire large history per request.
82 68 The boolean is [true] when the walk stopped at that cap with history left
83 69 unexplored — older matches may then exist beyond the result. *)
84 Removed:
85 Removed: val recent : repository -> int -> (t list, error) Lwt_result.t
86 70 end
87 71
88 72 (** {1 References} *)
@@ -92,8 +76,6 @@
92 76
93 77 val branch_name : string -> string option
94 78 val tag_name : string -> string option
95 Removed: val branches : repository -> (t list, error) Lwt_result.t
96 Removed: val tags : repository -> (t list, error) Lwt_result.t
97 79 val of_id : repository -> string -> (t, error) Lwt_result.t
98 80 end
99 81
@@ -102,8 +84,6 @@
102 84 module Entry : sig
103 85 type perm = Dir | File | Exec | Link | Submodule
104 86 type t = { hash : string; name : string; perm : perm }
105 Removed:
106 Removed: val is_readme : t -> bool
107 87 end
108 88
109 89 module Tree : sig
@@ -153,3 +133,17 @@
153 133 val read_root_readme : Config.t -> Blob.t option
154 134 val scan_subdirectory : Config.t -> string -> (fs_node list, error) result
155 135 val read_subdir_readme : Config.t -> string -> Blob.t option
136 Added:
137 Added: (** {1 For tests}
138 Added:
139 Added: These helpers have no callers in the server. They are exported so the test
140 Added: suite can exercise repository discovery directly. *)
141 Added:
142 Added: val is_repository : string -> bool
143 Added:
144 Added: val repository_layout_or_none : string -> repository_layout option
145 Added: (** Locate a repository's worktree and git directory. Collapses both "not a
146 Added: repository" and "could not be inspected" to [None]. *)
147 Added:
148 Added: val read_description_file : string -> string
149 Added: val fallback_branch_candidates : Config.t -> string list