@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.
Files changed (107) hide show
  1. package/all/copy-overwrite/scripts/lisa-gates.mjs +101 -34
  2. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +1 -1
  3. package/dist/cli/doctor-skip-jobs-migration.d.ts.map +1 -1
  4. package/dist/cli/doctor-skip-jobs-migration.js +9 -0
  5. package/dist/cli/doctor-skip-jobs-migration.js.map +1 -1
  6. package/dist/cli/ui-ci-quality-jobs-compute.d.ts.map +1 -1
  7. package/dist/cli/ui-ci-quality-jobs-compute.js +48 -13
  8. package/dist/cli/ui-ci-quality-jobs-compute.js.map +1 -1
  9. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  10. package/dist/core/lisa-owned-hash-ledger.js +14 -0
  11. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  12. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  13. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  14. package/dist/core/upstream-evidence-manifest.js +12 -7
  15. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  16. package/package.json +4 -4
  17. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  19. package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-aws/SKILL.md +7 -2
  20. package/plugins/lisa/scripts/install-remote-agent-aws.mjs +5 -3
  21. package/plugins/lisa/scripts/remote-agent-aws-setup.sh +41 -7
  22. package/plugins/lisa/skills/lisa-setup-remote-aws/SKILL.md +7 -2
  23. package/plugins/lisa-agy/plugin.json +1 -1
  24. package/plugins/lisa-agy/scripts/install-remote-agent-aws.mjs +5 -3
  25. package/plugins/lisa-agy/scripts/remote-agent-aws-setup.sh +41 -7
  26. package/plugins/lisa-agy/skills/lisa-setup-remote-aws/SKILL.md +7 -2
  27. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  29. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  30. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  34. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-copilot/scripts/install-remote-agent-aws.mjs +5 -3
  36. package/plugins/lisa-copilot/scripts/remote-agent-aws-setup.sh +41 -7
  37. package/plugins/lisa-copilot/skills/lisa-setup-remote-aws/SKILL.md +7 -2
  38. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-cursor/scripts/install-remote-agent-aws.mjs +5 -3
  40. package/plugins/lisa-cursor/scripts/remote-agent-aws-setup.sh +41 -7
  41. package/plugins/lisa-cursor/skills/lisa-setup-remote-aws/SKILL.md +7 -2
  42. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  44. package/plugins/lisa-devin/scripts/install-remote-agent-aws.mjs +5 -3
  45. package/plugins/lisa-devin/scripts/remote-agent-aws-setup.sh +41 -7
  46. package/plugins/lisa-devin/skills/lisa-setup-remote-aws/SKILL.md +7 -2
  47. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  49. package/plugins/lisa-expo-agy/plugin.json +1 -1
  50. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  54. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  56. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  57. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  61. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  63. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  64. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  68. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  71. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  75. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  77. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  78. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  82. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  84. package/plugins/lisa-rails-agy/plugin.json +1 -1
  85. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  89. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  91. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  92. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  95. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  96. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  98. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  99. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  102. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  103. package/plugins/src/base/scripts/install-remote-agent-aws.mjs +5 -3
  104. package/plugins/src/base/scripts/remote-agent-aws-setup.sh +41 -7
  105. package/plugins/src/base/skills/lisa-setup-remote-aws/SKILL.md +7 -2
  106. package/scripts/check-required-check-promotions.mjs +110 -3
  107. 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 stops and says
339
- so rather than repointing every unqualified \`aws\` command. Pass
340
- \`LISA_AWS_CLAIM_DEFAULT_PROFILE=1\` to take it over deliberately.
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" ] || fail \
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
- aws configure set role_arn "$default_role_arn" --profile default
633
- aws configure set source_profile "$BOOTSTRAP_PROFILE" --profile default
634
- aws configure set external_id "$external_id" --profile default
635
- aws configure set role_session_name "$session_name" --profile default
636
- aws configure set region "$default_region" --profile default
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, and otherwise stops and names the current owner;
57
- `LISA_AWS_CLAIM_DEFAULT_PROFILE=1` takes it over deliberately.
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 { readGates } from "../all/copy-overwrite/scripts/lisa-gates.mjs";
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
  *
@@ -103,7 +103,7 @@
103
103
  },
104
104
  "inspected": {
105
105
  "workflows": 26,
106
- "steps": 824,
106
+ "steps": 765,
107
107
  "couplings": 36,
108
108
  "inventory": 186
109
109
  },