@codyswann/lisa 4.10.7 → 4.10.8

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 (87) hide show
  1. package/all/copy-overwrite/scripts/lisa-gates.mjs +82 -1
  2. package/dist/cli/doctor-declared-contexts.d.ts.map +1 -1
  3. package/dist/cli/doctor-declared-contexts.js +16 -0
  4. package/dist/cli/doctor-declared-contexts.js.map +1 -1
  5. package/dist/cli/gate-report-drift-section.d.ts.map +1 -1
  6. package/dist/cli/gate-report-drift-section.js +6 -0
  7. package/dist/cli/gate-report-drift-section.js.map +1 -1
  8. package/dist/cli/gate-report-joins.d.ts +0 -15
  9. package/dist/cli/gate-report-joins.d.ts.map +1 -1
  10. package/dist/cli/gate-report-joins.js +2 -1
  11. package/dist/cli/gate-report-joins.js.map +1 -1
  12. package/dist/cli/gate-report-registry.d.ts +8 -0
  13. package/dist/cli/gate-report-registry.d.ts.map +1 -1
  14. package/dist/cli/gate-report-registry.js.map +1 -1
  15. package/dist/cli/gate-report-types.d.ts +2 -1
  16. package/dist/cli/gate-report-types.d.ts.map +1 -1
  17. package/dist/cli/gate-report-types.js.map +1 -1
  18. package/dist/core/gate-context-owners.d.ts +122 -0
  19. package/dist/core/gate-context-owners.d.ts.map +1 -0
  20. package/dist/core/gate-context-owners.js +174 -0
  21. package/dist/core/gate-context-owners.js.map +1 -0
  22. package/dist/core/gate-declaration-drift.d.ts +56 -79
  23. package/dist/core/gate-declaration-drift.d.ts.map +1 -1
  24. package/dist/core/gate-declaration-drift.js +73 -115
  25. package/dist/core/gate-declaration-drift.js.map +1 -1
  26. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  27. package/dist/core/lisa-owned-hash-ledger.js +4 -0
  28. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  29. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  30. package/dist/core/upstream-evidence-manifest.js +6 -2
  31. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  32. package/dist/health/declared-checks-inspection.d.ts +0 -22
  33. package/dist/health/declared-checks-inspection.d.ts.map +1 -1
  34. package/dist/health/declared-checks-inspection.js +44 -5
  35. package/dist/health/declared-checks-inspection.js.map +1 -1
  36. package/package.json +1 -1
  37. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  39. package/plugins/lisa-agy/plugin.json +1 -1
  40. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  42. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  43. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  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-harper-fabric/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  54. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  55. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  59. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  60. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  64. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  65. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  69. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  70. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  74. package/plugins/lisa-rails-agy/plugin.json +1 -1
  75. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  79. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  80. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  84. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  85. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  87. package/scripts/lisa-github-rulesets.sh +138 -0
@@ -901,6 +901,139 @@ collect_templates() {
901
901
  echo "${templates[@]}"
902
902
  }
903
903
 
904
+ ##############################################################################
905
+ # Retired Required Contexts
906
+ ##############################################################################
907
+
908
+ # Report required contexts that NOTHING WILL EVER POST, across EVERY ruleset the
909
+ # repository has — including the ones this script does not manage.
910
+ #
911
+ # This exists because the rest of the script cannot see the failure. Everything
912
+ # above is scoped per MANAGED ruleset name: it makes Lisa's four templates match,
913
+ # and it never looks at a ruleset somebody hand-made. #3067 is what that costs.
914
+ # 4.x renamed the quality job `🔎 AST Grep Scan` to `🔎 Structural Rules`. A
915
+ # repository whose hand-made ruleset still required the old name was left with a
916
+ # required check that can never report — and a required check that never reports
917
+ # does NOT fail a pull request. GitHub holds it at "Expected — Waiting for status
918
+ # to be reported", indefinitely: `mergeable: MERGEABLE`, `mergeStateStatus:
919
+ # BLOCKED`, every other check green, no red tick, no log to open, and nothing
920
+ # anywhere naming the cause. `--dry-run` on that repository correctly added the
921
+ # NEW name to the ruleset it manages and never mentioned the OLD name surviving
922
+ # in the one it does not. Running it to completion left the repository blocked.
923
+ #
924
+ # REPORT ONLY, and deliberately so. Lisa does not own a hand-made ruleset, and
925
+ # silently editing somebody else's branch protection is a bigger decision than
926
+ # this script carries — it would be Lisa deleting a requirement a human wrote,
927
+ # with no record of asking. What this owes the operator is the name and the
928
+ # reason, which is precisely what nothing gave them.
929
+ #
930
+ # The evidence is `previousLabels` in the shipped registry — Lisa's own record
931
+ # that Lisa renamed the job, which is why the claim is provable rather than
932
+ # inferred. A context that is simply absent from the derived set proves nothing:
933
+ # a repository may legitimately require a status posted by a third-party app or
934
+ # by a job its own CI defines, and a sweep that flagged every externally
935
+ # produced context would be noise an operator learns to ignore.
936
+ report_retired_contexts() {
937
+ local repo="$1"
938
+ local rulesets="$2"
939
+ local registry="$LISA_ROOT/all/copy-overwrite/scripts/lisa-gates.mjs"
940
+ local retired
941
+
942
+ # An unread retirement list is NOT "no retired contexts". Saying nothing here
943
+ # would report a repository clean on the strength of a read that never
944
+ # happened, which is the same defect one layer up.
945
+ if [[ ! -f "$registry" ]]; then
946
+ log_warning "Could not read $registry — retired required contexts were NOT checked. This is not a clean result."
947
+ return 0
948
+ fi
949
+ if ! retired=$(node "$registry" retired-contexts 2>/dev/null); then
950
+ log_warning "Could not derive the retired-context list — retired required contexts were NOT checked. This is not a clean result."
951
+ return 0
952
+ fi
953
+
954
+ # Likewise for the other side of the comparison: zero rulesets read and a
955
+ # repository with nothing required look identical from here.
956
+ local -a ids=()
957
+ if [[ -n "$rulesets" ]]; then
958
+ while IFS= read -r id; do
959
+ [[ -n "$id" ]] && ids+=("$id")
960
+ done < <(echo "$rulesets" | jq -r '.[].id // empty')
961
+ fi
962
+ if [[ ${#ids[@]} -eq 0 ]]; then
963
+ log_warning "No rulesets were readable — retired required contexts were NOT checked. This is not a clean result."
964
+ return 0
965
+ fi
966
+
967
+ # The LIST endpoint answers with summaries: id, name, enforcement — and no
968
+ # `rules`. A sweep run over the list would therefore find nothing on every
969
+ # repository, always, and report it as clean. Each ruleset's required checks
970
+ # only exist on its detail payload, so each one is fetched, and a detail this
971
+ # run could not read is stated rather than skipped.
972
+ local details="[]"
973
+ local id detail
974
+ for id in "${ids[@]}"; do
975
+ if ! detail=$(gh api -X GET "repos/$repo/rulesets/$id" 2>/dev/null); then
976
+ log_warning "Ruleset $id could not be read — retired required contexts were NOT checked for it. This is not a clean result."
977
+ continue
978
+ fi
979
+ details=$(jq -c -n --argjson all "$details" --argjson one "$detail" '$all + [$one]')
980
+ done
981
+
982
+ # Matched on the retired LABEL as the final context segment, never on the
983
+ # whole context string. A check run's reported name is the `/`-joined chain
984
+ # of the JOB names reaching it, and the depth varies with nesting: the same
985
+ # gate posts "<quality workflow> / <label>" on the pull-request path and
986
+ # "Release / <quality workflow> / <label>" on the release path. The registry
987
+ # renders one default chain, so comparing whole strings would find the
988
+ # pull-request spelling and walk straight past the release one — omitting a
989
+ # retired required context, which is the exact defect #3067 exists to
990
+ # detect, surviving inside the detector.
991
+ #
992
+ # Matching the leaf is not a loosening. A retired label is a name Lisa's own
993
+ # registry records that Lisa renamed away, so NO chain posts it any more —
994
+ # a ruleset requiring it under any prefix is red-walled just the same. The
995
+ # chain the ruleset actually pins is carried through into the replacement,
996
+ # so the operator is told to require the new name under the same caller
997
+ # chain they already wrote, not under the default one.
998
+ local hits
999
+ hits=$(jq -r -n --argjson live "$details" --argjson retired "$retired" '
1000
+ ($retired | map({key: .label, value: .}) | from_entries) as $dead
1001
+ | [ $live[]
1002
+ | .name as $ruleset
1003
+ | (.rules // [])[]
1004
+ | select(.type == "required_status_checks")
1005
+ | (.parameters.required_status_checks // [])[]
1006
+ | .context as $context
1007
+ | ($context | split(" / ")) as $chain
1008
+ | ($chain | last) as $label
1009
+ | select($dead[$label] != null)
1010
+ | (($chain[0:-1] + [$dead[$label].replacementLabel]) | join(" / ")) as $replacement
1011
+ | "\($ruleset)\t\($context)\t\($replacement)\t\($dead[$label].gate)"
1012
+ ] | unique | .[]')
1013
+
1014
+ if [[ -z "$hits" ]]; then
1015
+ log_verbose "No ruleset requires a context Lisa retired."
1016
+ return 0
1017
+ fi
1018
+
1019
+ echo ""
1020
+ log_warning "RETIRED REQUIRED CONTEXTS — these can NEVER report, and every pull request in this repository is waiting on them:"
1021
+ while IFS=$'\t' read -r ruleset context replacement gate; do
1022
+ [[ -n "$context" ]] || continue
1023
+ echo " ruleset '$ruleset' requires: $context"
1024
+ echo " Lisa renamed the '$gate' job; it posts \"$replacement\" now."
1025
+ echo " Not a failing check — GitHub waits on it forever, so there is no red tick and no log."
1026
+ done <<< "$hits"
1027
+ echo ""
1028
+ echo " Lisa does NOT edit a ruleset it does not manage, so nothing above was changed."
1029
+ echo " A rename is a three-step sequence and only this order is safe at every point:"
1030
+ echo " 1. remove the OLD context from every ruleset naming it"
1031
+ echo " 2. merge the change that makes the job post the NEW name"
1032
+ echo " 3. add the NEW context as required"
1033
+ echo " Doing (3) before (2) creates the same permanent wait in the other direction."
1034
+ echo ""
1035
+ }
1036
+
904
1037
  main() {
905
1038
  # Parse arguments
906
1039
  while [[ $# -gt 0 ]]; do
@@ -1038,6 +1171,11 @@ main() {
1038
1171
  fi
1039
1172
  done
1040
1173
 
1174
+ # Runs whatever the apply did, dry-run included. The retired name lives in a
1175
+ # ruleset the apply above never touched, so an apply that "succeeded" is
1176
+ # exactly the run that most needs to say this.
1177
+ report_retired_contexts "$repo" "$existing_rulesets"
1178
+
1041
1179
  echo ""
1042
1180
  if [[ "$DRY_RUN" == "true" ]]; then
1043
1181
  log_info "Dry run complete. ${#templates[@]} ruleset(s) would be applied."