farna-control 0.3.335__py3-none-any.whl
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.
- farna/__init__.py +27 -0
- farna/_types.py +14 -0
- farna/api/__init__.py +0 -0
- farna/api/connector_team_gate.py +93 -0
- farna/api/constants.py +44 -0
- farna/api/db_error_handling.py +621 -0
- farna/api/db_error_reporting.py +74 -0
- farna/api/dependencies.py +1672 -0
- farna/api/exception_handlers.py +200 -0
- farna/api/frontend_url.py +39 -0
- farna/api/hitl_answer_validation.py +150 -0
- farna/api/main.py +1631 -0
- farna/api/mcp_audit.py +365 -0
- farna/api/mcp_server.py +4039 -0
- farna/api/mcp_tool_registry.py +50 -0
- farna/api/mcp_tools/__init__.py +16 -0
- farna/api/mcp_tools/_patch_surface.py +401 -0
- farna/api/mcp_tools/admin.py +1205 -0
- farna/api/mcp_tools/agents.py +483 -0
- farna/api/mcp_tools/analytics.py +471 -0
- farna/api/mcp_tools/connectors.py +825 -0
- farna/api/mcp_tools/evals.py +925 -0
- farna/api/mcp_tools/hitl.py +1386 -0
- farna/api/mcp_tools/library.py +423 -0
- farna/api/mcp_tools/parameters.py +822 -0
- farna/api/mcp_tools/pipelines.py +2855 -0
- farna/api/mcp_tools/runs.py +998 -0
- farna/api/mcp_tools/schema_registry.py +552 -0
- farna/api/mcp_tools/secrets_api_keys.py +739 -0
- farna/api/mcp_tools/triggers.py +1210 -0
- farna/api/middleware/__init__.py +27 -0
- farna/api/middleware/catch_all.py +133 -0
- farna/api/middleware/correlation_id.py +38 -0
- farna/api/middleware/cors_logging.py +49 -0
- farna/api/middleware/csrf.py +98 -0
- farna/api/middleware/deprecation_headers.py +113 -0
- farna/api/middleware/host_origin.py +100 -0
- farna/api/middleware/query_guard.py +77 -0
- farna/api/middleware/rate_limiter.py +573 -0
- farna/api/middleware/request_id.py +11 -0
- farna/api/middleware/request_timeout.py +64 -0
- farna/api/middleware/security_headers.py +68 -0
- farna/api/middleware/sensitive_mask.py +670 -0
- farna/api/models/__init__.py +23 -0
- farna/api/models/error.py +149 -0
- farna/api/models/error_forwarder_config.py +71 -0
- farna/api/models/error_notification_rule.py +90 -0
- farna/api/models/problem.py +279 -0
- farna/api/models/team_visibility.py +24 -0
- farna/api/openapi.py +99 -0
- farna/api/pagination_params.py +97 -0
- farna/api/permission_router.py +59 -0
- farna/api/routes/__init__.py +0 -0
- farna/api/routes/_connector_team_gate.py +70 -0
- farna/api/routes/_org_settings.py +90 -0
- farna/api/routes/_trigger_events.py +84 -0
- farna/api/routes/activity_reports.py +228 -0
- farna/api/routes/admin.py +4865 -0
- farna/api/routes/admin_assistant.py +732 -0
- farna/api/routes/admin_capacity.py +67 -0
- farna/api/routes/admin_dev_mode.py +78 -0
- farna/api/routes/admin_email.py +372 -0
- farna/api/routes/admin_evidence_retention.py +320 -0
- farna/api/routes/admin_feature_flags.py +858 -0
- farna/api/routes/admin_housekeeping.py +358 -0
- farna/api/routes/admin_license.py +757 -0
- farna/api/routes/admin_monitor_config.py +165 -0
- farna/api/routes/admin_notifications.py +1428 -0
- farna/api/routes/admin_org_feature_flags.py +261 -0
- farna/api/routes/admin_org_mcp_authority.py +192 -0
- farna/api/routes/admin_orgs.py +1057 -0
- farna/api/routes/admin_rate_limits.py +72 -0
- farna/api/routes/admin_rotation.py +421 -0
- farna/api/routes/admin_run_retention.py +442 -0
- farna/api/routes/admin_runtime_config.py +234 -0
- farna/api/routes/admin_sso.py +1025 -0
- farna/api/routes/admin_system_audit.py +169 -0
- farna/api/routes/admin_system_config.py +188 -0
- farna/api/routes/admin_tiers.py +87 -0
- farna/api/routes/admin_triggers.py +326 -0
- farna/api/routes/agents.py +1438 -0
- farna/api/routes/air_gap.py +171 -0
- farna/api/routes/analytics.py +1107 -0
- farna/api/routes/api_keys.py +955 -0
- farna/api/routes/assistant.py +1470 -0
- farna/api/routes/audit.py +557 -0
- farna/api/routes/auth.py +1885 -0
- farna/api/routes/compliance.py +183 -0
- farna/api/routes/composite_templates.py +777 -0
- farna/api/routes/connectors.py +1311 -0
- farna/api/routes/contributions.py +370 -0
- farna/api/routes/cost_components.py +396 -0
- farna/api/routes/costs.py +1457 -0
- farna/api/routes/dashboard.py +1050 -0
- farna/api/routes/deployment.py +110 -0
- farna/api/routes/determination.py +618 -0
- farna/api/routes/environment_profiles.py +917 -0
- farna/api/routes/error_forwarder_config.py +622 -0
- farna/api/routes/error_notification_rules.py +401 -0
- farna/api/routes/errors.py +1127 -0
- farna/api/routes/evals.py +4273 -0
- farna/api/routes/events.py +318 -0
- farna/api/routes/evidence.py +898 -0
- farna/api/routes/external_agents.py +332 -0
- farna/api/routes/feedback.py +1206 -0
- farna/api/routes/guardrail_config.py +883 -0
- farna/api/routes/health.py +1987 -0
- farna/api/routes/hitl.py +2206 -0
- farna/api/routes/in_app_notifications.py +786 -0
- farna/api/routes/library.py +4707 -0
- farna/api/routes/lifecycle_maps.py +1846 -0
- farna/api/routes/manifest.py +15 -0
- farna/api/routes/mcp_oauth.py +786 -0
- farna/api/routes/mcp_servers.py +530 -0
- farna/api/routes/mcp_setup.py +173 -0
- farna/api/routes/me.py +585 -0
- farna/api/routes/metrics.py +223 -0
- farna/api/routes/metrics_ingest.py +313 -0
- farna/api/routes/model_backends.py +2025 -0
- farna/api/routes/node_categories.py +400 -0
- farna/api/routes/notifications.py +458 -0
- farna/api/routes/oauth_metadata.py +185 -0
- farna/api/routes/observability.py +433 -0
- farna/api/routes/onboarding.py +573 -0
- farna/api/routes/org_login.py +271 -0
- farna/api/routes/org_settings.py +141 -0
- farna/api/routes/parameter_schemas.py +1129 -0
- farna/api/routes/pipeline_folders.py +202 -0
- farna/api/routes/pipelines.py +7248 -0
- farna/api/routes/plugins.py +109 -0
- farna/api/routes/product_analytics.py +348 -0
- farna/api/routes/product_analytics_identity.py +438 -0
- farna/api/routes/product_analytics_transparency.py +387 -0
- farna/api/routes/registry.py +720 -0
- farna/api/routes/run_ws.py +236 -0
- farna/api/routes/runners.py +439 -0
- farna/api/routes/runs.py +5208 -0
- farna/api/routes/schema_folders.py +209 -0
- farna/api/routes/schemas.py +1693 -0
- farna/api/routes/scim.py +1430 -0
- farna/api/routes/service_accounts.py +687 -0
- farna/api/routes/slack.py +712 -0
- farna/api/routes/sso.py +1178 -0
- farna/api/routes/stripe_webhook.py +1164 -0
- farna/api/routes/system_maps.py +2606 -0
- farna/api/routes/teams.py +1258 -0
- farna/api/routes/templates.py +441 -0
- farna/api/routes/triggers.py +2099 -0
- farna/api/routes/variant_batches.py +660 -0
- farna/api/routes/variants.py +962 -0
- farna/api/routes/viewmodel.py +734 -0
- farna/api/routes/webhooks.py +2269 -0
- farna/api/run_scope.py +160 -0
- farna/api/schemas/system_maps.py +537 -0
- farna/api/team_scope.py +671 -0
- farna/api/trigger_busy.py +238 -0
- farna/api/viewmodel/__init__.py +0 -0
- farna/auth/__init__.py +6 -0
- farna/auth/api_key.py +759 -0
- farna/auth/dependencies.py +557 -0
- farna/auth/human_linkage.py +255 -0
- farna/auth/jwt.py +421 -0
- farna/auth/log_redaction.py +15 -0
- farna/auth/oauth.py +1220 -0
- farna/auth/oidc_verify.py +327 -0
- farna/auth/passwords.py +87 -0
- farna/auth/permissions.py +688 -0
- farna/auth/saml_handler.py +258 -0
- farna/auth/scim_auth.py +125 -0
- farna/auth/secret_storage.py +280 -0
- farna/auth/sso.py +1682 -0
- farna/auth/team_rbac.py +57 -0
- farna/auth/ws_token.py +74 -0
- farna/cli/__init__.py +64 -0
- farna/cli/apply/__init__.py +306 -0
- farna/cli/apply/drift.py +428 -0
- farna/cli/apply/executor.py +1256 -0
- farna/cli/apply/loader.py +61 -0
- farna/cli/apply/models.py +1877 -0
- farna/cli/apply/pipeline_apply.py +677 -0
- farna/cli/apply/plan.py +353 -0
- farna/cli/apply/system_map_apply.py +205 -0
- farna/cli/apply/trigger_apply.py +313 -0
- farna/cli/backfill_model_backend_base_url.py +556 -0
- farna/cli/backup.py +3033 -0
- farna/cli/break_glass.py +933 -0
- farna/cli/evidence.py +245 -0
- farna/cli/main.py +816 -0
- farna/cli/migrate.py +691 -0
- farna/cli/migrate_org.py +662 -0
- farna/cli/users.py +508 -0
- farna/compliance/__init__.py +46 -0
- farna/compliance/artifacts.py +173 -0
- farna/compliance/evidence_index.py +766 -0
- farna/compliance/mappings/__init__.py +5 -0
- farna/compliance/mappings/eu-ai-act.yaml +94 -0
- farna/compliance/mappings/iso-42001.yaml +104 -0
- farna/compliance/mappings/pack.yaml +34 -0
- farna/compliance/mappings/soc2.yaml +164 -0
- farna/compliance/pack.py +402 -0
- farna/connectors/__init__.py +0 -0
- farna/connectors/_ci_test_double.py +90 -0
- farna/connectors/_egress.py +56 -0
- farna/connectors/_rate_bucket.py +378 -0
- farna/connectors/_retry_headers.py +300 -0
- farna/connectors/_safe_cursor.py +25 -0
- farna/connectors/_safe_datetime.py +30 -0
- farna/connectors/_safe_int.py +40 -0
- farna/connectors/_safe_page.py +86 -0
- farna/connectors/asana/__init__.py +226 -0
- farna/connectors/azure_key_vault/__init__.py +264 -0
- farna/connectors/azure_pipelines/__init__.py +478 -0
- farna/connectors/azure_repos/__init__.py +274 -0
- farna/connectors/base.py +1189 -0
- farna/connectors/bitbucket/__init__.py +238 -0
- farna/connectors/buildkite/__init__.py +385 -0
- farna/connectors/ci_runner/__init__.py +13 -0
- farna/connectors/ci_runner/base.py +93 -0
- farna/connectors/ci_runner/github_actions.py +438 -0
- farna/connectors/ci_runner/gitlab_ci.py +301 -0
- farna/connectors/ci_runner/woodpecker.py +637 -0
- farna/connectors/circleci/__init__.py +333 -0
- farna/connectors/codeclimate/__init__.py +193 -0
- farna/connectors/confluence/__init__.py +238 -0
- farna/connectors/datadog/__init__.py +243 -0
- farna/connectors/discord/__init__.py +171 -0
- farna/connectors/dropbox_paper/__init__.py +179 -0
- farna/connectors/filesystem/__init__.py +107 -0
- farna/connectors/gitea/__init__.py +234 -0
- farna/connectors/github/__init__.py +1928 -0
- farna/connectors/gitlab/__init__.py +1500 -0
- farna/connectors/grafana/__init__.py +266 -0
- farna/connectors/jenkins/__init__.py +520 -0
- farna/connectors/jira/__init__.py +802 -0
- farna/connectors/linear/__init__.py +465 -0
- farna/connectors/microsoft_teams/__init__.py +257 -0
- farna/connectors/monday/__init__.py +315 -0
- farna/connectors/n8n/__init__.py +347 -0
- farna/connectors/notion/__init__.py +244 -0
- farna/connectors/npm/__init__.py +165 -0
- farna/connectors/onepassword/__init__.py +244 -0
- farna/connectors/opsgenie/__init__.py +346 -0
- farna/connectors/pagerduty/__init__.py +336 -0
- farna/connectors/plane/__init__.py +388 -0
- farna/connectors/pypi/__init__.py +162 -0
- farna/connectors/rest/__init__.py +2083 -0
- farna/connectors/rest/rest_metrics.py +195 -0
- farna/connectors/rest/rest_rollback.py +142 -0
- farna/connectors/security.py +363 -0
- farna/connectors/sentry/__init__.py +228 -0
- farna/connectors/sharepoint/__init__.py +229 -0
- farna/connectors/shell/__init__.py +395 -0
- farna/connectors/shortcut/__init__.py +194 -0
- farna/connectors/slack/__init__.py +591 -0
- farna/connectors/snyk/__init__.py +299 -0
- farna/connectors/sonarqube/__init__.py +373 -0
- farna/connectors/teamcity/__init__.py +324 -0
- farna/connectors/ticket_tracker/__init__.py +3 -0
- farna/connectors/ticket_tracker/base.py +114 -0
- farna/connectors/ticket_tracker/github.py +183 -0
- farna/connectors/ticket_tracker/trello.py +326 -0
- farna/connectors/trello/__init__.py +210 -0
- farna/connectors/youtrack/__init__.py +204 -0
- farna/core/__init__.py +5 -0
- farna/core/agent_command_sync.py +208 -0
- farna/core/agent_event_evidence.py +242 -0
- farna/core/agent_return_legacy.py +175 -0
- farna/core/air_gap.py +434 -0
- farna/core/alert_context.py +153 -0
- farna/core/alert_dispatch.py +69 -0
- farna/core/analytics/__init__.py +650 -0
- farna/core/analytics/builder.py +1143 -0
- farna/core/analytics/capacity.py +1151 -0
- farna/core/analytics/enforcement_sweep.py +141 -0
- farna/core/analytics/facts_window.py +77 -0
- farna/core/analytics/guardrails.py +608 -0
- farna/core/analytics/maintenance.py +715 -0
- farna/core/analytics/metrics.py +132 -0
- farna/core/analytics/service.py +1094 -0
- farna/core/artifacts/__init__.py +18 -0
- farna/core/artifacts/gc.py +81 -0
- farna/core/artifacts/store.py +419 -0
- farna/core/artifacts/streaming.py +286 -0
- farna/core/artifacts/writer.py +182 -0
- farna/core/assistant/__init__.py +0 -0
- farna/core/assistant/config_service.py +117 -0
- farna/core/assistant/context_source_service.py +170 -0
- farna/core/assistant/redis_registry.py +20 -0
- farna/core/assistant/skill_loader.py +300 -0
- farna/core/audit_coverage.py +709 -0
- farna/core/audit_logger/__init__.py +726 -0
- farna/core/audit_logger/append_only.py +64 -0
- farna/core/audit_logger/background.py +424 -0
- farna/core/audit_logger/hashing.py +69 -0
- farna/core/audit_logger/labels.py +87 -0
- farna/core/bundled_runner/__init__.py +25 -0
- farna/core/bundled_runner/health_probe.py +574 -0
- farna/core/bundled_runner/profile.py +64 -0
- farna/core/bundled_runner/runner_dispatch.py +2394 -0
- farna/core/bundled_runner/runner_reconciler.py +913 -0
- farna/core/capability_scope.py +587 -0
- farna/core/capacity_alerts.py +1479 -0
- farna/core/capacity_providers/__init__.py +75 -0
- farna/core/capacity_providers/fly.py +216 -0
- farna/core/cleanup_jobs/__init__.py +5 -0
- farna/core/cleanup_jobs/trigger_events_cleanup.py +67 -0
- farna/core/cleanup_jobs/webhook_dedup_cleanup.py +102 -0
- farna/core/composite_engine/__init__.py +20 -0
- farna/core/composite_engine/composite_binding.py +56 -0
- farna/core/composite_engine/expander.py +844 -0
- farna/core/composite_engine/schema_mapping.py +64 -0
- farna/core/connector_hub/__init__.py +1463 -0
- farna/core/connector_hub/health_sweep.py +308 -0
- farna/core/connector_hub/locking.py +188 -0
- farna/core/connector_refs.py +20 -0
- farna/core/cost_controller/__init__.py +1222 -0
- farna/core/cost_controller/breakdown/__init__.py +71 -0
- farna/core/cost_controller/breakdown/aggregate.py +415 -0
- farna/core/cost_controller/breakdown/constants.py +96 -0
- farna/core/cost_controller/breakdown/formula.py +292 -0
- farna/core/cost_controller/breakdown/metrics.py +266 -0
- farna/core/cost_controller/breakdown/params.py +664 -0
- farna/core/cost_controller/finalize.py +4335 -0
- farna/core/cost_controller/org_auto_pause.py +170 -0
- farna/core/cost_controller/probe.py +486 -0
- farna/core/cost_controller/system_config.py +68 -0
- farna/core/cost_settings.py +18 -0
- farna/core/credential_issuer.py +283 -0
- farna/core/cron_helpers.py +12319 -0
- farna/core/crypto/__init__.py +195 -0
- farna/core/demo.py +30 -0
- farna/core/dispatch.py +926 -0
- farna/core/dispatch_phases.py +60 -0
- farna/core/documentation_indexer.py +150 -0
- farna/core/egress_metrics.py +152 -0
- farna/core/email_service.py +213 -0
- farna/core/entitlements.py +263 -0
- farna/core/error_tracking/__init__.py +1173 -0
- farna/core/error_tracking/alert_dispatcher.py +415 -0
- farna/core/error_tracking/alerting.py +415 -0
- farna/core/error_tracking/forwarders/__init__.py +70 -0
- farna/core/error_tracking/forwarders/base.py +24 -0
- farna/core/error_tracking/forwarders/datadog.py +91 -0
- farna/core/error_tracking/forwarders/loki.py +103 -0
- farna/core/error_tracking/forwarders/opsgenie.py +106 -0
- farna/core/error_tracking/forwarders/pagerduty.py +102 -0
- farna/core/error_tracking/forwarders/rollbar.py +93 -0
- farna/core/error_tracking/forwarders/sentry.py +178 -0
- farna/core/error_tracking/metrics.py +410 -0
- farna/core/error_tracking/saq_hooks.py +432 -0
- farna/core/eval/finding_resolver.py +372 -0
- farna/core/eval/mute_policy.py +182 -0
- farna/core/eval_engine/__init__.py +1144 -0
- farna/core/eval_engine/author_warnings.py +427 -0
- farna/core/eval_engine/changed_sets.py +427 -0
- farna/core/eval_engine/coverage_gap.py +597 -0
- farna/core/eval_engine/decision_reconcile.py +227 -0
- farna/core/eval_engine/discovery_eval.py +239 -0
- farna/core/eval_engine/discovery_judge.py +27 -0
- farna/core/eval_engine/eval_definition_write.py +735 -0
- farna/core/eval_engine/evidence_layer.py +258 -0
- farna/core/eval_engine/execute_suite_run.py +1165 -0
- farna/core/eval_engine/human_eval_sets.py +341 -0
- farna/core/eval_engine/okr.py +302 -0
- farna/core/eval_engine/policy_gate.py +398 -0
- farna/core/eval_engine/regression.py +422 -0
- farna/core/eval_engine/suite_run.py +1007 -0
- farna/core/eval_engine/suite_run_judge.py +175 -0
- farna/core/eval_engine/typed_judge/__init__.py +109 -0
- farna/core/eval_engine/typed_judge/bridge.py +206 -0
- farna/core/eval_engine/typed_judge/config.py +376 -0
- farna/core/eval_engine/typed_judge/envelope.py +1055 -0
- farna/core/eval_engine/typed_judge/errors.py +98 -0
- farna/core/eval_engine/typed_judge/legacy.py +151 -0
- farna/core/eval_engine/typed_judge/naming.py +106 -0
- farna/core/eval_engine/typed_judge/transport.py +434 -0
- farna/core/event_dedup.py +261 -0
- farna/core/events/__init__.py +29 -0
- farna/core/events/event_bus.py +236 -0
- farna/core/events/listeners.py +387 -0
- farna/core/events/notification_events.py +90 -0
- farna/core/events/redis_broker.py +219 -0
- farna/core/events/relay.py +409 -0
- farna/core/events/worker_subscription.py +122 -0
- farna/core/evidence_pack/__init__.py +55 -0
- farna/core/evidence_pack/build.py +102 -0
- farna/core/evidence_pack/canonical.py +61 -0
- farna/core/evidence_pack/chain.py +148 -0
- farna/core/evidence_pack/manifest.py +73 -0
- farna/core/evidence_pack/signing.py +129 -0
- farna/core/evidence_pack/verify.py +285 -0
- farna/core/evidence_redaction.py +210 -0
- farna/core/evidence_retention.py +315 -0
- farna/core/exceptions.py +146 -0
- farna/core/feature_flags.py +1164 -0
- farna/core/feedback_manager/__init__.py +869 -0
- farna/core/feedback_manager/exceptions.py +32 -0
- farna/core/feedback_manager/queries.py +161 -0
- farna/core/feedback_manager/single_node_correction.py +347 -0
- farna/core/feedback_manager/status.py +100 -0
- farna/core/fernet_rotation.py +433 -0
- farna/core/graceful_shutdown.py +126 -0
- farna/core/graph_validator/__init__.py +3960 -0
- farna/core/graph_validator/_types.py +50 -0
- farna/core/graph_validator/category_validator.py +141 -0
- farna/core/graph_validator/mask_sentinel.py +184 -0
- farna/core/guardrails/__init__.py +1976 -0
- farna/core/guardrails/compensation.py +395 -0
- farna/core/guardrails/config.py +646 -0
- farna/core/guardrails/conformance.py +1039 -0
- farna/core/guardrails/correction.py +1564 -0
- farna/core/guardrails/coverage.py +418 -0
- farna/core/guardrails/finding_resolver.py +26 -0
- farna/core/guardrails/kill_switch_drill.py +208 -0
- farna/core/guardrails/loop_intercept.py +1048 -0
- farna/core/guardrails/materialise.py +221 -0
- farna/core/guardrails/mute_policy.py +22 -0
- farna/core/guardrails/output_intercept.py +187 -0
- farna/core/guardrails/packs/__init__.py +13 -0
- farna/core/guardrails/packs/soc2.py +222 -0
- farna/core/guardrails/policy_pack.py +370 -0
- farna/core/guardrails/redaction_mode.py +126 -0
- farna/core/guardrails/sandbox_bridge.py +480 -0
- farna/core/health_alerts.py +1224 -0
- farna/core/hitl_email_alerts.py +477 -0
- farna/core/hitl_manager/__init__.py +1581 -0
- farna/core/hitl_manager/deadline_warning.py +627 -0
- farna/core/hitl_manager/expiry_job.py +327 -0
- farna/core/hitl_manager/gate_coalescing.py +353 -0
- farna/core/hitl_manager/overdue_warning.py +274 -0
- farna/core/hitl_manager/review_expiry.py +244 -0
- farna/core/hitl_manager/sweep_alarm.py +318 -0
- farna/core/housekeeping.py +1386 -0
- farna/core/library/__init__.py +145 -0
- farna/core/library/agents/__init__.py +53 -0
- farna/core/library/agents/definitions.py +1591 -0
- farna/core/library/branch_fixer.py +1049 -0
- farna/core/library/complexity_reviewer.py +90 -0
- farna/core/library/integrations/__init__.py +53 -0
- farna/core/library/integrations/definitions.py +896 -0
- farna/core/library/risk_tiered_review.py +1182 -0
- farna/core/library/workflows/__init__.py +35 -0
- farna/core/library/workflows/definitions.py +792 -0
- farna/core/library_service/__init__.py +1065 -0
- farna/core/library_service/_seed_data.py +2124 -0
- farna/core/library_service/grant.py +74 -0
- farna/core/library_service/install.py +2793 -0
- farna/core/library_service/primitive_types.py +50 -0
- farna/core/library_service/runnability.py +350 -0
- farna/core/library_service/uninstall.py +369 -0
- farna/core/library_service/upgrade.py +1110 -0
- farna/core/licence_gate/__init__.py +119 -0
- farna/core/licence_gate/baseline.py +365 -0
- farna/core/licence_gate/content.py +269 -0
- farna/core/licence_gate/errors.py +35 -0
- farna/core/licence_gate/policy.py +223 -0
- farna/core/licence_gate/scanner.py +426 -0
- farna/core/licence_gate/verdict.py +292 -0
- farna/core/license.py +1017 -0
- farna/core/license_bootstrap.py +130 -0
- farna/core/license_signing.py +267 -0
- farna/core/lifecycle_map/__init__.py +0 -0
- farna/core/lifecycle_map/advancement.py +763 -0
- farna/core/lifecycle_map/import_export.py +351 -0
- farna/core/lifecycle_map/journeys.py +444 -0
- farna/core/lifecycle_map/reconcile.py +704 -0
- farna/core/lifecycle_map/self_report.py +165 -0
- farna/core/lifecycle_map/service.py +332 -0
- farna/core/lifecycle_map/validation.py +449 -0
- farna/core/line_diff.py +82 -0
- farna/core/logging_config.py +321 -0
- farna/core/manifest.py +92 -0
- farna/core/mcp/__init__.py +4 -0
- farna/core/mcp/scope_validator.py +921 -0
- farna/core/mcp/tool_pinning.py +252 -0
- farna/core/mcp_setup_handoff/__init__.py +102 -0
- farna/core/model_backend_endpoints.py +200 -0
- farna/core/model_backend_hub/__init__.py +1056 -0
- farna/core/model_backend_presets.py +70 -0
- farna/core/model_class_registry.py +440 -0
- farna/core/node_output_split.py +637 -0
- farna/core/notifier/__init__.py +1046 -0
- farna/core/notifier/event_mapper.py +604 -0
- farna/core/path_safety.py +29 -0
- farna/core/pipeline_decay_alerts.py +765 -0
- farna/core/pipeline_engine/__init__.py +41 -0
- farna/core/pipeline_engine/ancestor_refs.py +115 -0
- farna/core/pipeline_engine/classify.py +1544 -0
- farna/core/pipeline_engine/connector_write_factory.py +57 -0
- farna/core/pipeline_engine/decorator.py +361 -0
- farna/core/pipeline_engine/egress.py +414 -0
- farna/core/pipeline_engine/error_codes.py +1531 -0
- farna/core/pipeline_engine/errors.py +53 -0
- farna/core/pipeline_engine/eval_persist_order.py +683 -0
- farna/core/pipeline_engine/event_broker.py +227 -0
- farna/core/pipeline_engine/evidence.py +900 -0
- farna/core/pipeline_engine/executor.py +1551 -0
- farna/core/pipeline_engine/executor_parts/__init__.py +42 -0
- farna/core/pipeline_engine/executor_parts/admission.py +1054 -0
- farna/core/pipeline_engine/executor_parts/finalize.py +871 -0
- farna/core/pipeline_engine/executor_parts/hitl.py +519 -0
- farna/core/pipeline_engine/executor_parts/hubs.py +571 -0
- farna/core/pipeline_engine/executor_parts/outcomes.py +591 -0
- farna/core/pipeline_engine/executor_parts/run_execute.py +2750 -0
- farna/core/pipeline_engine/executor_parts/run_shape.py +983 -0
- farna/core/pipeline_engine/executor_parts/streaming.py +753 -0
- farna/core/pipeline_engine/executor_parts/support.py +506 -0
- farna/core/pipeline_engine/executor_parts/telemetry.py +301 -0
- farna/core/pipeline_engine/failure_context.py +182 -0
- farna/core/pipeline_engine/git_content.py +873 -0
- farna/core/pipeline_engine/graph_cache.py +1955 -0
- farna/core/pipeline_engine/hitl_context.py +1019 -0
- farna/core/pipeline_engine/idempotency.py +270 -0
- farna/core/pipeline_engine/input_truncation.py +28 -0
- farna/core/pipeline_engine/jmespath_eval.py +92 -0
- farna/core/pipeline_engine/llm_judge.py +587 -0
- farna/core/pipeline_engine/model_backend_errors.py +201 -0
- farna/core/pipeline_engine/modulo_saver.py +947 -0
- farna/core/pipeline_engine/node_runner.py +16566 -0
- farna/core/pipeline_engine/output_filter.py +133 -0
- farna/core/pipeline_engine/port_resolver.py +271 -0
- farna/core/pipeline_engine/publish_review_node.py +291 -0
- farna/core/pipeline_engine/recovery.py +864 -0
- farna/core/pipeline_engine/retry_compensation.py +740 -0
- farna/core/pipeline_engine/retry_policy.py +1239 -0
- farna/core/pipeline_engine/runaway_protection.py +117 -0
- farna/core/pipeline_engine/runtime_retry.py +655 -0
- farna/core/pipeline_engine/sandbox_errors.py +43 -0
- farna/core/pipeline_engine/sandbox_mode.py +772 -0
- farna/core/pipeline_engine/sandbox_policy.py +1545 -0
- farna/core/pipeline_engine/scatter_join.py +456 -0
- farna/core/pipeline_engine/schema_enforcement.py +379 -0
- farna/core/pipeline_engine/schema_repair.py +663 -0
- farna/core/pipeline_engine/terminal_publisher.py +251 -0
- farna/core/pipeline_engine/triage_apply_node.py +376 -0
- farna/core/pipeline_engine/watchdog_retry.py +656 -0
- farna/core/pipeline_engine/workspace_input_audit.py +332 -0
- farna/core/pipeline_engine/workspace_input_credentials.py +461 -0
- farna/core/pipeline_engine/workspace_input_orchestration.py +759 -0
- farna/core/pipeline_engine/workspace_inputs.py +171 -0
- farna/core/pipeline_engine/workspace_ssh.py +470 -0
- farna/core/pipeline_execution.py +5170 -0
- farna/core/pipeline_impact.py +521 -0
- farna/core/plugin_registry/__init__.py +492 -0
- farna/core/pricing.py +86 -0
- farna/core/principals.py +104 -0
- farna/core/product_analytics/__init__.py +10 -0
- farna/core/product_analytics/consent.py +335 -0
- farna/core/product_analytics/constants.py +98 -0
- farna/core/product_analytics/hmac_verify.py +114 -0
- farna/core/product_analytics/instance_identity.py +106 -0
- farna/core/product_analytics/metrics_constants.py +52 -0
- farna/core/product_analytics/metrics_dump.py +781 -0
- farna/core/product_analytics/vendor_client.py +459 -0
- farna/core/prompt_optimizer/__init__.py +262 -0
- farna/core/provenance.py +101 -0
- farna/core/rate_limiter.py +252 -0
- farna/core/registry/__init__.py +753 -0
- farna/core/registry/crypto.py +97 -0
- farna/core/release_channels.py +112 -0
- farna/core/reports/__init__.py +74 -0
- farna/core/reports/activity_report.py +543 -0
- farna/core/reports/cost_report.py +91 -0
- farna/core/reports/email_delivery.py +49 -0
- farna/core/reports/quality_report.py +383 -0
- farna/core/reports/scheduler.py +1057 -0
- farna/core/reports/weekly_digest.py +668 -0
- farna/core/retry_budget.py +164 -0
- farna/core/review_publish.py +418 -0
- farna/core/rollback_thresholds.py +314 -0
- farna/core/run_admission.py +1471 -0
- farna/core/run_context/__init__.py +47 -0
- farna/core/run_context/autonomy.py +384 -0
- farna/core/run_context/autonomy_telemetry.py +275 -0
- farna/core/run_log_correlation.py +263 -0
- farna/core/run_outputs_dualwrite.py +320 -0
- farna/core/run_provenance.py +69 -0
- farna/core/run_teardown.py +299 -0
- farna/core/run_terminal_advance.py +286 -0
- farna/core/runner_bindings.py +289 -0
- farna/core/runner_capacity.py +1863 -0
- farna/core/runtime_config/__init__.py +62 -0
- farna/core/runtime_config/key_bridge.py +181 -0
- farna/core/runtime_config/mint_budget.py +205 -0
- farna/core/runtime_config/org_flags.py +149 -0
- farna/core/runtime_config/store.py +293 -0
- farna/core/runtime_config/telemetry_bridge.py +83 -0
- farna/core/runtime_provider/__init__.py +942 -0
- farna/core/runtime_provider/base.py +5 -0
- farna/core/runtime_provider/docker.py +844 -0
- farna/core/runtime_provider/e2b.py +1092 -0
- farna/core/runtime_provider/endpoint_tls.py +150 -0
- farna/core/runtime_provider/hub.py +268 -0
- farna/core/runtime_provider/k8s.py +1311 -0
- farna/core/runtime_provider/local.py +229 -0
- farna/core/runtime_provider/local_docker.py +150 -0
- farna/core/runtime_provider/log_tail.py +47 -0
- farna/core/sanitize_log.py +15 -0
- farna/core/saq_worker.py +3272 -0
- farna/core/schema_registry/__init__.py +89 -0
- farna/core/schema_registry/_common.py +149 -0
- farna/core/schema_registry/contract.py +632 -0
- farna/core/schema_registry/generation.py +96 -0
- farna/core/schema_registry/inference.py +214 -0
- farna/core/schema_registry/migration.py +659 -0
- farna/core/schema_registry/rendering.py +729 -0
- farna/core/schema_registry/sanitize.py +120 -0
- farna/core/schema_registry/validation.py +251 -0
- farna/core/secret_patterns.py +359 -0
- farna/core/secrets_backend/__init__.py +186 -0
- farna/core/secrets_backend/aws.py +200 -0
- farna/core/secrets_backend/fernet.py +219 -0
- farna/core/secrets_backend/references.py +194 -0
- farna/core/secrets_backend/vault.py +209 -0
- farna/core/seed_data/__init__.py +0 -0
- farna/core/seed_data/catalog.py +43 -0
- farna/core/seed_data/cost_components.py +141 -0
- farna/core/seed_data/demo_data.py +334 -0
- farna/core/seed_data/library_schemas.py +690 -0
- farna/core/spend_ceiling.py +219 -0
- farna/core/sso_presets.py +133 -0
- farna/core/ssrf.py +1750 -0
- farna/core/stdout_retention.py +85 -0
- farna/core/stripe_fulfilment.py +608 -0
- farna/core/system_audit_logger.py +86 -0
- farna/core/system_map_persistence.py +174 -0
- farna/core/system_map_validation.py +55 -0
- farna/core/system_maps_ai_discovery.py +291 -0
- farna/core/system_maps_discovery.py +236 -0
- farna/core/team_visibility.py +468 -0
- farna/core/triage.py +613 -0
- farna/core/trigger_engine/__init__.py +2604 -0
- farna/core/trigger_engine/agent_signal.py +538 -0
- farna/core/trigger_engine/polling.py +472 -0
- farna/core/trigger_engine/pre_guardrail.py +215 -0
- farna/core/trigger_engine/slack_app_mention.py +595 -0
- farna/core/trigger_engine/tracker_intake.py +506 -0
- farna/core/trigger_engine/work_selector.py +236 -0
- farna/core/trigger_secrets.py +108 -0
- farna/core/trigger_streak.py +2285 -0
- farna/core/trigger_validation.py +123 -0
- farna/core/validation_level.py +212 -0
- farna/core/watchdog/__init__.py +22 -0
- farna/core/watchdog/worker_liveness.py +742 -0
- farna/core/work_item_enrichment.py +326 -0
- farna/core/worker_handoff.py +829 -0
- farna/core/worker_memory.py +187 -0
- farna/core/workflow_import_export/__init__.py +2520 -0
- farna/core/workspace_labels.py +83 -0
- farna/db/__init__.py +11 -0
- farna/db/alignment.py +245 -0
- farna/db/background.py +158 -0
- farna/db/bootstrap.py +179 -0
- farna/db/bootstrap_role.py +755 -0
- farna/db/bundled_runner_template.py +254 -0
- farna/db/capacity.py +454 -0
- farna/db/crud/__init__.py +1 -0
- farna/db/crud/_gate_advisory_lock.py +83 -0
- farna/db/crud/account.py +206 -0
- farna/db/crud/activity_report.py +87 -0
- farna/db/crud/agent.py +422 -0
- farna/db/crud/agent_runner_binding.py +216 -0
- farna/db/crud/base.py +55 -0
- farna/db/crud/break_glass_deny.py +133 -0
- farna/db/crud/composite_template.py +125 -0
- farna/db/crud/connector_instance.py +214 -0
- farna/db/crud/cost_component.py +179 -0
- farna/db/crud/daily_run_count.py +121 -0
- farna/db/crud/digest_report.py +58 -0
- farna/db/crud/environment_profile.py +304 -0
- farna/db/crud/error_tracking.py +353 -0
- farna/db/crud/eval_run.py +100 -0
- farna/db/crud/external_agent.py +113 -0
- farna/db/crud/folder_tree.py +106 -0
- farna/db/crud/guardrail_config.py +84 -0
- farna/db/crud/hitl_review_config.py +859 -0
- farna/db/crud/hitl_review_guard.py +799 -0
- farna/db/crud/invitations.py +213 -0
- farna/db/crud/last_admin_guard.py +126 -0
- farna/db/crud/library_primitive.py +531 -0
- farna/db/crud/mcp_server.py +117 -0
- farna/db/crud/model_backend.py +375 -0
- farna/db/crud/node_category.py +197 -0
- farna/db/crud/node_composite.py +42 -0
- farna/db/crud/node_observation.py +63 -0
- farna/db/crud/notifications.py +744 -0
- farna/db/crud/observability.py +69 -0
- farna/db/crud/org_deletion.py +770 -0
- farna/db/crud/org_membership.py +170 -0
- farna/db/crud/organisation.py +974 -0
- farna/db/crud/organisation_cost_state.py +104 -0
- farna/db/crud/pagination.py +169 -0
- farna/db/crud/parameter_schema.py +169 -0
- farna/db/crud/parameter_set.py +180 -0
- farna/db/crud/pipeline.py +2537 -0
- farna/db/crud/pipeline_folder.py +115 -0
- farna/db/crud/pipeline_owner.py +148 -0
- farna/db/crud/pipeline_snapshot.py +1345 -0
- farna/db/crud/pipeline_snapshot_versioning.py +896 -0
- farna/db/crud/policy_gate_decision.py +103 -0
- farna/db/crud/publisher.py +139 -0
- farna/db/crud/rating.py +304 -0
- farna/db/crud/row_lock.py +80 -0
- farna/db/crud/run.py +5602 -0
- farna/db/crud/run_attempts.py +218 -0
- farna/db/crud/run_node_outputs.py +1702 -0
- farna/db/crud/run_retention.py +1097 -0
- farna/db/crud/runner_probe.py +155 -0
- farna/db/crud/scheduled_report.py +167 -0
- farna/db/crud/schema.py +274 -0
- farna/db/crud/schema_folder.py +122 -0
- farna/db/crud/scim.py +296 -0
- farna/db/crud/spend_anomaly.py +109 -0
- farna/db/crud/sso_provider.py +450 -0
- farna/db/crud/system_audit_event.py +91 -0
- farna/db/crud/system_config.py +138 -0
- farna/db/crud/team.py +254 -0
- farna/db/crud/team_membership.py +111 -0
- farna/db/crud/team_scope.py +379 -0
- farna/db/crud/template.py +109 -0
- farna/db/crud/tier_catalog.py +50 -0
- farna/db/crud/token_family.py +193 -0
- farna/db/crud/trigger.py +193 -0
- farna/db/crud/user.py +5 -0
- farna/db/crud/variant_group.py +1019 -0
- farna/db/enums.py +32 -0
- farna/db/health_checks.py +95 -0
- farna/db/lifecycle_refs.py +322 -0
- farna/db/migration_guard.py +154 -0
- farna/db/migrations/README.md +81 -0
- farna/db/migrations/__init__.py +1 -0
- farna/db/migrations/_lock_state.py +31 -0
- farna/db/migrations/_rls_ceremony.py +36 -0
- farna/db/migrations/env.py +779 -0
- farna/db/migrations/script.py.mako +25 -0
- farna/db/migrations/versions/0350_baseline_schema.py +10905 -0
- farna/db/migrations/versions/0351_baseline_rls.py +2859 -0
- farna/db/migrations/versions/0352_baseline_privileges.py +316 -0
- farna/db/migrations/versions/0353_baseline_seed_data.py +36 -0
- farna/db/migrations/versions/0354_policy_gate_reason.py +17 -0
- farna/db/migrations/versions/0355_drop_library_sync_state.py +60 -0
- farna/db/migrations/versions/0356_soft_delete_community_library_primitives.py +61 -0
- farna/db/migrations/versions/0357_rebrand_library_seed_copy.py +150 -0
- farna/db/migrations/versions/0358_community_flag_tiers.py +47 -0
- farna/db/migrations/versions/0359_registry_sourced_drop_index.py +31 -0
- farna/db/migrations/versions/0360_free_schema_history_retire_pipeline_delete.py +54 -0
- farna/db/migrations/versions/0362_rename_legacy_db_objects.py +166 -0
- farna/db/migrations/versions/0363_lower_operational_flag_tiers.py +66 -0
- farna/db/migrations/versions/0364_rewrite_legacy_persisted_values.py +387 -0
- farna/db/migrations/versions/0365_runs_family_owner_team.py +598 -0
- farna/db/migrations/versions/0366_onboarding_progress_rls_setting.py +64 -0
- farna/db/migrations/versions/0367_scoped_bootstrap_pre_auth_policies.py +110 -0
- farna/db/migrations/versions/0368_invitations_quarantine_rls.py +157 -0
- farna/db/migrations/versions/0369_pipeline_family_owner_team.py +178 -0
- farna/db/migrations/versions/0370_redact_error_detail_tracebacks.py +304 -0
- farna/db/migrations/versions/0371_hitl_claims_revision.py +57 -0
- farna/db/migrations/versions/0372_collection_install_owner_team.py +72 -0
- farna/db/migrations/versions/0373_licence_gate.py +193 -0
- farna/db/models/__init__.py +249 -0
- farna/db/models/account.py +101 -0
- farna/db/models/agent.py +84 -0
- farna/db/models/agent_runner_binding.py +38 -0
- farna/db/models/api_key.py +67 -0
- farna/db/models/assistant_context_source.py +52 -0
- farna/db/models/assistant_message.py +42 -0
- farna/db/models/assistant_session.py +24 -0
- farna/db/models/assistant_skill.py +50 -0
- farna/db/models/audit_event.py +72 -0
- farna/db/models/base.py +112 -0
- farna/db/models/collection_install.py +180 -0
- farna/db/models/composite_template.py +40 -0
- farna/db/models/connector_instance.py +52 -0
- farna/db/models/connector_profile.py +67 -0
- farna/db/models/cost_component.py +66 -0
- farna/db/models/daily_run_count.py +48 -0
- farna/db/models/environment_profile.py +92 -0
- farna/db/models/error_event.py +35 -0
- farna/db/models/error_forwarder_config.py +26 -0
- farna/db/models/error_group.py +32 -0
- farna/db/models/error_notification_rule.py +75 -0
- farna/db/models/eval.py +95 -0
- farna/db/models/eval_dataset.py +164 -0
- farna/db/models/eval_result.py +144 -0
- farna/db/models/eval_suite.py +94 -0
- farna/db/models/eval_suite_run.py +291 -0
- farna/db/models/evidence.py +83 -0
- farna/db/models/evidence_redaction_rule.py +73 -0
- farna/db/models/external_agent.py +66 -0
- farna/db/models/feedback_record.py +64 -0
- farna/db/models/hitl_claim.py +139 -0
- farna/db/models/invitation.py +84 -0
- farna/db/models/journey.py +87 -0
- farna/db/models/library_primitive.py +149 -0
- farna/db/models/licence_gate.py +214 -0
- farna/db/models/lifecycle_map.py +53 -0
- farna/db/models/lifecycle_map_stage.py +45 -0
- farna/db/models/mcp_server.py +94 -0
- farna/db/models/mcp_setup_token.py +24 -0
- farna/db/models/metrics_staging.py +47 -0
- farna/db/models/model_backend.py +47 -0
- farna/db/models/node.py +72 -0
- farna/db/models/node_category.py +28 -0
- farna/db/models/node_observation.py +26 -0
- farna/db/models/notification.py +142 -0
- farna/db/models/notification_delivery.py +32 -0
- farna/db/models/notification_endpoint.py +23 -0
- farna/db/models/oauth_client.py +31 -0
- farna/db/models/oauth_token.py +147 -0
- farna/db/models/onboarding_progress.py +29 -0
- farna/db/models/org_membership.py +41 -0
- farna/db/models/organisation.py +121 -0
- farna/db/models/organisation_cost_state.py +62 -0
- farna/db/models/parameter_schema.py +26 -0
- farna/db/models/parameter_set.py +28 -0
- farna/db/models/pipeline.py +224 -0
- farna/db/models/pipeline_edge.py +74 -0
- farna/db/models/pipeline_folder.py +23 -0
- farna/db/models/pipeline_snapshot.py +134 -0
- farna/db/models/policy_gate.py +125 -0
- farna/db/models/policy_gate_decision.py +113 -0
- farna/db/models/primitive_abuse_report.py +34 -0
- farna/db/models/primitive_rating.py +25 -0
- farna/db/models/publisher.py +34 -0
- farna/db/models/run.py +742 -0
- farna/db/models/run_attempt.py +157 -0
- farna/db/models/run_daily_facts.py +254 -0
- farna/db/models/run_evidence.py +56 -0
- farna/db/models/run_node_outputs.py +187 -0
- farna/db/models/runner_probe_cache.py +47 -0
- farna/db/models/scheduled_report.py +56 -0
- farna/db/models/schema.py +64 -0
- farna/db/models/secret.py +12 -0
- farna/db/models/snapshot_schema_pin.py +31 -0
- farna/db/models/spend_anomaly.py +37 -0
- farna/db/models/sso_provider.py +39 -0
- farna/db/models/system_audit_event.py +72 -0
- farna/db/models/system_config.py +23 -0
- farna/db/models/system_map.py +405 -0
- farna/db/models/team.py +28 -0
- farna/db/models/team_membership.py +18 -0
- farna/db/models/tier_catalog.py +24 -0
- farna/db/models/token_family.py +40 -0
- farna/db/models/trigger.py +119 -0
- farna/db/models/trigger_event.py +90 -0
- farna/db/models/trigger_event_finding.py +71 -0
- farna/db/models/variant_batch_state.py +49 -0
- farna/db/models/variant_group.py +51 -0
- farna/db/models/web_vital_event.py +36 -0
- farna/db/models/webhook.py +31 -0
- farna/db/pipeline_ownership.py +188 -0
- farna/db/plain_dump.py +392 -0
- farna/db/repositories/__init__.py +82 -0
- farna/db/repositories/base.py +97 -0
- farna/db/repositories/evidence.py +8 -0
- farna/db/repositories/generic.py +41 -0
- farna/db/repositories/locks.py +190 -0
- farna/db/repositories/postgres.py +21 -0
- farna/db/repositories/system_map.py +2045 -0
- farna/db/rls.py +624 -0
- farna/db/rls_tripwire.py +214 -0
- farna/db/run_ownership.py +58 -0
- farna/db/runner_binding_constraints.py +137 -0
- farna/db/seed.py +500 -0
- farna/db/seed_demo.py +3408 -0
- farna/db/session.py +181 -0
- farna/db/settings_resolver.py +169 -0
- farna/db/soft_delete.py +109 -0
- farna/db/sqlstates.py +240 -0
- farna/db/tenant_scope.py +408 -0
- farna/db/unique_violation.py +28 -0
- farna/db/url_utils.py +301 -0
- farna/determination/__init__.py +12 -0
- farna/determination/comparison.py +535 -0
- farna/determination/draft.py +198 -0
- farna/determination/inference.py +465 -0
- farna/determination/models.py +126 -0
- farna/determination/rerun.py +488 -0
- farna/determination/review.py +248 -0
- farna/determination/scanner.py +205 -0
- farna/launcher/__init__.py +10 -0
- farna/launcher/config_source.py +427 -0
- farna/launcher/doctor.py +2069 -0
- farna/launcher/doctor_report.py +92 -0
- farna/launcher/entry.py +1154 -0
- farna/launcher/env_contract.py +92 -0
- farna/launcher/env_safety.py +192 -0
- farna/launcher/evidence_key.py +290 -0
- farna/launcher/initdb.py +387 -0
- farna/launcher/manifest.py +436 -0
- farna/launcher/platform.py +89 -0
- farna/launcher/policy.py +148 -0
- farna/launcher/runtime_config.py +88 -0
- farna/launcher/secrets_file.py +184 -0
- farna/launcher/service.py +545 -0
- farna/launcher/state.py +241 -0
- farna/launcher/supervisor.py +2753 -0
- farna/launcher/upgrade.py +2668 -0
- farna/lifecycle.py +522 -0
- farna/model_backends/__init__.py +60 -0
- farna/model_backends/ai21/__init__.py +16 -0
- farna/model_backends/anthropic/__init__.py +124 -0
- farna/model_backends/azure_openai/__init__.py +67 -0
- farna/model_backends/base.py +389 -0
- farna/model_backends/bedrock/__init__.py +41 -0
- farna/model_backends/cohere/__init__.py +62 -0
- farna/model_backends/deepseek/__init__.py +14 -0
- farna/model_backends/fireworks/__init__.py +16 -0
- farna/model_backends/gemini/__init__.py +73 -0
- farna/model_backends/grok/__init__.py +14 -0
- farna/model_backends/groq/__init__.py +16 -0
- farna/model_backends/jan/__init__.py +22 -0
- farna/model_backends/llamacpp/__init__.py +22 -0
- farna/model_backends/lm_studio/__init__.py +22 -0
- farna/model_backends/localai/__init__.py +22 -0
- farna/model_backends/mistral/__init__.py +72 -0
- farna/model_backends/module.py +170 -0
- farna/model_backends/ollama/__init__.py +22 -0
- farna/model_backends/openai/__init__.py +3 -0
- farna/model_backends/opencode/__init__.py +70 -0
- farna/model_backends/openrouter/__init__.py +14 -0
- farna/model_backends/perplexity/__init__.py +16 -0
- farna/model_backends/qwen/__init__.py +14 -0
- farna/model_backends/stub/__init__.py +7 -0
- farna/model_backends/stub/backend.py +105 -0
- farna/model_backends/tgi/__init__.py +22 -0
- farna/model_backends/togetherai/__init__.py +16 -0
- farna/model_backends/vertexai/__init__.py +41 -0
- farna/model_backends/vllm/__init__.py +22 -0
- farna/model_backends/watsonx/__init__.py +43 -0
- farna/otel_bridge/__init__.py +53 -0
- farna/otel_bridge/export.py +693 -0
- farna/otel_bridge/handler.py +655 -0
- farna/otel_bridge/trace_id.py +53 -0
- farna/settings.py +1880 -0
- farna/support/__init__.py +44 -0
- farna/support/bundle.py +1650 -0
- farna/support/redaction.py +412 -0
- farna/tools/__init__.py +1 -0
- farna/util/__init__.py +151 -0
- farna/util/one_time_token.py +26 -0
- farna/util/uuid.py +37 -0
- farna/utils/__init__.py +8 -0
- farna/utils/uuid.py +5 -0
- farna/version.py +76 -0
- farna_control-0.3.335.dist-info/METADATA +98 -0
- farna_control-0.3.335.dist-info/RECORD +949 -0
- farna_control-0.3.335.dist-info/WHEEL +4 -0
- farna_control-0.3.335.dist-info/entry_points.txt +2 -0
- farna_control-0.3.335.dist-info/licenses/LICENSE +19 -0
farna/__init__.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""Modulo package root.
|
|
2
|
+
|
|
3
|
+
Exports the package version and build tag for runtime inspection.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
|
|
8
|
+
from farna.version import get_version
|
|
9
|
+
|
|
10
|
+
__version__ = get_version()
|
|
11
|
+
|
|
12
|
+
_SHORT_SHA_LENGTH = 7
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def get_build_tag() -> str:
|
|
16
|
+
"""Return the short build tag derived from ``GIT_SHA``.
|
|
17
|
+
|
|
18
|
+
Uses the first 7 characters when a full SHA is available, otherwise
|
|
19
|
+
falls back to ``"build-local-dev"`` for local development.
|
|
20
|
+
"""
|
|
21
|
+
sha = os.environ.get("GIT_SHA", "")
|
|
22
|
+
if len(sha) >= _SHORT_SHA_LENGTH:
|
|
23
|
+
return f"build-{sha[:_SHORT_SHA_LENGTH]}"
|
|
24
|
+
return "build-local-dev"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
__build_tag__ = get_build_tag()
|
farna/_types.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Shared lightweight type aliases reused across modulo packages.
|
|
2
|
+
|
|
3
|
+
Centralised so connector and core payload-parsing code does not redeclare the
|
|
4
|
+
same ``dict[str, Any]`` / ``list[dict[str, Any]]`` aliases in every module.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
__all__ = ["_DICT_STR_ANY", "_LIST_DICT_STR_ANY"]
|
|
12
|
+
|
|
13
|
+
type _DICT_STR_ANY = dict[str, Any]
|
|
14
|
+
type _LIST_DICT_STR_ANY = list[dict[str, Any]]
|
farna/api/__init__.py
ADDED
|
File without changes
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""Shared HTTP connector-team gate for route write paths (FAR-1515, FAR-1618).
|
|
2
|
+
|
|
3
|
+
``farna.core.team_visibility`` owns the team-visibility predicate and the
|
|
4
|
+
``ConnectorBindingMissingError`` / mismatch-detail machinery, but it is pure
|
|
5
|
+
logic — it never raises an HTTP error. Every graph-write route that persists
|
|
6
|
+
connector bindings must convert that outcome into the SAME named 409
|
|
7
|
+
``connector_team_mismatch`` inside its own transaction (FAR-1515 MAJOR 4), so
|
|
8
|
+
the refusal rolls the whole write back instead of leaving half-created
|
|
9
|
+
entities. This module is the single HTTP-level wrapper every one of those
|
|
10
|
+
routes delegates to — pipeline graph saves
|
|
11
|
+
(``routes.pipelines._enforce_connector_team_bindings``), trigger connector
|
|
12
|
+
scope (``routes.triggers._validate_connector_instance_team_scope``), and the
|
|
13
|
+
library/template import gates (``routes.library``, ``routes.templates``) — so
|
|
14
|
+
the conversion cannot drift between them; a widening applied here reaches every
|
|
15
|
+
caller at once. (The MCP graph-write tool maps the same outcome to its own dict
|
|
16
|
+
result and the connector-visibility downgrade recomputes its own mismatches, so
|
|
17
|
+
neither inlines this HTTP conversion.)
|
|
18
|
+
|
|
19
|
+
Only the team-PRIVATE direction is refused: a ``visibility: team`` connector
|
|
20
|
+
may only bind to a pipeline owned by the same team. An org-visibility connector
|
|
21
|
+
is shared across the organisation and binds to ANY pipeline, team-owned or not
|
|
22
|
+
(FAR-1618 removed the reverse direction FAR-1515 had added). A binding the
|
|
23
|
+
team-blind org-scoped read cannot resolve (``ConnectorBindingMissingError``,
|
|
24
|
+
FAR-1515 CRITICAL 1) is the same named 409: a binding the gate cannot validate
|
|
25
|
+
never saves.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from __future__ import annotations
|
|
29
|
+
|
|
30
|
+
import uuid
|
|
31
|
+
from typing import Any, Protocol
|
|
32
|
+
|
|
33
|
+
from fastapi import HTTPException, status
|
|
34
|
+
from sqlalchemy.ext.asyncio import AsyncSession
|
|
35
|
+
|
|
36
|
+
from farna.core.team_visibility import (
|
|
37
|
+
ConnectorBindingMissingError,
|
|
38
|
+
ConnectorTeamMismatch,
|
|
39
|
+
connector_team_mismatch_detail,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# ``find_connector_team_mismatches`` returns the cross-team violations; the
|
|
44
|
+
# callers inject their own module-level binding so an existing monkeypatch of
|
|
45
|
+
# ``routes.<module>.find_connector_team_mismatches`` still intercepts the gate.
|
|
46
|
+
class ConnectorTeamMismatchFinder(Protocol):
|
|
47
|
+
async def __call__(
|
|
48
|
+
self,
|
|
49
|
+
session: AsyncSession,
|
|
50
|
+
*,
|
|
51
|
+
org_id: uuid.UUID,
|
|
52
|
+
pipeline_owner_team_id: uuid.UUID | None,
|
|
53
|
+
connector_bindings: list[dict[str, Any]],
|
|
54
|
+
) -> list[ConnectorTeamMismatch]: ...
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
async def enforce_connector_team_gate(
|
|
58
|
+
session: AsyncSession,
|
|
59
|
+
*,
|
|
60
|
+
org_id: uuid.UUID,
|
|
61
|
+
owner_team_id: uuid.UUID | None,
|
|
62
|
+
bindings: list[dict[str, Any]],
|
|
63
|
+
find_mismatches: ConnectorTeamMismatchFinder,
|
|
64
|
+
) -> None:
|
|
65
|
+
"""Refuse a graph write that pins another team's private connector.
|
|
66
|
+
|
|
67
|
+
Raises a 409 ``connector_team_mismatch`` for a team-private connector bound
|
|
68
|
+
to a pipeline owned by a different team (or an org pipeline with no owner
|
|
69
|
+
team), and the same named 409 for a binding the team-blind org-scoped read
|
|
70
|
+
cannot resolve. Runs inside the caller's transaction, so the raised error
|
|
71
|
+
rolls the write back. An empty binding list is a no-op — there is nothing
|
|
72
|
+
to judge. ``find_mismatches`` is the caller's
|
|
73
|
+
``find_connector_team_mismatches`` binding, threaded through so the gate
|
|
74
|
+
keeps a single test seam in the route module that owns it.
|
|
75
|
+
"""
|
|
76
|
+
if not bindings:
|
|
77
|
+
return
|
|
78
|
+
try:
|
|
79
|
+
mismatches = await find_mismatches(
|
|
80
|
+
session,
|
|
81
|
+
org_id=org_id,
|
|
82
|
+
pipeline_owner_team_id=owner_team_id,
|
|
83
|
+
connector_bindings=bindings,
|
|
84
|
+
)
|
|
85
|
+
except ConnectorBindingMissingError as exc:
|
|
86
|
+
# FAR-1515 CRITICAL 1: same named 409 as the graph-save paths — an
|
|
87
|
+
# unresolvable binding must not import any more than it must save.
|
|
88
|
+
raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail=str(exc)) from None
|
|
89
|
+
if mismatches:
|
|
90
|
+
raise HTTPException(
|
|
91
|
+
status_code=status.HTTP_409_CONFLICT,
|
|
92
|
+
detail=connector_team_mismatch_detail(mismatches),
|
|
93
|
+
)
|
farna/api/constants.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Shared message constants for the API layer.
|
|
2
|
+
|
|
3
|
+
These strings are duplicated across many route files (python:S1192). Centralising
|
|
4
|
+
them here keeps the literal in one place; route files import the constant instead
|
|
5
|
+
of repeating the string. Values are user-facing HTTPException details / API
|
|
6
|
+
messages -- do not change the text without checking all consumers.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
MSG_FEATURE_NOT_AVAILABLE = "Feature is not available. Run database migrations to enable it."
|
|
10
|
+
MSG_THIS_FEATURE_NOT_AVAILABLE = "This feature is not available. Run database migrations to enable it."
|
|
11
|
+
MSG_RESOURCE_ALREADY_EXISTS = "A resource with this value already exists"
|
|
12
|
+
MSG_INTERNAL_SERVER_ERROR = "Internal server error"
|
|
13
|
+
MSG_CSRF_FAILED = "CSRF validation failed"
|
|
14
|
+
MSG_UNEXPECTED_ERROR = "An unexpected error occurred."
|
|
15
|
+
MSG_UNEXPECTED_ERROR_NO_PERIOD = "An unexpected error occurred"
|
|
16
|
+
MSG_DB_OPERATION_FAILED = "Database operation failed. Please try again later."
|
|
17
|
+
MSG_DB_ERROR_PLEASE_TRY = "Database error. Please try again."
|
|
18
|
+
MSG_UNEXPECTED_ERROR_PLEASE_TRY = "An unexpected error occurred. Please try again."
|
|
19
|
+
MSG_FEATURE_NOT_AVAILABLE_CONTACT_SUPPORT = "Feature is not available. This feature requires a database update. Please contact support."
|
|
20
|
+
MSG_DATABASE_TEMPORARILY_UNAVAILABLE = "Database temporarily unavailable."
|
|
21
|
+
MSG_DATABASE_TEMPORARILY_UNAVAILABLE_PLEASE = "Database temporarily unavailable. Please try again."
|
|
22
|
+
MSG_DATABASE_ERROR_OCCURRED_PLEASE = "Database error occurred. Please try again later."
|
|
23
|
+
MSG_NO_ORGANISATION = "No organisation"
|
|
24
|
+
MSG_ORGANISATION_NOT_FOUND = "Organisation not found"
|
|
25
|
+
MSG_NOT_FOUND = "Not found"
|
|
26
|
+
MSG_ERROR_TRACKING_NOT_AVAILABLE = "Error tracking is not available. Run database migrations to enable it."
|
|
27
|
+
MSG_ERROR_TRACKING_TEMPORARILY_UNAVAILABLE = "Error tracking is temporarily unavailable. Please try again."
|
|
28
|
+
MSG_UNEXPECTED_ERROR_OCCURRED_WHILE = "An unexpected error occurred while processing your request."
|
|
29
|
+
MSG_TRIGGER_NOT_FOUND = "Trigger not found"
|
|
30
|
+
MSG_TEAM_NAME_ALREADY_EXISTS = "A team with this name already exists in your organisation"
|
|
31
|
+
MSG_TEAM_NOT_FOUND = "Team not found"
|
|
32
|
+
MSG_PIPELINE_NOT_FOUND = "Pipeline not found"
|
|
33
|
+
MSG_RUN_NOT_FOUND = "Run not found"
|
|
34
|
+
MSG_FOLDER_NOT_FOUND = "Folder not found"
|
|
35
|
+
MSG_ENVIRONMENT_PROFILE_NOT_FOUND = "Environment profile not found"
|
|
36
|
+
MSG_PRIMITIVE_NOT_FOUND = "Primitive not found"
|
|
37
|
+
|
|
38
|
+
# Shared permission code (python:S1192): several system-admin routes gate on the
|
|
39
|
+
# same instance-wide permission, so the identity-bearing string lives here once.
|
|
40
|
+
PERM_SYSTEM_CONFIG_MANAGE = "system.config.manage"
|
|
41
|
+
|
|
42
|
+
# Feature-flag names gated by more than one API module: the identity-bearing
|
|
43
|
+
# string lives here once so a rename cannot leave one gate stale.
|
|
44
|
+
SYSTEM_MAPS_FLAG = "system_maps"
|