@pome-sh/cli 0.18.0 → 0.20.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/build-info.json +3 -3
- package/dist/src/capture-server/index.js +1 -1
- package/dist/src/runner/mergeAdapterSignals.d.ts +23 -0
- package/dist/src/runner/mergeAdapterSignals.js +45 -3
- package/dist/src/scaffolds/mcp-loop/loop.js +3 -3
- package/node_modules/@hono/node-server/README.md +47 -1
- package/node_modules/@hono/node-server/dist/early-hints.cjs +35 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.cts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.mts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.mjs +33 -0
- package/node_modules/@hono/node-server/dist/index.cjs +10 -6
- package/node_modules/@hono/node-server/dist/index.mjs +10 -6
- package/node_modules/@hono/node-server/package.json +14 -3
- package/node_modules/@pome-sh/sdk/dist/check-state-path.d.ts +71 -0
- package/node_modules/@pome-sh/sdk/dist/check-state-path.js +200 -0
- package/node_modules/@pome-sh/sdk/dist/check-state-path.js.map +1 -0
- package/node_modules/@pome-sh/sdk/dist/checks.d.ts +2 -0
- package/node_modules/@pome-sh/sdk/dist/checks.js +5 -0
- package/node_modules/@pome-sh/sdk/dist/checks.js.map +1 -1
- package/node_modules/@pome-sh/sdk/dist/recorder.d.ts +10 -1
- package/node_modules/@pome-sh/sdk/dist/recorder.js +11 -2
- package/node_modules/@pome-sh/sdk/dist/recorder.js.map +1 -1
- package/node_modules/@pome-sh/sdk/package.json +4 -4
- package/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +111 -24
- package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +3 -3
- package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +6 -3
- package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +7 -2
- package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +1 -1
- package/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +68 -4
- package/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +19 -5
- package/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +60 -28
- package/node_modules/@pome-sh/shared-types/dist/recorder-events.js +81 -10
- package/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/package.json +1 -1
- package/node_modules/@pome-sh/shared-types/trace-contract.json +49 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-issues.js +35 -9
- package/node_modules/@pome-sh/twin-github/dist/src/check-issues.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-pulls.js +21 -5
- package/node_modules/@pome-sh/twin-github/dist/src/check-pulls.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-repos.d.ts +3 -0
- package/node_modules/@pome-sh/twin-github/dist/src/check-repos.js +111 -6
- package/node_modules/@pome-sh/twin-github/dist/src/check-repos.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-state.d.ts +21 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-state.js +77 -10
- package/node_modules/@pome-sh/twin-github/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/checks.d.ts +2 -0
- package/node_modules/@pome-sh/twin-github/dist/src/checks.js +5 -1
- package/node_modules/@pome-sh/twin-github/dist/src/checks.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/package.json +6 -6
- package/node_modules/@pome-sh/twin-gmail/CHANGELOG.md +36 -0
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-drafts.js +19 -4
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-drafts.js.map +1 -1
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-labels.js +15 -4
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-labels.js.map +1 -1
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-messages.js +19 -3
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-messages.js.map +1 -1
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-state.d.ts +26 -1
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-state.js +52 -16
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-gmail/package.json +5 -5
- package/node_modules/@pome-sh/twin-linear/CHANGELOG.md +36 -0
- package/node_modules/@pome-sh/twin-linear/dist/src/check-comments.js +15 -3
- package/node_modules/@pome-sh/twin-linear/dist/src/check-comments.js.map +1 -1
- package/node_modules/@pome-sh/twin-linear/dist/src/check-issues.js +31 -4
- package/node_modules/@pome-sh/twin-linear/dist/src/check-issues.js.map +1 -1
- package/node_modules/@pome-sh/twin-linear/dist/src/check-state.d.ts +27 -2
- package/node_modules/@pome-sh/twin-linear/dist/src/check-state.js +73 -20
- package/node_modules/@pome-sh/twin-linear/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-linear/package.json +5 -5
- package/node_modules/@pome-sh/twin-slack/dist/src/check-messages.js +28 -7
- package/node_modules/@pome-sh/twin-slack/dist/src/check-messages.js.map +1 -1
- package/node_modules/@pome-sh/twin-slack/dist/src/check-secrets.js +16 -3
- package/node_modules/@pome-sh/twin-slack/dist/src/check-secrets.js.map +1 -1
- package/node_modules/@pome-sh/twin-slack/dist/src/check-state.d.ts +26 -1
- package/node_modules/@pome-sh/twin-slack/dist/src/check-state.js +31 -4
- package/node_modules/@pome-sh/twin-slack/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-slack/package.json +6 -6
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-payments.d.ts +1 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-payments.js +16 -0
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-payments.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-refunds.js +11 -3
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-refunds.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-state.d.ts +25 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-state.js +31 -3
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/package.json +6 -6
- package/node_modules/hono/dist/cjs/context.js +28 -13
- package/node_modules/hono/dist/cjs/helper/proxy/index.js +4 -0
- package/node_modules/hono/dist/cjs/hono-base.js +3 -2
- package/node_modules/hono/dist/cjs/jsx/base.js +27 -23
- package/node_modules/hono/dist/cjs/jsx/hooks/index.js +16 -13
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +103 -8
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +5 -0
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +2 -2
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +9 -4
- package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +9 -4
- package/node_modules/hono/dist/cjs/middleware/language/language.js +10 -6
- package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +90 -0
- package/node_modules/hono/dist/cjs/request.js +6 -8
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +55 -56
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +64 -85
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +13 -5
- package/node_modules/hono/dist/cjs/router.js +1 -1
- package/node_modules/hono/dist/cjs/utils/cookie.js +3 -2
- package/node_modules/hono/dist/cjs/utils/url.js +7 -7
- package/node_modules/hono/dist/context.js +28 -13
- package/node_modules/hono/dist/helper/proxy/index.js +4 -0
- package/node_modules/hono/dist/hono-base.js +3 -2
- package/node_modules/hono/dist/jsx/base.js +27 -23
- package/node_modules/hono/dist/jsx/hooks/index.js +16 -13
- package/node_modules/hono/dist/middleware/cache/index.js +103 -8
- package/node_modules/hono/dist/middleware/compress/index.js +5 -0
- package/node_modules/hono/dist/middleware/cors/index.js +2 -2
- package/node_modules/hono/dist/middleware/etag/index.js +1 -1
- package/node_modules/hono/dist/middleware/jwk/jwk.js +9 -4
- package/node_modules/hono/dist/middleware/jwt/jwt.js +9 -4
- package/node_modules/hono/dist/middleware/language/language.js +10 -6
- package/node_modules/hono/dist/middleware/method-not-allowed/index.js +68 -0
- package/node_modules/hono/dist/request.js +7 -9
- package/node_modules/hono/dist/router/reg-exp-router/node.js +55 -56
- package/node_modules/hono/dist/router/reg-exp-router/router.js +64 -85
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +13 -5
- package/node_modules/hono/dist/router.js +1 -1
- package/node_modules/hono/dist/types/client/types.d.ts +1 -1
- package/node_modules/hono/dist/types/hono-base.d.ts +4 -3
- package/node_modules/hono/dist/types/jsx/base.d.ts +4 -2
- package/node_modules/hono/dist/types/jsx/dom/index.d.ts +5 -5
- package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/dom/server.d.ts +5 -5
- package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +8 -6
- package/node_modules/hono/dist/types/jsx/index.d.ts +5 -5
- package/node_modules/hono/dist/types/middleware/cache/index.d.ts +6 -4
- package/node_modules/hono/dist/types/middleware/cors/index.d.ts +1 -1
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -2
- package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +49 -0
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +1 -1
- package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +2 -1
- package/node_modules/hono/dist/types/router.d.ts +1 -1
- package/node_modules/hono/dist/types/utils/headers.d.ts +2 -2
- package/node_modules/hono/dist/types/utils/url.d.ts +1 -0
- package/node_modules/hono/dist/utils/cookie.js +4 -3
- package/node_modules/hono/dist/utils/url.js +5 -6
- package/node_modules/hono/package.json +10 -3
- package/package.json +21 -21
|
@@ -22,19 +22,48 @@
|
|
|
22
22
|
// - `repository.labels` (definitions) and `issue.labels` (applied) are
|
|
23
23
|
// different sets. Confusing them is the defect `github.no-new-labels`'s
|
|
24
24
|
// description exists to prevent.
|
|
25
|
+
//
|
|
26
|
+
// F-1197 — the resolvers below also return the POINTER they walked, so a check
|
|
27
|
+
// can cite where it looked. Nothing else about them changed; the shapes above
|
|
28
|
+
// are still the only thing that decides how the tree is read.
|
|
29
|
+
import { childStatePath, statePath } from "@pome-sh/sdk/checks";
|
|
25
30
|
// `ref` is always `owner/name` — the `repoRef` param type will not parse
|
|
26
31
|
// anything else — so there is deliberately no bare-name branch here. The
|
|
27
32
|
// owner/name fallback is for a state export that somehow omits `full_name`,
|
|
28
33
|
// not for a bare-name reference, which cannot reach this function.
|
|
34
|
+
//
|
|
35
|
+
// F-1197 — it returns the INDEX beside the row. The index is not decoration: a
|
|
36
|
+
// check cites where it looked as a JSON Pointer, and a pointer into an array
|
|
37
|
+
// needs the position the walk actually stopped at. Computing it here, in the
|
|
38
|
+
// same loop that decides which repo matched, is what keeps the citation and the
|
|
39
|
+
// verdict describing the same row — a second `findIndex` at the call site would
|
|
40
|
+
// be a second copy of the `full_name` / `owner+name` fallback, free to drift.
|
|
29
41
|
export function findRepo(state, ref) {
|
|
30
|
-
|
|
42
|
+
const repositories = state.repositories ?? [];
|
|
43
|
+
for (const [index, repo] of repositories.entries()) {
|
|
31
44
|
if (repo.full_name === ref)
|
|
32
|
-
return repo;
|
|
33
|
-
if (repo.owner != null && repo.name != null && `${repo.owner}/${repo.name}` === ref)
|
|
34
|
-
return repo;
|
|
45
|
+
return { repo, index };
|
|
46
|
+
if (repo.owner != null && repo.name != null && `${repo.owner}/${repo.name}` === ref) {
|
|
47
|
+
return { repo, index };
|
|
48
|
+
}
|
|
35
49
|
}
|
|
36
50
|
return null;
|
|
37
51
|
}
|
|
52
|
+
// The issue NUMBERS a repository export carries. `github.no-new-issues` compares
|
|
53
|
+
// these across the seed/final delta, and it compares numbers rather than titles
|
|
54
|
+
// for the reason its own description states: a duplicate issue usually carries
|
|
55
|
+
// the same title as the one it duplicates, so any human-authored field would let
|
|
56
|
+
// the duplicate hide behind its own likeness. A row with no usable number is
|
|
57
|
+
// dropped rather than counted as `NaN`, which would compare unequal to itself
|
|
58
|
+
// and read as a newly created issue on every run.
|
|
59
|
+
export function issueNumbers(repo) {
|
|
60
|
+
const numbers = new Set();
|
|
61
|
+
for (const issue of repo.issues ?? []) {
|
|
62
|
+
if (typeof issue.number === "number" && Number.isFinite(issue.number))
|
|
63
|
+
numbers.add(issue.number);
|
|
64
|
+
}
|
|
65
|
+
return numbers;
|
|
66
|
+
}
|
|
38
67
|
export function labelNames(repo) {
|
|
39
68
|
const names = new Set();
|
|
40
69
|
for (const label of repo.labels ?? []) {
|
|
@@ -43,23 +72,61 @@ export function labelNames(repo) {
|
|
|
43
72
|
}
|
|
44
73
|
return names;
|
|
45
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* The `failed` outcome a missing entity produces, citing where the lookup
|
|
77
|
+
* looked.
|
|
78
|
+
*
|
|
79
|
+
* One function rather than a conditional spread at every `if ("missing" in …)`
|
|
80
|
+
* site, because the rule it encodes — cite the searched collection, cite nothing
|
|
81
|
+
* when there was none — is one rule, and twelve hand-written copies of it is
|
|
82
|
+
* twelve chances for one to quietly drop the citation.
|
|
83
|
+
*/
|
|
84
|
+
export function missOutcome(miss) {
|
|
85
|
+
if (miss.searched === undefined)
|
|
86
|
+
return { passed: false, reason: miss.missing };
|
|
87
|
+
return { passed: false, reason: miss.missing, evidenceStatePaths: [miss.searched] };
|
|
88
|
+
}
|
|
46
89
|
export function resolveRepo(state, ref, where) {
|
|
47
|
-
const
|
|
48
|
-
|
|
90
|
+
const hit = findRepo(state, ref);
|
|
91
|
+
if (hit)
|
|
92
|
+
return { found: hit.repo, path: statePath("repositories", hit.index) };
|
|
93
|
+
return {
|
|
94
|
+
missing: `repo ${ref} not found in ${where}`,
|
|
95
|
+
// `undefined` — the key absent from the export — is the only case with
|
|
96
|
+
// nothing to point at. A `null` repository list is a citable fact: it says
|
|
97
|
+
// the export carried the field and it was empty.
|
|
98
|
+
searched: state.repositories === undefined ? undefined : statePath("repositories"),
|
|
99
|
+
};
|
|
49
100
|
}
|
|
50
101
|
export function resolveIssue(state, ref, number) {
|
|
51
102
|
const repo = resolveRepo(state, ref, "state_final");
|
|
52
103
|
if ("missing" in repo)
|
|
53
104
|
return repo;
|
|
54
|
-
const
|
|
55
|
-
|
|
105
|
+
const issues = repo.found.issues ?? [];
|
|
106
|
+
const index = issues.findIndex((candidate) => candidate.number === Number(number));
|
|
107
|
+
if (index >= 0) {
|
|
108
|
+
return { found: issues[index], path: childStatePath(repo.path, "issues", index) };
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
missing: `issue #${number} not found in ${ref}`,
|
|
112
|
+
searched: repo.found.issues === undefined ? undefined : childStatePath(repo.path, "issues"),
|
|
113
|
+
};
|
|
56
114
|
}
|
|
57
115
|
export function resolvePullRequest(state, ref, number) {
|
|
58
116
|
const repo = resolveRepo(state, ref, "state_final");
|
|
59
117
|
if ("missing" in repo)
|
|
60
118
|
return repo;
|
|
61
|
-
const
|
|
62
|
-
|
|
119
|
+
const pulls = repo.found.pull_requests ?? [];
|
|
120
|
+
const index = pulls.findIndex((candidate) => candidate.number === Number(number));
|
|
121
|
+
if (index >= 0) {
|
|
122
|
+
return { found: pulls[index], path: childStatePath(repo.path, "pull_requests", index) };
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
missing: `pull request #${number} not found in ${ref}`,
|
|
126
|
+
searched: repo.found.pull_requests === undefined
|
|
127
|
+
? undefined
|
|
128
|
+
: childStatePath(repo.path, "pull_requests"),
|
|
129
|
+
};
|
|
63
130
|
}
|
|
64
131
|
export function isMerged(pull) {
|
|
65
132
|
return pull.merged === 1 || pull.merged === true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-state.js","sourceRoot":"","sources":["../../src/check-state.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,sDAAsD;AACtD,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,EAAE;AACF,gFAAgF;AAChF,4CAA4C;AAC5C,gFAAgF;AAChF,6EAA6E;AAC7E,6EAA6E;AAC7E,sEAAsE;AACtE,yEAAyE;AACzE,4EAA4E;AAC5E,qCAAqC;
|
|
1
|
+
{"version":3,"file":"check-state.js","sourceRoot":"","sources":["../../src/check-state.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,sDAAsD;AACtD,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,EAAE;AACF,gFAAgF;AAChF,4CAA4C;AAC5C,gFAAgF;AAChF,6EAA6E;AAC7E,6EAA6E;AAC7E,sEAAsE;AACtE,yEAAyE;AACzE,4EAA4E;AAC5E,qCAAqC;AACrC,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,8DAA8D;AAE9D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAqB,MAAM,qBAAqB,CAAC;AAoFnF,yEAAyE;AACzE,yEAAyE;AACzE,4EAA4E;AAC5E,mEAAmE;AACnE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E,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3F,CAAC;IACD,OAAO;QACL,OAAO,EAAE,iBAAiB,MAAM,iBAAiB,GAAG,EAAE;QACtD,QAAQ,EACN,IAAI,CAAC,KAAK,CAAC,aAAa,KAAK,SAAS;YACpC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC;KACjD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAiC;IACxD,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC;AACnD,CAAC;AAED,uEAAuE;AACvE,6EAA6E;AAC7E,gFAAgF;AAChF,4EAA4E;AAC5E,0CAA0C;AAC1C,MAAM,UAAU,SAAS,CAAC,CAAS,EAAE,CAAS;IAC5C,OAAO,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAA4B;IAC5D,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;SACxB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -25,6 +25,8 @@ export declare const GITHUB_CHECKS: readonly [import("./check-kind.js").Check<{
|
|
|
25
25
|
repo: string;
|
|
26
26
|
}>, import("./check-kind.js").Check<{
|
|
27
27
|
repo: string;
|
|
28
|
+
}>, import("./check-kind.js").Check<{
|
|
29
|
+
repo: string;
|
|
28
30
|
}>, import("./check-kind.js").Check<{
|
|
29
31
|
pr: string;
|
|
30
32
|
repo: string;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
// So github now has no hand-written predicate left anywhere.
|
|
47
47
|
import { issueAssignee, issueCommentContains, issueExactlyOneLabel, issueExists, issueHasLabel, issueStateCheck, } from "./check-issues.js";
|
|
48
48
|
import { pullRequestCommentExists, pullRequestReviewExists, pullRequestStateCheck, } from "./check-pulls.js";
|
|
49
|
-
import { commitStatus, fileExists, noNewLabels } from "./check-repos.js";
|
|
49
|
+
import { commitStatus, fileExists, noNewIssues, noNewLabels } from "./check-repos.js";
|
|
50
50
|
import { noUnsupportedEndpoint, toolNeverCalled } from "./check-tape.js";
|
|
51
51
|
// Order is not first-match-wins here — the generated patterns are anchored and
|
|
52
52
|
// mutually exclusive, and `checks-contract.test.ts` proves no sentence is
|
|
@@ -60,6 +60,10 @@ export const GITHUB_CHECKS = [
|
|
|
60
60
|
issueExactlyOneLabel,
|
|
61
61
|
issueAssignee,
|
|
62
62
|
issueCommentContains,
|
|
63
|
+
// The two repo-scoped deltas sit together, right after the issue assertions
|
|
64
|
+
// they are the negatives of: `no-new-issues` is what `issue-exists` cannot
|
|
65
|
+
// say, and an author reaching for one usually wants to see the other.
|
|
66
|
+
noNewIssues,
|
|
63
67
|
noNewLabels,
|
|
64
68
|
pullRequestStateCheck,
|
|
65
69
|
pullRequestCommentExists,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../src/checks.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,6EAA6E;AAC7E,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,uEAAuE;AACvE,4EAA4E;AAC5E,mBAAmB;AACnB,EAAE;AACF,4EAA4E;AAC5E,kEAAkE;AAClE,+EAA+E;AAC/E,4CAA4C;AAC5C,EAAE;AACF,6DAA6D;AAC7D,6EAA6E;AAC7E,8DAA8D;AAC9D,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,2EAA2E;AAC3E,EAAE;AACF,+EAA+E;AAC/E,oEAAoE;AACp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AgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,EAAE;AACF,6DAA6D;AAE7D,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAezE,+EAA+E;AAC/E,0EAA0E;AAC1E,gFAAgF;AAChF,uEAAuE;AACvE,0BAA0B;AAC1B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,WAAW;IACX,eAAe;IACf,aAAa;IACb,oBAAoB;IACpB,aAAa;IACb,oBAAoB;IACpB,4EAA4E;IAC5E,2EAA2E;IAC3E,sEAAsE;IACtE,WAAW;IACX,WAAW;IACX,qBAAqB;IACrB,wBAAwB;IACxB,uBAAuB;IACvB,UAAU;IACV,YAAY;IACZ,4EAA4E;IAC5E,+EAA+E;IAC/E,kEAAkE;IAClE,qBAAqB;IACrB,eAAe;CACP,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pome-sh/twin-github",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Deterministic GitHub-shaped twin for agent testing — REST + MCP, SQLite-backed state.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@hono/node-server": "^2.0
|
|
37
|
-
"@pome-sh/sdk": "0.
|
|
38
|
-
"@pome-sh/shared-types": "0.
|
|
39
|
-
"hono": "^4.
|
|
40
|
-
"zod": "^4.
|
|
36
|
+
"@hono/node-server": "^2.1.0",
|
|
37
|
+
"@pome-sh/sdk": "0.11.1",
|
|
38
|
+
"@pome-sh/shared-types": "0.14.1",
|
|
39
|
+
"hono": "^4.13.0",
|
|
40
|
+
"zod": "^4.4.3"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"github",
|
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @pome-sh/twin-gmail — CHANGELOG
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
## 0.3.3 — 2026-08-04
|
|
5
|
+
|
|
6
|
+
Dependency-only patch (#302): `hono` `^4.12.31` → `^4.13.0`, `zod` `^4.1.13` → `^4.4.3`, `@hono/node-server` `^2.0.10` → `^2.1.0`.
|
|
7
|
+
No source file changed and `npm run test:contract` is green, so the surface is
|
|
8
|
+
identical — this exists so the npm artifact stops differing from `main`, which is
|
|
9
|
+
the staleness the publish skip-guard cannot see.
|
|
10
|
+
|
|
11
|
+
## 0.3.2 — 2026-08-04
|
|
12
|
+
|
|
13
|
+
- Re-pinned to `@pome-sh/sdk@0.11.0` for the F-1200 parent-vocabulary
|
|
14
|
+
change: a recorded row now carries `parent_event_id` rather than `parent_id`.
|
|
15
|
+
No change to this twin's own surface — `npm run test:contract` is green.
|
|
16
|
+
|
|
17
|
+
## 0.3.1 — 2026-08-03
|
|
18
|
+
|
|
19
|
+
Every state-reading check says where it looked (F-1197).
|
|
20
|
+
|
|
21
|
+
- 6 declarations now fill `CheckOutcome.evidenceStatePaths` (new in
|
|
22
|
+
`@pome-sh/sdk` 0.10.1) with RFC 6901 pointers into this twin's exported tree.
|
|
23
|
+
- `check-state.ts`'s resolvers return the pointer they walked. `Resolved<T>`'s
|
|
24
|
+
found arm gains `path`; its missing arm gains an optional `searched`, naming
|
|
25
|
+
the collection a failed lookup scanned.
|
|
26
|
+
- `checks-contract.test.ts` gains the citation gate and an EMPTY
|
|
27
|
+
`HONEST_UNCITED_CHECKS` ledger.
|
|
28
|
+
|
|
29
|
+
A failed lookup cites too, and that is the half worth knowing about. A message the export does not carry is the commonest refusal here, and it is the one a reader most wants to check.
|
|
30
|
+
So the honest citation on that arm is not the row — there is none — but the list:
|
|
31
|
+
*this is where I looked, see for yourself that it is not in it.*
|
|
32
|
+
|
|
33
|
+
Requires `@pome-sh/sdk` 0.10.1: the declarations call `statePath` /
|
|
34
|
+
`childStatePath`, which 0.10.0 does not export.
|
|
35
|
+
|
|
36
|
+
No sentence, template, substrate or check id changed, so `checksDigest` is
|
|
37
|
+
identical and no criterion re-binds.
|
|
38
|
+
|
|
3
39
|
## 0.3.0 — 2026-07-30
|
|
4
40
|
|
|
5
41
|
Gmail declares its assertable check vocabulary (F-1128, milestone A3).
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
// "no draft is addressed to anyone", always — a negative that can never fail,
|
|
10
10
|
// which is the exact defect A3 exists to eliminate.
|
|
11
11
|
import { defineCheck, VACUITY_SENTINEL, VACUITY_SENTINEL_NUMBER } from "@pome-sh/sdk/checks";
|
|
12
|
+
import { childStatePath } from "@pome-sh/sdk/checks";
|
|
12
13
|
import { countWord, emailAddress, parseCount } from "./check-params.js";
|
|
13
|
-
import { draftRecipients, isTruncated } from "./check-state.js";
|
|
14
|
+
import { DRAFTS_PATH, draftRecipients, isTruncated } from "./check-state.js";
|
|
14
15
|
import { draftAddressedTo as draftFor, finalWorld, gmailState } from "./check-worlds.js";
|
|
15
16
|
export const draftAddressedTo = defineCheck({
|
|
16
17
|
id: "gmail.draft-addressed-to",
|
|
@@ -58,9 +59,19 @@ export const draftAddressedTo = defineCheck({
|
|
|
58
59
|
return { passed: false, status: "skipped", reason: "state_incomplete" };
|
|
59
60
|
}
|
|
60
61
|
const wanted = email.toLowerCase();
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
|
|
62
|
+
const index = final.drafts.findIndex((entry) => draftRecipients(final, entry).some((to) => to.toLowerCase() === wanted));
|
|
63
|
+
if (index >= 0) {
|
|
64
|
+
const hit = final.drafts[index];
|
|
65
|
+
return {
|
|
66
|
+
passed: true,
|
|
67
|
+
reason: `draft ${hit.id ?? "?"} is addressed to ${email}`,
|
|
68
|
+
// The DRAFT row, not the backing message that actually holds the
|
|
69
|
+
// address. A reader following this pointer lands on the thing the
|
|
70
|
+
// sentence is about — "a draft addressed to X" — and the join to the
|
|
71
|
+
// message is an implementation detail of how the twin exports, not the
|
|
72
|
+
// claim (F-1197).
|
|
73
|
+
evidenceStatePaths: [childStatePath(DRAFTS_PATH, index)],
|
|
74
|
+
};
|
|
64
75
|
}
|
|
65
76
|
// Only refuse once the answer would otherwise be "no". A capped collection
|
|
66
77
|
// that still contains the draft is a real pass, and skipping it would drop a
|
|
@@ -71,6 +82,7 @@ export const draftAddressedTo = defineCheck({
|
|
|
71
82
|
return {
|
|
72
83
|
passed: false,
|
|
73
84
|
reason: `no draft is addressed to ${email} (${final.drafts.length} draft(s) inspected)`,
|
|
85
|
+
evidenceStatePaths: [DRAFTS_PATH],
|
|
74
86
|
};
|
|
75
87
|
},
|
|
76
88
|
});
|
|
@@ -132,6 +144,9 @@ export const draftCountAtLeast = defineCheck({
|
|
|
132
144
|
return {
|
|
133
145
|
passed: total >= wanted,
|
|
134
146
|
reason: `${total} draft(s) exist (wanted at least ${wanted})`,
|
|
147
|
+
// The collection whose LENGTH is the assertion. There is no narrower
|
|
148
|
+
// address for a cardinality.
|
|
149
|
+
evidenceStatePaths: [DRAFTS_PATH],
|
|
135
150
|
};
|
|
136
151
|
},
|
|
137
152
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-drafts.js","sourceRoot":"","sources":["../../src/check-drafts.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,iEAAiE;AACjE,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,oDAAoD;AAEpD,OAA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AE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrG,CAAC;IACD,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE;QAC3B,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,0EAA0E;YAC1E,uEAAuE;YACvE,2EAA2E;YAC3E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,KAAK,IAAI,EAAE,CAAC;QAClF,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,IAAI,IAAI;YAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;QAClG,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;QAClC,IAAI,KAAK,GAAG,MAAM,IAAI,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC;YACnD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iCAAiC,EAAE,CAAC;QACzF,CAAC;QACD,OAAO;YACL,MAAM,EAAE,KAAK,IAAI,MAAM;YACvB,MAAM,EAAE,GAAG,KAAK,oCAAoC,MAAM,GAAG;YAC7D,qEAAqE;YACrE,6BAA6B;YAC7B,kBAAkB,EAAE,CAAC,WAAW,CAAC;SAClC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// `github.no-new-labels` records what happens when one sentence blurs the two.
|
|
10
10
|
import { defineCheck, VACUITY_SENTINEL } from "@pome-sh/sdk/checks";
|
|
11
11
|
import { labelName } from "./check-params.js";
|
|
12
|
-
import { resolveLabelByName } from "./check-state.js";
|
|
12
|
+
import { missSkip, resolveLabelByName } from "./check-state.js";
|
|
13
13
|
import { finalWorld, gmailState, systemLabel, userLabel } from "./check-worlds.js";
|
|
14
14
|
export const labelExists = defineCheck({
|
|
15
15
|
id: "gmail.label-exists",
|
|
@@ -46,11 +46,22 @@ export const labelExists = defineCheck({
|
|
|
46
46
|
// `state_incomplete` and `collection_truncated` are unanswerable; a label
|
|
47
47
|
// genuinely not there is the honest FAIL this check exists to deliver.
|
|
48
48
|
if (found.missing.startsWith("label_not_found")) {
|
|
49
|
-
return {
|
|
49
|
+
return {
|
|
50
|
+
passed: false,
|
|
51
|
+
reason: `no label named "${label}" exists`,
|
|
52
|
+
// The label COLLECTION — the honest citation for a lookup that found
|
|
53
|
+
// nothing, and the arm a reader most wants to open: see for yourself
|
|
54
|
+
// that the name is not in it (F-1197).
|
|
55
|
+
...(found.searched === undefined ? {} : { evidenceStatePaths: [found.searched] }),
|
|
56
|
+
};
|
|
50
57
|
}
|
|
51
|
-
return
|
|
58
|
+
return missSkip(found);
|
|
52
59
|
}
|
|
53
|
-
return {
|
|
60
|
+
return {
|
|
61
|
+
passed: true,
|
|
62
|
+
reason: `label "${label}" exists (id ${found.found.id ?? "?"})`,
|
|
63
|
+
evidenceStatePaths: [found.path],
|
|
64
|
+
};
|
|
54
65
|
},
|
|
55
66
|
});
|
|
56
67
|
//# sourceMappingURL=check-labels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-labels.js","sourceRoot":"","sources":["../../src/check-labels.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,4EAA4E;AAC5E,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAE/E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|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actCount, labelRef, mailboxRef, messageId, parseCount } from "./check-params.js";
|
|
16
|
-
import { isTruncated, labelIdsFor, messageCarriesLabel, resolveMessage, } from "./check-state.js";
|
|
16
|
+
import { isTruncated, labelIdsFor, MESSAGE_LABELS_PATH, MESSAGES_PATH, messageCarriesLabel, missSkip, resolveMessage, } from "./check-state.js";
|
|
17
17
|
import { finalWorld, gmailState, message, messageLabel, systemLabel, userLabel, } from "./check-worlds.js";
|
|
18
18
|
// The workhorse of gmail's corpus: it binds three of the six criteria A3 found
|
|
19
19
|
// unbound, because tasks 22 and 27 say the same sentence about `msg_support` and
|
|
@@ -56,15 +56,21 @@ export const messageHasLabel = defineCheck({
|
|
|
56
56
|
evaluate({ message: id, label }, { final }) {
|
|
57
57
|
const found = resolveMessage(final, id);
|
|
58
58
|
if ("missing" in found)
|
|
59
|
-
return
|
|
59
|
+
return missSkip(found);
|
|
60
60
|
const carried = messageCarriesLabel(final, id, label);
|
|
61
61
|
if ("missing" in carried)
|
|
62
|
-
return
|
|
62
|
+
return missSkip(carried);
|
|
63
63
|
return {
|
|
64
64
|
passed: carried.found,
|
|
65
65
|
reason: carried.found
|
|
66
66
|
? `message ${id} carries label ${label}`
|
|
67
67
|
: `message ${id} does not carry label ${label}`,
|
|
68
|
+
// BOTH halves of the lookup, because the predicate really does read two
|
|
69
|
+
// places: the message row it resolved by id, and the join table it then
|
|
70
|
+
// questioned. Labels are not nested under their message in this export —
|
|
71
|
+
// that is the whole reason `messageCarriesLabel` exists — so one pointer
|
|
72
|
+
// could not say where this verdict came from (F-1197).
|
|
73
|
+
evidenceStatePaths: [found.path, carried.path],
|
|
68
74
|
};
|
|
69
75
|
},
|
|
70
76
|
});
|
|
@@ -134,6 +140,11 @@ export const mailboxLabelCount = defineCheck({
|
|
|
134
140
|
return {
|
|
135
141
|
passed: total === wanted,
|
|
136
142
|
reason: `mailbox "${mailbox}" has ${total} message(s) labeled ${label} (wanted ${wanted})`,
|
|
143
|
+
// The two collections the count is computed FROM. The count itself lives
|
|
144
|
+
// nowhere in the tree, so there is no narrower honest address — and the
|
|
145
|
+
// guards above already established that both collections are present and
|
|
146
|
+
// un-capped, which is what makes these pointers resolve.
|
|
147
|
+
evidenceStatePaths: [MESSAGES_PATH, MESSAGE_LABELS_PATH],
|
|
137
148
|
};
|
|
138
149
|
},
|
|
139
150
|
});
|
|
@@ -201,6 +212,11 @@ export const oneMessagePerRecipient = defineCheck({
|
|
|
201
212
|
: `${sent.length} ${label} message(s) to ${distinct.size} distinct recipient(s) ` +
|
|
202
213
|
`(${addressees.length} addressee slot(s)${wanted == null ? "" : `, wanted ${wanted}`}` +
|
|
203
214
|
`${noDuplicates ? "" : ", duplicate send detected"})`,
|
|
215
|
+
// Same two collections, same reason: the duplicate this check exists to
|
|
216
|
+
// catch is a property of the addressee lists across `messages`, filtered
|
|
217
|
+
// by `messageLabels`, and neither the flattened list nor its distinct set
|
|
218
|
+
// is anything the tree holds.
|
|
219
|
+
evidenceStatePaths: [MESSAGES_PATH, MESSAGE_LABELS_PATH],
|
|
204
220
|
};
|
|
205
221
|
},
|
|
206
222
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-messages.js","sourceRoot":"","sources":["../../src/check-messages.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,8EAA8E;AAC9E,oEAAoE;AACpE,oEAAoE;AACpE,6EAA6E;AAC7E,4EAA4E;AAC5E,2CAA2C;AAC3C,EAAE;AACF,2EAA2E;AAC3E,kBAAkB;AAElB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACvG,OAAO,EACL,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,cAAc,GAEf,MAAM,kBAAkB,CAAC;AAC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D,wEAAwE;YACxE,yEAAyE;YACzE,0EAA0E;YAC1E,8BAA8B;YAC9B,kBAAkB,EAAE,CAAC,aAAa,EAAE,mBAAmB,CAAC;SACzD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +1,35 @@
|
|
|
1
|
+
import { type CheckOutcome } from "@pome-sh/sdk/checks";
|
|
1
2
|
/** A resolver must be able to say WHY it found nothing: the ways of finding
|
|
2
|
-
* nothing get different verdicts. Same shape and same reason as twin-github's.
|
|
3
|
+
* nothing get different verdicts. Same shape and same reason as twin-github's.
|
|
4
|
+
*
|
|
5
|
+
* F-1197 added the pointers, also twin-github's: `path` is where the resolution
|
|
6
|
+
* landed, `searched` is the collection a failed lookup scanned. Both optional on
|
|
7
|
+
* the missing arm because gmail's commonest refusal is `state_incomplete` — the
|
|
8
|
+
* collection is absent from the export entirely, so there is nowhere to point
|
|
9
|
+
* and citing anything would be an affordance to nowhere. */
|
|
3
10
|
export type Resolved<T> = {
|
|
4
11
|
found: T;
|
|
12
|
+
path: string;
|
|
5
13
|
} | {
|
|
6
14
|
missing: string;
|
|
15
|
+
searched?: string;
|
|
7
16
|
};
|
|
17
|
+
/** The exported collections a pointer can address. Named because six
|
|
18
|
+
* declarations reach for them and a literal `"/messageLabels"` typed out six
|
|
19
|
+
* times is six chances to typo one into a pointer that resolves to nothing —
|
|
20
|
+
* and the mis-cased `/messagelabels` would look right in a diff. */
|
|
21
|
+
export declare const MESSAGES_PATH: string;
|
|
22
|
+
export declare const DRAFTS_PATH: string;
|
|
23
|
+
export declare const LABELS_PATH: string;
|
|
24
|
+
export declare const MESSAGE_LABELS_PATH: string;
|
|
25
|
+
/** The `skipped` outcome an unresolvable lookup produces, citing where it
|
|
26
|
+
* looked. Gmail abstains where twin-github fails — a message the export does
|
|
27
|
+
* not carry cannot be attested either way — so this is `missOutcome` with
|
|
28
|
+
* `skipped`, exactly as twin-slack's `missSkip` is. */
|
|
29
|
+
export declare function missSkip(miss: {
|
|
30
|
+
missing: string;
|
|
31
|
+
searched?: string;
|
|
32
|
+
}): CheckOutcome;
|
|
8
33
|
export interface GmailCheckStateMailbox {
|
|
9
34
|
email?: string;
|
|
10
35
|
displayName?: string;
|
|
@@ -34,6 +34,25 @@
|
|
|
34
34
|
// (`Label_follow_up` / `Follow Up`); a system label carries `id === name`.
|
|
35
35
|
// - EVERYTHING IS MAILBOX-SCOPED via `mailboxEmail`, and ids are minted per
|
|
36
36
|
// mailbox, so `deliveryMode: "seeded-mailboxes"` can put one id in two.
|
|
37
|
+
import { childStatePath, statePath } from "@pome-sh/sdk/checks";
|
|
38
|
+
/** The exported collections a pointer can address. Named because six
|
|
39
|
+
* declarations reach for them and a literal `"/messageLabels"` typed out six
|
|
40
|
+
* times is six chances to typo one into a pointer that resolves to nothing —
|
|
41
|
+
* and the mis-cased `/messagelabels` would look right in a diff. */
|
|
42
|
+
export const MESSAGES_PATH = statePath("messages");
|
|
43
|
+
export const DRAFTS_PATH = statePath("drafts");
|
|
44
|
+
export const LABELS_PATH = statePath("labels");
|
|
45
|
+
export const MESSAGE_LABELS_PATH = statePath("messageLabels");
|
|
46
|
+
/** The `skipped` outcome an unresolvable lookup produces, citing where it
|
|
47
|
+
* looked. Gmail abstains where twin-github fails — a message the export does
|
|
48
|
+
* not carry cannot be attested either way — so this is `missOutcome` with
|
|
49
|
+
* `skipped`, exactly as twin-slack's `missSkip` is. */
|
|
50
|
+
export function missSkip(miss) {
|
|
51
|
+
const outcome = { passed: false, status: "skipped", reason: miss.missing };
|
|
52
|
+
if (miss.searched === undefined)
|
|
53
|
+
return outcome;
|
|
54
|
+
return { ...outcome, evidenceStatePaths: [miss.searched] };
|
|
55
|
+
}
|
|
37
56
|
const lower = (value) => (value ?? "").toLowerCase();
|
|
38
57
|
/**
|
|
39
58
|
* Was this collection capped on the way out?
|
|
@@ -65,15 +84,26 @@ export function isTruncated(state, collection) {
|
|
|
65
84
|
export function resolveMessage(state, id) {
|
|
66
85
|
if (state.messages == null)
|
|
67
86
|
return { missing: "state_incomplete" };
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
87
|
+
const indices = state.messages
|
|
88
|
+
.map((message, index) => (lower(message.id) === lower(id) ? index : -1))
|
|
89
|
+
.filter((index) => index >= 0);
|
|
90
|
+
if (indices.length > 1) {
|
|
91
|
+
// The AMBIGUITY is the finding, so the citation is the collection rather
|
|
92
|
+
// than one of the candidates: pointing at either would present a coin-flip
|
|
93
|
+
// as the thing the check read.
|
|
94
|
+
return {
|
|
95
|
+
missing: `message_ambiguous ("${id}" exists in ${indices.length} mailboxes)`,
|
|
96
|
+
searched: MESSAGES_PATH,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (indices.length === 1) {
|
|
100
|
+
const index = indices[0];
|
|
101
|
+
return { found: state.messages[index], path: childStatePath(MESSAGES_PATH, index) };
|
|
102
|
+
}
|
|
103
|
+
if (isTruncated(state, "messages")) {
|
|
104
|
+
return { missing: 'collection_truncated ("messages")', searched: MESSAGES_PATH };
|
|
71
105
|
}
|
|
72
|
-
|
|
73
|
-
return { found: hits[0] };
|
|
74
|
-
if (isTruncated(state, "messages"))
|
|
75
|
-
return { missing: 'collection_truncated ("messages")' };
|
|
76
|
-
return { missing: `message_not_found ("${id}")` };
|
|
106
|
+
return { missing: `message_not_found ("${id}")`, searched: MESSAGES_PATH };
|
|
77
107
|
}
|
|
78
108
|
/**
|
|
79
109
|
* Every label id that counts as `wanted`, lower-cased for comparison.
|
|
@@ -106,9 +136,13 @@ export function messageCarriesLabel(state, messageId, wanted) {
|
|
|
106
136
|
const ids = labelIdsFor(state, wanted);
|
|
107
137
|
const carried = state.messageLabels.some((row) => lower(row.messageId) === lower(messageId) && ids.has(lower(row.labelId)));
|
|
108
138
|
if (!carried && isTruncated(state, "messageLabels")) {
|
|
109
|
-
return { missing: 'collection_truncated ("messageLabels")' };
|
|
139
|
+
return { missing: 'collection_truncated ("messageLabels")', searched: MESSAGE_LABELS_PATH };
|
|
110
140
|
}
|
|
111
|
-
|
|
141
|
+
// The JOIN, not a row in it. The answer is a boolean this function computed
|
|
142
|
+
// and the tree holds no such value, so the honest address is the table the
|
|
143
|
+
// question was asked of — and on the `false` side there is no row to name at
|
|
144
|
+
// all, which is exactly the arm a reader wants to check.
|
|
145
|
+
return { found: carried, path: MESSAGE_LABELS_PATH };
|
|
112
146
|
}
|
|
113
147
|
/**
|
|
114
148
|
* The label a criterion names BY NAME.
|
|
@@ -121,12 +155,14 @@ export function messageCarriesLabel(state, messageId, wanted) {
|
|
|
121
155
|
export function resolveLabelByName(state, name) {
|
|
122
156
|
if (state.labels == null)
|
|
123
157
|
return { missing: "state_incomplete" };
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
return { found:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
158
|
+
const index = state.labels.findIndex((label) => lower(label.name) === lower(name));
|
|
159
|
+
if (index >= 0) {
|
|
160
|
+
return { found: state.labels[index], path: childStatePath(LABELS_PATH, index) };
|
|
161
|
+
}
|
|
162
|
+
if (isTruncated(state, "labels")) {
|
|
163
|
+
return { missing: 'collection_truncated ("labels")', searched: LABELS_PATH };
|
|
164
|
+
}
|
|
165
|
+
return { missing: `label_not_found ("${name}")`, searched: LABELS_PATH };
|
|
130
166
|
}
|
|
131
167
|
/**
|
|
132
168
|
* Who a draft is addressed to — `to` + `cc`, from the backing MESSAGE.
|