feat: add registry discovery entrypoint#19
feat: add registry discovery entrypoint#19joy7758 merged 2 commits intopersona-definition-modulesfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0435fccfd6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| handlers = collect_module_exports( | ||
| "demos", | ||
| "STAGE_HANDLER_DEFINITIONS", | ||
| exact_names=("stage_handlers",), | ||
| prefixes=("stage_handlers_",), |
There was a problem hiding this comment.
Guard against empty handler discovery during circular imports
load_builtin_registry() now discovers handlers via collect_module_exports(...), but if demos.stage_handlers is imported before demos.task_registry, this call runs while demos.stage_handlers is only partially initialized. Because discovery falls back to an empty tuple when STAGE_HANDLER_DEFINITIONS is not yet set, no built-in handlers are registered and later build_stage_output/stage_handler_id_for calls fail with unknown handler errors. This is a regression from the previous side-effect registration path, which still populated handlers in that import order.
Useful? React with 👍 / 👎.
Summary
demos/discovery.pyas a shared discovery layer for stage handler, persona definition, and task type modulesBUILTIN_*) while standardizing on*_DEFINITIONSexports for future external extensionsValidation
python3 -m compileall demos/discovery.py demos/task_registry.py demos/stage_handlers.py demos/persona_definitions.py demos/task_types.py demos/persona_workflow_demo.pypython3 demos/persona_workflow_demo.pypython3 demos/persona_workflow_demo.py --task-input demos/product_design_task.jsonpython3 demos/persona_workflow_demo.py --task-input demos/ux_review_task.jsonpython3 demos/persona_workflow_demo.py --task-input /tmp/pop_legacy_task.jsonpython3 - <<'PY' ... collect_module_exports(...) ... PYmarket_research_task.json,product_design_task.json, andux_review_task.json