@codyswann/lisa 4.79.1 → 4.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all/copy-overwrite/scripts/lisa-gates.mjs +101 -34
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +1 -1
- package/dist/cli/doctor-skip-jobs-migration.d.ts.map +1 -1
- package/dist/cli/doctor-skip-jobs-migration.js +9 -0
- package/dist/cli/doctor-skip-jobs-migration.js.map +1 -1
- package/dist/cli/ui-ci-quality-jobs-compute.d.ts.map +1 -1
- package/dist/cli/ui-ci-quality-jobs-compute.js +48 -13
- package/dist/cli/ui-ci-quality-jobs-compute.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +14 -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/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +12 -7
- 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-setup-remote-aws/SKILL.md +7 -2
- package/plugins/lisa/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa-agy/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa-agy/skills/lisa-setup-remote-aws/SKILL.md +7 -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/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa-copilot/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa-copilot/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa-cursor/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa-cursor/skills/lisa-setup-remote-aws/SKILL.md +7 -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/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/lisa-devin/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/lisa-devin/skills/lisa-setup-remote-aws/SKILL.md +7 -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/scripts/install-remote-agent-aws.mjs +5 -3
- package/plugins/src/base/scripts/remote-agent-aws-setup.sh +41 -7
- package/plugins/src/base/skills/lisa-setup-remote-aws/SKILL.md +7 -2
- package/scripts/check-required-check-promotions.mjs +110 -3
- package/scripts/two-channel-couplings.json +1 -1
|
@@ -335,9 +335,11 @@ a name carrying the owner prevents it.
|
|
|
335
335
|
|
|
336
336
|
\`default\` is the one name that cannot be namespaced. The setup script writes
|
|
337
337
|
it for this project only when nothing else already owns it; if another Lisa
|
|
338
|
-
project or the operator's own configuration holds it, the script
|
|
339
|
-
|
|
340
|
-
\`
|
|
338
|
+
project or the operator's own configuration holds it, the script still writes
|
|
339
|
+
every named profile and verifies them as a normal run would, leaves
|
|
340
|
+
\`[default]\` untouched, and exits non-zero saying so rather than repointing
|
|
341
|
+
every unqualified \`aws\` command. Use the named profiles it lists, or pass
|
|
342
|
+
\`LISA_AWS_CLAIM_DEFAULT_PROFILE=1\` to take \`[default]\` over deliberately.
|
|
341
343
|
|
|
342
344
|
Production and shared profiles are observer-only. Production repair remains a
|
|
343
345
|
human-driven local-workstation operation.
|
|
@@ -598,12 +598,22 @@ if [ -n "$legacy_sections" ]; then
|
|
|
598
598
|
fi
|
|
599
599
|
fi
|
|
600
600
|
|
|
601
|
+
# Decided here, enforced at the end. Refusing `[default]` must not also refuse
|
|
602
|
+
# the named profiles: they are namespaced, carry no collision risk, and are the
|
|
603
|
+
# remedy the refusal points the operator at. Refusing before writing them told
|
|
604
|
+
# the operator to use profiles that did not exist, leaving the takeover override
|
|
605
|
+
# as the only real path — the outcome this guard exists to discourage. So every
|
|
606
|
+
# named profile is written and verified first, `[default]` alone is left
|
|
607
|
+
# untouched, and the run still exits non-zero: what the operator asked for
|
|
608
|
+
# (a ready workstation with this project's default) did not happen, and a
|
|
609
|
+
# caller that continued on success would run unqualified `aws` commands in the
|
|
610
|
+
# operator's account believing they reached this project's.
|
|
601
611
|
default_owner="$(default_profile_owner)"
|
|
612
|
+
claim_default=1
|
|
602
613
|
case "$default_owner" in
|
|
603
614
|
ours | legacy | unclaimed) ;;
|
|
604
615
|
*)
|
|
605
|
-
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] ||
|
|
606
|
-
"refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. Use the named profiles instead (${profile_names}), or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take it over deliberately."
|
|
616
|
+
[ "${LISA_AWS_CLAIM_DEFAULT_PROFILE:-0}" = "1" ] || claim_default=0
|
|
607
617
|
;;
|
|
608
618
|
esac
|
|
609
619
|
|
|
@@ -629,11 +639,13 @@ while IFS="$(printf '\t')" read -r stage role_arn region; do
|
|
|
629
639
|
done < <(printf '%s' "$profiles_json" | jq -r 'to_entries[] | [.key, .value.roleArn, .value.region] | @tsv')
|
|
630
640
|
|
|
631
641
|
default_profile="${PROFILE_NAMESPACE}-agent-${default_stage}"
|
|
632
|
-
|
|
633
|
-
aws configure set
|
|
634
|
-
aws configure set
|
|
635
|
-
aws configure set
|
|
636
|
-
aws configure set
|
|
642
|
+
if [ "$claim_default" = "1" ]; then
|
|
643
|
+
aws configure set role_arn "$default_role_arn" --profile default
|
|
644
|
+
aws configure set source_profile "$BOOTSTRAP_PROFILE" --profile default
|
|
645
|
+
aws configure set external_id "$external_id" --profile default
|
|
646
|
+
aws configure set role_session_name "$session_name" --profile default
|
|
647
|
+
aws configure set region "$default_region" --profile default
|
|
648
|
+
fi
|
|
637
649
|
|
|
638
650
|
chmod 600 "$credentials_file" "$config_file"
|
|
639
651
|
|
|
@@ -674,4 +686,26 @@ if [ -n "$legacy_names" ]; then
|
|
|
674
686
|
fi
|
|
675
687
|
fi
|
|
676
688
|
|
|
689
|
+
if [ "$claim_default" = "0" ]; then
|
|
690
|
+
if [ "${LISA_AWS_SKIP_VERIFY:-0}" = "1" ]; then
|
|
691
|
+
named_state="were written but not verified (LISA_AWS_SKIP_VERIFY=1)"
|
|
692
|
+
elif [ "${LISA_AWS_VERIFY_ALL_PROFILES:-0}" = "1" ]; then
|
|
693
|
+
named_state="were written and verified"
|
|
694
|
+
else
|
|
695
|
+
# Only the default stage's account is proved without VERIFY_ALL, so the
|
|
696
|
+
# message names exactly that one rather than vouching for all of them.
|
|
697
|
+
named_state="were written; ${default_profile} was verified (set LISA_AWS_VERIFY_ALL_PROFILES=1 to verify every one)"
|
|
698
|
+
fi
|
|
699
|
+
# The trap the override walks into when `[default]` is static keys rather
|
|
700
|
+
# than a config-side profile: claiming rewrites only the config file, so the
|
|
701
|
+
# keys stay, and `[default]` ends up holding a role and an unrelated account's
|
|
702
|
+
# keys at once. Which wins depends on each tool's credential precedence. The
|
|
703
|
+
# key material itself is never echoed.
|
|
704
|
+
static_keys_note=""
|
|
705
|
+
if [ -n "$(profile_setting_value "$credentials_file" "default" "aws_access_key_id")" ]; then
|
|
706
|
+
static_keys_note=" Note: ${credentials_file} holds long-lived access keys under [default]. Claiming rewrites only ${config_file} and does not remove them, so [default] would carry both this project's role and those keys, and which one a tool uses depends on its credential precedence."
|
|
707
|
+
fi
|
|
708
|
+
fail "refusing to overwrite the [default] AWS profile in ${config_file}: it belongs to ${default_owner}, not to ${PROFILE_NAMESPACE}. Overwriting it would silently repoint every unqualified aws command at this project's accounts. [default] was left untouched; this project's named profiles ${named_state} (${profile_names}). Use them instead, for example AWS_PROFILE=${default_profile} or --profile ${default_profile}, or set LISA_AWS_CLAIM_DEFAULT_PROFILE=1 to take [default] over deliberately.${static_keys_note}"
|
|
709
|
+
fi
|
|
710
|
+
|
|
677
711
|
echo "remote-agent-aws-setup: ready (${session_name}; namespace=${PROFILE_NAMESPACE} via ${namespace_source}; default=${default_profile} in account ${default_expected_account}; profiles=${profile_names})"
|
|
@@ -53,8 +53,13 @@ two bundles declaring the same stages overwrite each other in the shared
|
|
|
53
53
|
malformed. The name is the only place the owner can be recorded.
|
|
54
54
|
|
|
55
55
|
`default` cannot be namespaced. The script claims it only when nothing else
|
|
56
|
-
owns it
|
|
57
|
-
|
|
56
|
+
owns it. Otherwise it still writes every named profile and verifies them as a
|
|
57
|
+
normal run would (the default stage, or every stage under
|
|
58
|
+
`LISA_AWS_VERIFY_ALL_PROFILES=1`), leaves `[default]` untouched, and exits
|
|
59
|
+
non-zero naming the current owner and the named profiles to use instead (for example `AWS_PROFILE=<project>-agent-dev`);
|
|
60
|
+
`LISA_AWS_CLAIM_DEFAULT_PROFILE=1` takes `[default]` over deliberately. When the
|
|
61
|
+
owner is long-lived keys under `[default]` in `~/.aws/credentials`, the message
|
|
62
|
+
also says that claiming would not remove them.
|
|
58
63
|
|
|
59
64
|
Readiness is an account check, not a liveness check. `sts:GetCallerIdentity`
|
|
60
65
|
succeeding proves the credentials work, not that they reached the intended
|
|
@@ -139,7 +139,11 @@ import fs from "node:fs";
|
|
|
139
139
|
import path from "node:path";
|
|
140
140
|
import yaml from "js-yaml";
|
|
141
141
|
|
|
142
|
-
import {
|
|
142
|
+
import {
|
|
143
|
+
REGISTRY,
|
|
144
|
+
jobBackedGates,
|
|
145
|
+
readGates,
|
|
146
|
+
} from "../all/copy-overwrite/scripts/lisa-gates.mjs";
|
|
143
147
|
import { invokedAsScript } from "./lib/invoked-as-script.mjs";
|
|
144
148
|
import { buildRulesetPayload } from "./lisa-ruleset-payload.mjs";
|
|
145
149
|
|
|
@@ -363,7 +367,7 @@ export function collectDeclaredContexts(root) {
|
|
|
363
367
|
* jobs it declares, and whether it actually runs on every pull request.
|
|
364
368
|
*
|
|
365
369
|
* @param {string} absolute - absolute path to the workflow YAML.
|
|
366
|
-
* @returns {{ jobs: Map<string, string>, onPullRequest: boolean, pathFilterKeys: string[] } | null}
|
|
370
|
+
* @returns {{ jobs: Map<string, string>, matrixJobs: Set<string>, onPullRequest: boolean, pathFilterKeys: string[] } | null}
|
|
367
371
|
* the parsed facts, or null when the file is absent or unparseable.
|
|
368
372
|
*/
|
|
369
373
|
export function readWorkflow(absolute) {
|
|
@@ -395,10 +399,13 @@ export function readWorkflow(absolute) {
|
|
|
395
399
|
? ["paths", "paths-ignore"].filter(key => key in pullRequest)
|
|
396
400
|
: [];
|
|
397
401
|
const jobs = new Map();
|
|
402
|
+
const matrixJobs = new Set();
|
|
398
403
|
for (const [id, job] of Object.entries(doc.jobs ?? {})) {
|
|
399
404
|
jobs.set(id, typeof job?.name === "string" ? job.name : id);
|
|
405
|
+
const matrix = job?.strategy?.matrix;
|
|
406
|
+
if (typeof matrix === "object" && matrix !== null) matrixJobs.add(id);
|
|
400
407
|
}
|
|
401
|
-
return { jobs, onPullRequest, pathFilterKeys };
|
|
408
|
+
return { jobs, matrixJobs, onPullRequest, pathFilterKeys };
|
|
402
409
|
}
|
|
403
410
|
|
|
404
411
|
/**
|
|
@@ -674,9 +681,109 @@ function calledJobProblems(entry, root, calledName) {
|
|
|
674
681
|
},
|
|
675
682
|
];
|
|
676
683
|
}
|
|
684
|
+
if (entry.job_id === DECLARED_GATES_JOB) {
|
|
685
|
+
return declaredGateLegProblems(called, entry, calledName, root);
|
|
686
|
+
}
|
|
677
687
|
return jobNameProblems(called, entry.job_id, calledName, "called");
|
|
678
688
|
}
|
|
679
689
|
|
|
690
|
+
/** The matrix job that posts one context per declared gate leg. */
|
|
691
|
+
const DECLARED_GATES_JOB = "declared_gates";
|
|
692
|
+
|
|
693
|
+
/** The literal `name:` that makes each matrix leg post its gate's label. */
|
|
694
|
+
const MATRIX_LABEL_NAME = "${{ matrix.label }}";
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Verify a context posted by a `declared_gates` matrix leg rather than by a
|
|
698
|
+
* hand-written job (#3052).
|
|
699
|
+
*
|
|
700
|
+
* A leg has no static `name:` to compare — it is named by the registry label
|
|
701
|
+
* of the gate it runs. So the entry names that gate, and the guard checks the
|
|
702
|
+
* three facts that together mean the leg posts this exact string: the matrix
|
|
703
|
+
* job exists and is named by `matrix.label`, the gate's registry label is the
|
|
704
|
+
* context half, and no hand-written job still owns the gate. The last one
|
|
705
|
+
* matters because `momentLegs` emits no leg for a job-backed gate, so a ledger
|
|
706
|
+
* pointing at a leg that cannot exist would vouch for a context nothing posts.
|
|
707
|
+
*
|
|
708
|
+
* @param {{ jobs: Map<string, string>, matrixJobs: Set<string> }} called - parsed called workflow.
|
|
709
|
+
* @param {object} entry - the ledger entry.
|
|
710
|
+
* @param {string} calledName - the expected called-job display name.
|
|
711
|
+
* @param {string} root - absolute repository root.
|
|
712
|
+
* @returns {{ rule: string, detail: string }[]} problems, empty when sound.
|
|
713
|
+
*/
|
|
714
|
+
function declaredGateLegProblems(called, entry, calledName, root) {
|
|
715
|
+
// A job named by `matrix.label` with no `strategy.matrix` has no legs, so it
|
|
716
|
+
// posts no context at all — the name alone proves nothing.
|
|
717
|
+
if (
|
|
718
|
+
called.jobs.get(DECLARED_GATES_JOB) !== MATRIX_LABEL_NAME ||
|
|
719
|
+
!called.matrixJobs.has(DECLARED_GATES_JOB)
|
|
720
|
+
) {
|
|
721
|
+
return [
|
|
722
|
+
{
|
|
723
|
+
rule: "called-job-missing",
|
|
724
|
+
detail: `no '${DECLARED_GATES_JOB}' matrix job named '${MATRIX_LABEL_NAME}' in the called workflow, so no declared gate leg posts '${calledName}'`,
|
|
725
|
+
},
|
|
726
|
+
];
|
|
727
|
+
}
|
|
728
|
+
const gate = entry.gate;
|
|
729
|
+
const label =
|
|
730
|
+
typeof gate === "string" && Object.hasOwn(REGISTRY, gate)
|
|
731
|
+
? REGISTRY[gate].label
|
|
732
|
+
: undefined;
|
|
733
|
+
if (label === undefined) {
|
|
734
|
+
return [
|
|
735
|
+
{
|
|
736
|
+
rule: "leg-gate-missing",
|
|
737
|
+
detail: `a '${DECLARED_GATES_JOB}' entry must name the registry gate whose leg posts the context; got ${JSON.stringify(gate)}`,
|
|
738
|
+
},
|
|
739
|
+
];
|
|
740
|
+
}
|
|
741
|
+
if (label !== calledName) {
|
|
742
|
+
return [
|
|
743
|
+
{
|
|
744
|
+
rule: "called-job-name-mismatch",
|
|
745
|
+
detail: `gate '${gate}' posts '${label}' but the context expects '${calledName}'`,
|
|
746
|
+
},
|
|
747
|
+
];
|
|
748
|
+
}
|
|
749
|
+
if (jobBackedGates().includes(gate)) {
|
|
750
|
+
return [
|
|
751
|
+
{
|
|
752
|
+
rule: "leg-gate-job-backed",
|
|
753
|
+
detail: `gate '${gate}' is still owned by a hand-written job, so the runner emits no leg for it`,
|
|
754
|
+
},
|
|
755
|
+
];
|
|
756
|
+
}
|
|
757
|
+
return legDeclarationProblems(root, gate, calledName);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Whether this repository declares the gate at a level that makes its leg run.
|
|
762
|
+
*
|
|
763
|
+
* A leg exists only for a gate the project DECLARES at pull-request. A ledger
|
|
764
|
+
* entry pointing at a leg for an undeclared gate vouches for a context nothing
|
|
765
|
+
* posts, and a required context that never posts holds every pull request.
|
|
766
|
+
*
|
|
767
|
+
* @param {string} root - absolute repository root.
|
|
768
|
+
* @param {string} gate - the gate whose leg posts the context.
|
|
769
|
+
* @param {string} calledName - the expected called-job display name.
|
|
770
|
+
* @returns {{ rule: string, detail: string }[]} problems, empty when sound.
|
|
771
|
+
*/
|
|
772
|
+
function legDeclarationProblems(root, gate, calledName) {
|
|
773
|
+
const declared = readGates(root).gates?.[gate]?.["pull-request"];
|
|
774
|
+
const level =
|
|
775
|
+
typeof declared === "object" && declared !== null
|
|
776
|
+
? declared.level
|
|
777
|
+
: declared;
|
|
778
|
+
if (level === "required" || level === "optional") return [];
|
|
779
|
+
return [
|
|
780
|
+
{
|
|
781
|
+
rule: "leg-gate-undeclared",
|
|
782
|
+
detail: `gate '${gate}' is not declared at pull-request in .lisa.config.json (found ${JSON.stringify(declared ?? null)}), so no leg posts '${calledName}'`,
|
|
783
|
+
},
|
|
784
|
+
];
|
|
785
|
+
}
|
|
786
|
+
|
|
680
787
|
/**
|
|
681
788
|
* Read the promotion ledger.
|
|
682
789
|
*
|