Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EarPatch

EarPatch turns a Git patch into a linear, explicit narrative for screen-reader review. It replaces visual-only diff cues with words such as “added,” “removed,” and “changed from … to …”.

It runs locally. It has no runtime dependencies, model calls, API keys, telemetry, or network requests.

Quick start

EarPatch requires Python 3.10 or newer.

python -m pip install .
earpatch --trust-repository

Git mode reads unstaged changes from the current repository. Because Git can run helpers configured by a repository, this mode requires an explicit trust acknowledgement. Patch-file and standard-input modes do not load repository configuration:

earpatch changes.patch
git show --format= | earpatch -
earpatch --trust-repository
earpatch --trust-repository --staged
earpatch --trust-repository --revision HEAD~1

The default text output is designed for linear navigation:

Patch: 1 file. 2 additions and 1 deletion.

File 1 of 1: src/greeting.py. Modified. 2 additions and 1 deletion.
Change 1 of 1.
Changed from old line 4: return "Hello " + name
To new line 4: if not name:
New line 5:     return "Hello"

Output formats

Text is the default. Use --verbosity summary, changes, or full to control how much is spoken.

earpatch changes.patch --format text --verbosity changes
earpatch changes.patch --format html --output review.html
earpatch changes.patch --format json --output patch.json
  • Text gives a patch summary, numbered files, numbered change blocks, and old or new line numbers.
  • HTML gives a self-contained document with a skip link, semantic heading hierarchy, visible keyboard focus, explicit labels, and escaped patch text.
  • JSON exposes the same parsed model under the earpatch.patch.v1 schema. The bundled JSON Schema can validate integrations without running EarPatch.

What it handles

  • Modified, added, deleted, and renamed files.
  • Text and binary file records.
  • Multiple hunks and omitted one-line hunk counts.
  • “No newline at end of file” markers.
  • Patch files, standard input, staged changes, working-tree changes, and Git revisions or ranges.

Safety and privacy

EarPatch never uploads source code. It resolves Git only from absolute PATH directories outside the current repository, then runs it without a shell, pager, color, external diff helper, or text-conversion driver. HTML output escapes file paths and code before rendering, and the document carries a restrictive content security policy.

Inputs are limited to 10 MB by default, and Git is limited to 30 seconds. Both limits are configurable with --max-bytes and --git-timeout. Control and bidirectional-formatting characters are printed as visible Unicode labels so a patch cannot send terminal escapes or silently reverse displayed text.

--output refuses to replace an existing path. Add --force only when you intend an atomic replacement; a symbolic link is replaced rather than followed.

EarPatch describes what the patch contains. It does not claim that a change is correct, secure, or intended.

Why this project exists

Current accessibility guidance makes Git usable with a screen reader, but unified patches still expose important meaning through punctuation, color, and layout. AI developer tools have also introduced new diff and streaming surfaces with reported accessibility barriers.

The evidence, landscape search, product hypothesis, and limits are recorded in docs/RESEARCH.md. The MVP contract is in docs/SPEC.md.

Development

python -m pytest
python -m compileall -q src

The test suite covers parsing, line-number tracking, HTML escaping, output contracts, standard input, and an end-to-end local Git repository.

Accessibility feedback

This is an engineering MVP, not a claim of conformance based on user research. Feedback from blind and low-vision developers is the most valuable next input. Please include your screen reader, terminal or browser, the command used, and the point where the reading order or wording became difficult.

Contributing

See CONTRIBUTING.md. Security and privacy reports are covered by SECURITY.md.

EarPatch is available under the MIT License.

About

Screen-reader-first narration for Git and unified diffs

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages