@codyswann/lisa 8.1.1 → 8.2.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.
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.json +146 -11
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/scripts/queue-contract-resolution.mjs +583 -0
- package/plugins/lisa/.codex-plugin/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-summary.mjs +239 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-sweep.mjs +397 -0
- package/plugins/lisa/.codex-plugin/scripts/stale-blocker-verify.mjs +194 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa/scripts/stale-blocker-summary.mjs +239 -0
- package/plugins/lisa/scripts/stale-blocker-sweep.mjs +397 -0
- package/plugins/lisa/scripts/stale-blocker-verify.mjs +194 -0
- package/plugins/lisa/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-agy/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-agy/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-agy/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-agy/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-agy/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-agy/scripts/stale-blocker-summary.mjs +239 -0
- package/plugins/lisa-agy/scripts/stale-blocker-sweep.mjs +397 -0
- package/plugins/lisa-agy/scripts/stale-blocker-verify.mjs +194 -0
- package/plugins/lisa-agy/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-agy/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-agy/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-agy/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-copilot/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-summary.mjs +239 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-sweep.mjs +397 -0
- package/plugins/lisa-copilot/scripts/stale-blocker-verify.mjs +194 -0
- package/plugins/lisa-copilot/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-copilot/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-copilot/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-copilot/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-cursor/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-summary.mjs +239 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-sweep.mjs +397 -0
- package/plugins/lisa-cursor/scripts/stale-blocker-verify.mjs +194 -0
- package/plugins/lisa-cursor/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-cursor/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-cursor/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-cursor/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/scripts/ready-queue-order.mjs +99 -25
- package/plugins/lisa-devin/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/lisa-devin/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/lisa-devin/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/lisa-devin/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/lisa-devin/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/lisa-devin/scripts/stale-blocker-summary.mjs +239 -0
- package/plugins/lisa-devin/scripts/stale-blocker-sweep.mjs +397 -0
- package/plugins/lisa-devin/scripts/stale-blocker-verify.mjs +194 -0
- package/plugins/lisa-devin/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/lisa-devin/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/lisa-devin/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/lisa-devin/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/lisa-devin/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/scripts/ready-queue-order.mjs +99 -25
- package/plugins/src/base/scripts/stale-blocker-comment.mjs +185 -0
- package/plugins/src/base/scripts/stale-blocker-confirm.mjs +130 -0
- package/plugins/src/base/scripts/stale-blocker-edges.mjs +466 -0
- package/plugins/src/base/scripts/stale-blocker-pending.mjs +257 -0
- package/plugins/src/base/scripts/stale-blocker-restore.mjs +180 -0
- package/plugins/src/base/scripts/stale-blocker-summary.mjs +239 -0
- package/plugins/src/base/scripts/stale-blocker-sweep.mjs +397 -0
- package/plugins/src/base/scripts/stale-blocker-verify.mjs +194 -0
- package/plugins/src/base/skills/lisa-atlassian-access/SKILL.md +1 -0
- package/plugins/src/base/skills/lisa-github-build-intake/SKILL.md +2 -7
- package/plugins/src/base/skills/lisa-jira-build-intake/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-linear-access/SKILL.md +44 -0
- package/plugins/src/base/skills/lisa-linear-build-intake/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +127 -2
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
- package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
|
@@ -22,6 +22,8 @@ operation: list-issues [team:<ID>] [project:<ID>] [label:<NAME>] [state:<NAME>]
|
|
|
22
22
|
operation: get-issue id:<ID>
|
|
23
23
|
operation: save-issue payload:{...} [lifecycle_role:<ROLE>] [env:<KEY>]
|
|
24
24
|
operation: list-workflow-states team:<ID>
|
|
25
|
+
operation: delete-relation id:<ID>
|
|
26
|
+
operation: create-relation issue:<IDENTIFIER> related:<IDENTIFIER> type:blocks
|
|
25
27
|
operation: create-workflow-state payload:{...}
|
|
26
28
|
operation: list-comments (issue_id:<ID> | project_id:<ID>)
|
|
27
29
|
operation: save-comment (issue_id:<ID> | project_id:<ID>) body:"..."
|
|
@@ -293,6 +295,48 @@ Set `isTeamDefault` per node by comparing `node.id` against
|
|
|
293
295
|
the team's default, resolve the default through the team record and join on `id`
|
|
294
296
|
the same way.
|
|
295
297
|
|
|
298
|
+
## `delete-relation` — remove one relation by its own id
|
|
299
|
+
|
|
300
|
+
`delete-relation id:<ID>` deletes one issue relation by the relation's `id` (the
|
|
301
|
+
`inverseRelations` / `relations` node id, never an issue id). The session
|
|
302
|
+
manager's stale-blocker-link sweep uses it to drop a `blocks` relation whose
|
|
303
|
+
blocker is already finished (CodySwannGT/lisa#5065). Delete by relation id
|
|
304
|
+
only: never "update" a relation to remove it, because `issueRelationCreate`
|
|
305
|
+
converts an existing relation instead of adding one (CodySwannGT/lisa#3605).
|
|
306
|
+
|
|
307
|
+
```graphql
|
|
308
|
+
mutation($id:String!){ issueRelationDelete(id:$id){ success } }
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Read the issue back and confirm the relation is gone before reporting success.
|
|
312
|
+
The Linear MCP exposes no relation delete, so on an MCP-only substrate report
|
|
313
|
+
`Error: delete-relation needs the LINEAR_API_KEY GraphQL path` and leave the
|
|
314
|
+
relation in place.
|
|
315
|
+
|
|
316
|
+
## `create-relation` — put back one `blocks` relation
|
|
317
|
+
|
|
318
|
+
`create-relation issue:<blocker> related:<blocked> type:blocks` recreates the
|
|
319
|
+
relation "`<blocker>` blocks `<blocked>`". The stale-blocker-link sweep uses it
|
|
320
|
+
only to put back a relation it removed when the blocker reopened between its
|
|
321
|
+
confirm and its delete (CodySwannGT/lisa#5065). Resolve both identifiers to
|
|
322
|
+
issue ids first, and create it only after a read shows no relation between the
|
|
323
|
+
two issues: `issueRelationCreate` converts an existing relation instead of
|
|
324
|
+
adding a second one (CodySwannGT/lisa#3605), so it must never be used to edit.
|
|
325
|
+
|
|
326
|
+
```graphql
|
|
327
|
+
mutation($issueId:String!,$relatedIssueId:String!){
|
|
328
|
+
issueRelationCreate(input:{issueId:$issueId,relatedIssueId:$relatedIssueId,type:blocks}){
|
|
329
|
+
success issueRelation { id }
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Read the blocked issue back and confirm the `blocks` relation is in its
|
|
335
|
+
`inverseRelations` before reporting success. The Linear MCP exposes no relation
|
|
336
|
+
create with this guarantee, so on an MCP-only substrate report
|
|
337
|
+
`Error: create-relation needs the LINEAR_API_KEY GraphQL path` and name the
|
|
338
|
+
relation in the run's errors so a person can put it back.
|
|
339
|
+
|
|
296
340
|
## `save-comment` / `list-comments` — an Issue **or** a Project
|
|
297
341
|
|
|
298
342
|
Both comment operations take **either** `issue_id:` or `project_id:`. Exactly one
|
|
@@ -375,6 +375,8 @@ Post via `lisa-linear-access operation: save-comment` with:
|
|
|
375
375
|
|
|
376
376
|
This gate never blocks a legitimate flat Task/Bug: those have no open children and a leaf `type:`, so they fall straight through to the claim in 3b.
|
|
377
377
|
|
|
378
|
+
**Stale blocker links** (CodySwannGT/lisa#5065). Still before the claim, judge each "blocked by" edge of this item with the shared rule in `scripts/stale-blocker-edges.mjs` (`blockerResolution` against `terminalDoneRoles`, which reads the configured terminal done role from `.lisa.config.json`; never a hardcoded name). A blocker closed in the tracker, in that done role, or cancelled never holds the claim, and only those links are removed. A blocker in any other configured done state (an intermediate env rung such as `On Dev` or `On Stg`, from `landedDoneRoles`) has merged to a non-production environment: it does not hold the claim, but it is not finished, so its link is never removed. On a runtime with the session manager running, its Reconcile step removes those links every cycle. Every other runtime (Codex, Cursor, OpenCode, Antigravity, Copilot, Devin) has no session manager, so intake does the same clean-up for this one item: pass its read bundle to `planStaleLinkSweep` from `scripts/stale-blocker-sweep.mjs` (`max: 1`, `poster: "build-intake"`, so the comment carries this skill's `[claude-build-intake]` prefix). Right before writing, re-read the item and each blocker it names and pass that fresh read to `confirmStaleLinkPlan` from `scripts/stale-blocker-confirm.mjs`, which keeps only links that are still stale and rebuilds a GitHub body from the fresh body; write nothing when its `plan` is null. Before any write, record the confirmed plan with `recordInFlight` from `scripts/stale-blocker-pending.mjs` in `.lisa/stale-links-inflight.json` (it refuses an item that still has an unverified entry, so an earlier plan's removed links are never overwritten: do not claim or clean that item until the entry is verified), and settle it with `settleInFlight` only once `verifyStaleLinkRemoval` has read the item back and every other record (pending comment, owed restores) is saved; an item with an in-flight entry is not claimed; when the read-back fails, count it with `failedInFlight` and leave the entry, and at the start of the next run verify each entry still there again (never repeat its deletes) before anything else. Perform the confirmed plan's actions through `lisa-linear-access` (`delete-relation id:<id>`), then read the item back, and each removed blocker again, and pass both to `verifyStaleLinkRemoval` from `scripts/stale-blocker-verify.mjs` (`blockersNow`: `{<ref>: <the blocker as read now>}`). A removed link whose blocker reopened in between (or can no longer be read) comes back in `restored` with no marker: perform its `restore` actions straight away (`create-relation` through `lisa-linear-access` `operation: create-relation issue:<issue> related:<relatedIssue> type:blocks`), record those links as owed with `recordRestores(owed, result, plan.links, now)` in `.lisa/stale-links-restores.json`, read the item back, and settle the links it shows present with `settleRestores(owed, ref, presentRefs)`; name each in the summary. While an item still owes a restore it is not claimed (it would look unblocked while its blocker is open): at the start of the next run re-read it, perform `restoreActions` for the links still missing, and settle again. Only that item waits; every other ready item is still claimed, and a failed plan, verify or comment holds nothing. Post a comment only for the removals it confirms: its `comment` covers only links the read-back shows gone, so no marker is ever posted for a link whose deletion failed, and that link is simply planned again next run. A confirmed removal whose comment fails to post is owed: record it with `addPending` from `scripts/stale-blocker-pending.mjs` in `.lisa/stale-links-pending.json`, retry each owed comment on its own at the start of the next run (settling that one entry with `settlePending(pending, ref, removed)` after it posts, or counting a failure with `failedPending(pending, ref, removed)`; an item can owe more than one comment, and each settles on its own), and list any still owed under "Errors" in the summary. On a runtime whose workspace does not survive between runs, that file is lost with it; the summary's Errors entry, which quotes the comment, is then the only record, and the gap is stated there. Report the stale-link line from `summarizeVerifiedSweep` (scripts/stale-blocker-summary.mjs) over the verified results, never the plan's summary. Its `[lisa-stale-blocker-link]` markers make a re-run post nothing new. An open, cross-project or unreadable blocker is never touched; an unreadable one is named in the summary. Items in `$BLOCKED` are not cleaned here: they belong to the containment check in `lisa-repair-intake`.
|
|
379
|
+
|
|
378
380
|
#### 3b. Claim
|
|
379
381
|
|
|
380
382
|
Before the claim mutation, apply `claim-time-guards` — **Value before claim**, or **Worth doing** in `lisa-track` on runtimes without the rule tree (Antigravity). A ready label establishes neither value nor permission to expand scope. Respect the preceding human-hold gate; a declined incidental item consumes this cycle's one processed disposition.
|
|
@@ -578,6 +578,131 @@ just as long. Sweep both every cycle, after `classify` and before Dispatch:
|
|
|
578
578
|
A failure anywhere in this sweep is one transcript line: it never holds dispatch and never makes
|
|
579
579
|
the cycle `recovery-required`.
|
|
580
580
|
|
|
581
|
+
**Stale blocker links** (CodySwannGT/lisa#5065). A "blocked by" link to work that is already
|
|
582
|
+
finished makes the item look stuck when it is not, and an operator who sees every item waiting on
|
|
583
|
+
something cannot tell which ones really are. Clear those links every cycle, before Dispatch, so an
|
|
584
|
+
item held back only by them is claimable in this same cycle:
|
|
585
|
+
|
|
586
|
+
1. **Plan.** GitHub: `node "$SM/session-manager.mjs" stale-links-plan --tracker github --project-root "$ROOT"`
|
|
587
|
+
(it reads open issues, their native `blocked_by` dependencies and their `Blocked by` body lines
|
|
588
|
+
through `gh`). Jira / Linear: fetch every open item that has a blocker through
|
|
589
|
+
`lisa-atlassian-access` (the item's own `status`, plus `issuelinks` with each linked issue's
|
|
590
|
+
status and status category) or `lisa-linear-access` (the item's own `state { name }`, plus
|
|
591
|
+
`inverseRelations` with `id`, `type`, and the blocking issue's `identifier`, `team.key` and
|
|
592
|
+
`state { name type }`), with each item's comments, **paging until the last page**. The item's
|
|
593
|
+
own status is required: an item whose status is missing could be Blocked, so the plan leaves
|
|
594
|
+
all its links alone and lists it in `report.unknownStatus`. Write `{"complete":true,"items":[...]}` to
|
|
595
|
+
`.lisa/session-manager/stale-links-input.json` and run
|
|
596
|
+
`stale-links-plan --tracker jira|linear --input .lisa/session-manager/stale-links-input.json --project-root "$ROOT"`.
|
|
597
|
+
The plan writes nothing. A blocker is stale when it is closed in its tracker or sits in the
|
|
598
|
+
configured terminal done role (`.lisa.config.json`, never a hardcoded name). A blocker in an
|
|
599
|
+
intermediate done rung (`status:on-dev`, `On Stg`) has merged to a non-production environment:
|
|
600
|
+
it does not hold the item (the queue and intake treat it as cleared), but it is not finished,
|
|
601
|
+
so its link is never removed. A cancelled
|
|
602
|
+
blocker (GitHub `not_planned` or `duplicate`, Linear `canceled`) is treated as resolved, because
|
|
603
|
+
intake already ignores it, and the comment says it was cancelled. A blocker that is still open,
|
|
604
|
+
in another project or repository, or could not be read is never touched; an unreadable one is
|
|
605
|
+
listed in `report.inaccessible`. Items in the `blocked` role are left to the Blocked sweep
|
|
606
|
+
below, which decides by branch containment. `--max` caps the items per cycle (default 10); the
|
|
607
|
+
rest are `deferred` to the next cycle. Items whose planned removals did not happen in an earlier
|
|
608
|
+
cycle (recorded by `stale-links-verify`) are planned after every other candidate, so removals
|
|
609
|
+
that keep failing cannot take every slot; a removal that later succeeds clears the record.
|
|
610
|
+
2. **Confirm, then act** on each entry of `plans`. The plan is a snapshot: a blocker can be
|
|
611
|
+
reopened, or a person can edit the item, before you write. So first re-read the item **and
|
|
612
|
+
every blocker it names**, then write that one entry to
|
|
613
|
+
`.lisa/session-manager/stale-links-entry.json` and run
|
|
614
|
+
`stale-links-confirm --tracker github --plan .lisa/session-manager/stale-links-entry.json --project-root "$ROOT"`
|
|
615
|
+
(GitHub re-reads the issue, each blocker and the comments itself). For Jira and Linear, put the
|
|
616
|
+
fresh raw item, with its own status, each blocker's current status and the comments, in
|
|
617
|
+
`.lisa/session-manager/stale-links-fresh.json` and add `--input` with that path. Its `plan`
|
|
618
|
+
keeps only the links that are still stale: a reopened blocker is in `skipped` as
|
|
619
|
+
`blocker-not-resolved` and keeps its link, a missing item status skips every link as
|
|
620
|
+
`status-unknown`, an item closed since the plan skips as `item-closed`, only the planned links
|
|
621
|
+
themselves are kept (a link added since the plan, even to the same blocker, is never removed),
|
|
622
|
+
and the GitHub `body` is rebuilt from the fresh
|
|
623
|
+
body, so a concurrent edit survives. When `plan` is null, write nothing for that item. Also
|
|
624
|
+
skip it (one transcript line, no write) when it gained a person's assignee since the plan.
|
|
625
|
+
A non-null `plan` is recorded in flight (`.lisa/session-manager/stale-links-inflight.json`)
|
|
626
|
+
before you write anything, and stays there until a verify reads the item back and every other
|
|
627
|
+
record is saved, so a read-back that fails after the deletes is retried in step 3 instead of
|
|
628
|
+
being lost. While it is in flight, `queue` holds the item (reason `removal-unverified`). Confirm
|
|
629
|
+
refuses an item that still has an unverified entry, so an earlier plan's removed links are
|
|
630
|
+
never overwritten: skip that item this cycle (one transcript line); step 3 verifies it.
|
|
631
|
+
Then perform each of the confirmed plan's `actions` and nothing else, straight away. No tracker
|
|
632
|
+
offers a conditional delete ("remove this link only if its blocker is still finished"), so a
|
|
633
|
+
blocker can still reopen between this re-read and the write; verify below catches that and
|
|
634
|
+
puts the link back. A sub-second window remains between the delete and that re-read, during
|
|
635
|
+
which the link is briefly absent while its blocker is open. A queue read in that moment could
|
|
636
|
+
see the item as unblocked; the restore follows straight after, and that residual window is the
|
|
637
|
+
one gap no tracker API lets the sweep close.
|
|
638
|
+
- `delete-dependency` (GitHub): `gh api -X DELETE <endpoint>`.
|
|
639
|
+
- `body` (GitHub, when not null): write it as the issue body through `lisa-tracker-write`. It
|
|
640
|
+
differs from the fresh body only in the `Blocked by` refs it removes.
|
|
641
|
+
- `unlink` (Jira): `lisa-atlassian-access` `operation: unlink link-id:<linkId>`.
|
|
642
|
+
- `delete-relation` (Linear): `lisa-linear-access` `operation: delete-relation id:<relationId>`.
|
|
643
|
+
Then **verify**: write the confirmed entry to `.lisa/session-manager/stale-links-entry.json` and
|
|
644
|
+
run `stale-links-verify --tracker <t> --plan .lisa/session-manager/stale-links-entry.json --project-root "$ROOT"`
|
|
645
|
+
(GitHub reads the item back itself; Jira and Linear take the item as read back now in
|
|
646
|
+
`--input`, with its blocker relation list and its comments; without the relation list verify
|
|
647
|
+
refuses it, nothing is confirmed, and the entry stays in flight for step 3). It also reads every removed blocker again: GitHub itself; for Jira and
|
|
648
|
+
Linear, write `{"<ref>": <the blocker as read now, with its status / state and team>}` for
|
|
649
|
+
each planned removal to `.lisa/session-manager/stale-links-blockers.json` and add
|
|
650
|
+
`--blockers` with that path. A removed link whose blocker is no longer finished (reopened,
|
|
651
|
+
back in an intermediate done rung, or unreadable) is in `restored`, with no marker: perform its
|
|
652
|
+
`restore` actions straight away (`add-dependency`: `gh api -X POST <endpoint> -F
|
|
653
|
+
issue_id=<issueId>`; `body`: write it through `lisa-tracker-write`; `link` (Jira):
|
|
654
|
+
`lisa-atlassian-access` `operation: link from:<from> to:<to> type:<type>`; `create-relation`
|
|
655
|
+
(Linear): `lisa-linear-access` `operation: create-relation issue:<issue> related:<relatedIssue>
|
|
656
|
+
type:blocks`), then read the item back with
|
|
657
|
+
`stale-links-restored --ref <ref> --tracker <t> --project-root "$ROOT"` (GitHub reads it itself;
|
|
658
|
+
Jira and Linear add `--input` with the item as read now). Verify recorded those links as owed in
|
|
659
|
+
`.lisa/session-manager/stale-links-restores.json`, and `queue` holds the item (reason
|
|
660
|
+
`restore-owed`) until this read-back shows every one present; its `restore` lists fresh actions
|
|
661
|
+
for any still missing. Name each restored link in the cycle's transcript line. Its `confirmed` lists the removals the read-back shows gone and `stillPresent` the
|
|
662
|
+
ones that did not happen. Its `comment` (Jira: `commentAdf`, the same text as an ADF document,
|
|
663
|
+
because Jira Cloud's REST v3 comment body is ADF) covers ONLY the confirmed removals, so a
|
|
664
|
+
`[lisa-stale-blocker-link] blocker=<ref>` marker is never posted for a link that is still there:
|
|
665
|
+
a failed or impossible deletion (for example an MCP-only substrate) leaves no marker, and the
|
|
666
|
+
next cycle plans it again. When `comment` is null, post nothing. Otherwise the CLI has already
|
|
667
|
+
recorded it as pending; post it through `lisa-tracker-write`, then run
|
|
668
|
+
`stale-links-posted --ref <ref> --removed <its confirmed, comma-separated> --project-root "$ROOT"` (on a failed post, add `--failed`;
|
|
669
|
+
it stays pending). It also records any `stillPresent` removal for the next plan's ordering.
|
|
670
|
+
Keep every verify output for step 4. A link that comes back after its marker
|
|
671
|
+
was posted was put back by a person; the plan reports it in `report.keptByPerson` and never
|
|
672
|
+
removes it again.
|
|
673
|
+
3. **Retry what is owed.** Run `stale-links-pending --project-root "$ROOT"`, before Dispatch.
|
|
674
|
+
- For each `unverified` entry (a confirmed plan whose read-back failed), write its `plan` to
|
|
675
|
+
`.lisa/session-manager/stale-links-entry.json` and run the step 2 verify again (never the
|
|
676
|
+
deletes); a removal whose comment already posted is never owed twice.
|
|
677
|
+
- For each item in `restores`, run `stale-links-restored` as in step 2 and perform any
|
|
678
|
+
`restore` actions it returns, then run it again; the item stays held from Dispatch
|
|
679
|
+
(`restore-owed`) until it reports nothing owed. Every other item still dispatches.
|
|
680
|
+
- For each `pending` entry, post its `comment` (Jira:
|
|
681
|
+
`commentAdf`) on its `ref` through `lisa-tracker-write`, on its own, whatever the new plan
|
|
682
|
+
says, and settle that one entry with `stale-links-posted --ref <ref> --removed <its removed, comma-separated> --project-root "$ROOT"` (`--failed` when it fails again). An item can owe more than one comment; each settles on its own. Its
|
|
683
|
+
links are already gone, so no plan will ever see them again; this is the only place the
|
|
684
|
+
operator's explanation for them still comes from.
|
|
685
|
+
4. **Report.** The plan's `summary` describes intentions only ("planned", "would become ready"),
|
|
686
|
+
so never report it as done. Write `{"report":<the plan's report>,"results":[<each verify
|
|
687
|
+
output>]}` to `.lisa/session-manager/stale-links-results.json` and run
|
|
688
|
+
`stale-links-report --input .lisa/session-manager/stale-links-results.json --project-root "$ROOT"`. Its `summary` is
|
|
689
|
+
built from the verified results, with planned-but-not-done removals and deferred items counted
|
|
690
|
+
separately, e.g. `stale links: cleared 12 stale blocker links on 7 items; 3 now ready to start;
|
|
691
|
+
2 planned removals not done (retried next cycle); 4 items left for the next cycle; 29 real
|
|
692
|
+
blockers remain on 18 items.` Put that in the cycle's transcript line and in the recorded run
|
|
693
|
+
summary. Send Telegram nothing for this sweep unless `report.inaccessible` is non-empty and its
|
|
694
|
+
list changed since the last cycle: then one line naming the blockers that could not be opened.
|
|
695
|
+
|
|
696
|
+
A failure anywhere in this sweep is one transcript line and never makes the cycle
|
|
697
|
+
`recovery-required`. It holds dispatch for one item only: an item owed a restore (a blocker link
|
|
698
|
+
put back, not yet read back present) is held with reason `restore-owed`, an item whose removals
|
|
699
|
+
ran but were never read back with `removal-unverified`, and an item whose blocker list could not
|
|
700
|
+
be read with `blockers-unreadable`, until a later read clears it. A failed plan,
|
|
701
|
+
confirm, verify or comment holds nothing, and every other item still dispatches. Other runtimes have no session manager, so build intake runs the
|
|
702
|
+
same shared rule on the item it is about to claim (each `lisa-*-build-intake` skill's "Stale blocker
|
|
703
|
+
links" step); the rule itself lives in `scripts/stale-blocker-edges.mjs` and
|
|
704
|
+
`scripts/stale-blocker-sweep.mjs`, plain Node any agent can run.
|
|
705
|
+
|
|
581
706
|
**Blocked.** List the items in the `blocked` role (paged to completion, same access paths as the
|
|
582
707
|
queue below). For each:
|
|
583
708
|
|
|
@@ -758,7 +883,7 @@ Skip while `capacity` reports `paused`. Otherwise:
|
|
|
758
883
|
### 3. Report and record
|
|
759
884
|
|
|
760
885
|
If anything changed, write one transcript line, e.g.
|
|
761
|
-
`cycle: 2 running/4 cap, dispatched <TEAM>-124, released <TEAM>-125, 1 question pending
|
|
886
|
+
`cycle: 2 running/4 cap, dispatched <TEAM>-124, released <TEAM>-125, 1 question pending; stale links: cleared 2 stale blocker links on 1 item; 4 real blockers remain on 3 items` (the verified `stale-links-report` line). Then record
|
|
762
887
|
the run outcome (next section).
|
|
763
888
|
|
|
764
889
|
## Run outcome
|
|
@@ -769,7 +894,7 @@ session `start` creates), every cycle ends in **exactly one** of the six outcome
|
|
|
769
894
|
| This cycle | Run outcome |
|
|
770
895
|
|---|---|
|
|
771
896
|
| No dispatch, no state change, no question relayed or newly pending. The summary still states the denominator: "swept N ready, 0 dispatchable; R running/C cap". | `nothing-needed` |
|
|
772
|
-
| At least one of: a worker spawned and seen live in `status`; a Blocked→Ready release written and read back; an orphan finished, returned or re-dispatched, or a hold lifted, written and read back; an answer delivered and its marker removed (`SendMessage` acknowledged, or `resume` returned a session id), or recorded on the item and read back before its marker was removed; a stalled or `blocked-on-prompt` item retried. | `change-proved` |
|
|
897
|
+
| At least one of: a worker spawned and seen live in `status`; a Blocked→Ready release written and read back; a stale blocker link removed and confirmed by `stale-links-verify`; an orphan finished, returned or re-dispatched, or a hold lifted, written and read back; an answer delivered and its marker removed (`SendMessage` acknowledged, or `resume` returned a session id), or recorded on the item and read back before its marker was removed; a stalled or `blocked-on-prompt` item retried. | `change-proved` |
|
|
773
898
|
| An item was marked human-needed ("Mark and move on": marker and question comment written and read back), in any of the four cases, including an `exhausted` item moved to the `blocked` role, or a marked item whose question comment was re-posted after `item-answer` reported `no-question-comment`; or a worker `FAILED` moved the item to the `blocked` role with its reason comment, both read back. The summary names each ref and where to answer it. | `candidate-proposed` |
|
|
774
899
|
| No item was newly marked, but a pending question was re-sent on Telegram (`requestion`) and awaits the operator, and nothing else changed. | `approval-requested` |
|
|
775
900
|
| The tracker, a configured Telegram or `claude` was unreachable; Telegram is configured but was unavailable or unpaired (a question stayed pending with no Telegram message id); a human-needed mark could not be written or read back, or no marker is configured; an answer for a finished worker, an `exhausted` item or a `decision` no worker has picked up could not be posted on the item or read back (its question stays pending); a worker `FAILED`'s move to the `blocked` role could not be written or read back; a spawn failed after the claim (the item went back to Ready); a worker classified `setup-gap` (the item went back to Ready); the capacity probe failed. | `recovery-required` |
|
|
@@ -17,7 +17,12 @@
|
|
|
17
17
|
* Both tiers leave out items routed to a repo with a recorded setup gap
|
|
18
18
|
* (#4820) and list every gap once as `setupGaps`, with the command that
|
|
19
19
|
* clears it, so the manager reports it in plain language instead of
|
|
20
|
-
* re-dispatching there every cycle.
|
|
20
|
+
* re-dispatching there every cycle. They also leave out an item owed a
|
|
21
|
+
* stale-link restore (`restore-owed`, CodySwannGT/lisa#5065): a blocker link
|
|
22
|
+
* put back after its blocker reopened, not yet read back present, so the
|
|
23
|
+
* item would otherwise look unblocked while that blocker is open. An item
|
|
24
|
+
* whose stale-link removals ran but were never read back is held the same
|
|
25
|
+
* way (`removal-unverified`): its blocker may have reopened since.
|
|
21
26
|
*
|
|
22
27
|
* The GitHub fetches live in queue-github.mjs and JSON input in
|
|
23
28
|
* json-input.mjs (re-exported here), to keep each module under the line
|
|
@@ -39,10 +44,15 @@ import {
|
|
|
39
44
|
validOrAbsent,
|
|
40
45
|
} from "./cli-runtime.mjs";
|
|
41
46
|
import { resolveHumanGatePolicy } from "../../../scripts/human-gate-act.mjs";
|
|
47
|
+
import {
|
|
48
|
+
landedDoneRoles,
|
|
49
|
+
terminalDoneRoles,
|
|
50
|
+
} from "../../../scripts/stale-blocker-edges.mjs";
|
|
42
51
|
import { readJsonFile } from "./json-input.mjs";
|
|
43
52
|
import { readLedger } from "./ledger.mjs";
|
|
44
53
|
import { blockingGapRepo, listSetupGaps } from "./ledger-setup-gaps.mjs";
|
|
45
54
|
import { fetchGithubBacklog, fetchGithubQueue } from "./queue-github.mjs";
|
|
55
|
+
import { readInFlight, readRestores } from "./stale-links-state.mjs";
|
|
46
56
|
|
|
47
57
|
export { parseJson, readJsonFile } from "./json-input.mjs";
|
|
48
58
|
|
|
@@ -53,15 +63,17 @@ const NORMALIZERS = { jira: normalizeJiraIssue, linear: normalizeLinearIssue };
|
|
|
53
63
|
* @param {unknown} envelope - `{complete, pages, items}`
|
|
54
64
|
* @param {string} where - Where it came from, for messages
|
|
55
65
|
* @param {"jira"|"linear"} tracker - Vendor
|
|
66
|
+
* @param {readonly string[]} doneRoles - Configured terminal done names, so
|
|
67
|
+
* a blocker there counts as finished (#5065)
|
|
56
68
|
* @returns {{ items: object[], pages: unknown }} Normalized items
|
|
57
69
|
*/
|
|
58
|
-
function normalizeEnvelope(envelope, where, tracker) {
|
|
70
|
+
function normalizeEnvelope(envelope, where, tracker, judging) {
|
|
59
71
|
asSetupError(() => assertPagedToCompletion(envelope));
|
|
60
72
|
if (!Array.isArray(envelope.items)) {
|
|
61
73
|
throw new CliError(`${where}: items must be an array.`, 2);
|
|
62
74
|
}
|
|
63
75
|
return {
|
|
64
|
-
items: envelope.items.map(NORMALIZERS[tracker]),
|
|
76
|
+
items: envelope.items.map(item => NORMALIZERS[tracker](item, judging)),
|
|
65
77
|
pages: envelope.pages ?? null,
|
|
66
78
|
};
|
|
67
79
|
}
|
|
@@ -73,15 +85,21 @@ function normalizeEnvelope(envelope, where, tracker) {
|
|
|
73
85
|
* @param {object} ctx - CLI context
|
|
74
86
|
* @param {"jira"|"linear"} tracker - Vendor
|
|
75
87
|
* @param {boolean} withBacklog - Whether the backlog tier is required
|
|
88
|
+
* @param {ReturnType<typeof loadProject>} project - Loaded project
|
|
76
89
|
* @returns {{ items: object[], pages: unknown, backlog: { items: object[], pages: unknown } | null }} Normalized items
|
|
77
90
|
*/
|
|
78
|
-
function readEnvelopeQueue(ctx, tracker, withBacklog) {
|
|
91
|
+
function readEnvelopeQueue(ctx, tracker, withBacklog, project) {
|
|
79
92
|
const file = ctx.values.input;
|
|
80
93
|
if (!file) {
|
|
81
94
|
throw new CliError(`queue --tracker ${tracker} needs --input <file>.`, 2);
|
|
82
95
|
}
|
|
83
96
|
const envelope = readJsonFile(file);
|
|
84
|
-
const
|
|
97
|
+
const config = { tracker, global: project.global, local: project.local };
|
|
98
|
+
const judging = {
|
|
99
|
+
doneRoles: terminalDoneRoles(config),
|
|
100
|
+
landedRoles: landedDoneRoles(config),
|
|
101
|
+
};
|
|
102
|
+
const ready = normalizeEnvelope(envelope, file, tracker, judging);
|
|
85
103
|
if (!withBacklog) return { ...ready, backlog: null };
|
|
86
104
|
if (!envelope.backlog) {
|
|
87
105
|
throw new CliError(
|
|
@@ -93,7 +111,12 @@ function readEnvelopeQueue(ctx, tracker, withBacklog) {
|
|
|
93
111
|
}
|
|
94
112
|
return {
|
|
95
113
|
...ready,
|
|
96
|
-
backlog: normalizeEnvelope(
|
|
114
|
+
backlog: normalizeEnvelope(
|
|
115
|
+
envelope.backlog,
|
|
116
|
+
`${file} backlog`,
|
|
117
|
+
tracker,
|
|
118
|
+
judging
|
|
119
|
+
),
|
|
97
120
|
};
|
|
98
121
|
}
|
|
99
122
|
|
|
@@ -131,6 +154,46 @@ function withoutPending(order, waiting) {
|
|
|
131
154
|
};
|
|
132
155
|
}
|
|
133
156
|
|
|
157
|
+
/**
|
|
158
|
+
* Move items held by the stale-link state out of `ordered` into `excluded`:
|
|
159
|
+
* `restore-owed` until `stale-links-restored` reads their put-back links
|
|
160
|
+
* present, and `removal-unverified` until `stale-links-verify` reads back a
|
|
161
|
+
* removal whose read-back failed. Only those items wait; every other item
|
|
162
|
+
* still dispatches.
|
|
163
|
+
* @param {{ordered: {ref: string}[], excluded: {ref: string, reason: string}[]}} order - Ordered tier
|
|
164
|
+
* @param {Map<string, string>} held - Lower-cased ref -> reason
|
|
165
|
+
* @returns {{ordered: {ref: string}[], excluded: {ref: string, reason: string}[]}} Filtered tier
|
|
166
|
+
*/
|
|
167
|
+
function withoutStaleLinkHolds(order, held) {
|
|
168
|
+
const reasonOf = item => held.get(String(item.ref).toLowerCase());
|
|
169
|
+
return {
|
|
170
|
+
...order,
|
|
171
|
+
ordered: order.ordered.filter(item => reasonOf(item) === undefined),
|
|
172
|
+
excluded: [
|
|
173
|
+
...order.excluded,
|
|
174
|
+
...order.ordered
|
|
175
|
+
.filter(item => reasonOf(item) !== undefined)
|
|
176
|
+
.map(item => ({ ref: item.ref, reason: reasonOf(item) })),
|
|
177
|
+
],
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The items the stale-link state holds, by lower-cased ref.
|
|
183
|
+
* @param {string} root - Project root
|
|
184
|
+
* @returns {Map<string, string>} Ref -> reason
|
|
185
|
+
*/
|
|
186
|
+
function staleLinkHolds(root) {
|
|
187
|
+
const key = ref => ref.toLowerCase();
|
|
188
|
+
return new Map([
|
|
189
|
+
...Object.keys(readInFlight(root)).map(ref => [
|
|
190
|
+
key(ref),
|
|
191
|
+
"removal-unverified",
|
|
192
|
+
]),
|
|
193
|
+
...Object.keys(readRestores(root)).map(ref => [key(ref), "restore-owed"]),
|
|
194
|
+
]);
|
|
195
|
+
}
|
|
196
|
+
|
|
134
197
|
/**
|
|
135
198
|
* Move items routed to a repo with a recorded setup gap out of `ordered` into
|
|
136
199
|
* `excluded` with reason `setup-gap:<repo>` (#4820). Retrying cannot fix a
|
|
@@ -182,7 +245,7 @@ export async function queue(ctx) {
|
|
|
182
245
|
...fetchGithubQueue(ctx, project),
|
|
183
246
|
backlog: backlogPickup ? fetchGithubBacklog(ctx, project) : null,
|
|
184
247
|
}
|
|
185
|
-
: readEnvelopeQueue(ctx, tracker, backlogPickup);
|
|
248
|
+
: readEnvelopeQueue(ctx, tracker, backlogPickup, project);
|
|
186
249
|
const ledger = await readLedger(ctx.root);
|
|
187
250
|
const me = ctx.values.me ?? ledger.control.me ?? null;
|
|
188
251
|
const operators = config?.operatorIds ?? [];
|
|
@@ -200,10 +263,14 @@ export async function queue(ctx) {
|
|
|
200
263
|
const waiting = pendingRefs(ledger);
|
|
201
264
|
const gaps = ledger.control.setupGaps;
|
|
202
265
|
const multiRepo = Boolean(config?.repos);
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
266
|
+
const held = staleLinkHolds(ctx.root);
|
|
267
|
+
const order = withoutStaleLinkHolds(
|
|
268
|
+
withoutSetupGaps(
|
|
269
|
+
withoutPending(orderReadyQueue(items, policy), waiting),
|
|
270
|
+
gaps,
|
|
271
|
+
multiRepo
|
|
272
|
+
),
|
|
273
|
+
held
|
|
207
274
|
);
|
|
208
275
|
const json = {
|
|
209
276
|
tracker,
|
|
@@ -219,16 +286,19 @@ export async function queue(ctx) {
|
|
|
219
286
|
// An item both Ready and in the backlog fetch is Ready work; never twice.
|
|
220
287
|
const readyRefs = new Set(items.map(item => item.ref));
|
|
221
288
|
const backlogItems = backlog.items.filter(item => !readyRefs.has(item.ref));
|
|
222
|
-
const tier =
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
289
|
+
const tier = withoutStaleLinkHolds(
|
|
290
|
+
withoutSetupGaps(
|
|
291
|
+
withoutPending(
|
|
292
|
+
orderBacklogQueue(backlogItems, {
|
|
293
|
+
...policy,
|
|
294
|
+
validationFailures: ledger.validationFailures,
|
|
295
|
+
}),
|
|
296
|
+
waiting
|
|
297
|
+
),
|
|
298
|
+
gaps,
|
|
299
|
+
multiRepo
|
|
229
300
|
),
|
|
230
|
-
|
|
231
|
-
multiRepo
|
|
301
|
+
held
|
|
232
302
|
);
|
|
233
303
|
return {
|
|
234
304
|
json: {
|