@mnaimfaizy/agent-kit 1.0.0-beta.14 → 1.0.0-beta.16
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/README.md +22 -4
- package/custom-harness.schema.json +243 -0
- package/harnesses.json +244 -6
- package/package.json +3 -2
- package/src/checks/ci-workflow.mjs +105 -0
- package/src/checks/claude-app.mjs +11 -2
- package/src/checks/custom-harness.mjs +157 -0
- package/src/checks/github-app.mjs +214 -0
- package/src/checks/rulesets.mjs +9 -8
- package/src/checks/secrets-and-variables.mjs +27 -8
- package/src/checks/stages.mjs +705 -0
- package/src/cli.mjs +583 -36
- package/src/deep-scan/agent.mjs +88 -21
- package/src/deep-scan/credential.mjs +81 -32
- package/src/deep-scan/docker-driver.mjs +105 -42
- package/src/deep-scan/harness-text.mjs +99 -0
- package/src/deep-scan/lifecycle.mjs +68 -178
- package/src/deep-scan/limits.mjs +13 -7
- package/src/deep-scan/model-proxy.mjs +21 -10
- package/src/deep-scan/preflight.mjs +19 -6
- package/src/deep-scan/recipe.mjs +4 -0
- package/src/deep-scan/runtime.mjs +54 -6
- package/src/deep-scan/sandbox-run.mjs +232 -0
- package/src/deep-scan/sbx-driver.mjs +224 -39
- package/src/deep-scan/tar.mjs +69 -22
- package/src/deep-scan/verify.mjs +6 -1
- package/src/deep-scan.mjs +73 -13
- package/src/doctor.mjs +166 -5
- package/src/exec.mjs +14 -5
- package/src/factory/budget/budget.mjs +259 -0
- package/src/factory/build/command.mjs +321 -0
- package/src/factory/build/factory.mjs +473 -0
- package/src/factory/build/findings.mjs +55 -0
- package/src/factory/build/host.mjs +230 -0
- package/src/factory/build/notes.mjs +191 -0
- package/src/factory/build/pull-request.mjs +74 -0
- package/src/factory/bundle.mjs +146 -0
- package/src/factory/checks/allowed-paths.mjs +50 -0
- package/src/factory/checks/plan-header.mjs +296 -0
- package/src/factory/checks/qa.mjs +85 -0
- package/src/factory/checks/review.mjs +73 -0
- package/src/factory/checks/security.mjs +50 -0
- package/src/factory/checks/stage-check.mjs +89 -0
- package/src/factory/claims/command.mjs +187 -0
- package/src/factory/claims/release.mjs +111 -0
- package/src/factory/decision/answers.mjs +103 -0
- package/src/factory/decision/command.mjs +64 -0
- package/src/factory/decision/plan.mjs +99 -0
- package/src/factory/decision/request.mjs +116 -0
- package/src/factory/doctor/files.mjs +329 -0
- package/src/factory/doctor/index.mjs +56 -0
- package/src/factory/doctor/local.mjs +497 -0
- package/src/factory/doctor/orchestrate.mjs +146 -0
- package/src/factory/engine/lease.mjs +146 -0
- package/src/factory/engine/local-engine.mjs +177 -0
- package/src/factory/engine/lockfile.mjs +64 -0
- package/src/factory/engine/workflow-engine.mjs +124 -0
- package/src/factory/gate/comment.mjs +88 -0
- package/src/factory/gate/config.mjs +57 -0
- package/src/factory/gate/gate-core.mjs +250 -0
- package/src/factory/gate/guarded.mjs +17 -0
- package/src/factory/gate/reads.mjs +105 -0
- package/src/factory/gate/task.mjs +193 -0
- package/src/factory/gate/trip-reads.mjs +82 -0
- package/src/factory/gate/trip.mjs +87 -0
- package/src/factory/init/blueprint.mjs +174 -0
- package/src/factory/init/index.mjs +337 -0
- package/src/factory/labels/evidence.mjs +162 -0
- package/src/factory/labels/moves.mjs +32 -0
- package/src/factory/labels/reconcile.mjs +267 -0
- package/src/factory/labels/revert.mjs +87 -0
- package/src/factory/labels/timeline.mjs +72 -0
- package/src/factory/labels/voided.mjs +59 -0
- package/src/factory/limits/harness.mjs +39 -0
- package/src/factory/limits/limits.mjs +123 -0
- package/src/factory/merge/command.mjs +172 -0
- package/src/factory/outbox/check.mjs +240 -0
- package/src/factory/outbox/rulings.mjs +195 -0
- package/src/factory/plan/command.mjs +66 -0
- package/src/factory/plan/comment.mjs +156 -0
- package/src/factory/plan/publish.mjs +149 -0
- package/src/factory/plan/risk.mjs +153 -0
- package/src/factory/qa/command.mjs +163 -0
- package/src/factory/records/engine-record.mjs +133 -0
- package/src/factory/records/main.mjs +96 -0
- package/src/factory/records/record.mjs +226 -0
- package/src/factory/records/sink.mjs +57 -0
- package/src/factory/report/build.mjs +92 -0
- package/src/factory/report/command.mjs +80 -0
- package/src/factory/report/facts.mjs +226 -0
- package/src/factory/report/gate-section.mjs +122 -0
- package/src/factory/report/metrics.mjs +111 -0
- package/src/factory/report/reads.mjs +246 -0
- package/src/factory/report/render.mjs +121 -0
- package/src/factory/report/rollout.mjs +154 -0
- package/src/factory/review/command.mjs +182 -0
- package/src/factory/run/awake.mjs +70 -0
- package/src/factory/run/collect.mjs +77 -0
- package/src/factory/run/command.mjs +490 -0
- package/src/factory/run/gh.mjs +46 -0
- package/src/factory/run/launch.mjs +47 -0
- package/src/factory/run/pipelines.mjs +261 -0
- package/src/factory/run/raw.mjs +96 -0
- package/src/factory/run/restart.mjs +83 -0
- package/src/factory/run/s3.mjs +193 -0
- package/src/factory/run/secrets.mjs +142 -0
- package/src/factory/run/teardown.mjs +242 -0
- package/src/factory/run/token.mjs +68 -0
- package/src/factory/security/command.mjs +157 -0
- package/src/factory/setup/app.mjs +122 -0
- package/src/factory/setup/command.mjs +409 -0
- package/src/factory/setup/labels.mjs +25 -0
- package/src/factory/setup/reads.mjs +129 -0
- package/src/factory/setup/writes.mjs +126 -0
- package/src/factory/snapshot/write.mjs +176 -0
- package/src/factory/stop/command.mjs +136 -0
- package/src/factory/sweep/actions-main.mjs +117 -0
- package/src/factory/sweep/command.mjs +65 -0
- package/src/factory/sweep/knobs.mjs +78 -0
- package/src/factory/sweep/marker-version.mjs +15 -0
- package/src/factory/sweep/markers.mjs +112 -0
- package/src/factory/sweep/overlap.mjs +24 -0
- package/src/factory/sweep/run.mjs +198 -0
- package/src/factory/sweep/shell.mjs +394 -0
- package/src/factory/sweep/split.mjs +104 -0
- package/src/factory/sweep/states.mjs +87 -0
- package/src/factory/sweep/sweep-core.mjs +1781 -0
- package/src/factory/tracker/github.mjs +674 -0
- package/src/factory/tracker/operations.mjs +153 -0
- package/src/factory/upgrade/index.mjs +83 -0
- package/src/harness/adapters.mjs +30 -0
- package/src/harness/antigravity.mjs +187 -0
- package/src/harness/claude-code.mjs +8 -1
- package/src/harness/codex.mjs +219 -0
- package/src/harness/cursor.mjs +199 -0
- package/src/harness/custom/registry.mjs +21 -0
- package/src/harness/custom/schema.mjs +90 -0
- package/src/harness/custom.mjs +299 -0
- package/src/harness/facts.mjs +44 -7
- package/src/harness/gemini.mjs +164 -0
- package/src/harness/install-layer.mjs +86 -3
- package/src/harness/opencode.mjs +289 -0
- package/src/harness/resolve.mjs +156 -0
- package/src/harness/support-levels.mjs +151 -3
- package/src/harness-live/assess.mjs +29 -6
- package/src/harness-live/cursor-real.mjs +146 -0
- package/src/harness-live/cursor-version.mjs +70 -0
- package/src/harness-live/cursor.mjs +80 -0
- package/src/harness-live/custom.mjs +91 -0
- package/src/harness-live/fixture-harness.mjs +45 -0
- package/src/harness-live/harnesses.mjs +263 -0
- package/src/harness-live/host.mjs +113 -4
- package/src/harness-live/opencode.mjs +289 -0
- package/src/harness-live/probes.mjs +87 -7
- package/src/harness-live/run.mjs +101 -20
- package/src/harness-live/setup.mjs +126 -0
- package/src/harness-live/stage.mjs +25 -15
- package/src/harness-live/suite.mjs +276 -95
- package/src/harness-test.mjs +116 -0
- package/src/init.mjs +374 -36
- package/src/kit-owned-paths.mjs +1 -1
- package/src/model-proxy/core.mjs +128 -20
- package/src/model-proxy/profiles/anthropic.mjs +54 -10
- package/src/model-proxy/profiles/gemini-api.mjs +311 -0
- package/src/model-proxy/profiles/openai.mjs +327 -0
- package/src/model-proxy/stub-dialects/gemini-api.mjs +178 -0
- package/src/model-proxy/stub-dialects/openai.mjs +173 -0
- package/src/model-proxy/stub.mjs +9 -1
- package/src/stage/audit.mjs +79 -0
- package/src/stage/egress-route.mjs +207 -0
- package/src/stage/implement/carry.mjs +308 -0
- package/src/stage/implement/sandbox.mjs +271 -0
- package/src/stage/implement/verify.mjs +70 -0
- package/src/stage/implement.mjs +218 -0
- package/src/stage/plan.mjs +115 -0
- package/src/stage/review-response.mjs +172 -0
- package/src/stage/review.mjs +185 -0
- package/src/stage/workspace.mjs +274 -0
- package/src/stage.mjs +1087 -0
- package/src/upgrade.mjs +39 -7
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Without a GitHub App of the Consumer's own, a push made with the job token
|
|
2
|
+
// starts no CI: GitHub holds its pull_request runs for approval, and the kit
|
|
3
|
+
// starts only the held run of the Caller's `ci_workflow` (ADR 0026). So each
|
|
4
|
+
// pushing job should name a workflow with a pull_request trigger.
|
|
5
|
+
|
|
6
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { isMapping, parseYamlSubset } from "../yaml-subset.mjs";
|
|
9
|
+
import { result } from "./result.mjs";
|
|
10
|
+
|
|
11
|
+
const ID = "ci-workflow";
|
|
12
|
+
const TITLE = "CI starts for agent pushes";
|
|
13
|
+
/** What `release-ci` accepts (review-response.mjs `workflowPath`); a test holds them equal. */
|
|
14
|
+
export const WORKFLOW_PATH = /^\.github\/workflows\/[A-Za-z0-9_-][A-Za-z0-9._-]*\.ya?ml$/;
|
|
15
|
+
|
|
16
|
+
/** `on:` may be a mapping, one event name, or a list of names. */
|
|
17
|
+
export function hasPullRequestTrigger(text) {
|
|
18
|
+
const doc = parseYamlSubset(text);
|
|
19
|
+
const on = doc.on ?? doc["'on'"] ?? doc['"on"'];
|
|
20
|
+
const named = (value) => /(?:^|[\s,["'])pull_request(?:$|[\s,\]"':])/.test(String(value));
|
|
21
|
+
if (Array.isArray(on)) return on.some(named);
|
|
22
|
+
if (isMapping(on)) return "pull_request" in on;
|
|
23
|
+
return typeof on === "string" && named(on);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Why `path` cannot be the run that is started, or null. */
|
|
27
|
+
function problem(root, path) {
|
|
28
|
+
if (!WORKFLOW_PATH.test(path)) {
|
|
29
|
+
return `ci_workflow ${JSON.stringify(path)} is not a file directly under .github/workflows/.`;
|
|
30
|
+
}
|
|
31
|
+
const file = join(root, path);
|
|
32
|
+
if (!existsSync(file)) return `ci_workflow names ${path}, and there is no such file.`;
|
|
33
|
+
if (!hasPullRequestTrigger(readFileSync(file, "utf8"))) {
|
|
34
|
+
return `ci_workflow names ${path}, which has no pull_request trigger, so no run of it is held.`;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @param {{
|
|
41
|
+
* root: string,
|
|
42
|
+
* jobs: ReturnType<import("./github-app.mjs").pushingJobs>,
|
|
43
|
+
* appSet: boolean,
|
|
44
|
+
* appUnknown?: boolean,
|
|
45
|
+
* onAction: (where: string) => boolean,
|
|
46
|
+
* unreadHarness?: (where: string) => boolean,
|
|
47
|
+
* }} opts appUnknown: whether the App is set could not be told. onAction: the
|
|
48
|
+
* job's Stage runs on claude-code-action.
|
|
49
|
+
*/
|
|
50
|
+
export function checkCiWorkflow(opts) {
|
|
51
|
+
const { root, jobs, unread = [], appSet, appUnknown = false, onAction, unreadHarness } = opts;
|
|
52
|
+
const failed = [];
|
|
53
|
+
const empty = [];
|
|
54
|
+
const unchecked = [...unread];
|
|
55
|
+
const notes = [];
|
|
56
|
+
for (const item of jobs) {
|
|
57
|
+
const { stage, job, where, passesId, passesKey, takes, hiddenWith, hiddenSecrets } = item;
|
|
58
|
+
// Review response pushes with the job token on either harness.
|
|
59
|
+
if (stage === "implement" && onAction(where)) {
|
|
60
|
+
notes.push(`${where}: pushes as the Claude GitHub App, so ci_workflow is not used.`);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (hiddenWith || ((appSet || appUnknown) && hiddenSecrets)) {
|
|
64
|
+
unchecked.push(`${where}: not checked: ${hiddenWith ?? hiddenSecrets}.`);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const passesApp = passesId && passesKey && takes("app_id");
|
|
68
|
+
if (appSet && passesApp) {
|
|
69
|
+
notes.push(`${where}: ci_workflow is ignored, as your GitHub App pushes.`);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (appUnknown && passesApp) {
|
|
73
|
+
unchecked.push(`${where}: not checked: whether your GitHub App is set could not be read.`);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (stage === "implement" && unreadHarness?.(where)) {
|
|
77
|
+
unchecked.push(
|
|
78
|
+
`${where}: not checked: its harness could not be read, so doctor cannot tell whether ci_workflow is used.`,
|
|
79
|
+
);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (!takes("ci_workflow")) {
|
|
83
|
+
notes.push(`${where}: the pinned tag's workflow takes no ci_workflow.`);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const value = typeof job.with.ci_workflow === "string" ? job.with.ci_workflow.trim() : "";
|
|
87
|
+
if (!value) {
|
|
88
|
+
empty.push(
|
|
89
|
+
`${where}: ci_workflow is empty, so approve CI from the pull request's checks ` +
|
|
90
|
+
'("Approve workflows to run").',
|
|
91
|
+
);
|
|
92
|
+
} else if (value.includes("${{")) {
|
|
93
|
+
unchecked.push(`${where}: ci_workflow is an expression, which doctor cannot check.`);
|
|
94
|
+
} else {
|
|
95
|
+
const why = problem(root, value);
|
|
96
|
+
if (why) failed.push(`${where}: ${why}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const details = [...failed, ...empty, ...unchecked, ...notes];
|
|
100
|
+
const say = (status, summary) => result(ID, TITLE, status, summary, { details });
|
|
101
|
+
if (failed.length) return say("fail", `${failed.length} ci_workflow setting(s) start no CI.`);
|
|
102
|
+
if (empty.length) return say("warn", `CI needs a manual approval for ${empty.length} job(s).`);
|
|
103
|
+
if (unchecked.length) return say("skip", "Some Caller jobs were not checked.");
|
|
104
|
+
return say("pass", "No pushing job is left waiting for a manual approval.");
|
|
105
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// The Claude GitHub App must be installed on the repository
|
|
1
|
+
// The Claude GitHub App must be installed on the repository while a Stage runs
|
|
2
|
+
// on claude-code-action without a job token of its own, and only then. GitHub only shows
|
|
2
3
|
// app installations to an organization admin (`orgs/<org>/installations`) or
|
|
3
4
|
// to a GitHub App user token; a `gh` login on a personal account cannot see
|
|
4
5
|
// them, so there the check is skipped rather than guessed.
|
|
@@ -10,7 +11,15 @@ const TITLE = "Claude GitHub App installed";
|
|
|
10
11
|
const APP_SLUG = "claude";
|
|
11
12
|
const APP_URL = "https://github.com/apps/claude";
|
|
12
13
|
|
|
13
|
-
export function checkClaudeApp({ github, repo, owner, ownerType }) {
|
|
14
|
+
export function checkClaudeApp({ github, repo, owner, ownerType, needed = true }) {
|
|
15
|
+
if (!needed) {
|
|
16
|
+
return result(
|
|
17
|
+
ID,
|
|
18
|
+
TITLE,
|
|
19
|
+
"skip",
|
|
20
|
+
"No Stage runs on claude-code-action with the Claude GitHub App's token, so the App is not needed.",
|
|
21
|
+
);
|
|
22
|
+
}
|
|
14
23
|
if (ownerType !== "Organization") {
|
|
15
24
|
return result(
|
|
16
25
|
ID,
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// The Custom harness check (ADRs 0027 and 0030): each file a Stage names is on
|
|
2
|
+
// the default branch, which is what a run trusts, matches the pinned tag's
|
|
3
|
+
// schema (which holds the profile, the exact version and the attested levels'
|
|
4
|
+
// shape), and a file nothing names is warned about. Doctor never asks npm
|
|
5
|
+
// whether the package exists.
|
|
6
|
+
|
|
7
|
+
import { lstatSync, readdirSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { CUSTOM_DIR, MAX_BYTES, parseCustomHarness, SCHEMA_PATH } from "../harness/custom.mjs";
|
|
10
|
+
import { result } from "./result.mjs";
|
|
11
|
+
|
|
12
|
+
const ID = "custom-harness";
|
|
13
|
+
const TITLE = "Custom harness files";
|
|
14
|
+
const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
15
|
+
const VARIABLE = /^AGENT_KIT_(?:[A-Z_]+_)?HARNESS$/;
|
|
16
|
+
const DOCS = "File format: docs/harnesses.md#custom-harness at the pinned tag.";
|
|
17
|
+
|
|
18
|
+
/** The names of the `.json` files in the checkout's harness folder. */
|
|
19
|
+
function localNames(root) {
|
|
20
|
+
let entries;
|
|
21
|
+
try {
|
|
22
|
+
entries = readdirSync(join(root, CUSTOM_DIR));
|
|
23
|
+
} catch (err) {
|
|
24
|
+
if (err?.code === "ENOENT" || err?.code === "ENOTDIR") return [];
|
|
25
|
+
throw err;
|
|
26
|
+
}
|
|
27
|
+
return entries.filter(
|
|
28
|
+
(e) => e.endsWith(".json") && lstatSync(join(root, CUSTOM_DIR, e)).isFile(),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The names of the `.json` files the default branch holds there, on GitHub. */
|
|
33
|
+
function pushedNames(github, repo, ref) {
|
|
34
|
+
try {
|
|
35
|
+
return github
|
|
36
|
+
.getLines(
|
|
37
|
+
`repos/${repo}/contents/${CUSTOM_DIR}?ref=${ref}`,
|
|
38
|
+
'.[] | select(.type == "file") | .name',
|
|
39
|
+
)
|
|
40
|
+
.filter((e) => e.endsWith(".json"));
|
|
41
|
+
} catch (err) {
|
|
42
|
+
if (err.httpStatus === 404) return [];
|
|
43
|
+
throw err;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Why the default branch's file does not pass, or what it holds. */
|
|
48
|
+
function checkFile({ github, repo, ref, path, schema }) {
|
|
49
|
+
const data = github.getJson(`repos/${repo}/contents/${path}?ref=${ref}`);
|
|
50
|
+
if (data?.type !== "file") return { problems: ["it is not a plain file"] };
|
|
51
|
+
if (!(data.size <= MAX_BYTES)) return { problems: [`it is larger than ${MAX_BYTES / 1024} KiB`] };
|
|
52
|
+
return parseCustomHarness(Buffer.from(data.content ?? "", "base64").toString("utf8"), { schema });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** What a valid file holds, in one line. */
|
|
56
|
+
function summary(file) {
|
|
57
|
+
const attested = Object.entries(file.support_levels ?? {}).map(
|
|
58
|
+
([stage, { level, run }]) => `${stage} ${level} (${run})`,
|
|
59
|
+
);
|
|
60
|
+
return `profile ${file.profile}, ${file.package}@${file.version}, ${
|
|
61
|
+
attested.length ? `attested ${attested.join(", ")}` : "no attested level"
|
|
62
|
+
}`;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @param {{
|
|
67
|
+
* github: object,
|
|
68
|
+
* repo: string,
|
|
69
|
+
* root: string,
|
|
70
|
+
* defaultBranch: string,
|
|
71
|
+
* named: string[],
|
|
72
|
+
* snapshot: { tag: string, readFile: (path: string) => string | null },
|
|
73
|
+
* }} opts `named` are the harness names the Stage jobs and the harness
|
|
74
|
+
* variables hold.
|
|
75
|
+
* @returns {object[]} the check's result, or none where the repository neither
|
|
76
|
+
* names nor holds a Custom harness
|
|
77
|
+
*/
|
|
78
|
+
export function checkCustomHarness({ github, repo, root, defaultBranch, named, snapshot }) {
|
|
79
|
+
const used = [...new Set(named.filter((n) => n.startsWith("custom:")))]
|
|
80
|
+
.map((n) => n.slice("custom:".length))
|
|
81
|
+
.filter((n) => NAME.test(n))
|
|
82
|
+
.sort();
|
|
83
|
+
let pushed;
|
|
84
|
+
try {
|
|
85
|
+
pushed = pushedNames(github, repo, encodeURIComponent(defaultBranch));
|
|
86
|
+
} catch (err) {
|
|
87
|
+
if (!used.length) return [];
|
|
88
|
+
return [
|
|
89
|
+
result(ID, TITLE, "skip", `Could not list ${CUSTOM_DIR} on ${defaultBranch}: ${err.message}`),
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
const local = localNames(root);
|
|
93
|
+
const files = [...new Set([...pushed, ...local])].sort();
|
|
94
|
+
if (!used.length && !files.length) return [];
|
|
95
|
+
|
|
96
|
+
const { tag } = snapshot;
|
|
97
|
+
const schemaText = used.length ? snapshot.readFile(SCHEMA_PATH) : null;
|
|
98
|
+
const failed = [];
|
|
99
|
+
const warned = [];
|
|
100
|
+
const notes = [];
|
|
101
|
+
for (const name of used) {
|
|
102
|
+
const file = `${name}.json`;
|
|
103
|
+
const path = `${CUSTOM_DIR}/${file}`;
|
|
104
|
+
const label = `custom:${name}`;
|
|
105
|
+
if (schemaText === null) {
|
|
106
|
+
failed.push(`${label}: ${tag} runs no Custom harness: it has no ${SCHEMA_PATH}`);
|
|
107
|
+
} else if (!pushed.includes(file)) {
|
|
108
|
+
failed.push(
|
|
109
|
+
local.includes(file)
|
|
110
|
+
? `${label}: ${path} is only in your checkout: commit it and push it to ${defaultBranch}`
|
|
111
|
+
: `${label}: ${defaultBranch} has no ${path}`,
|
|
112
|
+
);
|
|
113
|
+
} else {
|
|
114
|
+
let checked;
|
|
115
|
+
try {
|
|
116
|
+
checked = checkFile({
|
|
117
|
+
github,
|
|
118
|
+
repo,
|
|
119
|
+
ref: encodeURIComponent(defaultBranch),
|
|
120
|
+
path,
|
|
121
|
+
schema: JSON.parse(schemaText),
|
|
122
|
+
});
|
|
123
|
+
} catch (err) {
|
|
124
|
+
failed.push(`${label}: ${path} could not be checked: ${err.message}`);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if ("problems" in checked) {
|
|
128
|
+
failed.push(...checked.problems.map((p) => `${label}: ${p}`));
|
|
129
|
+
} else notes.push(`${label}: ${summary(checked.file)}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
for (const file of files) {
|
|
133
|
+
const name = file.slice(0, -".json".length);
|
|
134
|
+
if (!used.includes(name)) {
|
|
135
|
+
warned.push(
|
|
136
|
+
NAME.test(name)
|
|
137
|
+
? `${CUSTOM_DIR}/${file}: no Stage or harness variable names custom:${name}`
|
|
138
|
+
: `${CUSTOM_DIR}/${file}: no custom:<name> can select a file with this name`,
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const status = failed.length ? "fail" : warned.length ? "warn" : "pass";
|
|
143
|
+
const said = {
|
|
144
|
+
fail: "A Custom harness a Stage names is not usable.",
|
|
145
|
+
warn: `${warned.length} Custom harness file(s) are unused.`,
|
|
146
|
+
pass: `${used.length} Custom harness file(s) on ${defaultBranch} are valid.`,
|
|
147
|
+
}[status];
|
|
148
|
+
return [
|
|
149
|
+
result(ID, TITLE, status, said, {
|
|
150
|
+
details: [...failed, ...warned, ...notes, ...(failed.length ? [DOCS] : [])],
|
|
151
|
+
}),
|
|
152
|
+
];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** The values of the repository variables that name a harness. */
|
|
156
|
+
export const harnessVariableValues = (values) =>
|
|
157
|
+
[...values].filter(([name]) => VARIABLE.test(name)).map(([, { value }]) => value);
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// The Consumer's optional GitHub App (ADR 0026): the repository variable
|
|
2
|
+
// AGENT_KIT_APP_ID and the secret AGENT_KIT_APP_PRIVATE_KEY, which the
|
|
3
|
+
// implement and Review response Callers pass as `app_id` and
|
|
4
|
+
// `app_private_key`. With both, the App's token makes the implement push and
|
|
5
|
+
// pull request and the Review response push. Set together or not at all.
|
|
6
|
+
|
|
7
|
+
import { parseWorkflowCallInputs } from "../workflow-call.mjs";
|
|
8
|
+
import { parseYamlSubset } from "../yaml-subset.mjs";
|
|
9
|
+
import { result } from "./result.mjs";
|
|
10
|
+
import { readMode } from "./review-response.mjs";
|
|
11
|
+
import { listNames, setCommand } from "./secrets-and-variables.mjs";
|
|
12
|
+
import { hiddenInputs } from "./stages.mjs";
|
|
13
|
+
|
|
14
|
+
export const APP_VARIABLE = "AGENT_KIT_APP_ID";
|
|
15
|
+
export const APP_SECRET = "AGENT_KIT_APP_PRIVATE_KEY";
|
|
16
|
+
export const APP_KEY_INPUT = "app_private_key";
|
|
17
|
+
|
|
18
|
+
const ID = "github-app";
|
|
19
|
+
const TITLE = "Your GitHub App is set up";
|
|
20
|
+
const INSTALLED_ID = "github-app-installed";
|
|
21
|
+
const INSTALLED_TITLE = "Your GitHub App is installed";
|
|
22
|
+
|
|
23
|
+
/** The Stages whose pushes the App makes, by reusable workflow. */
|
|
24
|
+
const PUSHING = {
|
|
25
|
+
"agent-implement-reusable.yml": "implement",
|
|
26
|
+
"agent-review-response-reusable.yml": "review-response",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const isPassed = (value) => typeof value === "string" && value.trim() !== "";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Each Caller job that pushes: the App halves it passes, whether its pinned
|
|
33
|
+
* workflow takes the input `name` (assumed so where the tag cannot be read),
|
|
34
|
+
* and why its `with:` or `secrets:` cannot be read, if they cannot.
|
|
35
|
+
* @param {(file: string) => string | null} [readReusable]
|
|
36
|
+
*/
|
|
37
|
+
export function pushingJobs(callers, readReusable = null) {
|
|
38
|
+
return callers.flatMap((caller) => {
|
|
39
|
+
const written = parseYamlSubset(caller.text).jobs;
|
|
40
|
+
return caller.jobs
|
|
41
|
+
.filter((job) => Object.hasOwn(PUSHING, job.uses.file))
|
|
42
|
+
.map((job) => {
|
|
43
|
+
const text = readReusable?.(job.uses.file) ?? null;
|
|
44
|
+
const inputs = text === null ? null : parseWorkflowCallInputs(text);
|
|
45
|
+
return {
|
|
46
|
+
stage: PUSHING[job.uses.file],
|
|
47
|
+
job,
|
|
48
|
+
where: `${caller.path}:${job.name}`,
|
|
49
|
+
passesId: isPassed(job.with.app_id),
|
|
50
|
+
// `secrets: inherit` passes secrets by their own names, so never this one.
|
|
51
|
+
passesKey: job.secrets !== "inherit" && isPassed(job.secrets[APP_KEY_INPUT]),
|
|
52
|
+
takes: (name) => inputs === null || inputs.has(name),
|
|
53
|
+
// Read as empty, either would look like a setting left out.
|
|
54
|
+
hiddenWith: hiddenInputs(written?.[job.name]),
|
|
55
|
+
hiddenSecrets: job.secretsUnsupported,
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** The Callers doctor could not read in full, so their jobs may not all be listed. */
|
|
62
|
+
export const unreadCallers = (callers) =>
|
|
63
|
+
callers.filter((c) => c.parseIncomplete).map((c) => `${c.path}: ${c.parseIncomplete}`);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Whether the variable and the secret are set. `unknown` says why doctor cannot
|
|
67
|
+
* tell; it is null when it can.
|
|
68
|
+
*/
|
|
69
|
+
export function readAppSettings({ github, repo, ownerType }) {
|
|
70
|
+
let variables;
|
|
71
|
+
let secrets;
|
|
72
|
+
try {
|
|
73
|
+
variables = listNames(github, repo, "variable", ownerType);
|
|
74
|
+
secrets = listNames(github, repo, "secret", ownerType);
|
|
75
|
+
} catch (err) {
|
|
76
|
+
return { idSet: false, keySet: false, unknown: `Could not list them: ${err.message}` };
|
|
77
|
+
}
|
|
78
|
+
const idSet = variables.names.has(APP_VARIABLE);
|
|
79
|
+
const keySet = secrets.names.has(APP_SECRET);
|
|
80
|
+
// A missing half may be set at an organization doctor could not read.
|
|
81
|
+
const hidden = (idSet ? null : variables.orgNote) ?? (keySet ? null : secrets.orgNote);
|
|
82
|
+
return { idSet, keySet, unknown: hidden };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @param {{ repo: string, settings: ReturnType<typeof readAppSettings>,
|
|
87
|
+
* jobs: ReturnType<typeof pushingJobs>, unread?: string[], tag?: string,
|
|
88
|
+
* onAction?: (where: string) => boolean, unreadHarness?: (where: string) => boolean }} opts onAction: the job's Stage runs
|
|
89
|
+
* on claude-code-action.
|
|
90
|
+
*/
|
|
91
|
+
export function checkGitHubApp(opts) {
|
|
92
|
+
const { repo, settings, jobs, unread = [], tag, onAction = () => false, unreadHarness } = opts;
|
|
93
|
+
const { idSet, keySet, unknown } = settings;
|
|
94
|
+
if (unknown) return result(ID, TITLE, "skip", unknown);
|
|
95
|
+
if (!idSet && !keySet) {
|
|
96
|
+
return result(
|
|
97
|
+
ID,
|
|
98
|
+
TITLE,
|
|
99
|
+
"pass",
|
|
100
|
+
"No GitHub App of your own is set (optional): the job token makes the pushes.",
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
if (idSet !== keySet) {
|
|
104
|
+
const [there, missing, kind] = idSet
|
|
105
|
+
? [APP_VARIABLE, APP_SECRET, "secret"]
|
|
106
|
+
: [APP_SECRET, APP_VARIABLE, "variable"];
|
|
107
|
+
// No --body: gh prompts for the value, so it never lands in shell history.
|
|
108
|
+
const { cmd } = setCommand(kind, missing, repo);
|
|
109
|
+
return result(ID, TITLE, "fail", `${there} is set and ${missing} is not.`, {
|
|
110
|
+
details: ["Set both, or neither: a run whose Caller passes one without the other fails."],
|
|
111
|
+
fix: [cmd],
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
const failed = [];
|
|
115
|
+
const unpassed = [];
|
|
116
|
+
const unchecked = [...unread];
|
|
117
|
+
const notes = [];
|
|
118
|
+
for (const item of jobs) {
|
|
119
|
+
const { stage, where, passesId, passesKey, takes, hiddenWith, hiddenSecrets } = item;
|
|
120
|
+
if (hiddenWith || hiddenSecrets) {
|
|
121
|
+
unchecked.push(`${where}: not checked: ${hiddenWith ?? hiddenSecrets}.`);
|
|
122
|
+
} else if (stage === "implement" && passesId === passesKey && unreadHarness?.(where)) {
|
|
123
|
+
unchecked.push(`${where}: not checked: its harness could not be read.`);
|
|
124
|
+
} else if (stage === "implement" && passesId === passesKey && onAction(where)) {
|
|
125
|
+
// Half a pair still fails such a run, so that is left to the checks below.
|
|
126
|
+
notes.push(
|
|
127
|
+
`${where}: runs on claude-code-action, which pushes as the Claude GitHub App, ` +
|
|
128
|
+
"so your App is not used there.",
|
|
129
|
+
);
|
|
130
|
+
} else if (!takes("app_id")) {
|
|
131
|
+
unpassed.push(`${where}: ${tag ?? "the pinned tag"}'s workflow takes no GitHub App.`);
|
|
132
|
+
} else if (passesId && !passesKey) {
|
|
133
|
+
failed.push(`${where}: passes app_id and not the ${APP_KEY_INPUT} secret; its runs fail.`);
|
|
134
|
+
} else if (passesKey && !passesId) {
|
|
135
|
+
failed.push(`${where}: passes the ${APP_KEY_INPUT} secret and not app_id; its runs fail.`);
|
|
136
|
+
} else if (!passesId) {
|
|
137
|
+
unpassed.push(
|
|
138
|
+
`${where}: passes neither app_id (vars.${APP_VARIABLE}) nor the ${APP_KEY_INPUT} ` +
|
|
139
|
+
`secret (secrets.${APP_SECRET}), so it pushes without your App.`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (failed.length) {
|
|
144
|
+
return result(ID, TITLE, "fail", `${failed.length} Caller job(s) pass half of your App.`, {
|
|
145
|
+
details: [...failed, ...unpassed, ...unchecked, ...notes],
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
if (unpassed.length) {
|
|
149
|
+
return result(ID, TITLE, "warn", `${unpassed.length} Caller job(s) do not use your App.`, {
|
|
150
|
+
details: [...unpassed, ...unchecked, ...notes],
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if (unchecked.length) {
|
|
154
|
+
return result(ID, TITLE, "skip", "Some Caller jobs could not be read.", {
|
|
155
|
+
details: [...unchecked, ...notes],
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const set = "The variable and the secret are set";
|
|
159
|
+
let summary = `${set}; no Caller job pushes, so nothing uses them.`;
|
|
160
|
+
if (jobs.length > notes.length) {
|
|
161
|
+
const which = notes.length ? "Caller job that can use them" : "pushing Caller job";
|
|
162
|
+
summary = `${set}, and each ${which} passes them.`;
|
|
163
|
+
} else if (notes.length) {
|
|
164
|
+
summary = `${set}; no Caller job uses them.`;
|
|
165
|
+
}
|
|
166
|
+
return result(ID, TITLE, "pass", summary, { details: notes });
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Only meaningful once both halves are set. */
|
|
170
|
+
export function checkGitHubAppInstalled({ github, repo, owner, ownerType }) {
|
|
171
|
+
const skip = (summary, details = []) =>
|
|
172
|
+
result(INSTALLED_ID, INSTALLED_TITLE, "skip", summary, { details });
|
|
173
|
+
if (ownerType !== "Organization") {
|
|
174
|
+
return skip("GitHub does not show a personal account's app installations to a gh login.", [
|
|
175
|
+
"Check https://github.com/settings/installations.",
|
|
176
|
+
]);
|
|
177
|
+
}
|
|
178
|
+
let id;
|
|
179
|
+
let rows;
|
|
180
|
+
try {
|
|
181
|
+
id = readMode(github, repo, ownerType, APP_VARIABLE)?.trim();
|
|
182
|
+
rows = github.getLines(
|
|
183
|
+
`orgs/${owner}/installations`,
|
|
184
|
+
'.installations[] | [(.app_id | tostring), (.client_id // ""), .repository_selection] | join(" ")',
|
|
185
|
+
);
|
|
186
|
+
} catch (err) {
|
|
187
|
+
return skip(`Could not list ${owner}'s app installations: ${err.message}`);
|
|
188
|
+
}
|
|
189
|
+
if (!id) return skip(`Could not read ${APP_VARIABLE}'s value.`);
|
|
190
|
+
const found = rows
|
|
191
|
+
.map((row) => row.split(" "))
|
|
192
|
+
.find(([app, client]) => [app, client].includes(id));
|
|
193
|
+
const settings = `https://github.com/organizations/${owner}/settings/installations`;
|
|
194
|
+
if (!found) {
|
|
195
|
+
return result(
|
|
196
|
+
INSTALLED_ID,
|
|
197
|
+
INSTALLED_TITLE,
|
|
198
|
+
"fail",
|
|
199
|
+
`No app with the id in ${APP_VARIABLE} is installed on ${owner}.`,
|
|
200
|
+
{ details: [`Install your App on ${repo}: ${settings}`] },
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
if (found[2] === "all") {
|
|
204
|
+
return result(
|
|
205
|
+
INSTALLED_ID,
|
|
206
|
+
INSTALLED_TITLE,
|
|
207
|
+
"pass",
|
|
208
|
+
`Installed on all of ${owner}'s repositories.`,
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
return skip(`Installed on selected ${owner} repositories; gh cannot see which.`, [
|
|
212
|
+
`Check that ${repo} is selected: ${settings}`,
|
|
213
|
+
]);
|
|
214
|
+
}
|
package/src/checks/rulesets.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// The rulesets docs/repository-hardening.md sets up, which keep
|
|
2
|
-
//
|
|
3
|
-
// release tags. Each gap is a warning: the flows
|
|
1
|
+
// The rulesets docs/repository-hardening.md sets up, which keep a GitHub App's
|
|
2
|
+
// token (the Claude App's, or the Consumer's own) away from the default
|
|
3
|
+
// branch, release branches and release tags. Each gap is a warning: the flows
|
|
4
|
+
// still run without them.
|
|
4
5
|
//
|
|
5
|
-
// A rule only counts when no one
|
|
6
|
+
// A rule only counts when no one an App can act as is on the ruleset's
|
|
6
7
|
// bypass list: rulesets stack, so an actor on one ruleset's bypass list is
|
|
7
8
|
// still held by any other ruleset with the same rule that does not list it.
|
|
8
9
|
|
|
@@ -125,8 +126,8 @@ const MAINTAIN_ROLE = 2;
|
|
|
125
126
|
const ROLE_NAMES = { 1: "Read", 2: "Maintain", 3: "Triage", 4: "Write", 5: "Admin" };
|
|
126
127
|
|
|
127
128
|
/**
|
|
128
|
-
* Bypass actors that undo the ruleset's protection against
|
|
129
|
-
* any GitHub App (
|
|
129
|
+
* Bypass actors that undo the ruleset's protection against an agent's token:
|
|
130
|
+
* any GitHub App (each is an `Integration`), any repository role
|
|
130
131
|
* below Maintain (the Write role, or a custom role), and, on a branch
|
|
131
132
|
* ruleset, deploy keys. Admin, Maintain, teams and organization admins are
|
|
132
133
|
* the intended bypass list; a DeployKey bypass on a tag ruleset is the
|
|
@@ -168,7 +169,7 @@ function ruleStatus(covering, type) {
|
|
|
168
169
|
}
|
|
169
170
|
|
|
170
171
|
const BYPASS_ADVICE =
|
|
171
|
-
"Keep the bypass list to Admin and Maintain: never
|
|
172
|
+
"Keep the bypass list to Admin and Maintain: never any GitHub App, the Write role, or a team an App acts through.";
|
|
172
173
|
|
|
173
174
|
function updateRule(rulesets, { defaultBranch }) {
|
|
174
175
|
const ID = "ruleset-update";
|
|
@@ -187,7 +188,7 @@ function updateRule(rulesets, { defaultBranch }) {
|
|
|
187
188
|
}
|
|
188
189
|
return result(ID, TITLE, "warn", `No active update rule on ${defaultBranch}.`, {
|
|
189
190
|
details: [
|
|
190
|
-
"A required pull request with zero approvals does not stop the Claude App merging its own pull request; an update rule does.",
|
|
191
|
+
"A required pull request with zero approvals does not stop any GitHub App (the Claude App, or yours) merging its own pull request; an update rule does.",
|
|
191
192
|
recipe,
|
|
192
193
|
],
|
|
193
194
|
});
|
|
@@ -26,6 +26,9 @@ const MODEL_INPUTS = new Set([
|
|
|
26
26
|
"cursor_api_key",
|
|
27
27
|
]);
|
|
28
28
|
|
|
29
|
+
/** The Consumer's own GitHub App's key: optional, and the `github-app` check judges it. */
|
|
30
|
+
const APP_INPUT = "app_private_key";
|
|
31
|
+
|
|
29
32
|
/** GitHub provides `secrets.GITHUB_TOKEN`; no `GITHUB_*` secret can be set by hand. */
|
|
30
33
|
const isProvided = (name) => /^github_/i.test(name);
|
|
31
34
|
|
|
@@ -150,7 +153,7 @@ export function deriveRequirements(callers, readReusable) {
|
|
|
150
153
|
};
|
|
151
154
|
}
|
|
152
155
|
|
|
153
|
-
function listNames(github, repo, kind, ownerType) {
|
|
156
|
+
export function listNames(github, repo, kind, ownerType) {
|
|
154
157
|
const key = kind === "secret" ? "secrets" : "variables";
|
|
155
158
|
const names = new Set(github.getLines(`repos/${repo}/actions/${key}`, `.${key}[].name`));
|
|
156
159
|
let orgNote = null;
|
|
@@ -226,7 +229,7 @@ function jobsWithTwoCredentials(jobs, isSet) {
|
|
|
226
229
|
}
|
|
227
230
|
|
|
228
231
|
/** `gh secret set` / `gh variable set` for a valid name, or a by-hand note. */
|
|
229
|
-
function setCommand(kind, name, repo, extra = []) {
|
|
232
|
+
export function setCommand(kind, name, repo, extra = []) {
|
|
230
233
|
if (!NAME_PATTERN.test(name)) return { note: byHand(`${kind} named`, name) };
|
|
231
234
|
return { cmd: command("gh", kind, "set", name, "--repo", repo, ...extra) };
|
|
232
235
|
}
|
|
@@ -238,7 +241,18 @@ function splitFixes(items) {
|
|
|
238
241
|
};
|
|
239
242
|
}
|
|
240
243
|
|
|
241
|
-
|
|
244
|
+
/**
|
|
245
|
+
* `perStageCredential`: the pinned tag publishes its harness facts, so the
|
|
246
|
+
* `stage-credential` check judges each Stage's model credential by its harness
|
|
247
|
+
* (a missing one, or a Deep scan with two), and this one judges none.
|
|
248
|
+
*/
|
|
249
|
+
export function checkSecrets({
|
|
250
|
+
github,
|
|
251
|
+
repo,
|
|
252
|
+
ownerType,
|
|
253
|
+
requirements,
|
|
254
|
+
perStageCredential = false,
|
|
255
|
+
}) {
|
|
242
256
|
const ID = "secrets";
|
|
243
257
|
const TITLE = "Secrets the Callers pass are set";
|
|
244
258
|
const { problems, noCredential = [], unsupported = [] } = requirements;
|
|
@@ -263,11 +277,16 @@ export function checkSecrets({ github, repo, ownerType, requirements }) {
|
|
|
263
277
|
const isSet = (x) => x.names.some((n) => listed.names.has(n.toUpperCase()));
|
|
264
278
|
const missingRequired = requirements.secrets.filter((x) => x.required && !isSet(x));
|
|
265
279
|
const missingOptional = requirements.secrets.filter(
|
|
266
|
-
(x) =>
|
|
280
|
+
(x) =>
|
|
281
|
+
!x.required &&
|
|
282
|
+
!isModelCredential(x) &&
|
|
283
|
+
!x.uses.every(({ input }) => input === APP_INPUT) &&
|
|
284
|
+
!isSet(x),
|
|
267
285
|
);
|
|
268
286
|
const claudeCode = claudeCodeJobs(requirements.secrets);
|
|
269
|
-
const uncredentialed = jobsWithoutCredential(claudeCode, isSet);
|
|
270
|
-
const doubled = jobsWithTwoCredentials(claudeCode, isSet);
|
|
287
|
+
const uncredentialed = perStageCredential ? [] : jobsWithoutCredential(claudeCode, isSet);
|
|
288
|
+
const doubled = perStageCredential ? [] : jobsWithTwoCredentials(claudeCode, isSet);
|
|
289
|
+
const unpassed = perStageCredential ? [] : noCredential;
|
|
271
290
|
const describe = (x) => `${x.names.join(" or ")} (${x.where.join(", ")})`;
|
|
272
291
|
// No --body: gh prompts for the value, so it never lands in shell history.
|
|
273
292
|
const wanted = [...missingRequired, ...uncredentialed.map((x) => x.first), ...missingOptional];
|
|
@@ -287,7 +306,7 @@ export function checkSecrets({ github, repo, ownerType, requirements }) {
|
|
|
287
306
|
`no model credential set: ${x.names} (${x.where.join(", ")}); the run fails without one`,
|
|
288
307
|
),
|
|
289
308
|
...missingOptional.map((x) => `optional, not set: ${describe(x)}`),
|
|
290
|
-
...
|
|
309
|
+
...unpassed,
|
|
291
310
|
...unsupported,
|
|
292
311
|
...notes,
|
|
293
312
|
];
|
|
@@ -304,7 +323,7 @@ export function checkSecrets({ github, repo, ownerType, requirements }) {
|
|
|
304
323
|
.join(" ");
|
|
305
324
|
return result(ID, TITLE, "fail", summary, { details, fix });
|
|
306
325
|
}
|
|
307
|
-
const bare = uncredentialed.length +
|
|
326
|
+
const bare = uncredentialed.length + unpassed.length;
|
|
308
327
|
if (bare || missingOptional.length) {
|
|
309
328
|
const summary = [
|
|
310
329
|
bare && "Some jobs have no model credential.",
|