@wildorder/nightshift 0.5.0 → 0.7.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.
- package/LICENSE +21 -21
- package/dist/author.d.ts +13 -0
- package/dist/author.d.ts.map +1 -1
- package/dist/author.js +46 -13
- package/dist/author.js.map +1 -1
- package/dist/ci-init.d.ts +51 -0
- package/dist/ci-init.d.ts.map +1 -0
- package/dist/ci-init.js +274 -0
- package/dist/ci-init.js.map +1 -0
- package/dist/cli.js +99 -11
- package/dist/cli.js.map +1 -1
- package/dist/decide.d.ts +13 -5
- package/dist/decide.d.ts.map +1 -1
- package/dist/decide.js +50 -35
- package/dist/decide.js.map +1 -1
- package/dist/decider-review.d.ts +68 -1
- package/dist/decider-review.d.ts.map +1 -1
- package/dist/decider-review.js +211 -3
- package/dist/decider-review.js.map +1 -1
- package/dist/decision-ledger.d.ts +79 -1
- package/dist/decision-ledger.d.ts.map +1 -1
- package/dist/decision-ledger.js +118 -11
- package/dist/decision-ledger.js.map +1 -1
- package/dist/decision-view.d.ts +41 -0
- package/dist/decision-view.d.ts.map +1 -0
- package/dist/decision-view.js +264 -0
- package/dist/decision-view.js.map +1 -0
- package/dist/exit-codes.d.ts +44 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +49 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/findings.d.ts +3 -0
- package/dist/findings.d.ts.map +1 -1
- package/dist/findings.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +2 -2
- package/dist/program-branch.d.ts +65 -0
- package/dist/program-branch.d.ts.map +1 -0
- package/dist/program-branch.js +123 -0
- package/dist/program-branch.js.map +1 -0
- package/dist/programs-dir.d.ts +27 -0
- package/dist/programs-dir.d.ts.map +1 -0
- package/dist/programs-dir.js +52 -0
- package/dist/programs-dir.js.map +1 -0
- package/dist/publish.d.ts +105 -0
- package/dist/publish.d.ts.map +1 -0
- package/dist/publish.js +528 -0
- package/dist/publish.js.map +1 -0
- package/dist/report-path.d.ts +7 -0
- package/dist/report-path.d.ts.map +1 -0
- package/dist/report-path.js +10 -0
- package/dist/report-path.js.map +1 -0
- package/dist/review-pass.d.ts +33 -1
- package/dist/review-pass.d.ts.map +1 -1
- package/dist/review-pass.js +94 -42
- package/dist/review-pass.js.map +1 -1
- package/dist/run-program.d.ts +29 -3
- package/dist/run-program.d.ts.map +1 -1
- package/dist/run-program.js +431 -47
- package/dist/run-program.js.map +1 -1
- package/dist/run-publish.d.ts +41 -0
- package/dist/run-publish.d.ts.map +1 -0
- package/dist/run-publish.js +33 -0
- package/dist/run-publish.js.map +1 -0
- package/package.json +5 -4
- package/skills/plan-program/SKILL.md +14 -0
- package/templates/AGENTS.md +29 -29
- package/templates/CLAUDE.md +7 -7
- package/templates/vision.md +46 -46
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the decider escalated — an agent's decision and a routed
|
|
3
|
+
* finding alike. The one definition of "needs your attention", shared by the
|
|
4
|
+
* run report's section, the pull request's escalation comments, and the
|
|
5
|
+
* count the CLI prints when a run ends, so the three can never disagree
|
|
6
|
+
* about how many things are waiting for the human.
|
|
7
|
+
*/
|
|
8
|
+
export function escalatedRecords(ledger) {
|
|
9
|
+
return [
|
|
10
|
+
...ledger.decisions.filter((record) => record.status === "escalated"),
|
|
11
|
+
...ledger.findings.filter((record) => record.status === "escalated"),
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
const LEGACY_FINDING_TITLE_PREFIX = "Reviewer finding: ";
|
|
15
|
+
/** A `DecisionRecord` written by a pre-decision-legibility conversion of a finding. */
|
|
16
|
+
export function isLegacyFinding(record) {
|
|
17
|
+
return record.decision.title.startsWith(LEGACY_FINDING_TITLE_PREFIX);
|
|
18
|
+
}
|
|
19
|
+
function isFindingRecord(record) {
|
|
20
|
+
return "origin" in record && record.origin === "finding";
|
|
21
|
+
}
|
|
22
|
+
/** POSIX single-quote escaping: wraps in `'...'`, replacing each `'` with `'\''`. */
|
|
23
|
+
function shellQuoteSingle(value) {
|
|
24
|
+
return `'${value.replaceAll("'", String.raw `'\''`)}'`;
|
|
25
|
+
}
|
|
26
|
+
/** The single implementation of the `nightshift decide` flip command. */
|
|
27
|
+
export function flipCommand(programId, decisionId, chooseLabel, reason) {
|
|
28
|
+
return (`npx --yes @wildorder/nightshift decide ${programId} ${decisionId} ` +
|
|
29
|
+
`--choose ${shellQuoteSingle(chooseLabel)} --reason ${shellQuoteSingle(reason)}`);
|
|
30
|
+
}
|
|
31
|
+
function flipCommandBlock(command) {
|
|
32
|
+
return ["```", command, "```", ""];
|
|
33
|
+
}
|
|
34
|
+
function renderEvidenceLine(evidence) {
|
|
35
|
+
if (evidence.kind === "location") {
|
|
36
|
+
const range = evidence.endLine === undefined
|
|
37
|
+
? `${evidence.startLine}`
|
|
38
|
+
: `${evidence.startLine}-${evidence.endLine}`;
|
|
39
|
+
const location = `${evidence.file}:${range}`;
|
|
40
|
+
return evidence.excerpt === undefined
|
|
41
|
+
? location
|
|
42
|
+
: `${location} — ${evidence.excerpt}`;
|
|
43
|
+
}
|
|
44
|
+
if (evidence.kind === "concern") {
|
|
45
|
+
return evidence.detail === undefined
|
|
46
|
+
? evidence.named
|
|
47
|
+
: `${evidence.named} — ${evidence.detail}`;
|
|
48
|
+
}
|
|
49
|
+
return `${evidence.metric}: ${evidence.value}`;
|
|
50
|
+
}
|
|
51
|
+
function renderEvidenceList(evidence) {
|
|
52
|
+
if (evidence.length === 0)
|
|
53
|
+
return [];
|
|
54
|
+
return evidence.map((item) => `- ${renderEvidenceLine(item)}`);
|
|
55
|
+
}
|
|
56
|
+
const DECISION_STATUS_LABEL = {
|
|
57
|
+
unratified: "unratified",
|
|
58
|
+
ratified: "ratified",
|
|
59
|
+
escalated: "escalated",
|
|
60
|
+
"human-decided": "human-decided",
|
|
61
|
+
};
|
|
62
|
+
const FINDING_STATUS_LABEL = {
|
|
63
|
+
open: "open",
|
|
64
|
+
"fix-now": "fix-now",
|
|
65
|
+
accepted: "accepted",
|
|
66
|
+
escalated: "escalated",
|
|
67
|
+
"human-decided": "human-decided",
|
|
68
|
+
};
|
|
69
|
+
/** The triage vocabulary a finding can be flipped between (WS-05 wires decide's acceptance of it). */
|
|
70
|
+
const TRIAGE_LABELS = ["fix-now", "accept", "escalate"];
|
|
71
|
+
function currentFindingDisposition(record) {
|
|
72
|
+
if (record.humanChosen !== undefined)
|
|
73
|
+
return record.humanChosen;
|
|
74
|
+
switch (record.status) {
|
|
75
|
+
case "fix-now":
|
|
76
|
+
return "fix-now";
|
|
77
|
+
case "accepted":
|
|
78
|
+
return "accept";
|
|
79
|
+
case "escalated":
|
|
80
|
+
return "escalate";
|
|
81
|
+
default:
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
// Decisions
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
function renderDecisionCompact(record) {
|
|
89
|
+
const oneWay = record.oneWay ? " · one-way door" : "";
|
|
90
|
+
const chosen = record.humanChosen ?? record.decision.chosen;
|
|
91
|
+
const lines = [
|
|
92
|
+
`- **${record.decision.title}** (\`${record.id}\`) — ${DECISION_STATUS_LABEL[record.status]}`,
|
|
93
|
+
` - Workstream: ${record.workstream}${oneWay}`,
|
|
94
|
+
` - Chosen: ${chosen}`,
|
|
95
|
+
];
|
|
96
|
+
if (record.baseCommit !== undefined) {
|
|
97
|
+
lines.push(` - Anchor: \`${record.baseCommit}\``);
|
|
98
|
+
}
|
|
99
|
+
return lines;
|
|
100
|
+
}
|
|
101
|
+
function renderDecisionFull(record, opts) {
|
|
102
|
+
const oneWay = record.oneWay ? " · one-way door" : "";
|
|
103
|
+
const chosen = record.humanChosen ?? record.decision.chosen;
|
|
104
|
+
const alternatives = record.decision.options.filter((option) => option.label !== chosen);
|
|
105
|
+
const lines = [
|
|
106
|
+
`### ${record.decision.title} (\`${record.id}\`)`,
|
|
107
|
+
"",
|
|
108
|
+
`- **Status:** ${DECISION_STATUS_LABEL[record.status]}`,
|
|
109
|
+
`- **Workstream:** ${record.workstream}${oneWay}`,
|
|
110
|
+
`- **Context:** ${record.decision.context}`,
|
|
111
|
+
`- **Chosen:** ${chosen} — ${record.decision.rationale}`,
|
|
112
|
+
];
|
|
113
|
+
if (alternatives.length > 0) {
|
|
114
|
+
lines.push(`- **Alternatives:** ${alternatives
|
|
115
|
+
.map((option) => option.description === undefined
|
|
116
|
+
? option.label
|
|
117
|
+
: `${option.label} — ${option.description}`)
|
|
118
|
+
.join("; ")}`);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
lines.push("- **Alternatives:** (none listed)");
|
|
122
|
+
}
|
|
123
|
+
lines.push(`- **Decider says:** ${record.reviewRationale ?? "(no rationale recorded)"}`);
|
|
124
|
+
if (record.baseCommit !== undefined) {
|
|
125
|
+
lines.push(`- **Anchor commit:** \`${record.baseCommit}\``);
|
|
126
|
+
}
|
|
127
|
+
lines.push("");
|
|
128
|
+
if (alternatives.length > 0) {
|
|
129
|
+
lines.push("To flip this decision:", "");
|
|
130
|
+
for (const option of alternatives) {
|
|
131
|
+
const reason = `Overriding nightshift's choice for "${record.decision.title}" after review`;
|
|
132
|
+
lines.push(...flipCommandBlock(flipCommand(opts.programId, record.id, option.label, reason)));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return lines;
|
|
136
|
+
}
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
// Findings
|
|
139
|
+
// ---------------------------------------------------------------------------
|
|
140
|
+
function renderFindingCompact(record) {
|
|
141
|
+
const disposition = currentFindingDisposition(record) ?? "not yet triaged";
|
|
142
|
+
const lines = [
|
|
143
|
+
`- **${record.subject}** (\`${record.id}\`) — ${FINDING_STATUS_LABEL[record.status]}`,
|
|
144
|
+
` - Workstream: ${record.workstream}`,
|
|
145
|
+
` - Severity: ${record.severity} · Triage: ${disposition}`,
|
|
146
|
+
];
|
|
147
|
+
if (record.baseCommit !== undefined) {
|
|
148
|
+
lines.push(` - Anchor: \`${record.baseCommit}\``);
|
|
149
|
+
}
|
|
150
|
+
return lines;
|
|
151
|
+
}
|
|
152
|
+
function renderFindingFull(record, opts) {
|
|
153
|
+
const lines = [
|
|
154
|
+
`### ${record.subject} (\`${record.id}\`)`,
|
|
155
|
+
"",
|
|
156
|
+
`- **Status:** ${FINDING_STATUS_LABEL[record.status]}`,
|
|
157
|
+
`- **Severity:** ${record.severity}`,
|
|
158
|
+
`- **Category:** ${record.category}`,
|
|
159
|
+
`- **Workstream:** ${record.workstream}`,
|
|
160
|
+
`- **Why this is here:** ${record.message}`,
|
|
161
|
+
];
|
|
162
|
+
const evidenceLines = renderEvidenceList(record.evidence);
|
|
163
|
+
if (evidenceLines.length > 0) {
|
|
164
|
+
lines.push("- **Evidence:**", ...evidenceLines.map((line) => ` ${line}`));
|
|
165
|
+
}
|
|
166
|
+
if (record.status === "escalated") {
|
|
167
|
+
if (record.escalationAlternatives !== undefined && record.escalationAlternatives.length > 0) {
|
|
168
|
+
lines.push(`- **Alternatives:** ${record.escalationAlternatives
|
|
169
|
+
.map((option) => option.description === undefined
|
|
170
|
+
? option.label
|
|
171
|
+
: `${option.label} — ${option.description}`)
|
|
172
|
+
.join("; ")}`);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
lines.push("- **Alternatives:** (no alternatives were composed)");
|
|
176
|
+
}
|
|
177
|
+
const question = record.escalationQuestion?.trim();
|
|
178
|
+
lines.push(`- **Question:** ${question === undefined || question === "" ? "(no question was composed)" : record.escalationQuestion}`);
|
|
179
|
+
}
|
|
180
|
+
lines.push(`- **Decider says:** ${record.triageRationale ?? "(not yet triaged)"}`);
|
|
181
|
+
if (record.baseCommit !== undefined) {
|
|
182
|
+
lines.push(`- **Anchor commit:** \`${record.baseCommit}\``);
|
|
183
|
+
}
|
|
184
|
+
lines.push("");
|
|
185
|
+
const current = currentFindingDisposition(record);
|
|
186
|
+
const flipLabels = TRIAGE_LABELS.filter((label) => label !== current);
|
|
187
|
+
if (flipLabels.length > 0) {
|
|
188
|
+
lines.push("To flip this triage:", "");
|
|
189
|
+
for (const label of flipLabels) {
|
|
190
|
+
const reason = `Overriding nightshift's triage of "${record.subject}" after review`;
|
|
191
|
+
lines.push(...flipCommandBlock(flipCommand(opts.programId, record.id, label, reason)));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return lines;
|
|
195
|
+
}
|
|
196
|
+
// ---------------------------------------------------------------------------
|
|
197
|
+
// Legacy synthetic findings (a `DecisionRecord` from before finding-recorded)
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
function legacySubject(record) {
|
|
200
|
+
return record.decision.title.slice(LEGACY_FINDING_TITLE_PREFIX.length);
|
|
201
|
+
}
|
|
202
|
+
/** Only blocker/major ever routed; reversible:false was the one-way (blocker) marker. */
|
|
203
|
+
function legacySeverity(record) {
|
|
204
|
+
return record.oneWay ? "blocker" : "major";
|
|
205
|
+
}
|
|
206
|
+
function renderLegacyFindingCompact(record) {
|
|
207
|
+
const lines = [
|
|
208
|
+
`- **${legacySubject(record)}** (\`${record.id}\`) — ${DECISION_STATUS_LABEL[record.status]}`,
|
|
209
|
+
` - Workstream: ${record.workstream}`,
|
|
210
|
+
` - Severity: ${legacySeverity(record)} (legacy record)`,
|
|
211
|
+
];
|
|
212
|
+
if (record.baseCommit !== undefined) {
|
|
213
|
+
lines.push(` - Anchor: \`${record.baseCommit}\``);
|
|
214
|
+
}
|
|
215
|
+
return lines;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Renders the honest history a legacy finding actually carries: never the
|
|
219
|
+
* synthetic proceed/fix-now options or the invented `chosen: "proceed"` as
|
|
220
|
+
* though an agent weighed them (SC-06) — no flip command either, since that
|
|
221
|
+
* would offer the same fabricated choice back. Evidence was only ever a
|
|
222
|
+
* lossy parenthetical in the old shape, so the context prose is shown as-is.
|
|
223
|
+
*/
|
|
224
|
+
function renderLegacyFindingFull(record) {
|
|
225
|
+
const lines = [
|
|
226
|
+
`### ${legacySubject(record)} (\`${record.id}\`)`,
|
|
227
|
+
"",
|
|
228
|
+
`- **Status:** ${DECISION_STATUS_LABEL[record.status]}`,
|
|
229
|
+
`- **Severity:** ${legacySeverity(record)} (derived; recorded before findings carried structured severity)`,
|
|
230
|
+
`- **Workstream:** ${record.workstream}`,
|
|
231
|
+
`- **Why this is here:** ${record.decision.context}`,
|
|
232
|
+
"- **Evidence:** (recorded before findings carried structured evidence; see the prose above)",
|
|
233
|
+
`- **Decider says:** ${record.reviewRationale ?? "(no rationale recorded)"}`,
|
|
234
|
+
];
|
|
235
|
+
if (record.baseCommit !== undefined) {
|
|
236
|
+
lines.push(`- **Anchor commit:** \`${record.baseCommit}\``);
|
|
237
|
+
}
|
|
238
|
+
return lines;
|
|
239
|
+
}
|
|
240
|
+
// ---------------------------------------------------------------------------
|
|
241
|
+
// Dispatch
|
|
242
|
+
// ---------------------------------------------------------------------------
|
|
243
|
+
/**
|
|
244
|
+
* Dispatches: a `FindingRecord` renders as a finding; a legacy synthetic
|
|
245
|
+
* finding (a `DecisionRecord` whose title is `"Reviewer finding: …"`) renders
|
|
246
|
+
* as the history it is; any other `DecisionRecord` renders as an agent
|
|
247
|
+
* decision.
|
|
248
|
+
*/
|
|
249
|
+
export function renderRecord(record, opts) {
|
|
250
|
+
if (isFindingRecord(record)) {
|
|
251
|
+
return opts.density === "compact"
|
|
252
|
+
? renderFindingCompact(record)
|
|
253
|
+
: renderFindingFull(record, opts);
|
|
254
|
+
}
|
|
255
|
+
if (isLegacyFinding(record)) {
|
|
256
|
+
return opts.density === "compact"
|
|
257
|
+
? renderLegacyFindingCompact(record)
|
|
258
|
+
: renderLegacyFindingFull(record);
|
|
259
|
+
}
|
|
260
|
+
return opts.density === "compact"
|
|
261
|
+
? renderDecisionCompact(record)
|
|
262
|
+
: renderDecisionFull(record, opts);
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=decision-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-view.js","sourceRoot":"","sources":["../src/decision-view.ts"],"names":[],"mappings":"AAgCA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAA0B;IACzD,OAAO;QACL,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC;QACrE,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC;KACrE,CAAC;AACJ,CAAC;AAED,MAAM,2BAA2B,GAAG,oBAAoB,CAAC;AAEzD,uFAAuF;AACvF,MAAM,UAAU,eAAe,CAAC,MAAsB;IACpD,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,eAAe,CAAC,MAAwB;IAC/C,OAAO,QAAQ,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC;AAC3D,CAAC;AAED,qFAAqF;AACrF,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAA,MAAM,CAAC,GAAG,CAAC;AACxD,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,WAAW,CACzB,SAAiB,EACjB,UAAkB,EAClB,WAAmB,EACnB,MAAc;IAEd,OAAO,CACL,0CAA0C,SAAS,IAAI,UAAU,GAAG;QACpE,YAAY,gBAAgB,CAAC,WAAW,CAAC,aAAa,gBAAgB,CAAC,MAAM,CAAC,EAAE,CACjF,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CA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CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,8EAA8E;AAC9E,WAAW;AACX,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAwB,EACxB,IAAmB;IAEnB,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS;YAC/B,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC;YAC9B,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS;YAC/B,CAAC,CAAC,0BAA0B,CAAC,MAAM,CAAC;YACpC,CAAC,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS;QAC/B,CAAC,CAAC,qBAAqB,CAAC,MAAM,CAAC;QAC/B,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The process exit codes a `nightshift run` terminates with — the one place
|
|
3
|
+
* they are defined. A CI author and the generated GitHub Actions workflow
|
|
4
|
+
* (WS-05) both read these; there is exactly one source.
|
|
5
|
+
*
|
|
6
|
+
* 0 COMPLETE every workstream built; the handover is a clean PR.
|
|
7
|
+
* 2 PARTIAL the run terminated with a reviewable handover, but at
|
|
8
|
+
* least one workstream failed or was parked. A red job is
|
|
9
|
+
* the correct signal — the run report is worth reading.
|
|
10
|
+
* 3 COULD_NOT_START the run never began: a dependency cycle, a missing or
|
|
11
|
+
* invalid manifest, an unconfigured implementer, or a
|
|
12
|
+
* branch precondition refused before any agent spawned.
|
|
13
|
+
* There is no run report, because there was no run.
|
|
14
|
+
*
|
|
15
|
+
* 1 is deliberately NOT one of these three. It stays the generic "unexpected
|
|
16
|
+
* error" code that Node (uncaught throw) and Commander (usage error) already
|
|
17
|
+
* emit, so a tool crash or a mistyped command is never read as a run outcome.
|
|
18
|
+
*/
|
|
19
|
+
export declare const EXIT_CODES: {
|
|
20
|
+
readonly COMPLETE: 0;
|
|
21
|
+
readonly GENERIC: 1;
|
|
22
|
+
readonly PARTIAL: 2;
|
|
23
|
+
readonly COULD_NOT_START: 3;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Thrown for every condition that stops a run before it starts. The CLI maps
|
|
27
|
+
* it to EXIT_CODES.COULD_NOT_START; anything else thrown out of a run is a
|
|
28
|
+
* genuine, unclassified error and stays EXIT_CODES.GENERIC. The message is the
|
|
29
|
+
* actionable guidance the operator reads — keep it a single readable sentence,
|
|
30
|
+
* exactly as the guards already write it.
|
|
31
|
+
*/
|
|
32
|
+
export declare class CouldNotStartError extends Error {
|
|
33
|
+
readonly exitCode: 3;
|
|
34
|
+
constructor(message: string, options?: {
|
|
35
|
+
cause?: unknown;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** Complete → 0; partial → 2. The only mapping a returned run outcome needs. */
|
|
39
|
+
export declare function exitCodeForResult(result: {
|
|
40
|
+
complete: boolean;
|
|
41
|
+
}): number;
|
|
42
|
+
/** A could-not-start throw → 3; every other throw → the generic 1. */
|
|
43
|
+
export declare function exitCodeForError(error: unknown): number;
|
|
44
|
+
//# sourceMappingURL=exit-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AAEX;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,QAAQ,IAA8B;gBACnC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAEvE;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIvD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The process exit codes a `nightshift run` terminates with — the one place
|
|
3
|
+
* they are defined. A CI author and the generated GitHub Actions workflow
|
|
4
|
+
* (WS-05) both read these; there is exactly one source.
|
|
5
|
+
*
|
|
6
|
+
* 0 COMPLETE every workstream built; the handover is a clean PR.
|
|
7
|
+
* 2 PARTIAL the run terminated with a reviewable handover, but at
|
|
8
|
+
* least one workstream failed or was parked. A red job is
|
|
9
|
+
* the correct signal — the run report is worth reading.
|
|
10
|
+
* 3 COULD_NOT_START the run never began: a dependency cycle, a missing or
|
|
11
|
+
* invalid manifest, an unconfigured implementer, or a
|
|
12
|
+
* branch precondition refused before any agent spawned.
|
|
13
|
+
* There is no run report, because there was no run.
|
|
14
|
+
*
|
|
15
|
+
* 1 is deliberately NOT one of these three. It stays the generic "unexpected
|
|
16
|
+
* error" code that Node (uncaught throw) and Commander (usage error) already
|
|
17
|
+
* emit, so a tool crash or a mistyped command is never read as a run outcome.
|
|
18
|
+
*/
|
|
19
|
+
export const EXIT_CODES = {
|
|
20
|
+
COMPLETE: 0,
|
|
21
|
+
GENERIC: 1,
|
|
22
|
+
PARTIAL: 2,
|
|
23
|
+
COULD_NOT_START: 3,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Thrown for every condition that stops a run before it starts. The CLI maps
|
|
27
|
+
* it to EXIT_CODES.COULD_NOT_START; anything else thrown out of a run is a
|
|
28
|
+
* genuine, unclassified error and stays EXIT_CODES.GENERIC. The message is the
|
|
29
|
+
* actionable guidance the operator reads — keep it a single readable sentence,
|
|
30
|
+
* exactly as the guards already write it.
|
|
31
|
+
*/
|
|
32
|
+
export class CouldNotStartError extends Error {
|
|
33
|
+
exitCode = EXIT_CODES.COULD_NOT_START;
|
|
34
|
+
constructor(message, options) {
|
|
35
|
+
super(message, options);
|
|
36
|
+
this.name = "CouldNotStartError";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** Complete → 0; partial → 2. The only mapping a returned run outcome needs. */
|
|
40
|
+
export function exitCodeForResult(result) {
|
|
41
|
+
return result.complete ? EXIT_CODES.COMPLETE : EXIT_CODES.PARTIAL;
|
|
42
|
+
}
|
|
43
|
+
/** A could-not-start throw → 3; every other throw → the generic 1. */
|
|
44
|
+
export function exitCodeForError(error) {
|
|
45
|
+
return error instanceof CouldNotStartError
|
|
46
|
+
? EXIT_CODES.COULD_NOT_START
|
|
47
|
+
: EXIT_CODES.GENERIC;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=exit-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,eAAe,EAAE,CAAC;CACV,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC;IAC/C,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED,gFAAgF;AAChF,MAAM,UAAU,iBAAiB,CAAC,MAA6B;IAC7D,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;AACpE,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,KAAK,YAAY,kBAAkB;QACxC,CAAC,CAAC,UAAU,CAAC,eAAe;QAC5B,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;AACzB,CAAC"}
|
package/dist/findings.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ export type Evidence = {
|
|
|
23
23
|
startLine: number;
|
|
24
24
|
endLine?: number;
|
|
25
25
|
excerpt?: string;
|
|
26
|
+
/** Set by the runner's deterministic existence check when `file` does not
|
|
27
|
+
* resolve to a path inside the repository. Never set by the reviewer. */
|
|
28
|
+
unverifiable?: boolean;
|
|
26
29
|
} | {
|
|
27
30
|
kind: "concern";
|
|
28
31
|
named: string;
|
package/dist/findings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findings.d.ts","sourceRoot":"","sources":["../src/findings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;AAElE,eAAO,MAAM,cAAc,EAAE,SAAS,QAAQ,EAKpC,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,8KAWrB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAChB;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"findings.d.ts","sourceRoot":"","sources":["../src/findings.ts"],"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C,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,MAAe,EAAY,EAAE,CAAC,CAAC;IACpE,IAAI,EAAE,SAAS;IACf,KAAK;IACL,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,MAAiC,EACjC,KAAa,EACH,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,13 +10,20 @@ export * from "./worktree-guard.js";
|
|
|
10
10
|
export * from "./detect-package-manager.js";
|
|
11
11
|
export * from "./decision.js";
|
|
12
12
|
export * from "./decision-ledger.js";
|
|
13
|
+
export type { FindingStatus } from "./decision-ledger.js";
|
|
14
|
+
export * from "./decision-view.js";
|
|
13
15
|
export * from "./manifest.js";
|
|
14
16
|
export * from "./author.js";
|
|
15
17
|
export * from "./run-program.js";
|
|
18
|
+
export * from "./publish.js";
|
|
19
|
+
export * from "./run-publish.js";
|
|
20
|
+
export * from "./report-path.js";
|
|
16
21
|
export * from "./decide.js";
|
|
17
22
|
export * from "./init-project.js";
|
|
18
23
|
export * from "./install-skills.js";
|
|
19
24
|
export * from "./install-prefs.js";
|
|
20
25
|
export * from "./install-wizard.js";
|
|
21
26
|
export * from "./package-assets.js";
|
|
27
|
+
export * from "./exit-codes.js";
|
|
28
|
+
export * from "./ci-init.js";
|
|
22
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AAIrC,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,13 +10,19 @@ export * from "./worktree-guard.js";
|
|
|
10
10
|
export * from "./detect-package-manager.js";
|
|
11
11
|
export * from "./decision.js";
|
|
12
12
|
export * from "./decision-ledger.js";
|
|
13
|
+
export * from "./decision-view.js";
|
|
13
14
|
export * from "./manifest.js";
|
|
14
15
|
export * from "./author.js";
|
|
15
16
|
export * from "./run-program.js";
|
|
17
|
+
export * from "./publish.js";
|
|
18
|
+
export * from "./run-publish.js";
|
|
19
|
+
export * from "./report-path.js";
|
|
16
20
|
export * from "./decide.js";
|
|
17
21
|
export * from "./init-project.js";
|
|
18
22
|
export * from "./install-skills.js";
|
|
19
23
|
export * from "./install-prefs.js";
|
|
20
24
|
export * from "./install-wizard.js";
|
|
21
25
|
export * from "./package-assets.js";
|
|
26
|
+
export * from "./exit-codes.js";
|
|
27
|
+
export * from "./ci-init.js";
|
|
22
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AAKrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -12,10 +12,10 @@ declare const workstreamSchema: z.ZodObject<{
|
|
|
12
12
|
name: z.ZodString;
|
|
13
13
|
taskFile: z.ZodString;
|
|
14
14
|
status: z.ZodDefault<z.ZodEnum<{
|
|
15
|
+
failed: "failed";
|
|
15
16
|
not_started: "not_started";
|
|
16
17
|
in_progress: "in_progress";
|
|
17
18
|
complete: "complete";
|
|
18
|
-
failed: "failed";
|
|
19
19
|
parked: "parked";
|
|
20
20
|
}>>;
|
|
21
21
|
commit: z.ZodOptional<z.ZodString>;
|
|
@@ -51,10 +51,10 @@ declare const manifestSchema: z.ZodObject<{
|
|
|
51
51
|
name: z.ZodString;
|
|
52
52
|
taskFile: z.ZodString;
|
|
53
53
|
status: z.ZodDefault<z.ZodEnum<{
|
|
54
|
+
failed: "failed";
|
|
54
55
|
not_started: "not_started";
|
|
55
56
|
in_progress: "in_progress";
|
|
56
57
|
complete: "complete";
|
|
57
|
-
failed: "failed";
|
|
58
58
|
parked: "parked";
|
|
59
59
|
}>>;
|
|
60
60
|
commit: z.ZodOptional<z.ZodString>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fixed prefix for every program branch. Not a config key — the charter
|
|
3
|
+
* keeps tuning knobs off the config surface, and a second source of truth
|
|
4
|
+
* next to this function is exactly what this module exists to prevent.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PROGRAM_BRANCH_PREFIX = "program/";
|
|
7
|
+
/**
|
|
8
|
+
* The one place a program ID becomes a branch name. The runner's
|
|
9
|
+
* preconditions and the branch command both call this; nothing else derives
|
|
10
|
+
* a branch name anywhere in the codebase.
|
|
11
|
+
*/
|
|
12
|
+
export declare function programBranchName(programId: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Git operations the branch command and the default-branch heuristic need,
|
|
15
|
+
* injectable so tests can force a specific state. The default implementation
|
|
16
|
+
* shells out to real git; tests otherwise drive real temporary repositories.
|
|
17
|
+
*/
|
|
18
|
+
export interface ProgramBranchGit {
|
|
19
|
+
isRepository(cwd: string): Promise<boolean>;
|
|
20
|
+
/** undefined when HEAD is detached. */
|
|
21
|
+
currentBranch(cwd: string): Promise<string | undefined>;
|
|
22
|
+
localBranchExists(cwd: string, branch: string): Promise<boolean>;
|
|
23
|
+
/** `origin/HEAD`'s target, with the leading `origin/` stripped; undefined when unset. */
|
|
24
|
+
originHeadBranch(cwd: string): Promise<string | undefined>;
|
|
25
|
+
/** `git config init.defaultBranch`; undefined when unset. */
|
|
26
|
+
configDefaultBranch(cwd: string): Promise<string | undefined>;
|
|
27
|
+
/** Switches to an existing local branch; never discards uncommitted work. */
|
|
28
|
+
switchTo(cwd: string, branch: string): Promise<void>;
|
|
29
|
+
/** Creates a branch from HEAD and switches to it; never discards uncommitted work. */
|
|
30
|
+
createAndSwitch(cwd: string, branch: string): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare const defaultProgramBranchGit: ProgramBranchGit;
|
|
33
|
+
export interface CreateOrSwitchProgramBranchOptions {
|
|
34
|
+
cwd?: string;
|
|
35
|
+
git?: ProgramBranchGit;
|
|
36
|
+
}
|
|
37
|
+
export interface CreateOrSwitchProgramBranchResult {
|
|
38
|
+
action: "created" | "switched";
|
|
39
|
+
branch: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a program's branch and switches to it, or switches to it when a
|
|
43
|
+
* prior run already made it, and reports which. Never discards uncommitted
|
|
44
|
+
* work: creating carries the working tree onto the new branch, and switching
|
|
45
|
+
* to an existing branch with conflicting local changes surfaces git's own
|
|
46
|
+
* refusal rather than overriding it.
|
|
47
|
+
*/
|
|
48
|
+
export declare function createOrSwitchProgramBranch(programId: string, options?: CreateOrSwitchProgramBranchOptions): Promise<CreateOrSwitchProgramBranchResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Resolves the repository's default branch name, in order: `origin/HEAD`,
|
|
51
|
+
* then the first of `main`/`master` that exists locally, then
|
|
52
|
+
* `init.defaultBranch`, then `"main"`.
|
|
53
|
+
*
|
|
54
|
+
* This is a heuristic, not a guarantee. It is authoritative when
|
|
55
|
+
* `origin/HEAD` is set and correct for the common `main`/`master` local
|
|
56
|
+
* repositories, but it cannot identify a custom default (say `trunk`) with
|
|
57
|
+
* neither `origin/HEAD` nor a matching `init.defaultBranch` — it will return
|
|
58
|
+
* `main` in that case. This does not create a safety hole: the run
|
|
59
|
+
* preconditions in `run-program.ts` never rely on this alone. If this
|
|
60
|
+
* function misnames the default, the wrong-branch precondition still refuses
|
|
61
|
+
* a run on any branch that is not the one derived from the program ID; only
|
|
62
|
+
* the specificity of the refusal message degrades.
|
|
63
|
+
*/
|
|
64
|
+
export declare function detectDefaultBranch(cwd: string, git?: ProgramBranchGit): Promise<string>;
|
|
65
|
+
//# sourceMappingURL=program-branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program-branch.d.ts","sourceRoot":"","sources":["../src/program-branch.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,GAAG,EAAE,MAAM,GAA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