@reneturcios/greenlight 0.9.0 → 0.9.2
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/README.md +44 -2
- package/dist/automate.d.ts +20 -0
- package/dist/automate.js +75 -7
- package/dist/automate.js.map +1 -1
- package/dist/babysit.d.ts +45 -1
- package/dist/babysit.js +188 -72
- package/dist/babysit.js.map +1 -1
- package/dist/ci-triage.d.ts +1 -1
- package/dist/ci-triage.js +6 -0
- package/dist/ci-triage.js.map +1 -1
- package/dist/claim-health.d.ts +1 -1
- package/dist/claim-health.js +12 -0
- package/dist/claim-health.js.map +1 -1
- package/dist/claim-import.d.ts +59 -0
- package/dist/claim-import.js +164 -0
- package/dist/claim-import.js.map +1 -0
- package/dist/claims.js +73 -20
- package/dist/claims.js.map +1 -1
- package/dist/cli.js +153 -11
- package/dist/cli.js.map +1 -1
- package/dist/doctor.js +14 -6
- package/dist/doctor.js.map +1 -1
- package/dist/github.d.ts +21 -0
- package/dist/github.js +70 -2
- package/dist/github.js.map +1 -1
- package/dist/guard.d.ts +13 -1
- package/dist/guard.js +15 -1
- package/dist/guard.js.map +1 -1
- package/dist/help.js +22 -6
- package/dist/help.js.map +1 -1
- package/dist/index.js +40 -2
- package/dist/index.js.map +1 -1
- package/dist/init.js +1 -1
- package/dist/llm-claims.d.ts +13 -2
- package/dist/llm-claims.js +54 -17
- package/dist/llm-claims.js.map +1 -1
- package/dist/posting-ledger.d.ts +70 -0
- package/dist/posting-ledger.js +170 -0
- package/dist/posting-ledger.js.map +1 -0
- package/dist/protocol-fetch.d.ts +3 -1
- package/dist/protocol-fetch.js +10 -1
- package/dist/protocol-fetch.js.map +1 -1
- package/dist/protocol.d.ts +14 -1
- package/dist/protocol.js +34 -3
- package/dist/protocol.js.map +1 -1
- package/dist/proxy.d.ts +50 -0
- package/dist/proxy.js +111 -0
- package/dist/proxy.js.map +1 -0
- package/dist/types.d.ts +18 -0
- package/integrations/README.md +3 -1
- package/integrations/claude-code/CLAUDE.snippet.md +3 -2
- package/integrations/cline/README.md +1 -1
- package/integrations/windsurf/README.md +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/claim-health.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim-health.js","sourceRoot":"","sources":["../src/claim-health.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claim-health.js","sourceRoot":"","sources":["../src/claim-health.ts"],"names":[],"mappings":"AAiCA,0DAA0D;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,yDAAyD;AACzD,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAmBjC,SAAS,YAAY,CAAC,CAAS,EAAE,CAAO;IACtC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAChC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACjC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAChC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;IAC3D,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;IAEhC,sEAAsE;IACtE,sEAAsE;IACtE,wCAAwC;IACxC,IAAI,UAAU,EAAE,KAAK,KAAK,aAAa,EAAE,CAAC;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE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AC,CAAC,IAAI,CAAC;IAClF,MAAM,QAAQ,GAAG,UAAU,KAAK,IAAI,IAAI,UAAU,GAAG,CAAC,IAAI,YAAY,KAAK,IAAI,IAAI,YAAY,GAAG,UAAU,GAAG,CAAC,CAAC;IACjH,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3F,MAAM,UAAU,GACd,CAAC,KAAK,CAAC,cAAc,KAAK,IAAI,IAAI,YAAY,KAAK,IAAI,CAAC;QACxD,CAAC,YAAY,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI,IAAI,YAAY,IAAI,QAAQ,CAAC,CAAC;IAC3E,IAAI,QAAQ,IAAI,UAAU,EAAE,CAAC;QAC3B,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,MAAM,EAAE,GAAG,GAAG,sBAAsB,IAAI,CAAC,KAAK,CAAC,YAAa,GAAG,EAAE,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAW,GAAG,EAAE,CAAC,kEAAkE;SACzK,CAAC;IACJ,CAAC;IAED,OAAO;QACL,MAAM,EAAE,gBAAgB;QACxB,MAAM,EAAE,GAAG,GAAG,WAAW,UAAU,CAAC,CAAC,CAAC,SAAS,UAAU,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,YAAY;KAC/J,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `greenlight claim --import`: backfill the my-claims registry for claims
|
|
3
|
+
* that already exist. v0.9.0's registry auto-registers only newly posted
|
|
4
|
+
* claims, so anyone upgrading arrives with an empty registry while the
|
|
5
|
+
* public Claim Ledger already knows about their claims (field case: Rene
|
|
6
|
+
* held 11 live claims and the babysitter said "no claims registry yet").
|
|
7
|
+
*
|
|
8
|
+
* Two sources:
|
|
9
|
+
* --ledger-user <github-username> fetch the public Claim Ledger's
|
|
10
|
+
* static API and import every active or linked claim by that user.
|
|
11
|
+
* --urls <issue-url,...> import a manual list of issue URLs.
|
|
12
|
+
*
|
|
13
|
+
* Registration reuses registerClaim, so re-imports refresh rather than
|
|
14
|
+
* duplicate. States completed/released/expired/superseded are skipped:
|
|
15
|
+
* the babysitter would retire them on sight anyway.
|
|
16
|
+
*/
|
|
17
|
+
import { type MyClaim } from "./claims-registry.js";
|
|
18
|
+
/** The public Claim Ledger's static API base (no auth). */
|
|
19
|
+
export declare const LEDGER_BASE_URL = "https://cloudcorprecords.github.io/claim-ledger";
|
|
20
|
+
/** Claim states worth watching: active leases and linked claims. Retired states are skipped. */
|
|
21
|
+
export declare const IMPORTABLE_CLAIM_STATES: Set<string>;
|
|
22
|
+
export interface LedgerIndexRepo {
|
|
23
|
+
owner: string;
|
|
24
|
+
repo: string;
|
|
25
|
+
}
|
|
26
|
+
export interface LedgerClaimEntry {
|
|
27
|
+
issue: number;
|
|
28
|
+
issue_url: string;
|
|
29
|
+
claimant: string;
|
|
30
|
+
state: string;
|
|
31
|
+
queue: unknown[];
|
|
32
|
+
}
|
|
33
|
+
export interface ImportDeps {
|
|
34
|
+
/** JSON GET, injectable for tests; the default hits the Ledger pages site. */
|
|
35
|
+
fetchJson?: (url: string) => Promise<unknown>;
|
|
36
|
+
}
|
|
37
|
+
export declare function fetchLedgerRepos(deps?: ImportDeps): Promise<LedgerIndexRepo[]>;
|
|
38
|
+
export declare function fetchLedgerClaims(owner: string, repo: string, deps?: ImportDeps): Promise<LedgerClaimEntry[]>;
|
|
39
|
+
export interface ImportResult {
|
|
40
|
+
/** Claims newly added to the registry. */
|
|
41
|
+
added: number;
|
|
42
|
+
/** Claims skipped: already registered, wrong claimant, or a retired state. */
|
|
43
|
+
skipped: number;
|
|
44
|
+
/** Repos scanned on the Ledger. */
|
|
45
|
+
reposScanned: number;
|
|
46
|
+
/** The registered entries, in registration order. */
|
|
47
|
+
claims: MyClaim[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Import every active or linked Ledger claim held by `username` into the
|
|
51
|
+
* registry. Pure of side effects except the registry file write.
|
|
52
|
+
*/
|
|
53
|
+
export declare function importLedgerClaims(registryPath: string, username: string, deps?: ImportDeps): Promise<ImportResult>;
|
|
54
|
+
/**
|
|
55
|
+
* Import a manual list of issue URLs (backfill for claims posted before
|
|
56
|
+
* the registry existed, or on repos the Ledger does not index). Never
|
|
57
|
+
* touches the network: pure registration with dedupe.
|
|
58
|
+
*/
|
|
59
|
+
export declare function importUrlList(registryPath: string, urls: string[]): ImportResult;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `greenlight claim --import`: backfill the my-claims registry for claims
|
|
3
|
+
* that already exist. v0.9.0's registry auto-registers only newly posted
|
|
4
|
+
* claims, so anyone upgrading arrives with an empty registry while the
|
|
5
|
+
* public Claim Ledger already knows about their claims (field case: Rene
|
|
6
|
+
* held 11 live claims and the babysitter said "no claims registry yet").
|
|
7
|
+
*
|
|
8
|
+
* Two sources:
|
|
9
|
+
* --ledger-user <github-username> fetch the public Claim Ledger's
|
|
10
|
+
* static API and import every active or linked claim by that user.
|
|
11
|
+
* --urls <issue-url,...> import a manual list of issue URLs.
|
|
12
|
+
*
|
|
13
|
+
* Registration reuses registerClaim, so re-imports refresh rather than
|
|
14
|
+
* duplicate. States completed/released/expired/superseded are skipped:
|
|
15
|
+
* the babysitter would retire them on sight anyway.
|
|
16
|
+
*/
|
|
17
|
+
import { registerClaim, loadRegistry } from "./claims-registry.js";
|
|
18
|
+
import { parseIssueUrl } from "./github.js";
|
|
19
|
+
/** The public Claim Ledger's static API base (no auth). */
|
|
20
|
+
export const LEDGER_BASE_URL = "https://cloudcorprecords.github.io/claim-ledger";
|
|
21
|
+
/** Claim states worth watching: active leases and linked claims. Retired states are skipped. */
|
|
22
|
+
export const IMPORTABLE_CLAIM_STATES = new Set(["active", "linked"]);
|
|
23
|
+
async function defaultFetchJson(url) {
|
|
24
|
+
const res = await fetch(url, {
|
|
25
|
+
headers: { Accept: "application/json", "User-Agent": "greenlight-cli" },
|
|
26
|
+
signal: AbortSignal.timeout(30000),
|
|
27
|
+
});
|
|
28
|
+
if (!res.ok)
|
|
29
|
+
throw new Error(`Ledger request failed: ${url} -> HTTP ${res.status}`);
|
|
30
|
+
return res.json();
|
|
31
|
+
}
|
|
32
|
+
export async function fetchLedgerRepos(deps = {}) {
|
|
33
|
+
const fetchJson = deps.fetchJson ?? defaultFetchJson;
|
|
34
|
+
const index = (await fetchJson(`${LEDGER_BASE_URL}/v1/index.json`));
|
|
35
|
+
const repos = [];
|
|
36
|
+
for (const r of index.repos ?? []) {
|
|
37
|
+
if (typeof r.owner === "string" && typeof r.repo === "string") {
|
|
38
|
+
repos.push({ owner: r.owner, repo: r.repo });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return repos;
|
|
42
|
+
}
|
|
43
|
+
export async function fetchLedgerClaims(owner, repo, deps = {}) {
|
|
44
|
+
const fetchJson = deps.fetchJson ?? defaultFetchJson;
|
|
45
|
+
const body = (await fetchJson(`${LEDGER_BASE_URL}/v1/repos/${owner}/${repo}/claims.json`));
|
|
46
|
+
const out = [];
|
|
47
|
+
for (const c of body.active_claims ?? []) {
|
|
48
|
+
if (typeof c.issue !== "number" || typeof c.issue_url !== "string" || typeof c.claimant !== "string" || typeof c.state !== "string") {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
out.push({
|
|
52
|
+
issue: c.issue,
|
|
53
|
+
issue_url: c.issue_url,
|
|
54
|
+
claimant: c.claimant,
|
|
55
|
+
state: c.state,
|
|
56
|
+
queue: Array.isArray(c.queue) ? c.queue : [],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Import every active or linked Ledger claim held by `username` into the
|
|
63
|
+
* registry. Pure of side effects except the registry file write.
|
|
64
|
+
*/
|
|
65
|
+
export async function importLedgerClaims(registryPath, username, deps = {}) {
|
|
66
|
+
const user = username.toLowerCase();
|
|
67
|
+
const repos = await fetchLedgerRepos(deps);
|
|
68
|
+
const added = [];
|
|
69
|
+
let skipped = 0;
|
|
70
|
+
for (const { owner, repo } of repos) {
|
|
71
|
+
let entries;
|
|
72
|
+
try {
|
|
73
|
+
entries = await fetchLedgerClaims(owner, repo, deps);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// One repo's file failing must not abort the whole import.
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
for (const e of entries) {
|
|
80
|
+
if (e.claimant.toLowerCase() !== user) {
|
|
81
|
+
skipped++;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (!IMPORTABLE_CLAIM_STATES.has(e.state)) {
|
|
85
|
+
skipped++;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
let issueOwner = owner;
|
|
89
|
+
let issueRepo = repo;
|
|
90
|
+
let issueNumber = e.issue;
|
|
91
|
+
let issueUrl = e.issue_url;
|
|
92
|
+
try {
|
|
93
|
+
const parsed = parseIssueUrl(e.issue_url);
|
|
94
|
+
issueOwner = parsed.owner;
|
|
95
|
+
issueRepo = parsed.repo;
|
|
96
|
+
issueNumber = parsed.number;
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
// The Ledger's own issue_url is canonical enough; keep the row's.
|
|
100
|
+
}
|
|
101
|
+
const key = issueUrl.toLowerCase();
|
|
102
|
+
const already = loadRegistry(registryPath).claims.some((c) => c.issueUrl.toLowerCase() === key);
|
|
103
|
+
if (already) {
|
|
104
|
+
skipped++;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const entry = {
|
|
108
|
+
issueUrl,
|
|
109
|
+
owner: issueOwner,
|
|
110
|
+
repo: issueRepo,
|
|
111
|
+
number: issueNumber,
|
|
112
|
+
postedAt: new Date().toISOString(),
|
|
113
|
+
claimant: e.claimant,
|
|
114
|
+
};
|
|
115
|
+
registerClaim(registryPath, entry);
|
|
116
|
+
added.push(entry);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return { added: added.length, skipped, reposScanned: repos.length, claims: added };
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Import a manual list of issue URLs (backfill for claims posted before
|
|
123
|
+
* the registry existed, or on repos the Ledger does not index). Never
|
|
124
|
+
* touches the network: pure registration with dedupe.
|
|
125
|
+
*/
|
|
126
|
+
export function importUrlList(registryPath, urls) {
|
|
127
|
+
const added = [];
|
|
128
|
+
let skipped = 0;
|
|
129
|
+
for (const raw of urls) {
|
|
130
|
+
const url = raw.trim();
|
|
131
|
+
if (!url) {
|
|
132
|
+
skipped++;
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
let owner;
|
|
136
|
+
let repo;
|
|
137
|
+
let number;
|
|
138
|
+
try {
|
|
139
|
+
({ owner, repo, number } = parseIssueUrl(url));
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
skipped++;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const canonical = `https://github.com/${owner}/${repo}/issues/${number}`;
|
|
146
|
+
const key = canonical.toLowerCase();
|
|
147
|
+
const already = loadRegistry(registryPath).claims.some((c) => c.issueUrl.toLowerCase() === key);
|
|
148
|
+
if (already) {
|
|
149
|
+
skipped++;
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
const entry = {
|
|
153
|
+
issueUrl: canonical,
|
|
154
|
+
owner,
|
|
155
|
+
repo,
|
|
156
|
+
number,
|
|
157
|
+
postedAt: new Date().toISOString(),
|
|
158
|
+
};
|
|
159
|
+
registerClaim(registryPath, entry);
|
|
160
|
+
added.push(entry);
|
|
161
|
+
}
|
|
162
|
+
return { added: added.length, skipped, reposScanned: 0, claims: added };
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=claim-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-import.js","sourceRoot":"","sources":["../src/claim-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAgB,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,eAAe,GAAG,iDAAiD,CAAC;AAEjF,gGAAgG;AAChG,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAoBrE,KAAK,UAAU,gBAAgB,CAAC,GAAW;IACzC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,gBAAgB,EAAE;QACvE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;KACnC,CAAC,CAAC;IACH,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,YAAY,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACpF,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAmB,EAAE;IAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,gBAAgB,CAAC;IACrD,MAAM,KAAK,GAAG,CAAC,MAAM,SAAS,CAAC,GAAG,eAAe,gBAAgB,CAAC,CAEjE,CAAC;IACF,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE,CA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,IAAI,CAAC;YACH,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;YACV,SAAS;QACX,CAAC;QACD,MAAM,SAAS,GAAG,sBAAsB,KAAK,IAAI,IAAI,WAAW,MAAM,EAAE,CAAC;QACzE,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAC;QAChG,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC;YACV,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG;YACZ,QAAQ,EAAE,SAAS;YACnB,KAAK;YACL,IAAI;YACJ,MAAM;YACN,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACnC,CAAC;QACF,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC1E,CAAC"}
|
package/dist/claims.js
CHANGED
|
@@ -1,22 +1,39 @@
|
|
|
1
1
|
// Strong: explicit claim of work or a concrete "I am doing it" statement.
|
|
2
2
|
const STRONG_PATTERNS = [
|
|
3
|
-
|
|
3
|
+
// "I'd like to work on this issue" — formbricks/formbricks#9504
|
|
4
|
+
// (2026-10-17): the contracted form missed the old "i would like".
|
|
5
|
+
// The trailing guard keeps "take this opportunity to ..." out, the
|
|
6
|
+
// same idiom the like-to-take pattern below protects.
|
|
7
|
+
{ name: "explicit-claim", regex: /\bi(['’]d| would) like to (work on|take|handle) (this|it)\b(?! (opportunity|moment|time) to)/i, strength: "strong" },
|
|
4
8
|
{ name: "please-assign", regex: /please assign (this|it|me)/i, strength: "strong" },
|
|
5
9
|
{ name: "assign-to-me", regex: /\bassign (it |this )?to me\b/i, strength: "strong" },
|
|
6
10
|
{ name: "assign-request", regex: /\bassign me\b/i, strength: "strong" },
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
// "If that's okay, I'll work on it and open a PR." — the same
|
|
12
|
+
// formbricks thread: "it" is as much a claim as "this". The lookahead
|
|
13
|
+
// keeps "take it into account / offline / under / as" from matching.
|
|
14
|
+
{ name: "will-take", regex: /\bi (will|shall) (take|work on|handle) (this|it)\b(?!\s+(?:into|offline|under|as|for granted)\b)/i, strength: "strong" },
|
|
15
|
+
// "It's yours @08abhinav, thanks!" — batrapulkit/squidbrake#79
|
|
16
|
+
// (2026-10-17): a maintainer handing the issue to a contributor is an
|
|
17
|
+
// assignment, the strongest taken-signal there is.
|
|
18
|
+
{ name: "its-yours", regex: /\bit(?:['’]s| is)(?: all)? yours\b/i, strength: "strong" },
|
|
19
|
+
// "I've packaged a clean, production-verified fix for this" —
|
|
20
|
+
// dubinc/dub#4659 (2026-10-17), and "I also prepared and tested a fix
|
|
21
|
+
// for this issue" — formbricks#9504's second claimant. A concrete
|
|
22
|
+
// fix-in-hand claim. The not/n't guard keeps "I have not prepared a
|
|
23
|
+
// fix" from matching.
|
|
24
|
+
{ name: "fix-packaged", regex: /\bi(?:['’]ve| have| also| just)?\s+(?!(?:not|n['’]t)\s)(?:packaged|prepared|completed|finished)\s+(?:(?:a|the|my|this)\s+)?(?:[\w.,-]+\s+){0,6}fix\b/i, strength: "strong" },
|
|
25
|
+
{ name: "working-on", regex: /i(['’]| a)m (currently |now )?working on this/i, strength: "strong" },
|
|
9
26
|
{ name: "taking-it", regex: /\btak(e|ing) this (on|up)\b/i, strength: "strong" },
|
|
10
|
-
{ name: "pr-opened", regex: /i('ve| have) opened (a |the )?pr\b/i, strength: "strong" },
|
|
27
|
+
{ name: "pr-opened", regex: /i(['’]ve| have) opened (a |the )?pr\b/i, strength: "strong" },
|
|
11
28
|
{ name: "fix-ready", regex: /\bfix (is )?ready\b/i, strength: "strong" },
|
|
12
29
|
{ name: "fix-in-progress", regex: /\bfix is in progress\b/i, strength: "strong" },
|
|
13
30
|
{ name: "pr-incoming", regex: /\bpr (is |will be |to be )?(incoming|coming|ready|prepared)\b/i, strength: "strong" },
|
|
14
|
-
{ name: "started-work", regex: /\bi('ve| have) started (working )?on this/i, strength: "strong" },
|
|
15
|
-
{ name: "want-to-work", regex: /i('d| would) like to (take|pick) (this|it) (on|up)/i, strength: "strong" },
|
|
31
|
+
{ name: "started-work", regex: /\bi(['’]ve| have) started (working )?on this/i, strength: "strong" },
|
|
32
|
+
{ name: "want-to-work", regex: /i(['’]d| would) like to (take|pick) (this|it) (on|up)/i, strength: "strong" },
|
|
16
33
|
// "Hi, I'd like to take this. Plan: ..." — the fastmcp #5743 claim (2026-10-14) that scan
|
|
17
34
|
// missed because want-to-work above demands a trailing "on"/"up". The negative lookahead
|
|
18
35
|
// keeps "I'd like to take this opportunity to thank ..." from counting as a claim.
|
|
19
|
-
{ name: "like-to-take", regex: /\bi('d| would) like to take (this|it)\b(?! (opportunity|moment|time) to)/i, strength: "strong" },
|
|
36
|
+
{ name: "like-to-take", regex: /\bi(['’]d| would) like to take (this|it)\b(?! (opportunity|moment|time) to)/i, strength: "strong" },
|
|
20
37
|
// "/attempt #1234" (or "/claim #1234") — bot-style commands some contributors post to
|
|
21
38
|
// announce they are taking the issue. tscircuit/tscircuit#5563 (2026-10-15) carried five
|
|
22
39
|
// of these from one contributor before anyone linked the actual fix PRs; without this
|
|
@@ -36,13 +53,38 @@ const STRONG_PATTERNS = [
|
|
|
36
53
|
// with a grain of salt".
|
|
37
54
|
{
|
|
38
55
|
name: "bare-take",
|
|
39
|
-
regex: /\b(?:i(?:'ll| will) take|let me take|i take|taking) (?:this|it)(?: one)?\b(?!\s+(?:[a-z][\w-]*\s+){0,2}(?:into|off(?:line)?|opportunity|opportunities|moment|time|with|under|as)\b)/i,
|
|
56
|
+
regex: /\b(?:i(?:['’]ll| will) take|let me take|i take|taking) (?:this|it)(?: one)?\b(?!\s+(?:[a-z][\w-]*\s+){0,2}(?:into|off(?:line)?|opportunity|opportunities|moment|time|with|under|as)\b)/i,
|
|
40
57
|
strength: "soft",
|
|
41
58
|
},
|
|
42
59
|
];
|
|
43
60
|
// Soft: interest or an offer, not a claim. Used only to soften confidence, not to mark TAKEN.
|
|
44
61
|
const SOFT_PATTERNS = [
|
|
45
|
-
|
|
62
|
+
// "I'd be happy to implement the proposed fix" — formbricks#9504
|
|
63
|
+
// (2026-10-17): the happy-to family missed the implementation verbs.
|
|
64
|
+
{ name: "soft-offer", regex: /\bhappy to (fix|work|help|take|implement|submit|contribute|open|review)\b/i, strength: "soft" },
|
|
65
|
+
// Bare "Working on this." — ollama/ollama#19078 (2026-10-17): the
|
|
66
|
+
// whole comment was three words. The morning eval caught it through
|
|
67
|
+
// the AI layer; with the layer down, the patterns missed it. Soft,
|
|
68
|
+
// not strong: no plan, no assignment ask. The guard rejects negations
|
|
69
|
+
// ("I'm not working on this"), non-actors ("Nobody is working on
|
|
70
|
+
// this"), and questions addressed at someone else ("Are you working
|
|
71
|
+
// on this?"). The strong working-on pattern above owns "I'm working
|
|
72
|
+
// on this" and runs first, so this never downgrades it.
|
|
73
|
+
{
|
|
74
|
+
name: "bare-working-on",
|
|
75
|
+
regex: /\bworking on (?:this|it|a fix|the fix)\b/i,
|
|
76
|
+
strength: "soft",
|
|
77
|
+
guard: (body, match) => {
|
|
78
|
+
const clause = (body.slice(0, match.index).split(/[.!?\n]/).pop() ?? "").toLowerCase();
|
|
79
|
+
if (/\b(not|n't|never|nobody|no one|none)\b/.test(clause))
|
|
80
|
+
return false;
|
|
81
|
+
if (/\bi(?:['’]m| am)\b/.test(clause))
|
|
82
|
+
return false;
|
|
83
|
+
if (/\b(you|u)\b/.test(clause))
|
|
84
|
+
return false;
|
|
85
|
+
return true;
|
|
86
|
+
},
|
|
87
|
+
},
|
|
46
88
|
{ name: "can-take", regex: /i can take this/i, strength: "soft" },
|
|
47
89
|
{ name: "interested", regex: /\binterested in (working on|taking|this)\b/i, strength: "soft" },
|
|
48
90
|
{ name: "looking-into", regex: /\blooking into this\b/i, strength: "soft" },
|
|
@@ -61,7 +103,7 @@ const SOFT_PATTERNS = [
|
|
|
61
103
|
// of place.
|
|
62
104
|
{
|
|
63
105
|
name: "pick-up-offer",
|
|
64
|
-
regex: /\b(?:i can|i(?:'ll| will)|let me|(?:can|could) i) pick (?:this|it) up\b(?!\s+(?:from|at|in|on|off|out)\b)/i,
|
|
106
|
+
regex: /\b(?:i can|i(?:['’]ll| will)|let me|(?:can|could) i) pick (?:this|it) up\b(?!\s+(?:from|at|in|on|off|out)\b)/i,
|
|
65
107
|
strength: "soft",
|
|
66
108
|
},
|
|
67
109
|
// "Can i still work on this, is this open." — the same firecrawl thread:
|
|
@@ -78,7 +120,7 @@ const PARTIAL_PATTERNS = [
|
|
|
78
120
|
{ name: "partial-taking", regex: /taking (the|this|on)\b.{0,40}?\b(ask|part|half|piece|fallback|remaining)\b/i, strength: "strong" },
|
|
79
121
|
{ name: "partial-claiming", regex: /claiming (the|this)\b.{0,30}?\b(part|half|ask)\b/i, strength: "strong" },
|
|
80
122
|
{ name: "partial-working-on", regex: /working on (the|this)\b.{0,30}?\b(part|half|piece)\b/i, strength: "strong" },
|
|
81
|
-
{ name: "partial-will-take", regex: /i('ll| will) take (the|this)\b.{0,30}?\b(part|half|ask|fallback)\b/i, strength: "strong" },
|
|
123
|
+
{ name: "partial-will-take", regex: /i(['’]ll| will) take (the|this)\b.{0,30}?\b(part|half|ask|fallback)\b/i, strength: "strong" },
|
|
82
124
|
];
|
|
83
125
|
const ALL_PATTERNS = [...PARTIAL_PATTERNS, ...STRONG_PATTERNS, ...SOFT_PATTERNS];
|
|
84
126
|
// Authors that are not humans claiming work.
|
|
@@ -113,19 +155,30 @@ export function detectClaims(issueAuthor, comments, now = new Date()) {
|
|
|
113
155
|
let scopeWord;
|
|
114
156
|
for (const pattern of ALL_PATTERNS) {
|
|
115
157
|
const m = pattern.regex.exec(comment.body);
|
|
116
|
-
if (m)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
158
|
+
if (!m)
|
|
159
|
+
continue;
|
|
160
|
+
// v0.9.2: a guard can reject a regex match the pattern alone
|
|
161
|
+
// cannot judge (negation, the actor). Rejected matches fall
|
|
162
|
+
// through to the next pattern, not out of detection.
|
|
163
|
+
if (pattern.guard && !pattern.guard(comment.body, m))
|
|
164
|
+
continue;
|
|
165
|
+
matched = pattern;
|
|
166
|
+
if (pattern.name.startsWith("partial-")) {
|
|
167
|
+
// Partial patterns carry the scope word in the second capture group.
|
|
168
|
+
scopeWord = (m[2] ?? "").toLowerCase() || undefined;
|
|
123
169
|
}
|
|
170
|
+
break; // partial and strong patterns come first, so first match wins
|
|
124
171
|
}
|
|
125
172
|
if (!matched)
|
|
126
173
|
continue;
|
|
127
|
-
// Skip the issue author unless they announce real work in progress
|
|
128
|
-
|
|
174
|
+
// Skip the issue author unless they announce real work in progress,
|
|
175
|
+
// or assign the issue to someone else (v0.9.2: "It's yours @x" is an
|
|
176
|
+
// assignment, not a self-claim — batrapulkit/squidbrake#79).
|
|
177
|
+
if (author === issueAuthor &&
|
|
178
|
+
matched.name !== "fix-ready" &&
|
|
179
|
+
matched.name !== "fix-in-progress" &&
|
|
180
|
+
matched.name !== "pr-opened" &&
|
|
181
|
+
matched.name !== "its-yours") {
|
|
129
182
|
continue;
|
|
130
183
|
}
|
|
131
184
|
const existing = byAuthor.get(author);
|
package/dist/claims.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.js","sourceRoot":"","sources":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