textloom-kg 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- textloom_kg-0.1.0/.dockerignore +10 -0
- textloom_kg-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +19 -0
- textloom_kg-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +13 -0
- textloom_kg-0.1.0/.github/dependabot.yml +18 -0
- textloom_kg-0.1.0/.github/pull_request_template.md +11 -0
- textloom_kg-0.1.0/.github/workflows/ci.yml +133 -0
- textloom_kg-0.1.0/.github/workflows/release-images.yml +84 -0
- textloom_kg-0.1.0/.github/workflows/release-pypi.yml +47 -0
- textloom_kg-0.1.0/.gitignore +18 -0
- textloom_kg-0.1.0/.python-version +1 -0
- textloom_kg-0.1.0/.trivyignore +2 -0
- textloom_kg-0.1.0/CHANGELOG.md +108 -0
- textloom_kg-0.1.0/CLAUDE.md +76 -0
- textloom_kg-0.1.0/CODE_OF_CONDUCT.md +7 -0
- textloom_kg-0.1.0/CONTRIBUTING.md +31 -0
- textloom_kg-0.1.0/GOVERNANCE.md +7 -0
- textloom_kg-0.1.0/LICENSE +202 -0
- textloom_kg-0.1.0/NOTICE +14 -0
- textloom_kg-0.1.0/PKG-INFO +612 -0
- textloom_kg-0.1.0/README.md +548 -0
- textloom_kg-0.1.0/REQUIREMENTS.md +549 -0
- textloom_kg-0.1.0/SECURITY.md +17 -0
- textloom_kg-0.1.0/THIRD_PARTY.md +126 -0
- textloom_kg-0.1.0/benchmarks/build_uk_silver.py +345 -0
- textloom_kg-0.1.0/benchmarks/check_regression.py +37 -0
- textloom_kg-0.1.0/benchmarks/fetch_redfm.py +85 -0
- textloom_kg-0.1.0/benchmarks/fetch_text2kgbench.py +65 -0
- textloom_kg-0.1.0/benchmarks/ontologies/redfm-wikidata.ttl +3568 -0
- textloom_kg-0.1.0/benchmarks/ontologies/uk-silver-manifest.json +2375 -0
- textloom_kg-0.1.0/deploy/Dockerfile +72 -0
- textloom_kg-0.1.0/deploy/compose/docker-compose.yml +147 -0
- textloom_kg-0.1.0/deploy/compose/forward.py +53 -0
- textloom_kg-0.1.0/deploy/compose/keycloak-realm.json +332 -0
- textloom_kg-0.1.0/deploy/compose/seaweedfs-s3.json +9 -0
- textloom_kg-0.1.0/deploy/compose/seed_s3.py +42 -0
- textloom_kg-0.1.0/deploy/compose/textloom.yaml +32 -0
- textloom_kg-0.1.0/deploy/gpu-torch.in +4 -0
- textloom_kg-0.1.0/deploy/gpu-torch.txt +529 -0
- textloom_kg-0.1.0/deploy/textloom.example.yaml +54 -0
- textloom_kg-0.1.0/docs/backlog/m0-deferred.md +21 -0
- textloom_kg-0.1.0/docs/backlog/m0-plan.md +35 -0
- textloom_kg-0.1.0/docs/backlog/m1-deferred.md +39 -0
- textloom_kg-0.1.0/docs/backlog/m1-plan.md +51 -0
- textloom_kg-0.1.0/docs/backlog/m2-deferred.md +22 -0
- textloom_kg-0.1.0/docs/backlog/m2-plan.md +60 -0
- textloom_kg-0.1.0/docs/backlog/m3-plan.md +96 -0
- textloom_kg-0.1.0/docs/benchmarks/README.md +96 -0
- textloom_kg-0.1.0/docs/benchmarks/results/0.0.1-ci.json +260 -0
- textloom_kg-0.1.0/docs/benchmarks/results/0.0.1-ci.md +47 -0
- textloom_kg-0.1.0/docs/benchmarks/results/0.1.0-redfm.json +352 -0
- textloom_kg-0.1.0/docs/benchmarks/results/0.1.0-redfm.md +37 -0
- textloom_kg-0.1.0/docs/benchmarks/results/0.1.0-text2kgbench.json +344 -0
- textloom_kg-0.1.0/docs/benchmarks/results/0.1.0-text2kgbench.md +132 -0
- textloom_kg-0.1.0/docs/benchmarks/results/0.1.0.md +119 -0
- textloom_kg-0.1.0/docs/benchmarks/results/2026-12-05-ci-adjudicator.md +69 -0
- textloom_kg-0.1.0/docs/benchmarks/results/2026-12-05-ci-format-loss.md +62 -0
- textloom_kg-0.1.0/docs/benchmarks/results/2026-12-05-ci-item2.md +143 -0
- textloom_kg-0.1.0/docs/benchmarks/results/2026-12-05-ci-multilingual.md +62 -0
- textloom_kg-0.1.0/docs/benchmarks/results/2026-12-05-ci-relations.md +109 -0
- textloom_kg-0.1.0/docs/benchmarks/results/ci-baseline.json +92 -0
- textloom_kg-0.1.0/docs/decisions/0000-template.md +17 -0
- textloom_kg-0.1.0/docs/decisions/0001-record-architecture-decisions.md +21 -0
- textloom_kg-0.1.0/docs/decisions/0002-separate-project-from-lakeloom.md +40 -0
- textloom_kg-0.1.0/docs/decisions/0003-model-and-data-licence-policy.md +46 -0
- textloom_kg-0.1.0/docs/decisions/0004-guided-workflow.md +46 -0
- textloom_kg-0.1.0/docs/decisions/0005-storage-layer-fsspec.md +28 -0
- textloom_kg-0.1.0/docs/decisions/0006-parsing-docling-native-pipeline.md +50 -0
- textloom_kg-0.1.0/docs/decisions/0007-m0-preview-is-lexical.md +30 -0
- textloom_kg-0.1.0/docs/decisions/0008-mcp-sdk-2.md +34 -0
- textloom_kg-0.1.0/docs/decisions/0009-project-name.md +29 -0
- textloom_kg-0.1.0/docs/decisions/0010-relation-model-gliner-relex.md +38 -0
- textloom_kg-0.1.0/docs/decisions/0011-portuguese-spacy-model.md +30 -0
- textloom_kg-0.1.0/docs/decisions/0012-text2kgbench-data-provenance.md +28 -0
- textloom_kg-0.1.0/docs/decisions/0013-m1-pipeline-and-benchmark-choices.md +62 -0
- textloom_kg-0.1.0/docs/decisions/0014-english-primary-language-packs.md +38 -0
- textloom_kg-0.1.0/docs/decisions/0015-model-providers-openrouter-and-jev.md +50 -0
- textloom_kg-0.1.0/docs/decisions/0016-candidates-and-lakeloom-submission.md +56 -0
- textloom_kg-0.1.0/docs/decisions/0017-language-pack-interface.md +55 -0
- textloom_kg-0.1.0/docs/decisions/0018-pipeline-preview-on-the-worker.md +38 -0
- textloom_kg-0.1.0/docs/decisions/0019-dev-stack-and-contract-tests.md +79 -0
- textloom_kg-0.1.0/docs/decisions/0020-cpu-only-pytorch-on-linux.md +31 -0
- textloom_kg-0.1.0/docs/decisions/0021-v1-benchmark-and-criterion-reading.md +37 -0
- textloom_kg-0.1.0/docs/decisions/0022-soft-domain-range-mode.md +41 -0
- textloom_kg-0.1.0/docs/decisions/0023-light-reference-resolution.md +43 -0
- textloom_kg-0.1.0/docs/decisions/0024-adjudicator-typed-pairs.md +45 -0
- textloom_kg-0.1.0/docs/decisions/0025-format-loss-test.md +42 -0
- textloom_kg-0.1.0/docs/decisions/0026-container-images.md +54 -0
- textloom_kg-0.1.0/docs/decisions/0027-documentation-in-the-readme.md +29 -0
- textloom_kg-0.1.0/docs/decisions/0028-multilingual-extraction.md +121 -0
- textloom_kg-0.1.0/docs/decisions/0029-results-without-lakeloom.md +87 -0
- textloom_kg-0.1.0/docs/decisions/0030-item-9-traces-candidate-quality.md +107 -0
- textloom_kg-0.1.0/docs/lakeloom-integration.md +119 -0
- textloom_kg-0.1.0/packs/textloom-lang-pt/README.md +24 -0
- textloom_kg-0.1.0/packs/textloom-lang-pt/pyproject.toml +17 -0
- textloom_kg-0.1.0/packs/textloom-lang-pt/src/textloom_lang_pt/__init__.py +53 -0
- textloom_kg-0.1.0/pyproject.toml +171 -0
- textloom_kg-0.1.0/scripts/build_redfm_ontology.py +181 -0
- textloom_kg-0.1.0/scripts/dev/compose_smoke.py +90 -0
- textloom_kg-0.1.0/scripts/dev/create_cigars_model.py +100 -0
- textloom_kg-0.1.0/scripts/dev/create_textloom_agent.py +125 -0
- textloom_kg-0.1.0/scripts/dev/exit_gate_m2.py +206 -0
- textloom_kg-0.1.0/scripts/make_cigars_slice.py +141 -0
- textloom_kg-0.1.0/scripts/make_fixture_docs.py +107 -0
- textloom_kg-0.1.0/src/textloom/__init__.py +8 -0
- textloom_kg-0.1.0/src/textloom/candidates/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/candidates/aggregate.py +138 -0
- textloom_kg-0.1.0/src/textloom/candidates/model.py +91 -0
- textloom_kg-0.1.0/src/textloom/cli.py +499 -0
- textloom_kg-0.1.0/src/textloom/config.py +276 -0
- textloom_kg-0.1.0/src/textloom/core/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/core/confirm.py +65 -0
- textloom_kg-0.1.0/src/textloom/core/corpora.py +215 -0
- textloom_kg-0.1.0/src/textloom/core/delivery.py +287 -0
- textloom_kg-0.1.0/src/textloom/core/jobs.py +780 -0
- textloom_kg-0.1.0/src/textloom/core/next_steps.py +1547 -0
- textloom_kg-0.1.0/src/textloom/core/preview.py +499 -0
- textloom_kg-0.1.0/src/textloom/core/profiles.py +101 -0
- textloom_kg-0.1.0/src/textloom/core/review.py +323 -0
- textloom_kg-0.1.0/src/textloom/core/services.py +51 -0
- textloom_kg-0.1.0/src/textloom/core/submission.py +190 -0
- textloom_kg-0.1.0/src/textloom/core/workspaces.py +268 -0
- textloom_kg-0.1.0/src/textloom/documents.py +68 -0
- textloom_kg-0.1.0/src/textloom/errors.py +96 -0
- textloom_kg-0.1.0/src/textloom/evaluation/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/evaluation/analysis.py +318 -0
- textloom_kg-0.1.0/src/textloom/evaluation/format_loss.py +425 -0
- textloom_kg-0.1.0/src/textloom/evaluation/funnel.py +129 -0
- textloom_kg-0.1.0/src/textloom/evaluation/harness.py +488 -0
- textloom_kg-0.1.0/src/textloom/evaluation/metrics.py +110 -0
- textloom_kg-0.1.0/src/textloom/evaluation/redfm.py +444 -0
- textloom_kg-0.1.0/src/textloom/evaluation/text2kgbench.py +184 -0
- textloom_kg-0.1.0/src/textloom/languages/__init__.py +103 -0
- textloom_kg-0.1.0/src/textloom/languages/base.py +182 -0
- textloom_kg-0.1.0/src/textloom/languages/english.py +156 -0
- textloom_kg-0.1.0/src/textloom/llm.py +367 -0
- textloom_kg-0.1.0/src/textloom/metrics.py +128 -0
- textloom_kg-0.1.0/src/textloom/models_registry.py +210 -0
- textloom_kg-0.1.0/src/textloom/ontology/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/ontology/compiler.py +514 -0
- textloom_kg-0.1.0/src/textloom/ontology/labels.py +49 -0
- textloom_kg-0.1.0/src/textloom/ontology/loaders.py +348 -0
- textloom_kg-0.1.0/src/textloom/ontology/profile.py +189 -0
- textloom_kg-0.1.0/src/textloom/outputs/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/outputs/candidates.py +90 -0
- textloom_kg-0.1.0/src/textloom/outputs/lakeloom_client.py +210 -0
- textloom_kg-0.1.0/src/textloom/outputs/patch.py +128 -0
- textloom_kg-0.1.0/src/textloom/outputs/rdf.py +129 -0
- textloom_kg-0.1.0/src/textloom/outputs/tables.py +90 -0
- textloom_kg-0.1.0/src/textloom/pipeline/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/pipeline/model.py +181 -0
- textloom_kg-0.1.0/src/textloom/pipeline/presets.py +139 -0
- textloom_kg-0.1.0/src/textloom/pipeline/runtime.py +302 -0
- textloom_kg-0.1.0/src/textloom/server/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/server/app.py +131 -0
- textloom_kg-0.1.0/src/textloom/server/auth.py +133 -0
- textloom_kg-0.1.0/src/textloom/server/prompts.py +262 -0
- textloom_kg-0.1.0/src/textloom/server/resources.py +86 -0
- textloom_kg-0.1.0/src/textloom/server/results.py +79 -0
- textloom_kg-0.1.0/src/textloom/server/tools_bench.py +135 -0
- textloom_kg-0.1.0/src/textloom/server/tools_core.py +529 -0
- textloom_kg-0.1.0/src/textloom/server/tools_guide.py +426 -0
- textloom_kg-0.1.0/src/textloom/server/tools_jobs.py +528 -0
- textloom_kg-0.1.0/src/textloom/server/tools_review.py +393 -0
- textloom_kg-0.1.0/src/textloom/stages/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/stages/adjudicator.py +226 -0
- textloom_kg-0.1.0/src/textloom/stages/candidates.py +494 -0
- textloom_kg-0.1.0/src/textloom/stages/gliner_words.py +84 -0
- textloom_kg-0.1.0/src/textloom/stages/language.py +108 -0
- textloom_kg-0.1.0/src/textloom/stages/linguistic.py +60 -0
- textloom_kg-0.1.0/src/textloom/stages/linking.py +190 -0
- textloom_kg-0.1.0/src/textloom/stages/mentions_gliner.py +145 -0
- textloom_kg-0.1.0/src/textloom/stages/mentions_lexical.py +127 -0
- textloom_kg-0.1.0/src/textloom/stages/mentions_ner.py +89 -0
- textloom_kg-0.1.0/src/textloom/stages/parse.py +242 -0
- textloom_kg-0.1.0/src/textloom/stages/parse_docling.py +215 -0
- textloom_kg-0.1.0/src/textloom/stages/parse_text.py +88 -0
- textloom_kg-0.1.0/src/textloom/stages/parse_worker.py +49 -0
- textloom_kg-0.1.0/src/textloom/stages/references.py +140 -0
- textloom_kg-0.1.0/src/textloom/stages/relations.py +471 -0
- textloom_kg-0.1.0/src/textloom/stages/validation.py +393 -0
- textloom_kg-0.1.0/src/textloom/stages/values.py +334 -0
- textloom_kg-0.1.0/src/textloom/state/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/state/db.py +77 -0
- textloom_kg-0.1.0/src/textloom/state/migrations/env.py +31 -0
- textloom_kg-0.1.0/src/textloom/state/migrations/script.py.mako +25 -0
- textloom_kg-0.1.0/src/textloom/state/migrations/versions/0001_m0_initial_schema.py +135 -0
- textloom_kg-0.1.0/src/textloom/state/migrations/versions/0002_m1_jobs_facts_benchmarks.py +159 -0
- textloom_kg-0.1.0/src/textloom/state/migrations/versions/0003_m2_candidates_marks_submissions.py +142 -0
- textloom_kg-0.1.0/src/textloom/state/migrations/versions/0004_m2_pipeline_previews.py +40 -0
- textloom_kg-0.1.0/src/textloom/state/migrations/versions/0005_m3_document_languages.py +26 -0
- textloom_kg-0.1.0/src/textloom/state/migrations/versions/0006_m3_fact_marks.py +40 -0
- textloom_kg-0.1.0/src/textloom/state/models.py +326 -0
- textloom_kg-0.1.0/src/textloom/storage/__init__.py +0 -0
- textloom_kg-0.1.0/src/textloom/storage/allowlist.py +105 -0
- textloom_kg-0.1.0/src/textloom/storage/buckets.py +116 -0
- textloom_kg-0.1.0/src/textloom/tracing.py +114 -0
- textloom_kg-0.1.0/src/textloom/untrusted.py +35 -0
- textloom_kg-0.1.0/tests/__init__.py +0 -0
- textloom_kg-0.1.0/tests/conftest.py +81 -0
- textloom_kg-0.1.0/tests/contract/__init__.py +0 -0
- textloom_kg-0.1.0/tests/contract/conftest.py +52 -0
- textloom_kg-0.1.0/tests/contract/test_lakeloom.py +94 -0
- textloom_kg-0.1.0/tests/contract/test_postgres_leases.py +82 -0
- textloom_kg-0.1.0/tests/contract/test_s3_and_server.py +132 -0
- textloom_kg-0.1.0/tests/fixtures/docs/01-vitolas.docx +0 -0
- textloom_kg-0.1.0/tests/fixtures/docs/01-vitolas.pdf +74 -0
- textloom_kg-0.1.0/tests/fixtures/docs/01-vitolas.txt +7 -0
- textloom_kg-0.1.0/tests/fixtures/docs/02-wrappers.docx +0 -0
- textloom_kg-0.1.0/tests/fixtures/docs/02-wrappers.pdf +93 -0
- textloom_kg-0.1.0/tests/fixtures/docs/02-wrappers.txt +13 -0
- textloom_kg-0.1.0/tests/fixtures/docs/03-curing.docx +0 -0
- textloom_kg-0.1.0/tests/fixtures/docs/03-curing.pdf +93 -0
- textloom_kg-0.1.0/tests/fixtures/docs/03-curing.txt +10 -0
- textloom_kg-0.1.0/tests/fixtures/docs/04-humidors.docx +0 -0
- textloom_kg-0.1.0/tests/fixtures/docs/04-humidors.pdf +74 -0
- textloom_kg-0.1.0/tests/fixtures/docs/04-humidors.txt +6 -0
- textloom_kg-0.1.0/tests/fixtures/docs/05-notes.docx +0 -0
- textloom_kg-0.1.0/tests/fixtures/docs/05-notes.pdf +74 -0
- textloom_kg-0.1.0/tests/fixtures/docs/05-notes.txt +7 -0
- textloom_kg-0.1.0/tests/fixtures/gold.json +98 -0
- textloom_kg-0.1.0/tests/fixtures/ontology/cigars-2.1.0/LICENSE +378 -0
- textloom_kg-0.1.0/tests/fixtures/ontology/cigars-2.1.0/SOURCE.md +7 -0
- textloom_kg-0.1.0/tests/fixtures/ontology/cigars-2.1.0/context.jsonld +1 -0
- textloom_kg-0.1.0/tests/fixtures/ontology/cigars-2.1.0/ontology.ttl +3184 -0
- textloom_kg-0.1.0/tests/fixtures/ontology/cigars-2.1.0/shapes.ttl +1181 -0
- textloom_kg-0.1.0/tests/fixtures/ontology/cigars-slice-shapes.ttl +99 -0
- textloom_kg-0.1.0/tests/fixtures/ontology/cigars-slice.ttl +229 -0
- textloom_kg-0.1.0/tests/unit/__init__.py +0 -0
- textloom_kg-0.1.0/tests/unit/test_adjudicator.py +166 -0
- textloom_kg-0.1.0/tests/unit/test_allowlist.py +78 -0
- textloom_kg-0.1.0/tests/unit/test_analysis.py +108 -0
- textloom_kg-0.1.0/tests/unit/test_auth.py +109 -0
- textloom_kg-0.1.0/tests/unit/test_candidates_review.py +379 -0
- textloom_kg-0.1.0/tests/unit/test_cli_and_registry.py +62 -0
- textloom_kg-0.1.0/tests/unit/test_compiler.py +179 -0
- textloom_kg-0.1.0/tests/unit/test_confirm.py +26 -0
- textloom_kg-0.1.0/tests/unit/test_corpora.py +70 -0
- textloom_kg-0.1.0/tests/unit/test_device.py +34 -0
- textloom_kg-0.1.0/tests/unit/test_domain_range_mode.py +139 -0
- textloom_kg-0.1.0/tests/unit/test_evaluation.py +303 -0
- textloom_kg-0.1.0/tests/unit/test_format_loss.py +177 -0
- textloom_kg-0.1.0/tests/unit/test_funnel.py +113 -0
- textloom_kg-0.1.0/tests/unit/test_item9_quality_and_traces.py +207 -0
- textloom_kg-0.1.0/tests/unit/test_jobs.py +104 -0
- textloom_kg-0.1.0/tests/unit/test_lakeloom_client.py +55 -0
- textloom_kg-0.1.0/tests/unit/test_language_packs.py +171 -0
- textloom_kg-0.1.0/tests/unit/test_literals.py +40 -0
- textloom_kg-0.1.0/tests/unit/test_llm_providers.py +134 -0
- textloom_kg-0.1.0/tests/unit/test_loaders.py +130 -0
- textloom_kg-0.1.0/tests/unit/test_local_delivery.py +353 -0
- textloom_kg-0.1.0/tests/unit/test_mcp_server.py +415 -0
- textloom_kg-0.1.0/tests/unit/test_metrics.py +62 -0
- textloom_kg-0.1.0/tests/unit/test_multilingual.py +337 -0
- textloom_kg-0.1.0/tests/unit/test_next_steps.py +412 -0
- textloom_kg-0.1.0/tests/unit/test_parse_docling.py +76 -0
- textloom_kg-0.1.0/tests/unit/test_parse_limits.py +106 -0
- textloom_kg-0.1.0/tests/unit/test_parse_text.py +65 -0
- textloom_kg-0.1.0/tests/unit/test_pipeline_models.py +59 -0
- textloom_kg-0.1.0/tests/unit/test_pipeline_precise.py +164 -0
- textloom_kg-0.1.0/tests/unit/test_preview.py +48 -0
- textloom_kg-0.1.0/tests/unit/test_proper_names.py +31 -0
- textloom_kg-0.1.0/tests/unit/test_readme.py +41 -0
- textloom_kg-0.1.0/tests/unit/test_redfm.py +83 -0
- textloom_kg-0.1.0/tests/unit/test_references.py +143 -0
- textloom_kg-0.1.0/tests/unit/test_relation_choice.py +24 -0
- textloom_kg-0.1.0/tests/unit/test_security.py +511 -0
- textloom_kg-0.1.0/tests/unit/test_values.py +41 -0
- textloom_kg-0.1.0/uv.lock +5740 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Something does not work as documented
|
|
4
|
+
labels: bug
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**What happened?**
|
|
8
|
+
|
|
9
|
+
**What did you expect?**
|
|
10
|
+
|
|
11
|
+
**Steps to reproduce**
|
|
12
|
+
|
|
13
|
+
**Environment**
|
|
14
|
+
- Textloom version:
|
|
15
|
+
- Python / container image (server, worker, worker-gpu):
|
|
16
|
+
- Ontology source (file, Git, Lakeloom) and Lakeloom version, if used:
|
|
17
|
+
- Deployment (stdio, compose, k8s):
|
|
18
|
+
|
|
19
|
+
**Logs** (redact secrets, tokens and document text you cannot share)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: uv
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
- package-ecosystem: github-actions
|
|
8
|
+
directory: /
|
|
9
|
+
schedule:
|
|
10
|
+
interval: weekly
|
|
11
|
+
- package-ecosystem: docker
|
|
12
|
+
directory: /deploy
|
|
13
|
+
schedule:
|
|
14
|
+
interval: weekly
|
|
15
|
+
ignore:
|
|
16
|
+
# Python is pinned to 3.12 (.python-version, pyright, CI); move minor versions deliberately.
|
|
17
|
+
- dependency-name: python
|
|
18
|
+
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- What does this change and why? -->
|
|
4
|
+
|
|
5
|
+
## Checklist
|
|
6
|
+
|
|
7
|
+
- [ ] Commits follow Conventional Commits and are signed off (`git commit -s`, DCO)
|
|
8
|
+
- [ ] Requirement IDs (`FR-…` / `NFR-…`) referenced in commits, docstrings and test names
|
|
9
|
+
- [ ] Tests added or updated; `uv run pytest`, `ruff check`, `ruff format --check` and `pyright` pass
|
|
10
|
+
- [ ] `CHANGELOG.md` updated under `[Unreleased]` (if user-visible)
|
|
11
|
+
- [ ] ADR added in `docs/decisions/` (if a non-trivial decision was made)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
lint-type-test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: astral-sh/setup-uv@v6
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true
|
|
19
|
+
- run: uv sync --all-extras --locked
|
|
20
|
+
- name: Model cache (pinned revisions)
|
|
21
|
+
uses: actions/cache@v4
|
|
22
|
+
with:
|
|
23
|
+
path: ~/.cache/textloom/models
|
|
24
|
+
key: models-${{ hashFiles('src/textloom/models_registry.py') }}
|
|
25
|
+
- run: uv run textloom models download
|
|
26
|
+
env:
|
|
27
|
+
TEXTLOOM_MODEL_CACHE: ~/.cache/textloom/models
|
|
28
|
+
TEXTLOOM_CONFIG_FILE: /dev/null
|
|
29
|
+
- run: uv run ruff check .
|
|
30
|
+
- run: uv run ruff format --check .
|
|
31
|
+
- run: uv run pyright
|
|
32
|
+
- run: uv run pytest --cov=textloom --cov-report=term
|
|
33
|
+
- name: Model tests (Docling native pipeline, GLiNER, relex)
|
|
34
|
+
run: uv run pytest -m models
|
|
35
|
+
- name: Benchmark regression subset (FR-EVAL-06; deterministic systems)
|
|
36
|
+
run: uv run textloom bench --subset ci --systems rules,hybrid --runs 1 --json bench.json
|
|
37
|
+
env:
|
|
38
|
+
TEXTLOOM_MODEL_CACHE: ~/.cache/textloom/models
|
|
39
|
+
TEXTLOOM_CONFIG_FILE: /dev/null
|
|
40
|
+
- name: Fail on an F1 drop above 2 points
|
|
41
|
+
run: uv run python benchmarks/check_regression.py bench.json docs/benchmarks/results/ci-baseline.json
|
|
42
|
+
- name: Server starts without heavy dependencies (TC-12)
|
|
43
|
+
run: |
|
|
44
|
+
uv venv /tmp/server-only
|
|
45
|
+
VIRTUAL_ENV=/tmp/server-only uv pip install .
|
|
46
|
+
/tmp/server-only/bin/python -c "import sys, textloom.server.app; assert 'torch' not in sys.modules"
|
|
47
|
+
|
|
48
|
+
dependency-scan:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v4
|
|
52
|
+
- uses: astral-sh/setup-uv@v6
|
|
53
|
+
- run: uv export --all-extras --format requirements-txt --no-hashes > requirements.txt
|
|
54
|
+
# Audit the pinned versions without installing them: on Linux the lock pins the CPU
|
|
55
|
+
# build of torch (2.x+cpu, PyTorch index, ADR 0020), which pip cannot resolve from PyPI.
|
|
56
|
+
- run: uvx pip-audit --disable-pip --no-deps -r requirements.txt
|
|
57
|
+
|
|
58
|
+
# NFR-DEP-01, NFR-SEC-09 (ADR 0026): build every image, scan it, keep its SBOM.
|
|
59
|
+
# Pull requests build the server and CPU worker for amd64; main also builds the CPU worker
|
|
60
|
+
# for arm64 (QEMU) and the GPU worker. Nothing is pushed here (see release-images.yml).
|
|
61
|
+
images:
|
|
62
|
+
runs-on: ubuntu-latest
|
|
63
|
+
strategy:
|
|
64
|
+
fail-fast: false
|
|
65
|
+
matrix:
|
|
66
|
+
target: [server, worker, worker-gpu]
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@v4
|
|
69
|
+
- name: Skip the GPU image on pull requests
|
|
70
|
+
id: gate
|
|
71
|
+
run: |
|
|
72
|
+
if [ "${{ matrix.target }}" = worker-gpu ] && [ "${{ github.event_name }}" = pull_request ]; then
|
|
73
|
+
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
74
|
+
fi
|
|
75
|
+
- name: Free disk space (CUDA wheels are large)
|
|
76
|
+
if: steps.gate.outputs.skip != 'true' && matrix.target != 'server'
|
|
77
|
+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
|
78
|
+
- uses: docker/setup-qemu-action@v4
|
|
79
|
+
if: steps.gate.outputs.skip != 'true' && matrix.target == 'worker' && github.event_name != 'pull_request'
|
|
80
|
+
- uses: docker/setup-buildx-action@v4
|
|
81
|
+
if: steps.gate.outputs.skip != 'true'
|
|
82
|
+
- name: Build (amd64, loaded for the scan)
|
|
83
|
+
if: steps.gate.outputs.skip != 'true'
|
|
84
|
+
uses: docker/build-push-action@v7
|
|
85
|
+
with:
|
|
86
|
+
context: .
|
|
87
|
+
file: deploy/Dockerfile
|
|
88
|
+
target: ${{ matrix.target }}
|
|
89
|
+
platforms: linux/amd64
|
|
90
|
+
load: true
|
|
91
|
+
tags: textloom-${{ matrix.target }}:ci
|
|
92
|
+
build-args: SOURCE_URL=${{ github.server_url }}/${{ github.repository }}
|
|
93
|
+
cache-from: type=gha,scope=${{ matrix.target }}
|
|
94
|
+
cache-to: type=gha,mode=max,scope=${{ matrix.target }}
|
|
95
|
+
- name: Build arm64 (multi-arch CPU worker)
|
|
96
|
+
if: matrix.target == 'worker' && github.event_name != 'pull_request'
|
|
97
|
+
uses: docker/build-push-action@v7
|
|
98
|
+
with:
|
|
99
|
+
context: .
|
|
100
|
+
file: deploy/Dockerfile
|
|
101
|
+
target: worker
|
|
102
|
+
platforms: linux/arm64
|
|
103
|
+
cache-from: type=gha,scope=worker-arm64
|
|
104
|
+
cache-to: type=gha,mode=max,scope=worker-arm64
|
|
105
|
+
- name: Runs as non-root, server without heavy dependencies
|
|
106
|
+
if: steps.gate.outputs.skip != 'true'
|
|
107
|
+
run: |
|
|
108
|
+
test "$(docker run --rm --entrypoint id textloom-${{ matrix.target }}:ci -u)" = 10001
|
|
109
|
+
if [ "${{ matrix.target }}" = server ]; then
|
|
110
|
+
docker run --rm --entrypoint python textloom-server:ci -c \
|
|
111
|
+
"import sys, textloom.server.app; assert 'torch' not in sys.modules"
|
|
112
|
+
else
|
|
113
|
+
docker run --rm --entrypoint python textloom-${{ matrix.target }}:ci -c \
|
|
114
|
+
"import torch, textloom.stages.relations; print(torch.__version__, torch.version.cuda)"
|
|
115
|
+
fi
|
|
116
|
+
- name: Scan (fixed CRITICAL and HIGH fail the build)
|
|
117
|
+
if: steps.gate.outputs.skip != 'true'
|
|
118
|
+
run: |
|
|
119
|
+
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
|
|
120
|
+
-v "$PWD/.trivyignore:/.trivyignore:ro" aquasec/trivy:0.77.0 image \
|
|
121
|
+
--scanners vuln --severity CRITICAL,HIGH --ignore-unfixed --exit-code 1 \
|
|
122
|
+
--ignorefile /.trivyignore textloom-${{ matrix.target }}:ci
|
|
123
|
+
- name: SBOM (CycloneDX)
|
|
124
|
+
if: steps.gate.outputs.skip != 'true'
|
|
125
|
+
run: |
|
|
126
|
+
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$PWD:/out" \
|
|
127
|
+
aquasec/trivy:0.77.0 image --format cyclonedx \
|
|
128
|
+
--output /out/sbom-${{ matrix.target }}.cdx.json textloom-${{ matrix.target }}:ci
|
|
129
|
+
- uses: actions/upload-artifact@v4
|
|
130
|
+
if: steps.gate.outputs.skip != 'true'
|
|
131
|
+
with:
|
|
132
|
+
name: sbom-${{ matrix.target }}
|
|
133
|
+
path: sbom-${{ matrix.target }}.cdx.json
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: release-images
|
|
2
|
+
|
|
3
|
+
# NFR-DEP-01, NFR-SEC-09 (ADR 0026): push the images to GHCR with an SBOM and provenance
|
|
4
|
+
# attached, then scan what was pushed. Runs only for a version tag (created by the owner at
|
|
5
|
+
# release, M3 item 10) or by hand.
|
|
6
|
+
# ghcr.io/<owner>/textloom:<version> server, amd64 + arm64
|
|
7
|
+
# ghcr.io/<owner>/textloom-worker:<version>-cpu and :cpu, amd64 + arm64
|
|
8
|
+
# ghcr.io/<owner>/textloom-worker:<version>-gpu and :gpu, amd64 (CUDA 13)
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
tags: ["v*"]
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
packages: write
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
push:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
strategy:
|
|
23
|
+
fail-fast: false
|
|
24
|
+
matrix:
|
|
25
|
+
include:
|
|
26
|
+
- target: server
|
|
27
|
+
image: textloom
|
|
28
|
+
suffix: ""
|
|
29
|
+
platforms: linux/amd64,linux/arm64
|
|
30
|
+
- target: worker
|
|
31
|
+
image: textloom-worker
|
|
32
|
+
suffix: cpu
|
|
33
|
+
platforms: linux/amd64,linux/arm64
|
|
34
|
+
- target: worker-gpu
|
|
35
|
+
image: textloom-worker
|
|
36
|
+
suffix: gpu
|
|
37
|
+
platforms: linux/amd64
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v4
|
|
40
|
+
- name: Free disk space (CUDA wheels are large)
|
|
41
|
+
if: matrix.target != 'server'
|
|
42
|
+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
|
43
|
+
- uses: docker/setup-qemu-action@v4
|
|
44
|
+
- uses: docker/setup-buildx-action@v4
|
|
45
|
+
- uses: docker/login-action@v4
|
|
46
|
+
with:
|
|
47
|
+
registry: ghcr.io
|
|
48
|
+
username: ${{ github.actor }}
|
|
49
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
50
|
+
- id: meta
|
|
51
|
+
uses: docker/metadata-action@v6
|
|
52
|
+
with:
|
|
53
|
+
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
|
|
54
|
+
flavor: |
|
|
55
|
+
latest=false
|
|
56
|
+
suffix=${{ matrix.suffix && format('-{0}', matrix.suffix) || '' }}
|
|
57
|
+
tags: |
|
|
58
|
+
type=semver,pattern={{version}}
|
|
59
|
+
type=raw,value=${{ matrix.suffix }},enable=${{ matrix.suffix != '' && startsWith(github.ref, 'refs/tags/v') }},suffix=
|
|
60
|
+
type=raw,value=latest,enable=${{ matrix.suffix == '' && startsWith(github.ref, 'refs/tags/v') }}
|
|
61
|
+
type=sha
|
|
62
|
+
- id: build
|
|
63
|
+
uses: docker/build-push-action@v7
|
|
64
|
+
with:
|
|
65
|
+
context: .
|
|
66
|
+
file: deploy/Dockerfile
|
|
67
|
+
target: ${{ matrix.target }}
|
|
68
|
+
platforms: ${{ matrix.platforms }}
|
|
69
|
+
push: true
|
|
70
|
+
sbom: true
|
|
71
|
+
provenance: mode=max
|
|
72
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
73
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
74
|
+
build-args: SOURCE_URL=${{ github.server_url }}/${{ github.repository }}
|
|
75
|
+
cache-from: type=gha,scope=release-${{ matrix.target }}
|
|
76
|
+
cache-to: type=gha,mode=max,scope=release-${{ matrix.target }}
|
|
77
|
+
- name: Scan the pushed image
|
|
78
|
+
run: |
|
|
79
|
+
image="$(echo "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}" | tr '[:upper:]' '[:lower:]')"
|
|
80
|
+
docker run --rm -v "$PWD/.trivyignore:/.trivyignore:ro" \
|
|
81
|
+
-e TRIVY_USERNAME=${{ github.actor }} -e TRIVY_PASSWORD=${{ secrets.GITHUB_TOKEN }} \
|
|
82
|
+
aquasec/trivy:0.77.0 image --scanners vuln --severity CRITICAL,HIGH \
|
|
83
|
+
--ignore-unfixed --exit-code 1 --ignorefile /.trivyignore \
|
|
84
|
+
"$image@${{ steps.build.outputs.digest }}"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: release-pypi
|
|
2
|
+
|
|
3
|
+
# Publish textloom-kg to PyPI with trusted publishing (no token stored): runs only for a
|
|
4
|
+
# version tag, created by the owner at release (M3 item 10, ADR 0009). The tag must match
|
|
5
|
+
# the version in pyproject.toml. PyPI side: a (pending) trusted publisher for repository
|
|
6
|
+
# elcioabrahao/textloom, workflow release-pypi.yml, environment pypi.
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
tags: ["v*"]
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
- uses: astral-sh/setup-uv@v6
|
|
21
|
+
- name: Tag matches the package version
|
|
22
|
+
run: |
|
|
23
|
+
version=$(uv version --short)
|
|
24
|
+
test "v${version}" = "${GITHUB_REF_NAME}" || {
|
|
25
|
+
echo "tag ${GITHUB_REF_NAME} does not match version ${version}"; exit 1; }
|
|
26
|
+
- run: uv build
|
|
27
|
+
- name: Check the distributions
|
|
28
|
+
run: uvx twine check --strict dist/*
|
|
29
|
+
- uses: actions/upload-artifact@v4
|
|
30
|
+
with:
|
|
31
|
+
name: dist
|
|
32
|
+
path: dist/
|
|
33
|
+
|
|
34
|
+
publish:
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
environment:
|
|
38
|
+
name: pypi
|
|
39
|
+
url: https://pypi.org/project/textloom-kg/
|
|
40
|
+
permissions:
|
|
41
|
+
id-token: write
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/download-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
name: dist
|
|
46
|
+
path: dist/
|
|
47
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
|
|
5
|
+
[SemVer](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2026-12-06
|
|
10
|
+
|
|
11
|
+
First release (alpha). Results on open benchmarks: `docs/benchmarks/results/0.1.0.md`.
|
|
12
|
+
|
|
13
|
+
### Added — M3 Release 0.1
|
|
14
|
+
|
|
15
|
+
- **Results without Lakeloom** (ADR 0029): built-in `local` export destination
|
|
16
|
+
(`TEXTLOOM_EXPORT_DIR`); facts as CSV and the job report as Markdown next to Turtle and
|
|
17
|
+
JSON-LD; `mark_facts` (human decisions on facts, kept across jobs); `deliver_candidates_locally`
|
|
18
|
+
(accepted vocabulary as a SKOS/Turtle ontology patch and local synonyms); the guide asks
|
|
19
|
+
whether results go to Lakeloom or stay local (G16, option `deliver_to`); prompts
|
|
20
|
+
`review_facts` and `deliver_results` (FR-VAL-04, FR-OUT-08..10).
|
|
21
|
+
- **Multilingual extraction** (ADR 0028): language identification per paragraph for ~90
|
|
22
|
+
languages (py3langid); labels in the text's language for matching and relation cues;
|
|
23
|
+
GLiNER word splitting for scripts with combining marks and without spaces; CLDR month names;
|
|
24
|
+
`survey_languages`; guide signal G15; `textloom bench redfm` on natively written text in ten
|
|
25
|
+
languages (FR-EXT-11, FR-ONT-06).
|
|
26
|
+
- **Quality work** on the hybrid pipeline: per-relation error analysis and pipeline funnel
|
|
27
|
+
(`evaluation/analysis.py`, `evaluation/funnel.py`); opt-in soft domain/range
|
|
28
|
+
(`domain_range: soft`, ADR 0022); light reference resolution (ADR 0023); relation cue
|
|
29
|
+
words across word families; typed adjudication of unlinked pairs (`adjudicate_pairs: typed`,
|
|
30
|
+
ADR 0024).
|
|
31
|
+
- **Format-loss test**: `textloom bench format-loss` renders benchmark sentences as PDF and
|
|
32
|
+
DOCX layouts and reports the F1 drop against text (FR-EVAL-04, ADR 0025).
|
|
33
|
+
- **OpenTelemetry traces** (`otel` extra, ADR 0030): spans per tool call, job document
|
|
34
|
+
(continuing the caller's trace), parse, stage, Lakeloom and LLM call (NFR-OPS-01).
|
|
35
|
+
- **Candidate quality** (ADR 0030): synonyms only for the whole renamed phrase; generic nouns
|
|
36
|
+
dropped; sentences that read like instructions to an AI yield no candidates and are listed
|
|
37
|
+
in the job report. Guide signal `G6-reload-after-applied`.
|
|
38
|
+
- **Security suite** (`tests/unit/test_security.py`): allowlist, quoting of document text in
|
|
39
|
+
every tool, oversized files, licence-blocked models, secrets (NFR-TST-06); CSV cells never
|
|
40
|
+
run as spreadsheet formulas.
|
|
41
|
+
- **Container images** (ADR 0026): server, CPU worker (amd64, arm64) and GPU worker (CUDA),
|
|
42
|
+
non-root, SBOM, Trivy scan in CI; `release-images.yml` pushes them to GHCR on a version tag.
|
|
43
|
+
- **Publishing**: `release-pypi.yml` publishes `textloom-kg` to PyPI with trusted publishing
|
|
44
|
+
on a version tag.
|
|
45
|
+
- **Documentation in the README** (ADR 0027), GitHub issue and pull request templates,
|
|
46
|
+
Dependabot.
|
|
47
|
+
|
|
48
|
+
### Added — M2 Vocabulary and Lakeloom
|
|
49
|
+
|
|
50
|
+
- Vocabulary candidates: new terms (C-value), synonyms, hierarchy (Hearst patterns) and
|
|
51
|
+
associations (PMI), with definitional passages and located evidence (FR-CAN-01..05).
|
|
52
|
+
- Review marks by a human principal, kept across jobs (`list_candidates`, `mark_candidates`,
|
|
53
|
+
FR-CAN-06); candidates as JSON and CSV (FR-OUT-02).
|
|
54
|
+
- `submit_to_lakeloom`: draft proposals in Lakeloom as an agent principal, with provenance in
|
|
55
|
+
each note; never approves; `get_submissions` follows their state (FR-OUT-03..05).
|
|
56
|
+
- Guide: stages review, submit and maintain; signals G5, G6, G7 (candidates), G8.
|
|
57
|
+
- Pipeline preview on a worker (`preview_extraction` with `mode: pipeline`), per-class
|
|
58
|
+
thresholds, Prometheus metrics (server gauges, worker counters).
|
|
59
|
+
- Language packs through the `textloom.languages` entry point (ADR 0017; example pack
|
|
60
|
+
`packs/textloom-lang-pt`).
|
|
61
|
+
- Development stack (`deploy/compose`: MinIO, PostgreSQL, Keycloak, Lakeloom) and contract
|
|
62
|
+
tests; CPU-only PyTorch on Linux (ADR 0020).
|
|
63
|
+
|
|
64
|
+
### Added — M1 Extraction
|
|
65
|
+
|
|
66
|
+
- Pipeline runtime with stages from the `textloom.stages` entry point; models loaded only
|
|
67
|
+
through the registry, pinned revisions, offline in production (FR-EXT-01, FR-EXT-09).
|
|
68
|
+
- Stages: `linguistic` (spaCy), `mentions_lexical` (PhraseMatcher on LOWER/ORTH/LEMMA),
|
|
69
|
+
`mentions_gliner` (gliner_multi-v2.1), `mentions_ner` (rules baseline), `linking` (exact,
|
|
70
|
+
lemma, fuzzy, embeddings), `values` (numbers, units, dates), `relations` (rules +
|
|
71
|
+
GLiNER-relex, domain/range), `adjudicator` (optional LLM), `validation` (domain, range,
|
|
72
|
+
datatype, cardinality, disjointness, SHACL) (FR-EXT-02..08, FR-VAL-01..03).
|
|
73
|
+
- Facts with located evidence; Turtle/JSON-LD with PROV-O and Web Annotation (FR-OUT-01).
|
|
74
|
+
- Jobs with per-document leases, resumability, reuse of unchanged documents, cancel,
|
|
75
|
+
`only_failed`; `textloom worker` (FR-EXT-10, NFR-DEP-04).
|
|
76
|
+
- Tools: `start_extraction_job`, `get_job`, `cancel_job`, `list_facts`, `get_evidence`,
|
|
77
|
+
`export_results`, `run_benchmark`, `compare_runs`; two-call confirm (FR-AGT-03); job
|
|
78
|
+
resources; `extract_from_corpus` prompt.
|
|
79
|
+
- Guide: stages through `review`/`maintain`; signals G3, G4, G7 (facts), G9, G12, G13, G14 and
|
|
80
|
+
the run step; facts/coverage/benchmark deliverables.
|
|
81
|
+
- Text2KGBench harness: fetch script, adapter, metrics, four systems, `textloom bench`
|
|
82
|
+
(FR-EVAL-01..03, FR-EVAL-06).
|
|
83
|
+
- `textloom models download|list`.
|
|
84
|
+
- Model providers: OpenRouter (OpenAI-compatible; DeepSeek V4 Flash for the `llm-only`
|
|
85
|
+
baseline) and TypeSafe Jev as adjudicator (ADR 0015).
|
|
86
|
+
- First Text2KGBench results (CI subset, four systems) in `docs/benchmarks/results/`.
|
|
87
|
+
|
|
88
|
+
### Added — M0 Foundation
|
|
89
|
+
|
|
90
|
+
- Project scaffolding (uv, ruff, pyright strict, pytest, CI).
|
|
91
|
+
- Settings and operator configuration file; typed errors with hints (FR-AGT-04).
|
|
92
|
+
- State store (SQLAlchemy 2, SQLite/PostgreSQL, Alembic) with audit log.
|
|
93
|
+
- Storage layer over fsspec with a bucket allowlist (FR-DOC-01, FR-DOC-02).
|
|
94
|
+
- Corpus registration and refresh with SHA-256, ETag and per-document state (FR-DOC-04, -07).
|
|
95
|
+
- Parsing: TXT/MD built-in; PDF and DOCX through Docling in an isolated process, with pages,
|
|
96
|
+
sections and character offsets (FR-DOC-05, NFR-SEC-04).
|
|
97
|
+
- Ontology loaders: file, Git tag, Lakeloom MCP resources (FR-ONT-01, FR-ONT-07).
|
|
98
|
+
- Deterministic profile compiler with guidance-quality report and workspace overrides
|
|
99
|
+
(FR-ONT-02..05).
|
|
100
|
+
- Model registry with licence policy (FR-LIC-01, FR-LIC-02).
|
|
101
|
+
- Guide: `get_next_steps` with stages setup/calibrate/extract, signals G1, G2, G10, G11,
|
|
102
|
+
deliverables and `next` hints (FR-GDE-01..10).
|
|
103
|
+
- MCP server (SDK 2.x): 11 tools, `start_here` prompt, workspace resources; OAuth resource
|
|
104
|
+
server over Streamable HTTP (NFR-SEC-01).
|
|
105
|
+
- CLI: `serve`, `worker` (stub), `compile-profile`, `parse`, `db-upgrade`.
|
|
106
|
+
|
|
107
|
+
[Unreleased]: https://github.com/elcioabrahao/textloom/compare/v0.1.0...HEAD
|
|
108
|
+
[0.1.0]: https://github.com/elcioabrahao/textloom/releases/tag/v0.1.0
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# CLAUDE.md — working on Textloom
|
|
2
|
+
|
|
3
|
+
Textloom extracts knowledge from unstructured documents (TXT, PDF, DOCX in buckets) using an
|
|
4
|
+
existing ontology to guide NLP tools, and serves everything over MCP with a guided,
|
|
5
|
+
step-by-step workflow. It is the companion of
|
|
6
|
+
[Lakeloom](https://github.com/elcioabrahao/lakeloom): Lakeloom governs the model, Textloom
|
|
7
|
+
reads documents and sends draft proposals back.
|
|
8
|
+
|
|
9
|
+
## Read first
|
|
10
|
+
|
|
11
|
+
1. `REQUIREMENTS.md` — the specification. Section 0 has the rules; section 13 the build order.
|
|
12
|
+
2. `docs/decisions/` — ADRs. 0002 (separate project), 0003 (licence policy), 0004 (guided
|
|
13
|
+
workflow) shape most of the code.
|
|
14
|
+
3. `docs/lakeloom-integration.md` — the contract with Lakeloom.
|
|
15
|
+
4. `docs/benchmarks/README.md` — how quality is measured.
|
|
16
|
+
|
|
17
|
+
## Build order
|
|
18
|
+
|
|
19
|
+
Work milestone by milestone (M0 → M1 → M2 → M3). Do not start a milestone before the previous
|
|
20
|
+
exit gate passes. At the start of each milestone, write a short plan in
|
|
21
|
+
`docs/backlog/mN-plan.md`; at the end, record anything deferred in `docs/backlog/mN-deferred.md`.
|
|
22
|
+
|
|
23
|
+
## Conventions (same as Lakeloom)
|
|
24
|
+
|
|
25
|
+
- Python ≥ 3.12, **uv**, **ruff**, **pyright strict** on `src/`, **pytest** (+ pytest-asyncio,
|
|
26
|
+
Hypothesis), **pydantic v2**, official **MCP Python SDK**.
|
|
27
|
+
- Requirement IDs in commit messages, docstrings and test names:
|
|
28
|
+
`test_fr_gde_04_ranking_is_deterministic`.
|
|
29
|
+
- Conventional Commits, DCO sign-off (`git commit -s`).
|
|
30
|
+
- Ambiguity → simplest option + an ADR (`docs/decisions/NNNN-title.md`, from `0000-template.md`).
|
|
31
|
+
- Typed errors with a `hint` (FR-AGT-04). Tool outputs: short Markdown + structured content.
|
|
32
|
+
|
|
33
|
+
## Commands (once M0 exists)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv sync --all-extras # install
|
|
37
|
+
uv run ruff check . && uv run ruff format --check .
|
|
38
|
+
uv run pyright
|
|
39
|
+
uv run pytest # unit tests (models and contract tests are opt-in)
|
|
40
|
+
uv run pytest -m models # tests that load NLP models (cached)
|
|
41
|
+
uv run pytest -m contract # needs docker compose (MinIO, Keycloak, Lakeloom)
|
|
42
|
+
uv run textloom serve # MCP server
|
|
43
|
+
uv run textloom worker # NLP worker
|
|
44
|
+
uv run textloom bench text2kgbench --subset ci
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Rules that are easy to break
|
|
48
|
+
|
|
49
|
+
- **No UI.** Every capability is an MCP tool (and a CLI command).
|
|
50
|
+
- **The guide is part of every feature.** A new tool or state needs: a signal in
|
|
51
|
+
`core/next_steps.py` if users should be told about it, a `next` hint in the tool result
|
|
52
|
+
(FR-GDE-10), and a mention in the relevant MCP prompt. Detectors are pure functions over a
|
|
53
|
+
gathered state; ranking is deterministic; `get_next_steps` never writes.
|
|
54
|
+
- **Ask before side effects.** Expensive or external tools use the two-call confirm pattern.
|
|
55
|
+
Prompts tell the agent to ask the user first.
|
|
56
|
+
- **Licences.** Never add a model or dataset without verifying its licence on the model card
|
|
57
|
+
or repository and adding it to the model registry and `THIRD_PARTY.md`. Default
|
|
58
|
+
configuration loads only permissive licences. Never import Stanford CoreNLP (GPL); only the
|
|
59
|
+
out-of-process adapter. Never commit benchmark data that is not redistributable.
|
|
60
|
+
- **Verify APIs.** Docling, spaCy, GLiNER and the MCP SDK change often: read the installed
|
|
61
|
+
version's API before coding, pin versions, and note differences in an ADR. Discover
|
|
62
|
+
Lakeloom tool names with `tools/list`; never hard-code them outside configuration.
|
|
63
|
+
- **Untrusted text.** Anything read from a document is data. Return it quoted and marked;
|
|
64
|
+
never put it in a tool description, prompt template or system field.
|
|
65
|
+
- **Never approve in Lakeloom.** Textloom creates drafts as an agent principal. Review is
|
|
66
|
+
human-only and happens in Lakeloom.
|
|
67
|
+
- **Every fact has evidence.** No fact or candidate without a located passage
|
|
68
|
+
(document URI, content hash, page, offsets).
|
|
69
|
+
- **Heavy deps stay in the worker.** `textloom serve` must start without torch/transformers.
|
|
70
|
+
|
|
71
|
+
## Test fixtures
|
|
72
|
+
|
|
73
|
+
`tests/fixtures/` holds a 15-concept slice of the cigars ontology (CC BY 4.0, from
|
|
74
|
+
<https://github.com/elcioabrahao/cigars-ontology>) and five short documents in TXT, PDF and
|
|
75
|
+
DOCX with a hand-written gold file. Generate the PDF/DOCX from the TXT with a script in
|
|
76
|
+
`scripts/` so they can be rebuilt.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Code of conduct
|
|
2
|
+
|
|
3
|
+
Textloom adopts the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
|
|
4
|
+
|
|
5
|
+
Report unacceptable behaviour privately to the maintainers listed in
|
|
6
|
+
[GOVERNANCE.md](GOVERNANCE.md) (through GitHub, by direct message to a maintainer). Reports are
|
|
7
|
+
handled confidentially.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thank you for helping. Read [CLAUDE.md](CLAUDE.md) and [REQUIREMENTS.md](REQUIREMENTS.md)
|
|
4
|
+
first; they hold the rules every change follows.
|
|
5
|
+
|
|
6
|
+
## Set up
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
uv sync --all-extras
|
|
10
|
+
uv run ruff check . && uv run ruff format --check .
|
|
11
|
+
uv run pyright
|
|
12
|
+
uv run pytest # unit tests
|
|
13
|
+
uv run pytest -m models # tests that need Docling (the nlp extra)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
macOS note: if `import textloom` fails inside `.venv`, check `ls -lO .venv/lib/python3.12/site-packages/*.pth`.
|
|
17
|
+
Python skips `.pth` files with the `hidden` flag; clear it with `chflags -R nohidden .venv`.
|
|
18
|
+
Tests do not depend on this (`pythonpath = ["src"]`).
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
|
|
22
|
+
- Requirement IDs in commit messages, docstrings and test names
|
|
23
|
+
(`test_fr_gde_04_ranking_is_deterministic`).
|
|
24
|
+
- [Conventional Commits](https://www.conventionalcommits.org/) and DCO sign-off
|
|
25
|
+
(`git commit -s`): by signing off you certify the
|
|
26
|
+
[Developer Certificate of Origin](https://developercertificate.org/).
|
|
27
|
+
- A new tool or state needs a guide signal (if users should hear about it), a `next` hint in
|
|
28
|
+
its result and a mention in the relevant MCP prompt.
|
|
29
|
+
- New models or datasets: verify the licence on the model card, add them to the model registry
|
|
30
|
+
and `THIRD_PARTY.md`.
|
|
31
|
+
- Ambiguity: choose the simplest option and write an ADR in `docs/decisions/`.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Governance
|
|
2
|
+
|
|
3
|
+
- **Maintainer:** Elcio Abrahão (GitHub `elcioabrahao`), project lead.
|
|
4
|
+
- Decisions follow lazy consensus on pull requests; architectural decisions are recorded as
|
|
5
|
+
ADRs in `docs/decisions/`. The project lead decides when consensus is not reached.
|
|
6
|
+
- New maintainers are invited by the existing maintainers after sustained contributions.
|
|
7
|
+
- Textloom is independent and not affiliated with the organisations listed in the README.
|