fix: stabilize the package — version, CI, connector discovery#13
Merged
Conversation
The package reported three different versions: __init__ said 0.6.0, the REST
app said 0.5.0, while the installed package was 0.7.3. A library that lies
about its own version to users and agents is a credibility hit.
Read it once, from importlib.metadata.version("model-ledger"), and drive the
REST app's version off the same value. Falls back to "0.0.0+unknown" only when
running from a source tree with no install.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The repo had no CI that ran the test suite, ruff, or mypy — a contributor
could merge red, and the configured 90% coverage gate never executed (nothing
ran --cov). The 3.10–3.13 support claim in the classifiers was untested.
- .github/workflows/ci.yml:
* quality job (3.12): ruff check, ruff format --check, mypy src/, and
pytest with the coverage gate.
* tests job: full suite on 3.10/3.11/3.13 (3.12 covered by quality).
* minimal permissions (contents: read), concurrency-cancel.
- pyproject: lower the never-enforced fail_under from 90 to an honest 70
(real coverage ~74%); ratchet upward as tests are added.
Verified locally: ruff/format/mypy clean, 714 passed / 11 skipped, 74.35%.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The creed is "the MCP server is the product," yet discover(source_type= "connector") raised NotImplementedError — an agent told to "scan my platforms" hit a hard wall. Now: - `rest` and `prefect` connectors are pure-config, so they run directly from connector_config through the discover tool. - `sql` and `github` need a live connection / parser callable that can't be expressed as JSON; discover returns an actionable message in DiscoverOutput.errors pointing to the SDK instead of raising. - Any connector failure (bad config, unknown name, missing connector_name) is returned in `errors` — the agent always gets a usable response, never a crash. Refactors the add/connect/summarize flow into a shared `_ingest` helper used by the inline, file, and connector paths. Updates the agent guide to match. Tests: 6 new connector tests (graceful errors + a config-driven ingest path). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three credibility fixes for the public package — so it does what it says, and a contributor can't merge red. (Stacks on the docs site in #12; no public-API behavior changes beyond the connector tool below.)
1. Single-source the version (
fix)The package reported three different versions —
__init__said0.6.0, the REST app said0.5.0, the installed package was0.7.3. A library that lies about its own version to users and agents is a credibility hit. Now read once fromimportlib.metadata, and the REST app uses the same value.2. Real CI on
src/(ci)There was no CI running the test suite,
ruff, ormypy, and the configured 90% coverage gate never executed (nothing ran--cov). The 3.10–3.13 support claim was untested. Adds.github/workflows/ci.yml:ruff check,ruff format --check,mypy src/, andpytestwith the coverage gate.fail_underfrom 90 to an honest 70 (real ~74%) — ratchet upward as tests are added.3. Connector discovery from the agent (
feat)discover(source_type="connector")used to raiseNotImplementedError— an agent told to "scan my platforms" hit a hard wall, despite connectors being the headline discovery story.restandprefectare pure-config, so they now run directly fromconnector_config.sqlandgithubneed a live connection / parser callable that can't be JSON —discoverreturns an actionable message inerrorspointing to the SDK.errorsrather than raising — the agent always gets a usable response._ingesthelper.Verification
ruff+format+mypyclean · 719 passed / 11 skipped · coverage 74.50%.🤖 Generated with Claude Code