{"record":{"id":"17f23c30958ad87a","repo":"affaan-m/ECC","slug":"provider-provider-r-is-not-available-provider-generation-in","errorCode":null,"errorMessage":"provider {provider!r} is not available: provider generation in TasteForge requires explicit separately authorized execution. This package ships no provider adapters and performs no network calls; the deterministic offline workflows (inspect/validate/interview/distill dry-run/apply local/export) need no provider.","messagePattern":"provider (.+?) is not available: provider generation in TasteForge requires explicit separately authorized execution\\. This package ships no provider adapters and performs no network calls; the deterministic offline workflows \\(inspect/validate/interview/distill dry-run/apply local/export\\) need no provider\\.","errorType":"exception","errorClass":"ProviderNotAuthorizedError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/providers.py","lineNumber":54,"sourceCode":"\nAdapterFactory = Callable[[], Any]\n\n\ndef list_providers() -> list[str]:\n    \"\"\"Registered provider ids. Always empty in this lane.\"\"\"\n    return sorted(_REGISTRY)\n\n\ndef get(provider: str) -> Any:\n    \"\"\"Return the adapter for ``provider`` or fail closed.\n\n    Fails closed - raising before any import or I/O - unless the provider was\n    explicitly registered with authorization AND the opt-in environment flag\n    is set. No provider is ever registered by this package.\n    \"\"\"\n    entry = _REGISTRY.get(provider)\n    if entry is None or not entry.get(\"authorized\"):\n        raise ProviderNotAuthorizedError(_FAIL_CLOSED_MESSAGE.format(provider=provider))\n    if os.environ.get(ALLOW_ENV, \"\").strip().lower() not in {\"1\", \"true\", \"yes\", \"on\"}:\n        raise ProviderNotAuthorizedError(_FAIL_CLOSED_MESSAGE.format(provider=provider))\n    return entry[\"factory\"]()\n\n\ndef register(\n    provider: str,\n    callable_factory: AdapterFactory,\n    *,\n    authorize: bool = False,\n) -> None:\n    \"\"\"Register an adapter factory. Refuses silent authorization.\n\n    ``authorize=True`` without the ``TASTEFORGE_ALLOW_PROVIDERS`` environment\n    flag is still a refusal: enabling a provider is a two-step deliberate act,\n    never a default.\n    \"\"\"\n    if not authorize:","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/providers.py#L36-L72","documentation":"providers.get() fails closed: it raises ProviderNotAuthorizedError before any import or I/O when the provider is absent from the registry or registered without authorization. This enforces the design rule that TasteForge ships no provider adapters and performs no network calls; offline workflows need no provider.","triggerScenarios":"Calling get(\"openai\") (or any name) when no adapter was ever registered; calling get on a name registered with authorize=False; calling from code that expects a networked generation path inside an offline workflow.","commonSituations":"Migrating scripts from other AI toolkits that assume a built-in provider; copy-pasted code calling provider generation when the deterministic offline workflow suffices; expecting an env var alone to enable an unregistered provider.","solutions":["Use the offline workflows (inspect/validate/interview/distill dry-run/apply local/export) which require no provider","If provider generation is truly required, call register(name, factory, authorize=True) AND set the TASTEFORGE_ALLOW_PROVIDERS env flag, both deliberately","Remove the provider-generation call entirely — the package intentionally has no built-in adapters"],"exampleFix":"// before\nadapter = providers.get(\"openai\")  # never registered\n// after\n# offline path — no provider needed\nresult = distill_dry_run(pack)  # or: explicitly register + opt-in env flag\nproviders.register(\"openai\", my_factory, authorize=True)\n# with TASTEFORGE_ALLOW_PROVIDERS=1 in the environment\nadapter = providers.get(\"openai\")","handlingStrategy":"try-catch","validationCode":"# no provider is needed for offline workflows; prefer them\nresult = validate(pack)  # or inspect / interview / distill dry-run / apply local / export","typeGuard":null,"tryCatchPattern":"try:\n    adapter = providers.get(name)\nexcept ProviderNotAuthorizedError:\n    adapter = None  # fall back to the deterministic offline workflow","preventionTips":["Default to offline workflows; reach for providers only with explicit sign-off","Never assume built-in adapters exist — this package ships none","Keep provider use behind an explicit, reviewed code path"],"tags":["provider","authorization","offline","fail-closed"],"backgroundTag":"feature-not-enabled","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}