tradingcodex 0.2.7__tar.gz → 0.2.8__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 (305) hide show
  1. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/PKG-INFO +1 -1
  2. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/README.md +3 -3
  3. tradingcodex-0.2.8/docs/artifact-supervisor-loop-prd.md +545 -0
  4. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/components.md +2 -2
  5. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/deployment.md +5 -3
  6. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/generated-workspaces.md +18 -1
  7. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/harness.md +21 -6
  8. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/improvement-loop.md +2 -0
  9. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/interfaces-and-surfaces.md +9 -1
  10. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/research-memory-and-artifacts.md +4 -0
  11. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/roles-skills-and-workflows.md +17 -1
  12. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/pyproject.toml +1 -1
  13. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tests/test_python_migration.py +215 -1
  14. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex.egg-info/PKG-INFO +1 -1
  15. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex.egg-info/SOURCES.txt +1 -1
  16. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/doctor.py +12 -0
  17. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/mcp.py +1 -0
  18. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/research.py +2 -0
  19. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/subagents.py +61 -1
  20. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/utils.py +12 -1
  21. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/api.py +13 -0
  22. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/artifact_quality.py +74 -0
  23. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/components.py +4 -4
  24. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/context_budget.py +26 -0
  25. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/harness.py +575 -3
  26. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/research.py +2 -0
  27. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/mcp_runtime.py +1 -0
  28. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/fragments/starter_prompt.html +54 -0
  29. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/research.html +31 -0
  30. tradingcodex-0.2.8/tradingcodex_service/version.py +1 -0
  31. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/web.py +10 -0
  32. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.codex/hooks/tradingcodex_hook.py +199 -5
  33. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.codex/prompts/base_instructions/head-manager.md +11 -0
  34. tradingcodex-0.2.8/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/research_artifact.schema.json +102 -0
  35. tradingcodex-0.2.8/workspace_templates/modules/repo-skills/files/.agents/skills/tcx-workflow/SKILL.md +28 -0
  36. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/tcx-workflow/references/decision-quality-spine.md +11 -0
  37. tradingcodex-0.2.7/docs/investment-decision-quality-prd.md +0 -777
  38. tradingcodex-0.2.7/tradingcodex_service/version.py +0 -1
  39. tradingcodex-0.2.7/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/research_artifact.schema.json +0 -43
  40. tradingcodex-0.2.7/workspace_templates/modules/repo-skills/files/.agents/skills/tcx-workflow/SKILL.md +0 -25
  41. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/CONTRIBUTING.md +0 -0
  42. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/LICENSE +0 -0
  43. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/MANIFEST.in +0 -0
  44. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/NOTICE +0 -0
  45. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/README.md +0 -0
  46. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/TRADEMARKS.md +0 -0
  47. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/__init__.py +0 -0
  48. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/audit/__init__.py +0 -0
  49. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/audit/admin.py +0 -0
  50. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/audit/apps.py +0 -0
  51. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/audit/migrations/0001_initial.py +0 -0
  52. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/audit/migrations/__init__.py +0 -0
  53. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/audit/models.py +0 -0
  54. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/harness/__init__.py +0 -0
  55. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/harness/admin.py +0 -0
  56. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/harness/apps.py +0 -0
  57. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/harness/migrations/0001_initial.py +0 -0
  58. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/harness/migrations/__init__.py +0 -0
  59. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/harness/models.py +0 -0
  60. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/harness/templatetags/__init__.py +0 -0
  61. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/integrations/__init__.py +0 -0
  62. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/integrations/admin.py +0 -0
  63. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/integrations/apps.py +0 -0
  64. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/integrations/migrations/0001_initial.py +0 -0
  65. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/integrations/migrations/0002_brokerconnection_brokeraccount_instrumentmap.py +0 -0
  66. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/integrations/migrations/__init__.py +0 -0
  67. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/integrations/models.py +0 -0
  68. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/mcp/__init__.py +0 -0
  69. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/mcp/admin.py +0 -0
  70. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/mcp/apps.py +0 -0
  71. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/mcp/migrations/0001_initial.py +0 -0
  72. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/mcp/migrations/__init__.py +0 -0
  73. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/mcp/models.py +0 -0
  74. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/mcp/services.py +0 -0
  75. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/__init__.py +0 -0
  76. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/admin.py +0 -0
  77. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/apps.py +0 -0
  78. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/migrations/0001_initial.py +0 -0
  79. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/migrations/0002_approvalreceipt_approved_order_type_and_more.py +0 -0
  80. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/migrations/0003_migrate_orderintent_to_orderticket.py +0 -0
  81. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/migrations/0004_remove_order_intent_compat_fields.py +0 -0
  82. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/migrations/__init__.py +0 -0
  83. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/models.py +0 -0
  84. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/orders/services.py +0 -0
  85. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/policy/__init__.py +0 -0
  86. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/policy/admin.py +0 -0
  87. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/policy/apps.py +0 -0
  88. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/policy/migrations/0001_initial.py +0 -0
  89. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/policy/migrations/__init__.py +0 -0
  90. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/policy/models.py +0 -0
  91. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/policy/services.py +0 -0
  92. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/portfolio/__init__.py +0 -0
  93. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/portfolio/admin.py +0 -0
  94. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/portfolio/apps.py +0 -0
  95. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/portfolio/migrations/0001_initial.py +0 -0
  96. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/portfolio/migrations/0002_brokersyncrun_portfolioledgerevent_reconciliationrun.py +0 -0
  97. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/portfolio/migrations/__init__.py +0 -0
  98. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/portfolio/models.py +0 -0
  99. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/workflows/__init__.py +0 -0
  100. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/workflows/admin.py +0 -0
  101. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/workflows/apps.py +0 -0
  102. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/workflows/migrations/0001_initial.py +0 -0
  103. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/workflows/migrations/__init__.py +0 -0
  104. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/apps/workflows/models.py +0 -0
  105. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/assets/tradingcodex-banner.svg +0 -0
  106. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/core-concepts-and-rules.md +0 -0
  107. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/financial-workflow-references.md +0 -0
  108. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/guardrails.md +0 -0
  109. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/licensing-and-commercialization.md +0 -0
  110. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/product-direction.md +0 -0
  111. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/safety-policy-and-execution.md +0 -0
  112. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/system-architecture.md +0 -0
  113. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/docs/validation-and-test-plan.md +0 -0
  114. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/install.sh +0 -0
  115. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/installation.md +0 -0
  116. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/setup.cfg +0 -0
  117. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tests/test_broker_center_prd.py +0 -0
  118. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tests/test_e2e_user_scenarios.py +0 -0
  119. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex.egg-info/dependency_links.txt +0 -0
  120. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex.egg-info/entry_points.txt +0 -0
  121. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex.egg-info/requires.txt +0 -0
  122. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex.egg-info/top_level.txt +0 -0
  123. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/__init__.py +0 -0
  124. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/__main__.py +0 -0
  125. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/__init__.py +0 -0
  126. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/bootstrap.py +0 -0
  127. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/connectors.py +0 -0
  128. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/db.py +0 -0
  129. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/decision.py +0 -0
  130. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/mode.py +0 -0
  131. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/orders.py +0 -0
  132. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/policy.py +0 -0
  133. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/profile.py +0 -0
  134. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/skills.py +0 -0
  135. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/strategies.py +0 -0
  136. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/workflow.py +0 -0
  137. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/commands/workspaces.py +0 -0
  138. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/generator.py +0 -0
  139. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/mcp_stdio.py +0 -0
  140. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/service_autostart.py +0 -0
  141. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_cli/startup_status.py +0 -0
  142. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/__init__.py +0 -0
  143. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/admin.py +0 -0
  144. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/__init__.py +0 -0
  145. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/agents.py +0 -0
  146. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/audit.py +0 -0
  147. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/brokers.py +0 -0
  148. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/common.py +0 -0
  149. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/decision_packages.py +0 -0
  150. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/markdown_preview.py +0 -0
  151. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/orders.py +0 -0
  152. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/policy.py +0 -0
  153. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/portfolio.py +0 -0
  154. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/runtime.py +0 -0
  155. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/application/runtime_mode.py +0 -0
  156. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/asgi.py +0 -0
  157. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/settings.py +0 -0
  158. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/static/tradingcodex_admin/favicon.svg +0 -0
  159. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/static/tradingcodex_web/app.css +0 -0
  160. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/static/tradingcodex_web/app.js +0 -0
  161. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/static/vendor/htmx/htmx.min.js +0 -0
  162. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/activity.html +0 -0
  163. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/agent_skills.html +0 -0
  164. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/agents.html +0 -0
  165. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/base.html +0 -0
  166. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/brokers.html +0 -0
  167. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/dashboard.html +0 -0
  168. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/decisions.html +0 -0
  169. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/fragments/role_inspector.html +0 -0
  170. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/fragments/topology_canvas.html +0 -0
  171. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/fragments/workspace_card.html +0 -0
  172. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/harness.html +0 -0
  173. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/mcp_router.html +0 -0
  174. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/orders.html +0 -0
  175. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/policy.html +0 -0
  176. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/portfolio.html +0 -0
  177. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/starter_prompt.html +0 -0
  178. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/templates/web/strategies.html +0 -0
  179. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/urls.py +0 -0
  180. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/tradingcodex_service/wsgi.py +0 -0
  181. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/__init__.py +0 -0
  182. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/audit/files/.tradingcodex/audit/README.md +0 -0
  183. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/audit/files/trading/audit/.gitkeep +0 -0
  184. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/audit/module.json +0 -0
  185. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.codex/config.toml +0 -0
  186. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.codex/hooks.json +0 -0
  187. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.codex/rules/tradingcodex.rules +0 -0
  188. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.tradingcodex/capabilities.yaml +0 -0
  189. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.tradingcodex/cli.py +0 -0
  190. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.tradingcodex/config.yaml +0 -0
  191. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.tradingcodex/policies/policy-bindings.yaml +0 -0
  192. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.tradingcodex/policies/principals.yaml +0 -0
  193. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/.tradingcodex/policies/roles.yaml +0 -0
  194. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/AGENTS.md +0 -0
  195. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/pyproject.toml +0 -0
  196. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/files/tcx +0 -0
  197. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/codex-base/module.json +0 -0
  198. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/policies/access-policies.yaml +0 -0
  199. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/policies/restricted-list.yaml +0 -0
  200. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/approval_receipt.schema.json +0 -0
  201. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/audit_event.schema.json +0 -0
  202. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/evidence_pack.schema.json +0 -0
  203. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/execution_result.schema.json +0 -0
  204. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/fundamental_report.schema.json +0 -0
  205. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/news_report.schema.json +0 -0
  206. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/order_ticket.schema.json +0 -0
  207. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/portfolio_review.schema.json +0 -0
  208. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/postmortem_report.schema.json +0 -0
  209. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/risk_report.schema.json +0 -0
  210. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/technical_report.schema.json +0 -0
  211. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/thesis.schema.json +0 -0
  212. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/files/.tradingcodex/schemas/valuation.schema.json +0 -0
  213. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/enforcement-guardrails/module.json +0 -0
  214. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.codex/agents/execution-operator.toml +0 -0
  215. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.codex/agents/fundamental-analyst.toml +0 -0
  216. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.codex/agents/instrument-analyst.toml +0 -0
  217. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.codex/agents/macro-analyst.toml +0 -0
  218. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.codex/agents/news-analyst.toml +0 -0
  219. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.codex/agents/portfolio-manager.toml +0 -0
  220. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.codex/agents/risk-manager.toml +0 -0
  221. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.codex/agents/technical-analyst.toml +0 -0
  222. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.codex/agents/valuation-analyst.toml +0 -0
  223. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.tradingcodex/mainagent/head-manager.yaml +0 -0
  224. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.tradingcodex/mainagent/skill-change-proposals/.gitkeep +0 -0
  225. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/files/.tradingcodex/mainagent/subagent-registry.yaml +0 -0
  226. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/fixed-subagents/module.json +0 -0
  227. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/guidance-guardrails/files/.tradingcodex/guidance/guardrails.md +0 -0
  228. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/guidance-guardrails/files/.tradingcodex/guidance/task-quality-checklist.md +0 -0
  229. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/guidance-guardrails/module.json +0 -0
  230. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/.tradingcodex/policies/information-barriers.yaml +0 -0
  231. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/.tradingcodex/secrets.md +0 -0
  232. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/approvals/.gitkeep +0 -0
  233. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/forecasts/.gitkeep +0 -0
  234. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/market-data/.gitkeep +0 -0
  235. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/orders/approved/.gitkeep +0 -0
  236. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/orders/draft/.gitkeep +0 -0
  237. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/orders/executed/.gitkeep +0 -0
  238. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/orders/rejected/.gitkeep +0 -0
  239. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/portfolio/.gitkeep +0 -0
  240. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/fundamental/.gitkeep +0 -0
  241. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/instrument/.gitkeep +0 -0
  242. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/macro/.gitkeep +0 -0
  243. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/news/.gitkeep +0 -0
  244. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/policy/.gitkeep +0 -0
  245. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/portfolio/.gitkeep +0 -0
  246. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/postmortem/.gitkeep +0 -0
  247. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/risk/.gitkeep +0 -0
  248. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/technical/.gitkeep +0 -0
  249. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/reports/valuation/.gitkeep +0 -0
  250. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/files/trading/research/.gitkeep +0 -0
  251. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/information-barriers/module.json +0 -0
  252. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/paper-trading/module.json +0 -0
  253. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/postmortem/files/.tradingcodex/workflows/postmortem.yaml +0 -0
  254. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/postmortem/module.json +0 -0
  255. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/postmortem/SKILL.md +0 -0
  256. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/postmortem/agents/openai.yaml +0 -0
  257. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/strategy-creator/SKILL.md +0 -0
  258. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/strategy-creator/agents/openai.yaml +0 -0
  259. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/tcx-build/SKILL.md +0 -0
  260. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/tcx-build/agents/openai.yaml +0 -0
  261. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/tcx-server/SKILL.md +0 -0
  262. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/tcx-server/agents/openai.yaml +0 -0
  263. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.agents/skills/tcx-workflow/agents/openai.yaml +0 -0
  264. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/execution-operator/execute-paper-order/SKILL.md +0 -0
  265. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/execution-operator/execute-paper-order/agents/openai.yaml +0 -0
  266. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/fundamental-analyst/fundamental-analysis/SKILL.md +0 -0
  267. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/fundamental-analyst/fundamental-analysis/agents/openai.yaml +0 -0
  268. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/instrument-analyst/instrument-analysis/SKILL.md +0 -0
  269. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/instrument-analyst/instrument-analysis/agents/openai.yaml +0 -0
  270. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/macro-analyst/macro-analysis/SKILL.md +0 -0
  271. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/macro-analyst/macro-analysis/agents/openai.yaml +0 -0
  272. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/news-analyst/news-analysis/SKILL.md +0 -0
  273. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/news-analyst/news-analysis/agents/openai.yaml +0 -0
  274. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/portfolio-manager/create-order-ticket/SKILL.md +0 -0
  275. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/portfolio-manager/create-order-ticket/agents/openai.yaml +0 -0
  276. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/portfolio-manager/portfolio-review/SKILL.md +0 -0
  277. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/portfolio-manager/portfolio-review/agents/openai.yaml +0 -0
  278. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/approve-order/SKILL.md +0 -0
  279. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/approve-order/agents/openai.yaml +0 -0
  280. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/policy-review/SKILL.md +0 -0
  281. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/policy-review/agents/openai.yaml +0 -0
  282. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/review-risk/SKILL.md +0 -0
  283. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/risk-manager/review-risk/agents/openai.yaml +0 -0
  284. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/anti-overfit-validation/SKILL.md +0 -0
  285. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/anti-overfit-validation/agents/openai.yaml +0 -0
  286. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/collect-evidence/SKILL.md +0 -0
  287. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/collect-evidence/agents/openai.yaml +0 -0
  288. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/external-data-source-gate/SKILL.md +0 -0
  289. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/external-data-source-gate/agents/openai.yaml +0 -0
  290. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/forecasting-discipline/SKILL.md +0 -0
  291. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/forecasting-discipline/agents/openai.yaml +0 -0
  292. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/numeric-data-qc/SKILL.md +0 -0
  293. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/numeric-data-qc/agents/openai.yaml +0 -0
  294. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/thesis-scenario-tree/SKILL.md +0 -0
  295. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/shared/thesis-scenario-tree/agents/openai.yaml +0 -0
  296. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/technical-analyst/technical-analysis/SKILL.md +0 -0
  297. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/technical-analyst/technical-analysis/agents/openai.yaml +0 -0
  298. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/valuation-analyst/valuation-review/SKILL.md +0 -0
  299. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/files/.tradingcodex/subagents/skills/valuation-analyst/valuation-review/agents/openai.yaml +0 -0
  300. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/repo-skills/module.json +0 -0
  301. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/stub-execution/module.json +0 -0
  302. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/tradingcodex-mcp/files/.tradingcodex/mcp/enforcer/README.md +0 -0
  303. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/tradingcodex-mcp/files/.tradingcodex/mcp/gateway/README.md +0 -0
  304. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/tradingcodex-mcp/files/.tradingcodex/mcp/server.py +0 -0
  305. {tradingcodex-0.2.7 → tradingcodex-0.2.8}/workspace_templates/modules/tradingcodex-mcp/module.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tradingcodex
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Codex-native trading harness with a Django service plane and approved action boundary.
5
5
  Author: TradingCodex Authors
6
6
  License-Expression: Apache-2.0
@@ -25,7 +25,7 @@ reference, then follow the topic-specific files for implementation-level rules.
25
25
  | [improvement-loop.md](./improvement-loop.md) | Improvement taxonomy: workflow quality, research memory, file-native skill proposals, postmortems, validation feedback | Quality gates, learning loops, postmortems, skill proposal/projection, or validation feedback behavior changes |
26
26
  | [product-direction.md](./product-direction.md) | Product definition, target users, goals, non-goals, scope posture, current defaults | Product direction, release scope, default runtime, product language, or live-execution posture changes |
27
27
  | [financial-workflow-references.md](./financial-workflow-references.md) | Research-backed finance workflow and non-expert UX principles for workflow handoffs and role outputs | User-facing workflow intake, suitability/profile context, plain-English output, or professional finance method framing changes |
28
- | [investment-decision-quality-prd.md](./investment-decision-quality-prd.md) | PRD for vague-prompt routing, Decision Quality Spine, forecast discipline, scenario reasoning, data QC, and anti-overfit validation | Investment-analysis quality, forecasting, decision-support routing, shared decision-quality skills, or forecast/readiness artifact contracts change |
28
+ | [artifact-supervisor-loop-prd.md](./artifact-supervisor-loop-prd.md) | PRD for bounded artifact-driven supervisor loops, follow-up routing, lane escalation, loop state, and Decision Quality Spine preservation | Investment-analysis loop behavior, follow-up routing, decision-support quality, forecasting, shared workflow skills, or artifact loop contracts change |
29
29
  | [system-architecture.md](./system-architecture.md) | Django modular monolith, central DB, app boundaries, service layer, core models, runtime planes | Django apps, DB ownership, service-layer use cases, model ownership, or runtime topology changes |
30
30
  | [interfaces-and-surfaces.md](./interfaces-and-surfaces.md) | Product web, Django Admin, Django Ninja API, MCP endpoint, CLI, generated `./tcx` wrapper | User/admin/API/MCP/CLI surface changes, route changes, or callable tool changes |
31
31
  | [safety-policy-and-execution.md](./safety-policy-and-execution.md) | Guardrail taxonomy, policy checks, approvals, idempotency, execution lifecycle, blocked actions | Policy, permissions, approvals, adapters, execution, restricted list, secret handling, or risk gates change |
@@ -58,8 +58,8 @@ reference, then follow the topic-specific files for implementation-level rules.
58
58
  | Django apps, models, service-layer contracts, or DB ownership | `system-architecture.md` |
59
59
  | Product web, Admin, REST, MCP, CLI, or wrapper behavior | `interfaces-and-surfaces.md` |
60
60
  | Guardrails, policy, permission, approval, execution, adapter, or secret boundary | `guardrails.md`, `safety-policy-and-execution.md`, `core-concepts-and-rules.md` |
61
- | Subagent roster, role responsibilities, skills, strategy behavior, workflow routing, decision-quality routing, or information barriers | `roles-skills-and-workflows.md`, `investment-decision-quality-prd.md`, `core-concepts-and-rules.md` |
62
- | Research memory, artifacts, exports, source snapshots, forecast ledgers, report readiness, or postmortem learning | `improvement-loop.md`, `research-memory-and-artifacts.md`, `investment-decision-quality-prd.md` |
61
+ | Subagent roster, role responsibilities, skills, strategy behavior, workflow routing, decision-quality routing, or information barriers | `roles-skills-and-workflows.md`, `artifact-supervisor-loop-prd.md`, `core-concepts-and-rules.md` |
62
+ | Research memory, artifacts, exports, source snapshots, forecast ledgers, report readiness, or postmortem learning | `improvement-loop.md`, `research-memory-and-artifacts.md`, `artifact-supervisor-loop-prd.md` |
63
63
  | Generated workspace structure, templates, hooks, bootstrap, or MCP config | `generated-workspaces.md` |
64
64
  | Test coverage or validation commands | `validation-and-test-plan.md` |
65
65
  | PyPI/TestPyPI release, CI/CD, or package distribution boundary | `deployment.md`, `product-direction.md` |
@@ -0,0 +1,545 @@
1
+ # Artifact Supervisor Loop PRD
2
+
3
+ Status: draft
4
+ Owner surface: Harness Improvement, fixed-role dispatch, workflow quality,
5
+ research memory, generated workspace templates
6
+ Related docs: `harness.md`, `roles-skills-and-workflows.md`,
7
+ `research-memory-and-artifacts.md`, `improvement-loop.md`,
8
+ `validation-and-test-plan.md`, `generated-workspaces.md`
9
+
10
+ ## Problem
11
+
12
+ TradingCodex already routes investment work through a `head-manager`, fixed
13
+ subagents, source-aware artifacts, handoff states, and approval/execution gates.
14
+ The current workflow is still too close to a one-pass sequence:
15
+
16
+ ```text
17
+ intake -> selected subagents -> role artifacts -> head-manager synthesis
18
+ ```
19
+
20
+ That misses an important property of real research: one role's artifact can
21
+ change the right next question for another role. A news artifact can reveal a
22
+ material driver. A technical artifact can expose a regime shift. A valuation
23
+ artifact can depend on stale or contradictory inputs. A risk artifact can block
24
+ decision support because the upstream evidence is not decision-ready.
25
+
26
+ TradingCodex needs a first-class loop, but not an unconstrained agent chat
27
+ loop. The system must turn role artifacts into bounded, auditable follow-up
28
+ work while preserving selected-team binding, no-overlap role ownership,
29
+ context discipline, approval gates, execution boundaries, and user scope.
30
+
31
+ ## Goals
32
+
33
+ - Replace one-pass dispatch with a bounded, artifact-driven supervisor loop.
34
+ - Let role artifacts propose follow-up work without letting subagents directly
35
+ command other subagents.
36
+ - Let `head-manager` verify artifacts, queue delta follow-ups, request same-role
37
+ revisions, preserve conflicts, propose lane escalation, or stop.
38
+ - Add lane-aware loop policy to routing output and generated hook context.
39
+ - Split role eligibility into initial dispatch, allowed follow-up, and
40
+ escalation-only sets.
41
+ - Extend research artifact metadata with explicit follow-up requests, trigger
42
+ types, materiality, suggested consent posture, and loop provenance.
43
+ - Store loop state as file-native workspace state for Codex inspection,
44
+ context-budget audit, product web preview, concurrent Codex app threads, and
45
+ postmortems.
46
+ - Keep all follow-up briefs compact: artifact path, context summary,
47
+ trigger, delta question, constraints, and blocked actions.
48
+ - Preserve Decision Quality Spine expectations inside the loop rather than
49
+ keeping them as a separate monolithic PRD.
50
+ - Add tests and smoke checks that prove loops improve quality without widening
51
+ authority.
52
+
53
+ ## Non-Goals
54
+
55
+ - No free-form multi-agent chat mesh.
56
+ - No subagent-to-subagent direct dispatch.
57
+ - No head-manager direct investment analysis before accepted role artifacts.
58
+ - No automatic lane expansion outside the routed lane without explicit policy
59
+ permission or user-visible escalation.
60
+ - No weakening of `research_only`, negated scope, selected-team binding,
61
+ information barriers, MCP allowlists, policy gates, approval gates, execution
62
+ gates, or secret boundaries.
63
+ - No loop-driven order approval, execution, broker access, or raw secret access.
64
+ - No new frontend framework, Node runtime, or unrelated dependency.
65
+ - No hidden prompt drift; durable behavior must live in docs, services,
66
+ templates, skills, schemas, hooks, and tests.
67
+ - No language-specific durable routing aliases outside a reviewed localization
68
+ layer.
69
+
70
+ ## Related Agent Loop Patterns
71
+
72
+ The design takes the useful part of modern agent-loop practice and rejects the
73
+ unsafe part for investment workflows.
74
+
75
+ - ReAct shows the value of interleaving reasoning and actions against external
76
+ evidence sources: <https://arxiv.org/abs/2210.03629>.
77
+ - Self-Refine shows that iterative feedback and refinement can improve outputs
78
+ at test time: <https://arxiv.org/abs/2303.17651>.
79
+ - Reflexion shows the value of feedback records and episodic learning for
80
+ agents: <https://openreview.net/forum?id=vAElhFcKW6>.
81
+
82
+ TradingCodex should not copy these patterns as open-ended self-reflection. It
83
+ should implement a product-specific loop where artifacts create explicit
84
+ triggers, `head-manager` acts as the supervisor, and service-layer policy
85
+ decides what can be queued, escalated, blocked, or synthesized.
86
+
87
+ ## Product Model
88
+
89
+ The loop is a supervised artifact state machine:
90
+
91
+ ```text
92
+ user request
93
+ -> intake / lane routing
94
+ -> initial dispatch queue
95
+ -> role artifacts
96
+ -> head-manager verification
97
+ -> loop planner
98
+ -> same-role revise
99
+ -> selected-team follow-up
100
+ -> downstream handoff
101
+ -> conflict challenge
102
+ -> lane escalation proposal
103
+ -> synthesize / waiting / blocked
104
+ ```
105
+
106
+ The loop does not replace the existing handoff states. It makes them runtime
107
+ inputs. Artifact handoff states are not workflow terminal states:
108
+
109
+ | Handoff state | Loop meaning |
110
+ | --- | --- |
111
+ | `accepted` | Artifact can be consumed, synthesized, or used to trigger a bounded follow-up. |
112
+ | `revise` | Owning role must repair missing evidence, stale source posture, scope mismatch, or artifact quality. |
113
+ | `blocked` | The workflow must preserve the block reason and avoid downstream synthesis that depends on the blocked claim. |
114
+ | `waiting` | Required role output does not exist yet; head-manager may provide task briefs but no substantive synthesis. |
115
+
116
+ Workflow terminal actions are separate from artifact states:
117
+
118
+ | Terminal workflow action | Meaning |
119
+ | --- | --- |
120
+ | `synthesize` | Exit criteria are met and synthesis can use accepted artifacts only. |
121
+ | `blocked` | The workflow cannot proceed without violating policy, role boundaries, or evidence quality. |
122
+ | `waiting` | Required artifacts, user consent, or role outputs are absent. |
123
+ | `lane_escalation_proposal` | Useful next work is outside the current lane or consent posture. |
124
+
125
+ ## Role-Team Model
126
+
127
+ Current routing exposes one selected team. Multi-round workflows need three
128
+ sets:
129
+
130
+ ```yaml
131
+ selected_team:
132
+ - roles spawned during initial dispatch
133
+ allowed_followup_team:
134
+ - roles that may receive loop follow-up inside the current lane
135
+ escalation_team:
136
+ - roles that may be proposed but not spawned without lane escalation or user consent
137
+ ```
138
+
139
+ Rules:
140
+
141
+ - `selected_team` remains the initial dispatch contract.
142
+ - `allowed_followup_team` may include selected roles and lane-authorized
143
+ conditional roles, but it is computed only during request classification.
144
+ - `escalation_team` is advisory only; it can produce a lane escalation proposal,
145
+ not automatic dispatch.
146
+ - Loop iterations must not add new roles to `allowed_followup_team`.
147
+ - Explicit negations remove roles and actions from `selected_team`,
148
+ `allowed_followup_team`, and `escalation_team`.
149
+ - Strategy context may explain an escalation proposal, but it must not directly
150
+ expand `allowed_followup_team`.
151
+ - `research_only` must not silently add valuation, portfolio, risk, approval,
152
+ or execution roles.
153
+ - Negated scope always wins before follow-up policy is applied.
154
+ - Execution-sensitive lanes use loop policy for verification only; they do not
155
+ use loops to discover new trade ideas or expand analysis scope.
156
+
157
+ ## Loop Triggers
158
+
159
+ Role artifacts may expose follow-up triggers. The initial required trigger set
160
+ is intentionally small:
161
+
162
+ | Trigger | Meaning |
163
+ | --- | --- |
164
+ | `coverage_gap` | Required evidence, method coverage, or role-owned work is missing. |
165
+ | `freshness_gap` | Source date, retrieved-at posture, market data, or filing/news freshness is inadequate. |
166
+ | `contradiction` | Artifacts conflict, or one artifact contradicts a key assumption used downstream. |
167
+ | `material_driver` | A new driver may affect thesis, valuation, portfolio fit, or risk posture. |
168
+ | `assumption_change` | A scenario, model input, or base/bear/bull case may need revision. |
169
+ | `method_gap` | The requested method needs anti-overfit, numeric QC, valuation, scenario, or source validation not yet present. |
170
+ | `scope_boundary` | The useful next role is outside the current lane or selected/allowed team. |
171
+ | `forecast_gap` | Prediction scope lacks horizon, base rate, target, probability posture, or resolution source. |
172
+ | `profile_gap` | Portfolio/risk/sizing support lacks investor profile, constraints, account state, or strategy context. |
173
+
174
+ Triggers do not automatically create work. They are inputs to the loop planner.
175
+
176
+ ## Artifact Contract
177
+
178
+ Research artifacts should keep the existing handoff metadata and add structured
179
+ follow-up requests when a role believes another pass would materially improve
180
+ the workflow:
181
+
182
+ ```yaml
183
+ follow_up_requests:
184
+ - trigger: material_driver
185
+ suggested_role: valuation-analyst
186
+ question: "Assess whether the material driver changes existing scenario assumptions."
187
+ reason: "The artifact identified a driver not yet reflected in accepted valuation work."
188
+ materiality: high
189
+ requested_by_role: news-analyst
190
+ created_at: "2026-06-30T00:00:00Z"
191
+ source_artifact_id: example-news-20260630
192
+ source_artifact_path: trading/research/example.news.md
193
+ source_artifact_version: 2
194
+ source_artifact_content_hash: "sha256:..."
195
+ trigger_evidence_refs:
196
+ - source_snapshot_id: news-source-001
197
+ - claim_ref: "body:material-driver-1"
198
+ required_inputs:
199
+ - accepted news artifact
200
+ - prior valuation artifact path if present
201
+ suggested_consent_posture: no_consent_expected
202
+ blocked_actions:
203
+ - order_execution
204
+ ```
205
+
206
+ The artifact request is not authoritative about lane scope or consent. The
207
+ planner must recalculate those fields from routing policy:
208
+
209
+ ```json
210
+ {
211
+ "planner_decision": "follow_up_existing_team",
212
+ "policy_within_current_lane": true,
213
+ "policy_requires_user_consent": false,
214
+ "policy_reason": "valuation-analyst is in allowed_followup_team for thesis_review"
215
+ }
216
+ ```
217
+
218
+ Contract rules:
219
+
220
+ - `question` must be delta-only and role-owned.
221
+ - `suggested_role` must be a fixed TradingCodex role.
222
+ - `reason` must cite the artifact finding that created the trigger.
223
+ - `materiality` is one of `low`, `medium`, or `high`.
224
+ - `suggested_consent_posture` is advisory only; the planner computes
225
+ authoritative consent and lane scope.
226
+ - Follow-up requests must not request approval, execution, broker secrets, raw
227
+ broker API access, or policy changes.
228
+ - `next_recipient` remains supported for a single obvious handoff; use
229
+ `follow_up_requests` for multiple or conditional follow-ups.
230
+
231
+ ## Loop Planner
232
+
233
+ `head-manager` runs artifact evaluation before loop planning. Artifact
234
+ evaluation uses this closed result set:
235
+
236
+ | Artifact evaluation | Use when |
237
+ | --- | --- |
238
+ | `accept_artifact` | Artifact is role-owned, source-aware, and ready for downstream use or trigger evaluation. |
239
+ | `revise_artifact` | Owning role stayed in bounds but must repair quality gaps. |
240
+ | `block_artifact` | The artifact identifies a block that prevents dependent workflow progress. |
241
+ | `wait_for_artifact` | Required role output does not exist yet. |
242
+
243
+ The planner then chooses from this closed action set:
244
+
245
+ | Planner action | Use when |
246
+ | --- | --- |
247
+ | `revise_same_role` | Owning role stayed in bounds but must repair quality gaps. |
248
+ | `follow_up_existing_team` | A delta question can be sent to selected or allowed follow-up roles. |
249
+ | `challenge_conflict` | Accepted artifacts materially conflict and need a targeted challenge pass. |
250
+ | `downstream_handoff` | Existing lane order requires a later role to consume accepted artifacts. |
251
+ | `lane_escalation_proposal` | Useful next role or action is outside the current lane or needs consent. |
252
+ | `blocked` | Policy, scope, stale evidence, unsupported instrument, or missing data blocks progress. |
253
+ | `waiting` | Required artifacts or role outputs are absent. |
254
+ | `synthesize` | Exit criteria are met and synthesis can use accepted artifacts only. |
255
+
256
+ The planner must not create new analysis content. It only decides how the
257
+ workflow should move based on artifacts, route policy, and blocked actions.
258
+
259
+ `challenge_conflict` can be sent only to the roles that own the conflicting
260
+ artifacts and the downstream role that must consume them. It must not add an
261
+ unrelated role under the cover of conflict review.
262
+
263
+ `queue` has phase-specific meaning:
264
+
265
+ - Phase 2 queue means an inspectable pending task record plus a generated
266
+ delta brief for `head-manager`; hooks and services do not automatically spawn
267
+ subagents.
268
+ - Phase 3 queue may compute controlled planner actions and delta briefs, but
269
+ it still must use the explicit Codex fixed-role spawn path and must not create
270
+ recursive hook dispatch.
271
+
272
+ The loop planner may flag `forecast_gap` and route a role-owned follow-up. It
273
+ must not create an empty forecast ledger task without an eligible role artifact
274
+ or explicit user forecast request.
275
+
276
+ ## Loop Policy
277
+
278
+ Routing should produce lane-specific loop policy. Initial defaults:
279
+
280
+ ```yaml
281
+ loop_policy:
282
+ max_iterations: 3
283
+ max_followups_per_iteration: 2
284
+ max_same_role_revisions: 1
285
+ max_total_subagent_tasks: 8 # includes initial dispatch, revisions, challenge passes, and follow-ups
286
+ max_loop_subagent_tasks: 4 # excludes initial dispatch
287
+ require_user_consent_for_lane_escalation: true
288
+ synthesize_on_budget_exhaustion: false
289
+ terminal_workflow_actions:
290
+ - synthesize
291
+ - blocked
292
+ - waiting
293
+ - lane_escalation_proposal
294
+ artifact_handoff_states:
295
+ - accepted
296
+ - revise
297
+ - blocked
298
+ - waiting
299
+ ```
300
+
301
+ Lane defaults may tighten these values:
302
+
303
+ | Lane family | Default loop posture |
304
+ | --- | --- |
305
+ | `research_only` | Up to 2 iterations; follow-up inside research roles only; valuation/portfolio/risk become escalation proposals. |
306
+ | `thesis_review` | Up to 3 iterations; challenge pass allowed for material conflicts and scenario assumptions. |
307
+ | `portfolio_risk_review` | Up to 3 iterations; profile gaps remain visible; no order approval or execution. |
308
+ | `order_ticket_draft_gate` | Up to 2 verification iterations; no execution and no new thesis expansion. |
309
+ | `order_ticket_approval_execution_gate` | Verification-only; all service-layer approval, duplicate, connection, policy, and audit gates remain authoritative. |
310
+ | `connector_build` | Investment subagents are not dispatched; build-plane rules apply instead. |
311
+
312
+ Budget exhaustion is not success. If the loop runs out of allowed iterations or
313
+ task budget without meeting exit criteria, the result is `waiting`, `blocked`,
314
+ or a lane escalation proposal, not a forced conclusion.
315
+
316
+ ## Context Contract
317
+
318
+ Every loop follow-up brief must be compact:
319
+
320
+ - original request
321
+ - current lane and constraints
322
+ - source artifact path
323
+ - source artifact `context_summary`
324
+ - exact trigger and reason
325
+ - delta question
326
+ - allowed inputs
327
+ - expected handoff state
328
+ - blocked actions
329
+
330
+ Follow-up briefs must not paste full prior artifacts, full source dumps, long
331
+ chat history, role manuals, or unrelated evidence. Downstream roles should
332
+ open full artifacts only when the summary and path are insufficient.
333
+
334
+ ## Workspace State
335
+
336
+ Add file-native loop state records:
337
+
338
+ ```text
339
+ .tradingcodex/mainagent/workflow-loop-state.json # latest compact summary / pointer
340
+ .tradingcodex/mainagent/workflows/<workflow_run_id>/loop-state.json # canonical run state
341
+ .tradingcodex/mainagent/workflows/<workflow_run_id>/prompt-gate.json
342
+ .tradingcodex/mainagent/session-workflow-runs.json # Codex session/thread -> workflow_run_id map
343
+ ```
344
+
345
+ The latest file is intentionally compact so Codex can inspect the current loop
346
+ without loading every historical run. The canonical run file is the durable
347
+ state for a specific workflow. This prevents two Codex app threads in the same
348
+ workspace from clobbering each other's loop state when prompts are routed at
349
+ nearly the same time.
350
+
351
+ Canonical run-state shape:
352
+
353
+ ```json
354
+ {
355
+ "workflow_run_id": "workflow-20260630T000000Z",
356
+ "lane": "thesis_review",
357
+ "state_path": ".tradingcodex/mainagent/workflows/workflow-20260630T000000Z/loop-state.json",
358
+ "latest_state_path": ".tradingcodex/mainagent/workflow-loop-state.json",
359
+ "session_key": "session_id:codex-thread-1",
360
+ "iteration": 1,
361
+ "loop_policy": {},
362
+ "selected_team": [],
363
+ "allowed_followup_team": [],
364
+ "escalation_team": [],
365
+ "pending_tasks": [],
366
+ "completed_artifacts": [],
367
+ "loop_decisions": [],
368
+ "escalation_proposals": [],
369
+ "blocked_actions": [],
370
+ "stop_reason": ""
371
+ }
372
+ ```
373
+
374
+ The compact latest summary mirrors the current run id, canonical `state_path`,
375
+ pending tasks, completed artifact summaries, planner decisions, escalation
376
+ proposals, blocked actions, and stop reason. Full event history remains
377
+ append-only audit JSONL.
378
+
379
+ Subagent continuation is tracked by run id, role, and subagent session id. A
380
+ subagent start can therefore mean either a new role-local session or a
381
+ continuation/reuse of an active role session, without merging unrelated Codex
382
+ threads that happen to use the same role.
383
+
384
+ ## Service And Template Requirements
385
+
386
+ Update these surfaces together:
387
+
388
+ - `tradingcodex_service/application/harness.py`
389
+ - routing output includes `loop_policy`, `allowed_followup_team`,
390
+ `escalation_team`, and exit criteria.
391
+ - starter prompt and hook context expose compact loop metadata.
392
+ - `tradingcodex_service/application/research.py`
393
+ - artifact export/import preserves `follow_up_requests`.
394
+ - `tradingcodex_service/application/artifact_quality.py`
395
+ - strict quality checks validate follow-up request shape.
396
+ - `workspace_templates/modules/repo-skills/files/.agents/skills/tcx-workflow/SKILL.md`
397
+ - procedure includes artifact intake, loop planner, delta follow-up, lane
398
+ escalation proposal, and stop conditions.
399
+ - Generated workspace hooks
400
+ - maintain run-specific loop state plus the compact latest pointer.
401
+ - map Codex session/thread ids to workflow run ids for concurrent app
402
+ threads in the same workspace.
403
+ - preserve subagent hook isolation and prevent recursive dispatch.
404
+ - CLI
405
+ - `./tcx subagents plan` should show initial dispatch, allowed follow-up,
406
+ escalation-only roles, pending tasks, and stop reason.
407
+ - `./tcx doctor --layer improvement` should check loop state and artifact
408
+ follow-up contract.
409
+ - Product web
410
+ - preview loop state, follow-up requests, escalation proposals, and blocked
411
+ actions without spawning agents, approving orders, or executing orders.
412
+ - first release escalation proposals are read-only; escalation approval stays
413
+ Codex-prompt or CLI driven with explicit user wording captured in audit.
414
+
415
+ ## Safety Requirements
416
+
417
+ - Subagents may propose follow-ups but cannot dispatch them.
418
+ - `head-manager` may queue follow-ups only inside routing policy.
419
+ - Lane escalation must be user-visible when it widens the team, scope, or
420
+ decision posture.
421
+ - Research-only lanes never become valuation, portfolio, risk, approval, or
422
+ execution lanes by loop drift.
423
+ - Natural language never creates approval or execution authority.
424
+ - Blocked actions from routing remain blocked after every loop iteration unless
425
+ an explicit service-layer gate changes them.
426
+ - Conflict handling must preserve unresolved disagreement instead of averaging
427
+ artifacts into false consensus.
428
+ - Weak upstream artifacts return `revise`, `blocked`, or `waiting`; downstream
429
+ roles must not fill missing upstream analysis outside their owned question.
430
+ - Follow-up requests that touch secrets, raw broker APIs, policy mutation,
431
+ approval mutation, or execution are invalid.
432
+
433
+ ## Implementation Plan
434
+
435
+ ### Phase 1: Contracts And Routing Metadata
436
+
437
+ - Add loop policy, allowed follow-up team, escalation team, and exit criteria
438
+ to routing summaries.
439
+ - Add `follow_up_requests` to artifact schema and quality checks.
440
+ - Update `tcx-workflow` and Decision Quality Spine reference text.
441
+ - Add docs and tests for trigger validation and selected-team preservation.
442
+ - Do not add runtime enqueue or automatic subagent spawn.
443
+
444
+ ### Phase 2: Inspectable Assisted Loop
445
+
446
+ - Write canonical run state under
447
+ `.tradingcodex/mainagent/workflows/<workflow_run_id>/loop-state.json` and a
448
+ compact latest pointer at `.tradingcodex/mainagent/workflow-loop-state.json`.
449
+ - Track pending tasks, completed artifacts, planner actions, escalation
450
+ proposals, and stop reason.
451
+ - Track session/thread to workflow-run mapping so multiple Codex app threads can
452
+ run in one attached workspace without overwriting each other's active loop.
453
+ - Extend `./tcx subagents plan`, product web read-only preview, and improvement
454
+ doctor checks.
455
+ - Generate pending task records and delta briefs for `head-manager`.
456
+ - Do not let hooks or services automatically spawn subagents.
457
+
458
+ ### Phase 3: Controlled Runtime Planner
459
+
460
+ - Implement loop planner helpers that read artifacts and return one of the
461
+ closed planner actions.
462
+ - Compute policy-owned lane scope and consent fields.
463
+ - Enqueue delta follow-up briefs inside selected/allowed team through the
464
+ explicit fixed-role spawn path.
465
+ - Generate lane escalation proposals outside allowed team.
466
+ - Enforce task and iteration budgets.
467
+ - Preserve recursive-dispatch prevention in hooks.
468
+
469
+ ### Phase 4: Product Web And Postmortems
470
+
471
+ - Show loop graph, trigger list, follow-up status, escalation proposals, and
472
+ blocked actions in read-only web views.
473
+ - Feed blocked/revised/escalated loops into postmortem and skill proposal
474
+ workflows.
475
+
476
+ ## Validation
477
+
478
+ Minimum tests:
479
+
480
+ - Artifact with `follow_up_requests` to a role inside `allowed_followup_team`
481
+ records a policy-approved delta follow-up.
482
+ - Artifact with `follow_up_requests` to a role outside allowed team creates
483
+ `lane_escalation_proposal` only.
484
+ - `research_only` cannot auto-add valuation, portfolio, risk, approval, or
485
+ execution through loop triggers.
486
+ - `handoff_state=revise` sends only the owning role a revision brief.
487
+ - `handoff_state=blocked` preserves block reason and prevents dependent
488
+ synthesis.
489
+ - Material conflict creates a challenge pass for owning roles without adding
490
+ unrelated roles.
491
+ - Loop budget exhaustion returns `waiting` or `blocked`, not unsupported final
492
+ synthesis.
493
+ - `blocked_actions` survive every loop state transition.
494
+ - `accepted` is validated as an artifact handoff state, not a terminal workflow
495
+ state.
496
+ - Artifact-provided consent posture is advisory; planner-computed policy fields
497
+ are authoritative.
498
+ - Invalid follow-up requests fail strict artifact quality checks.
499
+ - Generated workspace smoke proves hook context, latest loop summary, canonical
500
+ run loop state, role artifacts, and `tcx-workflow` instructions load together.
501
+ - Two routed prompts with different Codex session/thread ids produce different
502
+ canonical loop-state paths, and a subagent event for one session does not
503
+ mutate the other session's pending tasks.
504
+
505
+ Required smoke after implementation:
506
+
507
+ ```bash
508
+ rm -rf /tmp/tradingcodex-loop-smoke
509
+ python -m tradingcodex_cli attach /tmp/tradingcodex-loop-smoke
510
+ cd /tmp/tradingcodex-loop-smoke
511
+ ./tcx doctor
512
+ ./tcx doctor --layer improvement
513
+ ./tcx subagents plan "Analyze NVDA. No order, no trading."
514
+ printf '{"prompt":"Analyze NVDA. No order, no trading.","session_id":"thread-a"}\n' | python .codex/hooks/tradingcodex_hook.py user-prompt-submit
515
+ printf '{"prompt":"Analyze AAPL. No order, no trading.","session_id":"thread-b"}\n' | python .codex/hooks/tradingcodex_hook.py user-prompt-submit
516
+ ./tcx skills list --all
517
+ ```
518
+
519
+ Codex CLI smoke should verify that `head-manager` reports dispatch or waiting
520
+ status, does not produce direct investment analysis before artifacts, preserves
521
+ selected-team limits, and exposes loop state or escalation proposal when
522
+ follow-up is needed.
523
+
524
+ ## Acceptance Criteria
525
+
526
+ - Investment workflows are no longer limited to one artifact pass.
527
+ - Follow-up work is generated from artifacts, not hidden head-manager analysis.
528
+ - Subagents can propose but not dispatch cross-role work.
529
+ - `head-manager` can queue, revise, challenge, escalate, block, wait, or
530
+ synthesize using a closed action set.
531
+ - Loop state is visible in workspace files and audit trails.
532
+ - Context stays compact across iterations.
533
+ - Decision Quality Spine fields still apply inside selected lanes.
534
+ - Approval, execution, broker, secret, and policy boundaries are unchanged.
535
+ - Generated workspace validation catches loop drift, unauthorized expansion,
536
+ malformed follow-up requests, and unsupported synthesis.
537
+
538
+ ## Open Questions
539
+
540
+ - Should `allowed_followup_team` be computed entirely from lane metadata, or
541
+ can future reviewed strategy policy add non-execution conditional follow-up
542
+ roles before classification completes?
543
+ - Should older canonical run files be retained forever, capped by age/count, or
544
+ exported through a workspace cleanup command?
545
+ - Should follow-up materiality affect task priority only, or also loop budget?
@@ -38,7 +38,7 @@ paths clear.
38
38
  | `investment-request-routing` | Classifies user intent and activates fixed-role workflows. | `guardrail.guidance`, `improvement.workflow_quality` |
39
39
  | `fixed-role-dispatch` | Maintains head-manager, fixed subagent routing, and no-overlap handoff boundaries. | `guardrail.guidance`, `guardrail.information_barrier`, `improvement.workflow_quality` |
40
40
  | `research-memory` | Stores source-aware research artifacts, versions, snapshots, and exports. | `improvement.research_memory` |
41
- | `workflow-quality-gates` | Defines lane selection, Decision Quality Spine, handoff acceptance, artifact readiness, claim discipline, and synthesis gates. | `guardrail.guidance`, `improvement.workflow_quality` |
41
+ | `workflow-quality-gates` | Defines lane selection, Artifact Supervisor Loop policy, Decision Quality Spine, handoff acceptance, artifact readiness, claim discipline, and synthesis gates. | `guardrail.guidance`, `improvement.workflow_quality` |
42
42
  | `decision-package` | Wraps workflow plans, artifact paths, profile gaps, blocked actions, and next steps in Codex-readable workspace markdown. | `guardrail.guidance`, `improvement.workflow_quality`, `improvement.research_memory` |
43
43
  | `artifact-quality-contract` | Evaluates workspace artifacts and forecast ledgers for source/as-of posture, claim tags, handoff state, confidence, missing evidence, and next-recipient routing metadata. | `guardrail.guidance`, `improvement.workflow_quality`, `improvement.research_memory` |
44
44
  | `context-efficiency-contract` | Keeps workflows bounded through compact briefs, artifact references, context summaries, source snapshot IDs, targeted full-artifact reads, and `subagents context-audit` validation. | `guardrail.guidance`, `guardrail.information_barrier`, `improvement.workflow_quality`, `improvement.context_efficiency` |
@@ -52,7 +52,7 @@ paths clear.
52
52
  | `execution-boundary` | Keeps execution behind role action allowlists, approval, duplicate-request, connection, and audit checks. | `guardrail.enforcement`, `guardrail.information_barrier` |
53
53
  | `audit-ledger` | Records policy, MCP, order, approval, execution, and hook events. | `guardrail.enforcement`, `improvement.validation_feedback` |
54
54
  | `skill-improvement-loop` | Keeps core skills, strategy skills, and role-local optional skill files visible through validation, generated manifests, and read-only status. | `improvement.skill_evolution`, `guardrail.guidance` |
55
- | `postmortem-loop` | Turns rejected orders, process failures, thesis changes, and executions into improvements. | `improvement.postmortems`, `improvement.validation_feedback` |
55
+ | `postmortem-loop` | Turns rejected orders, process failures, thesis changes, artifact-loop blocks/escalations, and executions into improvements. | `improvement.postmortems`, `improvement.validation_feedback` |
56
56
  | `paper-execution` | Provides experimental local paper and validation-only execution paths behind the approved action boundary. | `guardrail.enforcement` |
57
57
 
58
58
  ## Runtime Surfaces
@@ -141,7 +141,7 @@ python3.11 -m venv /tmp/tcx-testpypi
141
141
  /tmp/tcx-testpypi/bin/pip install \
142
142
  --index-url https://test.pypi.org/simple/ \
143
143
  --extra-index-url https://pypi.org/simple/ \
144
- tradingcodex==0.2.7
144
+ tradingcodex==0.2.8
145
145
  rm -rf /tmp/tcx-testpypi-smoke
146
146
  mkdir -p /tmp/tcx-testpypi-smoke
147
147
  cd /tmp/tcx-testpypi-smoke
@@ -170,7 +170,7 @@ After the PyPI workflow completes:
170
170
 
171
171
  ```bash
172
172
  python3.11 -m venv /tmp/tcx-pypi
173
- /tmp/tcx-pypi/bin/pip install tradingcodex==0.2.7
173
+ /tmp/tcx-pypi/bin/pip install tradingcodex==0.2.8
174
174
  rm -rf /tmp/tcx-pypi-smoke
175
175
  mkdir -p /tmp/tcx-pypi-smoke
176
176
  cd /tmp/tcx-pypi-smoke
@@ -259,7 +259,9 @@ Use PEP 440 versions:
259
259
  boundaries after `0.2.5`
260
260
  - `0.2.7` for Codex-native decision packages and investment decision quality
261
261
  spine improvements after `0.2.6`
262
- - later patch releases for compatible fixes after `0.2.7`
262
+ - `0.2.8` for artifact-supervisor loop concurrency and run-specific workflow
263
+ loop state after `0.2.7`
264
+ - later patch releases for compatible fixes after `0.2.8`
263
265
  - pre-releases such as `0.3.0a1`, `0.3.0b1`, or `0.3.0rc1` when preparing
264
266
  the next minor contract
265
267
 
@@ -115,7 +115,7 @@ Generated workspaces contain:
115
115
  first-read experience clear for non-expert users
116
116
  - context-budget audit: `./tcx subagents context-audit --strict` inspects the
117
117
  latest prompt gate, prompt-gate history, compact hook context, subagent
118
- session state, and research artifacts after long multi-subagent runs; it
118
+ session state, workflow loop state, and research artifacts after long multi-subagent runs; it
119
119
  fails strict mode when handoff artifacts lack `context_summary`, compact gate
120
120
  history grows beyond budget, or gate/state/history payloads look like pasted
121
121
  markdown artifacts, and warns when reader-first fields are missing
@@ -123,6 +123,17 @@ Generated workspaces contain:
123
123
  keeps total counters plus recent active/completed/event records for Codex
124
124
  context; the full event stream remains in
125
125
  `trading/audit/subagent-session-events.jsonl`
126
+ - compact workflow loop state: `.tradingcodex/mainagent/workflow-loop-state.json`
127
+ is the latest summary and pointer; the canonical state for each routed prompt
128
+ lives under `.tradingcodex/mainagent/workflows/<workflow_run_id>/loop-state.json`
129
+ with the matching prompt gate beside it. The state records selected team,
130
+ allowed follow-up team, escalation-only roles, loop policy, pending tasks,
131
+ planner decisions, escalation proposals, blocked actions, and stop reason
132
+ without spawning subagents recursively
133
+ - Codex session/thread routing map:
134
+ `.tradingcodex/mainagent/session-workflow-runs.json` maps a Codex app session
135
+ key to the active `workflow_run_id`, so two app threads in one attached
136
+ workspace can continue different loops without clobbering each other
126
137
  - fixed subagents configured for `model = "gpt-5.5"` and `model_reasoning_effort = "high"`
127
138
  - fixed subagent `nickname_candidates` set to a single item matching the exact role `name`
128
139
  - fixed subagent identities kept in `.codex/agents/*.toml` `developer_instructions`, as required by Codex custom agent files
@@ -382,6 +393,12 @@ enforcement.
382
393
  - compact hook `additionalContext`; the full generated starter prompt remains
383
394
  in `.tradingcodex/mainagent/latest-user-prompt-gate.json` and is loaded only
384
395
  when the compact gate is insufficient
396
+ - compact Artifact Supervisor Loop metadata in hook context for
397
+ `allowed_followup_team`, `escalation_team`, `loop_policy`, the latest loop
398
+ summary, and the canonical run-specific loop-state path
399
+ - assisted loop planner previews through `./tcx subagents loop --artifact
400
+ <path>`, with optional `--record` limited to file-native pending tasks,
401
+ planner decisions, escalation proposals, blocked actions, and stop reason
385
402
  - execution negation routing such as "no order" and "no trading"
386
403
  - strategy authoring prompts remain in `strategy-creator`/strategy CRUD scope
387
404
  instead of auto-dispatching fixed investment subagents