@use-the-fork/spindle 0.0.2 → 0.2.0

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 (82) hide show
  1. package/build/Assets/Blueprints/Catalog.js +19 -9
  2. package/build/Assets/Blueprints/agents/sdd-implementer.agent.md +6 -6
  3. package/build/Assets/Blueprints/agents/sdd-orchestrator.agent.md +4 -7
  4. package/build/Assets/Blueprints/skills/author-agent/SKILL.md +9 -8
  5. package/build/Assets/Blueprints/skills/author-instruction/SKILL.md +9 -8
  6. package/build/Assets/Blueprints/skills/author-skill/SKILL.md +9 -8
  7. package/build/Assets/Blueprints/skills/grill/SKILL.md +3 -3
  8. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/SKILL.md +16 -12
  9. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/assets/implementer-prompt.md +2 -2
  10. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/corrective-rounds.md +1 -1
  11. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/example-workflow.md +14 -12
  12. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/full-spec.md +43 -23
  13. package/build/Assets/Blueprints/skills/int-subagent-driven-dev/references/review-inputs.md +7 -7
  14. package/build/Assets/Blueprints/skills/int-testing-agent-guidance/SKILL.md +2 -2
  15. package/build/Assets/Blueprints/skills/int-writing-skills/SKILL.md +2 -2
  16. package/build/Assets/Blueprints/skills/int-writing-skills/references/testing-skills.md +2 -2
  17. package/build/Assets/Blueprints/skills/{asd-ste100 → ref-asd-ste100}/SKILL.md +1 -1
  18. package/build/Assets/Blueprints/skills/ref-php-laravel-saloon-api-integrations/SKILL.md +38 -0
  19. package/build/Assets/Blueprints/skills/ref-php-laravel-saloon-api-integrations/references/concurrency-and-pools.md +73 -0
  20. package/build/Assets/Blueprints/skills/ref-php-laravel-saloon-api-integrations/references/connectors.md +99 -0
  21. package/build/Assets/Blueprints/skills/ref-php-laravel-saloon-api-integrations/references/data-transfer-objects.md +104 -0
  22. package/build/Assets/Blueprints/skills/ref-php-laravel-saloon-api-integrations/references/handling-failures.md +95 -0
  23. package/build/Assets/Blueprints/skills/ref-php-laravel-saloon-api-integrations/references/requests.md +111 -0
  24. package/build/Assets/Blueprints/skills/ref-php-laravel-saloon-api-integrations/references/responses.md +56 -0
  25. package/build/Assets/Blueprints/skills/ref-php-laravel-saloon-api-integrations/references/sending-requests.md +42 -0
  26. package/build/Assets/Blueprints/skills/ref-php-laravel-saloon-api-integrations/references/testing.md +119 -0
  27. package/build/Assets/Blueprints/skills/{author-design → sdd-author-design}/SKILL.md +12 -4
  28. package/build/Assets/Blueprints/skills/{grill-design → sdd-grill-design}/SKILL.md +1 -1
  29. package/build/Assets/Blueprints/skills/{implement-spec → sdd-implement-spec}/SKILL.md +6 -8
  30. package/build/Assets/Blueprints/skills/{to-spec → sdd-to-spec}/SKILL.md +3 -3
  31. package/build/Assets/Blueprints/skills/{to-tickets → sdd-to-tickets}/SKILL.md +3 -3
  32. package/build/Assets/Blueprints/skills/{setup-project → spindle-project-setup}/SKILL.md +4 -4
  33. package/build/Assets/Blueprints/skills/{update-tooling → spindle-tooling-update}/SKILL.md +5 -5
  34. package/build/Assets/Templates/project/copilot-instructions.md +3 -9
  35. package/build/Assets/Templates/project/ticket-tracker.md +14 -6
  36. package/build/BlueprintManagement/Commands/Prompts.js +1 -1
  37. package/build/SubagentDrivenDevelopment/Commands/ChecksRecordCommand.js +27 -5
  38. package/build/SubagentDrivenDevelopment/Commands/ChecksRequireCommand.js +31 -7
  39. package/build/SubagentDrivenDevelopment/Commands/CorrectCommand.js +0 -1
  40. package/build/SubagentDrivenDevelopment/Commands/FinishCommand.js +2 -1
  41. package/build/SubagentDrivenDevelopment/Commands/ImplementCommand.js +2 -0
  42. package/build/SubagentDrivenDevelopment/Commands/{ClaimCommand.js → IntegrateCommand.js} +8 -7
  43. package/build/SubagentDrivenDevelopment/Commands/ReviewCommand.js +9 -9
  44. package/build/SubagentDrivenDevelopment/Commands/StartCommand.js +23 -0
  45. package/build/SubagentDrivenDevelopment/Commands/StatusCommand.js +5 -0
  46. package/build/SubagentDrivenDevelopment/Commands/groups.js +3 -2
  47. package/build/SubagentDrivenDevelopment/Evidence/GitEvidence.js +188 -37
  48. package/build/SubagentDrivenDevelopment/Models/Workflow.js +0 -2
  49. package/build/SubagentDrivenDevelopment/Persistence/AssignmentSchema.js +4 -0
  50. package/build/SubagentDrivenDevelopment/Persistence/CheckSchema.js +4 -13
  51. package/build/SubagentDrivenDevelopment/Persistence/LedgerRepository.js +66 -5
  52. package/build/SubagentDrivenDevelopment/Persistence/ProgressSchema.js +54 -4
  53. package/build/SubagentDrivenDevelopment/Persistence/ReviewSchema.js +4 -0
  54. package/build/SubagentDrivenDevelopment/Policies/AssignmentPolicy.js +0 -3
  55. package/build/SubagentDrivenDevelopment/Policies/CheckPolicy.js +6 -3
  56. package/build/SubagentDrivenDevelopment/Policies/ReadinessPolicy.js +16 -6
  57. package/build/SubagentDrivenDevelopment/Policies/ReviewPolicy.js +16 -2
  58. package/build/SubagentDrivenDevelopment/Policies/WorkflowPolicy.js +8 -8
  59. package/build/SubagentDrivenDevelopment/Services/AssignmentService.js +73 -51
  60. package/build/SubagentDrivenDevelopment/Services/ChecksService.js +376 -21
  61. package/build/SubagentDrivenDevelopment/Services/CorrectionService.js +83 -14
  62. package/build/SubagentDrivenDevelopment/Services/DeliveryCorrectionService.js +3 -7
  63. package/build/SubagentDrivenDevelopment/Services/DeliveryService.js +43 -38
  64. package/build/SubagentDrivenDevelopment/Services/FeatureCreationService.js +1 -1
  65. package/build/SubagentDrivenDevelopment/Services/FeatureFinalizationService.js +1202 -0
  66. package/build/SubagentDrivenDevelopment/Services/FeatureInspectionService.js +41 -49
  67. package/build/SubagentDrivenDevelopment/Services/FeatureWorktreeService.js +544 -0
  68. package/build/SubagentDrivenDevelopment/Services/ReadinessService.js +2 -2
  69. package/build/SubagentDrivenDevelopment/Services/ReviewService.js +39 -3
  70. package/build/SubagentDrivenDevelopment/Services/SubmissionService.js +4 -1
  71. package/build/SubagentDrivenDevelopment/Services/TicketIntegrationService.js +621 -0
  72. package/build/SubagentDrivenDevelopment/Services/TicketService.js +3 -0
  73. package/build/SubagentDrivenDevelopment/Services/TicketWorktreeService.js +317 -0
  74. package/build/SubagentDrivenDevelopment/Services/WorkflowRecordsCommitter.js +336 -0
  75. package/build/SubagentDrivenDevelopment/SubagentDrivenDevelopmentServiceProvider.js +18 -8
  76. package/build/TemplateRendering/Computed/ComputedVariableProviders.js +2 -0
  77. package/build/TemplateRendering/Computed/Providers/AuthoringFlowchartProvider.js +26 -0
  78. package/package.json +2 -2
  79. package/build/SubagentDrivenDevelopment/Services/IntegrationService.js +0 -258
  80. /package/build/Assets/Blueprints/skills/{asd-ste100 → ref-asd-ste100}/CREDITS.MD +0 -0
  81. /package/build/Assets/Blueprints/skills/{asd-ste100 → ref-asd-ste100}/examples/before-after.md +0 -0
  82. /package/build/Assets/Blueprints/skills/{asd-ste100 → ref-asd-ste100}/references/writing-rules.md +0 -0
@@ -44,19 +44,15 @@ export class DeliveryCorrectionService extends Service {
44
44
  ].includes(options.reason ?? "")) {
45
45
  throw new Error("--reason is required for a pause and must identify the adjudication category.");
46
46
  }
47
- if (options.assessment || options.assessmentResult) {
47
+ if (options.assessment) {
48
48
  throw new Error("--assessment is only valid with --decision continue.");
49
49
  }
50
50
  }
51
51
  else if (options.reason) {
52
52
  throw new Error("--reason is only valid with --decision pause.");
53
53
  }
54
- if (options.decision === "continue" &&
55
- (!options.assessment?.trim() || options.assessmentResult !== "productive")) {
56
- throw new Error("--assessment and --assessment-result productive are required with --decision continue.");
57
- }
58
- if (options.assessmentResult && options.decision !== "continue") {
59
- throw new Error("--assessment-result is only valid with --decision continue.");
54
+ if (options.decision === "continue" && !options.assessment?.trim()) {
55
+ throw new Error("--assessment is required with --decision continue.");
60
56
  }
61
57
  const feature = this.featureInspectionService.resolveFeature(options.spec);
62
58
  return this.workspaceTransaction.run(feature.workspace, () => {
@@ -14,7 +14,8 @@ export class DeliveryService extends Service {
14
14
  findingPolicy;
15
15
  reviewPolicy;
16
16
  featureInspectionService;
17
- constructor(app, gitEvidence, reportEvidence, ticketRepository, ledgerRepository, workspaceTransaction, checkPolicy, findingPolicy, reviewPolicy, featureInspectionService) {
17
+ finalization;
18
+ constructor(app, gitEvidence, reportEvidence, ticketRepository, ledgerRepository, workspaceTransaction, checkPolicy, findingPolicy, reviewPolicy, featureInspectionService, finalization) {
18
19
  super(app);
19
20
  this.gitEvidence = gitEvidence;
20
21
  this.reportEvidence = reportEvidence;
@@ -25,12 +26,17 @@ export class DeliveryService extends Service {
25
26
  this.findingPolicy = findingPolicy;
26
27
  this.reviewPolicy = reviewPolicy;
27
28
  this.featureInspectionService = featureInspectionService;
29
+ this.finalization = finalization;
28
30
  }
29
31
  finish(options) {
30
32
  validateAuthor(options.author);
31
- const feature = this.featureInspectionService.resolveFeature(options.spec);
33
+ const feature = this.finalization.recordedFeature(options.spec) ??
34
+ this.featureInspectionService.resolveFeature(options.spec);
35
+ return this.finalization.finish(feature, options, (ledger) => this.assertReady(feature, options, ledger));
36
+ }
37
+ assertReady(feature, options, approvedLedger) {
32
38
  return this.workspaceTransaction.run(feature.workspace, () => {
33
- const ledger = this.ledgerRepository.readLedger(feature);
39
+ const ledger = approvedLedger ?? this.ledgerRepository.readLedger(feature);
34
40
  const delivery = ledger.delivery;
35
41
  if (ledger.tickets.length === 0) {
36
42
  throw new Error("Cannot finish; the feature must contain at least one ticket.");
@@ -42,9 +48,39 @@ export class DeliveryService extends Service {
42
48
  if (missing.length > 0) {
43
49
  throw new Error(`Cannot finish; every feature ticket must be closed: ${missing.join(", ")}.`);
44
50
  }
51
+ const unintegrated = ledger.tickets
52
+ .filter((progress) => progress.execution !== "integrated" || !progress.integration)
53
+ .map((progress) => progress.id);
54
+ if (unintegrated.length > 0) {
55
+ throw new Error(`Cannot finish; every ticket must be integrated: ${unintegrated.join(", ")}.`);
56
+ }
57
+ if (ledger.tickets.some((progress) => !progress.worktree ||
58
+ progress.integration?.postMerge?.status !== "passed" ||
59
+ !progress.integration.postMerge.checks ||
60
+ progress.integration.postMerge.mergeSha !== progress.integration.mergeSha ||
61
+ progress.integration.postMerge.checks.required.length === 0 ||
62
+ progress.integration.postMerge.checks.required.some((requirement) => {
63
+ const latest = progress
64
+ .integration.postMerge.checks.records.filter((record) => record.command === requirement.command)
65
+ .at(-1);
66
+ return (latest?.result !== "passed" || latest.headSha !== progress.integration.mergeSha);
67
+ }))) {
68
+ throw new Error("Cannot finish; every ticket needs recorded worktree ownership and passing exact post-merge validation.");
69
+ }
45
70
  if (tickets.length !== ledger.tickets.length) {
46
71
  throw new Error("Cannot finish; one or more feature ticket documents are missing.");
47
72
  }
73
+ for (const progress of ledger.tickets) {
74
+ if (!progress.acceptedEvidence || progress.adjudication?.status === "pending") {
75
+ throw new Error(`Cannot finish; ticket ${progress.id} has no frozen acceptance evidence or awaits adjudication.`);
76
+ }
77
+ const blockers = this.findingPolicy.findingBlockers(progress, {
78
+ ...progress.acceptedEvidence,
79
+ headSha: progress.integration.commitSha,
80
+ });
81
+ if (blockers.length)
82
+ throw new Error(`Cannot finish; ticket findings remain blocking:\n${blockers.join("\n")}`);
83
+ }
48
84
  if (delivery.adjudication?.status === "pending") {
49
85
  throw new Error(`Cannot finish; delivery correction is paused for adjudication (${delivery.adjudication.reason}).`);
50
86
  }
@@ -101,49 +137,18 @@ export class DeliveryService extends Service {
101
137
  reportSha256: createHash("sha256").update(content).digest("hex"),
102
138
  };
103
139
  }
104
- if (delivery.finished) {
105
- const same = delivery.finished.report === retrospective?.report &&
106
- delivery.finished.reportSha256 === retrospective?.reportSha256;
107
- if (!same) {
108
- throw new Error("Full-spec delivery is already finished with different retrospective evidence.");
109
- }
110
- return {
111
- scope: "delivery",
112
- finished: true,
113
- idempotent: true,
114
- retrospectiveRequired: ledger.retrospectiveRequired,
115
- ...(retrospective ? { retrospective } : {}),
116
- ...identity,
117
- };
118
- }
119
140
  const confirmed = this.gitEvidence.deliveryIdentity(feature, ledger, this.ticketRepository.readTickets(feature.workspace));
120
141
  if (confirmed.snapshot !== identity.snapshot ||
121
142
  this.checkPolicy.deliveryCheckBlockers(delivery, confirmed).length > 0) {
122
143
  throw new Error("Aggregate content or check evidence changed while finishing; resume and revalidate delivery.");
123
144
  }
124
- delivery.execution = "complete";
125
- delivery.finished = {
126
- at: new Date().toISOString(),
127
- author: options.author.trim(),
128
- ...retrospective,
129
- };
130
- delivery.status = "complete";
131
- delivery.history.push({
132
- at: delivery.finished.at,
133
- author: delivery.finished.author,
134
- action: "delivery-finished",
135
- });
136
- this.workspaceTransaction.writeLedger(feature, ledger);
137
- return {
138
- scope: "delivery",
139
- finished: true,
140
- retrospectiveRequired: ledger.retrospectiveRequired,
141
- ...(retrospective ? { retrospective } : {}),
142
- ...identity,
143
- };
145
+ return { ledger, identity, retrospective };
144
146
  });
145
147
  }
146
148
  next(options) {
149
+ const recorded = this.finalization.recordedFeature(options.spec);
150
+ if (recorded)
151
+ return this.finalization.status(recorded.feature);
147
152
  const status = this.featureInspectionService.status(options);
148
153
  return {
149
154
  feature: status.feature,
@@ -97,7 +97,7 @@ export class FeatureCreationService extends Service {
97
97
  retrospectiveRequired: options.requireRetrospective ?? false,
98
98
  reviewPolicy: {
99
99
  version: 1,
100
- ticket: ["sdd-reviewer"],
100
+ ticket: ["sdd-task-reviewer"],
101
101
  delivery: ["sdd-reviewer"],
102
102
  },
103
103
  tickets: [],