@sprigr/apps-fleet-conventions 0.1.0 → 0.2.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/dist/index.d.ts +36 -1
- package/dist/index.js +8 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -173,6 +173,41 @@ declare function isUnactionableRuling(body: string): boolean;
|
|
|
173
173
|
* sample), as does anything not opening with the reviewer's own prefix.
|
|
174
174
|
*/
|
|
175
175
|
declare function isMalformedVerdictPost(body: string): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* POST-TIME ONLY: this body would post but be INVISIBLE to the reader.
|
|
178
|
+
*
|
|
179
|
+
* `isMalformedVerdictPost` fails open when a verdict's `VERDICT:` line sits
|
|
180
|
+
* beyond `VERDICT_STATEMENT_WINDOW` (800) chars, which is exactly how the two
|
|
181
|
+
* #12926 duplicate-verdict pairs got through: the reviewer posted a long-form
|
|
182
|
+
* verdict whose ruling landed thousands of chars down (platform#157,
|
|
183
|
+
* `VERDICT:` at offset 2467) or placed the identity prefix ABOVE the machine
|
|
184
|
+
* marker (platform#148). Both carried the marker, both failed
|
|
185
|
+
* `TECH_LEAD_VERDICT_FORM_RE`, both posted, and the merge gate / router / the
|
|
186
|
+
* review-gate then saw no verdict — so the reviewer had to repost a canonical
|
|
187
|
+
* copy, producing the duplicate. A long-form REQUEST_CHANGES is worse: it is
|
|
188
|
+
* absent to the merge gate (reads as "no verdict") until someone reposts it.
|
|
189
|
+
*
|
|
190
|
+
* This predicate is the reader's complement with NO window, for the one shape
|
|
191
|
+
* the window cannot safely cover: a body that opens as the reviewer's OWN
|
|
192
|
+
* comment (`REVIEWER_ANCHOR_RE`, which a `[dev-fixer]` note quoting a verdict
|
|
193
|
+
* does not match) and carries the machine marker. The marker is the safe
|
|
194
|
+
* signal — by contract only a real verdict carries it, and prose that merely
|
|
195
|
+
* QUOTES a verdict never does — so a marker-carrying reviewer body the reader
|
|
196
|
+
* cannot parse is an invisible verdict wherever its ruling sits, and
|
|
197
|
+
* tag-before-marker is caught the same way (the marker is still present).
|
|
198
|
+
*
|
|
199
|
+
* For a MARKER-LESS reviewer body it defers to `isMalformedVerdictPost`'s
|
|
200
|
+
* 800-char window unchanged: that window exists so a long reviewer consult
|
|
201
|
+
* that QUOTES `VERDICT:` deep in its prose still posts (#6484 / #7653), and
|
|
202
|
+
* dropping it here would refuse those. So a marker-less deep quote under the
|
|
203
|
+
* reviewer's own anchor keeps posting, exactly as today.
|
|
204
|
+
*
|
|
205
|
+
* (Narrower than one reading of the #12926 fix sketch, which would refuse any
|
|
206
|
+
* reviewer-anchored body with a `VERDICT:` ANYWHERE: that re-introduces the
|
|
207
|
+
* deep-quote regression the window was added to prevent. The marker clause
|
|
208
|
+
* catches every observed #12926 case without it.)
|
|
209
|
+
*/
|
|
210
|
+
declare function wouldPostInvisibleVerdict(body: string): boolean;
|
|
176
211
|
/** The head SHA a verdict names, from whichever form it used. */
|
|
177
212
|
declare function verdictNamedSha(body: string): string | undefined;
|
|
178
213
|
|
|
@@ -241,4 +276,4 @@ declare function shardParityForAgentSlug(slug: string | null | undefined): Shard
|
|
|
241
276
|
*/
|
|
242
277
|
declare function isInShard(issueNumber: number, parity: ShardParity): boolean;
|
|
243
278
|
|
|
244
|
-
export { FLEET_SHARD_OWNERS, type ShardParity, TECH_LEAD_VERDICT_FORM_RE, TECH_LEAD_VERDICT_RE, type TechLeadRuling, type TechLeadVerdict, VERDICT_MARKER_RE, VERDICT_MARKER_STRIP_RE, isInShard, isMalformedVerdictPost, isUnactionableRuling, isUnparsedVerdictShaped, issueShardParity, normalizeVerdictRuling, parseAnchoredVerdictRuling, parseTechLeadVerdict, shardParityForAgentSlug, verdictNamedSha };
|
|
279
|
+
export { FLEET_SHARD_OWNERS, type ShardParity, TECH_LEAD_VERDICT_FORM_RE, TECH_LEAD_VERDICT_RE, type TechLeadRuling, type TechLeadVerdict, VERDICT_MARKER_RE, VERDICT_MARKER_STRIP_RE, isInShard, isMalformedVerdictPost, isUnactionableRuling, isUnparsedVerdictShaped, issueShardParity, normalizeVerdictRuling, parseAnchoredVerdictRuling, parseTechLeadVerdict, shardParityForAgentSlug, verdictNamedSha, wouldPostInvisibleVerdict };
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,12 @@ function isMalformedVerdictPost(body) {
|
|
|
28
28
|
if (!/VERDICT:/i.test(body.slice(0, VERDICT_STATEMENT_WINDOW))) return false;
|
|
29
29
|
return !TECH_LEAD_VERDICT_FORM_RE.test(body);
|
|
30
30
|
}
|
|
31
|
+
function wouldPostInvisibleVerdict(body) {
|
|
32
|
+
if (TECH_LEAD_VERDICT_FORM_RE.test(body)) return false;
|
|
33
|
+
if (!REVIEWER_ANCHOR_RE.test(body)) return false;
|
|
34
|
+
if (VERDICT_MARKER_RE.test(body)) return true;
|
|
35
|
+
return isMalformedVerdictPost(body);
|
|
36
|
+
}
|
|
31
37
|
var VERDICT_HEAD_SHA_PATTERNS = [
|
|
32
38
|
// Canonical machine marker. seed-fleet-agents.ts mandates it as the FIRST
|
|
33
39
|
// line of every verdict ("<!-- verdict sha=<7-char head SHA> -->") and calls
|
|
@@ -85,5 +91,6 @@ export {
|
|
|
85
91
|
parseAnchoredVerdictRuling,
|
|
86
92
|
parseTechLeadVerdict,
|
|
87
93
|
shardParityForAgentSlug,
|
|
88
|
-
verdictNamedSha
|
|
94
|
+
verdictNamedSha,
|
|
95
|
+
wouldPostInvisibleVerdict
|
|
89
96
|
};
|
package/package.json
CHANGED