EVEMISSTechnology

Repository guide · architecture · v2

psf / black · Architecture

Static view of the repository: 482 files dominated by tests (326), src (48), docs (48), and scripts (9); 18 entrypoints; all ten listed bounded paths start at action/main.py and stop at unresolved os.getenv, re.compile, or Path calls. Call degree concentrates in tests/util.py and src/black/linegen.py; 8,487 of 9,339 relations remain unresolved.

Original repository
psf/black
License
MIT · open-source license
Analyzed revision · last verified
20622e1259c29bda81831962ace1348ba1921c84 ·

Newer revision observed; the code this guide cites is unchanged. The default branch moved to 5fe7881e6e40, checked 2026-10-03. A revision diff of 48 changed files found no change in the code regions this guide cites. The guide still describes revision 20622e1259c2; repository-wide counts (files, calls and so on) refer to that revision.

psf/black: repository architecture from static analysis

Terms used on this page
Entrypoint record
A file the analyzer marks as a place where execution can start. When it carries a __main__ guard excerpt, the file contains an if __name__ == "__main__": block and the excerpt shows what that block calls; without an excerpt, the file was flagged by its name only.
Bounded static execution path
A call chain reconstructed from the source code without running it, stopped after a fixed number of steps. It shows how far the code can be followed on paper, not what happens at run time.
Unresolved boundary
Where a static path stops because the next call goes into an external library or cannot be resolved without running the code. It marks the edge of this analysis, not a defect in the repository.
Static relations
Calls and imports found in the source. "External or unresolved" relations point outside the analyzed files.
Module role
The analyzer's label for a file, inferred from how many calls go in and out (for example core, entry/orchestration, leaf). It describes a position in the call graph, not the authors' design.
Test-like files
Files whose names or locations look like tests. This analysis counts them; it does not run them.
Observed · inferred · author-claimed · unresolved
How each statement is supported: read directly from the analyzed files; derived by the analyzer from them; stated by the repository's authors (metadata, README); or not established by this analysis.
Verified
Two uses on these pages. In an analyzer record ("verified provenance", "a verified entrypoint") it means the record was read directly from the analyzed files, which these guides call observed; for an entrypoint, the __main__ guard text is present. Since the analyzer fix of 2026-10-04, a file that only has an entrypoint-like name such as cli.py or main.py is recorded as inferred; guides analyzed before that still call such a file verified, and it is still only a guess about how the file is used. It does not mean the code was run or tested. "Last verified" is the date the guide last passed the lab's checks against the analysis record of the stated revision; it is not a review of the repository itself.

Shape at a glance

The analyzed inventory holds 482 files, concentrated in tests (326 files), src (48), docs (48), .github (22), and scripts (9), with 19 files at the root. Four subsystem records describe docs, scripts, src, and tests as top-level directories likely representing subsystems. Paths in entrypoint and role records show src/ containing the packages black (including __init__.py, linegen.py, trans.py, comments.py, nodes.py), blackd, and blib2to3 (pytree.py) with a pgen2 subpackage (driver.py). Role and entrypoint records also show test code such as tests/test_black.py and tests/util.py, plus case files under tests/data/cases/. Entrypoint excerpts show two doc-check scripts opening CHANGES.md and markdown under docs/integrations/ and docs/usage_and_configuration/.

Entrypoints and control flow

The reconstruction counts 18 entrypoints and 176 bounded execution paths. Seventeen entrypoint records report a Python __main__ guard (if __name__ == "__main__":): eight in scripts/, five in src/ (black, blackd, and three blib2to3.pgen2 modules), and four in tests/ (tests/test_tokenize.py plus tests/data/cases/ files). An eighteenth record flags action/main.py as a likely executable by filename heuristic, and a teaching claim calls it a detected starting point. All ten listed bounded paths begin at action/main.py and end after one step at os.getenv (seven paths), re.compile (two), or Path (one), each with terminal reason 'unresolved_boundary', no detected cycle, and no truncation. None of the listed paths reaches the src/ tree. The repository summary separately names scripts/check_pre_commit_rev_in_example.py as the apparent main starting place.

Core modules and assigned roles

Each role record lists its evidence basis as static resolved call degree and entrypoint membership, so these roles are inferred from call counts, not observed at runtime. Role records report tests/util.py at 118 incoming calls and tests/test_black.py at 104 incoming and 177 outgoing. In src/, they report src/black/linegen.py at 79 incoming and 79 outgoing calls and src/black/trans.py at 66 each. The analyzer labels linegen.py, trans.py, comments.py, nodes.py, and tests/test_black.py 'service/core candidate', while src/black/__init__.py, src/blackd/__init__.py, tests/test_tokenize.py, and scripts/diff_shades_gha_helper.py are 'entry/orchestration candidate'. In blib2to3, role records show src/blib2to3/pytree.py at 13 incoming calls and src/blib2to3/pgen2/driver.py at 10 incoming and 13 outgoing.

Where static paths stop

Every listed bounded path stops inside action/main.py, at os.getenv, re.compile, or Path calls labeled external_or_unresolved. Relation counts give 8,487 external_or_unresolved relations against 852 local ones out of 9,339 total. The analyzer does not resolve dynamic dispatch, dynamic imports, reflection, monkey-patching, generated code, or framework runtime wiring, which caps what any static path can show. One-file top-level directories named plugin and autoload appear in the inventory; none of the ten listed bounded paths links to them (all ten stay within action/main.py per the execution-path records), and the packet establishes no loading mechanism for them.

Dependencies between parts

By type, the packet records 8,219 call relations and 1,120 imports among 9,339 static relations. The reconstruction separately reports 813 resolved static call relations across the 482 analyzed files. On manifest dependencies: dependency records in this analysis come only from requirements-style manifests, and pyproject.toml dependency tables are not parsed. Where internal calls concentrate, role records point to tests/util.py (118 incoming) and tests/test_black.py (177 outgoing, 104 incoming). Beyond these per-module degrees, specific cross-module dependency edges are not individually citable from this packet.

What static analysis cannot show

This asset rests on static analysis, which the analyzer documents as unable to resolve reflection, runtime dependency injection, dynamic imports, monkey-patching, generated code, framework runtime wiring, and dynamic dispatch. Install, run, and build inference is partial, and installation commands are not verified. README claim extraction is line-based and may capture code lines instead of prose, so README-derived statements are author_claimed at best. The manifest's capability fields describe the analyzer, not this repository, and are excluded from repository evidence. Finally, the inventory counts 326 test-like files, but how those suites behave when executed is not established here.

Suggested reading order

Start with README.md, pyproject.toml, and LICENSE, which the analyzer classifies as project-level important files. Then open action/main.py: the modify guide recommends beginning at that detected entrypoint and verifying downstream effects manually. For the core, read src/black/__init__.py, whose __main__ guard calls patched_main and whose role record is 'entry/orchestration candidate'. Continue with src/black/linegen.py and src/black/trans.py, the highest-degree src/ role records cited here, and use tests/test_black.py for behavior examples. Treat the 8,487 unresolved relations and the unresolved dynamic mechanisms as the edge of this map.

What this analysis could not establish

The writing model's own notes on the analysis record. Identifiers such as lim_3, exec_* or claim_… name records of that analysis; the claims table cites the same records.

  • architecture_reconstruction reports 176 bounded execution paths, but execution_paths_static lists only ten; this asset describes the ten listed paths.
  • architecture_reconstruction reports 813 resolved static call relations while relation_counts reports 852 local relations; the packet does not explain the difference.
  • dependencies_partial is empty: the packet contains no dep_* records, so no manifest-level dependency edges could be cited.
  • resolved_relation_summary_sample shows within-file call chains (for example inside action/main.py and scripts/diff_shades_gha_helper.py), but its entries carry no citable IDs, so the asset does not assert them.
  • boundaries_static and core_flow_static carry no citable IDs; boundary statements here are grounded through the exec_* records, relation_counts, and lim_* notes instead.
  • important_2 (readme.md) was excluded by the analyzer as a case-variant path not in the inventory; README.md (important_1) is the record used here.
  • Teaching claim claim_4d30ade3e21e states that no bounded static execution path is available, which contradicts the ten exec_* records in the same packet; the asset follows the exec_* records.
Claims and evidence — 35 claims, 35 supported by an independent verifier

Every substantive statement above is a claim bound to grounding IDs of the analyzed revision. Global grounding IDs are namespaced by the analysis run.

Claim Epistemic status Verifier Grounding (global IDs)
c1 The analyzed inventory holds 482 files; top-level directories include tests (326 files), src (48), docs (48), .github (22), scripts (9), and 19 files at the root. inferred supported analysis_f07f1c5b3429400e:summary_repository, analysis_f07f1c5b3429400e:claim_227144a415af
c2 Subsystem records describe docs, scripts, src, and tests as top-level directories likely representing subsystems. inferred supported analysis_f07f1c5b3429400e:subsys_1, analysis_f07f1c5b3429400e:subsys_2, analysis_f07f1c5b3429400e:subsys_3, analysis_f07f1c5b3429400e:subsys_4
c3 Paths in entrypoint and role records show src/ containing the packages black (with __init__.py, linegen.py, trans.py, comments.py, nodes.py), blackd, and blib2to3 (pytree.py) with a pgen2 subpackage (driver.py). inferred supported analysis_f07f1c5b3429400e:py_entry_fce0ce2b9b79, analysis_f07f1c5b3429400e:py_entry_479e85cc920d, analysis_f07f1c5b3429400e:py_entry_fae1962d2b1e, analysis_f07f1c5b3429400e:role_19, analysis_f07f1c5b3429400e:role_27, analysis_f07f1c5b3429400e:role_14, analysis_f07f1c5b3429400e:role_21, analysis_f07f1c5b3429400e:role_36
c4 Role and entrypoint records show test code including tests/test_black.py and tests/util.py, plus case files under tests/data/cases/. inferred supported analysis_f07f1c5b3429400e:role_48, analysis_f07f1c5b3429400e:role_56, analysis_f07f1c5b3429400e:py_entry_b93757a7ff5d
c5 Entrypoint excerpts show two doc-check scripts opening CHANGES.md and markdown files under docs/integrations/ and docs/usage_and_configuration/. observed supported analysis_f07f1c5b3429400e:py_entry_6375211a42e2, analysis_f07f1c5b3429400e:py_entry_49b6285f03c4
c6 The reconstruction overview counts 18 entrypoints and 176 bounded execution paths. inferred supported analysis_f07f1c5b3429400e:architecture_reconstruction
c7 Seventeen entrypoint records report a Python __main__ execution guard: eight in scripts/, five in src/ (black, blackd, and three blib2to3.pgen2 modules), and four in tests/ (tests/test_tokenize.py plus tests/data/cases/ files). observed supported analysis_f07f1c5b3429400e:py_entry_6375211a42e2, analysis_f07f1c5b3429400e:py_entry_49b6285f03c4, analysis_f07f1c5b3429400e:py_entry_a7be1b170db3, analysis_f07f1c5b3429400e:py_entry_45e63aec2981, analysis_f07f1c5b3429400e:py_entry_2d43f7cb959d, analysis_f07f1c5b3429400e:py_entry_078791731a33, analysis_f07f1c5b3429400e:py_entry_8be0649f8947, analysis_f07f1c5b3429400e:py_entry_f86a7886b9b8, analysis_f07f1c5b3429400e:py_entry_0ad4d7a9c321, analysis_f07f1c5b3429400e:py_entry_b93757a7ff5d, analysis_f07f1c5b3429400e:py_entry_ae3dafb0586c, analysis_f07f1c5b3429400e:py_entry_7a35d8e2430b, analysis_f07f1c5b3429400e:py_entry_fce0ce2b9b79, analysis_f07f1c5b3429400e:py_entry_479e85cc920d, analysis_f07f1c5b3429400e:py_entry_fae1962d2b1e, analysis_f07f1c5b3429400e:py_entry_2525738168fe, analysis_f07f1c5b3429400e:py_entry_bde361c6e00a
c8 An eighteenth entrypoint record flags action/main.py as a likely executable by filename heuristic, and a teaching claim calls it a detected starting point. inferred supported analysis_f07f1c5b3429400e:entry_1, analysis_f07f1c5b3429400e:claim_227144a415af
c9 All ten listed bounded execution paths begin at action/main.py and end after a single step at os.getenv (seven paths), re.compile (two), or Path (one), each with terminal_reason 'unresolved_boundary', cycle_detected false, and truncated false. inferred supported analysis_f07f1c5b3429400e:exec_bfd58df29904, analysis_f07f1c5b3429400e:exec_5daffbde25d6, analysis_f07f1c5b3429400e:exec_12046e1e9958, analysis_f07f1c5b3429400e:exec_dbb7510ec43e, analysis_f07f1c5b3429400e:exec_73307b610151, analysis_f07f1c5b3429400e:exec_c1026a562fe1, analysis_f07f1c5b3429400e:exec_9af0be24b41d, analysis_f07f1c5b3429400e:exec_05bf42edaef6, analysis_f07f1c5b3429400e:exec_5929f5433b53, analysis_f07f1c5b3429400e:exec_6997ef4ff3a1
c10 Scanning all ten listed paths, none reaches the src/ tree; each stops within action/main.py's first external calls. inferred supported analysis_f07f1c5b3429400e:exec_bfd58df29904, analysis_f07f1c5b3429400e:exec_5daffbde25d6, analysis_f07f1c5b3429400e:exec_12046e1e9958, analysis_f07f1c5b3429400e:exec_dbb7510ec43e, analysis_f07f1c5b3429400e:exec_73307b610151, analysis_f07f1c5b3429400e:exec_c1026a562fe1, analysis_f07f1c5b3429400e:exec_9af0be24b41d, analysis_f07f1c5b3429400e:exec_05bf42edaef6, analysis_f07f1c5b3429400e:exec_5929f5433b53, analysis_f07f1c5b3429400e:exec_6997ef4ff3a1
c11 The analyzer's repository summary describes scripts/check_pre_commit_rev_in_example.py as the apparent main starting place. inferred supported analysis_f07f1c5b3429400e:summary_repository
c12 All twenty role records list their evidence basis as 'static resolved call degree and entrypoint membership'; the roles are therefore inferred from call counts, not from runtime observation. inferred supported analysis_f07f1c5b3429400e:role_48, analysis_f07f1c5b3429400e:role_19, analysis_f07f1c5b3429400e:role_56, analysis_f07f1c5b3429400e:role_27, analysis_f07f1c5b3429400e:role_55, analysis_f07f1c5b3429400e:role_11, analysis_f07f1c5b3429400e:role_14, analysis_f07f1c5b3429400e:role_21, analysis_f07f1c5b3429400e:role_25, analysis_f07f1c5b3429400e:role_17, analysis_f07f1c5b3429400e:role_42, analysis_f07f1c5b3429400e:role_18, analysis_f07f1c5b3429400e:role_26, analysis_f07f1c5b3429400e:role_28, analysis_f07f1c5b3429400e:role_24, analysis_f07f1c5b3429400e:role_36, analysis_f07f1c5b3429400e:role_29, analysis_f07f1c5b3429400e:role_5, analysis_f07f1c5b3429400e:role_20, analysis_f07f1c5b3429400e:role_23
c13 Role records report tests/util.py at 118 incoming calls and tests/test_black.py at 104 incoming and 177 outgoing calls. inferred supported analysis_f07f1c5b3429400e:role_56, analysis_f07f1c5b3429400e:role_48
c14 Role records report src/black/linegen.py at 79 incoming and 79 outgoing calls and src/black/trans.py at 66 each. inferred supported analysis_f07f1c5b3429400e:role_19, analysis_f07f1c5b3429400e:role_27
c15 The analyzer labels src/black/linegen.py, src/black/trans.py, src/black/comments.py, src/black/nodes.py, and tests/test_black.py 'service/core candidate', and src/black/__init__.py, src/blackd/__init__.py, tests/test_tokenize.py, and scripts/diff_shades_gha_helper.py 'entry/orchestration candidate'. inferred supported analysis_f07f1c5b3429400e:role_19, analysis_f07f1c5b3429400e:role_27, analysis_f07f1c5b3429400e:role_14, analysis_f07f1c5b3429400e:role_21, analysis_f07f1c5b3429400e:role_48, analysis_f07f1c5b3429400e:role_11, analysis_f07f1c5b3429400e:role_28, analysis_f07f1c5b3429400e:role_55, analysis_f07f1c5b3429400e:role_5
c16 In blib2to3, role records show src/blib2to3/pytree.py at 13 incoming calls and src/blib2to3/pgen2/driver.py at 10 incoming and 13 outgoing. inferred supported analysis_f07f1c5b3429400e:role_36, analysis_f07f1c5b3429400e:role_29
c17 Each of the ten listed bounded paths terminates inside action/main.py at a call labeled external_or_unresolved — os.getenv, re.compile, or Path — with terminal_reason 'unresolved_boundary'. inferred supported analysis_f07f1c5b3429400e:exec_bfd58df29904, analysis_f07f1c5b3429400e:exec_5daffbde25d6, analysis_f07f1c5b3429400e:exec_12046e1e9958, analysis_f07f1c5b3429400e:exec_dbb7510ec43e, analysis_f07f1c5b3429400e:exec_73307b610151, analysis_f07f1c5b3429400e:exec_c1026a562fe1, analysis_f07f1c5b3429400e:exec_9af0be24b41d, analysis_f07f1c5b3429400e:exec_05bf42edaef6, analysis_f07f1c5b3429400e:exec_5929f5433b53, analysis_f07f1c5b3429400e:exec_6997ef4ff3a1
c18 Of the 9,339 recorded static relations, 8,487 are external_or_unresolved and 852 are local. observed supported analysis_f07f1c5b3429400e:relation_counts
c19 The analyzer documents that reflection, runtime dependency injection, dynamic imports, monkey-patching, generated code, framework runtime wiring, and dynamic dispatch are not resolved, bounding what static paths can show. observed supported analysis_f07f1c5b3429400e:lim_1
c20 The one-file plugin and autoload directories appear in the inventory but are not linked to any listed path: all ten listed bounded paths stay within action/main.py per the exec_* records. How those directories are loaded is not established by this packet. inferred supported analysis_f07f1c5b3429400e:summary_repository, analysis_f07f1c5b3429400e:lim_1, analysis_f07f1c5b3429400e:exec_bfd58df29904, analysis_f07f1c5b3429400e:exec_5daffbde25d6, analysis_f07f1c5b3429400e:exec_12046e1e9958, analysis_f07f1c5b3429400e:exec_dbb7510ec43e, analysis_f07f1c5b3429400e:exec_73307b610151, analysis_f07f1c5b3429400e:exec_c1026a562fe1, analysis_f07f1c5b3429400e:exec_9af0be24b41d, analysis_f07f1c5b3429400e:exec_05bf42edaef6, analysis_f07f1c5b3429400e:exec_5929f5433b53, analysis_f07f1c5b3429400e:exec_6997ef4ff3a1
c21 Among the 9,339 recorded static relations, 8,219 are calls and 1,120 are imports. observed supported analysis_f07f1c5b3429400e:relation_counts
c22 The reconstruction separately reports 813 resolved static call relations across the 482 analyzed files. inferred supported analysis_f07f1c5b3429400e:architecture_reconstruction
c23 Dependency records in this analysis come only from requirements-style manifests; pyproject.toml dependency tables are not parsed. observed supported analysis_f07f1c5b3429400e:lim_3
c24 Role degrees indicate where internal calls concentrate: tests/util.py draws 118 incoming calls, and tests/test_black.py makes 177 outgoing calls. inferred supported analysis_f07f1c5b3429400e:role_56, analysis_f07f1c5b3429400e:role_48
c25 Specific cross-module dependency edges are not individually citable from this packet: 8,487 relations remain external_or_unresolved, and no dep_* dependency records are included. unresolved supported analysis_f07f1c5b3429400e:relation_counts
c26 This asset rests on static analysis that does not resolve reflection, runtime dependency injection, dynamic imports, monkey-patching, generated code, framework runtime wiring, or dynamic dispatch. observed supported analysis_f07f1c5b3429400e:lim_1
c27 Install, run, and build inference is partial, and installation commands are not verified by this analysis. observed supported analysis_f07f1c5b3429400e:lim_2
c28 README claim extraction in this analyzer version is line-based and may capture code lines instead of prose, so README-derived statements are author_claimed at best. observed supported analysis_f07f1c5b3429400e:lim_4
c29 The manifest's project.actual_capabilities / non_capabilities fields describe the analyzer, not the analyzed repository, and are excluded from repository evidence. observed supported analysis_f07f1c5b3429400e:lim_5
c30 The inventory counts 326 test-like files, but how those suites behave when executed is not established by this packet's static records. unresolved supported analysis_f07f1c5b3429400e:summary_repository, analysis_f07f1c5b3429400e:claim_7c9925f9c8f4
c31 The analyzer classifies README.md, pyproject.toml, and LICENSE as project-level important files. observed supported analysis_f07f1c5b3429400e:important_1, analysis_f07f1c5b3429400e:important_3, analysis_f07f1c5b3429400e:important_4
c32 The packet's modify-guide claim recommends beginning analysis at the detected entrypoint action/main.py and verifying downstream effects manually. inferred supported analysis_f07f1c5b3429400e:claim_c3ece21fa115
c33 src/black/__init__.py carries a __main__ guard calling patched_main, and its role record is 'entry/orchestration candidate'. inferred supported analysis_f07f1c5b3429400e:py_entry_fce0ce2b9b79, analysis_f07f1c5b3429400e:role_11
c34 Among the src/ role records cited here, src/black/linegen.py (79 incoming calls) and src/black/trans.py (66) are the highest-degree; tests/test_black.py (104 incoming) offers behavior examples. inferred supported analysis_f07f1c5b3429400e:role_19, analysis_f07f1c5b3429400e:role_27, analysis_f07f1c5b3429400e:role_48
c35 With 8,487 of 9,339 relations unresolved and dynamic mechanisms unresolvable by this analysis, the described boundaries are the edge of this static map. inferred supported analysis_f07f1c5b3429400e:relation_counts, analysis_f07f1c5b3429400e:lim_1

Sources, rights and disclosure · attribution-license-templates/v0.1

Rights notice. Original repository hosted on GitHub. Repository source code, documentation, names, media, and related project materials remain subject to the rights of their respective authors, contributors, and other rights holders and to applicable repository license terms.

Platform notice. GitHub is the source hosting platform for the linked repository. GitHub and related marks are trademarks of GitHub, Inc. EVEMISS Technology is not affiliated with or endorsed by GitHub unless explicitly stated otherwise.

How this page is produced. This page was produced using revision-aware repository analysis and AI-assisted editorial tooling. Technical claims are tied to the analyzed repository revision and may be revalidated when the source repository changes.

AI-assisted analysis. Reviewed by EVEMISS Technology through human–AI collaborative review. · Report a rights concern · Back to the overview