code-factory-agent 0.1.1__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 (243) hide show
  1. code_factory_agent-0.1.1/.github/workflows/publish.yml +77 -0
  2. code_factory_agent-0.1.1/.gitignore +9 -0
  3. code_factory_agent-0.1.1/AGENTS.md +36 -0
  4. code_factory_agent-0.1.1/LICENSE +21 -0
  5. code_factory_agent-0.1.1/Makefile +98 -0
  6. code_factory_agent-0.1.1/PKG-INFO +268 -0
  7. code_factory_agent-0.1.1/README.md +212 -0
  8. code_factory_agent-0.1.1/SPEC.md +2245 -0
  9. code_factory_agent-0.1.1/UBIQUITOUS_LANGUAGE.md +66 -0
  10. code_factory_agent-0.1.1/docs/cli.md +105 -0
  11. code_factory_agent-0.1.1/docs/code-factory-overview.drawio +177 -0
  12. code_factory_agent-0.1.1/docs/code-factory-overview.drawio.svg +4 -0
  13. code_factory_agent-0.1.1/docs/code-factory-quality-gates.drawio +103 -0
  14. code_factory_agent-0.1.1/docs/code-factory-quality-gates.drawio.svg +4 -0
  15. code_factory_agent-0.1.1/docs/code-factory-typical-workflow.drawio +133 -0
  16. code_factory_agent-0.1.1/docs/code-factory-typical-workflow.drawio.svg +4 -0
  17. code_factory_agent-0.1.1/docs/code-factory-typical-workflow.svg +3 -0
  18. code_factory_agent-0.1.1/docs/images/code-factory-dashboard.png +0 -0
  19. code_factory_agent-0.1.1/docs/observability.md +65 -0
  20. code_factory_agent-0.1.1/docs/specs/features/native-ai-review.md +139 -0
  21. code_factory_agent-0.1.1/docs/ticket-cli.md +83 -0
  22. code_factory_agent-0.1.1/docs/workflow/README.md +30 -0
  23. code_factory_agent-0.1.1/docs/workflow/frontmatter.md +603 -0
  24. code_factory_agent-0.1.1/docs/workflow/prompt-template.md +245 -0
  25. code_factory_agent-0.1.1/pyproject.toml +81 -0
  26. code_factory_agent-0.1.1/src/code_factory/__init__.py +5 -0
  27. code_factory_agent-0.1.1/src/code_factory/__main__.py +5 -0
  28. code_factory_agent-0.1.1/src/code_factory/application/__init__.py +5 -0
  29. code_factory_agent-0.1.1/src/code_factory/application/bootstrap.py +283 -0
  30. code_factory_agent-0.1.1/src/code_factory/application/bootstrap_assets/skills/commit/SKILL.md +75 -0
  31. code_factory_agent-0.1.1/src/code_factory/application/bootstrap_assets/skills/debug/SKILL.md +119 -0
  32. code_factory_agent-0.1.1/src/code_factory/application/bootstrap_assets/skills/land/SKILL.md +230 -0
  33. code_factory_agent-0.1.1/src/code_factory/application/bootstrap_assets/skills/land/land_watch.py.asset +621 -0
  34. code_factory_agent-0.1.1/src/code_factory/application/bootstrap_assets/skills/linear/SKILL.md +74 -0
  35. code_factory_agent-0.1.1/src/code_factory/application/bootstrap_assets/skills/pull/SKILL.md +115 -0
  36. code_factory_agent-0.1.1/src/code_factory/application/bootstrap_assets/skills/push/SKILL.md +121 -0
  37. code_factory_agent-0.1.1/src/code_factory/application/dashboard/__init__.py +19 -0
  38. code_factory_agent-0.1.1/src/code_factory/application/dashboard/dashboard.py +219 -0
  39. code_factory_agent-0.1.1/src/code_factory/application/dashboard/dashboard_diagnostics.py +135 -0
  40. code_factory_agent-0.1.1/src/code_factory/application/dashboard/dashboard_format.py +188 -0
  41. code_factory_agent-0.1.1/src/code_factory/application/dashboard/dashboard_render.py +291 -0
  42. code_factory_agent-0.1.1/src/code_factory/application/dashboard/dashboard_workflow.py +76 -0
  43. code_factory_agent-0.1.1/src/code_factory/application/logging.py +90 -0
  44. code_factory_agent-0.1.1/src/code_factory/application/project_links.py +36 -0
  45. code_factory_agent-0.1.1/src/code_factory/application/service.py +288 -0
  46. code_factory_agent-0.1.1/src/code_factory/cli.py +273 -0
  47. code_factory_agent-0.1.1/src/code_factory/coding_agents/__init__.py +19 -0
  48. code_factory_agent-0.1.1/src/code_factory/coding_agents/base.py +70 -0
  49. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/__init__.py +5 -0
  50. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/__init__.py +6 -0
  51. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/client.py +300 -0
  52. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/messages.py +249 -0
  53. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/policies.py +59 -0
  54. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/protocol.py +193 -0
  55. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/reviews.py +82 -0
  56. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/routing.py +63 -0
  57. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/session.py +72 -0
  58. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/streams.py +82 -0
  59. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/structured_output.py +65 -0
  60. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/tool_response.py +27 -0
  61. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/app_server/turns.py +265 -0
  62. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/config.py +174 -0
  63. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/runtime.py +109 -0
  64. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/__init__.py +3 -0
  65. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/registry.py +273 -0
  66. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/results.py +47 -0
  67. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/tracker/__init__.py +16 -0
  68. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/tracker/attachment_tools.py +62 -0
  69. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/tracker/comment_tools.py +64 -0
  70. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/tracker/issue_read.py +102 -0
  71. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/tracker/issue_write.py +108 -0
  72. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/tracker/linear_errors.py +9 -0
  73. code_factory_agent-0.1.1/src/code_factory/coding_agents/codex/tools/tracker/tracker_context.py +24 -0
  74. code_factory_agent-0.1.1/src/code_factory/coding_agents/review_models.py +133 -0
  75. code_factory_agent-0.1.1/src/code_factory/config/__init__.py +36 -0
  76. code_factory_agent-0.1.1/src/code_factory/config/defaults.py +38 -0
  77. code_factory_agent-0.1.1/src/code_factory/config/models.py +134 -0
  78. code_factory_agent-0.1.1/src/code_factory/config/parsing.py +159 -0
  79. code_factory_agent-0.1.1/src/code_factory/config/review.py +87 -0
  80. code_factory_agent-0.1.1/src/code_factory/config/utils.py +226 -0
  81. code_factory_agent-0.1.1/src/code_factory/config/validation.py +20 -0
  82. code_factory_agent-0.1.1/src/code_factory/errors.py +81 -0
  83. code_factory_agent-0.1.1/src/code_factory/issues.py +54 -0
  84. code_factory_agent-0.1.1/src/code_factory/observability/__init__.py +3 -0
  85. code_factory_agent-0.1.1/src/code_factory/observability/api/__init__.py +4 -0
  86. code_factory_agent-0.1.1/src/code_factory/observability/api/client.py +54 -0
  87. code_factory_agent-0.1.1/src/code_factory/observability/api/payloads.py +181 -0
  88. code_factory_agent-0.1.1/src/code_factory/observability/api/server.py +222 -0
  89. code_factory_agent-0.1.1/src/code_factory/observability/cli_support.py +49 -0
  90. code_factory_agent-0.1.1/src/code_factory/observability/runtime_metadata.py +62 -0
  91. code_factory_agent-0.1.1/src/code_factory/project_init.py +224 -0
  92. code_factory_agent-0.1.1/src/code_factory/prompts/__init__.py +3 -0
  93. code_factory_agent-0.1.1/src/code_factory/prompts/builder.py +36 -0
  94. code_factory_agent-0.1.1/src/code_factory/prompts/review_assets/__init__.py +27 -0
  95. code_factory_agent-0.1.1/src/code_factory/prompts/review_assets/codex-review-base.md +87 -0
  96. code_factory_agent-0.1.1/src/code_factory/prompts/review_assets/review-output.json +85 -0
  97. code_factory_agent-0.1.1/src/code_factory/prompts/values.py +25 -0
  98. code_factory_agent-0.1.1/src/code_factory/runtime/__init__.py +23 -0
  99. code_factory_agent-0.1.1/src/code_factory/runtime/activity_phase.py +35 -0
  100. code_factory_agent-0.1.1/src/code_factory/runtime/messages.py +92 -0
  101. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/__init__.py +4 -0
  102. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/actor.py +252 -0
  103. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/context.py +105 -0
  104. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/control.py +85 -0
  105. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/dispatching.py +201 -0
  106. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/failure_policy.py +64 -0
  107. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/models.py +65 -0
  108. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/policy.py +102 -0
  109. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/reconciliation.py +253 -0
  110. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/recovery.py +93 -0
  111. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/retrying.py +206 -0
  112. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/snapshot.py +128 -0
  113. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/tokens.py +112 -0
  114. code_factory_agent-0.1.1/src/code_factory/runtime/orchestration/workpad_autosync.py +161 -0
  115. code_factory_agent-0.1.1/src/code_factory/runtime/subprocess/__init__.py +5 -0
  116. code_factory_agent-0.1.1/src/code_factory/runtime/subprocess/process_tree.py +112 -0
  117. code_factory_agent-0.1.1/src/code_factory/runtime/support.py +20 -0
  118. code_factory_agent-0.1.1/src/code_factory/runtime/worker/__init__.py +3 -0
  119. code_factory_agent-0.1.1/src/code_factory/runtime/worker/actor.py +254 -0
  120. code_factory_agent-0.1.1/src/code_factory/runtime/worker/quality_gates/__init__.py +10 -0
  121. code_factory_agent-0.1.1/src/code_factory/runtime/worker/quality_gates/ai_review.py +280 -0
  122. code_factory_agent-0.1.1/src/code_factory/runtime/worker/quality_gates/completion.py +270 -0
  123. code_factory_agent-0.1.1/src/code_factory/runtime/worker/quality_gates/pre_complete_feedback.py +117 -0
  124. code_factory_agent-0.1.1/src/code_factory/runtime/worker/quality_gates/readiness.py +98 -0
  125. code_factory_agent-0.1.1/src/code_factory/runtime/worker/results.py +113 -0
  126. code_factory_agent-0.1.1/src/code_factory/runtime/worker/utils.py +22 -0
  127. code_factory_agent-0.1.1/src/code_factory/runtime/worker/workpad.py +107 -0
  128. code_factory_agent-0.1.1/src/code_factory/structured_results.py +124 -0
  129. code_factory_agent-0.1.1/src/code_factory/trackers/__init__.py +18 -0
  130. code_factory_agent-0.1.1/src/code_factory/trackers/base.py +70 -0
  131. code_factory_agent-0.1.1/src/code_factory/trackers/bootstrap.py +41 -0
  132. code_factory_agent-0.1.1/src/code_factory/trackers/cli.py +275 -0
  133. code_factory_agent-0.1.1/src/code_factory/trackers/cli_support.py +79 -0
  134. code_factory_agent-0.1.1/src/code_factory/trackers/linear/__init__.py +18 -0
  135. code_factory_agent-0.1.1/src/code_factory/trackers/linear/bootstrap.py +255 -0
  136. code_factory_agent-0.1.1/src/code_factory/trackers/linear/bootstrap_queries.py +33 -0
  137. code_factory_agent-0.1.1/src/code_factory/trackers/linear/client.py +268 -0
  138. code_factory_agent-0.1.1/src/code_factory/trackers/linear/config.py +65 -0
  139. code_factory_agent-0.1.1/src/code_factory/trackers/linear/decoding.py +213 -0
  140. code_factory_agent-0.1.1/src/code_factory/trackers/linear/graphql.py +102 -0
  141. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/__init__.py +4 -0
  142. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/ops.py +9 -0
  143. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/ops_common.py +209 -0
  144. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/ops_files.py +57 -0
  145. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/ops_normalize.py +158 -0
  146. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/ops_queries.py +296 -0
  147. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/ops_read.py +224 -0
  148. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/ops_resolution.py +49 -0
  149. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/ops_resolution_service.py +190 -0
  150. code_factory_agent-0.1.1/src/code_factory/trackers/linear/ops/ops_write.py +243 -0
  151. code_factory_agent-0.1.1/src/code_factory/trackers/linear/project_resolution.py +80 -0
  152. code_factory_agent-0.1.1/src/code_factory/trackers/linear/queries.py +151 -0
  153. code_factory_agent-0.1.1/src/code_factory/trackers/memory/__init__.py +5 -0
  154. code_factory_agent-0.1.1/src/code_factory/trackers/memory/tracker.py +101 -0
  155. code_factory_agent-0.1.1/src/code_factory/trackers/tooling.py +111 -0
  156. code_factory_agent-0.1.1/src/code_factory/trackers/user_errors.py +103 -0
  157. code_factory_agent-0.1.1/src/code_factory/workflow/__init__.py +15 -0
  158. code_factory_agent-0.1.1/src/code_factory/workflow/loader.py +188 -0
  159. code_factory_agent-0.1.1/src/code_factory/workflow/models.py +133 -0
  160. code_factory_agent-0.1.1/src/code_factory/workflow/profiles/__init__.py +20 -0
  161. code_factory_agent-0.1.1/src/code_factory/workflow/profiles/review_profiles.py +293 -0
  162. code_factory_agent-0.1.1/src/code_factory/workflow/profiles/state_controls.py +92 -0
  163. code_factory_agent-0.1.1/src/code_factory/workflow/profiles/state_profiles.py +272 -0
  164. code_factory_agent-0.1.1/src/code_factory/workflow/profiles/state_values.py +62 -0
  165. code_factory_agent-0.1.1/src/code_factory/workflow/store.py +195 -0
  166. code_factory_agent-0.1.1/src/code_factory/workflow/template.py +114 -0
  167. code_factory_agent-0.1.1/src/code_factory/workflow/templates/default.md +340 -0
  168. code_factory_agent-0.1.1/src/code_factory/workspace/__init__.py +4 -0
  169. code_factory_agent-0.1.1/src/code_factory/workspace/ai_review/__init__.py +17 -0
  170. code_factory_agent-0.1.1/src/code_factory/workspace/ai_review/ai_review_feedback.py +99 -0
  171. code_factory_agent-0.1.1/src/code_factory/workspace/ai_review/ai_review_prompt.py +106 -0
  172. code_factory_agent-0.1.1/src/code_factory/workspace/hooks.py +116 -0
  173. code_factory_agent-0.1.1/src/code_factory/workspace/manager.py +170 -0
  174. code_factory_agent-0.1.1/src/code_factory/workspace/models.py +10 -0
  175. code_factory_agent-0.1.1/src/code_factory/workspace/paths.py +143 -0
  176. code_factory_agent-0.1.1/src/code_factory/workspace/repository.py +256 -0
  177. code_factory_agent-0.1.1/src/code_factory/workspace/review/__init__.py +11 -0
  178. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_browser.py +39 -0
  179. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_comments.py +47 -0
  180. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_models.py +36 -0
  181. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_observer.py +45 -0
  182. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_output.py +65 -0
  183. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_ports.py +81 -0
  184. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_resolution.py +211 -0
  185. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_runner.py +269 -0
  186. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_session.py +95 -0
  187. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_shell.py +29 -0
  188. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_surface.py +286 -0
  189. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_templates.py +129 -0
  190. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_textual_app.py +296 -0
  191. code_factory_agent-0.1.1/src/code_factory/workspace/review/review_textual_composer.py +192 -0
  192. code_factory_agent-0.1.1/src/code_factory/workspace/utils.py +42 -0
  193. code_factory_agent-0.1.1/src/code_factory/workspace/workpad.py +23 -0
  194. code_factory_agent-0.1.1/tests/__init__.py +1 -0
  195. code_factory_agent-0.1.1/tests/application/__init__.py +1 -0
  196. code_factory_agent-0.1.1/tests/application/test_application_dashboard.py +809 -0
  197. code_factory_agent-0.1.1/tests/application/test_bootstrap_units.py +336 -0
  198. code_factory_agent-0.1.1/tests/architecture/test_architecture.py +235 -0
  199. code_factory_agent-0.1.1/tests/cli/__init__.py +1 -0
  200. code_factory_agent-0.1.1/tests/cli/test_cli_review.py +72 -0
  201. code_factory_agent-0.1.1/tests/cli/test_cli_steering.py +235 -0
  202. code_factory_agent-0.1.1/tests/coding_agents/__init__.py +1 -0
  203. code_factory_agent-0.1.1/tests/coding_agents/test_app_server.py +232 -0
  204. code_factory_agent-0.1.1/tests/coding_agents/test_codex_edge_units.py +994 -0
  205. code_factory_agent-0.1.1/tests/coding_agents/test_coding_agents_and_observability.py +1424 -0
  206. code_factory_agent-0.1.1/tests/coding_agents/test_dynamic_tool.py +385 -0
  207. code_factory_agent-0.1.1/tests/conftest.py +140 -0
  208. code_factory_agent-0.1.1/tests/integration/__init__.py +1 -0
  209. code_factory_agent-0.1.1/tests/integration/helpers.py +57 -0
  210. code_factory_agent-0.1.1/tests/integration/support.py +403 -0
  211. code_factory_agent-0.1.1/tests/integration/test_failure_recovery.py +505 -0
  212. code_factory_agent-0.1.1/tests/integration/test_service_observability.py +107 -0
  213. code_factory_agent-0.1.1/tests/integration/test_steering.py +49 -0
  214. code_factory_agent-0.1.1/tests/integration/test_workflow_lifecycle.py +525 -0
  215. code_factory_agent-0.1.1/tests/runtime/__init__.py +1 -0
  216. code_factory_agent-0.1.1/tests/runtime/test_control_plane.py +564 -0
  217. code_factory_agent-0.1.1/tests/runtime/test_native_review_units.py +1090 -0
  218. code_factory_agent-0.1.1/tests/runtime/test_runtime_edge_units.py +991 -0
  219. code_factory_agent-0.1.1/tests/runtime/test_runtime_units.py +2716 -0
  220. code_factory_agent-0.1.1/tests/runtime/test_worker_orchestrator.py +174 -0
  221. code_factory_agent-0.1.1/tests/runtime/test_workpad_autosync.py +406 -0
  222. code_factory_agent-0.1.1/tests/test_core.py +281 -0
  223. code_factory_agent-0.1.1/tests/test_coverage_helpers.py +772 -0
  224. code_factory_agent-0.1.1/tests/test_foundations.py +1971 -0
  225. code_factory_agent-0.1.1/tests/test_project_init.py +421 -0
  226. code_factory_agent-0.1.1/tests/test_project_name_coverage.py +342 -0
  227. code_factory_agent-0.1.1/tests/test_verify_remaining_coverage.py +615 -0
  228. code_factory_agent-0.1.1/tests/trackers/__init__.py +1 -0
  229. code_factory_agent-0.1.1/tests/trackers/test_linear_ops_coverage.py +837 -0
  230. code_factory_agent-0.1.1/tests/trackers/test_linear_ops_remaining_coverage.py +379 -0
  231. code_factory_agent-0.1.1/tests/trackers/test_trackers_units.py +1287 -0
  232. code_factory_agent-0.1.1/tests/workflow/__init__.py +1 -0
  233. code_factory_agent-0.1.1/tests/workflow/test_workflow_ai_review.py +398 -0
  234. code_factory_agent-0.1.1/tests/workflow/test_workflow_template_defaults.py +32 -0
  235. code_factory_agent-0.1.1/tests/workspace/__init__.py +1 -0
  236. code_factory_agent-0.1.1/tests/workspace/test_ai_review_triggers.py +336 -0
  237. code_factory_agent-0.1.1/tests/workspace/test_ai_review_units.py +235 -0
  238. code_factory_agent-0.1.1/tests/workspace/test_review_comments.py +71 -0
  239. code_factory_agent-0.1.1/tests/workspace/test_review_ports.py +155 -0
  240. code_factory_agent-0.1.1/tests/workspace/test_review_session_units.py +272 -0
  241. code_factory_agent-0.1.1/tests/workspace/test_review_textual.py +463 -0
  242. code_factory_agent-0.1.1/tests/workspace/test_review_units.py +653 -0
  243. code_factory_agent-0.1.1/uv.lock +1337 -0
@@ -0,0 +1,77 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ verify:
13
+ name: Verify And Build
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Check out repository
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.12"
24
+
25
+ - name: Set up uv
26
+ uses: astral-sh/setup-uv@v6
27
+
28
+ - name: Validate tag matches package version
29
+ env:
30
+ GITHUB_REF_NAME: ${{ github.ref_name }}
31
+ run: |
32
+ python - <<'PY'
33
+ import os
34
+ import tomllib
35
+ from pathlib import Path
36
+
37
+ tag = os.environ["GITHUB_REF_NAME"]
38
+ version = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
39
+ expected = f"v{version}"
40
+ if tag != expected:
41
+ raise SystemExit(
42
+ f"Release tag {tag!r} does not match pyproject version {version!r}. "
43
+ f"Expected {expected!r}."
44
+ )
45
+ PY
46
+
47
+ - name: Run full verify gate
48
+ run: make verify
49
+
50
+ - name: Build distribution artifacts
51
+ run: uv build
52
+
53
+ - name: Upload distribution artifacts
54
+ uses: actions/upload-artifact@v4
55
+ with:
56
+ name: pypi-dist
57
+ path: dist/*
58
+
59
+ publish:
60
+ name: Publish To PyPI
61
+ needs: verify
62
+ runs-on: ubuntu-latest
63
+ environment:
64
+ name: pypi
65
+ permissions:
66
+ contents: read
67
+ id-token: write
68
+
69
+ steps:
70
+ - name: Download distribution artifacts
71
+ uses: actions/download-artifact@v4
72
+ with:
73
+ name: pypi-dist
74
+ path: dist
75
+
76
+ - name: Publish package to PyPI
77
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,9 @@
1
+ .venv/
2
+ .pytest_cache/
3
+ .idea/
4
+ __pycache__/
5
+ *.py[cod]
6
+ .coverage
7
+ coverage.json
8
+ htmlcov/
9
+ .linear.toml
@@ -0,0 +1,36 @@
1
+ # AGENTS.md
2
+
3
+ ## 1. Overview
4
+ This package is a long-running automation service that reads tracker work, creates isolated per-issue workspaces, and runs coding-agent sessions inside them. It exists to keep workflow policy in-repo, make issue execution repeatable, and provide enough observability to operate concurrent agent runs; when behavior is unclear, check `SPEC.md`.
5
+
6
+ ## 2. Folder Structure
7
+ - `src/code_factory`: Python package entrypoints, shared models, and package roots.
8
+ - `application`: service bootstrap, logging setup, project bootstrap assets, and operator dashboard rendering.
9
+ - `runtime`: orchestrator, worker, runtime messages, and subprocess/process lifecycle code.
10
+ - `trackers`: generic tracker boundary plus concrete tracker implementations.
11
+ - `coding_agents`: generic coding-agent boundary plus concrete coding-agent implementations.
12
+ - `config`: typed settings models, parsing, defaults, and validation helpers.
13
+ - `workflow`: `WORKFLOW.md` loading, templates, front-matter parsing, and workflow snapshot/state handling.
14
+ - `workspace`: workspace path safety, hook execution, workspace lifecycle management, and operator review/AI review flows.
15
+ - `observability`: operator-facing API payloads, CLI discovery helpers, runtime metadata, and HTTP server.
16
+ - `prompts`: workflow prompt rendering, review prompt assets, and prompt data shaping.
17
+ - `tests`: behavior, CLI, integration, and architecture tests; keep new tests close to the layer they protect.
18
+ - `pyproject.toml`: package metadata, lint/type/test tool configuration, and `uv` dependency management.
19
+ - `README.md`: operator-facing usage and API/CLI documentation.
20
+
21
+ ## 3. Core Behaviors & Patterns
22
+ - The orchestrator owns authoritative runtime state, workers report events back through messages, and concrete integrations stay behind generic boundaries.
23
+ - Logging is structured around standard library loggers with issue/session context added at call sites; startup, reload, hook, and protocol failures are logged explicitly rather than swallowed.
24
+ - Error handling favors validation up front, early returns on ineligible work, and bounded retries for transient failures; workflow reload errors keep the last known good snapshot active.
25
+ - Architecture is package-oriented and intentionally strict: concrete integrations live under `trackers/*` and `coding_agents/*`, utilities are package-local, and architecture tests guard import boundaries and file-size limits.
26
+
27
+ ## 4. Conventions
28
+ - Put helper functions in utility/support modules, not inside business modules such as actors, managers, services, or clients.
29
+ - Keep source files under 300 lines, prefer focused package-local models over global catch-all model files, and add comments where the control flow is not already obvious.
30
+
31
+ ## 5. Working Agreements
32
+ - Preserve behavior parity with `SPEC.md`, update it carefully before introducing new policy. Make it transparent to the user when a change would require a SPEC update.
33
+ - When changing runtime behavior, follow the existing layer boundaries instead of adding shortcuts across packages or adding root-level implementation modules.
34
+ - Add or update tests with behavior changes, including architecture rules when moving package boundaries or concrete/generic seams.
35
+ - Tests have 100% line and branch coverage with hard gates, add or adjust tests faithfully to keep coverage 100%. Use pragmas only for platform-specific behavior or branches otherwise unreasonable to test.
36
+ - Run targeted tests (with uv) while iterating, then run full gates (format check, lint, style, coverage, tests) before handoff: `make verify`.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Benjoyo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,98 @@
1
+ .PHONY: setup lint format-check typecheck test test-coverage coverage-gate coverage-packages fix repair verify-static verify clean
2
+
3
+ UV := uv run --project . --extra dev --group dev
4
+ SOURCE_DIR := src/code_factory
5
+ COVERAGE_JSON := coverage.json
6
+ LINE_COVERAGE_MIN := 100
7
+ BRANCH_COVERAGE_MIN := 100
8
+
9
+ setup:
10
+ uv sync --extra dev --group dev
11
+
12
+ lint:
13
+ @$(UV) ruff check --output-format concise .
14
+
15
+ format-check:
16
+ @$(UV) ruff format --check .
17
+
18
+ typecheck:
19
+ @$(UV) pyright
20
+
21
+ test:
22
+ @$(UV) python -m pytest -q
23
+
24
+ test-coverage:
25
+ @$(UV) python -m pytest -q --cov=$(SOURCE_DIR) --cov-branch --cov-report= --cov-report=json:$(COVERAGE_JSON)
26
+ @$(UV) python -c '\
27
+ import json; \
28
+ from pathlib import Path; \
29
+ totals = json.loads(Path("$(COVERAGE_JSON)").read_text())["totals"]; \
30
+ line_actual = float(totals["percent_statements_covered"]); \
31
+ line_display = totals["percent_statements_covered_display"]; \
32
+ branches = totals["num_branches"]; \
33
+ covered_branches = totals["covered_branches"]; \
34
+ branch_percent = float(totals["percent_branches_covered"]); \
35
+ branch_display = totals["percent_branches_covered_display"]; \
36
+ print(f"Coverage: lines {line_display}% ({line_actual:.2f}%), branches {branch_display}% ({branch_percent:.2f}%, {covered_branches}/{branches})") \
37
+ '
38
+
39
+ coverage-gate: test-coverage
40
+ @$(UV) python -c '\
41
+ import json; \
42
+ from pathlib import Path; \
43
+ line_minimum = float("$(LINE_COVERAGE_MIN)"); \
44
+ branch_minimum = float("$(BRANCH_COVERAGE_MIN)"); \
45
+ totals = json.loads(Path("$(COVERAGE_JSON)").read_text())["totals"]; \
46
+ line_actual = float(totals["percent_statements_covered"]); \
47
+ branch_actual = float(totals["percent_branches_covered"]); \
48
+ assert line_actual >= line_minimum, f"Line coverage gate failed: {line_actual:.2f}% < {line_minimum:.2f}%"; \
49
+ assert branch_actual >= branch_minimum, f"Branch coverage gate failed: {branch_actual:.2f}% < {branch_minimum:.2f}%" \
50
+ '
51
+
52
+ coverage-packages: test-coverage
53
+ @printf '%s\n' \
54
+ 'import json' \
55
+ 'from collections import defaultdict' \
56
+ 'from pathlib import Path' \
57
+ 'data = json.loads(Path("$(COVERAGE_JSON)").read_text())' \
58
+ 'totals = data["totals"]' \
59
+ 'overall_lines = float(totals["percent_statements_covered"])' \
60
+ 'overall_lines_covered = totals["covered_lines"]' \
61
+ 'overall_lines_total = totals["num_statements"]' \
62
+ 'overall_branches = float(totals["percent_branches_covered"])' \
63
+ 'overall_branches_covered = totals["covered_branches"]' \
64
+ 'overall_branches_total = totals["num_branches"]' \
65
+ 'acc = defaultdict(lambda: {"covered_lines": 0, "num_statements": 0, "covered_branches": 0, "num_branches": 0})' \
66
+ 'for path, meta in data["files"].items():' \
67
+ ' parts = Path(path).parts' \
68
+ ' idx = parts.index("code_factory")' \
69
+ ' package = parts[idx + 1] if len(parts) > idx + 2 else "(root)"' \
70
+ ' summary = meta["summary"]' \
71
+ ' acc[package]["covered_lines"] += summary["covered_lines"]' \
72
+ ' acc[package]["num_statements"] += summary["num_statements"]' \
73
+ ' acc[package]["covered_branches"] += summary["covered_branches"]' \
74
+ ' acc[package]["num_branches"] += summary["num_branches"]' \
75
+ 'print(f"overall\tlines {overall_lines:.2f}% ({overall_lines_covered}/{overall_lines_total})\tbranches {overall_branches:.2f}% ({overall_branches_covered}/{overall_branches_total})")' \
76
+ 'for package in sorted(acc):' \
77
+ ' covered_lines = acc[package]["covered_lines"]' \
78
+ ' total_lines = acc[package]["num_statements"]' \
79
+ ' lines_percent = 100.0 if total_lines == 0 else (covered_lines / total_lines * 100)' \
80
+ ' covered_branches = acc[package]["covered_branches"]' \
81
+ ' total_branches = acc[package]["num_branches"]' \
82
+ ' branches_percent = 100.0 if total_branches == 0 else (covered_branches / total_branches * 100)' \
83
+ ' print(f"{package}\tlines {lines_percent:.2f}% ({covered_lines}/{total_lines})\tbranches {branches_percent:.2f}% ({covered_branches}/{total_branches})")' \
84
+ | $(UV) python -
85
+
86
+ fix:
87
+ @$(UV) ruff check . --fix
88
+ @$(UV) ruff format .
89
+
90
+ repair: fix verify
91
+
92
+ verify-static: lint format-check typecheck
93
+
94
+ verify: verify-static test coverage-gate
95
+
96
+ clean:
97
+ rm -f .coverage $(COVERAGE_JSON)
98
+ rm -rf htmlcov
@@ -0,0 +1,268 @@
1
+ Metadata-Version: 2.4
2
+ Name: code-factory-agent
3
+ Version: 0.1.1
4
+ Summary: Extended Python asyncio port of the OpenAI Symphony spec
5
+ Project-URL: Homepage, https://github.com/Benjoyo/code-factory
6
+ Project-URL: Repository, https://github.com/Benjoyo/code-factory
7
+ Project-URL: Documentation, https://github.com/Benjoyo/code-factory/blob/main/README.md
8
+ Project-URL: Issues, https://github.com/Benjoyo/code-factory/issues
9
+ Project-URL: Changelog, https://github.com/Benjoyo/code-factory/releases
10
+ Author: Benjoyo
11
+ License: MIT License
12
+
13
+ Copyright (c) 2026 Benjoyo
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+ License-File: LICENSE
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.12
38
+ Classifier: Topic :: Software Development
39
+ Requires-Python: >=3.12
40
+ Requires-Dist: aiohttp<4,>=3.11.13
41
+ Requires-Dist: httpx<0.29,>=0.28.1
42
+ Requires-Dist: pydantic<3,>=2.11.7
43
+ Requires-Dist: python-liquid<3,>=2.1.0
44
+ Requires-Dist: pyyaml<7,>=6.0.2
45
+ Requires-Dist: rich<15,>=14.2.0
46
+ Requires-Dist: textual<9,>=8.1.0
47
+ Requires-Dist: typer<0.17,>=0.16.0
48
+ Requires-Dist: watchfiles<2,>=1.1.1
49
+ Provides-Extra: dev
50
+ Requires-Dist: pyright<2,>=1.1.398; extra == 'dev'
51
+ Requires-Dist: pytest-asyncio<1,>=0.25.3; extra == 'dev'
52
+ Requires-Dist: pytest-cov<7,>=6.1.1; extra == 'dev'
53
+ Requires-Dist: pytest<9,>=8.3.5; extra == 'dev'
54
+ Requires-Dist: ruff<0.12,>=0.11.0; extra == 'dev'
55
+ Description-Content-Type: text/markdown
56
+
57
+ <div align="center">
58
+
59
+ <h1>Code Factory</h1>
60
+
61
+ <p><strong>🏭 Orchestrate coding agents via Kanban — high autonomy, isolated per-issue workspaces, single-file repo-owned workflow contract</strong></p>
62
+
63
+ <p><a href="#quick-start">Quick Start</a> · <a href="https://github.com/Benjoyo/code-factory/blob/main/docs/cli.md">CLI</a> · <a href="https://github.com/Benjoyo/code-factory/blob/main/docs/workflow/README.md">Workflow</a> · <a href="https://github.com/Benjoyo/code-factory/blob/main/SPEC.md">Specification</a></p>
64
+
65
+ </div>
66
+
67
+ <p align="center">
68
+ <img src="https://raw.githubusercontent.com/Benjoyo/code-factory/main/docs/images/code-factory-dashboard.png" alt="Code Factory operator dashboard showing live issue execution, throughput, token usage, and operator links" width="1257" />
69
+ </p>
70
+
71
+ Code Factory is a Python asyncio implementation and extension of the OpenAI Symphony spec. It
72
+ polls tracker work, creates isolated per-issue workspaces, runs coding-agent
73
+ sessions inside them, and keeps the workflow contract versioned in
74
+ `WORKFLOW.md`.
75
+
76
+ Use it when you want repeatable issue execution, repo-owned workflow policy,
77
+ and enough observability to operate concurrent agent runs without building a
78
+ custom harness around your coding agent.
79
+
80
+ ## Typical Workflow
81
+
82
+ ![Typical Code Factory workflow showing tracker intake, per-issue workspace creation, coding-agent execution, operator review, and issue state progression](https://raw.githubusercontent.com/Benjoyo/code-factory/main/docs/code-factory-typical-workflow.svg)
83
+
84
+ ## What You Need
85
+
86
+ - Python 3.12
87
+ - [`uv`](https://docs.astral.sh/uv/)
88
+ - A valid `WORKFLOW.md`
89
+ - Access to the tracker configured in `WORKFLOW.md`
90
+ - A working coding-agent command available to `codex.command`
91
+
92
+ ## Installation
93
+
94
+ Install `cf` from PyPI as a `uv` tool:
95
+
96
+ ```bash
97
+ uv tool install code-factory-agent
98
+ ```
99
+
100
+ Then run it directly:
101
+
102
+ ```bash
103
+ cf --help
104
+ cf serve --no-guardrails
105
+ ```
106
+
107
+ If you prefer not to install the tool, you can still run it from the repo with
108
+ `uv run cf ...`.
109
+
110
+ ## Quick Start
111
+
112
+ ### 1. Install from PyPI
113
+
114
+ ```bash
115
+ uv tool install code-factory-agent
116
+ ```
117
+
118
+ ### 2. Create a starter workflow in a new project
119
+
120
+ ```bash
121
+ cf init
122
+ ```
123
+
124
+ `cf init` walks you through the starter values, renders a
125
+ project-specific `WORKFLOW.md`, and copies this repo's bundled skills into
126
+ `./.agents/skills`. Re-run with `--force` if you want to overwrite an existing
127
+ workflow or skills bundle.
128
+
129
+ ### 3. Start the service
130
+
131
+ ```bash
132
+ cf serve --no-guardrails
133
+ ```
134
+
135
+ If you omit the workflow path, the CLI defaults to `./WORKFLOW.md`.
136
+
137
+ ### 4. Create issues and move to Todo
138
+
139
+ - Create new issues in Linear Backlog
140
+ - Move ready-for-dev issues to Todo
141
+
142
+ ### 5. Steer agents during execution (optional)
143
+
144
+ Run:
145
+
146
+ ```bash
147
+ cf steer ENG-123 "also add integration tests please"
148
+ ```
149
+
150
+ This appends operator guidance to an in-flight issue turn.
151
+
152
+ ### 6. Review PRs
153
+
154
+ Run:
155
+
156
+ ```bash
157
+ cf review ENG-123
158
+ ```
159
+
160
+ This will:
161
+
162
+ - Launch a review worktree and any configured review servers.
163
+ - Open the browser automatically, if configured.
164
+ - Let you quickly submit PR comments with any problems you find.
165
+
166
+ ### 7. Move issues to Merging, Todo, or Rework
167
+
168
+ Move reviewed issues to:
169
+
170
+ - Merging, if review was successful
171
+ - Todo, if you left review comments in the PR
172
+ - Rework, if you left review comments and want a full, clean re-attempt at the issue
173
+
174
+ ## CLI Overview
175
+
176
+ The main operator commands are:
177
+
178
+ - `cf init` to bootstrap a repo-local workflow and bundled skills
179
+ - `cf serve` to run the long-lived automation service
180
+ - `cf review` to launch a review worktree and any configured review servers
181
+ - `cf steer` to append operator guidance to an in-flight issue turn
182
+ - `cf issue`, `cf comment`, `cf workpad`, and `cf tracker` for tracker-facing
183
+ operator actions
184
+
185
+ See [docs/cli.md](https://github.com/Benjoyo/code-factory/blob/main/docs/cli.md) for the general CLI reference and
186
+ [docs/ticket-cli.md](https://github.com/Benjoyo/code-factory/blob/main/docs/ticket-cli.md) for ticket-oriented commands.
187
+
188
+ ## Ticket Surfaces
189
+
190
+ Agent sessions use flat `tracker_issue_*`, `tracker_comment_*`,
191
+ `tracker_pr_link`, and `tracker_file_upload` tools for ticket work. The
192
+ orchestrator manages `workpad.md` synchronization to a ticket comment
193
+ automatically during the run.
194
+
195
+ Operators can use the CLI for the same ticket surface area:
196
+
197
+ ```bash
198
+ cf issue get ISSUE
199
+ cf issue list [--project PROJECT] [--team TEAM] [--state STATE]
200
+ cf issue create --team TEAM --title TITLE
201
+ cf issue update ISSUE
202
+ cf issue move ISSUE --state STATE
203
+ cf issue link-pr ISSUE --url URL
204
+ cf comment list ISSUE
205
+ cf comment create ISSUE
206
+ cf comment update COMMENT
207
+ cf workpad get ISSUE
208
+ cf workpad sync ISSUE
209
+ ```
210
+
211
+ ## Workflow
212
+
213
+ `WORKFLOW.md` is the main operator surface for Code Factory. It keeps tracker
214
+ configuration, active states, prompt sections, completion gates, review setup,
215
+ workspace hooks, and observability settings in the repo so teams can version and
216
+ hot-reload automation policy alongside application code.
217
+
218
+ See the workflow docs for the current contract:
219
+
220
+ - [Workflow docs](https://github.com/Benjoyo/code-factory/blob/main/docs/workflow/README.md)
221
+ - [Frontmatter reference](https://github.com/Benjoyo/code-factory/blob/main/docs/workflow/frontmatter.md)
222
+ - [Prompt template reference](https://github.com/Benjoyo/code-factory/blob/main/docs/workflow/prompt-template.md)
223
+ - [Specification](https://github.com/Benjoyo/code-factory/blob/main/SPEC.md)
224
+
225
+ ## Observability
226
+
227
+ Code Factory exposes a local observability API and, when stderr is attached to a
228
+ TTY, a live terminal dashboard for operators. See
229
+ [docs/observability.md](https://github.com/Benjoyo/code-factory/blob/main/docs/observability.md) for endpoints, dashboard
230
+ behavior, and steering/discovery details.
231
+
232
+ ## Runtime Notes
233
+
234
+ - Startup validates the workflow and required dispatch settings before the
235
+ scheduler loop begins.
236
+ - `WORKFLOW.md` is hot-reloaded automatically; valid changes affect future
237
+ dispatches without restarting the service.
238
+ - Only issues in active workflow states are dispatched.
239
+
240
+ ## Development
241
+
242
+ For local development from a checkout:
243
+
244
+ ```bash
245
+ git clone git@github.com:Benjoyo/code-factory.git
246
+ cd code-factory
247
+ make setup
248
+ ```
249
+
250
+ Run the CLI directly from the repo with `uv run`:
251
+
252
+ ```bash
253
+ uv run cf --help
254
+ uv run cf serve --no-guardrails
255
+ ```
256
+
257
+ If you want the checkout on your PATH during development, install the local
258
+ editable tool:
259
+
260
+ ```bash
261
+ uv tool install --editable .
262
+ ```
263
+
264
+ Run the full verification suite:
265
+
266
+ ```bash
267
+ make verify
268
+ ```