Skip to content

Consume langbank instead of carrying src/profiles/ - #26

Open
zmaril wants to merge 1 commit into
mainfrom
langbank-consumer
Open

Consume langbank instead of carrying src/profiles/#26
zmaril wants to merge 1 commit into
mainfrom
langbank-consumer

Conversation

@zmaril

@zmaril zmaril commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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.

86 files changed, 189 insertions(+), 3,594 deletions(-)

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. 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/WorkspaceId — genuinely entl's — are minted by entl's own private string_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:

walk files gained lost changed
entl itself 135 18 0 1
langbank 2,140 3 0 0
treebank 406 140 0 0

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-commentscorrect (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 in entl-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.md records what it was and the git show that 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.rs still 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

@zmaril
zmaril force-pushed the langbank-consumer branch from d44f10a to fc2c73a Compare August 18, 2026 07:50

zmaril commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main, which had gained the anchoring/propbank design PRs since I branched — including one thing that was nearly lost:

LanguageRole::expects_parser_pack() was added to profiles/language.rs on main, and my deletion of that file would have dropped it. It survives as an extension trait in entl-tree-sitter, with the original reasoning carried verbatim — and that's arguably its right home rather than a compromise: whether a parser pack exists for a role is a fact about that crate's pack format, not langbank's judgement about languages. langbank's own rule is that data states facts and consumers apply policy; this is policy.

Post-rebase: 181 tests passing (main's new anchoring tests included), fmt/clippy clean, and the treebank walk diff re-run byte-identical.

The LANGBANK_READ_TOKEN secret note stands — CI here can't fetch the github.com private repo without it.

@zmaril
zmaril force-pushed the langbank-consumer branch from fc2c73a to 5f43926 Compare August 18, 2026 07:54

zmaril commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

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 LANGBANK_READ_TOKEN step is removed; the fetch is anonymous and worked in CI already. git-fetch-with-cli stays, as ordinary hygiene rather than a credential workaround.

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
@zmaril
zmaril force-pushed the langbank-consumer branch from 5f43926 to b5c02fb Compare August 18, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant