Repository navigation
chore(python): import refract-py into clients/python and check it against this tree's CLI - #42
Merged
Merged
Conversation
… pandas integration
- feat: create AGENTS.md with build/test commands and conventions - ci: add GitHub Actions workflow (pytest on push) - test: expand from 3 to 21 tests (dataclasses, edge cases, _find_binary) - fix: _find_binary checks for npx/node before fallback - fix: _run catches FileNotFoundError with helpful install message - docs: add Integrations section to README (pandas, Jupyter, LangChain) - fix: event_type → eventType in README code example - chore: update opencode.json with skills and permissions
- feat: src/refract_eval.py — map events to eval records (build_leakage_benchmark, check_provenance, score_retrieval_quality, build_recency_benchmark)
…PyPI Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…nd demo animation - docs/assets/refract-py-pkg.png, captioned "refract-py package listing on PyPI", is a made-up PyPI page: `pip install refract-py`, v0.2.0, Python 3.11+, MIT and Apache-2.0 licences, "2.3k weekly downloads" and 42 stars. refract-py has never been on PyPI, and pyproject.toml says 0.1.0, Python >=3.10, AGPL-3.0. It contradicted the install line directly below it, which says the package is not on PyPI. - docs/assets/refract-py-cli.png showed an IPython session whose DataFrame had "event" values of edit/revert and an "editor" column of decimals; analyze() returns neither. - docs/assets/refract-py-demo.gif was a generated animation of a code snippet beside four boxes with row counts (13, 21, 29, 37) that no call produces. The image files are left in docs/assets; only the README embeds go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpGaiBuSk5nCSV2hKyD6PN
…-g3mj8p docs: remove the README's fabricated PyPI card, notebook screenshot and demo animation
to_networkx's docstring promised citation edges. It adds a "cites" edge for any fact detail containing "url=". No analyzer emits a citation URL as a fact (citation facts carry "type=added" and the like), so at brief and detailed depth the graph holds revision transitions only; at forensic depth the full_wikitext_before/after facts match, and each becomes a node holding a revision's whole wikitext. The docstring says so. compute_survival_records handles sentence events, not claim events; its docstring now says how spans are matched and censored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EpGaiBuSk5nCSV2hKyD6PN
…-g3mj8p docs: say what to_networkx and compute_survival_records build
pyproject.toml declares AGPL-3.0, but without a LICENSE file GitHub lists the repo as unlicensed, which reads as all rights reserved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore: add the AGPL-3.0 license file pyproject already declares
… CLI, and ship its two modules The previous commit imports refract-org/refract-py into clients/python with its history. This one makes it part of the repository. python.yml builds the CLI from the same commit, builds and installs the adapter's wheel on Python 3.10 (the floor pyproject declares) and 3.12, and runs pytest against that CLI; the imported workflow installed the CLI from npm. It runs on changes to the adapter, the CLI, the schema and docs/examples. tests/test_engine_contract.py parses the engine output in docs/examples keeping event and analyzer identity, and checks every flag analyze() and export() pass against the built CLI's help: a fake CLI without --flatten fails it. Building the wheel showed it held only src/refract: refract_eval and refract_langchain, which the docs import, were missing for anyone who installed it. The wheel now includes both, and imports from a fresh environment. The install target is pip install "git+https://github.com/refract-org/refract.git#subdirectory=clients/python", in the README, the docs site and the Colab notebook. The notebook page used RefractClient, RefractDocumentLoader, model_dump() and three exception classes the adapter does not have; it uses what the adapter exports. Co-Authored-By: Claude Opus 5.5 <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.
This is step 3 of
docs/repositories.md. It's stacked on #41, which is stacked on #40.Import
git subtree addbrings refract-org/refract-py'smainintoclients/pythonwith all 29 of its commits, the same way #37 imported the apps.git blameon the imported files leads back to their original commits. The package keeps its name (refract-py), itsrefractimport, Hatch, its AGPL-3.0 licence and its subprocess behaviour.Checks
python.yml:pyproject.tomldeclares) and 3.12 (what the old CI ran)It runs on changes to the adapter, the CLI, the schema and
docs/examples. The imported workflow installed the CLI from npm, so a flag change here was never tested against it.tests/test_engine_contract.py:docs/examples/and checks that event and analyzer identity survive: IDs, revision IDs, text, fact provenanceanalyze()andexport()pass against the built CLI's--helpA fake CLI whose help lacks
--flattenfails it withAssertionError: --flatten.A packaging bug the move exposed
The wheel contained only
src/refract.refract_eval.pyandrefract_langchain.py, which the docs import (from refract_langchain import RefractLoader,from refract_eval import …), were missing for anyone whopip installed it; they only worked from a checkout.only-includenow ships both. In a fresh environment the wheel imports all three.Install target
I tested this against this branch (
@chore/import-refract-py) in a fresh Python 3.12 environment, and it installsrefractandrefract_eval. The command is now in the README, the docs site, the Colab notebook and the adapter's README. The oldrefract-py.gitURL still installs its last version.The docs' notebook page used
RefractClient,RefractDocumentLoader, three exception classes andmodel_dump(), none of which the adapter has. It now usesRefract,RefractLoader,RefractErrorandas_frame=True.Verification
build,biome ci packages/,typecheck,check:boundaries,test(409 passed, including a layout test forclients/python),check:examplesandcheck:release --packall pass.apps/docs: lint, tests (103) and build pass.clients/python: 32 passed. One existing test was skipped because it needsnetworkx, which isn't installed here.🤖 Generated with Claude Code