@codyswann/lisa 4.21.5 → 4.22.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 (130) hide show
  1. package/all/copy-overwrite/scripts/lisa-environment-prepare.mjs +28 -12
  2. package/dist/cli/doctor-nightly-e2e-guard-command-files.d.ts +19 -0
  3. package/dist/cli/doctor-nightly-e2e-guard-command-files.d.ts.map +1 -0
  4. package/dist/cli/doctor-nightly-e2e-guard-command-files.js +221 -0
  5. package/dist/cli/doctor-nightly-e2e-guard-command-files.js.map +1 -0
  6. package/dist/cli/doctor-nightly-e2e-guard-contract.d.ts +113 -0
  7. package/dist/cli/doctor-nightly-e2e-guard-contract.d.ts.map +1 -0
  8. package/dist/cli/doctor-nightly-e2e-guard-contract.js +87 -0
  9. package/dist/cli/doctor-nightly-e2e-guard-contract.js.map +1 -0
  10. package/dist/cli/doctor-nightly-e2e-guard-deadline.d.ts +61 -0
  11. package/dist/cli/doctor-nightly-e2e-guard-deadline.d.ts.map +1 -0
  12. package/dist/cli/doctor-nightly-e2e-guard-deadline.js +97 -0
  13. package/dist/cli/doctor-nightly-e2e-guard-deadline.js.map +1 -0
  14. package/dist/cli/doctor-nightly-e2e-guard-evidence.d.ts +52 -0
  15. package/dist/cli/doctor-nightly-e2e-guard-evidence.d.ts.map +1 -0
  16. package/dist/cli/doctor-nightly-e2e-guard-evidence.js +68 -0
  17. package/dist/cli/doctor-nightly-e2e-guard-evidence.js.map +1 -0
  18. package/dist/cli/doctor-nightly-e2e-guard-graph.d.ts +14 -0
  19. package/dist/cli/doctor-nightly-e2e-guard-graph.d.ts.map +1 -0
  20. package/dist/cli/doctor-nightly-e2e-guard-graph.js +130 -0
  21. package/dist/cli/doctor-nightly-e2e-guard-graph.js.map +1 -0
  22. package/dist/cli/doctor-nightly-e2e-guard-io.d.ts +41 -0
  23. package/dist/cli/doctor-nightly-e2e-guard-io.d.ts.map +1 -0
  24. package/dist/cli/doctor-nightly-e2e-guard-io.js +239 -0
  25. package/dist/cli/doctor-nightly-e2e-guard-io.js.map +1 -0
  26. package/dist/cli/doctor-nightly-e2e-guard-job.d.ts +31 -0
  27. package/dist/cli/doctor-nightly-e2e-guard-job.d.ts.map +1 -0
  28. package/dist/cli/doctor-nightly-e2e-guard-job.js +156 -0
  29. package/dist/cli/doctor-nightly-e2e-guard-job.js.map +1 -0
  30. package/dist/cli/doctor-nightly-e2e-guard-proof.d.ts +42 -0
  31. package/dist/cli/doctor-nightly-e2e-guard-proof.d.ts.map +1 -0
  32. package/dist/cli/doctor-nightly-e2e-guard-proof.js +57 -0
  33. package/dist/cli/doctor-nightly-e2e-guard-proof.js.map +1 -0
  34. package/dist/cli/doctor-nightly-e2e-guard-remediation.d.ts +32 -0
  35. package/dist/cli/doctor-nightly-e2e-guard-remediation.d.ts.map +1 -0
  36. package/dist/cli/doctor-nightly-e2e-guard-remediation.js +55 -0
  37. package/dist/cli/doctor-nightly-e2e-guard-remediation.js.map +1 -0
  38. package/dist/cli/doctor-nightly-e2e-guard-runtime.d.ts +34 -0
  39. package/dist/cli/doctor-nightly-e2e-guard-runtime.d.ts.map +1 -0
  40. package/dist/cli/doctor-nightly-e2e-guard-runtime.js +93 -0
  41. package/dist/cli/doctor-nightly-e2e-guard-runtime.js.map +1 -0
  42. package/dist/cli/doctor-nightly-e2e-guard-scan.d.ts +17 -0
  43. package/dist/cli/doctor-nightly-e2e-guard-scan.d.ts.map +1 -0
  44. package/dist/cli/doctor-nightly-e2e-guard-scan.js +86 -0
  45. package/dist/cli/doctor-nightly-e2e-guard-scan.js.map +1 -0
  46. package/dist/cli/doctor-nightly-e2e-guard-shell-lexer.d.ts +38 -0
  47. package/dist/cli/doctor-nightly-e2e-guard-shell-lexer.d.ts.map +1 -0
  48. package/dist/cli/doctor-nightly-e2e-guard-shell-lexer.js +160 -0
  49. package/dist/cli/doctor-nightly-e2e-guard-shell-lexer.js.map +1 -0
  50. package/dist/cli/doctor-nightly-e2e-guard-shell.d.ts +40 -0
  51. package/dist/cli/doctor-nightly-e2e-guard-shell.d.ts.map +1 -0
  52. package/dist/cli/doctor-nightly-e2e-guard-shell.js +201 -0
  53. package/dist/cli/doctor-nightly-e2e-guard-shell.js.map +1 -0
  54. package/dist/cli/doctor-nightly-e2e-guard.d.ts +36 -0
  55. package/dist/cli/doctor-nightly-e2e-guard.d.ts.map +1 -0
  56. package/dist/cli/doctor-nightly-e2e-guard.js +186 -0
  57. package/dist/cli/doctor-nightly-e2e-guard.js.map +1 -0
  58. package/dist/cli/doctor.d.ts.map +1 -1
  59. package/dist/cli/doctor.js +7 -0
  60. package/dist/cli/doctor.js.map +1 -1
  61. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  62. package/dist/core/lisa-owned-hash-ledger.js +2 -0
  63. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  64. package/dist/core/nightly-e2e-guard-behavior-certificate.d.ts +25 -0
  65. package/dist/core/nightly-e2e-guard-behavior-certificate.d.ts.map +1 -0
  66. package/dist/core/nightly-e2e-guard-behavior-certificate.js +30 -0
  67. package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -0
  68. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  69. package/dist/core/upstream-evidence-manifest.js +32 -5
  70. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  71. package/dist/migrations/ensure-playwright-dedicated-caller.d.ts +0 -2
  72. package/dist/migrations/ensure-playwright-dedicated-caller.d.ts.map +1 -1
  73. package/dist/migrations/ensure-playwright-dedicated-caller.js +12 -40
  74. package/dist/migrations/ensure-playwright-dedicated-caller.js.map +1 -1
  75. package/expo/create-only/.github/workflows/maestro-e2e.yml +6 -0
  76. package/expo/create-only/.github/workflows/playwright-e2e.yml +5 -5
  77. package/package.json +5 -3
  78. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  80. package/plugins/lisa-agy/plugin.json +1 -1
  81. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  83. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  84. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  90. package/plugins/lisa-expo-agy/plugin.json +1 -1
  91. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  95. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  96. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  100. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  101. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  102. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  103. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  105. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  106. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  110. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  111. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  115. package/plugins/lisa-rails-agy/plugin.json +1 -1
  116. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  117. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  118. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  120. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  121. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  122. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  123. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  124. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  125. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  126. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  127. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  128. package/scripts/check-derived-artifacts.mjs +32 -5
  129. package/scripts/generate-nightly-e2e-guard-certificate.mjs +370 -0
  130. package/scripts/two-channel-couplings.json +16 -4
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @file doctor-nightly-e2e-guard-remediation.ts
3
+ * @description Provenance-aware repair guidance for nightly guard findings
4
+ * @module cli/doctor-nightly-e2e-guard-remediation
5
+ */
6
+ import { classifyHostCopy, } from "../core/lisa-owned-provenance.js";
7
+ import { LISA_OWNED_HASH_LEDGER } from "../core/lisa-owned-hash-ledger.js";
8
+ import { NIGHTLY_E2E_GUARD_BEHAVIOR_CERTIFICATES } from "../core/nightly-e2e-guard-behavior-certificate.js";
9
+ import { MAX_NIGHTLY_GUARD_FILE_BYTES, NIGHTLY_GUARD_CANONICAL_TARGET, NIGHTLY_GUARD_SHIPPED_TARGET, } from "./doctor-nightly-e2e-guard-contract.js";
10
+ import { readNightlyGuardFile } from "./doctor-nightly-e2e-guard-io.js";
11
+ import { digestNightlyGuardBytes, } from "./doctor-nightly-e2e-guard-proof.js";
12
+ const exactProbe = (target) => `node ${target} --contract-version`;
13
+ const preserveContext = "preserve the workflow/job names and required-check context unless a coordinated ruleset migration is planned";
14
+ const packageUnavailable = (reason) => `repair or reinstall Lisa first: its packaged guard is unreadable or corrupt (${reason}); then run \`lisa apply .\` and \`${exactProbe(NIGHTLY_GUARD_CANONICAL_TARGET)}\``;
15
+ const packageUncertified = (reason) => `upgrade or reinstall Lisa first: its packaged guard is not behavior-certified (${reason}); then run \`lisa apply .\` and \`${exactProbe(NIGHTLY_GUARD_CANONICAL_TARGET)}\``;
16
+ /**
17
+ * Produce exact repair guidance without collapsing missing, unreadable, stale,
18
+ * and deliberately modified files into the same destructive instruction.
19
+ * @param input - Caller, package, provenance, and deadline context
20
+ * @returns One bounded operator-readable remediation
21
+ */
22
+ export async function nightlyGuardRemediation(input) {
23
+ const shipped = await readNightlyGuardFile(input.lisaRoot, NIGHTLY_GUARD_SHIPPED_TARGET, MAX_NIGHTLY_GUARD_FILE_BYTES, input.deadline);
24
+ if (shipped.state === "missing") {
25
+ return `upgrade first: install Lisa 2.353.0+ on 2.x or, preferably, the current release; then run \`lisa apply .\` and \`${exactProbe(NIGHTLY_GUARD_CANONICAL_TARGET)}\``;
26
+ }
27
+ if (shipped.state === "unavailable") {
28
+ return packageUnavailable(shipped.reason);
29
+ }
30
+ const shippedDigest = digestNightlyGuardBytes(shipped.bytes);
31
+ const certificates = input.certificates ?? NIGHTLY_E2E_GUARD_BEHAVIOR_CERTIFICATES;
32
+ if (certificates[shippedDigest] === undefined) {
33
+ return packageUncertified("its exact bytes are absent from this release's nightly guard behavior certificate; a generic ownership hash is insufficient");
34
+ }
35
+ const ledger = input.ledger ?? LISA_OWNED_HASH_LEDGER;
36
+ if (input.caller.target !== NIGHTLY_GUARD_CANONICAL_TARGET) {
37
+ return `install ${NIGHTLY_GUARD_CANONICAL_TARGET} with \`lisa apply .\`, repoint this job to it, retire ${input.caller.target}, then run \`${exactProbe(NIGHTLY_GUARD_CANONICAL_TARGET)}\`; ${preserveContext}`;
38
+ }
39
+ const host = await readNightlyGuardFile(input.projectRoot, NIGHTLY_GUARD_CANONICAL_TARGET, MAX_NIGHTLY_GUARD_FILE_BYTES, input.deadline);
40
+ if (host.state === "missing") {
41
+ return `run \`lisa apply .\` to install ${NIGHTLY_GUARD_CANONICAL_TARGET}, then run \`${exactProbe(NIGHTLY_GUARD_CANONICAL_TARGET)}\``;
42
+ }
43
+ if (host.state === "unavailable") {
44
+ return `repair the canonical host path before applying: ${host.reason}; no file was replaced`;
45
+ }
46
+ const verdict = classifyHostCopy(NIGHTLY_GUARD_CANONICAL_TARGET, host.bytes, shipped.bytes, ledger);
47
+ if (verdict.kind === "identical") {
48
+ return `the failing target is the byte-identical packaged copy; repair, reinstall, or upgrade Lisa, re-run \`lisa apply .\`, then run \`${exactProbe(NIGHTLY_GUARD_CANONICAL_TARGET)}\``;
49
+ }
50
+ if (verdict.kind === "provably-stale") {
51
+ return `this canonical copy is provably stale; run \`lisa apply .\`, then run \`${exactProbe(NIGHTLY_GUARD_CANONICAL_TARGET)}\``;
52
+ }
53
+ return `review the preserved modified canonical guard, then take Lisa's exact copy with \`lisa apply . --refresh-templates=${NIGHTLY_GUARD_CANONICAL_TARGET}\` and run \`${exactProbe(NIGHTLY_GUARD_CANONICAL_TARGET)}\``;
54
+ }
55
+ //# sourceMappingURL=doctor-nightly-e2e-guard-remediation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-remediation.js","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-remediation.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I,CAAC;IACD,OAAO,sHAAsH,8BAA8B,gBAAgB,UAAU,CAAC,8BAA8B,CAAC,IAAI,CAAC;AAC5N,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @file doctor-nightly-e2e-guard-runtime.ts
3
+ * @description Proven shell and environment constraints for static guard calls
4
+ * @module cli/doctor-nightly-e2e-guard-runtime
5
+ */
6
+ /** Metadata whose exact values decide whether POSIX parsing is sound. */
7
+ export interface NightlyGuardRuntimeContext {
8
+ /** Highest-precedence workflow/job/step shell declaration, when present. */
9
+ readonly shell: unknown;
10
+ /** Job runner label used only when no shell is explicitly declared. */
11
+ readonly runsOn: unknown;
12
+ /** Fully merged workflow/job/step environment visible to the command. */
13
+ readonly environment: Readonly<Record<string, unknown>>;
14
+ }
15
+ /**
16
+ * Identify environment controls that can replace or alter Node/shell execution.
17
+ * @param name - Case-sensitive process environment name from YAML or shell
18
+ * @returns Whether the name can change how the certified bytes are executed
19
+ */
20
+ export declare const isExecutionChangingEnvironmentName: (name: string) => boolean;
21
+ /**
22
+ * Refuse an effective environment that can turn exact bytes into false proof.
23
+ * @param environment - Merged environment after YAML precedence is applied
24
+ * @returns A bounded refusal naming the first dangerous control, when present
25
+ */
26
+ export declare const nightlyGuardEnvironmentFailure: (environment: Readonly<Record<string, unknown>>) => string | undefined;
27
+ /**
28
+ * Require either a finite safe shell template or an exact hosted runner label.
29
+ * @param run - YAML-decoded command; empty steps need no shell inference
30
+ * @param context - Effective shell, runner, and merged environment metadata
31
+ * @returns Why static POSIX execution is unproved, or undefined when proved
32
+ */
33
+ export declare const nightlyGuardPosixContextFailure: (run: string, context: NightlyGuardRuntimeContext) => string | undefined;
34
+ //# sourceMappingURL=doctor-nightly-e2e-guard-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-runtime.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmDH,yEAAyE;AACzE,MAAM,WAAW,0BAA0B;IACzC,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACzD;AAED;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,GAAI,MAAM,MAAM,KAAG,OAEM,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GACzC,aAAa,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAC7C,MAAM,GAAG,SAOX,CAAC;AAKF;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,GAC1C,KAAK,MAAM,EACX,SAAS,0BAA0B,KAClC,MAAM,GAAG,SAeX,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * @file doctor-nightly-e2e-guard-runtime.ts
3
+ * @description Proven shell and environment constraints for static guard calls
4
+ * @module cli/doctor-nightly-e2e-guard-runtime
5
+ */
6
+ const EXECUTION_ENVIRONMENT_NAMES = new Set([
7
+ "BASHOPTS",
8
+ "BASH_ENV",
9
+ "CDPATH",
10
+ "ENV",
11
+ "GLOBIGNORE",
12
+ "IFS",
13
+ "PATH",
14
+ "POSIXLY_CORRECT",
15
+ "SHELLOPTS",
16
+ ]);
17
+ const EXECUTION_ENVIRONMENT_PREFIXES = [
18
+ "BASH_FUNC_",
19
+ "DYLD_",
20
+ "LD_",
21
+ "NIX_LD",
22
+ "NODE_",
23
+ ];
24
+ const GITHUB_HOSTED_POSIX_RUNNER = /^(?:ubuntu-(?:latest|24\.04|22\.04|20\.04)|macos-(?:latest|15|14|13))$/u;
25
+ const EXECUTION_PRESERVING_SHELLS = new Set([
26
+ "bash",
27
+ "bash {0}",
28
+ "bash -e {0}",
29
+ "bash -eo pipefail {0}",
30
+ "bash --noprofile --norc -eo pipefail {0}",
31
+ "sh",
32
+ "sh {0}",
33
+ "sh -e {0}",
34
+ "/bin/bash",
35
+ "/bin/bash {0}",
36
+ "/bin/bash -e {0}",
37
+ "/bin/bash -eo pipefail {0}",
38
+ "/bin/bash --noprofile --norc -eo pipefail {0}",
39
+ "/usr/bin/bash",
40
+ "/usr/bin/bash {0}",
41
+ "/usr/bin/bash -e {0}",
42
+ "/usr/bin/bash -eo pipefail {0}",
43
+ "/usr/bin/bash --noprofile --norc -eo pipefail {0}",
44
+ "/bin/sh",
45
+ "/bin/sh {0}",
46
+ "/bin/sh -e {0}",
47
+ "/usr/bin/sh",
48
+ "/usr/bin/sh {0}",
49
+ "/usr/bin/sh -e {0}",
50
+ ]);
51
+ /**
52
+ * Identify environment controls that can replace or alter Node/shell execution.
53
+ * @param name - Case-sensitive process environment name from YAML or shell
54
+ * @returns Whether the name can change how the certified bytes are executed
55
+ */
56
+ export const isExecutionChangingEnvironmentName = (name) => EXECUTION_ENVIRONMENT_NAMES.has(name) ||
57
+ EXECUTION_ENVIRONMENT_PREFIXES.some(prefix => name.startsWith(prefix));
58
+ /**
59
+ * Refuse an effective environment that can turn exact bytes into false proof.
60
+ * @param environment - Merged environment after YAML precedence is applied
61
+ * @returns A bounded refusal naming the first dangerous control, when present
62
+ */
63
+ export const nightlyGuardEnvironmentFailure = (environment) => {
64
+ const unsafe = Object.keys(environment)
65
+ .sort((left, right) => left.localeCompare(right))
66
+ .find(isExecutionChangingEnvironmentName);
67
+ return unsafe
68
+ ? `${unsafe} environment control can change or replace certified guard execution`
69
+ : undefined;
70
+ };
71
+ const normalizedShell = (shell) => shell.trim().split(/\s+/u).join(" ");
72
+ /**
73
+ * Require either a finite safe shell template or an exact hosted runner label.
74
+ * @param run - YAML-decoded command; empty steps need no shell inference
75
+ * @param context - Effective shell, runner, and merged environment metadata
76
+ * @returns Why static POSIX execution is unproved, or undefined when proved
77
+ */
78
+ export const nightlyGuardPosixContextFailure = (run, context) => {
79
+ if (run.trim().length === 0)
80
+ return undefined;
81
+ if (context.shell !== undefined) {
82
+ return typeof context.shell === "string" &&
83
+ EXECUTION_PRESERVING_SHELLS.has(normalizedShell(context.shell))
84
+ ? undefined
85
+ : "step shell is unknown, non-POSIX, or not an execution-preserving bash/sh template";
86
+ }
87
+ if (typeof context.runsOn !== "string" ||
88
+ !GITHUB_HOSTED_POSIX_RUNNER.test(context.runsOn)) {
89
+ return "runner is self-hosted, array-valued, custom, dynamic, or unknown; an explicit supported POSIX shell is required";
90
+ }
91
+ return undefined;
92
+ };
93
+ //# sourceMappingURL=doctor-nightly-e2e-guard-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-runtime.js","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC;IAC1C,UAAU;IACV,UAAU;IACV,QAAQ;IACR,KAAK;IACL,YAAY;IACZ,KAAK;IACL,MAAM;IACN,iBAAiB;IACjB,WAAW;CACZ,CAAC,CAAC;AACH,MAAM,8BAA8B,GAAG;IACrC,YAAY;IACZ,OAAO;IACP,KAAK;IACL,QAAQ;IACR,OAAO;CACR,CAAC;AAEF,MAAM,0BAA0B,GAC9B,yEAAyE,CAAC;AAE5E,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC;IAC1C,MAAM;IACN,UAAU;IACV,aAAa;IACb,uBAAuB;IACvB,0CAA0C;IAC1C,IAAI;IACJ,QAAQ;IACR,WAAW;IACX,WAAW;IACX,eAAe;IACf,kBAAkB;IAClB,4BAA4B;IAC5B,+CAA+C;IAC/C,eAAe;IACf,mBAAmB;IACnB,sBAAsB;IACtB,gCAAgC;IAChC,mDAAmD;IACnD,SAAS;IACT,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,iBAAiB;IACjB,oBAAoB;CACrB,CAAC,CAAC;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AClC,CAAC,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAChD,CAAC;QACD,OAAO,iHAAiH,CAAC;IAC3H,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { MAX_NIGHTLY_GUARD_CALLERS, MAX_NIGHTLY_GUARD_FILES, MAX_NIGHTLY_GUARD_TARGETS, type NightlyGuardScanResult } from "./doctor-nightly-e2e-guard-contract.js";
2
+ import { type NightlyGuardDeadline } from "./doctor-nightly-e2e-guard-deadline.js";
3
+ export { MAX_NIGHTLY_GUARD_CALLERS, MAX_NIGHTLY_GUARD_FILES, MAX_NIGHTLY_GUARD_TARGETS, };
4
+ export type { NightlyGuardCaller, NightlyGuardScanFailure, NightlyGuardScanResult, } from "./doctor-nightly-e2e-guard-contract.js";
5
+ /** Optional shared deadline used by the top-level doctor operation. */
6
+ export interface NightlyGuardScanDependencies {
7
+ /** Deadline started before discovery; standalone scans receive their own. */
8
+ readonly deadline?: NightlyGuardDeadline;
9
+ }
10
+ /**
11
+ * Discover every bypass-bearing guard caller reachable from repository events.
12
+ * @param projectRoot - Project root whose workflow tree is inspected
13
+ * @param dependencies - Shared deadline when called by doctor
14
+ * @returns Deterministic callers, or an explicit unavailable refusal
15
+ */
16
+ export declare function scanNightlyE2eGuardCallers(projectRoot: string, dependencies?: NightlyGuardScanDependencies): Promise<NightlyGuardScanResult>;
17
+ //# sourceMappingURL=doctor-nightly-e2e-guard-scan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-scan.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-scan.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,yBAAyB,EAEzB,uBAAuB,EACvB,yBAAyB,EAKzB,KAAK,sBAAsB,EAI5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,wCAAwC,CAAC;AAOhD,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,GAC1B,CAAC;AACF,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAEhD,uEAAuE;AACvE,MAAM,WAAW,4BAA4B;IAC3C,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CAC1C;AA6GD;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,YAAY,GAAE,4BAAiC,GAC9C,OAAO,CAAC,sBAAsB,CAAC,CAQjC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * @file doctor-nightly-e2e-guard-scan.ts
3
+ * @description Bounded executable-YAML discovery for nightly bypass callers
4
+ * @module cli/doctor-nightly-e2e-guard-scan
5
+ */
6
+ import { loadYaml } from "../utils/yaml.js";
7
+ import { MAX_NIGHTLY_GUARD_CALLERS, MAX_NIGHTLY_GUARD_FILE_BYTES, MAX_NIGHTLY_GUARD_FILES, MAX_NIGHTLY_GUARD_TARGETS, MAX_NIGHTLY_GUARD_TOTAL_BYTES, MAX_NIGHTLY_GUARD_WORKFLOW_ID_BYTES, NIGHTLY_GUARD_OPERATION_TIMEOUT_MS, NIGHTLY_GUARD_WORKFLOWS, nightlyGuardObject, orderNightlyGuardStrings, } from "./doctor-nightly-e2e-guard-contract.js";
8
+ import { createNightlyGuardDeadline, } from "./doctor-nightly-e2e-guard-deadline.js";
9
+ import { traceNightlyGuardCallers } from "./doctor-nightly-e2e-guard-graph.js";
10
+ import { readNightlyGuardDirectory, readNightlyGuardFile, } from "./doctor-nightly-e2e-guard-io.js";
11
+ export { MAX_NIGHTLY_GUARD_CALLERS, MAX_NIGHTLY_GUARD_FILES, MAX_NIGHTLY_GUARD_TARGETS, };
12
+ const unavailable = (workflow, reason) => ({
13
+ state: "unavailable",
14
+ failures: [{ workflow, reason }],
15
+ });
16
+ const parseWorkflow = (file, name, source) => {
17
+ try {
18
+ const document = nightlyGuardObject(loadYaml(source.toString("utf8")));
19
+ return document
20
+ ? { file, name, document }
21
+ : unavailable(file, "workflow YAML root is not a mapping");
22
+ }
23
+ catch (error) {
24
+ return unavailable(file, `workflow is unreadable or malformed (${error instanceof Error ? error.message : String(error)})`);
25
+ }
26
+ };
27
+ const isScanResult = (value) => "state" in value;
28
+ const hasControlCharacter = (value) => [...value].some(character => {
29
+ const codePoint = character.codePointAt(0) ?? 0;
30
+ return codePoint <= 31 || codePoint === 127;
31
+ });
32
+ /**
33
+ * Read the bounded workflow inventory without following path components.
34
+ * @param projectRoot - Project containment root
35
+ * @param deadline - Whole-operation deadline already started by doctor
36
+ * @returns Parsed inventory or an explicit availability refusal
37
+ */
38
+ async function readWorkflowRecords(projectRoot, deadline) {
39
+ const directory = await readNightlyGuardDirectory(projectRoot, NIGHTLY_GUARD_WORKFLOWS, deadline);
40
+ if (directory.state === "missing")
41
+ return [];
42
+ if (directory.state === "unavailable") {
43
+ return unavailable(NIGHTLY_GUARD_WORKFLOWS, directory.reason);
44
+ }
45
+ const names = orderNightlyGuardStrings(directory.names.filter(name => /\.ya?ml$/u.test(name)));
46
+ if (names.some(name => Buffer.byteLength(name) > MAX_NIGHTLY_GUARD_WORKFLOW_ID_BYTES ||
47
+ hasControlCharacter(name))) {
48
+ return unavailable(NIGHTLY_GUARD_WORKFLOWS, `workflow identifier exceeds the ${MAX_NIGHTLY_GUARD_WORKFLOW_ID_BYTES}-byte/control-character limit`);
49
+ }
50
+ if (names.length > MAX_NIGHTLY_GUARD_FILES) {
51
+ return unavailable(NIGHTLY_GUARD_WORKFLOWS, `workflow file limit ${MAX_NIGHTLY_GUARD_FILES} exceeded`);
52
+ }
53
+ const readNext = async (index, totalBytes, records) => {
54
+ const name = names[index];
55
+ if (name === undefined)
56
+ return records;
57
+ const file = `${NIGHTLY_GUARD_WORKFLOWS}/${name}`;
58
+ const read = await readNightlyGuardFile(projectRoot, file, MAX_NIGHTLY_GUARD_FILE_BYTES, deadline);
59
+ if (read.state !== "ok")
60
+ return unavailable(file, read.reason);
61
+ const nextTotal = totalBytes + read.bytes.length;
62
+ if (nextTotal > MAX_NIGHTLY_GUARD_TOTAL_BYTES) {
63
+ return unavailable(file, "workflow scan exceeds the 8 MiB total limit");
64
+ }
65
+ const parsed = parseWorkflow(file, name, read.bytes);
66
+ return isScanResult(parsed)
67
+ ? parsed
68
+ : await readNext(index + 1, nextTotal, [...records, parsed]);
69
+ };
70
+ return await readNext(0, 0, []);
71
+ }
72
+ /**
73
+ * Discover every bypass-bearing guard caller reachable from repository events.
74
+ * @param projectRoot - Project root whose workflow tree is inspected
75
+ * @param dependencies - Shared deadline when called by doctor
76
+ * @returns Deterministic callers, or an explicit unavailable refusal
77
+ */
78
+ export async function scanNightlyE2eGuardCallers(projectRoot, dependencies = {}) {
79
+ const deadline = dependencies.deadline ??
80
+ createNightlyGuardDeadline(undefined, NIGHTLY_GUARD_OPERATION_TIMEOUT_MS);
81
+ const records = await readWorkflowRecords(projectRoot, deadline);
82
+ return Array.isArray(records)
83
+ ? traceNightlyGuardCallers(records)
84
+ : records;
85
+ }
86
+ //# sourceMappingURL=doctor-nightly-e2e-guard-scan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-scan.js","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-scan.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,6BAA6B,EAC7B,mCAAmC,EACnC,kCAAkC,EAClC,uBAAuB,EAGvB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,0BAA0B,GAE3B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCA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ctor-nightly-e2e-guard-shell-lexer
5
+ */
6
+ /** How a shell word acquired its bytes. */
7
+ type QuoteKind = "unquoted" | "single" | "double" | "mixed";
8
+ /** One decoded shell word retained by the supported grammar. */
9
+ export interface ShellWord {
10
+ readonly kind: "word";
11
+ readonly value: string;
12
+ readonly quote: QuoteKind;
13
+ /** Shell expansion or unquoted glob syntax prevents exact byte proof. */
14
+ readonly dynamic: boolean;
15
+ }
16
+ /** One command separator or unsupported shell operator. */
17
+ interface ShellOperator {
18
+ readonly kind: "operator";
19
+ readonly value: string;
20
+ }
21
+ /** Bounded lexical token used only by the static interpreter. */
22
+ export type ShellToken = ShellWord | ShellOperator;
23
+ /** Result of lexing one YAML-decoded run scalar. */
24
+ export interface ShellLexResult {
25
+ readonly tokens?: readonly ShellToken[];
26
+ readonly reason?: string;
27
+ }
28
+ /**
29
+ * Lex shell words/operators while applying POSIX comment boundaries.
30
+ *
31
+ * `#` begins a comment only outside quotes at the start of a word. The scan is
32
+ * bounded by the 1 MiB workflow read and a 64-token grammar ceiling.
33
+ * @param source - YAML-decoded run scalar
34
+ * @returns Tokens or one fail-closed grammar reason
35
+ */
36
+ export declare function lexNightlyGuardRun(source: string): ShellLexResult;
37
+ export {};
38
+ //# sourceMappingURL=doctor-nightly-e2e-guard-shell-lexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-shell-lexer.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-shell-lexer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,2CAA2C;AAC3C,KAAK,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,2DAA2D;AAC3D,UAAU,aAAa;IACrB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,CAAC;AAcnD,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AA2KD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAoBjE"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * @file doctor-nightly-e2e-guard-shell-lexer.ts
3
+ * @description Bounded comment-aware lexer for the supported guard run grammar
4
+ * @module cli/doctor-nightly-e2e-guard-shell-lexer
5
+ */
6
+ const MAX_SHELL_TOKENS = 64;
7
+ const QUOTE_CHARACTERS = ["'", '"'];
8
+ const HORIZONTAL_WHITESPACE = [" ", "\t", "\r"];
9
+ const COMMAND_BOUNDARIES = ["\n", ";"];
10
+ const SHELL_OPERATORS = [">", "<", "&", "|", "(", ")"];
11
+ const quoteFor = (mask) => {
12
+ if (mask === 2)
13
+ return "single";
14
+ if (mask === 4)
15
+ return "double";
16
+ if (mask === 0 || mask === 1)
17
+ return "unquoted";
18
+ return "mixed";
19
+ };
20
+ const withToken = (state, token) => state.tokens.length >= MAX_SHELL_TOKENS
21
+ ? {
22
+ ...state,
23
+ error: `shell token limit ${MAX_SHELL_TOKENS} exceeded`,
24
+ }
25
+ : { ...state, tokens: [...state.tokens, token] };
26
+ const flushWord = (state) => state.word.length === 0
27
+ ? state
28
+ : withToken({ ...state, word: "", quoteMask: 0, dynamic: false }, {
29
+ kind: "word",
30
+ value: state.word,
31
+ quote: quoteFor(state.quoteMask),
32
+ dynamic: state.dynamic,
33
+ });
34
+ const withOperator = (state, value) => withToken(flushWord(state), { kind: "operator", value });
35
+ const withoutQuote = (state) => ({
36
+ tokens: state.tokens,
37
+ word: state.word,
38
+ quoteMask: state.quoteMask,
39
+ dynamic: state.dynamic,
40
+ comment: state.comment,
41
+ skipNext: state.skipNext,
42
+ ...(state.error ? { error: state.error } : {}),
43
+ });
44
+ const quotedCharacter = (state, source, character, index) => {
45
+ if ((character === "'" && state.quote === "single") ||
46
+ (character === '"' && state.quote === "double")) {
47
+ return withoutQuote(state);
48
+ }
49
+ if (character !== "\\" || state.quote !== "double") {
50
+ return {
51
+ ...state,
52
+ word: `${state.word}${character}`,
53
+ dynamic: state.dynamic ||
54
+ (state.quote === "double" && ["$", "`"].includes(character)),
55
+ };
56
+ }
57
+ const next = source[index + 1];
58
+ if (next === undefined) {
59
+ return { ...state, error: "unterminated shell escape" };
60
+ }
61
+ if (next === "\n")
62
+ return { ...state, skipNext: true };
63
+ return ["$", "`", '"', "\\"].includes(next)
64
+ ? { ...state, word: `${state.word}${next}`, skipNext: true }
65
+ : { ...state, word: `${state.word}\\` };
66
+ };
67
+ const escapedCharacter = (state, source, index) => {
68
+ const next = source[index + 1];
69
+ if (next === undefined) {
70
+ return { ...state, error: "unterminated shell escape" };
71
+ }
72
+ if (next === "\n")
73
+ return { ...state, skipNext: true };
74
+ return {
75
+ ...state,
76
+ word: `${state.word}${next}`,
77
+ quoteMask: state.quoteMask | 1,
78
+ skipNext: true,
79
+ };
80
+ };
81
+ const quotedStart = (state, character) => {
82
+ const single = character === "'";
83
+ return {
84
+ ...state,
85
+ quote: single ? "single" : "double",
86
+ quoteMask: state.quoteMask | (single ? 2 : 4),
87
+ };
88
+ };
89
+ const ordinaryCharacter = (state, character) => ({
90
+ ...state,
91
+ word: `${state.word}${character}`,
92
+ quoteMask: state.quoteMask | 1,
93
+ dynamic: state.dynamic || ["$", "`", "*", "?", "[", "~", "{"].includes(character),
94
+ });
95
+ const operatorCharacter = (state, source, character, index) => {
96
+ const doubled = source[index + 1] === character;
97
+ return {
98
+ ...withOperator(state, doubled ? `${character}${character}` : character),
99
+ skipNext: doubled,
100
+ };
101
+ };
102
+ const unquotedCharacter = (state, source, character, index) => {
103
+ if (QUOTE_CHARACTERS.includes(character)) {
104
+ return quotedStart(state, character);
105
+ }
106
+ if (character === "\\")
107
+ return escapedCharacter(state, source, index);
108
+ if (character === "#" && state.word.length === 0) {
109
+ return { ...state, comment: true };
110
+ }
111
+ if (HORIZONTAL_WHITESPACE.includes(character))
112
+ return flushWord(state);
113
+ if (COMMAND_BOUNDARIES.includes(character)) {
114
+ return withOperator(state, character);
115
+ }
116
+ return SHELL_OPERATORS.includes(character)
117
+ ? operatorCharacter(state, source, character, index)
118
+ : ordinaryCharacter(state, character);
119
+ };
120
+ const lexCharacter = (state, source, character, index) => {
121
+ if (state.error)
122
+ return state;
123
+ if (state.skipNext)
124
+ return { ...state, skipNext: false };
125
+ if (state.comment) {
126
+ return character === "\n"
127
+ ? { ...withOperator(state, "\n"), comment: false }
128
+ : state;
129
+ }
130
+ return state.quote
131
+ ? quotedCharacter(state, source, character, index)
132
+ : unquotedCharacter(state, source, character, index);
133
+ };
134
+ /**
135
+ * Lex shell words/operators while applying POSIX comment boundaries.
136
+ *
137
+ * `#` begins a comment only outside quotes at the start of a word. The scan is
138
+ * bounded by the 1 MiB workflow read and a 64-token grammar ceiling.
139
+ * @param source - YAML-decoded run scalar
140
+ * @returns Tokens or one fail-closed grammar reason
141
+ */
142
+ export function lexNightlyGuardRun(source) {
143
+ const scanned = source
144
+ .split("")
145
+ .reduce((state, character, index) => lexCharacter(state, source, character, index), {
146
+ tokens: [],
147
+ word: "",
148
+ quoteMask: 0,
149
+ dynamic: false,
150
+ comment: false,
151
+ skipNext: false,
152
+ });
153
+ const completed = flushWord(scanned);
154
+ if (completed.error)
155
+ return { reason: completed.error };
156
+ return completed.quote
157
+ ? { reason: "unterminated shell quote" }
158
+ : { tokens: completed.tokens };
159
+ }
160
+ //# sourceMappingURL=doctor-nightly-e2e-guard-shell-lexer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-shell-lexer.js","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-shell-lexer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACpC,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAChD,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACvC,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAyCvD,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAa,EAAE;IAC3C,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAChC,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAChC,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,UAAU,CAAC;IAChD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAChB,KAAsB,EACtB,KAAiB,EACA,EAAE,CACnB,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,gBAAgB;IACrC,CAAC,CAAC;QACE,GAAG,KAAK;QACR,KAAK,EAAE,qBAAqB,gBAAgB,WAAW;KACxD;IACH,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AAErD,MAAM,SAAS,GAAG,CAAC,KAAsB,EAAmB,EAAE,CAC5D,KAAK,CAAC,IAAI,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+1,40 @@
1
+ import { type NightlyGuardCommandFileWrite } from "./doctor-nightly-e2e-guard-command-files.js";
2
+ import { type NightlyGuardRuntimeContext } from "./doctor-nightly-e2e-guard-runtime.js";
3
+ /** Supported interpretation of one `run` scalar. */
4
+ export interface NightlyGuardRunInspection {
5
+ /** Literal target or an environment-resolution refusal. */
6
+ readonly target?: string;
7
+ /** Any Node token whose command did not fit the supported grammar. */
8
+ readonly reason?: string;
9
+ /** The command is the non-gating contract/report operation. */
10
+ readonly reportingOnly: boolean;
11
+ /** A Node command occurred after comment removal. */
12
+ readonly containsNode: boolean;
13
+ /** Executable shell construction of bypass state. */
14
+ readonly bypassWiring?: "inline environment" | "GITHUB_ENV";
15
+ /** Comment-stripped executable evidence that this step controls bypass. */
16
+ readonly bypassEvidence: boolean;
17
+ /** Ordered command-file effects retained for later guard-step attribution. */
18
+ readonly commandFileWrites?: readonly NightlyGuardCommandFileWrite[];
19
+ }
20
+ /**
21
+ * Compare bypass vocabulary independently of label case and punctuation.
22
+ * @param value - Executable expression or literal environment value
23
+ * @returns Whether the normalized text can denote nightly bypass state
24
+ */
25
+ export declare const hasNightlyBypassReference: (value: string) => boolean;
26
+ /**
27
+ * Match the exact environment names implemented by the shipped guard.
28
+ * @param value - YAML or shell environment name
29
+ * @returns Whether the name is part of the bounded-waiver contract
30
+ */
31
+ export declare const isNightlyBypassEnvironmentName: (value: string) => boolean;
32
+ /**
33
+ * Interpret the supported Node grammar after bounded comment-aware lexing.
34
+ * @param run - YAML-decoded shell scalar
35
+ * @param env - Literal YAML environment levels available to this step
36
+ * @param context - Runner and effective shell metadata proving POSIX semantics
37
+ * @returns Static target/reporting/refusal and bypass-wiring evidence
38
+ */
39
+ export declare function inspectNightlyGuardRun(run: string, env: Readonly<Record<string, string>>, context: NightlyGuardRuntimeContext): NightlyGuardRunInspection;
40
+ //# sourceMappingURL=doctor-nightly-e2e-guard-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-shell.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-shell.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6CAA6C,CAAC;AAMrD,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,uCAAuC,CAAC;AAc/C,oDAAoD;AACpD,MAAM,WAAW,yBAAyB;IACxC,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,qDAAqD;IACrD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,GAAG,YAAY,CAAC;IAC5D,2EAA2E;IAC3E,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,8EAA8E;IAC9E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,4BAA4B,EAAE,CAAC;CACtE;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,KAAG,OAiBzD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GAAI,OAAO,MAAM,KAAG,OACM,CAAC;AAqMtE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACrC,OAAO,EAAE,0BAA0B,GAClC,yBAAyB,CA6B3B"}