Consume langbank instead of carrying src/profiles/ - #26
Conversation
d44f10a to
fc2c73a
Compare
|
Rebased onto current main, which had gained the anchoring/propbank design PRs since I branched — including one thing that was nearly lost:
Post-rebase: 181 tests passing (main's new anchoring tests included), fmt/clippy clean, and the treebank walk diff re-run byte-identical. The |
fc2c73a to
5f43926
Compare
|
Correction to the PR body's warning: no secret is needed. langbank is public — I wrote the CI auth plumbing on the assumption it was still private, then noticed the first CI run passed without any token. The |
The four-repo decomposition named this boundary at design time: langbank
owns "what is this language", entl owns "what is in this codebase".
src/profiles/ was the part of entl on the wrong side of it — the module
langbank was lifted from — and every day both existed was a day their
answers could drift apart.
**Nothing is re-exported.** Code that needs a LanguageProfile, an
EcosystemProfile or a detection takes it from langbank directly:
entl-codebase, entl-github and entl-tree-sitter each carry the
dependency and name the types where they use them. entl's public surface
is what entl owns — walking, inventory, manifests, packages, workspaces —
and langbank types appear in it only where a boundary type genuinely
crosses (FileEntry.language is a langbank::LanguageDetection, an
Artifact names a langbank::ArtifactId). A consumer that wants langbank's
vocabulary depends on langbank, not on entl's copy of its names.
PackageId and WorkspaceId — genuinely entl's — are minted by entl's own
private string_id! macro, as they were before this change. langbank
exports its macro for consumers, but entl does not need it: two newtypes
do not justify a structural dependency, and the convention they encode
(ordered, hashable, serialised as a bare string) matches by construction
either way. Recorded inventories read back exactly as written.
## Behaviour change, measured
Walked three repositories before and after, diffing every file's
detected language:
entl itself 135 common files: 18 gained, 0 lost, 1 changed
langbank 2,140 files: 3 gained, 0 lost, 0 changed
treebank 406 files: 140 gained, 0 lost, 0 changed
The gains are what absorption bought: Cargo.lock is toml, .scm queries
are scheme, treebank's 112 patch files are diff. The one changed answer
is tsconfig.json, json -> json-with-comments, which is correct — the
file is JSONC and linguist maps the filename — so the old answer was the
bug. entl grows from 8 languages to 827 and 5 ecosystems to 36.
## Carried across the rebase
main gained LanguageRole::expects_parser_pack() while this branch was
open, on the very file it deletes. It survives as an extension trait in
entl-tree-sitter with the original reasoning verbatim — and that is its
right home rather than a workaround: whether a parser pack exists for a
role is a fact about that crate's pack format, not langbank's judgement
about languages.
## Removed with the module
verbosity (1,334 lines) — langbank dropped it as unreproducible: its
generator and its method write-up were both already lost. Nothing
outside this crate consumed it; its seven tests go with it. langbank's
docs/verbosity.md records what it was and how to read it back from git.
## Tests
Two tests pinned the old world exactly — five ecosystems, three
conventions — and now assert the floor rather than the ceiling, so an
absorption in langbank does not become a red build here.
profile_registration.rs keeps proving a downstream crate can register
its own profiles, importing the registration types from langbank as a
real downstream would.
181 passing, clippy -D warnings, fmt clean. langbank is public, so the
git dependency fetches anonymously; no CI secret involved.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJZVnN8ShZktJ8VSSL3AjD
5f43926 to
b5c02fb
Compare
The four-repo decomposition named this boundary at design time: langbank owns "what is this language", entl owns "what is in this codebase."
src/profiles/was the part of entl on the wrong side of it — the module langbank was lifted from — and every day both existed was a day their answers could drift apart.Nothing is re-exported
Code that needs a
LanguageProfile, anEcosystemProfileor a detection takes it from langbank directly — entl-codebase, entl-github and entl-tree-sitter each carry the dependency and name the types where they use them. entl's public surface is what entl owns: walking, inventory, manifests, packages, workspaces. langbank types appear in it only where a boundary type genuinely crosses (FileEntry.languageis alangbank::LanguageDetection; anArtifactnames alangbank::ArtifactId). A consumer that wants langbank's vocabulary depends on langbank, not on entl's copy of its names.PackageId/WorkspaceId— genuinely entl's — are minted by entl's own privatestring_id!, as before this change. langbank exports its macro for consumers, but two newtypes don't justify a structural dependency; the convention matches by construction either way. Recorded inventories read back exactly as written (transparent serde on both sides).Behaviour change, measured rather than assumed
Walked three repositories before and after, diffing every file's detected language:
Gains are what absorption bought:
Cargo.lockis toml,.scmqueries are scheme, treebank's 112 patch files are diff. The one changed answer istsconfig.json:json → json-with-comments— correct (it's JSONC; linguist maps the filename), so the old answer was the bug. entl grows 8 → 827 languages, 5 → 36 ecosystems.Carried across the rebase
main gained
LanguageRole::expects_parser_pack()while this branch was open — on the very file it deletes. It survives as an extension trait inentl-tree-sitter, original reasoning verbatim. That's its right home rather than a workaround: whether a parser pack exists for a role is a fact about that crate's pack format, not langbank's judgement about languages.Removed with the module
verbosity (1,334 lines) — langbank dropped it as unreproducible (generator and method write-up both already lost). Nothing outside this crate consumed it; its seven tests go too. langbank's
docs/verbosity.mdrecords what it was and thegit showthat reads it back.Tests
Two tests pinned the old world exactly — five ecosystems, three conventions — and now assert the floor rather than the ceiling, so an absorption in langbank doesn't turn into a red build here.
profile_registration.rsstill proves a downstream crate can register its own profiles, importing the registration types from langbank as a real downstream would.181 passing, clippy
-D warnings, fmt clean. langbank is public, so the git dependency fetches anonymously — no CI secret needed.🤖 Generated with Claude Code
https://claude.ai/code/session_01HJZVnN8ShZktJ8VSSL3AjD