@codyswann/lisa 4.99.6 → 4.99.7
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/all/copy-overwrite/scripts/check-third-party-review-evidence.mjs +337 -26
- package/dist/cli/doctor-third-party-evidence-seed.d.ts +9 -4
- package/dist/cli/doctor-third-party-evidence-seed.d.ts.map +1 -1
- package/dist/cli/doctor-third-party-evidence-seed.js +66 -21
- package/dist/cli/doctor-third-party-evidence-seed.js.map +1 -1
- package/dist/cli/doctor-third-party-evidence-steps.d.ts +19 -0
- package/dist/cli/doctor-third-party-evidence-steps.d.ts.map +1 -0
- package/dist/cli/doctor-third-party-evidence-steps.js +60 -0
- package/dist/cli/doctor-third-party-evidence-steps.js.map +1 -0
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +12 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/third-party-evidence-seed.d.ts +10 -1
- package/dist/core/third-party-evidence-seed.d.ts.map +1 -1
- package/dist/core/third-party-evidence-seed.js +72 -5
- package/dist/core/third-party-evidence-seed.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +43 -27
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- 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/skills/lisa-debrief-apply/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-delivery-effectiveness/SKILL.md +2 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-drive-pr-to-merge/SKILL.md +17 -7
- package/plugins/lisa/.codex-plugin/skills/lisa-github-build-intake/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +2 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-build-intake/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-learnings-audit/SKILL.md +11 -4
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-build-intake/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-persist-learning/SKILL.md +12 -12
- package/plugins/lisa/.codex-plugin/skills/lisa-pull-request-review/SKILL.md +62 -6
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +22 -5
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/answer-record.mjs +28 -4
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-answer-record.mjs +2 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-human.mjs +38 -4
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +8 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/ledger-questions.mjs +6 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-task-decomposition/SKILL.md +2 -2
- package/plugins/lisa/agents/learning-judge.md +7 -5
- package/plugins/lisa/commands/persist-learning.md +1 -1
- package/plugins/lisa/rules/reference/claim-archaeology.md +1 -1
- package/plugins/lisa/rules/reference/rejection-detection.md +1 -1
- package/plugins/lisa/rules/reference/work-item-definition-of-ready.md +5 -2
- package/plugins/lisa/skills/lisa-debrief-apply/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-delivery-effectiveness/SKILL.md +2 -2
- package/plugins/lisa/skills/lisa-drive-pr-to-merge/SKILL.md +17 -7
- package/plugins/lisa/skills/lisa-github-build-intake/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-implement/SKILL.md +2 -2
- package/plugins/lisa/skills/lisa-jira-build-intake/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-learnings-audit/SKILL.md +11 -4
- package/plugins/lisa/skills/lisa-linear-build-intake/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-persist-learning/SKILL.md +12 -12
- package/plugins/lisa/skills/lisa-pull-request-review/SKILL.md +62 -6
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +22 -5
- package/plugins/lisa/skills/lisa-session-manager/scripts/answer-record.mjs +28 -4
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-answer-record.mjs +2 -1
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-human.mjs +38 -4
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +8 -3
- package/plugins/lisa/skills/lisa-session-manager/scripts/ledger-questions.mjs +6 -1
- package/plugins/lisa/skills/lisa-task-decomposition/SKILL.md +2 -2
- package/plugins/lisa-agy/agents/learning-judge.md +7 -5
- package/plugins/lisa-agy/commands/lisa/persist-learning.md +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-debrief-apply/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-delivery-effectiveness/SKILL.md +2 -2
- package/plugins/lisa-agy/skills/lisa-drive-pr-to-merge/SKILL.md +17 -7
- package/plugins/lisa-agy/skills/lisa-github-build-intake/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +2 -2
- package/plugins/lisa-agy/skills/lisa-jira-build-intake/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-learnings-audit/SKILL.md +11 -4
- package/plugins/lisa-agy/skills/lisa-linear-build-intake/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-persist-learning/SKILL.md +12 -12
- package/plugins/lisa-agy/skills/lisa-pull-request-review/SKILL.md +62 -6
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +22 -5
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/answer-record.mjs +28 -4
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-answer-record.mjs +2 -1
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-human.mjs +38 -4
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +8 -3
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/ledger-questions.mjs +6 -1
- package/plugins/lisa-agy/skills/lisa-task-decomposition/SKILL.md +2 -2
- 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/agents/learning-judge.agent.md +7 -5
- package/plugins/lisa-copilot/commands/lisa/persist-learning.md +1 -1
- package/plugins/lisa-copilot/rules/reference/claim-archaeology.md +1 -1
- package/plugins/lisa-copilot/rules/reference/rejection-detection.md +1 -1
- package/plugins/lisa-copilot/rules/reference/work-item-definition-of-ready.md +5 -2
- package/plugins/lisa-copilot/skills/lisa-debrief-apply/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-delivery-effectiveness/SKILL.md +2 -2
- package/plugins/lisa-copilot/skills/lisa-drive-pr-to-merge/SKILL.md +17 -7
- package/plugins/lisa-copilot/skills/lisa-github-build-intake/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +2 -2
- package/plugins/lisa-copilot/skills/lisa-jira-build-intake/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-learnings-audit/SKILL.md +11 -4
- package/plugins/lisa-copilot/skills/lisa-linear-build-intake/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-persist-learning/SKILL.md +12 -12
- package/plugins/lisa-copilot/skills/lisa-pull-request-review/SKILL.md +62 -6
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +22 -5
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/answer-record.mjs +28 -4
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-answer-record.mjs +2 -1
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-human.mjs +38 -4
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +8 -3
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/ledger-questions.mjs +6 -1
- package/plugins/lisa-copilot/skills/lisa-task-decomposition/SKILL.md +2 -2
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/agents/learning-judge.md +7 -5
- package/plugins/lisa-cursor/commands/lisa/persist-learning.md +1 -1
- package/plugins/lisa-cursor/rules/claim-archaeology-reference.mdc +1 -1
- package/plugins/lisa-cursor/rules/rejection-detection-reference.mdc +1 -1
- package/plugins/lisa-cursor/rules/work-item-definition-of-ready-reference.mdc +5 -2
- package/plugins/lisa-cursor/skills/lisa-debrief-apply/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-delivery-effectiveness/SKILL.md +2 -2
- package/plugins/lisa-cursor/skills/lisa-drive-pr-to-merge/SKILL.md +17 -7
- package/plugins/lisa-cursor/skills/lisa-github-build-intake/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +2 -2
- package/plugins/lisa-cursor/skills/lisa-jira-build-intake/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-learnings-audit/SKILL.md +11 -4
- package/plugins/lisa-cursor/skills/lisa-linear-build-intake/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-persist-learning/SKILL.md +12 -12
- package/plugins/lisa-cursor/skills/lisa-pull-request-review/SKILL.md +62 -6
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +22 -5
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/answer-record.mjs +28 -4
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-answer-record.mjs +2 -1
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-human.mjs +38 -4
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +8 -3
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/ledger-questions.mjs +6 -1
- package/plugins/lisa-cursor/skills/lisa-task-decomposition/SKILL.md +2 -2
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/agents/learning-judge.md +7 -5
- package/plugins/lisa-devin/rules/reference/claim-archaeology.md +1 -1
- package/plugins/lisa-devin/rules/reference/rejection-detection.md +1 -1
- package/plugins/lisa-devin/rules/reference/work-item-definition-of-ready.md +5 -2
- package/plugins/lisa-devin/skills/lisa-debrief-apply/SKILL.md +1 -1
- package/plugins/lisa-devin/skills/lisa-delivery-effectiveness/SKILL.md +2 -2
- package/plugins/lisa-devin/skills/lisa-drive-pr-to-merge/SKILL.md +17 -7
- package/plugins/lisa-devin/skills/lisa-github-build-intake/SKILL.md +1 -1
- package/plugins/lisa-devin/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-devin/skills/lisa-implement/SKILL.md +2 -2
- package/plugins/lisa-devin/skills/lisa-jira-build-intake/SKILL.md +1 -1
- package/plugins/lisa-devin/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/lisa-devin/skills/lisa-learnings-audit/SKILL.md +11 -4
- package/plugins/lisa-devin/skills/lisa-linear-build-intake/SKILL.md +1 -1
- package/plugins/lisa-devin/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/lisa-devin/skills/lisa-persist-learning/SKILL.md +12 -12
- package/plugins/lisa-devin/skills/lisa-pull-request-review/SKILL.md +62 -6
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +22 -5
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/answer-record.mjs +28 -4
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-answer-record.mjs +2 -1
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-human.mjs +38 -4
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +8 -3
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/ledger-questions.mjs +6 -1
- package/plugins/lisa-devin/skills/lisa-task-decomposition/SKILL.md +2 -2
- 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-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-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/agents/learning-judge.md +7 -5
- package/plugins/src/base/commands/persist-learning.md +1 -1
- package/plugins/src/base/rules/reference/claim-archaeology.md +1 -1
- package/plugins/src/base/rules/reference/rejection-detection.md +1 -1
- package/plugins/src/base/rules/reference/work-item-definition-of-ready.md +5 -2
- package/plugins/src/base/skills/lisa-debrief-apply/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-delivery-effectiveness/SKILL.md +2 -2
- package/plugins/src/base/skills/lisa-drive-pr-to-merge/SKILL.md +17 -7
- package/plugins/src/base/skills/lisa-github-build-intake/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-github-validate-issue/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-implement/SKILL.md +2 -2
- package/plugins/src/base/skills/lisa-jira-build-intake/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-jira-validate-ticket/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-learnings-audit/SKILL.md +11 -4
- package/plugins/src/base/skills/lisa-linear-build-intake/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-linear-validate-issue/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-persist-learning/SKILL.md +12 -12
- package/plugins/src/base/skills/lisa-pull-request-review/SKILL.md +62 -6
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +22 -5
- package/plugins/src/base/skills/lisa-session-manager/scripts/answer-record.mjs +28 -4
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-answer-record.mjs +2 -1
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-human.mjs +38 -4
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +8 -3
- package/plugins/src/base/skills/lisa-session-manager/scripts/ledger-questions.mjs +6 -1
- package/plugins/src/base/skills/lisa-task-decomposition/SKILL.md +2 -2
- package/typescript/create-only/.github/workflows/third-party-review-evidence.yml +58 -17
|
@@ -127,10 +127,35 @@
|
|
|
127
127
|
* list is a no-op that SAYS it is a no-op. A silent pass is the exact defect
|
|
128
128
|
* this module exists to end, so it is not reproduced here.
|
|
129
129
|
*
|
|
130
|
+
* ## Every read is complete, or it says it is not (#4630)
|
|
131
|
+
*
|
|
132
|
+
* Statuses, check runs and comments each page. Statuses and check runs are
|
|
133
|
+
* read a full page at a time, and a response that admits to more rows than it
|
|
134
|
+
* returned is reported as unreadable — the reviewer's row could be on the page
|
|
135
|
+
* that was not read. Comments are read across every page, as the merge-path
|
|
136
|
+
* gate reads them, and a page that fails reports the comments as unreadable:
|
|
137
|
+
* no substitute is counted from them, and the report says so.
|
|
138
|
+
*
|
|
139
|
+
* ## The verdict is published on the head it judged (#4630)
|
|
140
|
+
*
|
|
141
|
+
* The evidence workflow wakes on `status` and `check_run` events, which GitHub
|
|
142
|
+
* runs from the default branch, so the job's own check run lands on the
|
|
143
|
+
* default branch's latest commit — never on the pull request head it judged.
|
|
144
|
+
* `--publish` reads the verdict a `--json` run saved, and the exit code it
|
|
145
|
+
* ended with, and creates ONE check run on that head: `success` for
|
|
146
|
+
* `satisfied` and `substituted`, `failure` for `unsatisfied` and for
|
|
147
|
+
* `pull-requests-unreadable`. A run with no head to show it on, or that cannot
|
|
148
|
+
* change the answer, publishes nothing and says why. A missing or unparseable
|
|
149
|
+
* verdict, an exit code other than the verdict's own, or a refused write fails
|
|
150
|
+
* the mode, so broken machinery still shows on the job.
|
|
151
|
+
*
|
|
130
152
|
* CLI:
|
|
131
153
|
* node scripts/check-third-party-review-evidence.mjs --sha <sha> [--json]
|
|
132
154
|
* [--context <context>] [--root <dir>] [--repo <owner/repo>]
|
|
133
155
|
* [--arm [--vacuity-report <path>]]
|
|
156
|
+
* node scripts/check-third-party-review-evidence.mjs --sha <sha>
|
|
157
|
+
* --publish <saved-verdict.json> --prover-exit <code>
|
|
158
|
+
* [--context <context>] [--repo <owner/repo>]
|
|
134
159
|
*
|
|
135
160
|
* `--arm` answers the merge driver's arm gate instead (#4653): whether
|
|
136
161
|
* auto-merge may be turned on for this head, and if not, what to do next.
|
|
@@ -147,7 +172,7 @@
|
|
|
147
172
|
*
|
|
148
173
|
* @module scripts/check-third-party-review-evidence
|
|
149
174
|
*/
|
|
150
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
175
|
+
import { appendFileSync, existsSync, readFileSync } from "node:fs";
|
|
151
176
|
|
|
152
177
|
import { boundedExecFileSync } from "./lib/bounded-spawn.mjs";
|
|
153
178
|
import { invokedAsScript } from "./lib/invoked-as-script.mjs";
|
|
@@ -918,7 +943,7 @@ export function reviewStanding({ reviews, sha }) {
|
|
|
918
943
|
* Check runs read for each reviewer's context, keyed by that context; a null
|
|
919
944
|
* entry is a read that failed, and a missing key is a reviewer whose runs
|
|
920
945
|
* were not read.
|
|
921
|
-
* @param {ReadonlyArray<{body?: string, user?: {login?: string}}
|
|
946
|
+
* @param {ReadonlyArray<{body?: string, user?: {login?: string}}>|null} options.comments - Issue comments on the pull request; null when they could not all be read, which counts no substitute.
|
|
922
947
|
* @param {string} options.sha - The head commit.
|
|
923
948
|
* @param {boolean|null} [options.isPullRequestHead] - Whether an open pull request has this commit as its head; null when the read failed.
|
|
924
949
|
* @param {(login: string) => boolean|null} [options.canWrite] -
|
|
@@ -971,7 +996,7 @@ export function reviewEvidenceVerdict({
|
|
|
971
996
|
return { ...reading, gateId: reviewer.gateId, substituted: false };
|
|
972
997
|
}
|
|
973
998
|
const judged = judgeSubstitutes({
|
|
974
|
-
comments,
|
|
999
|
+
comments: comments ?? [],
|
|
975
1000
|
context: reviewer.context,
|
|
976
1001
|
sha,
|
|
977
1002
|
canWrite: permission,
|
|
@@ -981,6 +1006,9 @@ export function reviewEvidenceVerdict({
|
|
|
981
1006
|
gateId: reviewer.gateId,
|
|
982
1007
|
substituted: judged.counted,
|
|
983
1008
|
substituteRefusals: judged.refused,
|
|
1009
|
+
// Comments that could not all be read count no substitute, and the
|
|
1010
|
+
// report says why rather than claiming nothing stands in.
|
|
1011
|
+
...(comments === null ? { commentsUnreadable: true } : {}),
|
|
984
1012
|
};
|
|
985
1013
|
});
|
|
986
1014
|
if (readings.every(reading => reading.reviewed)) {
|
|
@@ -1408,6 +1436,7 @@ export function armDecision({
|
|
|
1408
1436
|
* @property {string|null} state - The state, conclusion or lifecycle seen.
|
|
1409
1437
|
* @property {string|null} [source] - One of {@link EVIDENCE_SOURCES}.
|
|
1410
1438
|
* @property {boolean} [substituted] - Whether a writer's substitute stands in.
|
|
1439
|
+
* @property {boolean} [commentsUnreadable] - Whether the comments a substitute would be in could not all be read.
|
|
1411
1440
|
* @property {Array<{author: string, reason: string}>} [substituteRefusals] - Markers not counted, by whom, and why.
|
|
1412
1441
|
* @property {Array<{id: unknown, reason: string}>} [ignoredCheckRuns] - Runs set aside, and why.
|
|
1413
1442
|
*/
|
|
@@ -1460,7 +1489,9 @@ export function humanReport(verdict) {
|
|
|
1460
1489
|
}
|
|
1461
1490
|
const stood = reading.substituted
|
|
1462
1491
|
? "a writer's local adversarial review was posted in its place"
|
|
1463
|
-
:
|
|
1492
|
+
: reading.commentsUnreadable
|
|
1493
|
+
? "the pull request's comments could not be read, so no substitute was counted"
|
|
1494
|
+
: "NOTHING stands in its place";
|
|
1464
1495
|
const refused = (reading.substituteRefusals ?? []).map(
|
|
1465
1496
|
entry =>
|
|
1466
1497
|
` substitute marker by @${entry.author || "(unknown author)"} not counted: ${entry.reason}`
|
|
@@ -1500,7 +1531,7 @@ function describeSeen(reading) {
|
|
|
1500
1531
|
/**
|
|
1501
1532
|
* Parse the CLI arguments.
|
|
1502
1533
|
* @param {string[]} argv - Arguments after the script path.
|
|
1503
|
-
* @returns {{sha: string|null, context: string|null, root: string, repo: string|null, json: boolean, arm: boolean, "vacuity-report": string|null}} Options.
|
|
1534
|
+
* @returns {{sha: string|null, context: string|null, root: string, repo: string|null, json: boolean, arm: boolean, "vacuity-report": string|null, publish: string|null, "prover-exit": string|null}} Options.
|
|
1504
1535
|
*/
|
|
1505
1536
|
export function parseArgs(argv) {
|
|
1506
1537
|
const opts = {
|
|
@@ -1511,6 +1542,8 @@ export function parseArgs(argv) {
|
|
|
1511
1542
|
json: false,
|
|
1512
1543
|
arm: false,
|
|
1513
1544
|
"vacuity-report": null,
|
|
1545
|
+
publish: null,
|
|
1546
|
+
"prover-exit": null,
|
|
1514
1547
|
};
|
|
1515
1548
|
for (let index = 0; index < argv.length; index += 1) {
|
|
1516
1549
|
const arg = argv[index];
|
|
@@ -1554,18 +1587,34 @@ function splitFlag(arg) {
|
|
|
1554
1587
|
* failed check-run read leaves the reviewer's own status standing, so a host
|
|
1555
1588
|
* whose token cannot read check runs keeps reading statuses as before.
|
|
1556
1589
|
* @param {string} path - The API path.
|
|
1590
|
+
* @param {GhRunner} [gh] - The `gh` runner.
|
|
1557
1591
|
* @returns {unknown} The parsed body, or null.
|
|
1558
1592
|
*/
|
|
1559
|
-
function ghJson(path) {
|
|
1593
|
+
function ghJson(path, gh = runGh) {
|
|
1560
1594
|
try {
|
|
1561
|
-
return JSON.parse(
|
|
1562
|
-
boundedExecFileSync("gh", ["api", path], { encoding: "utf8" })
|
|
1563
|
-
);
|
|
1595
|
+
return JSON.parse(gh(["api", path]));
|
|
1564
1596
|
} catch {
|
|
1597
|
+
// probe-direction: fail-closed — a failed read is null, which every caller reports as unreadable rather than as evidence.
|
|
1565
1598
|
return null;
|
|
1566
1599
|
}
|
|
1567
1600
|
}
|
|
1568
1601
|
|
|
1602
|
+
/**
|
|
1603
|
+
* Runs `gh` with these arguments and returns its stdout; throws when it fails.
|
|
1604
|
+
* @callback GhRunner
|
|
1605
|
+
* @param {string[]} args - Arguments after `gh`.
|
|
1606
|
+
* @returns {string} Its stdout.
|
|
1607
|
+
*/
|
|
1608
|
+
|
|
1609
|
+
/**
|
|
1610
|
+
* The live `gh` runner: bounded, so a child that never answers is a failed
|
|
1611
|
+
* read rather than a verdict.
|
|
1612
|
+
* @type {GhRunner}
|
|
1613
|
+
*/
|
|
1614
|
+
function runGh(args) {
|
|
1615
|
+
return boundedExecFileSync("gh", args, { encoding: "utf8" });
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1569
1618
|
/**
|
|
1570
1619
|
* The combined status on one commit.
|
|
1571
1620
|
*
|
|
@@ -1574,15 +1623,26 @@ function ghJson(path) {
|
|
|
1574
1623
|
* `description` key at all, so hollow green is invisible through it.
|
|
1575
1624
|
* A read that failed returns null rather than an empty list, so the reading
|
|
1576
1625
|
* can say the statuses could not be read instead of claiming there were none.
|
|
1626
|
+
*
|
|
1627
|
+
* The endpoint pages `statuses` at 30 unless asked for more, and reports how
|
|
1628
|
+
* many contexts there are in `total_count` (#4630). A full page of 100 is
|
|
1629
|
+
* asked for, and a response that admits to more than it returned is reported
|
|
1630
|
+
* as unreadable — the rule {@link readCheckRuns} keeps — because the
|
|
1631
|
+
* reviewer's status could be on the page that was not read, and reading it as
|
|
1632
|
+
* absent would be a claim nothing here observed.
|
|
1577
1633
|
* @param {string} repo - `owner/repo`.
|
|
1578
1634
|
* @param {string} sha - The commit.
|
|
1579
|
-
* @
|
|
1635
|
+
* @param {GhRunner} [gh] - The `gh` runner, injectable so a paged or incomplete response can be fed in.
|
|
1636
|
+
* @returns {ReadonlyArray<object>|null} The statuses, newest first, or null when they could not all be read.
|
|
1580
1637
|
*/
|
|
1581
|
-
function readStatuses(repo, sha) {
|
|
1582
|
-
const body = /** @type {{statuses?: unknown}|null} */ (
|
|
1583
|
-
ghJson(`repos/${repo}/commits/${sha}/status
|
|
1638
|
+
export function readStatuses(repo, sha, gh = runGh) {
|
|
1639
|
+
const body = /** @type {{total_count?: unknown, statuses?: unknown}|null} */ (
|
|
1640
|
+
ghJson(`repos/${repo}/commits/${sha}/status?per_page=100`, gh)
|
|
1584
1641
|
);
|
|
1585
|
-
|
|
1642
|
+
if (!Array.isArray(body?.statuses)) return null;
|
|
1643
|
+
const total = body?.total_count;
|
|
1644
|
+
if (typeof total === "number" && total > body.statuses.length) return null;
|
|
1645
|
+
return body.statuses;
|
|
1586
1646
|
}
|
|
1587
1647
|
|
|
1588
1648
|
/**
|
|
@@ -1796,15 +1856,19 @@ export function standingObjections(reviews) {
|
|
|
1796
1856
|
*
|
|
1797
1857
|
* A writer's substitute for the current head is among the NEWEST comments, so
|
|
1798
1858
|
* a single page of a long pull request is exactly the one that misses it.
|
|
1859
|
+
* A failed page makes the whole read unreadable rather than shorter: no
|
|
1860
|
+
* substitute is counted from it, and the report says the comments could not
|
|
1861
|
+
* be read instead of claiming nothing stands in (#4630).
|
|
1799
1862
|
* @param {string} repo - `owner/repo`.
|
|
1800
1863
|
* @param {number[]} numbers - Pull request numbers.
|
|
1801
|
-
* @
|
|
1864
|
+
* @param {GhRunner} [gh] - The `gh` runner, injectable so paged responses can be fed in.
|
|
1865
|
+
* @returns {ReadonlyArray<object>|null} The comments, or null when any page failed.
|
|
1802
1866
|
*/
|
|
1803
|
-
function readAllComments(repo, numbers) {
|
|
1804
|
-
|
|
1805
|
-
number
|
|
1806
|
-
readAllPages(`repos/${repo}/issues/${number}/comments?per_page=100`) ?? []
|
|
1867
|
+
export function readAllComments(repo, numbers, gh = runGh) {
|
|
1868
|
+
const lists = numbers.map(number =>
|
|
1869
|
+
readAllPages(`repos/${repo}/issues/${number}/comments?per_page=100`, gh)
|
|
1807
1870
|
);
|
|
1871
|
+
return lists.every(Array.isArray) ? lists.flat() : null;
|
|
1808
1872
|
}
|
|
1809
1873
|
|
|
1810
1874
|
/**
|
|
@@ -1834,20 +1898,18 @@ function readAllReviews(repo, number) {
|
|
|
1834
1898
|
/**
|
|
1835
1899
|
* Every row of one paginated list endpoint.
|
|
1836
1900
|
* @param {string} path - The API path.
|
|
1901
|
+
* @param {GhRunner} [gh] - The `gh` runner.
|
|
1837
1902
|
* @returns {ReadonlyArray<object>|null} The rows, or null when any page failed.
|
|
1838
1903
|
*/
|
|
1839
|
-
function readAllPages(path) {
|
|
1904
|
+
function readAllPages(path, gh = runGh) {
|
|
1840
1905
|
// probe-direction: fail-closed — a failed read is null; reviews then stop the arm decision, and comments then count no substitute.
|
|
1841
1906
|
try {
|
|
1842
|
-
const pages = JSON.parse(
|
|
1843
|
-
boundedExecFileSync("gh", ["api", "--paginate", "--slurp", path], {
|
|
1844
|
-
encoding: "utf8",
|
|
1845
|
-
})
|
|
1846
|
-
);
|
|
1907
|
+
const pages = JSON.parse(gh(["api", "--paginate", "--slurp", path]));
|
|
1847
1908
|
return Array.isArray(pages) && pages.every(Array.isArray)
|
|
1848
1909
|
? pages.flat()
|
|
1849
1910
|
: null;
|
|
1850
1911
|
} catch {
|
|
1912
|
+
// probe-direction: fail-closed — a failed page is null; reviews then stop the arm decision, and comments then count no substitute.
|
|
1851
1913
|
return null;
|
|
1852
1914
|
}
|
|
1853
1915
|
}
|
|
@@ -1963,6 +2025,250 @@ function writeArmDecision(verdict, { opts, io, out, repo, pulls, canWrite }) {
|
|
|
1963
2025
|
return decision.arm ? 0 : 1;
|
|
1964
2026
|
}
|
|
1965
2027
|
|
|
2028
|
+
/** The check run a verdict is published as, before a waking reviewer's name. */
|
|
2029
|
+
export const PUBLISHED_CHECK_NAME = "🕵️ Third-party review evidence";
|
|
2030
|
+
|
|
2031
|
+
/**
|
|
2032
|
+
* The conclusion each published outcome carries on the head it judged.
|
|
2033
|
+
*
|
|
2034
|
+
* `success` for a head a reviewer, or a writer's substitute, vouches for — the
|
|
2035
|
+
* title says which — and `failure` for every outcome the prover exits 1 on.
|
|
2036
|
+
*/
|
|
2037
|
+
const PUBLISHED_CONCLUSIONS = Object.freeze({
|
|
2038
|
+
[EVIDENCE_OUTCOMES.satisfied]: "success",
|
|
2039
|
+
[EVIDENCE_OUTCOMES.substituted]: "success",
|
|
2040
|
+
[EVIDENCE_OUTCOMES.unsatisfied]: "failure",
|
|
2041
|
+
[EVIDENCE_OUTCOMES.pullRequestsUnreadable]: "failure",
|
|
2042
|
+
});
|
|
2043
|
+
|
|
2044
|
+
/**
|
|
2045
|
+
* Why each unpublished outcome publishes nothing: there is no pull request
|
|
2046
|
+
* head to show it on, or the run cannot change the answer.
|
|
2047
|
+
*/
|
|
2048
|
+
const UNPUBLISHED_BECAUSE = Object.freeze({
|
|
2049
|
+
[EVIDENCE_OUTCOMES.noReviewerConfigured]:
|
|
2050
|
+
"no third-party reviewer is configured, so there is no verdict to show",
|
|
2051
|
+
[EVIDENCE_OUTCOMES.notAConfiguredReviewer]:
|
|
2052
|
+
"the status or check run that woke this run belongs to no declared reviewer, so it cannot change the answer",
|
|
2053
|
+
[EVIDENCE_OUTCOMES.notAPullRequestHead]:
|
|
2054
|
+
"the commit is not the head of any open pull request, so there is no pull request head to show a verdict on",
|
|
2055
|
+
[EVIDENCE_OUTCOMES.pending]:
|
|
2056
|
+
"the reviewer has not answered yet; its answer wakes this workflow again, and that run publishes the verdict",
|
|
2057
|
+
});
|
|
2058
|
+
|
|
2059
|
+
/** The longest summary GitHub accepts on a check run. */
|
|
2060
|
+
const SUMMARY_LIMIT = 65535;
|
|
2061
|
+
|
|
2062
|
+
/**
|
|
2063
|
+
* The backtick fence a report is shown in, so its column layout survives
|
|
2064
|
+
* Markdown. It is one backtick longer than the longest backtick run in the
|
|
2065
|
+
* report (three at least), so text quoted from a third-party status can
|
|
2066
|
+
* never close it early.
|
|
2067
|
+
* @param {string} report - The text the fence will hold.
|
|
2068
|
+
* @returns {string} The fence.
|
|
2069
|
+
*/
|
|
2070
|
+
function fenceFor(report) {
|
|
2071
|
+
const longest = Array.from(report.matchAll(/`+/g)).reduce(
|
|
2072
|
+
(most, match) => Math.max(most, match[0].length),
|
|
2073
|
+
0
|
|
2074
|
+
);
|
|
2075
|
+
return "`".repeat(Math.max(3, longest + 1));
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
/**
|
|
2079
|
+
* A report inside a `text` fence, cut so the fenced whole fits in `limit`.
|
|
2080
|
+
* @param {string} report - The human report.
|
|
2081
|
+
* @param {number} [limit] - The most characters the fenced text may hold.
|
|
2082
|
+
* @returns {string} The fenced report.
|
|
2083
|
+
*/
|
|
2084
|
+
export function fencedReport(report, limit = Number.POSITIVE_INFINITY) {
|
|
2085
|
+
const fence = fenceFor(report);
|
|
2086
|
+
const open = `${fence}text\n`;
|
|
2087
|
+
const close = `\n${fence}`;
|
|
2088
|
+
const room = limit - open.length - close.length;
|
|
2089
|
+
return `${open}${report.slice(0, Math.max(0, room))}${close}`;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* A saved `--json` verdict about this commit, or null when it is not one.
|
|
2094
|
+
* @param {string} text - The saved report.
|
|
2095
|
+
* @param {string} sha - The commit the run was asked about.
|
|
2096
|
+
* @returns {{outcome: string, sha: string, readings: ReadonlyArray<ReportedReading>}|null} The verdict.
|
|
2097
|
+
*/
|
|
2098
|
+
function savedVerdict(text, sha) {
|
|
2099
|
+
// probe-direction: fail-closed — anything that does not parse as this commit's verdict is no verdict.
|
|
2100
|
+
try {
|
|
2101
|
+
const verdict = JSON.parse(text);
|
|
2102
|
+
return typeof verdict?.outcome === "string" &&
|
|
2103
|
+
verdict.sha === sha &&
|
|
2104
|
+
Array.isArray(verdict.readings)
|
|
2105
|
+
? verdict
|
|
2106
|
+
: null;
|
|
2107
|
+
} catch {
|
|
2108
|
+
return null;
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
/**
|
|
2113
|
+
* What to publish for one saved verdict: a check run, nothing (and why), or an
|
|
2114
|
+
* error that fails the job.
|
|
2115
|
+
*
|
|
2116
|
+
* The exit code is checked against the verdict it came with. The prover exits
|
|
2117
|
+
* 1 exactly when its conclusion is `failure`; any other pairing, and any exit
|
|
2118
|
+
* but 0 or 1, is machinery that did not reach the verdict it claims.
|
|
2119
|
+
* @param {object} options - Publication inputs.
|
|
2120
|
+
* @param {string} options.text - The saved `--json` report.
|
|
2121
|
+
* @param {string} options.proverExit - The exit code the prover ended with.
|
|
2122
|
+
* @param {string} options.sha - The head the verdict judged.
|
|
2123
|
+
* @param {string} options.context - The reviewer that woke the run; empty on the manual path.
|
|
2124
|
+
* @returns {{error: string}|{report: string, why: string}|{report: string, body: object}} The publication.
|
|
2125
|
+
*/
|
|
2126
|
+
export function verdictPublication({ text, proverExit, sha, context }) {
|
|
2127
|
+
if (proverExit !== "0" && proverExit !== "1") {
|
|
2128
|
+
return {
|
|
2129
|
+
error: `the prover exited ${proverExit || "without an exit code"}, so it reached no verdict to publish`,
|
|
2130
|
+
};
|
|
2131
|
+
}
|
|
2132
|
+
const verdict = savedVerdict(text, sha);
|
|
2133
|
+
if (verdict === null) {
|
|
2134
|
+
return {
|
|
2135
|
+
error: `the prover's saved report is not a verdict about ${sha}`,
|
|
2136
|
+
};
|
|
2137
|
+
}
|
|
2138
|
+
const { outcome } = verdict;
|
|
2139
|
+
const conclusion = PUBLISHED_CONCLUSIONS[outcome];
|
|
2140
|
+
if (
|
|
2141
|
+
conclusion === undefined &&
|
|
2142
|
+
!Object.hasOwn(UNPUBLISHED_BECAUSE, outcome)
|
|
2143
|
+
) {
|
|
2144
|
+
return {
|
|
2145
|
+
error: `the prover reported an outcome nothing here knows: ${outcome}`,
|
|
2146
|
+
};
|
|
2147
|
+
}
|
|
2148
|
+
if (proverExit !== (conclusion === "failure" ? "1" : "0")) {
|
|
2149
|
+
return {
|
|
2150
|
+
error: `the prover exited ${proverExit} with a verdict of ${outcome}, which it never pairs`,
|
|
2151
|
+
};
|
|
2152
|
+
}
|
|
2153
|
+
const report = humanReport(verdict);
|
|
2154
|
+
if (conclusion === undefined) {
|
|
2155
|
+
return { report, why: UNPUBLISHED_BECAUSE[outcome] };
|
|
2156
|
+
}
|
|
2157
|
+
return {
|
|
2158
|
+
report,
|
|
2159
|
+
body: {
|
|
2160
|
+
name: context
|
|
2161
|
+
? `${PUBLISHED_CHECK_NAME} (${context})`
|
|
2162
|
+
: PUBLISHED_CHECK_NAME,
|
|
2163
|
+
head_sha: sha,
|
|
2164
|
+
status: "completed",
|
|
2165
|
+
conclusion,
|
|
2166
|
+
output: {
|
|
2167
|
+
title: report.split("\n")[0],
|
|
2168
|
+
summary: fencedReport(report, SUMMARY_LIMIT),
|
|
2169
|
+
},
|
|
2170
|
+
},
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
/**
|
|
2175
|
+
* What a failed write said, on one line an annotation can carry.
|
|
2176
|
+
* @param {unknown} error - What the `gh` runner threw.
|
|
2177
|
+
* @returns {string} GitHub's refusal, or the error.
|
|
2178
|
+
*/
|
|
2179
|
+
function refusalOf(error) {
|
|
2180
|
+
const stderr = String(
|
|
2181
|
+
/** @type {{stderr?: unknown}} */ (error)?.stderr ?? ""
|
|
2182
|
+
).trim();
|
|
2183
|
+
const said =
|
|
2184
|
+
stderr ||
|
|
2185
|
+
(error instanceof Error ? error.message : String(error ?? "unknown"));
|
|
2186
|
+
return said
|
|
2187
|
+
.split("\n")
|
|
2188
|
+
.map(line => line.trim())
|
|
2189
|
+
.filter(line => line !== "")
|
|
2190
|
+
.join(" ");
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
/**
|
|
2194
|
+
* Publish a saved verdict on the head it judged, and return the exit code.
|
|
2195
|
+
*
|
|
2196
|
+
* 0 once the check run is created, or when nothing is to be published; 1
|
|
2197
|
+
* when the verdict could not be read or trusted, or GitHub refused the write.
|
|
2198
|
+
* The report goes to stdout and to the step summary either way.
|
|
2199
|
+
* @param {ReturnType<typeof parseArgs> & {sha: string}} opts - Parsed options.
|
|
2200
|
+
* @param {object} io - Injected side effects.
|
|
2201
|
+
* @param {(path: string) => string} [io.readFile] - Reader for the saved verdict.
|
|
2202
|
+
* @param {(args: string[], input: string) => string} [io.gh] - Writer: `gh` with a request body on stdin.
|
|
2203
|
+
* @param {(text: string) => void} [io.appendSummary] - Appends to the job's step summary.
|
|
2204
|
+
* @param {{write: (text: string) => void}} out - Stdout.
|
|
2205
|
+
* @param {{write: (text: string) => void}} err - Stderr.
|
|
2206
|
+
* @returns {number} The exit code.
|
|
2207
|
+
*/
|
|
2208
|
+
function publishVerdict(opts, io, out, err) {
|
|
2209
|
+
const readFile = io.readFile ?? (path => readFileSync(path, "utf8"));
|
|
2210
|
+
const summarise =
|
|
2211
|
+
io.appendSummary ??
|
|
2212
|
+
(text => {
|
|
2213
|
+
const file = process.env.GITHUB_STEP_SUMMARY;
|
|
2214
|
+
if (file) appendFileSync(file, text);
|
|
2215
|
+
});
|
|
2216
|
+
let text = "";
|
|
2217
|
+
// probe-direction: fail-closed — a report that cannot be read is no verdict, and fails below.
|
|
2218
|
+
try {
|
|
2219
|
+
text = readFile(String(opts.publish));
|
|
2220
|
+
} catch {
|
|
2221
|
+
text = "";
|
|
2222
|
+
}
|
|
2223
|
+
const plan = verdictPublication({
|
|
2224
|
+
text,
|
|
2225
|
+
proverExit: opts["prover-exit"] ?? "",
|
|
2226
|
+
sha: opts.sha,
|
|
2227
|
+
context: opts.context ?? "",
|
|
2228
|
+
});
|
|
2229
|
+
if ("error" in plan) {
|
|
2230
|
+
err.write(
|
|
2231
|
+
`::error title=Review evidence verdict not published::${plan.error}. Nothing was published on ${opts.sha}; a run that reached no verdict fails, so the broken machinery shows.\n`
|
|
2232
|
+
);
|
|
2233
|
+
return 1;
|
|
2234
|
+
}
|
|
2235
|
+
out.write(`${plan.report}\n`);
|
|
2236
|
+
summarise(`### ${PUBLISHED_CHECK_NAME}\n\n${fencedReport(plan.report)}\n\n`);
|
|
2237
|
+
if (!("body" in plan)) {
|
|
2238
|
+
out.write(`Nothing published on ${opts.sha}: ${plan.why}.\n`);
|
|
2239
|
+
summarise(`Nothing published: ${plan.why}.\n`);
|
|
2240
|
+
return 0;
|
|
2241
|
+
}
|
|
2242
|
+
const { name, conclusion } = plan.body;
|
|
2243
|
+
const repo = opts.repo ?? process.env.GITHUB_REPOSITORY ?? "";
|
|
2244
|
+
const gh =
|
|
2245
|
+
io.gh ??
|
|
2246
|
+
((args, input) =>
|
|
2247
|
+
boundedExecFileSync("gh", args, {
|
|
2248
|
+
encoding: "utf8",
|
|
2249
|
+
input,
|
|
2250
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
2251
|
+
}));
|
|
2252
|
+
// probe-direction: fail-closed — a write that was refused, or killed at its deadline, published nothing, so the job fails.
|
|
2253
|
+
try {
|
|
2254
|
+
if (!/^[^/\s]+\/[^/\s]+$/u.test(repo)) {
|
|
2255
|
+
throw new Error(`repository must be owner/repo, not "${repo}"`);
|
|
2256
|
+
}
|
|
2257
|
+
gh(
|
|
2258
|
+
["api", `repos/${repo}/check-runs`, "--method", "POST", "--input", "-"],
|
|
2259
|
+
JSON.stringify(plan.body)
|
|
2260
|
+
);
|
|
2261
|
+
} catch (error) {
|
|
2262
|
+
err.write(
|
|
2263
|
+
`::error title=Review evidence verdict not published::The check run "${name}" was not published on ${opts.sha}: ${refusalOf(error)}. The verdict is not on the pull request head, so this job fails.\n`
|
|
2264
|
+
);
|
|
2265
|
+
return 1;
|
|
2266
|
+
}
|
|
2267
|
+
out.write(`Published "${name}" on ${opts.sha}: ${conclusion}.\n`);
|
|
2268
|
+
summarise(`Published \`${name}\` on \`${opts.sha}\`: **${conclusion}**.\n`);
|
|
2269
|
+
return 0;
|
|
2270
|
+
}
|
|
2271
|
+
|
|
1966
2272
|
/**
|
|
1967
2273
|
* The CLI body.
|
|
1968
2274
|
* @param {string[]} argv - Arguments after the script path.
|
|
@@ -1975,7 +2281,7 @@ function writeArmDecision(verdict, { opts, io, out, repo, pulls, canWrite }) {
|
|
|
1975
2281
|
* reader and not the other, the other reads nothing: an injected reader
|
|
1976
2282
|
* means the caller supplies the evidence, and mixing a live read into it
|
|
1977
2283
|
* would judge a fixture against the network.
|
|
1978
|
-
* @param {(numbers: number[]) => ReadonlyArray<object
|
|
2284
|
+
* @param {(numbers: number[]) => ReadonlyArray<object>|null} [io.comments] - Comment reader; null when the comments could not all be read.
|
|
1979
2285
|
* @param {(path: string) => string} [io.readFile] - Reader for `--vacuity-report` and `required-checks.json`.
|
|
1980
2286
|
* @param {(numbers: number[]) => ReadonlyArray<object>|null} [io.reviews] - Review-object reader, `--arm` only.
|
|
1981
2287
|
* @param {(login: string) => boolean|null} [io.canWrite] -
|
|
@@ -1984,6 +2290,8 @@ function writeArmDecision(verdict, { opts, io, out, repo, pulls, canWrite }) {
|
|
|
1984
2290
|
* reading and by `--arm`; absent, it reads
|
|
1985
2291
|
* `repos/{repo}/collaborators/{login}/permission`.
|
|
1986
2292
|
* @param {() => boolean} [io.requiredChecks] - Whether `required-checks.json` declares an evidence-bearing check, `--arm` only.
|
|
2293
|
+
* @param {(args: string[], input: string) => string} [io.gh] - Check-run writer, `--publish` only.
|
|
2294
|
+
* @param {(text: string) => void} [io.appendSummary] - Step-summary writer, `--publish` only.
|
|
1987
2295
|
* @param {{write: (text: string) => void}} [io.out] - Stdout.
|
|
1988
2296
|
* @param {{write: (text: string) => void}} [io.err] - Stderr.
|
|
1989
2297
|
* @returns {number} The exit code.
|
|
@@ -1996,6 +2304,9 @@ export function main(argv, io = {}) {
|
|
|
1996
2304
|
err.write("error: --sha <commit> is required\n");
|
|
1997
2305
|
return 2;
|
|
1998
2306
|
}
|
|
2307
|
+
if (opts.publish !== null) {
|
|
2308
|
+
return publishVerdict({ ...opts, sha: opts.sha }, io, out, err);
|
|
2309
|
+
}
|
|
1999
2310
|
const gates = io.gates ?? readGates(opts.root).gates;
|
|
2000
2311
|
const reviewers = configuredReviewers({ gates });
|
|
2001
2312
|
const repo = opts.repo ?? process.env.GITHUB_REPOSITORY ?? "";
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { type EvidenceSeedReading } from "../core/third-party-evidence-seed.js";
|
|
2
2
|
import type { DoctorCheck } from "./doctor.js";
|
|
3
|
+
import { EVIDENCE_STEPS_LINES } from "./doctor-third-party-evidence-steps.js";
|
|
3
4
|
/** Name of the check as doctor reports it. */
|
|
4
5
|
export declare const THIRD_PARTY_EVIDENCE_SEED_CHECK_NAME = "Third-party review evidence wakes on check runs?";
|
|
5
6
|
/** The trigger lines to add under `on:`. */
|
|
6
7
|
export declare const CHECK_RUN_TRIGGER_LINES: readonly [" check_run:", " types: [completed]"];
|
|
7
|
-
/**
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The permission line to set under an existing `permissions:` block. `write`
|
|
10
|
+
* includes reading, so it replaces a `checks: read` line rather than joining it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CHECKS_WRITE_LINE = " checks: write";
|
|
9
13
|
/** The whole block, for a copy missing any scope the prover reads with. */
|
|
10
|
-
export declare const PERMISSIONS_BLOCK_LINES: readonly ["permissions:", " contents: read", " statuses: read", " checks:
|
|
14
|
+
export declare const PERMISSIONS_BLOCK_LINES: readonly ["permissions:", " contents: read", " statuses: read", " checks: write", " pull-requests: read"];
|
|
15
|
+
export { EVIDENCE_STEPS_LINES };
|
|
11
16
|
/** The values that carry the run's commit and reviewer to the prover. */
|
|
12
|
-
export declare const RUN_IDENTITY_LINES: readonly ["
|
|
17
|
+
export declare const RUN_IDENTITY_LINES: readonly [" env:", " EVIDENCE_SHA: ${{ github.event.check_run.head_sha || github.event.sha || inputs.sha }}", " EVIDENCE_CONTEXT: ${{ github.event.check_run.name || github.event.context }}"];
|
|
13
18
|
/** The concurrency key that keeps one run from cancelling another's verdict. */
|
|
14
19
|
export declare const CONCURRENCY_GROUP_LINE = " group: third-party-review-evidence-${{ github.event_name }}-${{ github.event.check_run.head_sha || github.event.sha || inputs.sha }}-${{ github.event.check_run.name || github.event.context }}";
|
|
15
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-third-party-evidence-seed.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-third-party-evidence-seed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor-third-party-evidence-seed.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-third-party-evidence-seed.ts"],"names":[],"mappings":"AAmCA,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,8CAA8C;AAC9C,eAAO,MAAM,oCAAoC,qDACG,CAAC;AAwBrD,4CAA4C;AAC5C,eAAO,MAAM,uBAAuB,qDAG1B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AAEnD,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,+GAM1B,CAAC;AAEX,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAEhC,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,6MAIrB,CAAC;AAEX,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,sMAA2G,CAAC;AAuJ/I;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAOtE;AAED;;;;;;;;;GASG;AACH,wBAAsB,2BAA2B,CAC/C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CAiCtB"}
|