@intentius/chant 0.122.0 → 0.124.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 (203) hide show
  1. package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
  2. package/dist/cli/commands/lint.d.ts.map +1 -1
  3. package/dist/cli/handlers/gate-resume.d.ts +1 -1
  4. package/dist/cli/handlers/gate-resume.d.ts.map +1 -1
  5. package/dist/cli/handlers/operator.d.ts +1 -1
  6. package/dist/cli/handlers/operator.d.ts.map +1 -1
  7. package/dist/cli/handlers/override-approve.d.ts +17 -0
  8. package/dist/cli/handlers/override-approve.d.ts.map +1 -0
  9. package/dist/cli/handlers/run-wave.d.ts.map +1 -1
  10. package/dist/cli/main.d.ts.map +1 -1
  11. package/dist/cli/registry.d.ts +4 -0
  12. package/dist/cli/registry.d.ts.map +1 -1
  13. package/dist/config-import.d.ts +1 -1
  14. package/dist/gate-decision.d.ts +157 -0
  15. package/dist/gate-decision.d.ts.map +1 -0
  16. package/dist/lifecycle/gate-applied.d.ts +75 -0
  17. package/dist/lifecycle/gate-applied.d.ts.map +1 -0
  18. package/dist/lifecycle/gate-audit.d.ts +145 -0
  19. package/dist/lifecycle/gate-audit.d.ts.map +1 -0
  20. package/dist/lifecycle/gate-ledger-select.d.ts +54 -0
  21. package/dist/lifecycle/gate-ledger-select.d.ts.map +1 -0
  22. package/dist/lifecycle/gate-ledger.d.ts +1 -45
  23. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  24. package/dist/lifecycle/override-ledger.d.ts +34 -0
  25. package/dist/lifecycle/override-ledger.d.ts.map +1 -0
  26. package/dist/lifecycle/rollback.d.ts.map +1 -1
  27. package/dist/lifecycle/work-item-id.d.ts +22 -0
  28. package/dist/lifecycle/work-item-id.d.ts.map +1 -0
  29. package/dist/lifecycle/work-lease.d.ts +2 -2
  30. package/dist/lifecycle/work-lease.d.ts.map +1 -1
  31. package/dist/lint/policy-import.d.ts +1 -1
  32. package/dist/lint/post-synth.d.ts +20 -1
  33. package/dist/lint/post-synth.d.ts.map +1 -1
  34. package/dist/notify-verify.d.ts +62 -0
  35. package/dist/notify-verify.d.ts.map +1 -0
  36. package/dist/notify-verify.js +76 -0
  37. package/dist/notify.d.ts +202 -0
  38. package/dist/notify.d.ts.map +1 -0
  39. package/dist/notify.js +307 -0
  40. package/dist/op/__fixtures__/decide-stub-backend.d.ts +1 -1
  41. package/dist/op/activities/activity-contracts.d.ts +4 -4
  42. package/dist/op/activities/gh-host.d.ts +37 -0
  43. package/dist/op/activities/gh-host.d.ts.map +1 -0
  44. package/dist/op/activities/lexicon-upgrade.d.ts +11 -0
  45. package/dist/op/activities/lexicon-upgrade.d.ts.map +1 -1
  46. package/dist/op/activities/propose-upgrade.d.ts.map +1 -1
  47. package/dist/op/activities/reconcile.d.ts +74 -76
  48. package/dist/op/activities/reconcile.d.ts.map +1 -1
  49. package/dist/op/gate-approval.d.ts +17 -1
  50. package/dist/op/gate-approval.d.ts.map +1 -1
  51. package/dist/op/gate-name.d.ts +8 -1
  52. package/dist/op/gate-name.d.ts.map +1 -1
  53. package/dist/op/gate-resume.d.ts +4 -2
  54. package/dist/op/gate-resume.d.ts.map +1 -1
  55. package/dist/op/gate-review.d.ts +2 -1
  56. package/dist/op/gate-review.d.ts.map +1 -1
  57. package/dist/op/gate.d.ts +43 -6
  58. package/dist/op/gate.d.ts.map +1 -1
  59. package/dist/op/index.d.ts +8 -6
  60. package/dist/op/index.d.ts.map +1 -1
  61. package/dist/op/op-waves-notify.d.ts +31 -0
  62. package/dist/op/op-waves-notify.d.ts.map +1 -0
  63. package/dist/op/op-waves-run.d.ts +218 -16
  64. package/dist/op/op-waves-run.d.ts.map +1 -1
  65. package/dist/op/op-waves.d.ts +113 -2
  66. package/dist/op/op-waves.d.ts.map +1 -1
  67. package/dist/op/operator.d.ts +15 -0
  68. package/dist/op/operator.d.ts.map +1 -1
  69. package/dist/op/work-lease-decl.d.ts.map +1 -1
  70. package/dist/op/work-lease-run.d.ts.map +1 -1
  71. package/dist/override-gate.d.ts +224 -0
  72. package/dist/override-gate.d.ts.map +1 -0
  73. package/dist/pr-forge.d.ts +225 -19
  74. package/dist/pr-forge.d.ts.map +1 -1
  75. package/dist/workspace/conformance/__fixtures__/reference-broker.d.ts +1 -1
  76. package/dist/workspace/conformance/broker.d.ts +1 -1
  77. package/dist/workspace/status-gates.d.ts +1 -0
  78. package/dist/workspace/status-gates.d.ts.map +1 -1
  79. package/dist/workspace/trust/gate-seal.d.ts +96 -0
  80. package/dist/workspace/trust/gate-seal.d.ts.map +1 -0
  81. package/dist/workspace/trust/policy.d.ts +2 -41
  82. package/dist/workspace/trust/policy.d.ts.map +1 -1
  83. package/dist/workspace/trust/seal.d.ts +2 -27
  84. package/dist/workspace/trust/seal.d.ts.map +1 -1
  85. package/dist/workspace/trust/trust-files.d.ts +57 -0
  86. package/dist/workspace/trust/trust-files.d.ts.map +1 -0
  87. package/dist/workspace/work-cli.d.ts.map +1 -1
  88. package/package.json +15 -2
  89. package/src/cli/commands/build.ts +1 -1
  90. package/src/cli/commands/check-lexicon.ts +3 -1
  91. package/src/cli/commands/lint-post-synth.e2e.test.ts +117 -0
  92. package/src/cli/commands/lint.test.ts +4 -109
  93. package/src/cli/commands/lint.ts +5 -2
  94. package/src/cli/discovery-skip.e2e.test.ts +18 -3
  95. package/src/cli/handlers/__snapshots__/build-member.test.ts.snap +2 -2
  96. package/src/cli/handlers/gate-resume.ts +3 -2
  97. package/src/cli/handlers/operator.test.ts +12 -1
  98. package/src/cli/handlers/operator.ts +25 -13
  99. package/src/cli/handlers/override-approve.test.ts +87 -0
  100. package/src/cli/handlers/override-approve.ts +103 -0
  101. package/src/cli/handlers/run-wave.ts +10 -2
  102. package/src/cli/main.test.ts +8 -0
  103. package/src/cli/main.ts +15 -0
  104. package/src/cli/registry.ts +4 -0
  105. package/src/config-import.ts +1 -1
  106. package/src/discovery/sandbox/run.test.ts +1 -1
  107. package/src/gate-decision-bundle.test.ts +56 -0
  108. package/src/gate-decision.test.ts +237 -0
  109. package/src/gate-decision.ts +321 -0
  110. package/src/lifecycle/gate-applied.ts +115 -0
  111. package/src/lifecycle/gate-audit-bundle.test.ts +47 -0
  112. package/src/lifecycle/gate-audit.test.ts +134 -0
  113. package/src/lifecycle/gate-audit.ts +438 -0
  114. package/src/lifecycle/gate-ledger-select.ts +113 -0
  115. package/src/lifecycle/gate-ledger.test.ts +22 -0
  116. package/src/lifecycle/gate-ledger.ts +9 -104
  117. package/src/lifecycle/override-ledger.test.ts +63 -0
  118. package/src/lifecycle/override-ledger.ts +69 -0
  119. package/src/lifecycle/rollback.ts +5 -1
  120. package/src/lifecycle/work-item-id.test.ts +71 -0
  121. package/src/lifecycle/work-item-id.ts +35 -0
  122. package/src/lifecycle/work-lease.ts +4 -5
  123. package/src/lint/policy-import.ts +1 -1
  124. package/src/lint/post-synth.test.ts +29 -0
  125. package/src/lint/post-synth.ts +21 -2
  126. package/src/notify-bundle.test.ts +50 -0
  127. package/src/notify-plain-node.e2e.test.ts +68 -0
  128. package/src/notify-verify.test.ts +59 -0
  129. package/src/notify-verify.ts +93 -0
  130. package/src/notify.schema.json +72 -0
  131. package/src/notify.test.ts +279 -0
  132. package/src/notify.ts +398 -0
  133. package/src/op/__fixtures__/decide-stub-backend.ts +1 -1
  134. package/src/op/activities/gh-host.test.ts +130 -0
  135. package/src/op/activities/gh-host.ts +79 -0
  136. package/src/op/activities/lexicon-upgrade.ts +22 -1
  137. package/src/op/activities/propose-upgrade.ts +5 -1
  138. package/src/op/activities/reconcile.test.ts +284 -280
  139. package/src/op/activities/reconcile.ts +128 -131
  140. package/src/op/gate-approval.test.ts +175 -7
  141. package/src/op/gate-approval.ts +27 -1
  142. package/src/op/gate-name.ts +10 -2
  143. package/src/op/gate-resume.ts +6 -3
  144. package/src/op/gate-review.ts +4 -7
  145. package/src/op/gate.ts +117 -16
  146. package/src/op/index.ts +36 -5
  147. package/src/op/op-waves-notify.test.ts +127 -0
  148. package/src/op/op-waves-notify.ts +101 -0
  149. package/src/op/op-waves-run.ts +908 -123
  150. package/src/op/op-waves.test.ts +543 -3
  151. package/src/op/op-waves.ts +215 -6
  152. package/src/op/operator.test.ts +29 -0
  153. package/src/op/operator.ts +27 -2
  154. package/src/op/run-context.test.ts +2 -2
  155. package/src/op/work-lease-decl.ts +4 -4
  156. package/src/op/work-lease-run.test.ts +5 -0
  157. package/src/op/work-lease-run.ts +4 -3
  158. package/src/override-gate-bundle.test.ts +47 -0
  159. package/src/override-gate.test.ts +239 -0
  160. package/src/override-gate.ts +395 -0
  161. package/src/pr-forge-bundle.test.ts +40 -0
  162. package/src/pr-forge.test.ts +378 -0
  163. package/src/pr-forge.ts +546 -47
  164. package/src/workspace/conformance/__fixture__/decisions/decision.kind.mjs +1 -1
  165. package/src/workspace/conformance/__fixtures__/reference-broker.ts +1 -1
  166. package/src/workspace/conformance/broker.ts +1 -1
  167. package/src/workspace/records-write-contract.test.ts +3 -2
  168. package/src/workspace/records-write.e2e.test.ts +1 -1
  169. package/src/workspace/status-gates.ts +7 -4
  170. package/src/workspace/trust/gate-seal.test.ts +156 -0
  171. package/src/workspace/trust/gate-seal.ts +254 -0
  172. package/src/workspace/trust/policy.ts +10 -165
  173. package/src/workspace/trust/seal.ts +19 -34
  174. package/src/workspace/trust/trust-files.test.ts +50 -0
  175. package/src/workspace/trust/trust-files.ts +245 -0
  176. package/src/workspace/work-cli.ts +5 -3
  177. package/src/workspace/work-history.test.ts +7 -0
  178. /package/src/audit/{catalog.test.ts → catalog.e2e.test.ts} +0 -0
  179. /package/src/audit/{discover.test.ts → discover.e2e.test.ts} +0 -0
  180. /package/src/audit/{remote-discovery.test.ts → remote-discovery.e2e.test.ts} +0 -0
  181. /package/src/audit/{rules-doc.test.ts → rules-doc.e2e.test.ts} +0 -0
  182. /package/src/{bench.test.ts → bench.e2e.test.ts} +0 -0
  183. /package/src/cli/commands/{check-lexicon-doc-drift.test.ts → check-lexicon-doc-drift.e2e.test.ts} +0 -0
  184. /package/src/cli/commands/{import.test.ts → import.e2e.test.ts} +0 -0
  185. /package/src/cli/{component-security-boundary.test.ts → component-security-boundary.e2e.test.ts} +0 -0
  186. /package/src/cli/mcp/{workspace-tools.test.ts → workspace-tools.e2e.test.ts} +0 -0
  187. /package/src/cli/{security-boundary.test.ts → security-boundary.e2e.test.ts} +0 -0
  188. /package/src/cli/{serve-mcp-workspace.test.ts → serve-mcp-workspace.e2e.test.ts} +0 -0
  189. /package/src/cli/{static-config-read.test.ts → static-config-read.e2e.test.ts} +0 -0
  190. /package/src/codegen/{json-schema-to-ts.test.ts → json-schema-to-ts.e2e.test.ts} +0 -0
  191. /package/src/{lexicon-seams.test.ts → lexicon-seams.e2e.test.ts} +0 -0
  192. /package/src/meta/{declared-imports.test.ts → declared-imports.e2e.test.ts} +0 -0
  193. /package/src/op/{command-gate.test.ts → command-gate.e2e.test.ts} +0 -0
  194. /package/src/op/{steward-beside.test.ts → steward-beside.e2e.test.ts} +0 -0
  195. /package/src/op/{steward-points.test.ts → steward-points.e2e.test.ts} +0 -0
  196. /package/src/workspace/{checks.test.ts → checks.e2e.test.ts} +0 -0
  197. /package/src/workspace/{intent-reviews.test.ts → intent-reviews.e2e.test.ts} +0 -0
  198. /package/src/workspace/{profiles.test.ts → profiles.e2e.test.ts} +0 -0
  199. /package/src/workspace/{read-contract.test.ts → read-contract.e2e.test.ts} +0 -0
  200. /package/src/workspace/{records-contract.test.ts → records-contract.e2e.test.ts} +0 -0
  201. /package/src/workspace/{records-since.test.ts → records-since.e2e.test.ts} +0 -0
  202. /package/src/workspace/{records-write.test.ts → records-write-commands.e2e.test.ts} +0 -0
  203. /package/src/workspace/{work-size.test.ts → work-size.e2e.test.ts} +0 -0
@@ -0,0 +1,224 @@
1
+ /**
2
+ * The override gate (#3760, decision #3756): a person's recorded, reasoned
3
+ * decision to apply one plan a policy denied, spent once a run applies it.
4
+ *
5
+ * The policy engines stay in the products (OPA and conftest in terragucci,
6
+ * config rules in SQL Yodeler). They say a plan is denied and by which rules.
7
+ * This module records and decides the overrides of those denials, so a
8
+ * product keeps a thin layer over it:
9
+ *
10
+ * - A denial is a pending fact on `_gates/policy-override.jsonl` on
11
+ * `chant/lifecycle`, gate the subject (a root, an environment, whatever the
12
+ * product applies one plan to), with the rules that denied it
13
+ * ({@link overridePending}). Its `planDigest` is the override digest
14
+ * ({@link overrideDigest}), which binds the subject, the plan digest and
15
+ * the rule ids, so `chant approve` copies it by default.
16
+ * - An override is an approval of that gate and digest, written with
17
+ * `chant approve policy-override <subject> --rule <id> --reason <text>`
18
+ * (`--sign` under `sealed`). The reason is its `note`.
19
+ * - It counts ({@link decideOverride}) when it is newer than the subject's
20
+ * newest pending fact, names this digest, was written by a person the
21
+ * overriders at base list ({@link overridersAt}), gives a reason, and under
22
+ * `sealed` carries a seal that verifies for its approver against the
23
+ * signers file at base. A line a job wrote (one that carries `via` or a
24
+ * forge `review`) or an agent wrote never counts.
25
+ * - Before a run applies under an override it appends an applied record
26
+ * ({@link appliedOverride}) to `_gates/policy-override/applied.jsonl`. An
27
+ * override with an applied record is spent: it counts for nothing again, so
28
+ * a plan that is denied again waits for its own override, and a spent
29
+ * override of an older plan is not reported as a moved plan.
30
+ *
31
+ * Like `./gate-decision.ts` it reads the lines it is handed and writes
32
+ * nothing; `override-gate-bundle.test.ts` holds its import graph to the
33
+ * same bundle. chant's own writers are in `./lifecycle/override-ledger.ts`.
34
+ */
35
+ import { type GateSigners } from "./workspace/trust/gate-seal.js";
36
+ import type { GateResolutionRecord, PendingGateRecord } from "./lifecycle/gate-ledger.js";
37
+ import type { GateApprovalSource } from "./op/op-waves.js";
38
+ import type { GateAuditApply } from "./lifecycle/gate-audit.js";
39
+ export type { GateResolutionRecord, PendingGateRecord } from "./lifecycle/gate-ledger.js";
40
+ export type { GateSigners } from "./workspace/trust/gate-seal.js";
41
+ /** The op every override and denial is recorded under. `./lifecycle/gate-audit.ts` reads this op as overrides by default. */
42
+ export declare const OVERRIDE_OP = "policy-override";
43
+ /** The ledger file on `chant/lifecycle` that holds denials and overrides. */
44
+ export declare const OVERRIDE_LEDGER = "_gates/policy-override.jsonl";
45
+ /** The file beside it that holds the overrides a run applied under. chant reads only the `.jsonl` files directly under `_gates/` as gate ledgers, so it never reads these lines as gate records. */
46
+ export declare const OVERRIDE_APPLIED = "_gates/policy-override/applied.jsonl";
47
+ /** Where the overriders are read at base when the caller names no other file: one principal per line, `#` starts a comment. */
48
+ export declare const OVERRIDERS_PATH = ".chant/overriders";
49
+ /** The rules as an override names them: trimmed, each once, sorted. */
50
+ export declare function sortedRules(rules: readonly string[]): string[];
51
+ /**
52
+ * The digest an override binds: the subject, its plan digest and the rules
53
+ * that denied it, as `sha256:<hex>` over their LF-joined lines after the op
54
+ * name. A plan that moved, or a different set of rules, gives another digest,
55
+ * so an override of one denial never lets another through.
56
+ */
57
+ export declare function overrideDigest(subject: string, planDigest: string, rules: readonly string[]): string;
58
+ /** The command that overrides a denial. */
59
+ export declare function overrideCommand(subject: string, rules: readonly string[], sealed?: boolean): string;
60
+ /** A denial's pending fact: the gate's record, with the plan it denied and the rules that denied it. `planDigest` is the override digest. */
61
+ export interface OverridePendingRecord extends PendingGateRecord {
62
+ /** The plan digest the policy denied. */
63
+ plan: string;
64
+ /** The ids of the rules that denied it, sorted. */
65
+ rules: string[];
66
+ }
67
+ export interface OverridePendingInput {
68
+ subject: string;
69
+ planDigest: string;
70
+ rules: readonly string[];
71
+ /** ISO-8601. */
72
+ timestamp: string;
73
+ /** ISO-8601; past it a run that is still denied records a fresh fact. */
74
+ expiresAt: string;
75
+ description?: string;
76
+ runId?: string;
77
+ url?: string;
78
+ }
79
+ /** The pending fact a run records when the policy denies a plan and no override counts for it ({@link decideOverride} returns no `standing` fact). Appending it is the caller's. */
80
+ export declare function overridePending(input: OverridePendingInput): OverridePendingRecord;
81
+ /** The denials on the ledger: each subject's newest pending fact of the override op that names a plan. Sorted by subject. */
82
+ export declare function recordedDenials(pending: readonly PendingGateRecord[]): OverridePendingRecord[];
83
+ /** The overriders file at base. */
84
+ export interface Overriders {
85
+ /** The commit it was read at. */
86
+ base: string | null;
87
+ path: string;
88
+ /** Whether the file exists at base. Without it nobody may override. */
89
+ active: boolean;
90
+ principals: string[];
91
+ }
92
+ /** The principals in an overriders file: one per line, blank lines and `#` comments skipped. */
93
+ export declare function parseOverriders(text: string): string[];
94
+ /**
95
+ * The overriders at `base` (a commit the repository holds, such as
96
+ * `baseCommit(repo)` from `@intentius/chant/gate-decision`), from `path`
97
+ * (default {@link OVERRIDERS_PATH}). Read at base, so the change being
98
+ * applied cannot add the person who overrides its own denial. A product that
99
+ * keeps its list in its own config at base reads it there and passes the
100
+ * principals to {@link decideOverride} instead.
101
+ */
102
+ export declare function overridersAt(repo: string, base: string, path?: string): Overriders;
103
+ /** A line of `_gates/policy-override/applied.jsonl`: a run applied under the override of `planDigest` made at `approvedAt`. */
104
+ export interface AppliedOverrideRecord {
105
+ version: 1;
106
+ kind: "applied";
107
+ op: string;
108
+ /** The subject. */
109
+ gate: string;
110
+ /** The override digest. */
111
+ planDigest: string;
112
+ /** The override's own timestamp: every override of this digest at or before it is spent. */
113
+ approvedAt: string;
114
+ approvedBy: string;
115
+ /** When the run recorded it. */
116
+ timestamp: string;
117
+ runId?: string;
118
+ commit?: string;
119
+ }
120
+ /** The applied records in the text of an applied file. Malformed lines, and lines of another kind, are skipped. */
121
+ export declare function parseAppliedOverrides(text: string): AppliedOverrideRecord[];
122
+ /** What judges an override line: who may write one, the approval mode, and under `sealed` the signers at base. */
123
+ export interface OverrideRule {
124
+ /** The principals who may override (an overriders file's, or a product's own list at base). */
125
+ overriders: readonly string[];
126
+ /** Where they were read, for the refusals. Default {@link OVERRIDERS_PATH}. */
127
+ overridersPath?: string;
128
+ /** `sealed` counts only a seal that verifies; `ledger` and `pr-review` count an unsealed override (an override is a person's line on the ledger, never a review). Default `ledger`. */
129
+ mode?: GateApprovalSource;
130
+ /** The signers at base (`gateSignersAt`). Under `sealed`, absent means nothing counts. */
131
+ signers?: GateSigners;
132
+ }
133
+ /** Why this ledger line does not count as an override, or null when it does. */
134
+ export declare function overrideRefusal(rule: OverrideRule, r: GateResolutionRecord): string | null;
135
+ export interface OverrideInput extends OverrideRule {
136
+ /** The lines of `_gates/policy-override.jsonl`. Lines of other ops are ignored. */
137
+ ledger: {
138
+ resolutions: readonly GateResolutionRecord[];
139
+ pending: readonly PendingGateRecord[];
140
+ };
141
+ /** The lines of `_gates/policy-override/applied.jsonl`. Absent reads as none. */
142
+ applied?: readonly AppliedOverrideRecord[];
143
+ subject: string;
144
+ /** The plan digest the policy denied. */
145
+ planDigest: string;
146
+ /** The ids of the rules that denied it. */
147
+ rules: readonly string[];
148
+ /** ISO-8601 now, for whether the standing pending fact has expired. */
149
+ now?: string;
150
+ }
151
+ /** An override that counts. */
152
+ export interface StandingOverride {
153
+ subject: string;
154
+ by: string;
155
+ at: string;
156
+ reason: string;
157
+ rules: string[];
158
+ /** The plan digest it lets through. */
159
+ planDigest: string;
160
+ /** The override digest. */
161
+ digest: string;
162
+ sealed: boolean;
163
+ resolution: GateResolutionRecord;
164
+ }
165
+ export type OverrideDecision =
166
+ /** An override of this digest counts: the run may apply this plan, after recording {@link appliedOverride}. */
167
+ {
168
+ status: "overridden";
169
+ digest: string;
170
+ override: StandingOverride;
171
+ }
172
+ /**
173
+ * No override counts. `refusals` says why each override of this digest
174
+ * does not. `standing` is the unexpired pending fact for this digest, so a
175
+ * run that finds one records no other. `spent` is the newest override of
176
+ * another digest a run already applied under.
177
+ */
178
+ | {
179
+ status: "none";
180
+ digest: string;
181
+ refusals: string[];
182
+ standing?: OverridePendingRecord;
183
+ spent?: {
184
+ digest: string;
185
+ by: string;
186
+ at: string;
187
+ };
188
+ }
189
+ /** An override counts for another digest and was never applied: the plan or its rules changed after it was written. */
190
+ | {
191
+ status: "moved";
192
+ digest: string;
193
+ by: string;
194
+ was: string | undefined;
195
+ refusals: string[];
196
+ standing?: OverridePendingRecord;
197
+ };
198
+ /**
199
+ * Decide one denied plan against the override ledger, as `decideGateApproval`
200
+ * decides a gate: a line counts only when it is an override of this subject
201
+ * newer than the subject's newest pending fact, names this digest, passes
202
+ * {@link overrideRefusal}, and is not spent (an applied record of its digest
203
+ * made at or after it). The newest counting line wins.
204
+ *
205
+ * Decide before recording a denial: an override written after an expired
206
+ * pending fact still counts, and a run that records a fresh fact first would
207
+ * make it older than the anchor.
208
+ */
209
+ export declare function decideOverride(input: OverrideInput): OverrideDecision;
210
+ /** The applied record a run appends before it applies under `override`, which spends it. Appending it is the caller's. */
211
+ export declare function appliedOverride(override: StandingOverride, at: {
212
+ timestamp: string;
213
+ runId?: string;
214
+ commit?: string;
215
+ }): AppliedOverrideRecord;
216
+ /**
217
+ * The applied records as applies for the audit reader
218
+ * (`@intentius/chant/lifecycle/gate-audit`), each citing the override it
219
+ * spent, so the trail shows an `override-spent` entry for it and a gap when
220
+ * the ledger holds no such override. A product that records its applies
221
+ * elsewhere cites the override on its own apply instead.
222
+ */
223
+ export declare function overrideAuditApplies(applied: readonly AppliedOverrideRecord[], path?: string): GateAuditApply[];
224
+ //# sourceMappingURL=override-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"override-gate.d.ts","sourceRoot":"","sources":["../src/override-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAOH,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEhF,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACvF,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D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E,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE;AAC9I,uHAAuH;GACrH;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC;AAEnI;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,CA6DrE;AAED,0HAA0H;AAC1H,wBAAgB,eAAe,CAAC,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAa7I;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,EAAE,IAAI,SAAmB,GAAG,cAAc,EAAE,CAUzH"}
@@ -1,20 +1,29 @@
1
1
  /**
2
- * What the pull-request loop (#3183) asks of a forge: keep one note on the
3
- * pull request up to date, set a commit status per stage, list who approved
4
- * the pull request, and find the pull request that merged a commit.
2
+ * What chant and the products built on it ask of a forge: keep one comment
3
+ * (a merge request note on GitLab) on a pull request up to date, set a commit
4
+ * status, keep one tracking issue in the repository, list who approved a pull
5
+ * request, and find the pull request that merged a commit.
5
6
  *
6
- * GitHub and Forgejo speak the same REST shapes for the first three, at
7
+ * The pull-request loop (#3183) uses the note, the status and the review
8
+ * calls. `reconcilePr`'s `comment` and `issue` finding modes post through the
9
+ * same clients (#3757), so a finding needs no `gh` on the runner. terragucci
10
+ * and SQL Yodeler post their own notes, statuses and drift issues through
11
+ * them too (#3759): bodies stay with each product, the finding by marker and
12
+ * the forge's REST shapes live here.
13
+ *
14
+ * GitHub and Forgejo speak the same REST shapes for most of this, at
7
15
  * different base URLs (`$GITHUB_API_URL` is right on both, #2305); they part
8
- * on the commit-to-pull-request lookup and on review states. GitLab has its
9
- * own API for all four. Each client takes a `fetch`, so the tests drive them
10
- * with a recording fake and no network.
16
+ * on the commit-to-pull-request lookup, on review states and on page size.
17
+ * GitLab has its own API for all of it. Each client takes a `fetch`, so the
18
+ * tests drive them with a recording fake and no network.
11
19
  *
12
20
  * A reviewer is named the way #3163 names a person: `github:<login>`,
13
21
  * `gitlab:<login>`, or `<forge>@<host>:<login>` off the forge's default host.
14
22
  * The apply compares that string with the approval's `resolvedBy`.
15
23
  *
16
24
  * Like `./pr-loop.ts`, this bundles without the TypeScript toolchain (#3421):
17
- * it imports nothing.
25
+ * it imports nothing but `node:fs`, to read a CI job's event payload.
26
+ * `./pr-forge-bundle.test.ts` holds it to that.
18
27
  */
19
28
  export type ForgeKind = "github" | "gitlab" | "forgejo";
20
29
  export declare const FORGE_KINDS: readonly ForgeKind[];
@@ -29,12 +38,84 @@ export type ForgeFetch = (url: string, init: {
29
38
  text(): Promise<string>;
30
39
  }>;
31
40
  export interface ForgeStatus {
32
- /** `chant/plan` or `chant/apply`. */
41
+ /** The status's name, such as `chant/plan` or `terragucci/plan`. */
33
42
  context: string;
34
43
  state: "pending" | "success" | "failure";
44
+ /** Cut to what the forge keeps: 140 characters on GitHub and Forgejo, 255 on GitLab. */
35
45
  description: string;
36
46
  /** The pipeline run, linked from the status. */
37
47
  url?: string;
48
+ /** GitLab only: the pipeline the status belongs to. */
49
+ pipelineId?: number;
50
+ }
51
+ /**
52
+ * How a comment or an issue is told to be the caller's own. By default the
53
+ * body starts with the marker, chant's recipe since #2291, and anyone may
54
+ * have written it.
55
+ */
56
+ export interface MarkerMatch {
57
+ /** `prefix` (the default): the body starts with the marker. `anywhere`: the body carries it. */
58
+ match?: "prefix" | "anywhere";
59
+ /**
60
+ * Only a comment or issue written by this login counts: `user.login` on
61
+ * GitHub and Forgejo, `author.username` on GitLab, compared without case.
62
+ * A merge request's author can write a note carrying any marker, so a
63
+ * product that reads its own notes back names its bot here.
64
+ */
65
+ author?: string;
66
+ }
67
+ /** What {@link PrForge.upsertComment} did. */
68
+ export interface CommentResult {
69
+ action: "created" | "updated" | "unchanged";
70
+ /** The comment's or note's id. */
71
+ id: number;
72
+ /** Its web URL, when the forge's answer carries one (GitHub and Forgejo do; a GitLab note does not). */
73
+ url?: string;
74
+ }
75
+ /** A comment or note {@link PrForge.findComment} read back. */
76
+ export interface FoundComment {
77
+ /** The comment's or note's id. */
78
+ id: number;
79
+ body: string;
80
+ /** Its web URL, when the forge's answer carries one (GitHub and Forgejo do; a GitLab note does not). */
81
+ url?: string;
82
+ }
83
+ /** A finding to keep in a tracking issue. `body` carries the marker. */
84
+ export interface IssueFinding {
85
+ title: string;
86
+ body: string;
87
+ }
88
+ export interface TrackIssueOptions extends MarkerMatch {
89
+ /**
90
+ * When the finding has cleared (`null`), close the open issue, after
91
+ * {@link clearComment} when one is given. Off by default: `reconcilePr`'s
92
+ * `issue` mode never closes an issue, and a closed one is never reopened,
93
+ * so the next finding opens a fresh issue.
94
+ */
95
+ closeOnClear?: boolean;
96
+ /** Posted on the issue before it is closed. */
97
+ clearComment?: string;
98
+ /**
99
+ * When the open issue counts as already current, in place of an equal
100
+ * title and body, for a body that names something that changes on every
101
+ * run (the run's URL, a timestamp). A string: unchanged when the titles
102
+ * are equal and the open issue's body carries it, such as the finding's
103
+ * fingerprint. A function: unchanged when it returns true for the open
104
+ * issue and the finding. An unchanged issue is not edited.
105
+ */
106
+ sameWhen?: string | ((open: IssueFinding, finding: IssueFinding) => boolean);
107
+ }
108
+ /** What {@link PrForge.trackIssue} did. */
109
+ export interface IssueResult {
110
+ /**
111
+ * `opened`, `updated`, or `unchanged` (title and body already current) for
112
+ * a finding; `closed`, `left` (open, `closeOnClear` off) or `none` (no open
113
+ * issue) for a cleared one.
114
+ */
115
+ action: "opened" | "updated" | "unchanged" | "closed" | "left" | "none";
116
+ /** The issue's number (GitHub, Forgejo) or iid (GitLab). */
117
+ number?: number;
118
+ url?: string;
38
119
  }
39
120
  export interface PrForge {
40
121
  kind: ForgeKind;
@@ -44,14 +125,51 @@ export interface PrForge {
44
125
  runUrl?: string;
45
126
  /** How #3163 names `login` on this forge. */
46
127
  principalOf(login: string): string;
47
- /** Update the note on `pr` whose body starts with `marker`, or add one. */
48
- upsertNote(pr: number, marker: string, body: string): Promise<void>;
128
+ /**
129
+ * Keep one comment on pull request `pr` (one note on merge request `pr`):
130
+ * the one {@link MarkerMatch} finds is updated, unless its body is already
131
+ * `body`, or one is added. `body` must carry the marker the same way, or
132
+ * the next run could not find it; that is refused before any call. Every
133
+ * page of comments is read, and GitLab's system notes are skipped. When
134
+ * several match, the oldest is kept.
135
+ */
136
+ upsertComment(pr: number, marker: string, body: string, opts?: MarkerMatch): Promise<CommentResult>;
137
+ /**
138
+ * {@link upsertComment} by prefix, without the body check, resolving to the
139
+ * comment's web URL. The pull-request loop's form.
140
+ */
141
+ upsertNote(pr: number, marker: string, body: string): Promise<string | undefined>;
142
+ /**
143
+ * The comment on pull request `pr` (the note on merge request `pr`) that
144
+ * {@link upsertComment} would update for `marker`: the oldest one that
145
+ * {@link MarkerMatch} finds, `author` honoured, so a pull request's author
146
+ * cannot plant one. Undefined when there is none. Every page is read, and
147
+ * GitLab's system notes are skipped.
148
+ */
149
+ findComment(pr: number, marker: string, opts?: MarkerMatch): Promise<FoundComment | undefined>;
49
150
  setStatus(sha: string, status: ForgeStatus): Promise<void>;
151
+ /**
152
+ * Keep one OPEN tracking issue for `marker` in line with `finding`: open
153
+ * it, update its title and body, or, when `finding` is `null` and
154
+ * `closeOnClear` is set, close it with a comment. Only open issues are
155
+ * read, so an issue closed by hand stays closed. Pull requests are never
156
+ * taken for issues. When several match, the oldest is kept.
157
+ */
158
+ trackIssue(marker: string, finding: IssueFinding | null, opts?: TrackIssueOptions): Promise<IssueResult>;
159
+ /**
160
+ * {@link trackIssue} by prefix for a finding, without the body check,
161
+ * resolving to the issue's web URL. `reconcilePr`'s `issue` mode's form.
162
+ */
163
+ upsertIssue(marker: string, title: string, body: string): Promise<string | undefined>;
50
164
  /** Logins whose standing review approves `pr`. */
51
165
  approvers(pr: number): Promise<string[]>;
52
166
  /** The merged pull request that produced `sha`, or null. */
53
167
  pullRequestFor(sha: string): Promise<number | null>;
54
168
  }
169
+ /** A GitHub or Forgejo client. */
170
+ export type GithubShapedForge = PrForge & {
171
+ kind: "github" | "forgejo";
172
+ };
55
173
  /** Thrown when a forge answers a call with an error status. */
56
174
  export declare class ForgeApiError extends Error {
57
175
  readonly method: string;
@@ -73,33 +191,121 @@ export interface GithubForgeOptions {
73
191
  fetch?: ForgeFetch;
74
192
  }
75
193
  /** A GitHub client (github.com or GitHub Enterprise Server). */
76
- export declare function githubForge(opts: GithubForgeOptions): PrForge;
194
+ export declare function githubForge(opts: GithubForgeOptions): GithubShapedForge;
77
195
  /** A Forgejo (or Gitea) client. `host` is required: Forgejo has no default host. */
78
196
  export declare function forgejoForge(opts: GithubForgeOptions & {
79
197
  host: string;
80
- }): PrForge;
198
+ }): GithubShapedForge;
81
199
  export interface GitlabForgeOptions {
82
200
  /** `$CI_API_V4_URL`. */
83
201
  apiBase: string;
84
202
  /** `$CI_PROJECT_ID`, or the URL-encoded path. */
85
203
  project: string;
86
204
  token: string;
205
+ /**
206
+ * The header the token goes in: `PRIVATE-TOKEN` (the default) for an
207
+ * access token, `JOB-TOKEN` for `CI_JOB_TOKEN`. One in the other's header
208
+ * is a 401.
209
+ */
210
+ tokenHeader?: "PRIVATE-TOKEN" | "JOB-TOKEN";
87
211
  /** Default gitlab.com. */
88
212
  host?: string;
89
213
  runUrl?: string;
90
214
  fetch?: ForgeFetch;
91
215
  }
92
- /** A GitLab client. The token needs the `api` scope: a job token cannot write merge-request notes. */
216
+ /**
217
+ * A GitLab client. Writing notes needs an access token with the `api` scope
218
+ * on most instances: the job token reaches only the endpoints the instance's
219
+ * job-token allowlist names.
220
+ */
93
221
  export declare function gitlabForge(opts: GitlabForgeOptions): PrForge;
94
222
  /** Thrown when the environment lacks what a forge client needs. */
95
223
  export declare class ForgeEnvironmentError extends Error {
96
- constructor(kind: ForgeKind, missing: string[]);
224
+ readonly kind: ForgeKind | undefined;
225
+ readonly missing: string[];
226
+ /**
227
+ * @param kind The forge, or undefined when the environment does not say which.
228
+ * @param missing What is missing, each naming the variable to set.
229
+ */
230
+ constructor(kind: ForgeKind | undefined, missing: string[]);
97
231
  }
98
232
  /**
99
- * A client for `kind` from the CI job's environment. The token is
100
- * `CHANT_FORGE_TOKEN` when set, else the forge's own: `GITHUB_TOKEN` (also
101
- * set on Forgejo Actions) or `GITLAB_TOKEN`. GitLab's `CI_JOB_TOKEN` cannot
102
- * write notes, so a GitLab pipeline names a project access token.
233
+ * A client for `kind` from the CI job's environment, as the pull-request
234
+ * loop reads it. The token is `CHANT_FORGE_TOKEN` when set, else the forge's
235
+ * own: `GITHUB_TOKEN` (also set on Forgejo Actions) or `GITLAB_TOKEN`.
236
+ * GitLab's `CI_JOB_TOKEN` cannot write notes, so a GitLab pipeline names a
237
+ * project access token. {@link forgeTargetFromEnv} is the general reading,
238
+ * with the finding modes' token order.
103
239
  */
104
240
  export declare function forgeFromEnv(kind: ForgeKind, env?: Record<string, string | undefined>, fetchImpl?: ForgeFetch): PrForge;
241
+ type Env = Record<string, string | undefined>;
242
+ /**
243
+ * The forge a CI job runs on, from its environment, or undefined outside a
244
+ * GitHub Actions, GitLab CI or Forgejo Actions job. Forgejo is told apart by
245
+ * `FORGEJO_ACTIONS` or `GITEA_ACTIONS`, or by a GitHub-style job whose
246
+ * `GITHUB_API_URL` ends in `/api/v1`, which GitHub never serves.
247
+ */
248
+ export declare function detectForge(env?: Env): ForgeKind | undefined;
249
+ /** Where a CI job posts: the forge, the repository, the token, and the pull request and commit when there are ones. */
250
+ export interface ForgeTarget {
251
+ kind: ForgeKind;
252
+ /** The REST base: `https://api.github.com`, `<host>/api/v3`, `<host>/api/v1`, or `<host>/api/v4`. */
253
+ apiBase: string;
254
+ /** `owner/name` on GitHub and Forgejo; the project id or path on GitLab. */
255
+ repo: string;
256
+ /** Lower-cased. */
257
+ host: string;
258
+ token: string;
259
+ /** The variable the token came from, for messages. Never the token itself. */
260
+ tokenSource: string;
261
+ /** GitLab: `JOB-TOKEN` when the token is `CI_JOB_TOKEN`, else `PRIVATE-TOKEN`. */
262
+ tokenHeader?: "PRIVATE-TOKEN" | "JOB-TOKEN";
263
+ /** The pull request's number, or the merge request's iid. */
264
+ pr?: number;
265
+ /** The commit a status belongs on: the pull request's head when the event names it. */
266
+ sha?: string;
267
+ /** The run, to link from a status. */
268
+ runUrl?: string;
269
+ }
270
+ export interface ForgeTargetOptions {
271
+ /** The forge, in place of {@link detectForge}. */
272
+ kind?: ForgeKind;
273
+ /** Read the token from this variable only, in place of the default order. */
274
+ tokenEnv?: string;
275
+ /** Refuse an environment with no pull or merge request. Default false. */
276
+ requirePr?: boolean;
277
+ /** Reads the event payload `GITHUB_EVENT_PATH` names. Default `node:fs`. */
278
+ readFile?: (path: string) => string;
279
+ }
280
+ /**
281
+ * The token order {@link forgeTargetFromEnv} reads, as guide/ops documents
282
+ * it: a chant-specific variable first, for posting to an instance other than
283
+ * the one the job runs on, then what the job already carries (#3802). A
284
+ * Forgejo job reads `FORGEJO_TOKEN` before the `GITHUB_*` names, and the
285
+ * GitHub row has its own chant variable rather than the Forgejo one.
286
+ */
287
+ export declare const FORGE_TOKEN_ORDER: Record<ForgeKind, readonly string[]>;
288
+ /**
289
+ * Where a CI job posts, read from its environment: the forge
290
+ * ({@link detectForge} unless `kind` is given), the repository, the REST
291
+ * base, the host, the token, and the pull request and its head commit when
292
+ * the run has them. Throws {@link ForgeEnvironmentError} naming every
293
+ * missing piece.
294
+ *
295
+ * - GitHub Actions: `GITHUB_REPOSITORY`, `GITHUB_API_URL` (default
296
+ * `https://api.github.com`), `GITHUB_SERVER_URL`; the pull request from
297
+ * the event payload at `GITHUB_EVENT_PATH` or `refs/pull/<n>/` in
298
+ * `GITHUB_REF`, its head from the payload, else `GITHUB_SHA`.
299
+ * - Forgejo Actions: the same, with `FORGEJO_*` read before `GITHUB_*`,
300
+ * and the REST base `<server>/api/v1` when no API URL is set.
301
+ * - GitLab CI: `CI_API_V4_URL` (or `CI_SERVER_URL/api/v4`), the merge
302
+ * request's project before the pipeline's (a fork's merge request runs in
303
+ * the fork), `CI_MERGE_REQUEST_IID`, `CI_COMMIT_SHA`, `CI_PIPELINE_URL`.
304
+ *
305
+ * The token is read in {@link FORGE_TOKEN_ORDER}, or from `tokenEnv` alone.
306
+ */
307
+ export declare function forgeTargetFromEnv(env?: Env, opts?: ForgeTargetOptions): ForgeTarget;
308
+ /** The client for a {@link ForgeTarget}, from {@link forgeTargetFromEnv} or built by hand. */
309
+ export declare function forgeClient(target: ForgeTarget, fetchImpl?: ForgeFetch): PrForge;
310
+ export {};
105
311
  //# sourceMappingURL=pr-forge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pr-forge.d.ts","sourceRoot":"","sources":["../src/pr-forge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExD,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAAoC,CAAC;AAEjF,wDAAwD;AACxD,MAAM,MAAM,UAAU,GAAG,CACvB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KACrE,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,CAA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gB,kBAAkB,CAAC,GAAG,GAAE,GAAiB,EAAE,IAAI,GAAE,kBAAuB,GAAG,WAAW,CAuErG;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,UAAU,GAAG,OAAO,CAgBhF"}
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * It is a test fixture and the package does not export it: chant never runs
10
10
  * a broker or listens on a port (ws-052, ws-086), so it lives under
11
- * `__fixtures__`, which test/no-listener.test.ts leaves out like a test file.
11
+ * `__fixtures__`, which test/no-listener.e2e.test.ts leaves out like a test file.
12
12
  * `startReferenceBroker(env)` has the shape of the suite's `start`.
13
13
  */
14
14
  import type { BrokerConformanceEnv, StartedBroker } from "../broker.js";
@@ -167,7 +167,7 @@ export type BrokerHttpHandler = (req: IncomingMessage, res: ServerResponse) => v
167
167
  /**
168
168
  * How the suite serves its upstreams: serve `handler` on a loopback port and
169
169
  * return its URL and how to stop it. The caller passes it because chant
170
- * itself never listens on a port (ws-052, ws-086, test/no-listener.test.ts);
170
+ * itself never listens on a port (ws-052, ws-086, test/no-listener.e2e.test.ts);
171
171
  * the test that runs the suite does.
172
172
  */
173
173
  export type BrokerListen = (handler: BrokerHttpHandler) => Promise<{
@@ -16,6 +16,7 @@
16
16
  * gate in its environment is the anchor, only approvals recorded since it and
17
17
  * for its plan count, and a gate with an `approval` block counts them with
18
18
  * `tallyGateApprovals`, as `describeApprovalProgress` does after an approve.
19
+ * Its human quorum reaches back to `humanQuorumSince` (#3206), as a run's does.
19
20
  */
20
21
  import { type GateApprovalRule } from "../op/gate.js";
21
22
  /** Why a member's gates can't be listed. Closed: a new code is a contract change. */
@@ -1 +1 @@
1
- {"version":3,"file":"status-gates.d.ts","sourceRoot":"","sources":["../../src/workspace/status-gates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG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