latris 0.3.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.
- latris-0.3.0/.gitignore +75 -0
- latris-0.3.0/CLAUDE.md +98 -0
- latris-0.3.0/CONTRIBUTING.md +54 -0
- latris-0.3.0/LICENSE +201 -0
- latris-0.3.0/PKG-INFO +232 -0
- latris-0.3.0/README.md +173 -0
- latris-0.3.0/docs/README.md +103 -0
- latris-0.3.0/docs/engineering/AI_LAYER.md +361 -0
- latris-0.3.0/docs/engineering/ARCHITECTURE.md +489 -0
- latris-0.3.0/docs/engineering/CLI_REFERENCE.md +298 -0
- latris-0.3.0/docs/engineering/GIT_INTEGRATION.md +152 -0
- latris-0.3.0/docs/engineering/SCHEMA_NOTES.md +397 -0
- latris-0.3.0/docs/engineering/TESTING.md +92 -0
- latris-0.3.0/llms.txt +34 -0
- latris-0.3.0/projects/README.md +16 -0
- latris-0.3.0/projects/sample_data.csv +28 -0
- latris-0.3.0/pyproject.toml +151 -0
- latris-0.3.0/scripts/bump-version.sh +86 -0
- latris-0.3.0/scripts/dev-server.sh +98 -0
- latris-0.3.0/scripts/dev-stop.sh +71 -0
- latris-0.3.0/src/latris/CLAUDE.md +72 -0
- latris-0.3.0/src/latris/__init__.py +1 -0
- latris-0.3.0/src/latris/__main__.py +4 -0
- latris-0.3.0/src/latris/_mutation_signal.py +34 -0
- latris-0.3.0/src/latris/ai/__init__.py +0 -0
- latris-0.3.0/src/latris/ai/adapters/__init__.py +43 -0
- latris-0.3.0/src/latris/ai/adapters/base.py +88 -0
- latris-0.3.0/src/latris/ai/adapters/litellm_adapter.py +272 -0
- latris-0.3.0/src/latris/ai/adapters/mock_adapter.py +105 -0
- latris-0.3.0/src/latris/ai/call.py +442 -0
- latris-0.3.0/src/latris/ai/chain_runner.py +155 -0
- latris-0.3.0/src/latris/ai/chains.py +121 -0
- latris-0.3.0/src/latris/ai/config.py +127 -0
- latris-0.3.0/src/latris/ai/context.py +2695 -0
- latris-0.3.0/src/latris/ai/credentials.py +145 -0
- latris-0.3.0/src/latris/ai/interactions.py +187 -0
- latris-0.3.0/src/latris/ai/prompts.py +1940 -0
- latris-0.3.0/src/latris/ai/proposals.py +1857 -0
- latris-0.3.0/src/latris/ai/render.py +412 -0
- latris-0.3.0/src/latris/ai/validate_urls.py +89 -0
- latris-0.3.0/src/latris/cli/__init__.py +0 -0
- latris-0.3.0/src/latris/cli/_errors.py +60 -0
- latris-0.3.0/src/latris/cli/ai_cmd.py +733 -0
- latris-0.3.0/src/latris/cli/analyse_cmd.py +220 -0
- latris-0.3.0/src/latris/cli/app.py +151 -0
- latris-0.3.0/src/latris/cli/attr_cmd.py +26 -0
- latris-0.3.0/src/latris/cli/bn_cmd.py +352 -0
- latris-0.3.0/src/latris/cli/challenge_cmd.py +119 -0
- latris-0.3.0/src/latris/cli/check_cmd.py +51 -0
- latris-0.3.0/src/latris/cli/completeness_cmd.py +139 -0
- latris-0.3.0/src/latris/cli/edge_cmd.py +65 -0
- latris-0.3.0/src/latris/cli/elicit_cmd.py +144 -0
- latris-0.3.0/src/latris/cli/evidence_cmd.py +39 -0
- latris-0.3.0/src/latris/cli/export_cmd.py +156 -0
- latris-0.3.0/src/latris/cli/fcm_cmd.py +112 -0
- latris-0.3.0/src/latris/cli/findings_cmd.py +125 -0
- latris-0.3.0/src/latris/cli/history_cmd.py +81 -0
- latris-0.3.0/src/latris/cli/init_cmd.py +48 -0
- latris-0.3.0/src/latris/cli/interpret_cmd.py +203 -0
- latris-0.3.0/src/latris/cli/lineage_cmd.py +237 -0
- latris-0.3.0/src/latris/cli/mapping_cmd.py +72 -0
- latris-0.3.0/src/latris/cli/maturity_cmd.py +49 -0
- latris-0.3.0/src/latris/cli/node_cmd.py +85 -0
- latris-0.3.0/src/latris/cli/project_cmd.py +113 -0
- latris-0.3.0/src/latris/cli/provenance_cmd.py +168 -0
- latris-0.3.0/src/latris/cli/ref_cmd.py +137 -0
- latris-0.3.0/src/latris/cli/review_cmd.py +36 -0
- latris-0.3.0/src/latris/cli/story_cmd.py +144 -0
- latris-0.3.0/src/latris/cli/sync_cmd.py +79 -0
- latris-0.3.0/src/latris/cli/view_cmd.py +30 -0
- latris-0.3.0/src/latris/diff/__init__.py +0 -0
- latris-0.3.0/src/latris/diff/semantic.py +680 -0
- latris-0.3.0/src/latris/exporters/__init__.py +0 -0
- latris-0.3.0/src/latris/exporters/_format.py +10 -0
- latris-0.3.0/src/latris/exporters/_scope.py +31 -0
- latris-0.3.0/src/latris/exporters/diagram.py +106 -0
- latris-0.3.0/src/latris/exporters/dot.py +92 -0
- latris-0.3.0/src/latris/exporters/markdown.py +728 -0
- latris-0.3.0/src/latris/exporters/narrative.py +302 -0
- latris-0.3.0/src/latris/exporters/packs.py +70 -0
- latris-0.3.0/src/latris/exporters/review_html.py +698 -0
- latris-0.3.0/src/latris/exporters/story_diagram.py +377 -0
- latris-0.3.0/src/latris/exporters/story_html.py +134 -0
- latris-0.3.0/src/latris/exporters/templates/story/story.html.jinja2 +91 -0
- latris-0.3.0/src/latris/exporters/templates/story/themes/default.css +63 -0
- latris-0.3.0/src/latris/exporters/templates/story/vendor/scrollama.min.js +1 -0
- latris-0.3.0/src/latris/exporters/word.py +538 -0
- latris-0.3.0/src/latris/operations/__init__.py +0 -0
- latris-0.3.0/src/latris/operations/_activations.py +93 -0
- latris-0.3.0/src/latris/operations/_actor.py +22 -0
- latris-0.3.0/src/latris/operations/_attribute_helpers.py +49 -0
- latris-0.3.0/src/latris/operations/_bn_canonical.py +103 -0
- latris-0.3.0/src/latris/operations/_bn_engine.py +125 -0
- latris-0.3.0/src/latris/operations/_chunking.py +162 -0
- latris-0.3.0/src/latris/operations/_data_engine.py +854 -0
- latris-0.3.0/src/latris/operations/_graph_checks.py +41 -0
- latris-0.3.0/src/latris/operations/_logs.py +22 -0
- latris-0.3.0/src/latris/operations/_resolve.py +75 -0
- latris-0.3.0/src/latris/operations/activation.py +63 -0
- latris-0.3.0/src/latris/operations/ai_bibliography.py +152 -0
- latris-0.3.0/src/latris/operations/analysis.py +134 -0
- latris-0.3.0/src/latris/operations/analysis_runs.py +128 -0
- latris-0.3.0/src/latris/operations/attributes.py +157 -0
- latris-0.3.0/src/latris/operations/batch.py +98 -0
- latris-0.3.0/src/latris/operations/bn.py +339 -0
- latris-0.3.0/src/latris/operations/bn_inference.py +97 -0
- latris-0.3.0/src/latris/operations/bn_learn.py +321 -0
- latris-0.3.0/src/latris/operations/bn_sensitivity.py +165 -0
- latris-0.3.0/src/latris/operations/challenges.py +157 -0
- latris-0.3.0/src/latris/operations/coherence_checks.py +234 -0
- latris-0.3.0/src/latris/operations/commit.py +89 -0
- latris-0.3.0/src/latris/operations/completeness.py +340 -0
- latris-0.3.0/src/latris/operations/compose.py +395 -0
- latris-0.3.0/src/latris/operations/configure.py +119 -0
- latris-0.3.0/src/latris/operations/datasets.py +658 -0
- latris-0.3.0/src/latris/operations/edges.py +101 -0
- latris-0.3.0/src/latris/operations/element_history.py +162 -0
- latris-0.3.0/src/latris/operations/elicitation.py +216 -0
- latris-0.3.0/src/latris/operations/evidence.py +277 -0
- latris-0.3.0/src/latris/operations/fcm_inference.py +196 -0
- latris-0.3.0/src/latris/operations/findings.py +683 -0
- latris-0.3.0/src/latris/operations/graph_analysis.py +792 -0
- latris-0.3.0/src/latris/operations/init.py +154 -0
- latris-0.3.0/src/latris/operations/interpret.py +815 -0
- latris-0.3.0/src/latris/operations/interpret_registry.py +176 -0
- latris-0.3.0/src/latris/operations/lineage.py +779 -0
- latris-0.3.0/src/latris/operations/mappings.py +130 -0
- latris-0.3.0/src/latris/operations/maturity.py +332 -0
- latris-0.3.0/src/latris/operations/nodes.py +121 -0
- latris-0.3.0/src/latris/operations/project.py +189 -0
- latris-0.3.0/src/latris/operations/provenance.py +261 -0
- latris-0.3.0/src/latris/operations/readiness.py +918 -0
- latris-0.3.0/src/latris/operations/references.py +659 -0
- latris-0.3.0/src/latris/operations/report_config.py +66 -0
- latris-0.3.0/src/latris/operations/review.py +213 -0
- latris-0.3.0/src/latris/operations/story.py +313 -0
- latris-0.3.0/src/latris/operations/sync.py +698 -0
- latris-0.3.0/src/latris/operations/view_attributes.py +127 -0
- latris-0.3.0/src/latris/operations/view_roles.py +74 -0
- latris-0.3.0/src/latris/operations/views.py +137 -0
- latris-0.3.0/src/latris/perf.py +98 -0
- latris-0.3.0/src/latris/repo/__init__.py +0 -0
- latris-0.3.0/src/latris/repo/git.py +547 -0
- latris-0.3.0/src/latris/repo/layout.py +331 -0
- latris-0.3.0/src/latris/repo/lineage_index.py +110 -0
- latris-0.3.0/src/latris/repo/project.py +36 -0
- latris-0.3.0/src/latris/repo/yaml_io.py +149 -0
- latris-0.3.0/src/latris/schema/__init__.py +297 -0
- latris-0.3.0/src/latris/schema/ai.py +91 -0
- latris-0.3.0/src/latris/schema/analysis.py +46 -0
- latris-0.3.0/src/latris/schema/attributes.py +182 -0
- latris-0.3.0/src/latris/schema/bn.py +227 -0
- latris-0.3.0/src/latris/schema/common.py +104 -0
- latris-0.3.0/src/latris/schema/completeness.py +60 -0
- latris-0.3.0/src/latris/schema/data_actions.py +91 -0
- latris-0.3.0/src/latris/schema/data_versions.py +38 -0
- latris-0.3.0/src/latris/schema/datasets.py +61 -0
- latris-0.3.0/src/latris/schema/elicitation.py +102 -0
- latris-0.3.0/src/latris/schema/findings.py +100 -0
- latris-0.3.0/src/latris/schema/ids.py +98 -0
- latris-0.3.0/src/latris/schema/interpretation.py +108 -0
- latris-0.3.0/src/latris/schema/layout_ui.py +27 -0
- latris-0.3.0/src/latris/schema/lineage.py +61 -0
- latris-0.3.0/src/latris/schema/maturity.py +37 -0
- latris-0.3.0/src/latris/schema/membership.py +33 -0
- latris-0.3.0/src/latris/schema/model_types.py +312 -0
- latris-0.3.0/src/latris/schema/project.py +30 -0
- latris-0.3.0/src/latris/schema/provenance.py +154 -0
- latris-0.3.0/src/latris/schema/references.py +55 -0
- latris-0.3.0/src/latris/schema/report_config.py +55 -0
- latris-0.3.0/src/latris/schema/review.py +88 -0
- latris-0.3.0/src/latris/schema/roles.py +31 -0
- latris-0.3.0/src/latris/schema/settings.py +67 -0
- latris-0.3.0/src/latris/schema/story.py +129 -0
- latris-0.3.0/src/latris/schema/substrate.py +171 -0
- latris-0.3.0/src/latris/schema/views.py +50 -0
- latris-0.3.0/src/latris/server/__init__.py +1 -0
- latris-0.3.0/src/latris/server/__main__.py +39 -0
- latris-0.3.0/src/latris/server/app.py +687 -0
- latris-0.3.0/src/latris/server/config.py +16 -0
- latris-0.3.0/src/latris/server/deps.py +26 -0
- latris-0.3.0/src/latris/server/entry.py +120 -0
- latris-0.3.0/src/latris/server/help.py +1236 -0
- latris-0.3.0/src/latris/server/perf.py +80 -0
- latris-0.3.0/src/latris/server/routes/__init__.py +1 -0
- latris-0.3.0/src/latris/server/routes/activity.py +20 -0
- latris-0.3.0/src/latris/server/routes/ai.py +484 -0
- latris-0.3.0/src/latris/server/routes/analysis.py +114 -0
- latris-0.3.0/src/latris/server/routes/annotations.py +94 -0
- latris-0.3.0/src/latris/server/routes/attributes.py +30 -0
- latris-0.3.0/src/latris/server/routes/bn.py +234 -0
- latris-0.3.0/src/latris/server/routes/challenges.py +59 -0
- latris-0.3.0/src/latris/server/routes/checks.py +35 -0
- latris-0.3.0/src/latris/server/routes/completeness.py +94 -0
- latris-0.3.0/src/latris/server/routes/compose.py +90 -0
- latris-0.3.0/src/latris/server/routes/configure.py +50 -0
- latris-0.3.0/src/latris/server/routes/datasets.py +213 -0
- latris-0.3.0/src/latris/server/routes/edges.py +49 -0
- latris-0.3.0/src/latris/server/routes/evidence.py +61 -0
- latris-0.3.0/src/latris/server/routes/export.py +86 -0
- latris-0.3.0/src/latris/server/routes/fcm.py +75 -0
- latris-0.3.0/src/latris/server/routes/findings.py +133 -0
- latris-0.3.0/src/latris/server/routes/help.py +28 -0
- latris-0.3.0/src/latris/server/routes/history.py +39 -0
- latris-0.3.0/src/latris/server/routes/interpret.py +190 -0
- latris-0.3.0/src/latris/server/routes/layout.py +38 -0
- latris-0.3.0/src/latris/server/routes/lineage.py +205 -0
- latris-0.3.0/src/latris/server/routes/model_choices.py +57 -0
- latris-0.3.0/src/latris/server/routes/model_types.py +40 -0
- latris-0.3.0/src/latris/server/routes/nodes.py +67 -0
- latris-0.3.0/src/latris/server/routes/provenance.py +111 -0
- latris-0.3.0/src/latris/server/routes/readiness.py +121 -0
- latris-0.3.0/src/latris/server/routes/references.py +152 -0
- latris-0.3.0/src/latris/server/routes/report_config.py +40 -0
- latris-0.3.0/src/latris/server/routes/review.py +31 -0
- latris-0.3.0/src/latris/server/routes/story.py +126 -0
- latris-0.3.0/src/latris/server/routes/sync.py +219 -0
- latris-0.3.0/src/latris/server/routes/view_attributes.py +49 -0
- latris-0.3.0/src/latris/server/routes/views.py +64 -0
- latris-0.3.0/src/latris/server/state.py +160 -0
- latris-0.3.0/src/latris/server/watch.py +133 -0
- latris-0.3.0/src/latris/sync/__init__.py +5 -0
- latris-0.3.0/src/latris/sync/askpass.py +54 -0
- latris-0.3.0/src/latris/sync/client.py +156 -0
- latris-0.3.0/src/latris/sync/credentials.py +112 -0
- latris-0.3.0/tests/__init__.py +0 -0
- latris-0.3.0/tests/ai/__init__.py +0 -0
- latris-0.3.0/tests/ai/evals/__init__.py +0 -0
- latris-0.3.0/tests/ai/evals/test_node_consistency.py +319 -0
- latris-0.3.0/tests/ai/test_call.py +338 -0
- latris-0.3.0/tests/ai/test_call_flow.py +571 -0
- latris-0.3.0/tests/ai/test_chains.py +151 -0
- latris-0.3.0/tests/ai/test_config.py +119 -0
- latris-0.3.0/tests/ai/test_context.py +619 -0
- latris-0.3.0/tests/ai/test_credentials.py +134 -0
- latris-0.3.0/tests/ai/test_draft_proposals.py +268 -0
- latris-0.3.0/tests/ai/test_interactions.py +227 -0
- latris-0.3.0/tests/ai/test_litellm_adapter.py +289 -0
- latris-0.3.0/tests/ai/test_mock_adapter.py +111 -0
- latris-0.3.0/tests/ai/test_prompt_contract.py +79 -0
- latris-0.3.0/tests/ai/test_prompts.py +210 -0
- latris-0.3.0/tests/ai/test_proposals.py +1299 -0
- latris-0.3.0/tests/ai/test_provenance_proposals.py +229 -0
- latris-0.3.0/tests/ai/test_recommend_approach.py +55 -0
- latris-0.3.0/tests/ai/test_secret_redaction.py +67 -0
- latris-0.3.0/tests/ai/test_smoke_prompts.py +492 -0
- latris-0.3.0/tests/ai/test_validate_urls.py +138 -0
- latris-0.3.0/tests/cli/__init__.py +0 -0
- latris-0.3.0/tests/cli/test_ai_cmd.py +104 -0
- latris-0.3.0/tests/cli/test_analyse_cli.py +136 -0
- latris-0.3.0/tests/cli/test_bn_canonical_cli.py +80 -0
- latris-0.3.0/tests/cli/test_bn_cli.py +100 -0
- latris-0.3.0/tests/cli/test_check_cmd.py +68 -0
- latris-0.3.0/tests/cli/test_cli_smoke.py +92 -0
- latris-0.3.0/tests/cli/test_edge_cmd.py +77 -0
- latris-0.3.0/tests/cli/test_errors.py +79 -0
- latris-0.3.0/tests/cli/test_fcm_cli.py +83 -0
- latris-0.3.0/tests/cli/test_history_cmd.py +96 -0
- latris-0.3.0/tests/cli/test_init_cmd.py +82 -0
- latris-0.3.0/tests/cli/test_mapping_cmd.py +92 -0
- latris-0.3.0/tests/cli/test_review_cmd.py +120 -0
- latris-0.3.0/tests/cli/test_story_cmd.py +157 -0
- latris-0.3.0/tests/cli/test_sync_cmd.py +150 -0
- latris-0.3.0/tests/conftest.py +177 -0
- latris-0.3.0/tests/diff/__init__.py +0 -0
- latris-0.3.0/tests/diff/test_semantic.py +225 -0
- latris-0.3.0/tests/exporters/__init__.py +0 -0
- latris-0.3.0/tests/exporters/test_diagram.py +170 -0
- latris-0.3.0/tests/exporters/test_dot.py +87 -0
- latris-0.3.0/tests/exporters/test_export_cli.py +68 -0
- latris-0.3.0/tests/exporters/test_markdown.py +230 -0
- latris-0.3.0/tests/exporters/test_narrative.py +123 -0
- latris-0.3.0/tests/exporters/test_packs.py +59 -0
- latris-0.3.0/tests/exporters/test_review_html.py +181 -0
- latris-0.3.0/tests/exporters/test_scope.py +90 -0
- latris-0.3.0/tests/exporters/test_story_diagram.py +77 -0
- latris-0.3.0/tests/exporters/test_story_html.py +114 -0
- latris-0.3.0/tests/exporters/test_word.py +106 -0
- latris-0.3.0/tests/integration/__init__.py +0 -0
- latris-0.3.0/tests/integration/test_full_stack.py +142 -0
- latris-0.3.0/tests/operations/__init__.py +0 -0
- latris-0.3.0/tests/operations/test_analysis_runs.py +63 -0
- latris-0.3.0/tests/operations/test_attribute_helpers.py +81 -0
- latris-0.3.0/tests/operations/test_attributes.py +73 -0
- latris-0.3.0/tests/operations/test_batch.py +145 -0
- latris-0.3.0/tests/operations/test_bn_canonical.py +155 -0
- latris-0.3.0/tests/operations/test_bn_inference.py +249 -0
- latris-0.3.0/tests/operations/test_bn_learn.py +137 -0
- latris-0.3.0/tests/operations/test_bn_readiness.py +130 -0
- latris-0.3.0/tests/operations/test_bn_sensitivity.py +105 -0
- latris-0.3.0/tests/operations/test_bn_spike.py +75 -0
- latris-0.3.0/tests/operations/test_bn_worked_example.py +117 -0
- latris-0.3.0/tests/operations/test_challenges.py +226 -0
- latris-0.3.0/tests/operations/test_chunking.py +107 -0
- latris-0.3.0/tests/operations/test_coherence_checks.py +157 -0
- latris-0.3.0/tests/operations/test_commit.py +169 -0
- latris-0.3.0/tests/operations/test_completeness.py +259 -0
- latris-0.3.0/tests/operations/test_compose.py +595 -0
- latris-0.3.0/tests/operations/test_configure.py +185 -0
- latris-0.3.0/tests/operations/test_data_evidence.py +72 -0
- latris-0.3.0/tests/operations/test_datasets.py +701 -0
- latris-0.3.0/tests/operations/test_elicitation.py +162 -0
- latris-0.3.0/tests/operations/test_fcm_inference.py +176 -0
- latris-0.3.0/tests/operations/test_fetch_reference.py +161 -0
- latris-0.3.0/tests/operations/test_findings.py +521 -0
- latris-0.3.0/tests/operations/test_graph_analysis.py +435 -0
- latris-0.3.0/tests/operations/test_graph_analysis_kind_filter.py +129 -0
- latris-0.3.0/tests/operations/test_graph_checks.py +52 -0
- latris-0.3.0/tests/operations/test_init.py +132 -0
- latris-0.3.0/tests/operations/test_interpret.py +458 -0
- latris-0.3.0/tests/operations/test_lineage.py +368 -0
- latris-0.3.0/tests/operations/test_mappings.py +86 -0
- latris-0.3.0/tests/operations/test_model_choices.py +142 -0
- latris-0.3.0/tests/operations/test_nodes_edges.py +166 -0
- latris-0.3.0/tests/operations/test_project_ops.py +36 -0
- latris-0.3.0/tests/operations/test_provenance.py +143 -0
- latris-0.3.0/tests/operations/test_readiness.py +412 -0
- latris-0.3.0/tests/operations/test_reconcile.py +105 -0
- latris-0.3.0/tests/operations/test_references_crud.py +591 -0
- latris-0.3.0/tests/operations/test_refs_evidence.py +167 -0
- latris-0.3.0/tests/operations/test_report_config.py +76 -0
- latris-0.3.0/tests/operations/test_resolve.py +144 -0
- latris-0.3.0/tests/operations/test_review.py +380 -0
- latris-0.3.0/tests/operations/test_review_scope.py +102 -0
- latris-0.3.0/tests/operations/test_story.py +131 -0
- latris-0.3.0/tests/operations/test_sync.py +164 -0
- latris-0.3.0/tests/operations/test_sync_conflict.py +55 -0
- latris-0.3.0/tests/operations/test_version_sync.py +115 -0
- latris-0.3.0/tests/operations/test_view_roles.py +66 -0
- latris-0.3.0/tests/operations/test_views.py +125 -0
- latris-0.3.0/tests/repo/__init__.py +0 -0
- latris-0.3.0/tests/repo/test_git.py +86 -0
- latris-0.3.0/tests/repo/test_git_branches.py +117 -0
- latris-0.3.0/tests/repo/test_git_remote.py +85 -0
- latris-0.3.0/tests/repo/test_revert.py +37 -0
- latris-0.3.0/tests/repo/test_yaml_io.py +296 -0
- latris-0.3.0/tests/schema/__init__.py +0 -0
- latris-0.3.0/tests/schema/test_atomic_write.py +35 -0
- latris-0.3.0/tests/schema/test_bn.py +96 -0
- latris-0.3.0/tests/schema/test_completeness.py +69 -0
- latris-0.3.0/tests/schema/test_ids.py +80 -0
- latris-0.3.0/tests/schema/test_interpretation.py +105 -0
- latris-0.3.0/tests/schema/test_kind_coercion.py +55 -0
- latris-0.3.0/tests/schema/test_maturity.py +45 -0
- latris-0.3.0/tests/schema/test_membership.py +33 -0
- latris-0.3.0/tests/schema/test_model_types.py +113 -0
- latris-0.3.0/tests/schema/test_provenance_axes.py +291 -0
- latris-0.3.0/tests/schema/test_review.py +184 -0
- latris-0.3.0/tests/schema/test_round_trip.py +719 -0
- latris-0.3.0/tests/schema/test_story.py +82 -0
- latris-0.3.0/tests/schema/test_utf8_windows.py +52 -0
- latris-0.3.0/tests/server/__init__.py +0 -0
- latris-0.3.0/tests/server/test_activity_routes.py +95 -0
- latris-0.3.0/tests/server/test_ai_preview.py +322 -0
- latris-0.3.0/tests/server/test_ai_routes.py +115 -0
- latris-0.3.0/tests/server/test_ai_routes_coverage.py +440 -0
- latris-0.3.0/tests/server/test_analysis_routes.py +120 -0
- latris-0.3.0/tests/server/test_annotations_readiness.py +77 -0
- latris-0.3.0/tests/server/test_annotations_routes.py +146 -0
- latris-0.3.0/tests/server/test_bn_routes.py +148 -0
- latris-0.3.0/tests/server/test_checks_routes.py +87 -0
- latris-0.3.0/tests/server/test_completeness_routes.py +194 -0
- latris-0.3.0/tests/server/test_configure_routes.py +112 -0
- latris-0.3.0/tests/server/test_datasets_routes.py +287 -0
- latris-0.3.0/tests/server/test_error_cases.py +144 -0
- latris-0.3.0/tests/server/test_export_routes.py +52 -0
- latris-0.3.0/tests/server/test_fcm_routes.py +99 -0
- latris-0.3.0/tests/server/test_findings_routes.py +171 -0
- latris-0.3.0/tests/server/test_help_routes.py +70 -0
- latris-0.3.0/tests/server/test_interpret_routes.py +331 -0
- latris-0.3.0/tests/server/test_layout_readiness_history.py +173 -0
- latris-0.3.0/tests/server/test_lineage_routes.py +185 -0
- latris-0.3.0/tests/server/test_model_types_routes.py +91 -0
- latris-0.3.0/tests/server/test_no_project_app.py +45 -0
- latris-0.3.0/tests/server/test_perf.py +147 -0
- latris-0.3.0/tests/server/test_provenance_routes.py +69 -0
- latris-0.3.0/tests/server/test_review_routes.py +132 -0
- latris-0.3.0/tests/server/test_routes.py +262 -0
- latris-0.3.0/tests/server/test_skeleton.py +151 -0
- latris-0.3.0/tests/server/test_state_contract.py +96 -0
- latris-0.3.0/tests/server/test_state_loader.py +133 -0
- latris-0.3.0/tests/server/test_story_routes.py +152 -0
- latris-0.3.0/tests/server/test_view_attributes_routes.py +89 -0
- latris-0.3.0/tests/server/test_views_routes.py +98 -0
- latris-0.3.0/tests/server/test_watch_unit.py +129 -0
- latris-0.3.0/tests/server/test_websocket.py +92 -0
- latris-0.3.0/tests/sync/test_askpass.py +31 -0
- latris-0.3.0/tests/sync/test_client.py +74 -0
- latris-0.3.0/tests/sync/test_credentials.py +64 -0
- latris-0.3.0/tests/test_worked_example.py +43 -0
- latris-0.3.0/worked_example/__init__.py +3 -0
- latris-0.3.0/worked_example/worked_example.py +1380 -0
- latris-0.3.0/worked_example/worked_example_output.md +1843 -0
latris-0.3.0/.gitignore
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual envs
|
|
24
|
+
venv/
|
|
25
|
+
.venv/
|
|
26
|
+
env/
|
|
27
|
+
.env
|
|
28
|
+
|
|
29
|
+
# IDE
|
|
30
|
+
.vscode/
|
|
31
|
+
.idea/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
|
|
35
|
+
# OS
|
|
36
|
+
.DS_Store
|
|
37
|
+
Thumbs.db
|
|
38
|
+
|
|
39
|
+
# Node
|
|
40
|
+
node_modules/
|
|
41
|
+
|
|
42
|
+
# Sample data
|
|
43
|
+
sample_data.csv
|
|
44
|
+
|
|
45
|
+
# Project
|
|
46
|
+
*.log
|
|
47
|
+
logs/
|
|
48
|
+
.coverage
|
|
49
|
+
htmlcov/
|
|
50
|
+
.pytest_cache/
|
|
51
|
+
.mypy_cache/
|
|
52
|
+
.ruff_cache/
|
|
53
|
+
.pytest-run/
|
|
54
|
+
.pytest-tmp/
|
|
55
|
+
.pytest-tmp-*/
|
|
56
|
+
pytest-cache-files-*/
|
|
57
|
+
|
|
58
|
+
# Claude Code local settings
|
|
59
|
+
.claude/
|
|
60
|
+
|
|
61
|
+
# Demo / scratch modelling projects (each has its own git repo)
|
|
62
|
+
projects/
|
|
63
|
+
demo-project/
|
|
64
|
+
|
|
65
|
+
# Build artefacts
|
|
66
|
+
dist/
|
|
67
|
+
|
|
68
|
+
# Inside an initialised modelling project (latris init):
|
|
69
|
+
# generated exports and layout files are not source of truth.
|
|
70
|
+
reports/exports/
|
|
71
|
+
layout/*.layout.yaml
|
|
72
|
+
# Per-reference full-text artefacts (Phase 4b retrieval). Derived
|
|
73
|
+
# content; the SourceSnapshot metadata in references.yaml is the
|
|
74
|
+
# git-tracked record of when/where it was fetched.
|
|
75
|
+
ai/reference-extracts/
|
latris-0.3.0/CLAUDE.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Context for AI coding agents working in this repository.
|
|
4
|
+
|
|
5
|
+
## What this is
|
|
6
|
+
|
|
7
|
+
**Latris** — an evidence-native modelling workbench. This repo is the
|
|
8
|
+
open-source core: the `latris` Python package (`src/latris/`), its CLI,
|
|
9
|
+
and the FastAPI + WebSocket server backend. The Latris desktop app is
|
|
10
|
+
built on this package from a separate private repository.
|
|
11
|
+
|
|
12
|
+
Start at [README.md](./README.md) and [docs/README.md](./docs/README.md).
|
|
13
|
+
|
|
14
|
+
## Where things live
|
|
15
|
+
|
|
16
|
+
- [`src/latris/`](./src/latris/) — the package. Layered:
|
|
17
|
+
`schema/` → `repo/` → `operations/` → `cli/`, plus `ai/` (LLM layer),
|
|
18
|
+
`diff/` (semantic diffs), `exporters/` (DOT, Markdown, Word, HTML
|
|
19
|
+
packs), `server/` (FastAPI + WebSocket backend), `sync/` (client for
|
|
20
|
+
the collaboration control plane — the service itself is separate and
|
|
21
|
+
proprietary; `sync.latris.app` is its public URL).
|
|
22
|
+
- [`tests/`](./tests/) — pytest suite mirroring the package layout.
|
|
23
|
+
Hermetic — env-var git identity and `LATRIS_AI_MOCK=1`; no network or
|
|
24
|
+
real keys required.
|
|
25
|
+
- [`worked_example/`](./worked_example/) — living worked example
|
|
26
|
+
(acceptance test) and generated transcript.
|
|
27
|
+
- [`docs/`](./docs/) — engineering reference. Start at
|
|
28
|
+
[docs/README.md](./docs/README.md).
|
|
29
|
+
- [`scripts/`](./scripts/) — `dev-server.sh` / `dev-stop.sh` (backend
|
|
30
|
+
process lifecycle for dev), `bump-version.sh` (version + tag).
|
|
31
|
+
|
|
32
|
+
## Working principles
|
|
33
|
+
|
|
34
|
+
- **Design docs are source of truth.** Architectural commitments live in
|
|
35
|
+
[`docs/engineering/`](./docs/engineering/): `ARCHITECTURE.md`
|
|
36
|
+
(three-layer architecture), `SCHEMA_NOTES.md` (schema shape),
|
|
37
|
+
`AI_LAYER.md` (AI contract), `GIT_INTEGRATION.md` (commit model),
|
|
38
|
+
`TESTING.md` (test strategy). Don't drift from them silently; if you
|
|
39
|
+
think one needs to change, propose it.
|
|
40
|
+
- **Schema before code-that-uses-schema.** New entities land as pydantic
|
|
41
|
+
models with round-trip tests before any operation depends on them.
|
|
42
|
+
- **No business logic in `cli/`.** A CLI command is one parse + one call
|
|
43
|
+
into `operations/` + one print. The server also imports
|
|
44
|
+
`operations/` directly.
|
|
45
|
+
- **Single chokepoints.** Five files own their concern: `repo/git.py`
|
|
46
|
+
(subprocess), `repo/yaml_io.py` (YAML), `repo/layout.py` (paths),
|
|
47
|
+
`operations/commit.py` (commits), `schema/ids.py` (IDs).
|
|
48
|
+
- **No AI-authored commits.** Even AI-proposed mutations commit as the
|
|
49
|
+
responsible human; AI involvement records to `ai/interactions.jsonl`
|
|
50
|
+
and the commit's `Provenance:` trailer.
|
|
51
|
+
- **No secrets on disk.** API keys live only in env vars or OS keyring;
|
|
52
|
+
`ai_config.yaml` is committed but rejects key-shaped fields
|
|
53
|
+
defensively.
|
|
54
|
+
- **Keep help topics current.** User-facing help lives in
|
|
55
|
+
`src/latris/server/help.py` (served at `/api/help/topics`). When you
|
|
56
|
+
add, rename, or change a workflow phase, model type, or user-facing
|
|
57
|
+
concept, update the relevant help topic body so documentation stays
|
|
58
|
+
accurate.
|
|
59
|
+
- **Commit after changes.** Commit work before finishing a session;
|
|
60
|
+
don't leave modified or untracked work uncommitted.
|
|
61
|
+
- **Frozen constants.** The per-project state directory `.graph-tooling`
|
|
62
|
+
and the keyring service name `latris-sync` are data-format constants —
|
|
63
|
+
renaming them breaks existing users' projects/credentials. Never
|
|
64
|
+
rename.
|
|
65
|
+
|
|
66
|
+
## Running tests
|
|
67
|
+
|
|
68
|
+
`python -m pytest` runs the suite in parallel by default (`-n auto`, via
|
|
69
|
+
`pytest-xdist`). For serial debugging — clean tracebacks, breakpoints,
|
|
70
|
+
deterministic output ordering — pass `-n0`. Targeted runs
|
|
71
|
+
(`pytest tests/ai/test_context.py`) are the inner-loop optimum.
|
|
72
|
+
See [docs/engineering/TESTING.md](./docs/engineering/TESTING.md).
|
|
73
|
+
|
|
74
|
+
## Worked example is the acceptance test
|
|
75
|
+
|
|
76
|
+
Every new CLI command or user-facing feature must be added to
|
|
77
|
+
[`worked_example/worked_example.py`](./worked_example/worked_example.py).
|
|
78
|
+
After adding, run `pytest tests/test_worked_example.py --slow` to
|
|
79
|
+
regenerate
|
|
80
|
+
[`worked_example/worked_example_output.md`](./worked_example/worked_example_output.md).
|
|
81
|
+
Commit both the script change and the updated transcript. A feature that
|
|
82
|
+
isn't in the worked example isn't done. The transcript is living
|
|
83
|
+
documentation — it always shows the tool's full current capabilities.
|
|
84
|
+
|
|
85
|
+
## Versioning
|
|
86
|
+
|
|
87
|
+
`src/latris/__init__.py` (`__version__`) is the single version string,
|
|
88
|
+
read by hatchling. Never edit it by hand — use the bump script:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
bash scripts/bump-version.sh 0.3.1 # bump + commit + tag
|
|
92
|
+
bash scripts/bump-version.sh 0.3.1 --no-tag # bump + commit only
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Pushing a `v*` tag triggers `.github/workflows/publish.yml`, which
|
|
96
|
+
publishes the package to PyPI. Remind the user to push tags after a
|
|
97
|
+
bump; confirm version numbers with them rather than choosing
|
|
98
|
+
unilaterally.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Contributing to Latris
|
|
2
|
+
|
|
3
|
+
Thanks for helping build Latris. This document is the short version; the
|
|
4
|
+
engineering docs under [`docs/engineering/`](docs/engineering/) are the
|
|
5
|
+
source of truth.
|
|
6
|
+
|
|
7
|
+
## Set up
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/Shannon-Bengtson/latris.git
|
|
11
|
+
cd latris
|
|
12
|
+
python -m venv .venv
|
|
13
|
+
# Windows: .venv\Scripts\activate — mac/linux: source .venv/bin/activate
|
|
14
|
+
pip install -e ".[server,data,dev]"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Requires Python 3.11+ and git 2.40+ with a configured `user.name` /
|
|
18
|
+
`user.email`.
|
|
19
|
+
|
|
20
|
+
## Before you open a PR
|
|
21
|
+
|
|
22
|
+
1. **Tests pass**: `python -m pytest` (parallel by default).
|
|
23
|
+
2. **Lint clean**: `python -m ruff check src tests`.
|
|
24
|
+
3. **Worked example updated** if you added or changed any CLI command or
|
|
25
|
+
user-facing feature: extend `worked_example/worked_example.py`, then
|
|
26
|
+
regenerate the transcript with
|
|
27
|
+
`pytest tests/test_worked_example.py --slow` and commit both. A
|
|
28
|
+
feature that isn't in the worked example isn't done.
|
|
29
|
+
|
|
30
|
+
## Ground rules
|
|
31
|
+
|
|
32
|
+
- No business logic in `cli/` — a command is one parse + one call into
|
|
33
|
+
`operations/` + one print.
|
|
34
|
+
- Respect the single chokepoints: `repo/git.py` (all subprocess),
|
|
35
|
+
`repo/yaml_io.py` (all YAML), `repo/layout.py` (all paths),
|
|
36
|
+
`operations/commit.py` (all commits), `schema/ids.py` (all IDs).
|
|
37
|
+
- No AI-authored commits; no secrets on disk (keys live in env vars or
|
|
38
|
+
the OS keyring).
|
|
39
|
+
- The per-project state directory `.graph-tooling` is a frozen
|
|
40
|
+
data-format constant — do not rename it.
|
|
41
|
+
- Layer discipline: `schema/` → `repo/` → `operations/` → `cli/`; never
|
|
42
|
+
import upward. `server/` sits beside `cli/` and consumes
|
|
43
|
+
`operations/`.
|
|
44
|
+
|
|
45
|
+
## Versioning
|
|
46
|
+
|
|
47
|
+
Never edit `src/latris/__init__.py` by hand — use
|
|
48
|
+
`bash scripts/bump-version.sh <version>` (bumps, commits, and tags;
|
|
49
|
+
pushing a `v*` tag triggers the PyPI publish workflow).
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
By contributing you agree that your contributions are licensed under the
|
|
54
|
+
[Apache-2.0 license](LICENSE) that covers the project.
|
latris-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright (c) 2026 Shannon Bengtson
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
latris-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: latris
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Latris — an AI-assisted, evidence-native causal-modelling workbench (Python CLI + server backend).
|
|
5
|
+
Project-URL: Homepage, https://latris.app
|
|
6
|
+
Project-URL: Repository, https://github.com/Shannon-Bengtson/latris
|
|
7
|
+
Author: Shannon Bengtson
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: bayesian,causal,cld,evidence,git,latris,modelling,provenance,systems-thinking
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Operating System :: MacOS
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Requires-Dist: bibtexparser<2,>=1.4
|
|
26
|
+
Requires-Dist: click>=8.2
|
|
27
|
+
Requires-Dist: httpx>=0.28
|
|
28
|
+
Requires-Dist: instructor>=1.3
|
|
29
|
+
Requires-Dist: jinja2>=3.1
|
|
30
|
+
Requires-Dist: keyring>=25
|
|
31
|
+
Requires-Dist: litellm>=1.40
|
|
32
|
+
Requires-Dist: pydantic>=2.6
|
|
33
|
+
Requires-Dist: python-docx>=1.1
|
|
34
|
+
Requires-Dist: python-ulid>=2.2
|
|
35
|
+
Requires-Dist: rich>=13.7
|
|
36
|
+
Requires-Dist: ruamel-yaml>=0.18
|
|
37
|
+
Requires-Dist: typer>=0.26
|
|
38
|
+
Provides-Extra: data
|
|
39
|
+
Requires-Dist: pandas>=2.0; extra == 'data'
|
|
40
|
+
Requires-Dist: scipy>=1.11; extra == 'data'
|
|
41
|
+
Provides-Extra: dev
|
|
42
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
43
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
44
|
+
Requires-Dist: pytest-rerunfailures>=14; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest-xdist>=3.5; extra == 'dev'
|
|
46
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
47
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
48
|
+
Provides-Extra: quant
|
|
49
|
+
Requires-Dist: pgmpy>=1.1; extra == 'quant'
|
|
50
|
+
Provides-Extra: server
|
|
51
|
+
Requires-Dist: fastapi>=0.115; extra == 'server'
|
|
52
|
+
Requires-Dist: pandas>=2.0; extra == 'server'
|
|
53
|
+
Requires-Dist: pgmpy>=1.1; extra == 'server'
|
|
54
|
+
Requires-Dist: python-multipart>=0.0.7; extra == 'server'
|
|
55
|
+
Requires-Dist: scipy>=1.11; extra == 'server'
|
|
56
|
+
Requires-Dist: uvicorn[standard]>=0.34; extra == 'server'
|
|
57
|
+
Requires-Dist: watchfiles>=1.0; extra == 'server'
|
|
58
|
+
Description-Content-Type: text/markdown
|
|
59
|
+
|
|
60
|
+
# Latris
|
|
61
|
+
|
|
62
|
+
**Structure for defensible reasoning.**
|
|
63
|
+
|
|
64
|
+
Latris is an evidence-native modelling workbench for building defensible
|
|
65
|
+
causal and systems models — structured provenance, challenge workflows,
|
|
66
|
+
git-native versioning, AI-assisted drafting under human approval, and
|
|
67
|
+
report generation.
|
|
68
|
+
|
|
69
|
+
This repository is the open-source core: the Python package (`latris`),
|
|
70
|
+
its CLI, and the FastAPI + WebSocket server backend. The Latris desktop
|
|
71
|
+
app (React + Electron) is built on top of this package from a separate
|
|
72
|
+
private repository.
|
|
73
|
+
|
|
74
|
+
- Every modelling project is a **git repo** — every change is an
|
|
75
|
+
inspectable, reversible commit.
|
|
76
|
+
- Evidence and provenance are **first-class data**, not annotations:
|
|
77
|
+
citations, assumptions, decisions, challenges, sign-offs.
|
|
78
|
+
- AI assistance returns **structured proposals**, never free-form
|
|
79
|
+
mutations; a human approves before anything commits.
|
|
80
|
+
- One substrate, many formalisms: qualitative CLD/DAG views today, a
|
|
81
|
+
built-in discrete **Bayesian Network engine** (state spaces, CPTs with
|
|
82
|
+
per-cell provenance, exact inference, parameter learning), and more
|
|
83
|
+
views on the architecture's path.
|
|
84
|
+
|
|
85
|
+
Status: **alpha** (0.3.0). Apache-2.0 licensed.
|
|
86
|
+
|
|
87
|
+
## Prerequisites
|
|
88
|
+
|
|
89
|
+
- **Python 3.11+** on PATH
|
|
90
|
+
- **git 2.40+** on PATH, with `user.name` and `user.email` configured
|
|
91
|
+
globally (Latris commits as you, and enforces that identity)
|
|
92
|
+
|
|
93
|
+
## Install
|
|
94
|
+
|
|
95
|
+
From PyPI (once published):
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pip install "latris[server,data]"
|
|
99
|
+
latris --version
|
|
100
|
+
latris doctor # verify git + identity
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
From source:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git clone https://github.com/Shannon-Bengtson/latris.git
|
|
107
|
+
cd latris
|
|
108
|
+
python -m venv .venv
|
|
109
|
+
# Windows: .venv\Scripts\activate — mac/linux: source .venv/bin/activate
|
|
110
|
+
pip install -e ".[server,data,dev]"
|
|
111
|
+
latris doctor
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Optional extras:
|
|
115
|
+
|
|
116
|
+
| Extra | Brings in | For |
|
|
117
|
+
|-------|-----------|-----|
|
|
118
|
+
| `server` | FastAPI, uvicorn, pandas, scipy, pgmpy | The API server (`python -m latris.server`) |
|
|
119
|
+
| `data` | pandas, scipy | Dataset wrangling and statistics |
|
|
120
|
+
| `quant` | pgmpy | Quantitative inference (also in `server`) |
|
|
121
|
+
| `dev` | pytest, xdist, ruff, build | Running the test suite |
|
|
122
|
+
|
|
123
|
+
## Quickstart
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# 1. Create a project (a git repo with the full model structure)
|
|
127
|
+
latris init air-quality --question "What drives urban air quality?"
|
|
128
|
+
|
|
129
|
+
cd air-quality
|
|
130
|
+
|
|
131
|
+
# 2. Build a model: nodes, then edges
|
|
132
|
+
latris node add "Traffic volume" --kind variable
|
|
133
|
+
latris node add "NO2 concentration" --kind variable
|
|
134
|
+
latris edge add <traffic-id> <no2-id> --kind causal
|
|
135
|
+
|
|
136
|
+
# 3. Inspect — every step above was a git commit
|
|
137
|
+
latris status
|
|
138
|
+
latris log
|
|
139
|
+
|
|
140
|
+
# 4. Export
|
|
141
|
+
latris export md --output reports/report.md
|
|
142
|
+
latris export dot --view cld --output reports/model.dot
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The full command catalogue is in
|
|
146
|
+
[`docs/engineering/CLI_REFERENCE.md`](docs/engineering/CLI_REFERENCE.md).
|
|
147
|
+
|
|
148
|
+
## Run the API server
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
python -m latris.server --project-root ./air-quality
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Serves the full CRUD/AI/export API on **http://127.0.0.1:8741** (the
|
|
155
|
+
same backend the Latris desktop app embeds). `--help` lists flags.
|
|
156
|
+
|
|
157
|
+
## AI layer (optional, bring your own key)
|
|
158
|
+
|
|
159
|
+
AI calls go through a vendor-agnostic adapter (litellm + instructor);
|
|
160
|
+
secrets live in your OS keyring, never on disk:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
latris ai key set anthropic # or openai / gemini / groq / ...
|
|
164
|
+
latris ai config show # default model lives in .graph-tooling/ai_config.yaml
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Set `LATRIS_AI_MOCK=1` to stub all AI calls (used by the test suite and
|
|
168
|
+
CI; the pre-rename `GRAPH_TOOLING_AI_MOCK` is still honoured for one
|
|
169
|
+
release).
|
|
170
|
+
|
|
171
|
+
## Tests
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
python -m pytest # full suite, parallel via pytest-xdist
|
|
175
|
+
python -m pytest -n0 # serial, for clean tracebacks
|
|
176
|
+
python -m pytest tests/test_worked_example.py --slow # acceptance test (regenerates the transcript)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Documentation
|
|
180
|
+
|
|
181
|
+
- [`docs/README.md`](docs/README.md) — documentation index
|
|
182
|
+
- [`docs/engineering/ARCHITECTURE.md`](docs/engineering/ARCHITECTURE.md) — how it's built
|
|
183
|
+
- [`docs/engineering/CLI_REFERENCE.md`](docs/engineering/CLI_REFERENCE.md) — command catalogue
|
|
184
|
+
- [`worked_example/worked_example_output.md`](worked_example/worked_example_output.md) — a full end-to-end session transcript
|
|
185
|
+
- [`llms.txt`](llms.txt) — machine-readable doc map for AI agents
|
|
186
|
+
|
|
187
|
+
## License
|
|
188
|
+
|
|
189
|
+
[Apache-2.0](LICENSE) — Copyright (c) 2026 Shannon Bengtson.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## For AI agents
|
|
194
|
+
|
|
195
|
+
You are working with **Latris**, an evidence-native causal-modelling
|
|
196
|
+
CLI + API server. Treat the engineering docs as the source of truth:
|
|
197
|
+
start from [`llms.txt`](llms.txt) and
|
|
198
|
+
[`docs/README.md`](docs/README.md).
|
|
199
|
+
|
|
200
|
+
Setup (one shot):
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
pip install "latris[server,data]"
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Minimal working session (init → node → edge → export → history):
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
latris init demo --question "Does X cause Y in context Z?"
|
|
210
|
+
cd demo
|
|
211
|
+
latris node add "X" --kind variable
|
|
212
|
+
latris node add "Y" --kind variable
|
|
213
|
+
latris edge add <x-id> <y-id> --kind causal # IDs from the node add output
|
|
214
|
+
latris export md --output reports/report.md
|
|
215
|
+
latris log # every mutation is a git commit
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
The complete, always-current demonstration of every command is the
|
|
219
|
+
worked example:
|
|
220
|
+
[`worked_example/worked_example_output.md`](worked_example/worked_example_output.md)
|
|
221
|
+
(generated by `worked_example/worked_example.py`; the generator is the
|
|
222
|
+
repo's acceptance test). Read it before asking the user how the tool
|
|
223
|
+
behaves — and after changing CLI behaviour, regenerate it
|
|
224
|
+
(`pytest tests/test_worked_example.py --slow`) and commit the updated
|
|
225
|
+
transcript.
|
|
226
|
+
|
|
227
|
+
Hard rules when modifying this repo: no business logic in `cli/` (one
|
|
228
|
+
parse + one call into `operations/` + one print); respect the five
|
|
229
|
+
chokepoints (`repo/git.py`, `repo/yaml_io.py`, `repo/layout.py`,
|
|
230
|
+
`operations/commit.py`, `schema/ids.py`); no AI-authored commits; no
|
|
231
|
+
secrets on disk. See [`CLAUDE.md`](CLAUDE.md) and
|
|
232
|
+
[`src/latris/CLAUDE.md`](src/latris/CLAUDE.md).
|