badgerflow 0.2.0__tar.gz → 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.
Files changed (209) hide show
  1. {badgerflow-0.2.0/badgerflow.egg-info → badgerflow-0.3.0}/PKG-INFO +73 -8
  2. {badgerflow-0.2.0 → badgerflow-0.3.0}/README.md +72 -7
  3. badgerflow-0.3.0/badgerflow/.agents/skills/badgerflow-platform-api/SKILL.md +201 -0
  4. badgerflow-0.3.0/badgerflow/.agents/skills/badgerflow-plugin/SKILL.md +171 -0
  5. badgerflow-0.3.0/badgerflow/.agents/skills/badgerflow-plugin/references/troubleshooting.md +24 -0
  6. badgerflow-0.3.0/badgerflow/.agents/skills/badgerflow-procode-agent/SKILL.md +178 -0
  7. badgerflow-0.3.0/badgerflow/.agents/skills/badgerflow-procode-agent/references/capabilities.md +105 -0
  8. badgerflow-0.3.0/badgerflow/.agents/skills/badgerflow-release/SKILL.md +120 -0
  9. badgerflow-0.3.0/badgerflow/.agents/skills/badgerflow-troubleshooting/SKILL.md +86 -0
  10. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/__init__.py +1 -1
  11. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/cli/main.py +114 -6
  12. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/cli/plugin.py +410 -43
  13. badgerflow-0.3.0/badgerflow/cli/plugin_call.py +191 -0
  14. badgerflow-0.3.0/badgerflow/cli/plugin_image.py +244 -0
  15. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/cli/plugin_scaffold.py +156 -10
  16. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/cli/scaffold.py +12 -1
  17. badgerflow-0.3.0/badgerflow/cli/skills.py +217 -0
  18. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/README.md +1 -1
  19. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/constants.py +15 -2
  20. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/event-policy_violation.json +1 -1
  21. badgerflow-0.3.0/badgerflow/contract/examples/ir.hash +1 -0
  22. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/ir.json +38 -0
  23. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/manifest.json +39 -1
  24. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/invoke-request.schema.json +1 -1
  25. badgerflow-0.3.0/badgerflow/contract/ir.schema.json +182 -0
  26. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/manifest.schema.json +127 -50
  27. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/knowledge/client.py +9 -5
  28. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/langgraph/compile.py +203 -83
  29. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/langgraph/uses.py +65 -6
  30. badgerflow-0.3.0/badgerflow/plugin/conformance.py +297 -0
  31. badgerflow-0.3.0/badgerflow/plugin/egress_proxy.py +368 -0
  32. badgerflow-0.3.0/badgerflow/plugin/envelope.py +71 -0
  33. badgerflow-0.3.0/badgerflow/plugin/oci.py +446 -0
  34. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/plugin/testing.py +15 -20
  35. badgerflow-0.3.0/badgerflow/procode/actor.py +118 -0
  36. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/procode/context.py +7 -0
  37. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/tools/client.py +17 -1
  38. {badgerflow-0.2.0 → badgerflow-0.3.0/badgerflow.egg-info}/PKG-INFO +73 -8
  39. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow.egg-info/SOURCES.txt +20 -0
  40. {badgerflow-0.2.0 → badgerflow-0.3.0}/pyproject.toml +5 -1
  41. badgerflow-0.3.0/tests/test_actor_tokens.py +200 -0
  42. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_cli.py +9 -4
  43. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_cli_plugin.py +172 -1
  44. badgerflow-0.3.0/tests/test_cli_plugin_call.py +232 -0
  45. badgerflow-0.3.0/tests/test_cli_plugin_image.py +261 -0
  46. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_cli_register.py +1 -1
  47. badgerflow-0.3.0/tests/test_cli_skills.py +179 -0
  48. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_contract_constants.py +8 -2
  49. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_contract_hash.py +1 -1
  50. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_contract_schemas.py +2 -0
  51. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_export_golden.py +12 -4
  52. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_import.py +2 -2
  53. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_langgraph_compile.py +160 -22
  54. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_langgraph_stream.py +3 -1
  55. badgerflow-0.3.0/tests/test_plugin_egress_proxy.py +191 -0
  56. badgerflow-0.3.0/tests/test_plugin_oci.py +445 -0
  57. badgerflow-0.2.0/badgerflow/contract/examples/ir.hash +0 -1
  58. badgerflow-0.2.0/badgerflow/contract/ir.schema.json +0 -132
  59. badgerflow-0.2.0/badgerflow/plugin/conformance.py +0 -166
  60. {badgerflow-0.2.0 → badgerflow-0.3.0}/LICENSE +0 -0
  61. {badgerflow-0.2.0 → badgerflow-0.3.0}/NOTICE +0 -0
  62. {badgerflow-0.2.0 → badgerflow-0.3.0}/agiel/__init__.py +0 -0
  63. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/auth/__init__.py +0 -0
  64. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/auth/run_token.py +0 -0
  65. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/cli/__init__.py +0 -0
  66. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/cli/preview.py +0 -0
  67. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/cli/project.py +0 -0
  68. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/__init__.py +0 -0
  69. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/adapters/__init__.py +0 -0
  70. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/adapters/autogen.py +0 -0
  71. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/adapters/crewai.py +0 -0
  72. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/adapters/langchain.py +0 -0
  73. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/cli/__init__.py +0 -0
  74. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/cli/main.py +0 -0
  75. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/cli/manifest.py +0 -0
  76. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/client.py +0 -0
  77. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/exceptions.py +0 -0
  78. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/__init__.py +0 -0
  79. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/agents.py +0 -0
  80. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/auth.py +0 -0
  81. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/dependencies.py +0 -0
  82. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/guardrail_profiles.py +0 -0
  83. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/guardrails.py +0 -0
  84. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/models.py +0 -0
  85. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/namespaces.py +0 -0
  86. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/rag.py +0 -0
  87. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/releases.py +0 -0
  88. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/webhooks.py +0 -0
  89. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/client/resources/workflows.py +0 -0
  90. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/connectors/__init__.py +0 -0
  91. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/connectors/client.py +0 -0
  92. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/__init__.py +0 -0
  93. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/event.schema.json +0 -0
  94. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/event-complete.json +0 -0
  95. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/event-pause_review.json +0 -0
  96. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/event-step_completed.json +0 -0
  97. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/event-step_started.json +0 -0
  98. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/invoke-request.json +0 -0
  99. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/invoke-response-completed.json +0 -0
  100. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/invoke-response-failed.json +0 -0
  101. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/examples/invoke-response-paused.json +0 -0
  102. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/hash.py +0 -0
  103. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/invoke-response.schema.json +0 -0
  104. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/pause.py +0 -0
  105. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/README.md +0 -0
  106. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/__init__.py +0 -0
  107. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/attestation.py +0 -0
  108. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/constants.py +0 -0
  109. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-call-meta--credential-field-not-an-identifier.json +0 -0
  110. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-call-meta--missing-namespace.json +0 -0
  111. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--any-allowed-with-aliases.json +0 -0
  112. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--credentials-without-form.json +0 -0
  113. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--duplicate-tool.json +0 -0
  114. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--egress-with-scheme.json +0 -0
  115. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--no-tools.json +0 -0
  116. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--non-object-output-schema.json +0 -0
  117. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--select-without-options.json +0 -0
  118. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--stale-schema-hash.json +0 -0
  119. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--typo-in-tool.json +0 -0
  120. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--unknown-effect.json +0 -0
  121. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--unknown-permission.json +0 -0
  122. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--uppercase-name.json +0 -0
  123. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--wildcard-egress.json +0 -0
  124. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-manifest--wrong-manifest-hash.json +0 -0
  125. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-token--audience-not-derived-from-perms.json +0 -0
  126. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-token--installation-mismatch.json +0 -0
  127. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-token--outlives-a-tool-call.json +0 -0
  128. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-token--run-token-marker.json +0 -0
  129. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/invalid/plugin-token--unknown-audience.json +0 -0
  130. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/plugin-attestation.json +0 -0
  131. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/plugin-attestation.trust.json +0 -0
  132. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/plugin-call-meta.json +0 -0
  133. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/plugin-manifest.json +0 -0
  134. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/examples/plugin-token.json +0 -0
  135. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/hash.py +0 -0
  136. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/plugin-call-meta.schema.json +0 -0
  137. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/plugin-manifest.schema.json +0 -0
  138. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/plugin-token.schema.json +0 -0
  139. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/plugin/validate.py +0 -0
  140. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/contract/validate.py +0 -0
  141. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/events/__init__.py +0 -0
  142. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/events/emitter.py +0 -0
  143. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/events/steps.py +0 -0
  144. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/guardrails/__init__.py +0 -0
  145. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/guardrails/client.py +0 -0
  146. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/knowledge/__init__.py +0 -0
  147. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/langgraph/__init__.py +0 -0
  148. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/langgraph/agent.py +0 -0
  149. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/langgraph/callback.py +0 -0
  150. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/langgraph/chat.py +0 -0
  151. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/langgraph/checkpoint.py +0 -0
  152. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/langgraph/tools.py +0 -0
  153. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/llm/__init__.py +0 -0
  154. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/llm/client.py +0 -0
  155. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/ontology/__init__.py +0 -0
  156. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/ontology/client.py +0 -0
  157. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/otel/__init__.py +0 -0
  158. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/otel/logs.py +0 -0
  159. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/otel/metrics.py +0 -0
  160. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/otel/scope.py +0 -0
  161. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/otel/spans.py +0 -0
  162. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/otel/tracing.py +0 -0
  163. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/plugin/__init__.py +0 -0
  164. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/plugin/context.py +0 -0
  165. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/plugin/definition.py +0 -0
  166. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/plugin/errors.py +0 -0
  167. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/plugin/server.py +0 -0
  168. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/plugin/signing.py +0 -0
  169. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/procode/__init__.py +0 -0
  170. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/procode/app.py +0 -0
  171. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/procode/clients.py +0 -0
  172. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/procode/config.py +0 -0
  173. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/procode/current.py +0 -0
  174. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/procode/errors.py +0 -0
  175. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/procode/stepctx.py +0 -0
  176. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/procode/transport.py +0 -0
  177. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow/tools/__init__.py +0 -0
  178. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow.egg-info/dependency_links.txt +0 -0
  179. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow.egg-info/entry_points.txt +0 -0
  180. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow.egg-info/requires.txt +0 -0
  181. {badgerflow-0.2.0 → badgerflow-0.3.0}/badgerflow.egg-info/top_level.txt +0 -0
  182. {badgerflow-0.2.0 → badgerflow-0.3.0}/setup.cfg +0 -0
  183. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_agent_card.py +0 -0
  184. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_claims_chat_example.py +0 -0
  185. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_claims_triage_example.py +0 -0
  186. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_cli_preview.py +0 -0
  187. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_cli_release.py +0 -0
  188. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_context_steps.py +0 -0
  189. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_contract_pause.py +0 -0
  190. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_events_emitter.py +0 -0
  191. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_governed_clients.py +0 -0
  192. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_langgraph_agent.py +0 -0
  193. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_langgraph_approval_example.py +0 -0
  194. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_langgraph_checkpoint.py +0 -0
  195. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_langgraph_tools.py +0 -0
  196. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_llm_client.py +0 -0
  197. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_llm_standalone.py +0 -0
  198. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_metrics_endpoint.py +0 -0
  199. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_otel.py +0 -0
  200. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_payout_approval_example.py +0 -0
  201. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_plugin_contract.py +0 -0
  202. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_plugin_manifest.py +0 -0
  203. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_plugin_mcp.py +0 -0
  204. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_plugin_storage.py +0 -0
  205. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_plugin_testing.py +0 -0
  206. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_procode_server.py +0 -0
  207. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_proxy_environment.py +0 -0
  208. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_run_token_verifier.py +0 -0
  209. {badgerflow-0.2.0 → badgerflow-0.3.0}/tests/test_slow_review_example.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: badgerflow
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: BadgerFlow Python SDK: governed pro-code agents, the platform REST client, and the bf / agiel CLIs
5
5
  License-Expression: Apache-2.0
6
6
  Keywords: langgraph,agents,llm,governance,badgerflow,mlops
@@ -91,8 +91,28 @@ app = Agent.from_langgraph(build_graph(), name="claims-triage", version="0.1.0",
91
91
  ```
92
92
 
93
93
  Those declarations are the contract. The platform compiles them into a graph it
94
- can render, checks them against what exists in your namespace at release time,
95
- and denies a node at runtime that reaches for something it never declared.
94
+ can render — every node, every conditional edge as a router with its branch
95
+ labels, and the END your graph declares — checks them against what exists in
96
+ your namespace at release time, and denies a node at runtime that reaches for
97
+ something it never declared. `bf compile` shows that graph before you register.
98
+
99
+ `settings` is the half a reviewer reads rather than the platform enforces: what
100
+ the node is configured with, shown read-only on its card and inspector.
101
+
102
+ ```python
103
+ @node(
104
+ uses=Uses(model="gpt-4o"),
105
+ determinism="recorded_inference",
106
+ settings={"model": "gpt-4o", "temperature": 0, "system_prompt": TRIAGE_SYSTEM,
107
+ "output": "_Triage"},
108
+ )
109
+ async def triage(state: State) -> State: ...
110
+ ```
111
+
112
+ Any JSON object (or a pydantic model) up to 64 KB. It is pinned by the release
113
+ hash like the rest of the node's config, so what the approver read is what
114
+ runs — and it is declared, because the compiler cannot see a prompt that is
115
+ built inside the function.
96
116
 
97
117
  ## Work that outlives a request
98
118
 
@@ -141,6 +161,23 @@ Keep large values out of the graph state. The checkpoint travels with the pause
141
161
  and is capped; a state that is too big fails the run with a clear reason rather
142
162
  than producing a pause the platform cannot file. Hold a reference instead.
143
163
 
164
+ ## Answering a chat
165
+
166
+ A chat-triggered agent receives each turn as text. The platform puts that text
167
+ in `input` and, when your input model has one place for it, under that field's
168
+ name in `structured` too: a field named `input`; else the one required string
169
+ field; else one named `message`, `text`, `query`, `question`, `prompt` or
170
+ `content`; else the one string field. So `Input(problem: str, attempt: str =
171
+ "")` receives the turn as `problem`, and `Input(message: str = "", problem: str
172
+ = "", attempt: str = "")` as `message`. Several optional string fields with
173
+ none of those names is left to your model, which then sees them all empty.
174
+
175
+ Going back, the bubble shows one field of your output model: the one you mark
176
+ with `Field(json_schema_extra={"x-badgerflow-reply": True})`, else one named
177
+ `reply`, `answer`, `response`, `message`, `text` or `content`, else the single
178
+ string field. An output that names none of those shows as its JSON, which is
179
+ the cue to mark the field. A streamed agent's deltas are always the reply.
180
+
144
181
  ## Streaming a run
145
182
 
146
183
  Ask for `text/event-stream` and the invocation answers with the run's event
@@ -257,10 +294,26 @@ Each workspace's credential reaches the tool only inside the platform's call.
257
294
  model outside `models`. A raised exception becomes a tool error the model can
258
295
  read. Test tools in-process with `badgerflow.plugin.testing.PluginTestClient`.
259
296
 
260
- Plugins ship only through your own registry: `bf plugin build`,
261
- `bf plugin publish --registry <yours>`, `bf plugin sign --key <pem>`, then
262
- `bf plugin submit`. The platform imports a package only if a key in the
263
- operator's trust set signed it. `ctx.storage` is a JSON key-value store per calling
297
+ Before shipping, check the built image and call a tool the way the platform would:
298
+
299
+ ```bash
300
+ bf plugin build
301
+ bf plugin validate --image acme-crm:0.1.0 # run non-root, read-only, no capabilities, as the cluster does
302
+ bf plugin call find_customer --image acme-crm:0.1.0 \
303
+ --args '{"email": "ada@example.com"}' --credentials @creds.json
304
+ ```
305
+
306
+ `call` sends the platform's call envelope, credentials included, and with
307
+ `--image` puts the plugin behind a local proxy that allows only `egress` and
308
+ prints each connection; `--url` calls a plugin already serving. `ctx.llm` and
309
+ `ctx.storage` have no local platform there.
310
+
311
+ Plugins ship only through your own registry. `bf plugin publish --registry <yours>
312
+ --key <pem> --keyid <id>` pushes the image by digest over the registry API (no
313
+ cosign, no Docker `insecure-registries`; `--insecure` for plain HTTP) and pushes
314
+ the signed attestation beside it; then `bf plugin submit --image <ref>`. The
315
+ platform imports a package only if a key in the operator's trust set signed it.
316
+ `bf plugin init` also writes a CI workflow that runs these on a version tag. `ctx.storage` is a JSON key-value store per calling
264
317
  workspace under `storage_bytes`, in memory under `PluginTestClient` and on the
265
318
  platform (`BADGERFLOW_PLATFORM_URL`) when served.
266
319
 
@@ -276,8 +329,20 @@ platform (`BADGERFLOW_PLATFORM_URL`) when served.
276
329
  | `bf status` | registration, release, and hash agreement |
277
330
  | `bf release submit \| status` | the governed release and its scorecard |
278
331
  | `bf models` | the models your model key may call, with prices |
279
- | `bf plugin init \| manifest \| test \| validate` | author and check a tool plugin |
332
+ | `bf plugin init \| manifest \| test \| validate [--image]` | author and check a tool plugin, or its image |
333
+ | `bf plugin call <tool> --image \| --url` | one call with the platform's envelope and credentials |
280
334
  | `bf plugin build \| publish \| sign \| submit \| dev` | package, sign and submit it |
335
+ | `bf skills install \| check` | teach a coding tool this SDK: `.agents/skills`, `.claude/skills`, an `AGENTS.md` block; `check` fails after an upgrade until you re-install |
336
+
337
+ ## Coding tools
338
+
339
+ `bf init` and `bf plugin init` also install the SDK's agent skills — for Claude Code, Codex,
340
+ Cursor and any tool that reads `.agents/skills` or `AGENTS.md` — so the tool knows the commands,
341
+ the declarations and the rules without reading this SDK's source. Commit them. After upgrading
342
+ `badgerflow`, run `bf skills install`; `bf skills check` in CI fails while they describe another
343
+ version. `--no-skills` opts out. Claude Code users with access to the BadgerFlow repository can
344
+ also add it as a plugin marketplace: `/plugin marketplace add facileai/agiel`, then
345
+ `/plugin install badgerflow@badgerflow`.
281
346
 
282
347
  ## Versioning
283
348
 
@@ -36,8 +36,28 @@ app = Agent.from_langgraph(build_graph(), name="claims-triage", version="0.1.0",
36
36
  ```
37
37
 
38
38
  Those declarations are the contract. The platform compiles them into a graph it
39
- can render, checks them against what exists in your namespace at release time,
40
- and denies a node at runtime that reaches for something it never declared.
39
+ can render — every node, every conditional edge as a router with its branch
40
+ labels, and the END your graph declares — checks them against what exists in
41
+ your namespace at release time, and denies a node at runtime that reaches for
42
+ something it never declared. `bf compile` shows that graph before you register.
43
+
44
+ `settings` is the half a reviewer reads rather than the platform enforces: what
45
+ the node is configured with, shown read-only on its card and inspector.
46
+
47
+ ```python
48
+ @node(
49
+ uses=Uses(model="gpt-4o"),
50
+ determinism="recorded_inference",
51
+ settings={"model": "gpt-4o", "temperature": 0, "system_prompt": TRIAGE_SYSTEM,
52
+ "output": "_Triage"},
53
+ )
54
+ async def triage(state: State) -> State: ...
55
+ ```
56
+
57
+ Any JSON object (or a pydantic model) up to 64 KB. It is pinned by the release
58
+ hash like the rest of the node's config, so what the approver read is what
59
+ runs — and it is declared, because the compiler cannot see a prompt that is
60
+ built inside the function.
41
61
 
42
62
  ## Work that outlives a request
43
63
 
@@ -86,6 +106,23 @@ Keep large values out of the graph state. The checkpoint travels with the pause
86
106
  and is capped; a state that is too big fails the run with a clear reason rather
87
107
  than producing a pause the platform cannot file. Hold a reference instead.
88
108
 
109
+ ## Answering a chat
110
+
111
+ A chat-triggered agent receives each turn as text. The platform puts that text
112
+ in `input` and, when your input model has one place for it, under that field's
113
+ name in `structured` too: a field named `input`; else the one required string
114
+ field; else one named `message`, `text`, `query`, `question`, `prompt` or
115
+ `content`; else the one string field. So `Input(problem: str, attempt: str =
116
+ "")` receives the turn as `problem`, and `Input(message: str = "", problem: str
117
+ = "", attempt: str = "")` as `message`. Several optional string fields with
118
+ none of those names is left to your model, which then sees them all empty.
119
+
120
+ Going back, the bubble shows one field of your output model: the one you mark
121
+ with `Field(json_schema_extra={"x-badgerflow-reply": True})`, else one named
122
+ `reply`, `answer`, `response`, `message`, `text` or `content`, else the single
123
+ string field. An output that names none of those shows as its JSON, which is
124
+ the cue to mark the field. A streamed agent's deltas are always the reply.
125
+
89
126
  ## Streaming a run
90
127
 
91
128
  Ask for `text/event-stream` and the invocation answers with the run's event
@@ -202,10 +239,26 @@ Each workspace's credential reaches the tool only inside the platform's call.
202
239
  model outside `models`. A raised exception becomes a tool error the model can
203
240
  read. Test tools in-process with `badgerflow.plugin.testing.PluginTestClient`.
204
241
 
205
- Plugins ship only through your own registry: `bf plugin build`,
206
- `bf plugin publish --registry <yours>`, `bf plugin sign --key <pem>`, then
207
- `bf plugin submit`. The platform imports a package only if a key in the
208
- operator's trust set signed it. `ctx.storage` is a JSON key-value store per calling
242
+ Before shipping, check the built image and call a tool the way the platform would:
243
+
244
+ ```bash
245
+ bf plugin build
246
+ bf plugin validate --image acme-crm:0.1.0 # run non-root, read-only, no capabilities, as the cluster does
247
+ bf plugin call find_customer --image acme-crm:0.1.0 \
248
+ --args '{"email": "ada@example.com"}' --credentials @creds.json
249
+ ```
250
+
251
+ `call` sends the platform's call envelope, credentials included, and with
252
+ `--image` puts the plugin behind a local proxy that allows only `egress` and
253
+ prints each connection; `--url` calls a plugin already serving. `ctx.llm` and
254
+ `ctx.storage` have no local platform there.
255
+
256
+ Plugins ship only through your own registry. `bf plugin publish --registry <yours>
257
+ --key <pem> --keyid <id>` pushes the image by digest over the registry API (no
258
+ cosign, no Docker `insecure-registries`; `--insecure` for plain HTTP) and pushes
259
+ the signed attestation beside it; then `bf plugin submit --image <ref>`. The
260
+ platform imports a package only if a key in the operator's trust set signed it.
261
+ `bf plugin init` also writes a CI workflow that runs these on a version tag. `ctx.storage` is a JSON key-value store per calling
209
262
  workspace under `storage_bytes`, in memory under `PluginTestClient` and on the
210
263
  platform (`BADGERFLOW_PLATFORM_URL`) when served.
211
264
 
@@ -221,8 +274,20 @@ platform (`BADGERFLOW_PLATFORM_URL`) when served.
221
274
  | `bf status` | registration, release, and hash agreement |
222
275
  | `bf release submit \| status` | the governed release and its scorecard |
223
276
  | `bf models` | the models your model key may call, with prices |
224
- | `bf plugin init \| manifest \| test \| validate` | author and check a tool plugin |
277
+ | `bf plugin init \| manifest \| test \| validate [--image]` | author and check a tool plugin, or its image |
278
+ | `bf plugin call <tool> --image \| --url` | one call with the platform's envelope and credentials |
225
279
  | `bf plugin build \| publish \| sign \| submit \| dev` | package, sign and submit it |
280
+ | `bf skills install \| check` | teach a coding tool this SDK: `.agents/skills`, `.claude/skills`, an `AGENTS.md` block; `check` fails after an upgrade until you re-install |
281
+
282
+ ## Coding tools
283
+
284
+ `bf init` and `bf plugin init` also install the SDK's agent skills — for Claude Code, Codex,
285
+ Cursor and any tool that reads `.agents/skills` or `AGENTS.md` — so the tool knows the commands,
286
+ the declarations and the rules without reading this SDK's source. Commit them. After upgrading
287
+ `badgerflow`, run `bf skills install`; `bf skills check` in CI fails while they describe another
288
+ version. `--no-skills` opts out. Claude Code users with access to the BadgerFlow repository can
289
+ also add it as a plugin marketplace: `/plugin marketplace add facileai/agiel`, then
290
+ `/plugin install badgerflow@badgerflow`.
226
291
 
227
292
  ## Versioning
228
293
 
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: badgerflow-platform-api
3
+ description: Create or edit a BadgerFlow canvas workflow through the platform's REST API — the node (step) catalogue, the graph shape, the {step.field} reference grammar, the compile endpoint and its diagnostic codes, recommendations and the risk profile. Use when the user asks to build, generate, modify or debug a BadgerFlow workflow graph programmatically, or when a graph compiles with errors or W3xx reference warnings.
4
+ license: Apache-2.0
5
+ metadata:
6
+ version: "0.3.0"
7
+ ---
8
+
9
+ # Authoring a canvas workflow through the API
10
+
11
+ A canvas workflow is a JSON graph — `nodes` and `edges` — that workflow-service compiles. The
12
+ two ways a machine author fails here are both silent: inventing a step type, and writing a
13
+ reference that resolves to nothing (it reaches the model as literal text and the run still
14
+ "succeeds"). The defence against both is the same: **ask the platform, then compile, and treat
15
+ every diagnostic as a defect until explained.**
16
+
17
+ ## The loop — run it, do not reason about it
18
+
19
+ 1. **Read the catalogue** before writing any node. Do not rely on this file's table when the
20
+ platform is reachable — the live catalogue is the version that platform runs.
21
+ 2. **Read the inventory** — what this workspace actually has (models, tools, collections,
22
+ guardrail profiles, agents). Never reference a resource by a name you made up.
23
+ 3. Write the graph. Save it.
24
+ 4. **Compile.** Fix every error. Fix or explain every warning. Repeat until clean.
25
+ 5. **Read the recommendations** and show them to the user. Do not apply or dismiss them on the
26
+ user's behalf without asking.
27
+
28
+ | Step | Request (under the platform ingress) |
29
+ |---|---|
30
+ | Catalogue | `GET /api/workflows/v1/workflows/node-types` — also `references`, `edges`, `error_policy`, `example_workflows` |
31
+ | One step type | `GET /api/workflows/v1/workflows/node-types/{type}` — `config_schema`, `handles`, `template_fields`, `retired_keys`, `example`, `notes` |
32
+ | Inventory | `GET /api/agents/v1/inventory` — each section reports `ok`, `forbidden` or `unavailable` |
33
+ | Create | `POST /api/workflows/v1/workflows` — `name`, `namespace`, `trigger_type`, `nodes`, `edges`, optional `guardrail_profile` |
34
+ | Update | `PUT /api/workflows/v1/workflows/{id}` — partial; send `nodes` and `edges` together |
35
+ | Compile | `POST /api/workflows/v1/workflows/{id}/compile` → `ok`, `diagnostics[]` (`severity`, `code`, `message`, `node_id`), `error_count`, `warning_count`, `ir_hash` |
36
+ | Advice | `GET /api/workflows/v1/workflows/{id}/recommendations` — recommendations, readiness by component, the open risk questions |
37
+ | Risk profile | `GET` / `PUT /api/workflows/v1/workflows/{id}/risk-profile` |
38
+
39
+ Authentication is `Authorization: Bearer <credential>`. The credential is the user's; read it
40
+ from the environment variable they name and never print it, store it, or put it in a URL. The
41
+ namespace comes from the credential — an `X-Namespace` header is a hint, not a way to reach
42
+ another workspace. A section of the inventory marked `forbidden` or `unavailable` means "not
43
+ known", not "empty": say so rather than concluding the workspace has no tools.
44
+
45
+ ## The graph
46
+
47
+ ```json
48
+ {
49
+ "nodes": [
50
+ {"id": "start", "type": "trigger", "data": {}},
51
+ {"id": "summarise", "type": "llm", "data": {"model": "<a model from the inventory>",
52
+ "user_prompt": "Summarise: {input}"}},
53
+ {"id": "result", "type": "output", "data": {"value": "{summarise}"}}
54
+ ],
55
+ "edges": [
56
+ {"id": "e1", "source": "start", "target": "summarise"},
57
+ {"id": "e2", "source": "summarise", "target": "result"}
58
+ ]
59
+ }
60
+ ```
61
+
62
+ - **Step ids must be plain words** (`[A-Za-z0-9_]+`), and meaningful: the id is how every later
63
+ step refers to this one. `order_lookup`, not `llm-1723` — a hyphenated id can never be
64
+ referenced.
65
+ - A branching step routes by `sourceHandle` on its outgoing edges (the catalogue lists each
66
+ type's `handles`). An edge leaving a step's `error` handle is that step's own failure path.
67
+ - **No cycles** (E006). Repetition is a `for_each` step.
68
+ - A chat-triggered workflow runs **once per user message**; do not model a conversation as a
69
+ loop.
70
+ - Copy `data` keys from the step type's `config_schema` and `example`. An unknown key is
71
+ ignored by the runtime and reported as W212.
72
+ - `"model": "default"` is a placeholder that is dropped — name a real model from the inventory.
73
+
74
+ <!-- generated:step-types -->
75
+ Catalogue version `2026.09.0`. Live copy: `GET /api/workflows/v1/workflows/node-types`.
76
+
77
+ | `type` | Category | What it does | Notes |
78
+ |---|---|---|---|
79
+ | `trigger` | Trigger | Marks where the run starts and declares its inputs. Never executes. | |
80
+ | `agent_call` | AI | Hand off to a registered agent; optionally constrain its reply to an output schema. | |
81
+ | `llm` | AI | A single model call. | |
82
+ | `rag` | AI | Retrieve from a knowledge collection. | |
83
+ | `guardrail` | AI | Evaluate content against a guardrail and block the run on violation. | |
84
+ | `condition` | Logic | Two-way branch. | edge handles: `true`, `false` |
85
+ | `switch` | Logic | Multi-way branch; routes on the first matching case. | edge handles: `case:<case id>`, `default` |
86
+ | `merge` | Logic | Join branch outputs (concat / list / compare). | |
87
+ | `human_review` | Logic | Pause for a reviewer; continue down the approved or the rejected path. | pauses; edge handles: `approved`, `rejected` |
88
+ | `collect_input` | Logic | Ask the user for typed fields; the slot schema is the resume contract. | pauses |
89
+ | `collect_files` | Logic | Ask the user for files, validated against type and count rules. | pauses |
90
+ | `for_each` | Logic | Loop over a list of items. | |
91
+ | `wait` | Logic | Pause for a set time, then continue. | pauses |
92
+ | `execute_workflow` | Logic | Run another workflow as a step. | |
93
+ | `error_trigger` | Logic | Error handler — a second root that runs when a step fails. | |
94
+ | `decision` | Logic | Evaluate rules over facts; computes {outputs, fired_rules, matched}. | |
95
+ | `http` | Action | Call a REST endpoint. | |
96
+ | `mcp_server` | Action | Call a tool on an MCP server. | |
97
+ | `plugin_tool` | Action | Call a tool from an installed plugin. | |
98
+ | `database_query` | Data | Read-only SQL via a connector. | |
99
+ | `transform` | Data | Reshape and validate data without a model; computes {value, valid, violations, coercion_errors}. | |
100
+ | `extract` | Data | Pull typed fields out of uploaded documents. | |
101
+ | `code` | Action | Run Python or bash in a hardened sandbox. | |
102
+ | `output` | Action | The run's return value. | |
103
+ | `stop_error` | Action | Halt the run with a custom error message. | |
104
+ | `ontology_validate` | Ontology | Check a value against a released concept scheme. | |
105
+ | `ontology_lookup` | Ontology | Read a concept — label, definition, hierarchy path. | |
106
+ <!-- /generated:step-types -->
107
+
108
+ ## References — how one step reads another
109
+
110
+ <!-- generated:reference-grammar -->
111
+ Syntax: `{root} · {root.field} · {root.0.field}`
112
+
113
+ A reference's root may be:
114
+
115
+ - a step id — THE reliable root: the run context is keyed by step id. It must be a plain word ([A-Za-z0-9_]+); a hyphenated id such as llm-1723 can never be referenced. Give steps ids like order_lookup and reference {order_lookup} or {order_lookup.rows.0.total}
116
+ - a merge step's data.output_key — merge is the ONLY step that also publishes under its output_key. Every other step stores the key and ignores it: {my_key} is W301
117
+ - a trigger input field key
118
+ - payload — on a webhook trigger, the request body (absent when the body carries a top-level string 'input')
119
+ - builtins: input, user_input, session_id, conversation_history, item, index, items, error_message, error_node, error_type, is_eval
120
+
121
+ Limits: at most 10 dot-separated segments, 64 characters each.
122
+
123
+ What goes wrong silently:
124
+
125
+ - An unknown root is NOT an error: it renders as literal text and compiles with W301. Treat any W301 as a defect.
126
+ - {__input__} and {__session_id__} never resolve — double-underscore roots are refused. Use {input} and {session_id}.
127
+ - Template fields (prompts, URLs, bodies) resolve SINGLE braces with no spaces. {{ x }} in a prompt reaches the model as literal text. Operand fields (a condition's left/right, a switch value) additionally accept {{x}} — do not rely on it; write {x} everywhere.
128
+ - Referencing a step that is not an ancestor is W302.
129
+ <!-- /generated:reference-grammar -->
130
+
131
+ ## Diagnostics
132
+
133
+ Errors block a run and a release. Warnings do not block — and most of them mean the workflow
134
+ will do the wrong thing quietly. The `message` from the compile response is authoritative and
135
+ often names the fix; codes not listed here are explained by their message.
136
+
137
+ <!-- generated:diagnostics -->
138
+ | Code | Meaning |
139
+ |---|---|
140
+ | `E001` | Workflow has no executable node after the trigger. |
141
+ | `E002` | A step type has no executable mapping — it would be skipped. |
142
+ | `E003` | An edge references a node that doesn't exist on the canvas. |
143
+ | `E004` | Duplicate node id. |
144
+ | `E005` | A node is unreachable from the entry — it will never run. |
145
+ | `E006` | Cycle detected. Workflows are acyclic. |
146
+ | `E007` | Condition has no outgoing true/false branch — it dead-ends. |
147
+ | `E008` | Execute-Workflow step has no target workflow. |
148
+ | `E009` | Guardrail step has no guardrail selected. |
149
+ | `E010` | MCP step has no tool name configured. |
150
+ | `E011` | Switch case (or default) routes to an unknown node. |
151
+ | `E012` | A Wait / Collect-input / Collect-files step sits **inside a For-Each body** — pauses can't resume per-item. |
152
+ | `E013` | Agent step has no agent selected. |
153
+ | `E014` | A For-Each source isn't iterable (a scalar). |
154
+ | `E015` | A node only follows a **Stop-and-Error** step — dead code. |
155
+ | `E016` | Ambiguous Wait (neither a duration nor an *until*). |
156
+ | `E017` | A Decision table can only ever emit `{}` (no rules **and** no default). |
157
+ | `E018` | A Transform transforms nothing and validates nothing. |
158
+ | `E019` | A declared output contract the envelope can't enforce (Agent / Extract). |
159
+ | `E021` | An Extract step has no output schema — it extracts into nothing. |
160
+ | `E024` | A `{reference}` the resolver can never accept — more than **10** dot-separated segments, a segment longer than **64** characters, or a skipped segment mid-path (`{a..b}`). Braced prose like `{loading...}` is **not** flagged: a trailing run of dots is an ellipsis, not a path. |
161
+ | `W201` | Condition is missing an arm — that outcome ends the run here. |
162
+ | `W202` | Switch has no default route — an unmatched value ends the run here. |
163
+ | `W203` | Wait-for-approval has no rejected path — a rejection ends the run here. |
164
+ | `W204` | A Merge has fewer than two inputs — it merges nothing. |
165
+ | `W205` | An On-error handler has no steps connected — failures route to a dead end. |
166
+ | `W206` | A review with no prompt publishes a bare contract to the reviewer. |
167
+ | `W207` | A Collect-input with no slots defined pauses but asks for nothing. |
168
+ | `W208` | A route depends on an agent step that declares no validated output — determinism can't be guaranteed. |
169
+ | `W209` | Collect-files bounds are inverted (max below min); the runtime clamps max up. |
170
+ | `W212` | A step carries a setting it does not have — a misspelt or outdated key such as `body_template` for `body`. The step ignores it. Mostly seen in graphs written through the API rather than the canvas; where a real setting is close, the message names it. |
171
+ | `W213` | A RAG step has no knowledge collection selected — it retrieves nothing and the model answers unaided. |
172
+ | `W301` | A `{reference}` (or the **root** of a dot-path, the part before the first dot) matches no step, output key, run-input field, or built-in. The runtime passes it through as **literal text**. Where the compiler can guess, the message suggests the name you probably meant. If the name is another step's **Output key**, the message says so and gives the reference to write instead: only a Merge step publishes under its output key — every other step is referenced by its **step id**. |
173
+ | `W302` | A `{reference}` points at a step that does **not** run before this one — the value will be empty or stale. |
174
+ | `W304` | A `{{ reference }}` sits in a field that only resolves **single** braces — a prompt, a URL, a request body, a tool argument, a review prompt. It reaches the model or the API as literal text. Write `{step.field}`, no spaces. (A condition's or switch's operands accept either spelling.) |
175
+ <!-- /generated:diagnostics -->
176
+
177
+ ## Advice and risk — what to do with it
178
+
179
+ `GET …/recommendations` returns records: a `severity`, the `signal` and the step (`target`)
180
+ that fired it, the `consequence` of doing nothing, a `fix` (`graph_patch`, `set_field` or
181
+ `manual`) and the case in which it is a false positive. Rules for an assistant:
182
+
183
+ - **Propose, do not apply.** Show the recommendation and its fix; apply a `graph_patch` only
184
+ when the user says so, then save and compile again.
185
+ - **Never dismiss on the user's behalf.** A dismissal needs a reason
186
+ (`not_applicable`, `risk_accepted`, `handled_elsewhere`) and is shown to the person who
187
+ approves the release. It is theirs to give.
188
+ - The **open risk questions** (is it customer-facing, does it handle sensitive data, does it make
189
+ consequential decisions about people) can only be answered by a person. Ask the user; do not
190
+ guess, and do not answer "no" to make a recommendation go away.
191
+ - A step that changes something in the world (a tool whose `effect` is `write`, an outbound
192
+ HTTP call, an email) normally wants a `human_review` step before it, and a failure path. The
193
+ recommendations say where.
194
+
195
+ ## Before you say it is done
196
+
197
+ 1. Compile returns `ok: true`, and every remaining warning is explained to the user.
198
+ 2. No W301, W302 or W304 remains — each is a reference that will not resolve.
199
+ 3. Every model, tool, collection, agent and guardrail profile named in the graph exists in the
200
+ inventory.
201
+ 4. The user has seen the open recommendations and risk questions.
@@ -0,0 +1,171 @@
1
+ ---
2
+ name: badgerflow-plugin
3
+ description: Build, test, package, sign and submit a BadgerFlow tool or connector plugin with the badgerflow Python SDK — a plugin.py using Plugin, @plugin.tool, ToolContext, Permissions and credential, and its generated badgerflow-plugin.yaml. Use when the project has plugin.py or badgerflow-plugin.yaml, imports badgerflow.plugin, or when the user asks to give BadgerFlow agents a new tool or wrap a vendor API.
4
+ license: Apache-2.0
5
+ metadata:
6
+ version: "0.3.0"
7
+ ---
8
+
9
+ # BadgerFlow tool plugin
10
+
11
+ A plugin is a standard MCP server plus a signed manifest, both derived from typed Python. An
12
+ approver reads the manifest — its tools, their effects, the hosts it may reach, the credentials it
13
+ asks for — and the platform enforces exactly that. So the plugin's declarations are a security
14
+ statement, not boilerplate. Write the narrowest ones that work.
15
+
16
+ ## The loop — run it, do not reason about it
17
+
18
+ After every change to `plugin.py`:
19
+
20
+ ```bash
21
+ bf plugin manifest # regenerate badgerflow-plugin.yaml — NEVER edit that file by hand
22
+ bf plugin test # the project's pytest suite, offline
23
+ bf plugin validate # conformance: manifest, drift, health, tools/list, hashes
24
+ ```
25
+
26
+ `bf plugin validate` failing on "badgerflow-plugin.yaml is what plugin.py generates" means the
27
+ manifest is stale: run `bf plugin manifest` and commit both files. A plugin the platform would
28
+ refuse fails when `plugin.py` is imported — read that error, it names the rule.
29
+
30
+ <!-- generated:commands-plugin -->
31
+ | Command | What it does |
32
+ |---|---|
33
+ | `bf plugin build` | docker build the plugin image, labelled with its manifest hash. |
34
+ | `bf plugin call` | Call one tool with the platform's call envelope — credentials included. |
35
+ | `bf plugin dev` | Submit a laptop-served plugin as a `dev` package. DEV WORKSPACES ONLY: the prod overlay refuses the kind, and the signature is still required. Run it again after moving the URL: an unchanged manifest re-points the existing package and its installation in place (no new release). A changed manifest needs a new version. |
36
+ | `bf plugin init` | Scaffold a plugin project and generate its manifest. |
37
+ | `bf plugin manifest` | Regenerate badgerflow-plugin.yaml from plugin.py. |
38
+ | `bf plugin publish` | Push the image to your registry by digest; with --key, sign and push the attestation too. Speaks the registry API directly: no docker daemon registry configuration (insecure-registries) and no cosign needed. Credentials: BADGERFLOW_REGISTRY_USERNAME and BADGERFLOW_REGISTRY_PASSWORD, else your Docker config (docker login). |
39
+ | `bf plugin sign` | Write the signed attestation of the manifest (DSSE over an in-toto Statement). |
40
+ | `bf plugin submit` | Create the plugin package in agent-platform-api ($BADGERFLOW_PLATFORM_URL). |
41
+ | `bf plugin test` | Run the project's tests with pytest; extra arguments pass through. |
42
+ | `bf plugin validate` | Run the conformance suite against the plugin served in-process, or its image. |
43
+ <!-- /generated:commands-plugin -->
44
+
45
+ <!-- not-real -->
46
+ **Commands that do not exist** — do not suggest them: `bf plugin deploy`, `bf plugin install`,
47
+ `bf plugin push`, `bf plugin run`, `bf plugin login`, `bf plugin package`. Installing, approving
48
+ and enabling a plugin happen in the platform (UI or REST), by two different people.
49
+ <!-- /not-real -->
50
+
51
+ ## Start a project
52
+
53
+ ```bash
54
+ pip install 'badgerflow[plugin]' pytest
55
+ bf plugin init acme-crm && cd acme-crm
56
+ bf plugin test && bf plugin validate
57
+ ```
58
+
59
+ The scaffold is a working plugin with one tool, offline tests, a distroless non-root
60
+ `Dockerfile`, a `.gitignore` that excludes `*.pem` and `creds.json`, and a CI workflow. Edit it;
61
+ do not start from an empty file.
62
+
63
+ ## Writing a tool
64
+
65
+ ```python
66
+ from pydantic import BaseModel, SecretStr
67
+ from badgerflow.plugin import Permissions, Plugin, ToolContext, ToolError, credential
68
+
69
+ plugin = Plugin("acme-crm", "0.1.0", description="Read customers in Acme CRM.",
70
+ permissions=Permissions(egress=["api.acme.com"]))
71
+
72
+ class Credentials(BaseModel):
73
+ api_key: SecretStr = credential(label="API key", kind="secret")
74
+
75
+ class Customer(BaseModel):
76
+ id: str
77
+ name: str
78
+
79
+ @plugin.tool(effect="read", credentials=Credentials, title="Find customer")
80
+ async def find_customer(ctx: ToolContext[Credentials], email: str) -> Customer:
81
+ """Look up a customer by email."""
82
+ resp = await ctx.http.get("https://api.acme.com/customers", params={"email": email},
83
+ headers={"Authorization": f"Bearer {ctx.credentials.api_key.get_secret_value()}"})
84
+ if resp.status_code == 404:
85
+ raise ToolError(f"no customer has the email {email!r}")
86
+ resp.raise_for_status()
87
+ return Customer.model_validate(resp.json())
88
+
89
+ app = plugin.asgi()
90
+ ```
91
+
92
+ - **The signature is the input schema, the return type is the output schema, the docstring is
93
+ the description the model reads.** Type every parameter; return a pydantic model. Write the
94
+ docstring for a model deciding whether to call the tool.
95
+ - **`effect` is a claim an approver relies on.** `read` = observes only. `write` = creates,
96
+ changes, sends, deletes, pays, or anything a person would want to confirm. When unsure it is
97
+ `write`. Do not mark a tool `read` to make review easier — the platform's advice on where to
98
+ put human review reads this value.
99
+ - **`ctx.http` is the only way out.** It refuses any host not in `Permissions.egress` before
100
+ sending, and in the cluster the network does too. Do not import `requests`/`httpx` and call
101
+ out yourself: it works on a laptop and fails in the cluster. No wildcards, schemes or paths in
102
+ `egress` — `host` or `host:port`, lowercase.
103
+ - **Credentials arrive only inside the platform's call.** Declare them as a pydantic model of
104
+ `credential(...)` fields and read `ctx.credentials`. Never `os.environ`, never a file, never a
105
+ default value. Never log a credential or put it in a `ToolError`.
106
+ - **Failures the model should read are `ToolError(message)`.** Any other exception also becomes
107
+ a tool error, with a less useful message.
108
+ - `ctx.llm` may only call models in `Permissions.models` (or the lone `"any-allowed"`);
109
+ `ctx.storage` is a per-workspace JSON key-value store bounded by `storage_bytes`.
110
+ Everything absent from `Permissions` is denied.
111
+
112
+ <!-- generated:plugin-contract -->
113
+ | What | Must match |
114
+ |---|---|
115
+ | plugin `name` | `^[a-z](?:[a-z0-9-]{0,38}[a-z0-9])?$` |
116
+ | plugin `version` | `^(0\|[1-9][0-9]*)\.(0\|[1-9][0-9]*)\.(0\|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?$` (semver) |
117
+ | tool name (the function's name) | `^[a-z][a-z0-9_]{0,62}$` |
118
+ | credential field name | `^[a-z][a-z0-9_]{0,62}$` |
119
+ | `Permissions.egress` entry | `^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z0-9-]{0,61}[a-z0-9](?::[1-9][0-9]{0,4})?$` |
120
+ | tool `effect` | `read` · `write` |
121
+ | credential `kind` | `secret` · `text` · `select` · `oauth` |
122
+ | `tenancy` | `shared` · `single` |
123
+ <!-- /generated:plugin-contract -->
124
+
125
+ The tool's name is the Python function's name, so name functions to fit the pattern above.
126
+
127
+ ## Testing
128
+
129
+ Use `badgerflow.plugin.testing.PluginTestClient` with `httpx.MockTransport` — tests run offline,
130
+ in-process, with fake credentials:
131
+
132
+ ```python
133
+ from badgerflow.plugin.testing import PluginTestClient, ToolCallError
134
+
135
+ async with PluginTestClient(plugin, credentials={"api_key": "sk-test"},
136
+ transport=httpx.MockTransport(fake_api)) as client:
137
+ customer = await client.call("find_customer", email="ada@example.com")
138
+ ```
139
+
140
+ Test the failure path too (`pytest.raises(ToolCallError, ...)`), and assert the request your
141
+ tool sends carries the credential where the vendor expects it.
142
+
143
+ ## Shipping
144
+
145
+ ```bash
146
+ bf plugin build # docker build, labelled with the manifest hash
147
+ bf plugin validate --image acme-crm:0.1.0 # run non-root, read-only, as the cluster runs it
148
+ bf plugin call find_customer --image acme-crm:0.1.0 --args '{"email": "a@b.co"}' --credentials @creds.json
149
+ bf plugin publish --registry registry.example.internal/plugins --key plugin-signing.pem --keyid <id>
150
+ bf plugin submit --image registry.example.internal/plugins/acme-crm@sha256:<digest>
151
+ ```
152
+
153
+ - Plugins ship only through the customer's **own** OCI registry, by **digest**, signed. The
154
+ platform imports a package only if a key in the operator's trust set signed it.
155
+ - A version is immutable: re-importing `0.1.0` with different bytes is a 409. Any change —
156
+ even a docstring — needs a version bump, then manifest, test, validate, build, publish.
157
+ - **Never commit a signing key or `creds.json`**, never paste a key into a file in the
158
+ workspace, never print one. If the user has no key yet, tell them to generate one themselves.
159
+ - After `submit`, the rest is governed and needs two people: install (opens a release) →
160
+ a *different* person approves → the requester executes → a workspace enables it.
161
+ `bf plugin dev` submits a laptop-served plugin to a **dev** workspace only; production
162
+ refuses the kind.
163
+
164
+ When a step fails: [references/troubleshooting.md](references/troubleshooting.md).
165
+
166
+ ## Before you say it is done
167
+
168
+ 1. `bf plugin manifest` was run after the last edit, and `badgerflow-plugin.yaml` is committed.
169
+ 2. `bf plugin test` and `bf plugin validate` exit 0.
170
+ 3. Every tool's `effect` is honest; `egress` lists only hosts the code calls.
171
+ 4. No credential in code, tests' real values, logs, errors or git.
@@ -0,0 +1,24 @@
1
+ # When a plugin step fails
2
+
3
+ | Symptom | What it means | What to do |
4
+ |---|---|---|
5
+ | Importing `plugin.py` raises a definition error | a name, version, egress host or permission breaks the plugin contract; the message quotes the pattern | fix the value — do not work around it |
6
+ | `bf plugin validate`: *badgerflow-plugin.yaml is what plugin.py generates* fails | `plugin.py` changed after the last manifest | `bf plugin manifest`, commit both files |
7
+ | A tool call fails locally with a refused host | the host is not in `Permissions.egress` | add the exact host (no scheme, no wildcard) — the approver will see it |
8
+ | A tool answers "needs credentials" from a plain MCP client | credentials reach a tool only inside the platform's call envelope | use `bf plugin call … --credentials @creds.json`, or `PluginTestClient(credentials=…)` |
9
+ | `ctx.llm` / `ctx.storage` fail under `bf plugin call` | there is no local platform behind them there | test those with `PluginTestClient` |
10
+ | `bf plugin build` hangs on the first `FROM` line | Docker cannot pull a base image | pre-pull the base images, retry |
11
+ | `bf plugin validate --image` reports a manifest mismatch | the image was built with a different SDK version than the one that generated the manifest | rebuild with `bf plugin build` (it passes the manifest's SDK version) |
12
+ | `publish`: *was not built from this manifest* | the image's hash label is stale | `bf plugin build` again |
13
+ | import: `plugin_signature_untrusted` | the signing key is not in the operator's trust set, or `--keyid` names another entry | sign with a trusted key, or give the operator the trust entry `bf plugin sign` prints |
14
+ | import: `plugin_registry_unreachable` | the platform cannot read the registry | check the reference is `host/repo@sha256:…`; an operator may need to allow the registry host |
15
+ | import: 409, a version is immutable | that version is already imported with other bytes | bump the version |
16
+ | Approve is refused | the requester cannot approve their own release, or lacks the capability | a second person approves |
17
+ | The installed version stays at *approved* | the plugin pod is not healthy yet | an operator checks the plugin pods |
18
+ | An agent's tool picker does not list the tools | the plugin is not enabled for that workspace | enable it on the plugin's page |
19
+ | The agent answers without calling the tool | the model does not support tool calling, or the draft was not saved | pick a tool-calling model; save the draft |
20
+
21
+ Registry credentials for `publish` come from `BADGERFLOW_REGISTRY_USERNAME` /
22
+ `BADGERFLOW_REGISTRY_PASSWORD`, else the user's `docker login`. An encrypted signing key's
23
+ password is read from `BADGERFLOW_SIGNING_KEY_PASSWORD`. These are the user's to set; never ask
24
+ for their values in chat.