Classify and resolve the merge-conflict classes this workspace produces repeatedly
| Tier | tools |
| Role | unclassified (baselined) |
| Path | crates/tools/merge-resolve |
| Edition | 2021 |
| Targets | tools-merge-resolve, tools_merge_resolve, cli_test |
| Public items | 6 across 0 modules |
| Tests | 16 |
What it is for
Classify and resolve the merge conflicts this workspace produces repeatedly.
Three conflict classes account for nearly every merge collision here, and each has one correct resolution that is a property of the file, not a judgment about the change:
- Generated blocks —
docs/AI_CONTEXT.md's crate index says "do not edit by
hand". Both sides are machine output from different commits, so picking a side is always wrong: the answer is to regenerate after the merge. Taking either side silently produces an index that describes neither parent.
- Append-only ledgers —
CHANGELOG.mdgrows at the top. Two branches each
adding entries is not a disagreement; both sets are true and the resolution is the union, ours first. Choosing one side deletes shipped history.
- Lockfiles —
Cargo.lockis derived from the manifests. Resolve by
regenerating, never by merging text.
Anything else is a real disagreement about content and this tool refuses it. Refusing loudly is the point: a resolver that guesses at genuine conflicts is worse than no resolver, because its output looks reviewed.
Capabilities
crate root
Classify and resolve the merge conflicts this workspace produces repeatedly.
| Item |
|---|
fn resolve_ledger(content : & str) -> Result <String, String> |
fn regeneration_command(path : & str) -> Option <& 'static str> |
Class
Classify and resolve the merge conflicts this workspace produces repeatedly.
| Item |
|---|
pub enum Class |
fn classify(path : & str, content : & str) -> Class |
Hunk
Classify and resolve the merge conflicts this workspace produces repeatedly.
| Item |
|---|
pub struct Hunk |
fn parse_hunks(content : & str) -> Result <Vec <Hunk>, String> |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
No public modules: the crate root is its whole surface.
Public surface
`crate root`
| Item | What it is |
|---|---|
pub enum Class | What kind of conflict a path holds, which determines the only correct resolution. |
fn classify(path : & str, content : & str) -> Class | Classify by path and content together |
pub struct Hunk | One parsed conflict hunk. |
fn parse_hunks(content : & str) -> Result <Vec <Hunk>, String> | Parse every conflict hunk |
fn resolve_ledger(content : & str) -> Result <String, String> | Resolve a ledger conflict by keeping both sides, ours first |
fn regeneration_command(path : & str) -> Option <& 'static str> | The command that rebuilds a generated file, if this tool knows one. |
No pub use re-exports: every item above is declared in this crate.
Boundary
Depends on no other workspace tier.
Shares tier tools with 84 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (84 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | tools |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/tools/merge-resolve |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime. None.
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tempfile | ^3 | — | no | always |
Build. None.
Depended on by. Nothing in this workspace.
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| bin | tools-merge-resolve | `src/main.rs` |
| lib | tools_merge_resolve | `src/lib.rs` |
| test | cli_test | `tests/cli_test.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 13 |
| Integration tests | 3 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 6 | 0 | 0 |
What the tests establish, by name:
lockfile_driver_fails_loud_when_cargo_cannot_resolve—tests/cli_test.rslockfile_driver_keeps_a_parent_and_regenerates—tests/cli_test.rswrong_arity_is_a_usage_error—tests/cli_test.rsa_changelog_is_a_ledger—src/lib.rsa_conflict_inside_a_generated_block_is_generated—src/lib.rsa_hand_edit_beside_a_generated_block_is_manual—src/lib.rsa_ledger_keeps_both_sides_ours_first—src/lib.rsa_ledger_with_many_hunks_loses_no_entry—src/lib.rsa_lockfile_is_regenerated_not_merged—src/lib.rsa_one_sided_ledger_hunk_does_not_gain_a_blank_line—src/lib.rsan_ordinary_source_conflict_is_manual—src/lib.rsclean_content_has_no_hunks—src/lib.rsgenerated_files_name_their_rebuild_command—src/lib.rshunks_parse_with_both_sides—src/lib.rsmalformed_markers_are_refused_not_guessed—src/lib.rsparse_accepts_exactly_the_git_driver_argv—src/main.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 6 | 6 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 6
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 2 |
| Source lines | 399 |
| Code lines | 287 |
| Public API items | 6 |
| Public modules | 0 |
| Tests | 16 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 0 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"enum" : 1
"function" : 4
"struct" : 1
pie showData
title Rust source composition
"Code" : 287
"Blank or comment" : 112
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.