@use-the-fork/spindle 0.0.0-stage → 0.0.1

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 (245) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -2
  3. package/build/Assets/Blueprints/Catalog.js +110 -0
  4. package/build/Assets/Blueprints/agents/general.agent.md +67 -0
  5. package/build/Assets/Blueprints/agents/sdd-code-reviewer.agent.md +62 -0
  6. package/build/Assets/Blueprints/agents/sdd-code-slop-reviewer.agent.md +59 -0
  7. package/build/Assets/Blueprints/agents/sdd-implementer.agent.md +77 -0
  8. package/build/Assets/Blueprints/agents/sdd-orchestrator.agent.md +42 -0
  9. package/build/Assets/Blueprints/agents/sdd-re-review.agent.md +57 -0
  10. package/build/Assets/Blueprints/agents/sdd-reviewer.agent.md +89 -0
  11. package/build/Assets/Blueprints/agents/sdd-task-reviewer.agent.md +54 -0
  12. package/build/Assets/Blueprints/agents/shared-codebase-analyzer.agent.md +151 -0
  13. package/build/Assets/Blueprints/agents/shared-codebase-locator.agent.md +130 -0
  14. package/build/Assets/Blueprints/agents/shared-codebase-pattern-finder.agent.md +247 -0
  15. package/build/Assets/Blueprints/agents/shared-explore.agent.md +53 -0
  16. package/build/Assets/Blueprints/agents/shared-r.agent.md +17 -0
  17. package/build/Assets/Blueprints/agents/shared-rw.agent.md +17 -0
  18. package/build/Assets/Blueprints/agents/shared-rwx.agent.md +17 -0
  19. package/build/Assets/Blueprints/agents/shared-web-search-researcher.agent.md +122 -0
  20. package/build/Assets/Blueprints/instructions/code-commenting.instructions.md +39 -0
  21. package/build/Assets/Blueprints/instructions/source-architecture.instructions.md +15 -0
  22. package/build/Assets/Blueprints/skills/asd-ste100/CREDITS.MD +1 -0
  23. package/build/Assets/Blueprints/skills/asd-ste100/SKILL.md +83 -0
  24. package/build/Assets/Blueprints/skills/asd-ste100/examples/before-after.md +107 -0
  25. package/build/Assets/Blueprints/skills/asd-ste100/references/writing-rules.md +65 -0
  26. package/build/Assets/Blueprints/skills/author-agent/SKILL.md +26 -0
  27. package/build/Assets/Blueprints/skills/author-design/SKILL.md +38 -0
  28. package/build/Assets/Blueprints/skills/author-instruction/SKILL.md +28 -0
  29. package/build/Assets/Blueprints/skills/author-skill/SKILL.md +26 -0
  30. package/build/Assets/Blueprints/skills/grill/SKILL.md +33 -0
  31. package/build/Assets/Blueprints/skills/grill-design/SKILL.md +41 -0
  32. package/build/Assets/Blueprints/skills/grill-with-docs/SKILL.md +14 -0
  33. package/build/Assets/Blueprints/skills/implement/SKILL.md +79 -0
  34. package/build/Assets/Blueprints/skills/implement-spec/SKILL.md +34 -0
  35. package/build/Assets/Blueprints/skills/improve-codebase-architecture/HTML-REPORT.md +129 -0
  36. package/build/Assets/Blueprints/skills/improve-codebase-architecture/SKILL.md +74 -0
  37. package/build/Assets/Blueprints/skills/int-code-review/SKILL.md +76 -0
  38. package/build/Assets/Blueprints/skills/int-code-slop-review/SKILL.md +238 -0
  39. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/_sections.md +36 -0
  40. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/_template.md +42 -0
  41. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/comments-closing-brace-labels.md +112 -0
  42. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/comments-empty-docblocks.md +132 -0
  43. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/comments-narration.md +118 -0
  44. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/comments-placeholder.md +130 -0
  45. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/defensive-generic-catch.md +153 -0
  46. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/defensive-impossible-null.md +157 -0
  47. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/defensive-missing-real.md +157 -0
  48. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/naming-generic-placeholders.md +120 -0
  49. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/naming-over-descriptive.md +108 -0
  50. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/naming-suffix-abuse.md +167 -0
  51. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/naming-type-in-name.md +100 -0
  52. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/over-eng-dependency-creep.md +114 -0
  53. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/over-eng-premature-interface.md +136 -0
  54. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/over-eng-single-method-class.md +161 -0
  55. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/over-eng-useless-wrapper.md +140 -0
  56. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/style-as-any-escape.md +127 -0
  57. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/style-debug-artifacts.md +144 -0
  58. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/style-hyper-consistent.md +84 -0
  59. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/style-no-hack-scars.md +113 -0
  60. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/style-trivial-boilerplate.md +191 -0
  61. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/test-doesnt-throw.md +132 -0
  62. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/test-mirror-implementation.md +125 -0
  63. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/test-mock-everything.md +148 -0
  64. package/build/Assets/Blueprints/skills/int-code-slop-review/rules/test-snapshot-abuse.md +131 -0
  65. package/build/Assets/Blueprints/skills/int-codebase-design/SKILL.md +116 -0
  66. package/build/Assets/Blueprints/skills/int-codebase-design/references/DEEPENING.md +37 -0
  67. package/build/Assets/Blueprints/skills/int-codebase-design/references/DESIGN-IT-TWICE.md +44 -0
  68. package/build/Assets/Blueprints/skills/int-domain-modeling/SKILL.md +78 -0
  69. package/build/Assets/Blueprints/skills/int-domain-modeling/references/ADR-FORMAT.md +47 -0
  70. package/build/Assets/Blueprints/skills/int-domain-modeling/references/GLOSSARY-FORMAT.md +60 -0
  71. package/build/Assets/Blueprints/skills/int-prototype/LOGIC.md +67 -0
  72. package/build/Assets/Blueprints/skills/int-prototype/SKILL.md +30 -0
  73. package/build/Assets/Blueprints/skills/int-prototype/UI.md +112 -0
  74. package/build/Assets/Blueprints/skills/int-retrospective/SKILL.md +88 -0
  75. package/build/Assets/Blueprints/skills/int-retrospective/assets/retrospective-prompt.md +38 -0
  76. package/build/Assets/Blueprints/skills/int-retrospective/references/assessment.md +56 -0
  77. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/SKILL.md +64 -0
  78. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/assets/implementer-prompt.md +40 -0
  79. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/assets/reviewer-prompt.md +43 -0
  80. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/aggregate-review.md +7 -0
  81. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/corrective-rounds.md +72 -0
  82. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/example-workflow.md +25 -0
  83. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/full-spec.md +72 -0
  84. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/implementer-corrections.md +9 -0
  85. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/review-inputs.md +26 -0
  86. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/verification-evidence.md +7 -0
  87. package/build/Assets/Blueprints/skills/int-test-driven-development/SKILL.md +51 -0
  88. package/build/Assets/Blueprints/skills/int-test-driven-development/references/mocking.md +31 -0
  89. package/build/Assets/Blueprints/skills/int-test-driven-development/references/tests.md +68 -0
  90. package/build/Assets/Blueprints/skills/int-testing-agent-guidance/SKILL.md +53 -0
  91. package/build/Assets/Blueprints/skills/int-verification-before-completion/SKILL.md +25 -0
  92. package/build/Assets/Blueprints/skills/int-writing-agents/SKILL.md +66 -0
  93. package/build/Assets/Blueprints/skills/int-writing-for-agents/SKILL.md +86 -0
  94. package/build/Assets/Blueprints/skills/int-writing-instruction/SKILL.md +57 -0
  95. package/build/Assets/Blueprints/skills/int-writing-skills/SKILL.md +129 -0
  96. package/build/Assets/Blueprints/skills/int-writing-skills/assets/interactive.md +83 -0
  97. package/build/Assets/Blueprints/skills/int-writing-skills/assets/reference.md +32 -0
  98. package/build/Assets/Blueprints/skills/int-writing-skills/references/arguments.md +50 -0
  99. package/build/Assets/Blueprints/skills/int-writing-skills/references/interactive-skills.md +53 -0
  100. package/build/Assets/Blueprints/skills/int-writing-skills/references/persuasion-principles.md +220 -0
  101. package/build/Assets/Blueprints/skills/int-writing-skills/references/reference-skills.md +20 -0
  102. package/build/Assets/Blueprints/skills/int-writing-skills/references/testing-skills.md +48 -0
  103. package/build/Assets/Blueprints/skills/retrospective/SKILL.md +16 -0
  104. package/build/Assets/Blueprints/skills/setup-project/SKILL.md +66 -0
  105. package/build/Assets/Blueprints/skills/to-spec/SKILL.md +53 -0
  106. package/build/Assets/Blueprints/skills/to-tickets/SKILL.md +49 -0
  107. package/build/Assets/Blueprints/skills/update-tooling/SKILL.md +86 -0
  108. package/build/Assets/Templates/Catalog.js +12 -0
  109. package/build/Assets/Templates/Catalog.ts +17 -0
  110. package/build/Assets/Templates/project/copilot-instructions.md +17 -0
  111. package/build/Assets/Templates/project/domain.md +51 -0
  112. package/build/Assets/Templates/project/ticket-tracker.md +33 -0
  113. package/build/Assets/Templates/sdd/design.md +25 -0
  114. package/build/Assets/Templates/sdd/spec.md +29 -0
  115. package/build/Assets/Templates/sdd/ticket.md +15 -0
  116. package/build/BlueprintManagement/BlueprintManagementServiceProvider.js +15 -0
  117. package/build/BlueprintManagement/Catalog/BlueprintCatalog.js +238 -0
  118. package/build/BlueprintManagement/Commands/BlueprintCommandOptions.js +9 -0
  119. package/build/BlueprintManagement/Commands/ConflictPolicy.js +6 -0
  120. package/build/BlueprintManagement/Commands/InitCommand.js +117 -0
  121. package/build/BlueprintManagement/Commands/Prompts.js +66 -0
  122. package/build/BlueprintManagement/Commands/UpdateCommand.js +86 -0
  123. package/build/BlueprintManagement/Handlers/Agents/AgentHandler.js +21 -0
  124. package/build/BlueprintManagement/Handlers/BlueprintHandlers.js +4 -0
  125. package/build/BlueprintManagement/Handlers/Instructions/InstructionHandler.js +21 -0
  126. package/build/BlueprintManagement/Handlers/Skills/SkillHandler.js +10 -0
  127. package/build/BlueprintManagement/Reconciliation/BlueprintCatalogPlanner.js +87 -0
  128. package/build/BlueprintManagement/Reconciliation/BlueprintRemovalCoordinator.js +78 -0
  129. package/build/BlueprintManagement/Services/BlueprintReconciliationService.js +391 -0
  130. package/build/BlueprintManagement/Services/InstallationService.js +54 -0
  131. package/build/BlueprintManagement/Support/BlueprintFiles.js +113 -0
  132. package/build/BlueprintManagement/Types/Blueprint.js +1 -0
  133. package/build/BlueprintManagement/Types/Installation.js +1 -0
  134. package/build/BlueprintManagement/Types/Reconciliation.js +1 -0
  135. package/build/BlueprintManagement/Versioning/BlueprintVersion.js +70 -0
  136. package/build/BlueprintManagement/Versioning/BlueprintVersioning.js +55 -0
  137. package/build/Commands/Command.js +3 -0
  138. package/build/Commands/CommandOptions.js +12 -0
  139. package/build/Config/Config.js +3 -0
  140. package/build/Foundation/Application.js +112 -0
  141. package/build/Foundation/ApplicationBuilder.js +23 -0
  142. package/build/Foundation/Bootstrap/Bootstrapper.js +2 -0
  143. package/build/Foundation/Bootstrap/DiscoverGitRoot.js +8 -0
  144. package/build/Foundation/Bootstrap/LoadConsoleArgs.js +47 -0
  145. package/build/Foundation/Bootstrap/LoadProjectConfiguration.js +144 -0
  146. package/build/Foundation/Bootstrap/RegisterProviders.js +12 -0
  147. package/build/Foundation/Bootstrap/RequireProjectConfiguration.js +14 -0
  148. package/build/Foundation/ConsoleInvocation.js +1 -0
  149. package/build/Foundation/Container.js +185 -0
  150. package/build/Foundation/FoundationServiceProvider.js +5 -0
  151. package/build/Foundation/Kernel.js +30 -0
  152. package/build/Foundation/Service.js +23 -0
  153. package/build/Foundation/ServiceProvider.js +12 -0
  154. package/build/Git/GitServiceProvider.js +8 -0
  155. package/build/Git/Services/GitService.js +26 -0
  156. package/build/Project/ProjectServiceProvider.js +8 -0
  157. package/build/Project/Services/ProjectService.js +124 -0
  158. package/build/SubagentDrivenDevelopment/Commands/ChecksRecordCommand.js +35 -0
  159. package/build/SubagentDrivenDevelopment/Commands/ChecksRequireCommand.js +33 -0
  160. package/build/SubagentDrivenDevelopment/Commands/ClaimCommand.js +23 -0
  161. package/build/SubagentDrivenDevelopment/Commands/CorrectCommand.js +37 -0
  162. package/build/SubagentDrivenDevelopment/Commands/CreateCommand.js +26 -0
  163. package/build/SubagentDrivenDevelopment/Commands/FindingCreateCommand.js +39 -0
  164. package/build/SubagentDrivenDevelopment/Commands/FindingUpdateCommand.js +36 -0
  165. package/build/SubagentDrivenDevelopment/Commands/FinishCommand.js +23 -0
  166. package/build/SubagentDrivenDevelopment/Commands/ImplementCommand.js +23 -0
  167. package/build/SubagentDrivenDevelopment/Commands/NextCommand.js +21 -0
  168. package/build/SubagentDrivenDevelopment/Commands/ReadyCommand.js +21 -0
  169. package/build/SubagentDrivenDevelopment/Commands/RequirementsDecideCommand.js +33 -0
  170. package/build/SubagentDrivenDevelopment/Commands/ResumeCommand.js +31 -0
  171. package/build/SubagentDrivenDevelopment/Commands/ReviewCommand.js +55 -0
  172. package/build/SubagentDrivenDevelopment/Commands/ReviewRequireCommand.js +12 -0
  173. package/build/SubagentDrivenDevelopment/Commands/StatusCommand.js +21 -0
  174. package/build/SubagentDrivenDevelopment/Commands/SubmitCommand.js +59 -0
  175. package/build/SubagentDrivenDevelopment/Commands/TicketCommentCommand.js +24 -0
  176. package/build/SubagentDrivenDevelopment/Commands/TicketCreateCommand.js +25 -0
  177. package/build/SubagentDrivenDevelopment/Commands/TicketUpdateCommand.js +31 -0
  178. package/build/SubagentDrivenDevelopment/Commands/groups.js +36 -0
  179. package/build/SubagentDrivenDevelopment/Evidence/GitEvidence.js +449 -0
  180. package/build/SubagentDrivenDevelopment/Evidence/ReportEvidence.js +80 -0
  181. package/build/SubagentDrivenDevelopment/Models/Assignments.js +1 -0
  182. package/build/SubagentDrivenDevelopment/Models/Evidence.js +1 -0
  183. package/build/SubagentDrivenDevelopment/Models/Findings.js +1 -0
  184. package/build/SubagentDrivenDevelopment/Models/Options.js +1 -0
  185. package/build/SubagentDrivenDevelopment/Models/Workflow.js +16 -0
  186. package/build/SubagentDrivenDevelopment/Persistence/AssignmentSchema.js +155 -0
  187. package/build/SubagentDrivenDevelopment/Persistence/CheckSchema.js +71 -0
  188. package/build/SubagentDrivenDevelopment/Persistence/FeatureWorkspace.js +76 -0
  189. package/build/SubagentDrivenDevelopment/Persistence/FileSystem.js +28 -0
  190. package/build/SubagentDrivenDevelopment/Persistence/FindingSchema.js +81 -0
  191. package/build/SubagentDrivenDevelopment/Persistence/LedgerRepository.js +322 -0
  192. package/build/SubagentDrivenDevelopment/Persistence/PathSafety.js +62 -0
  193. package/build/SubagentDrivenDevelopment/Persistence/ProgressSchema.js +95 -0
  194. package/build/SubagentDrivenDevelopment/Persistence/ReadinessReader.js +40 -0
  195. package/build/SubagentDrivenDevelopment/Persistence/ReviewSchema.js +68 -0
  196. package/build/SubagentDrivenDevelopment/Persistence/TicketRepository.js +147 -0
  197. package/build/SubagentDrivenDevelopment/Persistence/WorkspaceTransaction.js +282 -0
  198. package/build/SubagentDrivenDevelopment/Policies/AcceptancePolicy.js +100 -0
  199. package/build/SubagentDrivenDevelopment/Policies/AssignmentPolicy.js +36 -0
  200. package/build/SubagentDrivenDevelopment/Policies/CheckPolicy.js +93 -0
  201. package/build/SubagentDrivenDevelopment/Policies/FindingPolicy.js +53 -0
  202. package/build/SubagentDrivenDevelopment/Policies/InputValidation.js +36 -0
  203. package/build/SubagentDrivenDevelopment/Policies/ReadinessPolicy.js +26 -0
  204. package/build/SubagentDrivenDevelopment/Policies/RequiredReviewers.js +12 -0
  205. package/build/SubagentDrivenDevelopment/Policies/ReviewPolicy.js +87 -0
  206. package/build/SubagentDrivenDevelopment/Policies/WorkflowPolicy.js +85 -0
  207. package/build/SubagentDrivenDevelopment/Services/AssignmentService.js +269 -0
  208. package/build/SubagentDrivenDevelopment/Services/ChecksService.js +319 -0
  209. package/build/SubagentDrivenDevelopment/Services/CorrectionService.js +273 -0
  210. package/build/SubagentDrivenDevelopment/Services/DeliveryCorrectionService.js +253 -0
  211. package/build/SubagentDrivenDevelopment/Services/DeliveryFindingService.js +302 -0
  212. package/build/SubagentDrivenDevelopment/Services/DeliveryService.js +160 -0
  213. package/build/SubagentDrivenDevelopment/Services/DeliverySubmissionService.js +273 -0
  214. package/build/SubagentDrivenDevelopment/Services/FeatureCreationService.js +138 -0
  215. package/build/SubagentDrivenDevelopment/Services/FeatureInspectionService.js +399 -0
  216. package/build/SubagentDrivenDevelopment/Services/FindingService.js +392 -0
  217. package/build/SubagentDrivenDevelopment/Services/IntegrationService.js +258 -0
  218. package/build/SubagentDrivenDevelopment/Services/ReadinessService.js +21 -0
  219. package/build/SubagentDrivenDevelopment/Services/RequirementsService.js +216 -0
  220. package/build/SubagentDrivenDevelopment/Services/ReviewService.js +471 -0
  221. package/build/SubagentDrivenDevelopment/Services/SubmissionService.js +299 -0
  222. package/build/SubagentDrivenDevelopment/Services/TicketService.js +186 -0
  223. package/build/SubagentDrivenDevelopment/SubagentDrivenDevelopmentServiceProvider.js +113 -0
  224. package/build/Support/Records.js +5 -0
  225. package/build/Support/Repository.js +139 -0
  226. package/build/Support/Stacks.js +10 -0
  227. package/build/TemplateRendering/Computed/ComputedContextService.js +13 -0
  228. package/build/TemplateRendering/Computed/ComputedVariableProvider.js +6 -0
  229. package/build/TemplateRendering/Computed/ComputedVariableProviders.js +6 -0
  230. package/build/TemplateRendering/Computed/Providers/InternalSkillDescriptionProvider.js +6 -0
  231. package/build/TemplateRendering/Computed/Providers/SpindlePackageManagerProvider.js +11 -0
  232. package/build/TemplateRendering/Computed/ResolveRenderContext.js +18 -0
  233. package/build/TemplateRendering/Rendering/RenderText.js +43 -0
  234. package/build/TemplateRendering/TemplateRenderingServiceProvider.js +8 -0
  235. package/build/Tooling/Commands/ToolingAddCommand.js +29 -0
  236. package/build/Tooling/Commands/ToolingListCommand.js +19 -0
  237. package/build/Tooling/Commands/ToolingRemoveCommand.js +19 -0
  238. package/build/Tooling/Commands/ToolingUpdateCommand.js +30 -0
  239. package/build/Tooling/Commands/groups.js +4 -0
  240. package/build/Tooling/Models/ToolingEntry.js +1 -0
  241. package/build/Tooling/Services/ToolingService.js +278 -0
  242. package/build/Tooling/ToolingServiceProvider.js +15 -0
  243. package/build/cli.js +36 -0
  244. package/build/index.js +31 -0
  245. package/package.json +54 -3
@@ -0,0 +1,299 @@
1
+ import matter from "gray-matter";
2
+ import { Service } from "../../Foundation/Service.js";
3
+ import { validateAuthor, validateTicketId, } from "../Policies/InputValidation.js";
4
+ export class SubmissionService extends Service {
5
+ gitEvidence;
6
+ reportEvidence;
7
+ ticketRepository;
8
+ ledgerRepository;
9
+ workspaceTransaction;
10
+ checkPolicy;
11
+ reviewPolicy;
12
+ workflowPolicy;
13
+ deliverySubmissionService;
14
+ featureInspectionService;
15
+ constructor(app, gitEvidence, reportEvidence, ticketRepository, ledgerRepository, workspaceTransaction, checkPolicy, reviewPolicy, workflowPolicy, deliverySubmissionService, featureInspectionService) {
16
+ super(app);
17
+ this.gitEvidence = gitEvidence;
18
+ this.reportEvidence = reportEvidence;
19
+ this.ticketRepository = ticketRepository;
20
+ this.ledgerRepository = ledgerRepository;
21
+ this.workspaceTransaction = workspaceTransaction;
22
+ this.checkPolicy = checkPolicy;
23
+ this.reviewPolicy = reviewPolicy;
24
+ this.workflowPolicy = workflowPolicy;
25
+ this.deliverySubmissionService = deliverySubmissionService;
26
+ this.featureInspectionService = featureInspectionService;
27
+ }
28
+ submit(options) {
29
+ if (options.scope === "delivery") {
30
+ if (options.ticket)
31
+ throw new Error("--ticket and --scope delivery are mutually exclusive.");
32
+ if (options.role === "implementation")
33
+ return this.deliverySubmissionService.submitDeliveryImplementation(options);
34
+ return this.deliverySubmissionService.submitDeliveryReview(options);
35
+ }
36
+ if (options.scope !== undefined)
37
+ throw new Error("--scope must be 'delivery'.");
38
+ if (!options.ticket)
39
+ throw new Error("Submit requires --ticket or --scope delivery.");
40
+ validateTicketId(options.ticket);
41
+ validateAuthor(options.author);
42
+ if (options.role === "review")
43
+ return this.submitReview(options);
44
+ if (options.role !== "implementation") {
45
+ throw new Error("Submit role must be implementation or review.");
46
+ }
47
+ if (options.assignment !== undefined ||
48
+ options.result !== undefined ||
49
+ options.noFindings ||
50
+ options.findings !== undefined) {
51
+ throw new Error("Review assignment, result, and no-findings options require role review.");
52
+ }
53
+ if (options.unavailable && !options.details?.trim()) {
54
+ throw new Error("--details is required when the implementation report is unavailable.");
55
+ }
56
+ if (options.unavailable && options.report !== undefined) {
57
+ throw new Error("--report cannot be combined with --unavailable.");
58
+ }
59
+ if (!options.unavailable && options.details !== undefined) {
60
+ throw new Error("--details is only valid with --unavailable.");
61
+ }
62
+ const feature = this.featureInspectionService.resolveFeature(options.spec);
63
+ return this.workspaceTransaction.run(feature.workspace, () => {
64
+ const ledger = this.ledgerRepository.readLedger(feature);
65
+ const ticket = this.ticketRepository.requireTicket(this.ticketRepository.readTickets(feature.workspace), options.ticket);
66
+ const progress = this.workflowPolicy.requireProgress(ledger, options.ticket);
67
+ const identity = this.gitEvidence.contentIdentity(feature, ticket, progress.baseSha, progress.checks);
68
+ const assignment = progress.assignment;
69
+ if (!assignment || assignment.role !== options.role) {
70
+ throw new Error("No matching implementation assignment is pending for this ticket.");
71
+ }
72
+ if (progress.owner !== options.author.trim() ||
73
+ assignment.controller !== options.author.trim()) {
74
+ throw new Error("Only the current controller may submit this implementation report.");
75
+ }
76
+ if (options.unavailable) {
77
+ const details = options.details.trim();
78
+ if (assignment.status === "unavailable" && assignment.unavailableDetails === details) {
79
+ return {
80
+ ticket: options.ticket,
81
+ execution: progress.execution,
82
+ assignment,
83
+ unavailable: true,
84
+ idempotent: true,
85
+ ...identity,
86
+ };
87
+ }
88
+ if (assignment.status !== "pending" || progress.execution !== "implementing") {
89
+ throw new Error("The implementation assignment is no longer awaiting a report.");
90
+ }
91
+ assignment.status = "unavailable";
92
+ assignment.unavailableDetails = details;
93
+ const afterTicket = matter.stringify(this.ticketRepository.appendAudit(ticket.body, options.author, `Implementation report unavailable for assignment ${assignment.id}: ${details}. Work remains pending.`), this.ticketRepository.metadata(ticket));
94
+ this.workspaceTransaction.writeWorkflowState(feature, ticket, afterTicket, ledger);
95
+ return {
96
+ ticket: options.ticket,
97
+ execution: progress.execution,
98
+ assignment,
99
+ unavailable: true,
100
+ ...identity,
101
+ };
102
+ }
103
+ if (assignment.status === "submitted") {
104
+ const currentPath = this.reportEvidence.submissionReportPath(feature, assignment, options.report);
105
+ const digest = this.reportEvidence.readReportDigest(feature, currentPath);
106
+ if (digest !== assignment.reportSha256) {
107
+ throw new Error("The registered implementation report changed after submission.");
108
+ }
109
+ return {
110
+ ticket: options.ticket,
111
+ execution: progress.execution,
112
+ assignment,
113
+ report: assignment.report,
114
+ reportSha256: digest,
115
+ idempotent: true,
116
+ ...identity,
117
+ };
118
+ }
119
+ if ((assignment.status !== "pending" && assignment.status !== "unavailable") ||
120
+ progress.execution !== "implementing") {
121
+ throw new Error("The implementation assignment is not awaiting a report.");
122
+ }
123
+ const reportPath = this.reportEvidence.submissionReportPath(feature, assignment, options.report);
124
+ let reportSha256;
125
+ try {
126
+ reportSha256 = this.reportEvidence.readReportDigest(feature, reportPath);
127
+ }
128
+ catch (error) {
129
+ if (typeof error === "object" &&
130
+ error !== null &&
131
+ "code" in error &&
132
+ error.code === "ENOENT") {
133
+ throw new Error(`Implementation report is missing or unavailable at ${assignment.report}; the assignment remains pending.`);
134
+ }
135
+ throw error;
136
+ }
137
+ assignment.status = "submitted";
138
+ assignment.reportSha256 = reportSha256;
139
+ assignment.submittedAt = new Date().toISOString();
140
+ assignment.submittedBy = options.author.trim();
141
+ delete assignment.unavailableDetails;
142
+ if (assignment.action === "correct") {
143
+ const attempt = progress.correctionAttempts?.find((candidate) => candidate.number === assignment.attempt);
144
+ if (!attempt || attempt.assignmentId !== assignment.id) {
145
+ throw new Error("Corrective assignment has no matching persisted attempt.");
146
+ }
147
+ attempt.assignment = assignment;
148
+ }
149
+ progress.execution = "reviewing";
150
+ const afterTicket = matter.stringify(this.ticketRepository.appendAudit(ticket.body, options.author, `Implementation report submitted for assignment ${assignment.id}: ${assignment.report} (sha256 ${reportSha256}).`), this.ticketRepository.metadata(ticket));
151
+ this.workspaceTransaction.writeWorkflowState(feature, ticket, afterTicket, ledger);
152
+ return {
153
+ ticket: options.ticket,
154
+ execution: progress.execution,
155
+ assignment,
156
+ report: assignment.report,
157
+ reportSha256,
158
+ ...identity,
159
+ };
160
+ });
161
+ }
162
+ submitReview(options) {
163
+ if (!options.assignment?.trim()) {
164
+ throw new Error("Review submission requires --assignment.");
165
+ }
166
+ if (!options.report)
167
+ throw new Error("Review submission requires --report.");
168
+ if (!options.result)
169
+ throw new Error("Review submission requires explicit --result.");
170
+ if (!["passed", "failed", "unavailable"].includes(options.result)) {
171
+ throw new Error(`Invalid review result: ${options.result}.`);
172
+ }
173
+ const findingIds = options.findingIds?.map((id) => id.trim());
174
+ if (options.noFindings === true && findingIds !== undefined) {
175
+ throw new Error("--findings and --no-findings cannot be combined.");
176
+ }
177
+ if (findingIds !== undefined &&
178
+ (findingIds.length === 0 ||
179
+ findingIds.some((id) => !/^F-\d{4,}$/.test(id)) ||
180
+ new Set(findingIds).size !== findingIds.length)) {
181
+ throw new Error("--findings must contain unique canonical finding IDs.");
182
+ }
183
+ if (options.noFindings !== true && findingIds === undefined) {
184
+ throw new Error("Review submission requires either --findings or exclusive --no-findings.");
185
+ }
186
+ if (options.unavailable) {
187
+ throw new Error("Use --result unavailable, not --unavailable, for review submissions.");
188
+ }
189
+ if (options.result === "passed" && options.details !== undefined) {
190
+ throw new Error("--details is only valid for failed or unavailable review results.");
191
+ }
192
+ if (options.result !== "passed" && !options.details?.trim()) {
193
+ throw new Error("--details is required for failed or unavailable reviews.");
194
+ }
195
+ const feature = this.featureInspectionService.resolveFeature(options.spec);
196
+ return this.workspaceTransaction.run(feature.workspace, () => {
197
+ const ledger = this.ledgerRepository.readLedger(feature);
198
+ const ticket = this.ticketRepository.requireTicket(this.ticketRepository.readTickets(feature.workspace), options.ticket);
199
+ const progress = this.workflowPolicy.requireProgress(ledger, options.ticket);
200
+ if (!["reviewing", "changes-requested"].includes(progress.execution) || !progress.owner) {
201
+ throw new Error(`Ticket ${options.ticket} is not awaiting review submission.`);
202
+ }
203
+ if (progress.owner !== options.author.trim()) {
204
+ throw new Error("Only the current controller may submit a review result.");
205
+ }
206
+ const correctionAttempt = progress.correctionAttempts?.find((attempt) => attempt.reviewAssignments?.some((candidate) => candidate.id === options.assignment));
207
+ const assignment = correctionAttempt?.reviewAssignments?.find((candidate) => candidate.id === options.assignment) ?? progress.reviewAssignments?.find((candidate) => candidate.id === options.assignment);
208
+ if (!assignment || assignment.role !== "review") {
209
+ throw new Error(`No review assignment matches ID ${options.assignment}.`);
210
+ }
211
+ if (progress.execution === "changes-requested" && assignment.status !== "submitted") {
212
+ throw new Error(`Ticket ${options.ticket} is awaiting a controller correction decision.`);
213
+ }
214
+ if (!progress.baseSha)
215
+ throw new Error("Review assignment has no recorded Git baseline.");
216
+ const identity = this.gitEvidence.contentIdentity(feature, ticket, progress.baseSha, progress.checks);
217
+ const checkBlockers = this.checkPolicy.reviewCheckBlockers(feature, ticket, progress, identity);
218
+ if (checkBlockers.length > 0)
219
+ throw new Error(checkBlockers.join("\n"));
220
+ const snapshotBlocker = this.reviewPolicy.reviewSnapshotBlocker(feature, progress, assignment, identity);
221
+ if (snapshotBlocker)
222
+ throw new Error(snapshotBlocker);
223
+ const reportPath = this.reportEvidence.submissionReportPath(feature, assignment, options.report);
224
+ const reportSha256 = this.reportEvidence.readReportDigest(feature, reportPath);
225
+ const registeredFromReport = (progress.findings ?? [])
226
+ .filter((finding) => finding.provenance.some((source) => source.report === assignment.report && source.snapshot === assignment.snapshot))
227
+ .map((finding) => finding.id);
228
+ if (options.noFindings === true && registeredFromReport.length > 0) {
229
+ throw new Error(`Review report has registered findings and cannot declare --no-findings: ${registeredFromReport.join(", ")}.`);
230
+ }
231
+ if (findingIds !== undefined) {
232
+ const missing = registeredFromReport.filter((id) => !findingIds.includes(id));
233
+ const unknown = findingIds.filter((id) => !registeredFromReport.includes(id));
234
+ if (missing.length > 0 || unknown.length > 0) {
235
+ throw new Error(`--findings must exactly list canonical findings registered from this report and snapshot; missing=${missing.join(",") || "none"}; invalid provenance=${unknown.join(",") || "none"}.`);
236
+ }
237
+ }
238
+ if (assignment.status === "submitted") {
239
+ if (assignment.result === options.result &&
240
+ assignment.noFindings === (options.noFindings === true ? true : undefined) &&
241
+ JSON.stringify(assignment.findingIds) === JSON.stringify(findingIds) &&
242
+ assignment.submittedBy === options.author.trim() &&
243
+ assignment.details === options.details?.trim()) {
244
+ return {
245
+ ticket: options.ticket,
246
+ execution: progress.execution,
247
+ assignment,
248
+ report: assignment.report,
249
+ reportSha256,
250
+ idempotent: true,
251
+ ...identity,
252
+ };
253
+ }
254
+ throw new Error("The review assignment already has a different submitted result.");
255
+ }
256
+ const confirmedTicket = this.ticketRepository.requireTicket(this.ticketRepository.readTickets(feature.workspace), options.ticket);
257
+ const confirmedIdentity = this.gitEvidence.contentIdentity(feature, confirmedTicket, progress.baseSha, progress.checks);
258
+ const confirmedInventory = this.gitEvidence.changedPaths(progress.baseSha);
259
+ const confirmedReportDigest = this.reportEvidence.readReportDigest(feature, reportPath);
260
+ if (confirmedIdentity.snapshot !== identity.snapshot ||
261
+ JSON.stringify(confirmedInventory) !== JSON.stringify(assignment.inventory) ||
262
+ confirmedReportDigest !== reportSha256) {
263
+ throw new Error("Review inputs changed while submitting; retry against the frozen assignment.");
264
+ }
265
+ assignment.status = "submitted";
266
+ assignment.result = options.result;
267
+ if (options.noFindings === true)
268
+ assignment.noFindings = true;
269
+ else
270
+ delete assignment.noFindings;
271
+ if (findingIds !== undefined)
272
+ assignment.findingIds = findingIds;
273
+ else
274
+ delete assignment.findingIds;
275
+ assignment.reportSha256 = reportSha256;
276
+ assignment.submittedAt = new Date().toISOString();
277
+ assignment.submittedBy = options.author.trim();
278
+ if (options.details?.trim())
279
+ assignment.details = options.details.trim();
280
+ const submittedFindings = (assignment.findingIds ?? [])
281
+ .map((id) => progress.findings?.find((finding) => finding.id === id))
282
+ .filter((finding) => finding !== undefined);
283
+ if (assignment.result !== "passed" ||
284
+ submittedFindings.some((finding) => finding.blocking && finding.status !== "fixed" && finding.status !== "dismissed")) {
285
+ progress.execution = "changes-requested";
286
+ }
287
+ const afterTicket = matter.stringify(this.ticketRepository.appendAudit(ticket.body, options.author, `Review report submitted for assignment ${assignment.id}: result=${assignment.result}${assignment.noFindings === true ? "; no-findings explicitly declared" : `; findings=${(assignment.findingIds ?? []).join(",")}`}; report=${assignment.report} (sha256 ${reportSha256}).`), this.ticketRepository.metadata(ticket));
288
+ this.workspaceTransaction.writeWorkflowState(feature, ticket, afterTicket, ledger);
289
+ return {
290
+ ticket: options.ticket,
291
+ execution: progress.execution,
292
+ assignment,
293
+ report: assignment.report,
294
+ reportSha256,
295
+ ...identity,
296
+ };
297
+ });
298
+ }
299
+ }
@@ -0,0 +1,186 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { join, relative } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import matter from "gray-matter";
5
+ import { templateCatalog } from "../../Assets/Templates/Catalog.js";
6
+ import { Service } from "../../Foundation/Service.js";
7
+ import { TICKET_ID, TRACKER_STATUSES, } from "../Models/Workflow.js";
8
+ import { lstatIfPresent } from "../Persistence/FileSystem.js";
9
+ import { validateAuthor, validateTicketId, validateCategory, } from "../Policies/InputValidation.js";
10
+ import { resolveRenderContext } from "../../TemplateRendering/Computed/ResolveRenderContext.js";
11
+ import { renderText } from "../../TemplateRendering/Rendering/RenderText.js";
12
+ const templates = fileURLToPath(new URL("../../Assets/Templates/", import.meta.url));
13
+ export class TicketService extends Service {
14
+ ticketRepository;
15
+ ledgerRepository;
16
+ pathSafety;
17
+ workspaceTransaction;
18
+ featureInspectionService;
19
+ constructor(app, ticketRepository, ledgerRepository, pathSafety, workspaceTransaction, featureInspectionService) {
20
+ super(app);
21
+ this.ticketRepository = ticketRepository;
22
+ this.ledgerRepository = ledgerRepository;
23
+ this.pathSafety = pathSafety;
24
+ this.workspaceTransaction = workspaceTransaction;
25
+ this.featureInspectionService = featureInspectionService;
26
+ }
27
+ ticketCreate(options) {
28
+ this.ticketRepository.validateTicketCreateOptions(options);
29
+ const feature = this.featureInspectionService.resolveFeature(options.spec);
30
+ return this.workspaceTransaction.run(feature.workspace, () => {
31
+ const ledger = this.ledgerRepository.readLedger(feature);
32
+ const tickets = this.ticketRepository.readTickets(feature.workspace);
33
+ this.ticketRepository.validateDependencyGraph(tickets);
34
+ let highest = 0n;
35
+ for (const candidate of [
36
+ ...tickets.map((item) => item.id),
37
+ ...ledger.tickets.map((item) => item.id),
38
+ ]) {
39
+ const match = TICKET_ID.exec(candidate);
40
+ if (match && BigInt(match[1]) > highest)
41
+ highest = BigInt(match[1]);
42
+ }
43
+ const id = `T-${String(highest + 1n).padStart(4, "0")}`;
44
+ const path = join(feature.workspace, "tickets", `${id}.md`);
45
+ if (lstatIfPresent(path))
46
+ throw new Error(`Ticket already exists: ${id}.`);
47
+ this.pathSafety.assertTicketPath(feature.workspace, path);
48
+ const ticket = {
49
+ id,
50
+ title: options.title.trim(),
51
+ reporter: options.reporter.trim(),
52
+ category: options.category,
53
+ status: "open",
54
+ blockedBy: [],
55
+ };
56
+ const context = resolveRenderContext(this.app, {
57
+ variables: {
58
+ title: options.title.trim(),
59
+ reporter: options.reporter.trim(),
60
+ category: options.category,
61
+ author: options.author.trim(),
62
+ },
63
+ });
64
+ const template = renderText(readFileSync(join(templates, templateCatalog.sdd.ticket), "utf8"), context);
65
+ const document = matter.stringify(this.ticketRepository.appendAudit(template, options.author, "Ticket created."), { id });
66
+ ledger.tickets.push({
67
+ ...ticket,
68
+ execution: "unstarted",
69
+ });
70
+ this.workspaceTransaction.applyWrites(feature.workspace, [
71
+ { path: relative(feature.workspace, path), before: null, after: document },
72
+ {
73
+ path: "sdd.json",
74
+ before: readFileSync(feature.ledger, "utf8"),
75
+ after: `${JSON.stringify(ledger, null, 2)}\n`,
76
+ },
77
+ ]);
78
+ return { ticket: id, path };
79
+ });
80
+ }
81
+ ticketUpdate(options) {
82
+ validateTicketId(options.ticket);
83
+ validateAuthor(options.author);
84
+ if (options.title === undefined &&
85
+ options.reporter === undefined &&
86
+ options.category === undefined &&
87
+ options.status === undefined &&
88
+ options.blocker === undefined &&
89
+ !options.clearBlocker &&
90
+ options.blockedBy === undefined &&
91
+ !options.clearBlockedBy) {
92
+ throw new Error("Provide ticket fields, status, blocker, or dependency options to update.");
93
+ }
94
+ if (options.clearBlockedBy && options.blockedBy !== undefined) {
95
+ throw new Error("--clear-blocked-by cannot be combined with --blocked-by.");
96
+ }
97
+ if (options.clearBlocker && options.blocker !== undefined) {
98
+ throw new Error("--clear-blocker cannot be combined with --blocker.");
99
+ }
100
+ if (options.title !== undefined && !options.title.trim())
101
+ throw new Error("Title must not be empty.");
102
+ if (options.reporter !== undefined && !options.reporter.trim()) {
103
+ throw new Error("Reporter must not be empty.");
104
+ }
105
+ if (options.category !== undefined)
106
+ validateCategory(options.category);
107
+ if (options.status !== undefined &&
108
+ !TRACKER_STATUSES.some((status) => status === options.status)) {
109
+ throw new Error(`Ticket status must be one of: ${TRACKER_STATUSES.join(", ")}.`);
110
+ }
111
+ if (options.blocker !== undefined && !options.blocker.trim()) {
112
+ throw new Error("Blocker reason must not be empty.");
113
+ }
114
+ const feature = this.featureInspectionService.resolveFeature(options.spec);
115
+ return this.workspaceTransaction.run(feature.workspace, () => {
116
+ const ledger = this.ledgerRepository.readLedger(feature);
117
+ const tickets = this.ticketRepository.readTickets(feature.workspace);
118
+ const current = this.ticketRepository.requireTicket(tickets, options.ticket);
119
+ const updated = { ...current };
120
+ const progress = ledger.tickets.find((item) => item.id === current.id);
121
+ if (!progress)
122
+ throw new Error(`Ticket ${current.id} has no ledger record.`);
123
+ const structured = ledger.tickets.find((item) => item.id === current.id);
124
+ if (options.title !== undefined)
125
+ structured.title = updated.title = options.title.trim();
126
+ if (options.reporter !== undefined)
127
+ structured.reporter = updated.reporter = options.reporter.trim();
128
+ if (options.category !== undefined) {
129
+ structured.category = options.category;
130
+ updated.category = structured.category;
131
+ }
132
+ if (options.status !== undefined) {
133
+ structured.status = options.status;
134
+ updated.status = structured.status;
135
+ }
136
+ if (options.blocker !== undefined) {
137
+ structured.blocker = options.blocker.trim();
138
+ updated.blocker = structured.blocker;
139
+ }
140
+ if (options.clearBlocker) {
141
+ delete structured.blocker;
142
+ delete updated.blocker;
143
+ }
144
+ if (options.blockedBy !== undefined) {
145
+ const blockedBy = this.ticketRepository.normalizeDependencies(options.blockedBy);
146
+ updated.blocked_by = blockedBy;
147
+ structured.blockedBy = blockedBy;
148
+ }
149
+ if (options.clearBlockedBy) {
150
+ updated.blocked_by = [];
151
+ structured.blockedBy = [];
152
+ }
153
+ if (structured.status === "closed" && structured.blocker) {
154
+ throw new Error("Cannot close a blocked ticket; clear its blocker first.");
155
+ }
156
+ const changed = this.ticketRepository.serializeTicket(updated, this.ticketRepository.appendAudit(current.body, options.author, "Ticket fields updated."));
157
+ const candidate = tickets.map((item) => item.id === current.id ? { ...updated, raw: changed, body: matter(changed).content } : item);
158
+ this.ticketRepository.validateDependencyGraph(candidate);
159
+ this.workspaceTransaction.applyWrites(feature.workspace, [
160
+ { path: relative(feature.workspace, current.path), before: current.raw, after: changed },
161
+ {
162
+ path: "sdd.json",
163
+ before: readFileSync(feature.ledger, "utf8"),
164
+ after: `${JSON.stringify(ledger, null, 2)}\n`,
165
+ },
166
+ ]);
167
+ return { ticket: options.ticket, path: current.path };
168
+ });
169
+ }
170
+ ticketComment(options) {
171
+ validateTicketId(options.ticket);
172
+ validateAuthor(options.author);
173
+ if (!options.details.trim())
174
+ throw new Error("Comment details must not be empty.");
175
+ const feature = this.featureInspectionService.resolveFeature(options.spec);
176
+ return this.workspaceTransaction.run(feature.workspace, () => {
177
+ this.ledgerRepository.readLedger(feature);
178
+ const current = this.ticketRepository.requireTicket(this.ticketRepository.readTickets(feature.workspace), options.ticket);
179
+ const after = matter.stringify(this.ticketRepository.appendAudit(current.body, options.author, options.details.trim()), this.ticketRepository.metadata(current));
180
+ this.workspaceTransaction.applyWrites(feature.workspace, [
181
+ { path: relative(feature.workspace, current.path), before: current.raw, after },
182
+ ]);
183
+ return { ticket: options.ticket, path: current.path };
184
+ });
185
+ }
186
+ }
@@ -0,0 +1,113 @@
1
+ import { ServiceProvider } from "../Foundation/ServiceProvider.js";
2
+ import { GitService } from "../Git/Services/GitService.js";
3
+ import { ChecksRecordCommand } from "./Commands/ChecksRecordCommand.js";
4
+ import { ChecksRequireCommand } from "./Commands/ChecksRequireCommand.js";
5
+ import { ClaimCommand } from "./Commands/ClaimCommand.js";
6
+ import { CorrectCommand } from "./Commands/CorrectCommand.js";
7
+ import { CreateCommand } from "./Commands/CreateCommand.js";
8
+ import { FindingCreateCommand } from "./Commands/FindingCreateCommand.js";
9
+ import { FindingUpdateCommand } from "./Commands/FindingUpdateCommand.js";
10
+ import { FinishCommand } from "./Commands/FinishCommand.js";
11
+ import { ImplementCommand } from "./Commands/ImplementCommand.js";
12
+ import { NextCommand } from "./Commands/NextCommand.js";
13
+ import { ReadyCommand } from "./Commands/ReadyCommand.js";
14
+ import { RequirementsDecideCommand } from "./Commands/RequirementsDecideCommand.js";
15
+ import { ResumeCommand } from "./Commands/ResumeCommand.js";
16
+ import { ReviewCommand } from "./Commands/ReviewCommand.js";
17
+ import { ReviewRequireCommand } from "./Commands/ReviewRequireCommand.js";
18
+ import { StatusCommand } from "./Commands/StatusCommand.js";
19
+ import { SubmitCommand } from "./Commands/SubmitCommand.js";
20
+ import { TicketCommentCommand } from "./Commands/TicketCommentCommand.js";
21
+ import { TicketCreateCommand } from "./Commands/TicketCreateCommand.js";
22
+ import { TicketUpdateCommand } from "./Commands/TicketUpdateCommand.js";
23
+ import { GitEvidence } from "./Evidence/GitEvidence.js";
24
+ import { ReportEvidence } from "./Evidence/ReportEvidence.js";
25
+ import { FeatureWorkspace } from "./Persistence/FeatureWorkspace.js";
26
+ import { LedgerRepository } from "./Persistence/LedgerRepository.js";
27
+ import { PathSafety } from "./Persistence/PathSafety.js";
28
+ import { ReadinessReader } from "./Persistence/ReadinessReader.js";
29
+ import { TicketRepository } from "./Persistence/TicketRepository.js";
30
+ import { WorkspaceTransaction } from "./Persistence/WorkspaceTransaction.js";
31
+ import { AcceptancePolicy } from "./Policies/AcceptancePolicy.js";
32
+ import { AssignmentPolicy } from "./Policies/AssignmentPolicy.js";
33
+ import { CheckPolicy } from "./Policies/CheckPolicy.js";
34
+ import { FindingPolicy } from "./Policies/FindingPolicy.js";
35
+ import { ReadinessPolicy } from "./Policies/ReadinessPolicy.js";
36
+ import { ReviewPolicy } from "./Policies/ReviewPolicy.js";
37
+ import { WorkflowPolicy } from "./Policies/WorkflowPolicy.js";
38
+ import { AssignmentService } from "./Services/AssignmentService.js";
39
+ import { ChecksService } from "./Services/ChecksService.js";
40
+ import { CorrectionService } from "./Services/CorrectionService.js";
41
+ import { DeliveryCorrectionService } from "./Services/DeliveryCorrectionService.js";
42
+ import { DeliveryFindingService } from "./Services/DeliveryFindingService.js";
43
+ import { DeliveryService } from "./Services/DeliveryService.js";
44
+ import { DeliverySubmissionService } from "./Services/DeliverySubmissionService.js";
45
+ import { FeatureCreationService } from "./Services/FeatureCreationService.js";
46
+ import { FeatureInspectionService } from "./Services/FeatureInspectionService.js";
47
+ import { FindingService } from "./Services/FindingService.js";
48
+ import { IntegrationService } from "./Services/IntegrationService.js";
49
+ import { ReadinessService } from "./Services/ReadinessService.js";
50
+ import { RequirementsService } from "./Services/RequirementsService.js";
51
+ import { ReviewService } from "./Services/ReviewService.js";
52
+ import { SubmissionService } from "./Services/SubmissionService.js";
53
+ import { TicketService } from "./Services/TicketService.js";
54
+ export class SubagentDrivenDevelopmentServiceProvider extends ServiceProvider {
55
+ static commands() {
56
+ return [
57
+ CreateCommand,
58
+ TicketCreateCommand,
59
+ TicketUpdateCommand,
60
+ TicketCommentCommand,
61
+ ReadyCommand,
62
+ ClaimCommand,
63
+ ChecksRequireCommand,
64
+ ChecksRecordCommand,
65
+ ImplementCommand,
66
+ CorrectCommand,
67
+ ReviewCommand,
68
+ ReviewRequireCommand,
69
+ FindingCreateCommand,
70
+ FindingUpdateCommand,
71
+ RequirementsDecideCommand,
72
+ SubmitCommand,
73
+ FinishCommand,
74
+ ResumeCommand,
75
+ NextCommand,
76
+ StatusCommand,
77
+ ];
78
+ }
79
+ register() {
80
+ this.app.singleton(ReadinessReader, async (app) => new ReadinessReader(app, await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(PathSafety)));
81
+ this.app.singleton(ReadinessPolicy, async (app) => new ReadinessPolicy(app, await app.make(TicketRepository)));
82
+ this.app.singleton(FeatureCreationService, async (app) => new FeatureCreationService(app, await app.make(FeatureWorkspace), await app.make(PathSafety), await app.make(WorkspaceTransaction), await app.make(GitEvidence)));
83
+ this.app.singleton(FeatureInspectionService, async (app) => new FeatureInspectionService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(FeatureWorkspace), await app.make(TicketRepository), await app.make(AcceptancePolicy), await app.make(AssignmentPolicy), await app.make(CheckPolicy), await app.make(FindingPolicy), await app.make(ReviewPolicy)));
84
+ this.app.singleton(TicketService, async (app) => new TicketService(app, await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(PathSafety), await app.make(WorkspaceTransaction), await app.make(FeatureInspectionService)));
85
+ this.app.singleton(ReadinessService, async (app) => new ReadinessService(app, await app.make(FeatureInspectionService), await app.make(ReadinessReader), await app.make(ReadinessPolicy), await app.make(PathSafety)));
86
+ this.app.singleton(AssignmentService, async (app) => new AssignmentService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(AssignmentPolicy), await app.make(CheckPolicy), await app.make(ReviewPolicy), await app.make(WorkflowPolicy), await app.make(FeatureInspectionService)));
87
+ this.app.singleton(CorrectionService, async (app) => new CorrectionService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(WorkflowPolicy), await app.make(DeliveryCorrectionService), await app.make(FeatureInspectionService)));
88
+ this.app.singleton(DeliveryCorrectionService, async (app) => new DeliveryCorrectionService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(FeatureInspectionService)));
89
+ this.app.singleton(ChecksService, async (app) => new ChecksService(app, await app.make(GitEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(WorkflowPolicy), await app.make(FeatureInspectionService)));
90
+ this.app.singleton(ReviewService, async (app) => new ReviewService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(AssignmentPolicy), await app.make(CheckPolicy), await app.make(ReviewPolicy), await app.make(WorkflowPolicy), await app.make(FeatureInspectionService)));
91
+ this.app.singleton(FindingService, async (app) => new FindingService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(CheckPolicy), await app.make(FindingPolicy), await app.make(ReviewPolicy), await app.make(WorkflowPolicy), await app.make(DeliveryFindingService), await app.make(FeatureInspectionService)));
92
+ this.app.singleton(DeliveryFindingService, async (app) => new DeliveryFindingService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(CheckPolicy), await app.make(FindingPolicy), await app.make(ReviewPolicy), await app.make(FeatureInspectionService)));
93
+ this.app.singleton(RequirementsService, async (app) => new RequirementsService(app, await app.make(GitEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(WorkflowPolicy), await app.make(FeatureInspectionService)));
94
+ this.app.singleton(SubmissionService, async (app) => new SubmissionService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(CheckPolicy), await app.make(ReviewPolicy), await app.make(WorkflowPolicy), await app.make(DeliverySubmissionService), await app.make(FeatureInspectionService)));
95
+ this.app.singleton(DeliverySubmissionService, async (app) => new DeliverySubmissionService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(CheckPolicy), await app.make(ReviewPolicy), await app.make(FeatureInspectionService)));
96
+ this.app.singleton(IntegrationService, async (app) => new IntegrationService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(AcceptancePolicy), await app.make(WorkflowPolicy), await app.make(FeatureInspectionService)));
97
+ this.app.singleton(DeliveryService, async (app) => new DeliveryService(app, await app.make(GitEvidence), await app.make(ReportEvidence), await app.make(TicketRepository), await app.make(LedgerRepository), await app.make(WorkspaceTransaction), await app.make(CheckPolicy), await app.make(FindingPolicy), await app.make(ReviewPolicy), await app.make(FeatureInspectionService)));
98
+ this.app.singleton(FeatureWorkspace, async (app) => new FeatureWorkspace(app, await app.make(LedgerRepository), await app.make(PathSafety)));
99
+ this.app.singleton(LedgerRepository, async (app) => new LedgerRepository(app));
100
+ this.app.singleton(TicketRepository, async (app) => new TicketRepository(app, await app.make(PathSafety), await app.make(LedgerRepository)));
101
+ this.app.singleton(WorkspaceTransaction, async (app) => new WorkspaceTransaction(app, await app.make(PathSafety)));
102
+ this.app.singleton(PathSafety, async (app) => new PathSafety(app, await app.make(GitService)));
103
+ this.app.singleton(GitEvidence, async (app) => new GitEvidence(app, await app.make(GitService), await app.make(LedgerRepository)));
104
+ this.app.singleton(ReportEvidence, async (app) => new ReportEvidence(app, await app.make(PathSafety)));
105
+ this.app.singleton(CheckPolicy, async (app) => new CheckPolicy(app, await app.make(GitEvidence)));
106
+ this.app.singleton(ReviewPolicy, async (app) => new ReviewPolicy(app, await app.make(GitEvidence), await app.make(ReportEvidence)));
107
+ this.app.singleton(FindingPolicy, async (app) => new FindingPolicy(app, await app.make(ReviewPolicy)));
108
+ this.app.singleton(AcceptancePolicy, async (app) => new AcceptancePolicy(app, await app.make(AssignmentPolicy), await app.make(CheckPolicy), await app.make(FindingPolicy), await app.make(ReviewPolicy)));
109
+ this.app.singleton(AssignmentPolicy, async (app) => new AssignmentPolicy(app, await app.make(ReportEvidence)));
110
+ this.app.singleton(WorkflowPolicy, async (app) => new WorkflowPolicy(app));
111
+ }
112
+ async boot() { }
113
+ }
@@ -0,0 +1,5 @@
1
+ export class Records {
2
+ static isRecord(value) {
3
+ return typeof value === "object" && value !== null && !Array.isArray(value);
4
+ }
5
+ }