Skip to content

feat: add registry discovery entrypoint#19

Merged
joy7758 merged 2 commits intopersona-definition-modulesfrom
discovery-entrypoint
Mar 15, 2026
Merged

feat: add registry discovery entrypoint#19
joy7758 merged 2 commits intopersona-definition-modulesfrom
discovery-entrypoint

Conversation

@joy7758
Copy link
Owner

@joy7758 joy7758 commented Mar 15, 2026

Summary

  • add demos/discovery.py as a shared discovery layer for stage handler, persona definition, and task type modules
  • switch registry loading to collect exported definitions from matching modules instead of hardcoded imports
  • keep compatibility aliases (BUILTIN_*) while standardizing on *_DEFINITIONS exports for future external extensions

Validation

  • 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.py
  • python3 demos/persona_workflow_demo.py
  • python3 demos/persona_workflow_demo.py --task-input demos/product_design_task.json
  • python3 demos/persona_workflow_demo.py --task-input demos/ux_review_task.json
  • python3 demos/persona_workflow_demo.py --task-input /tmp/pop_legacy_task.json
  • python3 - <<'PY' ... collect_module_exports(...) ... PY
  • schema validation for market_research_task.json, product_design_task.json, and ux_review_task.json

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +169 to +173
handlers = collect_module_exports(
"demos",
"STAGE_HANDLER_DEFINITIONS",
exact_names=("stage_handlers",),
prefixes=("stage_handlers_",),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@joy7758 joy7758 merged commit 88f7305 into persona-definition-modules Mar 15, 2026
2 checks passed
joy7758 added a commit that referenced this pull request Mar 15, 2026
* feat: split builtin persona definitions

* feat: add registry discovery entrypoint (#19)

* feat: add registry discovery entrypoint

* feat: support external plugin packages (#20)
joy7758 added a commit that referenced this pull request Mar 15, 2026
* feat: split builtin task type definitions

* feat: split builtin persona definitions (#18)

* feat: split builtin persona definitions

* feat: add registry discovery entrypoint (#19)

* feat: add registry discovery entrypoint

* feat: support external plugin packages (#20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant