@codyswann/lisa 4.21.4 → 4.21.6

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 (126) hide show
  1. package/dist/cli/doctor-nightly-e2e-guard-command-files.d.ts +19 -0
  2. package/dist/cli/doctor-nightly-e2e-guard-command-files.d.ts.map +1 -0
  3. package/dist/cli/doctor-nightly-e2e-guard-command-files.js +221 -0
  4. package/dist/cli/doctor-nightly-e2e-guard-command-files.js.map +1 -0
  5. package/dist/cli/doctor-nightly-e2e-guard-contract.d.ts +113 -0
  6. package/dist/cli/doctor-nightly-e2e-guard-contract.d.ts.map +1 -0
  7. package/dist/cli/doctor-nightly-e2e-guard-contract.js +87 -0
  8. package/dist/cli/doctor-nightly-e2e-guard-contract.js.map +1 -0
  9. package/dist/cli/doctor-nightly-e2e-guard-deadline.d.ts +61 -0
  10. package/dist/cli/doctor-nightly-e2e-guard-deadline.d.ts.map +1 -0
  11. package/dist/cli/doctor-nightly-e2e-guard-deadline.js +97 -0
  12. package/dist/cli/doctor-nightly-e2e-guard-deadline.js.map +1 -0
  13. package/dist/cli/doctor-nightly-e2e-guard-evidence.d.ts +52 -0
  14. package/dist/cli/doctor-nightly-e2e-guard-evidence.d.ts.map +1 -0
  15. package/dist/cli/doctor-nightly-e2e-guard-evidence.js +68 -0
  16. package/dist/cli/doctor-nightly-e2e-guard-evidence.js.map +1 -0
  17. package/dist/cli/doctor-nightly-e2e-guard-graph.d.ts +14 -0
  18. package/dist/cli/doctor-nightly-e2e-guard-graph.d.ts.map +1 -0
  19. package/dist/cli/doctor-nightly-e2e-guard-graph.js +130 -0
  20. package/dist/cli/doctor-nightly-e2e-guard-graph.js.map +1 -0
  21. package/dist/cli/doctor-nightly-e2e-guard-io.d.ts +41 -0
  22. package/dist/cli/doctor-nightly-e2e-guard-io.d.ts.map +1 -0
  23. package/dist/cli/doctor-nightly-e2e-guard-io.js +239 -0
  24. package/dist/cli/doctor-nightly-e2e-guard-io.js.map +1 -0
  25. package/dist/cli/doctor-nightly-e2e-guard-job.d.ts +31 -0
  26. package/dist/cli/doctor-nightly-e2e-guard-job.d.ts.map +1 -0
  27. package/dist/cli/doctor-nightly-e2e-guard-job.js +156 -0
  28. package/dist/cli/doctor-nightly-e2e-guard-job.js.map +1 -0
  29. package/dist/cli/doctor-nightly-e2e-guard-proof.d.ts +42 -0
  30. package/dist/cli/doctor-nightly-e2e-guard-proof.d.ts.map +1 -0
  31. package/dist/cli/doctor-nightly-e2e-guard-proof.js +57 -0
  32. package/dist/cli/doctor-nightly-e2e-guard-proof.js.map +1 -0
  33. package/dist/cli/doctor-nightly-e2e-guard-remediation.d.ts +32 -0
  34. package/dist/cli/doctor-nightly-e2e-guard-remediation.d.ts.map +1 -0
  35. package/dist/cli/doctor-nightly-e2e-guard-remediation.js +55 -0
  36. package/dist/cli/doctor-nightly-e2e-guard-remediation.js.map +1 -0
  37. package/dist/cli/doctor-nightly-e2e-guard-runtime.d.ts +34 -0
  38. package/dist/cli/doctor-nightly-e2e-guard-runtime.d.ts.map +1 -0
  39. package/dist/cli/doctor-nightly-e2e-guard-runtime.js +93 -0
  40. package/dist/cli/doctor-nightly-e2e-guard-runtime.js.map +1 -0
  41. package/dist/cli/doctor-nightly-e2e-guard-scan.d.ts +17 -0
  42. package/dist/cli/doctor-nightly-e2e-guard-scan.d.ts.map +1 -0
  43. package/dist/cli/doctor-nightly-e2e-guard-scan.js +86 -0
  44. package/dist/cli/doctor-nightly-e2e-guard-scan.js.map +1 -0
  45. package/dist/cli/doctor-nightly-e2e-guard-shell-lexer.d.ts +38 -0
  46. package/dist/cli/doctor-nightly-e2e-guard-shell-lexer.d.ts.map +1 -0
  47. package/dist/cli/doctor-nightly-e2e-guard-shell-lexer.js +160 -0
  48. package/dist/cli/doctor-nightly-e2e-guard-shell-lexer.js.map +1 -0
  49. package/dist/cli/doctor-nightly-e2e-guard-shell.d.ts +40 -0
  50. package/dist/cli/doctor-nightly-e2e-guard-shell.d.ts.map +1 -0
  51. package/dist/cli/doctor-nightly-e2e-guard-shell.js +201 -0
  52. package/dist/cli/doctor-nightly-e2e-guard-shell.js.map +1 -0
  53. package/dist/cli/doctor-nightly-e2e-guard.d.ts +36 -0
  54. package/dist/cli/doctor-nightly-e2e-guard.d.ts.map +1 -0
  55. package/dist/cli/doctor-nightly-e2e-guard.js +186 -0
  56. package/dist/cli/doctor-nightly-e2e-guard.js.map +1 -0
  57. package/dist/cli/doctor.d.ts.map +1 -1
  58. package/dist/cli/doctor.js +7 -0
  59. package/dist/cli/doctor.js.map +1 -1
  60. package/dist/core/nightly-e2e-guard-behavior-certificate.d.ts +25 -0
  61. package/dist/core/nightly-e2e-guard-behavior-certificate.d.ts.map +1 -0
  62. package/dist/core/nightly-e2e-guard-behavior-certificate.js +30 -0
  63. package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -0
  64. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  65. package/dist/core/upstream-evidence-manifest.js +30 -3
  66. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  67. package/package.json +5 -3
  68. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +17 -2
  71. package/plugins/lisa/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +17 -2
  72. package/plugins/lisa-agy/plugin.json +1 -1
  73. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +17 -2
  74. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  76. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  77. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +17 -2
  81. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +17 -2
  83. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  85. package/plugins/lisa-expo-agy/plugin.json +1 -1
  86. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  90. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  91. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  95. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  96. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  100. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  101. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  102. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  103. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  105. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  106. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  110. package/plugins/lisa-rails-agy/plugin.json +1 -1
  111. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  115. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  116. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  117. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  118. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  120. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  121. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  122. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  123. package/plugins/src/base/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +17 -2
  124. package/scripts/check-derived-artifacts.mjs +32 -5
  125. package/scripts/generate-nightly-e2e-guard-certificate.mjs +370 -0
  126. package/scripts/two-channel-couplings.json +16 -4
@@ -0,0 +1,19 @@
1
+ /** @file doctor-nightly-e2e-guard-command-files.ts @description Bounded payload-aware interpretation of GitHub command-file writes @module cli/doctor-nightly-e2e-guard-command-files */
2
+ import { type ShellToken } from "./doctor-nightly-e2e-guard-shell-lexer.js";
3
+ declare const GITHUB_COMMAND_FILES: readonly ["GITHUB_ENV", "GITHUB_PATH"];
4
+ /** One statically observed write to a GitHub command file. */
5
+ export interface NightlyGuardCommandFileWrite {
6
+ /** Command file whose later-step process state can change. */
7
+ readonly file: (typeof GITHUB_COMMAND_FILES)[number];
8
+ /** Whether the exact emitted name is proven harmless to guard execution. */
9
+ readonly safety: "safe" | "unsafe" | "unknown";
10
+ }
11
+ /**
12
+ * Retain command-file effects without mistaking unrelated assignments for payload.
13
+ * @param tokens - Comment-stripped bounded shell tokens for one step
14
+ * @param safeEnvironmentName - Guard-aware predicate for one exact emitted name
15
+ * @returns Every recognized command-file sink in source order
16
+ */
17
+ export declare function inspectNightlyGuardCommandFileWrites(tokens: readonly ShellToken[], safeEnvironmentName: (name: string) => boolean): readonly NightlyGuardCommandFileWrite[];
18
+ export {};
19
+ //# sourceMappingURL=doctor-nightly-e2e-guard-command-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-command-files.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-command-files.ts"],"names":[],"mappings":"AAAA,yLAAyL;AACzL,OAAO,EACL,KAAK,UAAU,EAEhB,MAAM,2CAA2C,CAAC;AAGnD,QAAA,MAAM,oBAAoB,wCAAyC,CAAC;AAYpE,8DAA8D;AAC9D,MAAM,WAAW,4BAA4B;IAC3C,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;IACrD,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;CAChD;AA2SD;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAC7C,SAAS,4BAA4B,EAAE,CAMzC"}
@@ -0,0 +1,221 @@
1
+ import { isExecutionChangingEnvironmentName as changesExecution } from "./doctor-nightly-e2e-guard-runtime.js";
2
+ const GITHUB_COMMAND_FILES = ["GITHUB_ENV", "GITHUB_PATH"];
3
+ const POSIX_IDENTIFIER = "[A-Za-z_]\\w*";
4
+ const POSIX_ASSIGNMENT = /^([A-Za-z_]\w*)=/u;
5
+ const ENVIRONMENT_TARGET = new RegExp(`^\\$(?:\\{(${POSIX_IDENTIFIER})\\}|(${POSIX_IDENTIFIER}))$`, "u");
6
+ const INDIRECT_ENVIRONMENT_TARGET = new RegExp(`^\\$\\{!(${POSIX_IDENTIFIER})\\}$`, "u");
7
+ const words = (tokens) => tokens.filter((token) => token.kind === "word");
8
+ const commandFileReference = (word) => !word.dynamic || word.quote === "single"
9
+ ? undefined
10
+ : GITHUB_COMMAND_FILES.find(file => new RegExp(`\\$(?:\\{[^}\\n]*${file}[^}\\n]*\\}|[A-Z0-9_]*${file}[A-Z0-9_]*)`, "u").test(word.value));
11
+ const exactTargetName = (word) => {
12
+ if (word.quote === "single")
13
+ return undefined;
14
+ const match = ENVIRONMENT_TARGET.exec(word.value);
15
+ return match?.[1] ?? match?.[2];
16
+ };
17
+ const indirectTargetName = (word) => word.quote === "single"
18
+ ? undefined
19
+ : INDIRECT_ENVIRONMENT_TARGET.exec(word.value)?.[1];
20
+ const commandSegment = (tokens, end) => {
21
+ const boundary = tokens
22
+ .slice(0, end)
23
+ .reduce((latest, token, index) => token.kind === "operator" &&
24
+ (token.value === "\n" || token.value === ";")
25
+ ? index
26
+ : latest, -1);
27
+ return tokens.slice(boundary + 1, end);
28
+ };
29
+ const assignmentName = (word) => word.dynamic || word.quote === "mixed" || /[\n\r\\`$]/u.test(word.value)
30
+ ? undefined
31
+ : /^([A-Z][A-Z0-9_]*)=[\x20-\x7e]*$/u.exec(word.value)?.[1];
32
+ const literalPrintfAssignment = (word) => {
33
+ if (word.dynamic || word.quote !== "single" || !word.value.endsWith("\\n")) {
34
+ return undefined;
35
+ }
36
+ const line = word.value.slice(0, -2);
37
+ if (/[\\%]/u.test(line))
38
+ return undefined;
39
+ return assignmentName({ ...word, value: line });
40
+ };
41
+ const emittedAssignmentName = (tokens) => {
42
+ if (tokens.some(token => token.kind === "operator"))
43
+ return undefined;
44
+ const emitted = words(tokens);
45
+ const format = emitted[1];
46
+ const payload = emitted.length === 2 && emitted[0]?.value === "echo"
47
+ ? emitted[1]
48
+ : emitted.length === 3 &&
49
+ emitted[0]?.value === "printf" &&
50
+ format?.dynamic === false &&
51
+ format.quote !== "mixed" &&
52
+ ["%s", "%s\\n"].includes(format.value)
53
+ ? emitted[2]
54
+ : undefined;
55
+ if (payload)
56
+ return assignmentName(payload);
57
+ return emitted.length === 2 && emitted[0]?.value === "printf"
58
+ ? literalPrintfAssignment(emitted[1])
59
+ : undefined;
60
+ };
61
+ const aliasName = (word) => word.quote === "single" || word.quote === "double"
62
+ ? undefined
63
+ : POSIX_ASSIGNMENT.exec(word.value)?.[1];
64
+ const literalCommandFileAssignment = (word) => {
65
+ if (word.dynamic)
66
+ return undefined;
67
+ const name = aliasName(word);
68
+ if (!name)
69
+ return undefined;
70
+ const value = word.value.slice(word.value.indexOf("=") + 1);
71
+ return GITHUB_COMMAND_FILES.find(file => value === file);
72
+ };
73
+ const aliasBefore = (tokens, targetName, target) => tokens
74
+ .slice(0, target)
75
+ .reduce((latest, token) => {
76
+ if (token.kind !== "word" || aliasName(token) !== targetName) {
77
+ return latest;
78
+ }
79
+ const file = commandFileReference(token);
80
+ if (!file)
81
+ return undefined;
82
+ const value = token.value.slice(token.value.indexOf("=") + 1);
83
+ const match = ENVIRONMENT_TARGET.exec(value);
84
+ return {
85
+ file,
86
+ exact: (match?.[1] ?? match?.[2]) === file,
87
+ };
88
+ }, undefined);
89
+ const priorCommandFile = (tokens, target) => tokens
90
+ .slice(0, target)
91
+ .reduce((latest, token) => (token.kind === "word" ? (commandFileReference(token) ?? latest) : latest), undefined);
92
+ const indirectCommandFileBefore = (tokens, targetName, target) => {
93
+ const prior = tokens.slice(0, target);
94
+ const assigned = prior.reduce((latest, token) => {
95
+ if (token.kind !== "word" || aliasName(token) !== targetName) {
96
+ return latest;
97
+ }
98
+ return commandFileReference(token) ?? literalCommandFileAssignment(token);
99
+ }, undefined);
100
+ if (assigned)
101
+ return assigned;
102
+ return prior.reduce((latest, token) => token.kind === "word"
103
+ ? (commandFileReference(token) ??
104
+ literalCommandFileAssignment(token) ??
105
+ latest)
106
+ : latest, undefined);
107
+ };
108
+ const redirectBefore = (tokens, target) => {
109
+ const prior = tokens[target - 1];
110
+ if (prior?.kind === "operator" &&
111
+ (prior.value === ">" || prior.value === ">>")) {
112
+ return target - 1;
113
+ }
114
+ const clobber = tokens[target - 2];
115
+ return clobber?.kind === "operator" &&
116
+ clobber.value === ">" &&
117
+ prior?.kind === "operator" &&
118
+ prior.value === "|"
119
+ ? target - 2
120
+ : undefined;
121
+ };
122
+ const supportedTeePrefix = (tokens) => {
123
+ const command = tokens.at(-1);
124
+ const assignments = command?.kind === "word" && command.value === "command"
125
+ ? tokens.slice(0, -1)
126
+ : tokens;
127
+ return assignments.every(token => {
128
+ if (token.kind !== "word")
129
+ return false;
130
+ const name = aliasName(token);
131
+ return name !== undefined && !token.dynamic && !changesExecution(name);
132
+ });
133
+ };
134
+ const teeCommandStart = (tokens, teeIndex) => {
135
+ const segment = commandSegment(tokens, teeIndex);
136
+ const pipe = segment.reduce((latest, token, index) => token.kind === "operator" && token.value === "|" ? index : latest, -1);
137
+ const prefix = segment.slice(pipe + 1);
138
+ if (!supportedTeePrefix(prefix))
139
+ return undefined;
140
+ return pipe < 0 ? teeIndex : teeIndex - segment.length + pipe;
141
+ };
142
+ const teeSinkBefore = (tokens, target) => {
143
+ const append = tokens[target - 1];
144
+ const teeIndex = append?.kind === "word" && append.value === "-a" ? target - 2 : target - 1;
145
+ const tee = tokens[teeIndex];
146
+ if (tee?.kind !== "word" || tee.value !== "tee")
147
+ return undefined;
148
+ return teeCommandStart(tokens, teeIndex);
149
+ };
150
+ const unresolvedTeeBefore = (tokens, target) => words(commandSegment(tokens, target)).some(word => word.value === "tee");
151
+ const emittedNameForSink = (tokens, target) => {
152
+ const redirect = redirectBefore(tokens, target);
153
+ if (redirect !== undefined) {
154
+ return emittedAssignmentName(commandSegment(tokens, redirect));
155
+ }
156
+ const teeSink = teeSinkBefore(tokens, target);
157
+ return teeSink === undefined
158
+ ? undefined
159
+ : emittedAssignmentName(commandSegment(tokens, teeSink));
160
+ };
161
+ const isSinkTarget = (tokens, target) => redirectBefore(tokens, target) !== undefined ||
162
+ teeSinkBefore(tokens, target) !== undefined;
163
+ const readOnlyReference = (token, command) => aliasName(token) !== undefined || command === "echo";
164
+ const resolvedCommandFileTarget = (tokens, token, index) => {
165
+ const targetName = exactTargetName(token);
166
+ const indirectName = indirectTargetName(token);
167
+ const direct = commandFileReference(token);
168
+ if (direct)
169
+ return { file: direct, exact: targetName === direct };
170
+ const alias = targetName ? aliasBefore(tokens, targetName, index) : undefined;
171
+ if (alias)
172
+ return alias;
173
+ const indirectAlias = indirectName
174
+ ? indirectCommandFileBefore(tokens, indirectName, index)
175
+ : undefined;
176
+ if (indirectAlias)
177
+ return { file: indirectAlias, exact: false };
178
+ const indirect = targetName ? priorCommandFile(tokens, index) : undefined;
179
+ return indirect ? { file: indirect, exact: false } : undefined;
180
+ };
181
+ const writeForToken = (tokens, token, index, safeEnvironmentName) => {
182
+ const sink = isSinkTarget(tokens, index);
183
+ const target = resolvedCommandFileTarget(tokens, token, index);
184
+ if (!target)
185
+ return undefined;
186
+ const readOnly = !unresolvedTeeBefore(tokens, index) &&
187
+ readOnlyReference(token, words(commandSegment(tokens, index))[0]?.value);
188
+ if (!sink && readOnly)
189
+ return undefined;
190
+ if (!sink)
191
+ return { file: target.file, safety: "unknown" };
192
+ if (!target.exact)
193
+ return { file: target.file, safety: "unknown" };
194
+ if (target.file === "GITHUB_PATH") {
195
+ return { file: target.file, safety: "unsafe" };
196
+ }
197
+ const emittedName = emittedNameForSink(tokens, index);
198
+ return {
199
+ file: target.file,
200
+ safety: emittedName === undefined
201
+ ? "unknown"
202
+ : safeEnvironmentName(emittedName)
203
+ ? "safe"
204
+ : "unsafe",
205
+ };
206
+ };
207
+ /**
208
+ * Retain command-file effects without mistaking unrelated assignments for payload.
209
+ * @param tokens - Comment-stripped bounded shell tokens for one step
210
+ * @param safeEnvironmentName - Guard-aware predicate for one exact emitted name
211
+ * @returns Every recognized command-file sink in source order
212
+ */
213
+ export function inspectNightlyGuardCommandFileWrites(tokens, safeEnvironmentName) {
214
+ return tokens.flatMap((token, index) => {
215
+ if (token.kind !== "word")
216
+ return [];
217
+ const write = writeForToken(tokens, token, index, safeEnvironmentName);
218
+ return write ? [write] : [];
219
+ });
220
+ }
221
+ //# sourceMappingURL=doctor-nightly-e2e-guard-command-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-command-files.js","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-command-files.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kCAAkC,IAAI,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAE/G,MAAM,oBAAoB,GAAG,CAAC,YAAY,EAAE,aAAa,CAAU,CAAC;AACpE,MAAM,gBAAgB,GAAG,eAAe,CAAC;AACzC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAC7C,MAAM,kBAAkB,GAAG,IAAI,MAAM,CACnC,cAAc,gBAAgB,SAAS,gBAAgB,KAAK,EAC5D,GAAG,CACJ,CAAC;AACF,MAAM,2BAA2B,GAAG,IAAI,MAAM,CAC5C,YAAY,gBAAgB,OAAO,EACnC,GAAG,CACJ,CAAC;AAUF,MAAM,KAAK,GAAG,CAAC,MAA6B,EAAwB,EAAE,CACpE,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAsB,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;AAEtE,MAAM,oBAAoB,GAAG,CAC3B,IAAe,EACmC,EAAE,CACpD,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ;IACtC,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,E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I,EAAE,MAAM,CAAC,IAAI;QACjB,MAAM,EACJ,WAAW,KAAK,SAAS;YACvB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC;gBAChC,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,QAAQ;KACjB,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,oCAAoC,CAClD,MAA6B,EAC7B,mBAA8C;IAE9C,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACrC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC;QACvE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,113 @@
1
+ /** Canonical destination installed into host projects. */
2
+ export declare const NIGHTLY_GUARD_CANONICAL_TARGET = "scripts/check-nightly-e2e-health.mjs";
3
+ /** Canonical guard inside an installed Lisa package. */
4
+ export declare const NIGHTLY_GUARD_SHIPPED_TARGET = "typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs";
5
+ /** Workflow inventory root inspected by doctor. */
6
+ export declare const NIGHTLY_GUARD_WORKFLOWS = ".github/workflows";
7
+ /** Maximum workflow files inspected by one doctor run. */
8
+ export declare const MAX_NIGHTLY_GUARD_FILES = 256;
9
+ /** Maximum active root-to-guard call paths inspected by one doctor run. */
10
+ export declare const MAX_NIGHTLY_GUARD_CALLERS = 64;
11
+ /** Maximum distinct scripts proven by one doctor run. */
12
+ export declare const MAX_NIGHTLY_GUARD_TARGETS = 8;
13
+ /** Maximum bytes read from any workflow or target file. */
14
+ export declare const MAX_NIGHTLY_GUARD_FILE_BYTES: number;
15
+ /** Maximum workflow bytes read across discovery. */
16
+ export declare const MAX_NIGHTLY_GUARD_TOTAL_BYTES: number;
17
+ /** Maximum local reusable call depth. */
18
+ export declare const MAX_NIGHTLY_GUARD_LOCAL_DEPTH = 8;
19
+ /** Maximum UTF-8 bytes in one workflow filename attribution identifier. */
20
+ export declare const MAX_NIGHTLY_GUARD_WORKFLOW_ID_BYTES = 255;
21
+ /** Maximum ASCII bytes in one GitHub job mapping identifier. */
22
+ export declare const MAX_NIGHTLY_GUARD_JOB_ID_BYTES = 100;
23
+ /** Maximum bytes retained across all caller-attribution fields. */
24
+ export declare const MAX_NIGHTLY_GUARD_ATTRIBUTION_BYTES: number;
25
+ /** Maximum bytes emitted in this doctor row's human/JSON detail. */
26
+ export declare const MAX_NIGHTLY_GUARD_DETAIL_BYTES: number;
27
+ /** Maximum time allocated to one static target proof. */
28
+ export declare const NIGHTLY_GUARD_TARGET_TIMEOUT_MS = 2000;
29
+ /** Maximum time allocated to discovery, proof, and remediation together. */
30
+ export declare const NIGHTLY_GUARD_OPERATION_TIMEOUT_MS = 15000;
31
+ /** One active root-to-job path and the literal script it executes. */
32
+ export interface NightlyGuardCaller {
33
+ /** Leaf workflow that contains the executable guard job. */
34
+ readonly workflow: string;
35
+ /** Leaf job identifier, which participates in the check context. */
36
+ readonly job: string;
37
+ /** Full root-to-leaf attribution retained even for shared reusables. */
38
+ readonly callPath: string;
39
+ /** Whether the leaf calls Lisa's endpoint or invokes Node itself. */
40
+ readonly kind: "official-reusable" | "direct";
41
+ /** Literal project-relative JavaScript target. */
42
+ readonly target: string;
43
+ }
44
+ /** One reason discovery could not produce a trustworthy answer. */
45
+ export interface NightlyGuardScanFailure {
46
+ /** Workflow involved, or the workflow directory for inventory failures. */
47
+ readonly workflow: string;
48
+ /** Bounded operator-readable refusal. */
49
+ readonly reason: string;
50
+ }
51
+ /** Discovery distinguishes an examined zero from unavailable evidence. */
52
+ export type NightlyGuardScanResult = {
53
+ readonly state: "ok";
54
+ readonly callers: readonly NightlyGuardCaller[];
55
+ } | {
56
+ readonly state: "unavailable";
57
+ readonly failures: readonly NightlyGuardScanFailure[];
58
+ };
59
+ /** Parsed workflow retained with its deterministic display path. */
60
+ export interface NightlyGuardWorkflowRecord {
61
+ /** Repo-relative path used in findings. */
62
+ readonly file: string;
63
+ /** Basename used by supported local reusable references. */
64
+ readonly name: string;
65
+ /** Parsed YAML mapping. */
66
+ readonly document: Readonly<Record<string, unknown>>;
67
+ }
68
+ /** Successful trusted contract evidence or a reason no verdict exists. */
69
+ export type NightlyGuardProbeResult = {
70
+ readonly state: "compatible";
71
+ readonly version: string;
72
+ } | {
73
+ readonly state: "failure";
74
+ readonly reason: string;
75
+ readonly version?: string;
76
+ };
77
+ /**
78
+ * Narrow unknown values to YAML-style mappings.
79
+ * @param value - Parsed YAML value
80
+ * @returns Mapping values only; arrays and scalars are refused
81
+ */
82
+ export declare const nightlyGuardObject: (value: unknown) => Readonly<Record<string, unknown>> | undefined;
83
+ /**
84
+ * Return trimmed YAML strings while refusing coercion.
85
+ * @param value - Parsed YAML value
86
+ * @returns Trimmed literal string or an empty sentinel
87
+ */
88
+ export declare const nightlyGuardText: (value: unknown) => string;
89
+ /**
90
+ * Sort ASCII identifiers without locale-dependent ordering.
91
+ * @param values - Identifiers copied before ordering
92
+ * @returns Deterministically ordered copy
93
+ */
94
+ export declare const orderNightlyGuardStrings: <T extends string>(values: readonly T[]) => T[];
95
+ /**
96
+ * Validate the documented GitHub job-id alphabet and Lisa's 100-byte ceiling.
97
+ * @param jobId - YAML `jobs` mapping key used in check attribution
98
+ * @returns Whether the identifier can enter a bounded caller path
99
+ */
100
+ export declare const isNightlyGuardJobId: (jobId: string) => boolean;
101
+ /**
102
+ * Count retained attribution bytes, including separators between fields.
103
+ * @param caller - Active caller about to enter doctor output
104
+ * @returns Exact UTF-8 bytes charged to the aggregate attribution budget
105
+ */
106
+ export declare const nightlyGuardCallerAttributionBytes: (caller: NightlyGuardCaller) => number;
107
+ /**
108
+ * Normalize a supported literal target without resolving through the host FS.
109
+ * @param candidate - Workflow-provided path token
110
+ * @returns Normalized project-relative path, or undefined for unsupported input
111
+ */
112
+ export declare function normalizeNightlyGuardTarget(candidate: string): string | undefined;
113
+ //# sourceMappingURL=doctor-nightly-e2e-guard-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-contract.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-contract.ts"],"names":[],"mappings":"AAOA,0DAA0D;AAC1D,eAAO,MAAM,8BAA8B,yCACH,CAAC;AACzC,wDAAwD;AACxD,eAAO,MAAM,4BAA4B,mEACyB,CAAC;AACnE,mDAAmD;AACnD,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,yDAAyD;AACzD,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,2DAA2D;AAC3D,eAAO,MAAM,4BAA4B,QAAc,CAAC;AACxD,oDAAoD;AACpD,eAAO,MAAM,6BAA6B,QAAkB,CAAC;AAC7D,yCAAyC;AACzC,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,2EAA2E;AAC3E,eAAO,MAAM,mCAAmC,MAAM,CAAC;AACvD,gEAAgE;AAChE,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAClD,mEAAmE;AACnE,eAAO,MAAM,mCAAmC,QAAW,CAAC;AAC5D,oEAAoE;AACpE,eAAO,MAAM,8BAA8B,QAAW,CAAC;AACvD,yDAAyD;AACzD,eAAO,MAAM,+BAA+B,OAAQ,CAAC;AACrD,4EAA4E;AAC5E,eAAO,MAAM,kCAAkC,QAAS,CAAC;AAEzD,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC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,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEN;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,OAAO,KACb,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAGxB,CAAC;AAEhB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,MACH,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,MAAM,EACvD,QAAQ,SAAS,CAAC,EAAE,KACnB,CAAC,EAC2E,CAAC;AAIhF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,KAAG,OAEhC,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,GAC7C,QAAQ,kBAAkB,KACzB,MAGA,CAAC;AAIJ;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CASpB"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * @file doctor-nightly-e2e-guard-contract.ts
3
+ * @description Shared bounds and data contracts for active nightly guard proof
4
+ * @module cli/doctor-nightly-e2e-guard-contract
5
+ */
6
+ import * as path from "node:path";
7
+ /** Canonical destination installed into host projects. */
8
+ export const NIGHTLY_GUARD_CANONICAL_TARGET = "scripts/check-nightly-e2e-health.mjs";
9
+ /** Canonical guard inside an installed Lisa package. */
10
+ export const NIGHTLY_GUARD_SHIPPED_TARGET = "typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs";
11
+ /** Workflow inventory root inspected by doctor. */
12
+ export const NIGHTLY_GUARD_WORKFLOWS = ".github/workflows";
13
+ /** Maximum workflow files inspected by one doctor run. */
14
+ export const MAX_NIGHTLY_GUARD_FILES = 256;
15
+ /** Maximum active root-to-guard call paths inspected by one doctor run. */
16
+ export const MAX_NIGHTLY_GUARD_CALLERS = 64;
17
+ /** Maximum distinct scripts proven by one doctor run. */
18
+ export const MAX_NIGHTLY_GUARD_TARGETS = 8;
19
+ /** Maximum bytes read from any workflow or target file. */
20
+ export const MAX_NIGHTLY_GUARD_FILE_BYTES = 1024 * 1024;
21
+ /** Maximum workflow bytes read across discovery. */
22
+ export const MAX_NIGHTLY_GUARD_TOTAL_BYTES = 8 * 1024 * 1024;
23
+ /** Maximum local reusable call depth. */
24
+ export const MAX_NIGHTLY_GUARD_LOCAL_DEPTH = 8;
25
+ /** Maximum UTF-8 bytes in one workflow filename attribution identifier. */
26
+ export const MAX_NIGHTLY_GUARD_WORKFLOW_ID_BYTES = 255;
27
+ /** Maximum ASCII bytes in one GitHub job mapping identifier. */
28
+ export const MAX_NIGHTLY_GUARD_JOB_ID_BYTES = 100;
29
+ /** Maximum bytes retained across all caller-attribution fields. */
30
+ export const MAX_NIGHTLY_GUARD_ATTRIBUTION_BYTES = 3 * 1024;
31
+ /** Maximum bytes emitted in this doctor row's human/JSON detail. */
32
+ export const MAX_NIGHTLY_GUARD_DETAIL_BYTES = 4 * 1024;
33
+ /** Maximum time allocated to one static target proof. */
34
+ export const NIGHTLY_GUARD_TARGET_TIMEOUT_MS = 2_000;
35
+ /** Maximum time allocated to discovery, proof, and remediation together. */
36
+ export const NIGHTLY_GUARD_OPERATION_TIMEOUT_MS = 15_000;
37
+ /**
38
+ * Narrow unknown values to YAML-style mappings.
39
+ * @param value - Parsed YAML value
40
+ * @returns Mapping values only; arrays and scalars are refused
41
+ */
42
+ export const nightlyGuardObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value)
43
+ ? value
44
+ : undefined;
45
+ /**
46
+ * Return trimmed YAML strings while refusing coercion.
47
+ * @param value - Parsed YAML value
48
+ * @returns Trimmed literal string or an empty sentinel
49
+ */
50
+ export const nightlyGuardText = (value) => typeof value === "string" ? value.trim() : "";
51
+ /**
52
+ * Sort ASCII identifiers without locale-dependent ordering.
53
+ * @param values - Identifiers copied before ordering
54
+ * @returns Deterministically ordered copy
55
+ */
56
+ export const orderNightlyGuardStrings = (values) => [...values].sort((left, right) => (left < right ? -1 : left > right ? 1 : 0));
57
+ const JOB_ID = /^[A-Za-z_][A-Za-z0-9_-]*$/u;
58
+ /**
59
+ * Validate the documented GitHub job-id alphabet and Lisa's 100-byte ceiling.
60
+ * @param jobId - YAML `jobs` mapping key used in check attribution
61
+ * @returns Whether the identifier can enter a bounded caller path
62
+ */
63
+ export const isNightlyGuardJobId = (jobId) => Buffer.byteLength(jobId) <= MAX_NIGHTLY_GUARD_JOB_ID_BYTES &&
64
+ JOB_ID.test(jobId);
65
+ /**
66
+ * Count retained attribution bytes, including separators between fields.
67
+ * @param caller - Active caller about to enter doctor output
68
+ * @returns Exact UTF-8 bytes charged to the aggregate attribution budget
69
+ */
70
+ export const nightlyGuardCallerAttributionBytes = (caller) => Buffer.byteLength([caller.workflow, caller.job, caller.callPath, caller.target].join("\0"));
71
+ const TARGET = /^(?:[A-Za-z0-9_.-]+\/)*[A-Za-z0-9_.-]+\.(?:js|mjs|cjs)$/u;
72
+ /**
73
+ * Normalize a supported literal target without resolving through the host FS.
74
+ * @param candidate - Workflow-provided path token
75
+ * @returns Normalized project-relative path, or undefined for unsupported input
76
+ */
77
+ export function normalizeNightlyGuardTarget(candidate) {
78
+ const relative = candidate.startsWith("./") ? candidate.slice(2) : candidate;
79
+ if (!TARGET.test(relative) || path.posix.isAbsolute(relative)) {
80
+ return undefined;
81
+ }
82
+ const segments = relative.split("/");
83
+ return segments.includes(".") || segments.includes("..")
84
+ ? undefined
85
+ : relative;
86
+ }
87
+ //# sourceMappingURL=doctor-nightly-e2e-guard-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-contract.js","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-contract.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,8BAA8B,GACzC,sCAA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AC7E,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9D,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,OAAO,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;QACtD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,QAAQ,CAAC;AACf,CAAC"}
@@ -0,0 +1,61 @@
1
+ /** Explicit error used to convert every deadline exhaustion into one finding. */
2
+ export declare class NightlyGuardDeadlineError extends Error {
3
+ /** Distinguishes a bounded refusal from arbitrary IO failures. */
4
+ readonly code = "NIGHTLY_GUARD_DEADLINE";
5
+ /**
6
+ * Create the stable operator-facing deadline refusal.
7
+ * @param reason - Budget whose expiration caused the refusal
8
+ */
9
+ constructor(reason?: string);
10
+ }
11
+ /** Absolute operation budget shared across leaf modules. */
12
+ export interface NightlyGuardDeadline {
13
+ /** Absolute time from the injected monotonic clock. */
14
+ readonly expiresAt: number;
15
+ /** Monotonic clock used by every budget check. */
16
+ readonly now: () => number;
17
+ /** Exact budget represented by this absolute expiration. */
18
+ readonly reason: string;
19
+ }
20
+ /**
21
+ * Start the deadline before discovery so an expensive scan consumes proof time.
22
+ * @param now - Injected monotonic clock
23
+ * @param timeoutMs - Whole-operation budget
24
+ * @param reason - Exact budget named on expiry
25
+ * @returns Shared absolute deadline
26
+ */
27
+ export declare function createNightlyGuardDeadline(now?: () => number, timeoutMs?: number, reason?: string): NightlyGuardDeadline;
28
+ /**
29
+ * Return the non-negative time left in the shared budget.
30
+ * @param deadline - Shared absolute deadline
31
+ * @returns Remaining milliseconds, clamped at zero
32
+ */
33
+ export declare const nightlyGuardRemaining: (deadline: NightlyGuardDeadline) => number;
34
+ /**
35
+ * Describe the exact target ceiling without hard-coding the default budget.
36
+ * @param timeoutMs - Target-specific ceiling in milliseconds
37
+ * @returns Stable operator-facing deadline reason
38
+ */
39
+ export declare function nightlyGuardTargetDeadlineReason(timeoutMs: number): string;
40
+ /**
41
+ * Refuse work immediately once the shared deadline has elapsed.
42
+ * @param deadline - Shared absolute deadline
43
+ */
44
+ export declare function assertNightlyGuardDeadline(deadline: NightlyGuardDeadline): void;
45
+ /**
46
+ * Enforce the remaining wall-clock budget even when an injected collaborator
47
+ * never resolves. The abandoned operation is read-only and cannot alter the
48
+ * inspected project after the refusal is returned.
49
+ * @param deadline - Shared operation deadline
50
+ * @param operation - Lazy read-only asynchronous work
51
+ * @returns The operation result before expiry
52
+ */
53
+ export declare function withinNightlyGuardDeadline<T>(deadline: NightlyGuardDeadline, operation: () => Promise<T>): Promise<T>;
54
+ /**
55
+ * Give one target a smaller ceiling without extending the outer deadline.
56
+ * @param outer - Whole-operation deadline
57
+ * @param timeoutMs - Target-specific ceiling
58
+ * @returns Deadline ending at the earlier ceiling
59
+ */
60
+ export declare function limitNightlyGuardDeadline(outer: NightlyGuardDeadline, timeoutMs: number): NightlyGuardDeadline;
61
+ //# sourceMappingURL=doctor-nightly-e2e-guard-deadline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-deadline.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-deadline.ts"],"names":[],"mappings":"AASA,iFAAiF;AACjF,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,kEAAkE;IAClE,QAAQ,CAAC,IAAI,4BAA4B;IAEzC;;;OAGG;gBACS,MAAM,SAAkD;CAIrE;AAED,4DAA4D;AAC5D,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,GAAE,MAAM,MAAgC,EAC3C,SAAS,SAAqC,EAC9C,MAAM,SAAkD,GACvD,oBAAoB,CAEtB;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,oBAAoB,KAAG,MACrB,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAM1E;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,oBAAoB,GAC7B,IAAI,CAIN;AAED;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAAC,CAAC,EAChD,QAAQ,EAAE,oBAAoB,EAC9B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAC1B,OAAO,CAAC,CAAC,CAAC,CAmBZ;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,oBAAoB,EAC3B,SAAS,EAAE,MAAM,GAChB,oBAAoB,CAUtB"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * @file doctor-nightly-e2e-guard-deadline.ts
3
+ * @description One monotonic deadline shared by guard discovery and proof
4
+ * @module cli/doctor-nightly-e2e-guard-deadline
5
+ */
6
+ import { performance } from "node:perf_hooks";
7
+ import { NIGHTLY_GUARD_OPERATION_TIMEOUT_MS } from "./doctor-nightly-e2e-guard-contract.js";
8
+ /** Explicit error used to convert every deadline exhaustion into one finding. */
9
+ export class NightlyGuardDeadlineError extends Error {
10
+ /** Distinguishes a bounded refusal from arbitrary IO failures. */
11
+ code = "NIGHTLY_GUARD_DEADLINE";
12
+ /**
13
+ * Create the stable operator-facing deadline refusal.
14
+ * @param reason - Budget whose expiration caused the refusal
15
+ */
16
+ constructor(reason = "15 seconds whole-operation deadline exhausted") {
17
+ super(reason);
18
+ this.name = "NightlyGuardDeadlineError";
19
+ }
20
+ }
21
+ /**
22
+ * Start the deadline before discovery so an expensive scan consumes proof time.
23
+ * @param now - Injected monotonic clock
24
+ * @param timeoutMs - Whole-operation budget
25
+ * @param reason - Exact budget named on expiry
26
+ * @returns Shared absolute deadline
27
+ */
28
+ export function createNightlyGuardDeadline(now = () => performance.now(), timeoutMs = NIGHTLY_GUARD_OPERATION_TIMEOUT_MS, reason = "15 seconds whole-operation deadline exhausted") {
29
+ return { expiresAt: now() + timeoutMs, now, reason };
30
+ }
31
+ /**
32
+ * Return the non-negative time left in the shared budget.
33
+ * @param deadline - Shared absolute deadline
34
+ * @returns Remaining milliseconds, clamped at zero
35
+ */
36
+ export const nightlyGuardRemaining = (deadline) => Math.max(0, deadline.expiresAt - deadline.now());
37
+ /**
38
+ * Describe the exact target ceiling without hard-coding the default budget.
39
+ * @param timeoutMs - Target-specific ceiling in milliseconds
40
+ * @returns Stable operator-facing deadline reason
41
+ */
42
+ export function nightlyGuardTargetDeadlineReason(timeoutMs) {
43
+ const seconds = timeoutMs / 1000;
44
+ const duration = Number.isInteger(seconds)
45
+ ? `${seconds} ${seconds === 1 ? "second" : "seconds"}`
46
+ : `${timeoutMs} milliseconds`;
47
+ return `${duration} target proof deadline exhausted`;
48
+ }
49
+ /**
50
+ * Refuse work immediately once the shared deadline has elapsed.
51
+ * @param deadline - Shared absolute deadline
52
+ */
53
+ export function assertNightlyGuardDeadline(deadline) {
54
+ if (nightlyGuardRemaining(deadline) <= 0) {
55
+ throw new NightlyGuardDeadlineError(deadline.reason);
56
+ }
57
+ }
58
+ /**
59
+ * Enforce the remaining wall-clock budget even when an injected collaborator
60
+ * never resolves. The abandoned operation is read-only and cannot alter the
61
+ * inspected project after the refusal is returned.
62
+ * @param deadline - Shared operation deadline
63
+ * @param operation - Lazy read-only asynchronous work
64
+ * @returns The operation result before expiry
65
+ */
66
+ export async function withinNightlyGuardDeadline(deadline, operation) {
67
+ const remaining = nightlyGuardRemaining(deadline);
68
+ if (remaining <= 0)
69
+ throw new NightlyGuardDeadlineError(deadline.reason);
70
+ return await new Promise((resolve, reject) => {
71
+ const timer = setTimeout(() => reject(new NightlyGuardDeadlineError(deadline.reason)), remaining);
72
+ operation().then(value => {
73
+ clearTimeout(timer);
74
+ resolve(value);
75
+ }, error => {
76
+ clearTimeout(timer);
77
+ reject(error);
78
+ });
79
+ });
80
+ }
81
+ /**
82
+ * Give one target a smaller ceiling without extending the outer deadline.
83
+ * @param outer - Whole-operation deadline
84
+ * @param timeoutMs - Target-specific ceiling
85
+ * @returns Deadline ending at the earlier ceiling
86
+ */
87
+ export function limitNightlyGuardDeadline(outer, timeoutMs) {
88
+ const targetExpiresAt = outer.now() + timeoutMs;
89
+ return {
90
+ expiresAt: Math.min(outer.expiresAt, targetExpiresAt),
91
+ now: outer.now,
92
+ reason: targetExpiresAt < outer.expiresAt
93
+ ? nightlyGuardTargetDeadlineReason(timeoutMs)
94
+ : outer.reason,
95
+ };
96
+ }
97
+ //# sourceMappingURL=doctor-nightly-e2e-guard-deadline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-nightly-e2e-guard-deadline.js","sourceRoot":"","sources":["../../src/cli/doctor-nightly-e2e-guard-deadline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAE5F,iFAAiF;AACjF,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,kEAAkE;IACzD,IAAI,GAAG,wBAAwB,CAAC;IAEzC;;;OAGG;IACH,YAAY,MAAM,GAAG,+CAA+C;QAClE,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAYD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,MAAoB,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAC3C,SAAS,GAAG,kC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