@juangcarmona/lighthouse-sdlc 0.18.2 → 0.18.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juangcarmona/lighthouse-sdlc",
3
- "version": "0.18.2",
3
+ "version": "0.18.4",
4
4
  "type": "module",
5
5
  "description": "Provider-neutral SDLC skills, commands and route contracts for Lighthouse adopters",
6
6
  "repository": {
@@ -140,8 +140,7 @@ export async function checkEpicCapacity({ api, repository, owner, child, current
140
140
  if (!Array.isArray(candidates) || candidates.length !== 1) throw Error('Epic child inventory is incomplete or ambiguous');
141
141
  const issue = await api(`issues/${candidates[0].number}`);
142
142
  if (issue.id !== candidates[0].id || issue.user?.login !== 'github-actions[bot]' || issue.user.type !== 'Bot' || !isDeepStrictEqual(readEpicMarker(issue.body), correlation)) throw Error('Epic child inventory changed');
143
- if (issue.state === 'closed') continue;
144
- if (issue.state !== 'open' || issue.pull_request) throw Error('Epic child state is uncertain');
143
+ if (!['open', 'closed'].includes(issue.state) || issue.pull_request) throw Error('Epic child state is uncertain');
145
144
  const comments = await issueComments(api, issue.number);
146
145
  const active = comments.filter(comment => comment.user?.login === 'github-actions[bot]' && comment.user.type === 'Bot' && comment.body?.includes('<!-- lighthouse-dispatch:')).map(comment => readDispatchReceipt(comment, repository, issue.number)).some(receipt => receipt.stage === 'implement' && receipt.id !== excludeRequest && ['requested', 'running', 'unknown'].includes(receipt.status));
147
146
  if (active || issue.number !== child && issue.labels.some(label => label.name === 'agent-working')) occupied++;
@@ -192,7 +192,7 @@ export async function reconcilePublishedStage(api, repository, owner, issue, com
192
192
  const expectedStatus = result.status === 'passed' ? 'completed' : question ? 'waiting' : 'blocked';
193
193
  if (!interrupted && dispatch.receipt.status !== expectedStatus) return 'uncertain';
194
194
  const projection = resultHandoffState({ status: result.status, stage: snapshot.stage, question });
195
- if (!projection.label || (!issue.labels.some(l => l.name === projection.label) && !(interrupted && issue.labels.some(l => l.name === snapshot.stage))) || issue.labels.some(l => ['ready', 'triaged', 'needs-info', 'waiting-review', 'execution-failed', 'pr-draft', 'pr-ready'].includes(l.name) && l.name !== projection.label)) return 'uncertain';
195
+ if ((projection.label && !issue.labels.some(l => l.name === projection.label) && !(interrupted && issue.labels.some(l => l.name === snapshot.stage))) || issue.labels.some(l => ['ready', 'triaged', 'needs-info', 'waiting-review', 'execution-failed', 'pr-draft', 'pr-ready'].includes(l.name) && l.name !== projection.label)) return 'uncertain';
196
196
  let action = question ? `Owner: ${question} Reply here.` : 'None.';
197
197
  let next = question ? `The answer will be checked against this question before ${snapshot.stage} continues.` : 'Any continuation follows the configured authorization.';
198
198
  if (snapshot.stage === 'refine' && result.status === 'passed') {
@@ -205,10 +205,10 @@ export async function reconcilePublishedStage(api, repository, owner, issue, com
205
205
  await checkDispatchClaim(api, repository, issue.number, { commentId: dispatch.commentId, requestId: dispatch.request.id, digest: dispatch.receipt.digest }, run.id);
206
206
  const fresh = await api(`issues/${issue.number}`), freshComments = await issueComments(api, issue.number);
207
207
  const currentRepo = await api(''), currentRevision = (await api(`commits/${encodeURIComponent(currentRepo.default_branch)}`)).sha;
208
- if (currentRevision !== revision || (await api(`commits/${encodeURIComponent(dispatch.request.ref)}`)).sha !== workflowRevision || fresh.state !== 'open' || fresh.user?.login !== owner || fresh.pull_request || fresh.labels.some(l => ['agent-working', 'human-working'].includes(l.name) || incompatibleStage(l)) || (!fresh.labels.some(l => l.name === projection.label) && !(interrupted && fresh.labels.some(l => l.name === snapshot.stage))) || fresh.labels.some(l => ['ready', 'triaged', 'needs-info', 'waiting-review', 'execution-failed', 'pr-draft', 'pr-ready'].includes(l.name) && l.name !== projection.label) || intent(fresh, freshComments, owner) !== dispatch.request.taskDigest) return 'uncertain';
208
+ if (currentRevision !== revision || (await api(`commits/${encodeURIComponent(dispatch.request.ref)}`)).sha !== workflowRevision || fresh.state !== 'open' || fresh.user?.login !== owner || fresh.pull_request || fresh.labels.some(l => ['agent-working', 'human-working'].includes(l.name) || incompatibleStage(l)) || (projection.label && !fresh.labels.some(l => l.name === projection.label) && !(interrupted && fresh.labels.some(l => l.name === snapshot.stage))) || fresh.labels.some(l => ['ready', 'triaged', 'needs-info', 'waiting-review', 'execution-failed', 'pr-draft', 'pr-ready'].includes(l.name) && l.name !== projection.label) || intent(fresh, freshComments, owner) !== dispatch.request.taskDigest) return 'uncertain';
209
209
  if (freshComments.some(c => c.user?.login === 'github-actions[bot]' && Number(c.id) > Number(dispatch.commentId) && c.body?.includes('<!-- lighthouse-dispatch:'))) return 'uncertain';
210
210
  if (interrupted && fresh.labels.some(l => l.name === snapshot.stage)) {
211
- if (!fresh.labels.some(l => l.name === projection.label)) {
211
+ if (projection.label && !fresh.labels.some(l => l.name === projection.label)) {
212
212
  await checkDispatchClaim(api, repository, issue.number, { commentId: dispatch.commentId, requestId: dispatch.request.id, digest: dispatch.receipt.digest }, run.id);
213
213
  await api(`issues/${issue.number}/labels`, 'POST', { labels: [projection.label] });
214
214
  }