oss-pulse 0.1.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/CHANGELOG.md +26 -0
- package/CODE_OF_CONDUCT.md +7 -0
- package/CONTRIBUTING.md +30 -0
- package/LICENSE +21 -0
- package/README.md +158 -0
- package/SECURITY.md +12 -0
- package/action.yml +45 -0
- package/dist/action-artifacts.d.ts +3 -0
- package/dist/action-artifacts.d.ts.map +1 -0
- package/dist/action-artifacts.js +38 -0
- package/dist/action-artifacts.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +117 -0
- package/dist/cli.js.map +1 -0
- package/dist/errors.d.ts +19 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +31 -0
- package/dist/errors.js.map +1 -0
- package/dist/format.d.ts +8 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +127 -0
- package/dist/format.js.map +1 -0
- package/dist/git.d.ts +3 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +168 -0
- package/dist/git.js.map +1 -0
- package/dist/github-annotations.d.ts +3 -0
- package/dist/github-annotations.d.ts.map +1 -0
- package/dist/github-annotations.js +36 -0
- package/dist/github-annotations.js.map +1 -0
- package/dist/report-rules.d.ts +12 -0
- package/dist/report-rules.d.ts.map +1 -0
- package/dist/report-rules.js +207 -0
- package/dist/report-rules.js.map +1 -0
- package/dist/report.d.ts +3 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +26 -0
- package/dist/report.js.map +1 -0
- package/dist/sarif.d.ts +3 -0
- package/dist/sarif.d.ts.map +1 -0
- package/dist/sarif.js +74 -0
- package/dist/sarif.js.map +1 -0
- package/dist/types.d.ts +52 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/docs/CLAUDE_FOR_OSS_PLAYBOOK.md +31 -0
- package/docs/CONTRIBUTOR_BACKLOG.md +93 -0
- package/docs/RELEASE.md +38 -0
- package/docs/REPORT_SCHEMA.md +116 -0
- package/docs/ROADMAP.md +30 -0
- package/docs/examples/README.md +12 -0
- package/docs/examples/octocat-hello-world.md +44 -0
- package/docs/examples/sindresorhus-is.md +47 -0
- package/docs/report.schema.json +136 -0
- package/package.json +40 -0
package/dist/format.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export function formatJson(report) {
|
|
2
|
+
return `${JSON.stringify(report, null, 2)}\n`;
|
|
3
|
+
}
|
|
4
|
+
export function formatMarkdown(report) {
|
|
5
|
+
const checkRows = report.checks
|
|
6
|
+
.map((check) => `| ${check.passed ? "pass" : "fix"} | ${escapeCell(check.label)} | ${check.points} | ${escapeCell(check.detail)} |`)
|
|
7
|
+
.join("\n");
|
|
8
|
+
const actions = report.actions.length === 0 ? "No next actions." : formatActions(report);
|
|
9
|
+
return [
|
|
10
|
+
"# OSS Pulse",
|
|
11
|
+
"",
|
|
12
|
+
`Score: ${report.score}/100`,
|
|
13
|
+
`Status: ${report.status}`,
|
|
14
|
+
`Branch: ${report.branch}`,
|
|
15
|
+
`Latest commit: ${report.latestCommitIso ?? "unknown"}`,
|
|
16
|
+
"",
|
|
17
|
+
"## Checks",
|
|
18
|
+
"",
|
|
19
|
+
"| State | Check | Points | Detail |",
|
|
20
|
+
"| --- | --- | ---: | --- |",
|
|
21
|
+
checkRows,
|
|
22
|
+
"",
|
|
23
|
+
"## Next Actions",
|
|
24
|
+
"",
|
|
25
|
+
actions,
|
|
26
|
+
"",
|
|
27
|
+
].join("\n");
|
|
28
|
+
}
|
|
29
|
+
export function formatMarkdownSummary(report) {
|
|
30
|
+
const actions = report.actions.length === 0 ? "No next actions." : formatActions(report);
|
|
31
|
+
return [
|
|
32
|
+
"# OSS Pulse",
|
|
33
|
+
"",
|
|
34
|
+
`Score: ${report.score}/100`,
|
|
35
|
+
`Status: ${report.status}`,
|
|
36
|
+
"",
|
|
37
|
+
"## Next Actions",
|
|
38
|
+
"",
|
|
39
|
+
actions,
|
|
40
|
+
"",
|
|
41
|
+
].join("\n");
|
|
42
|
+
}
|
|
43
|
+
export function formatReleaseNotes(report) {
|
|
44
|
+
const verifiedChecks = report.checks
|
|
45
|
+
.filter((check) => check.passed)
|
|
46
|
+
.map((check) => `- ${escapeText(check.label)}`)
|
|
47
|
+
.join("\n");
|
|
48
|
+
const actions = report.actions.length === 0 ? "No follow-up actions." : formatActions(report);
|
|
49
|
+
return [
|
|
50
|
+
"# Release Notes Draft",
|
|
51
|
+
"",
|
|
52
|
+
"## Maintenance",
|
|
53
|
+
"",
|
|
54
|
+
`OSS Pulse score: ${report.score}/100 (${report.status})`,
|
|
55
|
+
"",
|
|
56
|
+
"## Verified Maintainer Surfaces",
|
|
57
|
+
"",
|
|
58
|
+
verifiedChecks || "No verified surfaces yet.",
|
|
59
|
+
"",
|
|
60
|
+
"## Follow-Up Actions",
|
|
61
|
+
"",
|
|
62
|
+
actions,
|
|
63
|
+
"",
|
|
64
|
+
].join("\n");
|
|
65
|
+
}
|
|
66
|
+
export function formatContributorOnboarding(report) {
|
|
67
|
+
const availableSurfaces = report.checks
|
|
68
|
+
.filter((check) => check.passed)
|
|
69
|
+
.map((check) => `- ${escapeText(check.label)}`)
|
|
70
|
+
.join("\n");
|
|
71
|
+
const actions = report.actions.length === 0 ? "No maintainer follow-up actions." : formatActions(report);
|
|
72
|
+
return [
|
|
73
|
+
"# Contributor Onboarding Report",
|
|
74
|
+
"",
|
|
75
|
+
`OSS Pulse score: ${report.score}/100 (${report.status})`,
|
|
76
|
+
"",
|
|
77
|
+
"## Available Now",
|
|
78
|
+
"",
|
|
79
|
+
availableSurfaces || "No contributor surfaces are ready yet.",
|
|
80
|
+
"",
|
|
81
|
+
"## Maintainer Follow-Up",
|
|
82
|
+
"",
|
|
83
|
+
actions,
|
|
84
|
+
"",
|
|
85
|
+
"## First PR Checklist",
|
|
86
|
+
"",
|
|
87
|
+
"- Read the available project documentation.",
|
|
88
|
+
"- Pick a small issue or ask for a starter task.",
|
|
89
|
+
"- Include the command you ran when opening a pull request.",
|
|
90
|
+
"",
|
|
91
|
+
].join("\n");
|
|
92
|
+
}
|
|
93
|
+
export function formatTriageSuggestions(report) {
|
|
94
|
+
const issueSuggestions = report.actions.length === 0
|
|
95
|
+
? "No issue triage suggestions."
|
|
96
|
+
: report.actions
|
|
97
|
+
.map((action) => `- Open ${action.priority}-priority issue: ${escapeText(action.title)} - ${escapeText(action.detail)}`)
|
|
98
|
+
.join("\n");
|
|
99
|
+
return [
|
|
100
|
+
"# Triage Suggestions",
|
|
101
|
+
"",
|
|
102
|
+
`OSS Pulse score: ${report.score}/100 (${report.status})`,
|
|
103
|
+
"",
|
|
104
|
+
"## Issue Triage",
|
|
105
|
+
"",
|
|
106
|
+
issueSuggestions,
|
|
107
|
+
"",
|
|
108
|
+
"## Pull Request Triage",
|
|
109
|
+
"",
|
|
110
|
+
"- Prioritize pull requests that close high-priority maintainer readiness gaps.",
|
|
111
|
+
"- Ask contributors to include the command they ran.",
|
|
112
|
+
"- Keep review scope tied to one OSS Pulse action or one small documentation surface.",
|
|
113
|
+
"",
|
|
114
|
+
].join("\n");
|
|
115
|
+
}
|
|
116
|
+
function formatActions(report) {
|
|
117
|
+
return report.actions
|
|
118
|
+
.map((action, index) => `${index + 1}. **${escapeText(action.title)}** (${action.priority}) - ${escapeText(action.detail)}`)
|
|
119
|
+
.join("\n");
|
|
120
|
+
}
|
|
121
|
+
function escapeCell(value) {
|
|
122
|
+
return escapeText(value).replaceAll("|", "\\|");
|
|
123
|
+
}
|
|
124
|
+
function escapeText(value) {
|
|
125
|
+
return value.replaceAll("\n", " ");
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,UAAU,CAAC,MAAmB;IAC5C,OAAO,GAAG,IAAI,CAAC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,MAAM,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,QAAQ,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACtG;SACA,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AACpC,CAAC"}
|
package/dist/git.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAIpE,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAuBlF"}
|
package/dist/git.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { access, readdir, stat } from "node:fs/promises";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
import { GitCommandError, RepositoryPathError } from "./errors.js";
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
7
|
+
export async function scanRepository(inputPath) {
|
|
8
|
+
const inputRoot = resolve(inputPath);
|
|
9
|
+
await ensureDirectory(inputRoot);
|
|
10
|
+
await ensureGitRepository(inputRoot);
|
|
11
|
+
const root = await gitTopLevel(inputRoot);
|
|
12
|
+
const [branch, latestCommitIso, commitsLast30Days, contributorsLast90Days, files] = await Promise.all([
|
|
13
|
+
git(root, ["branch", "--show-current"]),
|
|
14
|
+
optionalGit(root, ["log", "-1", "--format=%cI"]),
|
|
15
|
+
countGitLines(root, ["log", "--since=30 days ago", "--format=%H"]),
|
|
16
|
+
countGitLines(root, ["shortlog", "-sne", "--since=90 days ago", "HEAD"]),
|
|
17
|
+
scanMaintainerFiles(root),
|
|
18
|
+
]);
|
|
19
|
+
return {
|
|
20
|
+
branch: branch.trim() || "detached",
|
|
21
|
+
commitsLast30Days,
|
|
22
|
+
contributorsLast90Days,
|
|
23
|
+
files,
|
|
24
|
+
latestCommitIso: latestCommitIso.trim() || null,
|
|
25
|
+
root,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async function ensureDirectory(root) {
|
|
29
|
+
try {
|
|
30
|
+
const rootStat = await stat(root);
|
|
31
|
+
if (!rootStat.isDirectory()) {
|
|
32
|
+
throw new RepositoryPathError(root, "path is not a directory");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (error instanceof RepositoryPathError) {
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
40
|
+
throw new RepositoryPathError(root, "path does not exist");
|
|
41
|
+
}
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function ensureGitRepository(root) {
|
|
46
|
+
try {
|
|
47
|
+
const result = await git(root, ["rev-parse", "--is-inside-work-tree"]);
|
|
48
|
+
if (result.trim() !== "true") {
|
|
49
|
+
throw new RepositoryPathError(root, "path is not inside a git repository");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (error instanceof GitCommandError) {
|
|
54
|
+
throw new RepositoryPathError(root, "path is not inside a git repository");
|
|
55
|
+
}
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function gitTopLevel(root) {
|
|
60
|
+
return (await git(root, ["rev-parse", "--show-toplevel"])).trim();
|
|
61
|
+
}
|
|
62
|
+
async function scanMaintainerFiles(root) {
|
|
63
|
+
const [changelog, codeOfConduct, contributing, funding, goodFirstIssueTemplate, issueTemplate, license, pullRequestTemplate, readme, releaseWorkflow, security, workflowCount,] = await Promise.all([
|
|
64
|
+
existsAny(root, ["CHANGELOG.md", "CHANGELOG"]),
|
|
65
|
+
existsAny(root, ["CODE_OF_CONDUCT.md", ".github/CODE_OF_CONDUCT.md"]),
|
|
66
|
+
existsAny(root, ["CONTRIBUTING.md", ".github/CONTRIBUTING.md"]),
|
|
67
|
+
existsAny(root, [".github/FUNDING.yml", ".github/FUNDING.yaml"]),
|
|
68
|
+
existsAny(root, [
|
|
69
|
+
".github/ISSUE_TEMPLATE/good_first_issue.md",
|
|
70
|
+
".github/ISSUE_TEMPLATE/good_first_issue.yml",
|
|
71
|
+
".github/ISSUE_TEMPLATE/good_first_issue.yaml",
|
|
72
|
+
".github/ISSUE_TEMPLATE/good-first-issue.md",
|
|
73
|
+
".github/ISSUE_TEMPLATE/good-first-issue.yml",
|
|
74
|
+
".github/ISSUE_TEMPLATE/good-first-issue.yaml",
|
|
75
|
+
]),
|
|
76
|
+
existsAny(root, [".github/ISSUE_TEMPLATE.md", ".github/ISSUE_TEMPLATE"]),
|
|
77
|
+
existsAny(root, ["LICENSE", "LICENSE.md"]),
|
|
78
|
+
existsAny(root, [".github/PULL_REQUEST_TEMPLATE.md", ".github/pull_request_template.md"]),
|
|
79
|
+
existsAny(root, ["README.md", "README"]),
|
|
80
|
+
existsAny(root, [
|
|
81
|
+
".github/workflows/release.yml",
|
|
82
|
+
".github/workflows/release.yaml",
|
|
83
|
+
".github/workflows/publish.yml",
|
|
84
|
+
".github/workflows/publish.yaml",
|
|
85
|
+
]),
|
|
86
|
+
existsAny(root, ["SECURITY.md", ".github/SECURITY.md"]),
|
|
87
|
+
countWorkflowFiles(root),
|
|
88
|
+
]);
|
|
89
|
+
return {
|
|
90
|
+
changelog,
|
|
91
|
+
codeOfConduct,
|
|
92
|
+
contributing,
|
|
93
|
+
funding,
|
|
94
|
+
goodFirstIssueTemplate,
|
|
95
|
+
issueTemplate,
|
|
96
|
+
license,
|
|
97
|
+
pullRequestTemplate,
|
|
98
|
+
readme,
|
|
99
|
+
releaseWorkflow,
|
|
100
|
+
security,
|
|
101
|
+
workflowCount,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
async function existsAny(root, relativePaths) {
|
|
105
|
+
for (const relativePath of relativePaths) {
|
|
106
|
+
try {
|
|
107
|
+
await access(resolve(root, relativePath));
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
async function countWorkflowFiles(root) {
|
|
120
|
+
const workflowsRoot = resolve(root, ".github/workflows");
|
|
121
|
+
try {
|
|
122
|
+
const entries = await readdir(workflowsRoot, { withFileTypes: true });
|
|
123
|
+
return entries.filter((entry) => entry.isFile() && (entry.name.endsWith(".yml") || entry.name.endsWith(".yaml"))).length;
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
127
|
+
return 0;
|
|
128
|
+
}
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function countGitLines(root, args) {
|
|
133
|
+
const output = await optionalGit(root, args);
|
|
134
|
+
return output
|
|
135
|
+
.split("\n")
|
|
136
|
+
.map((line) => line.trim())
|
|
137
|
+
.filter((line) => line.length > 0).length;
|
|
138
|
+
}
|
|
139
|
+
async function optionalGit(root, args) {
|
|
140
|
+
try {
|
|
141
|
+
return await git(root, args);
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
if (error instanceof GitCommandError) {
|
|
145
|
+
return "";
|
|
146
|
+
}
|
|
147
|
+
throw error;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
async function git(root, args) {
|
|
151
|
+
try {
|
|
152
|
+
const result = await execFileAsync("git", ["-C", root, ...args]);
|
|
153
|
+
return result.stdout;
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
if (isExecError(error)) {
|
|
157
|
+
throw new GitCommandError(args, root, error.stderr);
|
|
158
|
+
}
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function isExecError(error) {
|
|
163
|
+
return (typeof error === "object" &&
|
|
164
|
+
error !== null &&
|
|
165
|
+
"stderr" in error &&
|
|
166
|
+
typeof error.stderr === "string");
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=git.js.map
|
package/dist/git.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGlE,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;AAEzC,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,SAAiB;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;IACpC,MAAM,eAAe,CAAC,SAAS,CAAC,CAAA;IAChC,MAAM,mBAAmB,CAAC,SAAS,CAAC,CAAA;IACpC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,CAAA;IAEzC,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,KAAK,CAAC,GAC/E,MAAM,OAA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,CAAC;AACH,CAAC;AAED,KAAK,UAAU,GAAG,CAAC,IAAY,EAAE,IAAuB;IACtD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,CAAA;QAChE,OAAO,MAAM,CAAC,MAAM,CAAA;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;QACrD,CAAC;QACD,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,CACjC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-annotations.d.ts","sourceRoot":"","sources":["../src/github-annotations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAI1D,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAGnE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { artifactUriForAction } from "./action-artifacts.js";
|
|
2
|
+
export function formatGithubAnnotations(report) {
|
|
3
|
+
const annotations = report.actions.map(formatAnnotation);
|
|
4
|
+
return annotations.length === 0 ? "" : `${annotations.join("\n")}\n`;
|
|
5
|
+
}
|
|
6
|
+
function formatAnnotation(action) {
|
|
7
|
+
const properties = [
|
|
8
|
+
`file=${escapeProperty(artifactUriForAction(action.id))}`,
|
|
9
|
+
"line=1",
|
|
10
|
+
`title=${escapeProperty(action.title)}`,
|
|
11
|
+
].join(",");
|
|
12
|
+
const message = escapeData(`${action.title}: ${action.detail}`);
|
|
13
|
+
return `::${annotationLevel(action.priority)} ${properties}::${message}`;
|
|
14
|
+
}
|
|
15
|
+
function annotationLevel(priority) {
|
|
16
|
+
switch (priority) {
|
|
17
|
+
case "high":
|
|
18
|
+
return "error";
|
|
19
|
+
case "medium":
|
|
20
|
+
return "warning";
|
|
21
|
+
case "low":
|
|
22
|
+
return "notice";
|
|
23
|
+
default:
|
|
24
|
+
return assertNever(priority);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function escapeData(value) {
|
|
28
|
+
return value.replaceAll("%", "%25").replaceAll("\r", "%0D").replaceAll("\n", "%0A");
|
|
29
|
+
}
|
|
30
|
+
function escapeProperty(value) {
|
|
31
|
+
return escapeData(value).replaceAll(":", "%3A").replaceAll(",", "%2C");
|
|
32
|
+
}
|
|
33
|
+
function assertNever(value) {
|
|
34
|
+
throw new Error(`unexpected annotation priority: ${value}`);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=github-annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-annotations.js","sourceRoot":"","sources":["../src/github-annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAK5D,MAAM,UAAU,uBAAuB,CAAC,MAAmB;IACzD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;IACxD,OAAO,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;AACtE,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAmB;IAC3C,MAAM,UAAU,GAAG;QACjB,QAAQ,cAAc,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE;QACzD,QAAQ;QACR,SAAS,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;KACxC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACX,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/D,OAAO,KAAK,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU,KAAK,OAAO,EAAE,CAAA;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,QAAiC;IACxD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,OAAO,CAAA;QAChB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAA;QAClB,KAAK,KAAK;YACR,OAAO,QAAQ,CAAA;QACjB;YACE,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAA;IAChC,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACrF,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AACxE,CAAC;AAED,SAAS,WAAW,CAAC,KAAY;IAC/B,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAA;AAC7D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CheckId, PulseAction, RepositorySignals } from "./types.js";
|
|
2
|
+
type CheckRule = {
|
|
3
|
+
readonly action: PulseAction | null;
|
|
4
|
+
readonly detail: (signals: RepositorySignals) => string;
|
|
5
|
+
readonly id: CheckId;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly passed: (signals: RepositorySignals) => boolean;
|
|
8
|
+
readonly points: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const CHECK_RULES: readonly CheckRule[];
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=report-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-rules.d.ts","sourceRoot":"","sources":["../src/report-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnF,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;IACnC,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,MAAM,CAAA;IACvD,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAA;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB,CAAA;AAyFD,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EA+H3C,CAAA"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
const ACTIONS = {
|
|
2
|
+
"add-ci-workflow": {
|
|
3
|
+
detail: "Add a minimal CI workflow so contributors can trust the project gate.",
|
|
4
|
+
id: "add-ci-workflow",
|
|
5
|
+
priority: "medium",
|
|
6
|
+
title: "Add CI workflow",
|
|
7
|
+
},
|
|
8
|
+
"add-changelog": {
|
|
9
|
+
detail: "Add CHANGELOG.md so users and contributors can follow release impact.",
|
|
10
|
+
id: "add-changelog",
|
|
11
|
+
priority: "medium",
|
|
12
|
+
title: "Add CHANGELOG",
|
|
13
|
+
},
|
|
14
|
+
"add-code-of-conduct": {
|
|
15
|
+
detail: "Add a code of conduct so contribution norms are explicit before growth.",
|
|
16
|
+
id: "add-code-of-conduct",
|
|
17
|
+
priority: "low",
|
|
18
|
+
title: "Add CODE_OF_CONDUCT",
|
|
19
|
+
},
|
|
20
|
+
"add-contributing-guide": {
|
|
21
|
+
detail: "Explain setup, test commands, PR expectations, and good first issue flow.",
|
|
22
|
+
id: "add-contributing-guide",
|
|
23
|
+
priority: "high",
|
|
24
|
+
title: "Add CONTRIBUTING guide",
|
|
25
|
+
},
|
|
26
|
+
"add-funding": {
|
|
27
|
+
detail: "Add .github/FUNDING.yml so sponsor paths are discoverable from GitHub.",
|
|
28
|
+
id: "add-funding",
|
|
29
|
+
priority: "low",
|
|
30
|
+
title: "Add funding metadata",
|
|
31
|
+
},
|
|
32
|
+
"add-good-first-issue-template": {
|
|
33
|
+
detail: "Add a good first issue template so maintainers can publish starter work quickly.",
|
|
34
|
+
id: "add-good-first-issue-template",
|
|
35
|
+
priority: "medium",
|
|
36
|
+
title: "Add good first issue template",
|
|
37
|
+
},
|
|
38
|
+
"add-issue-template": {
|
|
39
|
+
detail: "Add an issue template that asks for reproduction steps and expected behavior.",
|
|
40
|
+
id: "add-issue-template",
|
|
41
|
+
priority: "high",
|
|
42
|
+
title: "Add issue template",
|
|
43
|
+
},
|
|
44
|
+
"add-license": {
|
|
45
|
+
detail: "Add an OSI-approved license so downstream users can legally adopt the project.",
|
|
46
|
+
id: "add-license",
|
|
47
|
+
priority: "high",
|
|
48
|
+
title: "Add LICENSE",
|
|
49
|
+
},
|
|
50
|
+
"add-pull-request-template": {
|
|
51
|
+
detail: "Add a PR template covering intent, tests, and release-note impact.",
|
|
52
|
+
id: "add-pull-request-template",
|
|
53
|
+
priority: "high",
|
|
54
|
+
title: "Add pull request template",
|
|
55
|
+
},
|
|
56
|
+
"add-readme": {
|
|
57
|
+
detail: "Add a README with install, quick start, and contribution links.",
|
|
58
|
+
id: "add-readme",
|
|
59
|
+
priority: "high",
|
|
60
|
+
title: "Add README",
|
|
61
|
+
},
|
|
62
|
+
"add-release-workflow": {
|
|
63
|
+
detail: "Add a release or publish workflow so tagged releases are repeatable.",
|
|
64
|
+
id: "add-release-workflow",
|
|
65
|
+
priority: "medium",
|
|
66
|
+
title: "Add release workflow",
|
|
67
|
+
},
|
|
68
|
+
"add-security-policy": {
|
|
69
|
+
detail: "Add SECURITY.md so vulnerability reports have a private intake path.",
|
|
70
|
+
id: "add-security-policy",
|
|
71
|
+
priority: "high",
|
|
72
|
+
title: "Add SECURITY policy",
|
|
73
|
+
},
|
|
74
|
+
"invite-contributors": {
|
|
75
|
+
detail: "Create starter issues and invite external contributors into small, reviewable work.",
|
|
76
|
+
id: "invite-contributors",
|
|
77
|
+
priority: "medium",
|
|
78
|
+
title: "Grow external contributors",
|
|
79
|
+
},
|
|
80
|
+
"resume-maintenance": {
|
|
81
|
+
detail: "Land a small maintenance commit so visitors can see active stewardship.",
|
|
82
|
+
id: "resume-maintenance",
|
|
83
|
+
priority: "medium",
|
|
84
|
+
title: "Resume visible maintenance",
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
export const CHECK_RULES = [
|
|
88
|
+
{
|
|
89
|
+
action: ACTIONS["add-readme"],
|
|
90
|
+
detail: (signals) => (signals.files.readme ? "README found" : "README missing"),
|
|
91
|
+
id: "readme",
|
|
92
|
+
label: "README",
|
|
93
|
+
passed: (signals) => signals.files.readme,
|
|
94
|
+
points: 10,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
action: ACTIONS["add-license"],
|
|
98
|
+
detail: (signals) => (signals.files.license ? "LICENSE found" : "LICENSE missing"),
|
|
99
|
+
id: "license",
|
|
100
|
+
label: "License",
|
|
101
|
+
passed: (signals) => signals.files.license,
|
|
102
|
+
points: 15,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
action: ACTIONS["add-contributing-guide"],
|
|
106
|
+
detail: (signals) => signals.files.contributing ? "CONTRIBUTING guide found" : "CONTRIBUTING guide missing",
|
|
107
|
+
id: "contributing",
|
|
108
|
+
label: "Contribution guide",
|
|
109
|
+
passed: (signals) => signals.files.contributing,
|
|
110
|
+
points: 10,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
action: ACTIONS["add-issue-template"],
|
|
114
|
+
detail: (signals) => signals.files.issueTemplate ? "Issue template found" : "No issue template",
|
|
115
|
+
id: "issue-template",
|
|
116
|
+
label: "Issue template",
|
|
117
|
+
passed: (signals) => signals.files.issueTemplate,
|
|
118
|
+
points: 5,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
action: ACTIONS["add-good-first-issue-template"],
|
|
122
|
+
detail: (signals) => signals.files.goodFirstIssueTemplate
|
|
123
|
+
? "Good first issue template found"
|
|
124
|
+
: "No good first issue template",
|
|
125
|
+
id: "good-first-issue-template",
|
|
126
|
+
label: "Good first issue template",
|
|
127
|
+
passed: (signals) => signals.files.goodFirstIssueTemplate,
|
|
128
|
+
points: 5,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
action: ACTIONS["add-pull-request-template"],
|
|
132
|
+
detail: (signals) => signals.files.pullRequestTemplate
|
|
133
|
+
? "Pull request template found"
|
|
134
|
+
: "No pull request template",
|
|
135
|
+
id: "pull-request-template",
|
|
136
|
+
label: "Pull request template",
|
|
137
|
+
passed: (signals) => signals.files.pullRequestTemplate,
|
|
138
|
+
points: 10,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
action: ACTIONS["add-security-policy"],
|
|
142
|
+
detail: (signals) => signals.files.security ? "SECURITY policy found" : "SECURITY policy missing",
|
|
143
|
+
id: "security",
|
|
144
|
+
label: "Security policy",
|
|
145
|
+
passed: (signals) => signals.files.security,
|
|
146
|
+
points: 10,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
action: ACTIONS["add-ci-workflow"],
|
|
150
|
+
detail: (signals) => signals.files.workflowCount > 0
|
|
151
|
+
? `${signals.files.workflowCount} workflow file(s) found`
|
|
152
|
+
: "No workflow files found",
|
|
153
|
+
id: "ci-workflow",
|
|
154
|
+
label: "CI workflow",
|
|
155
|
+
passed: (signals) => signals.files.workflowCount > 0,
|
|
156
|
+
points: 5,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
action: ACTIONS["add-release-workflow"],
|
|
160
|
+
detail: (signals) => signals.files.releaseWorkflow ? "Release workflow found" : "No release workflow",
|
|
161
|
+
id: "release-workflow",
|
|
162
|
+
label: "Release workflow",
|
|
163
|
+
passed: (signals) => signals.files.releaseWorkflow,
|
|
164
|
+
points: 5,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
action: ACTIONS["add-changelog"],
|
|
168
|
+
detail: (signals) => (signals.files.changelog ? "CHANGELOG found" : "CHANGELOG missing"),
|
|
169
|
+
id: "changelog",
|
|
170
|
+
label: "Changelog",
|
|
171
|
+
passed: (signals) => signals.files.changelog,
|
|
172
|
+
points: 5,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
action: ACTIONS["add-funding"],
|
|
176
|
+
detail: (signals) => (signals.files.funding ? "Funding metadata found" : "No funding metadata"),
|
|
177
|
+
id: "funding",
|
|
178
|
+
label: "Funding metadata",
|
|
179
|
+
passed: (signals) => signals.files.funding,
|
|
180
|
+
points: 5,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
action: ACTIONS["invite-contributors"],
|
|
184
|
+
detail: (signals) => `${signals.contributorsLast90Days} contributor(s) in the last 90 days`,
|
|
185
|
+
id: "external-contributors",
|
|
186
|
+
label: "Contributor activity",
|
|
187
|
+
passed: (signals) => signals.contributorsLast90Days >= 2,
|
|
188
|
+
points: 5,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
action: ACTIONS["add-code-of-conduct"],
|
|
192
|
+
detail: (signals) => signals.files.codeOfConduct ? "Code of conduct found" : "Code of conduct missing",
|
|
193
|
+
id: "code-of-conduct",
|
|
194
|
+
label: "Code of conduct",
|
|
195
|
+
passed: (signals) => signals.files.codeOfConduct,
|
|
196
|
+
points: 5,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
action: ACTIONS["resume-maintenance"],
|
|
200
|
+
detail: (signals) => `${signals.commitsLast30Days} commit(s) in the last 30 days`,
|
|
201
|
+
id: "recent-activity",
|
|
202
|
+
label: "Recent activity",
|
|
203
|
+
passed: (signals) => signals.commitsLast30Days > 0,
|
|
204
|
+
points: 5,
|
|
205
|
+
},
|
|
206
|
+
];
|
|
207
|
+
//# sourceMappingURL=report-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-rules.js","sourceRoot":"","sources":["../src/report-rules.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,GAAkC;IAC7C,iBAAiB,EAAE;QACjB,MAAM,EAAE,uEAAuE;QAC/E,EAAE,EAAE,iBAAiB;QACrB,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,iBAAiB;KACzB;IACD,eAAe,EAAE;QACf,MAAM,EAAE,uEAAuE;QAC/E,EAAE,EAAE,eAAe;QACnB,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,eAAe;KACvB;IACD,qBAAqB,EAAE;QACrB,MAAM,EAAE,yEAAyE;QACjF,EAAE,EAAE,qBAAqB;QACzB,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,qBAAqB;KAC7B;IACD,wBAAwB,EAAE;QACxB,MAAM,EAAE,2EAA2E;QACnF,EAAE,EAAE,wBAAwB;QAC5B,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,wBAAwB;KAChC;IACD,aAAa,EAAE;QACb,MAAM,EAAE,wEAAwE;QAChF,EAAE,EAAE,aAAa;QACjB,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,sBAAsB;KAC9B;IACD,+BAA+B,EAAE;QAC/B,MAAM,EAAE,kFAAkF;QAC1F,EAAE,EAAE,+BAA+B;QACnC,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,+BAA+B;KACvC;IACD,oBAAoB,EAAE;QACpB,MAAM,EAAE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CAAC;QACtC,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,sBAAsB,qCAAqC;QAC3F,EAAE,EAAE,uBAAuB;QAC3B,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,sBAAsB,IAAI,CAAC;QACxD,MAAM,EAAE,CAAC;KACV;IACD;QACE,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC;QACtC,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAClB,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,yBAAyB;QACnF,EAAE,EAAE,iBAAiB;QACrB,KAAK,EAAE,iBAAiB;QACxB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa;QAChD,MAAM,EAAE,CAAC;KACV;IACD;QACE,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC;QACrC,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,iBAAiB,gCAAgC;QACjF,EAAE,EAAE,iBAAiB;QACrB,KAAK,EAAE,iBAAiB;QACxB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB,GAAG,CAAC;QAClD,MAAM,EAAE,CAAC;KACV;CACF,CAAA"}
|
package/dist/report.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2B,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEzF,wBAAgB,WAAW,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,GAAE,IAAiB,GAAG,WAAW,CA4B3F"}
|
package/dist/report.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CHECK_RULES } from "./report-rules.js";
|
|
2
|
+
export function buildReport(signals, now = new Date()) {
|
|
3
|
+
const checks = CHECK_RULES.map((rule) => {
|
|
4
|
+
const passed = rule.passed(signals);
|
|
5
|
+
return {
|
|
6
|
+
detail: rule.detail(signals),
|
|
7
|
+
id: rule.id,
|
|
8
|
+
label: rule.label,
|
|
9
|
+
passed,
|
|
10
|
+
points: passed ? rule.points : 0,
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
const actions = CHECK_RULES.flatMap((rule) => rule.passed(signals) || rule.action === null ? [] : [rule.action]);
|
|
14
|
+
const score = checks.reduce((total, check) => total + check.points, 0);
|
|
15
|
+
return {
|
|
16
|
+
actions,
|
|
17
|
+
branch: signals.branch,
|
|
18
|
+
checks,
|
|
19
|
+
generatedAtIso: now.toISOString(),
|
|
20
|
+
latestCommitIso: signals.latestCommitIso,
|
|
21
|
+
root: signals.root,
|
|
22
|
+
score,
|
|
23
|
+
status: score === 100 ? "ready" : "needs-work",
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG/C,MAAM,UAAU,WAAW,CAAC,OAA0B,EAAE,MAAY,IAAI,IAAI,EAAE;IAC5E,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAc,EAAE;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAEnC,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAC5B,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM;YACN,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,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