Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Keep copied Markdown evidence out of issue metadata
pulse-triage[bot]df3a3d1e717f
diff --git a/.github/scripts/issue-version-triage.cjs b/.github/scripts/issue-version-triage.cjsindex 0a66aa0b2b..2854abb08d 100644--- a/.github/scripts/issue-version-triage.cjs+++ b/.github/scripts/issue-version-triage.cjs@@ -10,36 +10,79 @@ function escapeRegExp(value) {return String(value || "").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");}-function atxHeading(text) {- // Edited issue forms still use Markdown: up to three leading spaces and- // one to six hashes, separated from the text by whitespace. A closing hash- // run is optional, but only closes a heading when preceded by whitespace.- const match = text.match(/^ {0,3}#{1,6}(?:[ \t]+(.*)|$)/);- if (!match) return null;- return (match[1] || "").replace(/(?:^|[ \t]+)#+[ \t]*$/, "").trim();+// Use the same locked GFM lexer as Pulse's Markdown surfaces, without+// rendering or executing any issue content. Only top-level declarations count.+const { lexer } = require("marked");++function inlineProjection(tokens, maskCode = false) {+ return (tokens || []).map((token) => {+ const raw = token.raw || "";+ // Keep line positions when removing hidden comments. A comment inside a+ // code span is a literal, not an HTML token, and remains evidence.+ if (token.type === "html" && /^<!--/.test(raw)) {+ return raw.replace(/[^\r\n]/g, "");+ }+ if (maskCode && token.type === "codespan") {+ return raw.replace(/[^\r\n]/g, " ");+ }+ if (token.tokens && typeof token.text === "string") {+ const offset = raw.indexOf(token.text);+ if (offset !== -1) {+ return raw.slice(0, offset) + inlineProjection(token.tokens, maskCode) ++ raw.slice(offset + token.text.length);+ }+ }+ return raw;+ }).join("");}function declarationLines(body) {- let fence = null;- return stripHTMLComments(body).split(/\r?\n/).map((text) => {- const marker = text.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);- let delimiter = false;- const inCode = fence !== null;- if (fence) {- if (marker && marker[1][0] === fence.character &&- marker[1].length >= fence.length && !marker[2].trim()) {- fence = null;- delimiter = true;+ const lines = [];+ const append = (text, declaration = false, metadata = text) => {+ const visible = text.split(/\r?\n/);+ const declared = metadata.split(/\r?\n/);+ visible.forEach((value, i) => lines.push({+ text: value,+ metadata: declared[i] || "",+ delimiter: false,+ declaration,+ heading: null,+ }));+ };+ for (const token of lexer(String(body || ""), { gfm: true })) {+ if (token.type === "heading") {+ const text = inlineProjection(token.tokens).trim();+ lines.push({ text, metadata: text, delimiter: false, declaration: true, heading: text });+ } else if (token.type === "paragraph") {+ append(inlineProjection(token.tokens), true, inlineProjection(token.tokens, true));+ } else if (token.type === "code") {+ // A real version field may have a fenced or indented value. Its contents+ // remain a value, never new metadata or a section boundary.+ append(token.text);+ } else if (token.type === "list") {+ // Preserve legacy "- **Pulse version**: ..." declarations. Only an+ // item's first line can declare one; lazy/nested copied content cannot.+ for (const item of token.items) {+ const first = item.tokens[0];+ if (first && first.type === "text" && first.tokens) {+ const text = inlineProjection(first.tokens);+ const metadata = inlineProjection(first.tokens, true);+ append(text.split(/\r?\n/)[0], true, metadata.split(/\r?\n/)[0]);+ append(text.split(/\r?\n/).slice(1).join("\n"));+ for (const nested of item.tokens.slice(1)) append(nested.raw || "");+ } else {+ append(item.raw);+ }}- } else if (marker && (marker[1][0] === "~" || !marker[2].includes("`"))) {- fence = { character: marker[1][0], length: marker[1].length };- delimiter = true;+ } else if (token.type === "html" && /^\s*<!--/.test(token.raw)) {+ append("");+ } else {+ // Block quotes (including lazy continuation), HTML, tables and nested+ // examples are evidence, not top-level form structure.+ append(token.raw || "");}- // Pasted examples and logs are evidence, not issue-form structure. Keep- // their text as a value under a real field, but never scan it for fields.- const declaration = !inCode && !delimiter && !/^(?: {4}|\t)/.test(text);- return { text, delimiter, declaration, heading: declaration ? atxHeading(text) : null };- });+ }+ return lines;}function firstFieldValue(lines) {@@ -64,86 +107,6 @@ function extractSectionValue(body, heading, followingHeadings = []) {return lines.slice(start + 1, end).map((line) => line.text).join("\n").trim();}-function stripHTMLComments(value) {- let stripped = String(value || "");- let previous;- do {- previous = stripped;- let fence = null;- let inComment = false;- // Strip hidden template text, not literal markers in pasted code. In- // particular, an unfinished HTML response must not swallow the real form- // fields after its closing Markdown fence. Match the same fences and- // indentation that declarationLines excludes from metadata declarations.- stripped = stripped.split(/(\r?\n)/).map((text, index) => {- if (index % 2) return text;- const marker = text.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);- if (!inComment) {- if (fence) {- if (marker && marker[1][0] === fence.character &&- marker[1].length >= fence.length && !marker[2].trim()) {- fence = null;- }- return text;- }- if (marker && (marker[1][0] === "~" || !marker[2].includes("`"))) {- fence = { character: marker[1][0], length: marker[1].length };- return text;- }- // A quoted log is not a top-level form declaration. Its literal- // comment opener must not hide the unquoted fields which follow it.- if (/^(?: {4}|\t| {0,3}>)/.test(text)) return text;- }- // Match complete, same-line code spans by exact backtick-run length.- // Looking up the next run avoids rescanning a long pasted line for each- // unmatched delimiter. Backticks inside a hidden comment cannot open a- // span: the scanner below skips the comment before considering them.- const codeEnds = new Map();- const nextRun = new Map();- const runs = [...text.matchAll(/`+/g)];- for (let i = runs.length - 1; i >= 0; i -= 1) {- const run = runs[i];- if (nextRun.has(run[0].length)) {- codeEnds.set(run.index, nextRun.get(run[0].length));- }- nextRun.set(run[0].length, run.index + run[0].length);- }- const token = /<!--|`+/g;- let visible = "";- let offset = 0;- while (offset < text.length) {- if (inComment) {- const end = text.indexOf("-->", offset);- if (end === -1) break;- offset = end + 3;- inComment = false;- } else {- token.lastIndex = offset;- const next = token.exec(text);- if (!next) return visible + text.slice(offset);- const start = next.index;- visible += text.slice(offset, start);- let escapes = 0;- for (let i = start - 1; i >= 0 && text[i] === "\\"; i -= 1) escapes += 1;- const codeEnd = next[0][0] === "`" && escapes % 2 === 0 && codeEnds.get(start);- if (codeEnd) {- visible += text.slice(start, codeEnd);- offset = codeEnd;- } else if (next[0] === "<!--" && escapes % 2 === 0) {- offset = start + 4;- inComment = true;- } else {- visible += next[0];- offset = start + next[0].length;- }- }- }- return visible;- }).join("");- } while (stripped !== previous);- return stripped;-}-function classifyAdditionalActionableTopics(body) {const value = extractSectionValue(body, "Additional actionable topics", ["Pulse version",@@ -153,11 +116,11 @@ function classifyAdditionalActionableTopics(body) {]);if (value === null) return null;- const normalized = stripHTMLComments(value)+ const normalized = value.trim().toLowerCase().replace(/[.!]+$/g, "");- if (!normalized) return false;+ if (!normalized || !/[\p{L}\p{N}]/u.test(normalized)) return false;return !new Set(["_no response_",@@ -198,7 +161,7 @@ function extractPulseVersion(title, body) {}for (let i = 0; i < lines.length; i += 1) {if (!lines[i].declaration) continue;- const line = (lines[i].heading ?? lines[i].text).replace(/\*\*|__/g, "")+ const line = (lines[i].heading ?? lines[i].metadata).replace(/\*\*|__/g, "").replace(/^[ \t]*[-*][ \t]+/, "").trim();const field = line.match(/^Pulse[ \t]*(?:[|-][ \t]*)?version(?:[ \t]*[:|][ \t]*|[ \t]+|$)(.*)$/i@@ -208,7 +171,12 @@ function extractPulseVersion(title, body) {// Legacy inline/standalone fields have the same authority as the form.// Unknown or incomplete must not borrow an agent/platform version or// an upgrade's starting version from the title.- const inlineValue = field[1].trim();+ const visibleLine = (lines[i].heading ?? lines[i].text).replace(/\*\*|__/g, "")+ .replace(/^[ \t]*[-*][ \t]+/, "").trim();+ const visibleField = visibleLine.match(+ /^Pulse[ \t]*(?:[|-][ \t]*)?version(?:[ \t]*[:|][ \t]*|[ \t]+|$)(.*)$/i+ );+ const inlineValue = visibleField ? visibleField[1].trim() : "";if (inlineValue) return normalizeLegacyVersionValue(inlineValue);// A declared value may itself be fenced; that does not turn headings// elsewhere in a fenced log into declarations.@@ -216,6 +184,9 @@ function extractPulseVersion(title, body) {}}+ // A starting version named in an upgrade title is not a running-version+ // declaration. Copied examples may leave no usable body field at all.+ if (/\b(?:upgrad(?:e|ed|ing)|migrat(?:e|ed|ing))\b[^\n]*\bfrom\b/i.test(String(title || ""))) return null;return normalizeVersion(title);}diff --git a/.github/scripts/issue-version-triage.test.cjs b/.github/scripts/issue-version-triage.test.cjsindex 6f9167feb1..f34fd3dcb0 100644--- a/.github/scripts/issue-version-triage.test.cjs+++ b/.github/scripts/issue-version-triage.test.cjs@@ -547,26 +547,30 @@ test("inline and quoted HTML literals cannot hide subsequent form declarations",}});-test("actual hidden comments stay hidden beside inline and quoted evidence", () => {+test("an interrupted inline comment cannot turn an unclosed code fence into visible fields", () => {const { extractPulseVersion, classifyV6FeedbackType, classifyAdditionalActionableTopics } = triage.internals;for (const evidence of ["A literal `<!-- unfinished` followed by <!--",- "A mismatched `<!-- opener`` remains an actual comment",+ "A mismatched `<!-- opener`` remains text before a block quote","An escaped \\` backtick does not protect <!-- unfinished`",- "An even escape \\\\<!-- still opens a comment",+ "An even escape \\\\<!-- remains text before the quote","<!-- a hidden ` backtick is not an opener --> <!-- second hidden`",]) {const body = [evidence, "> quoted text", "```", "### Pulse version", "6.4.1",- "### Feedback type", "Bug / regression", "### Additional actionable topics", "Hidden topic",+ "### Feedback type", "Bug / regression", "### Additional actionable topics", "Copied topic","-->", "### Pulse version", "unknown", "### Feedback type", "Documentation issue","### Additional actionable topics", "None"].join("\n");+ // GFM's block lexer puts every later line inside the unclosed fence.+ // The previous scanner mistakenly treated an inline opener as a comment+ // across those blocks, then accepted invisible headings after its close.assert.equal(extractPulseVersion("Upgrade from v6.4.5", body), null, body);- assert.equal(classifyV6FeedbackType(body), "documentation", body);- assert.equal(classifyAdditionalActionableTopics(body), false, body);- const unfinished = body.replace("-->\n### Pulse version\nunknown", "\n### Pulse version\nunknown");- assert.equal(extractPulseVersion("Bug", unfinished), null, unfinished);- assert.equal(classifyV6FeedbackType(unfinished), null, unfinished);- assert.equal(classifyAdditionalActionableTopics(unfinished), null, unfinished);+ assert.equal(classifyV6FeedbackType(body), null, body);+ assert.equal(classifyAdditionalActionableTopics(body), null, body);+ const visible = body + "\n```\n### Pulse version\n6.5.0\n" ++ "### Feedback type\nDocumentation issue\n### Additional actionable topics\nNone";+ assert.equal(extractPulseVersion("Upgrade from v6.4.5", visible), "6.5.0", visible);+ assert.equal(classifyV6FeedbackType(visible), "documentation", visible);+ assert.equal(classifyAdditionalActionableTopics(visible), false, visible);}});@@ -1419,3 +1423,95 @@ test("a mismatched current issue identity fails closed", async () => {assert.equal(calls.removeLabel.length, 0);assert.equal(calls.createComment.length, 0);});+++test("quoted and multiline inline-code versions cannot replace a legacy declaration", () => {+ const { extractPulseVersion } = triage.internals;+ for (const newline of ["\n", "\r\n"]) {+ for (const copied of [+ "> Copied old log\nPulse version: 6.4.5",+ "Pasted text: `\nPulse version: 6.4.5\n`",+ "Pasted text: **`\nPulse version: 6.4.5\n`**",+ "- Copied old log\n Pulse version: 6.4.5",+ "<pre>\nPulse version: 6.4.5\n</pre>",+ ]) {+ const body = (copied + "\n\nPulse version: **`6.5.0`**").replaceAll("\n", newline);+ assert.equal(extractPulseVersion("Upgrade from v6.4.5", body), "6.5.0", body);+ assert.equal(extractPulseVersion("Bug", copied.replaceAll("\n", newline)), null, copied);+ }+ }+});++test("raw HTML and nested headings cannot declare form metadata", () => {+ const { extractPulseVersion, classifyV6FeedbackType, classifyAdditionalActionableTopics } = triage.internals;+ const fields = "### Pulse version\n6.4.5\n### Feedback type\nBug / regression\n" ++ "### Additional actionable topics\nCopied template text.";+ for (const copied of [+ "<div>\n" + fields + "\n</div>",+ "<pre>\n" + fields + "\n</pre>",+ "<script>\n" + fields + "\n</script>",+ fields.split("\n").map(line => "> " + line).join("\n"),+ "- Copied template\n\n" + fields.split("\n").map(line => " " + line).join("\n"),+ ]) {+ assert.equal(extractPulseVersion("No declared version", copied), null, copied);+ assert.equal(classifyV6FeedbackType(copied), null, copied);+ assert.equal(classifyAdditionalActionableTopics(copied), null, copied);+ const body = copied + "\n\n### Pulse version\nunknown\n### Feedback type\nDocumentation issue\n" ++ "### Additional actionable topics\nNone";+ assert.equal(extractPulseVersion("Upgrade from v6.4.5", body), null, body);+ assert.equal(classifyV6FeedbackType(body), "documentation", body);+ assert.equal(classifyAdditionalActionableTopics(body), false, body);+ }+});++test("the actual label consumer keeps copied declarations from changing report or Community state", async () => {+ const { github, calls } = createGithub();+ const issue = { number: 2902, title: "Pasted old installer output",+ body: "> Copied log\nPulse version: 6.4.5\n\n" ++ "<div>\n### Feedback type\nBug / regression\n### Additional actionable topics\nExample\n</div>\n\n" ++ "Pulse version: `6.5.0`",+ labels: ["bug", "affects-6.4.5", "needs-version-info", "needs-retest-on-latest", "needs-human", "operator-reviewed"]+ .map(name => ({ name })) };+ await syncLabels({ github, core: createCore(), context: createContext({ issue }) });+ assert.deepEqual(calls.addLabels.map(call => call.labels), [["affects-6.5.0"]]);+ assert.deepEqual(calls.removeLabel.map(call => call.name), ["affects-6.4.5", "needs-version-info"]);+ assert.deepEqual(calls.createComment, []);+ assert.deepEqual(calls.getLatestRelease, []);+ assert.deepEqual(calls.paginate, []);+ assert.deepEqual(calls.getIssue.map(call => call.issue_number), [2902]);+});+++test("triage workflow prepares and checks the exact parser before minting its write token", () => {+ const workflow = fs.readFileSync(path.resolve(__dirname, "../workflows/issue-version-label-sync.yml"), "utf8");+ const install = workflow.indexOf("run: npm ci --ignore-scripts --no-audit --no-fund --prefix .github/scripts");+ const check = workflow.indexOf("run: npm run test:triage --prefix .github/scripts");+ const credential = workflow.indexOf("- name: Mint triage bot token");+ assert.ok(install >= 0 && check > install && credential > check);+ assert.match(workflow, /node-version: '24'/);+ assert.match(workflow, /actions\/setup-node@[0-9a-f]{40}/);+ assert.match(workflow, /persist-credentials: false/);+ for (const file of ["package.json", "package-lock.json", "issue-version-triage.test.cjs", "triage-comment-policy.test.cjs"]) {+ assert.ok(workflow.includes(`.github/scripts/${file}`), file);+ }+ assert.ok(workflow.includes("docs/ISSUE_TRIAGE.md"));+ assert.ok(workflow.includes(".github/ISSUE_TEMPLATE"));+ assert.ok(workflow.includes(".github/workflows"));+ assert.doesNotMatch(workflow, /npm install|--ignore-scripts=false|\$\{\{ github\.event\.issue\.body/);+});++test("the standalone triage graph reuses the existing exact parser without transitive or lifecycle additions", () => {+ const manifest = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8"));+ const lock = JSON.parse(fs.readFileSync(path.join(__dirname, "package-lock.json"), "utf8"));+ assert.equal(manifest.private, true);+ assert.deepEqual(manifest.dependencies, { marked: "17.0.6" });+ assert.deepEqual(lock.packages[""].dependencies, manifest.dependencies);+ assert.deepEqual(Object.keys(lock.packages).sort(), ["", "node_modules/marked"]);+ const parser = lock.packages["node_modules/marked"];+ assert.equal(parser.version, manifest.dependencies.marked);+ assert.equal(parser.resolved, "https://registry.npmjs.org/marked/-/marked-17.0.6.tgz");+ assert.match(parser.integrity, /^sha512-/);+ assert.equal(parser.hasInstallScript, undefined);+ assert.equal(parser.dependencies, undefined);+ assert.equal(parser.optionalDependencies, undefined);+});diff --git a/.github/scripts/package-lock.json b/.github/scripts/package-lock.jsonnew file mode 100644index 0000000000..1a3fd98afe--- /dev/null+++ b/.github/scripts/package-lock.json@@ -0,0 +1,30 @@+{+ "name": "pulse-community-scripts",+ "version": "1.0.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "pulse-community-scripts",+ "version": "1.0.0",+ "dependencies": {+ "marked": "17.0.6"+ },+ "engines": {+ "node": ">=24"+ }+ },+ "node_modules/marked": {+ "version": "17.0.6",+ "resolved": "https://registry.npmjs.org/marked/-/marked-17.0.6.tgz",+ "integrity": "sha512-gB0gkNafnonOw0obSTEGZTT86IuhILt2Wfx0mWH/1Au83kybTayroZ/V6nS25mN7u8ASy+5fMhgB3XPNrOZdmA==",+ "license": "MIT",+ "bin": {+ "marked": "bin/marked.js"+ },+ "engines": {+ "node": ">= 20"+ }+ }+ }+}diff --git a/.github/scripts/package.json b/.github/scripts/package.jsonnew file mode 100644index 0000000000..e63e5f5cfb--- /dev/null+++ b/.github/scripts/package.json@@ -0,0 +1,14 @@+{+ "name": "pulse-community-scripts",+ "version": "1.0.0",+ "private": true,+ "engines": {+ "node": ">=24"+ },+ "dependencies": {+ "marked": "17.0.6"+ },+ "scripts": {+ "test:triage": "node --test issue-version-triage.test.cjs triage-comment-policy.test.cjs"+ }+}diff --git a/.github/workflows/README.md b/.github/workflows/README.mdindex 861e6ae00b..8587eb278f 100644--- a/.github/workflows/README.md+++ b/.github/workflows/README.md@@ -270,6 +270,7 @@ verify downloaded files offline against the candidate-builder identity.**File**: `issue-version-label-sync.yml`- The silent metadata path runs on `opened`, `edited`, and `reopened` issue events. The shared helper at `.github/scripts/issue-version-triage.cjs` maintains version labels, `needs-version-info`, feedback classification and `needs-decomposition`.+- Its Node 24 job installs the exact locked Markdown lexer with lifecycle scripts disabled, then tests the helper before minting the triage write token. Top-level fields count; quoted, nested, HTML and inline-code examples remain evidence rather than declarations.- It reads the current report and labels before classifying; failed reads stop without an event-snapshot fallback, and closed issues or pull requests are skipped. A superseded declaration event cannot restore a cleared decomposition task. No release lookup is needed for metadata classification.- Version-only retest posting and marked-request timeout closure workflows are retired. An older reported version or silence is not evidence of resolution.- Community owns public follow-up and closure after whole-thread review, relevant-fix verification and confirmed released-source inclusion. The synchronizer neither adds nor removes the community-owned `needs-retest-on-latest` label. Classification uses individual label additions/removals rather than replacing the event snapshot, preserving concurrent Community label decisions. Existing labels and comments are context, not proof that a reporter has or has not replied.diff --git a/.github/workflows/issue-version-label-sync.yml b/.github/workflows/issue-version-label-sync.ymlindex 701da98865..b1023be1f2 100644--- a/.github/workflows/issue-version-label-sync.yml+++ b/.github/workflows/issue-version-label-sync.yml@@ -16,21 +16,39 @@ jobs:runs-on: ubuntu-24.04timeout-minutes: 10steps:- - name: Mint triage bot token- id: triage-token- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0- with:- app-id: 2484142- private-key: ${{ secrets.PULSE_TRIAGE_APP_PRIVATE_KEY }}-- - name: Check out triage helper+ - name: Check out triage helper and locked parseruses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1with:persist-credentials: falsesparse-checkout: |.github/scripts/issue-version-triage.cjs+ .github/scripts/issue-version-triage.test.cjs+ .github/scripts/triage-comment-policy.test.cjs+ .github/scripts/package.json+ .github/scripts/package-lock.json+ .github/ISSUE_TEMPLATE+ .github/workflows+ docs/ISSUE_TRIAGE.mdsparse-checkout-cone-mode: false+ - name: Set up Node.js+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0+ with:+ node-version: '24'++ - name: Install locked parser without lifecycle scripts+ run: npm ci --ignore-scripts --no-audit --no-fund --prefix .github/scripts++ - name: Verify silent triage before obtaining its write credential+ run: npm run test:triage --prefix .github/scripts++ - name: Mint triage bot token+ id: triage-token+ uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0+ with:+ app-id: 2484142+ private-key: ${{ secrets.PULSE_TRIAGE_APP_PRIVATE_KEY }}+- name: Sync issue version metadatauses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0with:diff --git a/docs/ISSUE_TRIAGE.md b/docs/ISSUE_TRIAGE.mdindex 7d283f87fe..376eca0978 100644--- a/docs/ISSUE_TRIAGE.md+++ b/docs/ISSUE_TRIAGE.md@@ -19,6 +19,14 @@ Reporters may still write free-form issues, edit form output, or discover asecond topic during discussion. Triage owns decomposition in those cases; itmust not require the reporter to refile information they already supplied.+Automatic metadata uses top-level rendered Markdown fields, not declarations+inside quoted logs, nested lists, raw HTML or code examples. A legacy bullet+whose first line explicitly names **Pulse version** remains a declaration;+a copied continuation does not. Hidden comments do not supply a value, and+an upgrade title's **from** version is not a fallback for the failing version.+These labels support intake only: they do not establish a cause, resolution or+reason to contact the reporter. Existing reports need no refile.+The bug and pre-release forms ask for the version on the failing runninginstance, not merely the version before an upgrade. If installation failedbefore Pulse started, the attempted version or release asset is the relevant