From b96f26d261ebca2f9dd2c1a9c382a075dd45f2e8 Mon Sep 17 00:00:00 2001 From: "J. Kirby Ross" Date: Mon, 10 Nov 2025 21:50:10 -0800 Subject: [PATCH 1/5] ci(labels): add label sync workflow and labels catalog (non-destructive) --- .github/labels.yml | 66 ++++++++++++++++++++++++++++++++ .github/workflows/label-sync.yml | 22 +++++++++++ 2 files changed, 88 insertions(+) create mode 100644 .github/labels.yml create mode 100644 .github/workflows/label-sync.yml diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 00000000..40006a54 --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,66 @@ +- name: type: bug + color: d73a4a + description: Bug report +- name: type: enhancement + color: a2eeef + description: Feature or enhancement +- name: type: docs + color: 0075ca + description: Documentation changes +- name: type: spec/design + color: bfd4f2 + description: Specification or design discussion +- name: type: tooling + color: c2e0c6 + description: Tooling or developer experience +- name: type: test + color: e4e669 + description: Tests or fixtures +- name: area: xtask + color: 5319e7 + description: Rust xtask tooling +- name: area: schemas + color: b60205 + description: JSON Schemas and examples +- name: area: diagrams + color: 0e8a16 + description: Mermaid diagrams and tooling +- name: area: ci + color: fef2c0 + description: CI/CD workflows +- name: area: build + color: 1d76db + description: Build, Makefile, toolchain +- name: area: determinism + color: 0366d6 + description: Deterministic projections and encodings +- name: area: privacy + color: 5319e7 + description: Privacy / ciphertext handling concerns +- name: area: governance + color: 0052cc + description: Governance model and docs +- name: priority: p0 + color: b60205 + description: Critical priority +- name: priority: p1 + color: d93f0b + description: High priority +- name: priority: p2 + color: fbca04 + description: Normal priority +- name: status: blocked + color: 000000 + description: Blocked on dependency +- name: needs: info + color: cfd3d7 + description: Needs more information +- name: needs: repro + color: cfd3d7 + description: Needs minimal reproduction +- name: good first issue + color: 7057ff + description: Good for newcomers +- name: help wanted + color: 008672 + description: Help appreciated diff --git a/.github/workflows/label-sync.yml b/.github/workflows/label-sync.yml new file mode 100644 index 00000000..7e5122ef --- /dev/null +++ b/.github/workflows/label-sync.yml @@ -0,0 +1,22 @@ +name: Label Sync + +on: + push: + paths: + - .github/labels.yml + workflow_dispatch: + +permissions: + contents: read + issues: write + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Sync labels from .github/labels.yml + uses: crazy-max/ghaction-github-labeler@v5 + with: + yaml_file: .github/labels.yml + skip_delete: true From be9e50ce91b3cec0414441f397246d1e0ce1a19c Mon Sep 17 00:00:00 2001 From: "J. Kirby Ross" Date: Thu, 13 Nov 2025 12:16:42 -0800 Subject: [PATCH 2/5] ci(labels): quote label names containing colons to satisfy YAML parsing for label sync --- .github/labels.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/labels.yml b/.github/labels.yml index 40006a54..00a0ba5e 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -1,61 +1,61 @@ -- name: type: bug +- name: "type: bug" color: d73a4a description: Bug report -- name: type: enhancement +- name: "type: enhancement" color: a2eeef description: Feature or enhancement -- name: type: docs +- name: "type: docs" color: 0075ca description: Documentation changes -- name: type: spec/design +- name: "type: spec/design" color: bfd4f2 description: Specification or design discussion -- name: type: tooling +- name: "type: tooling" color: c2e0c6 description: Tooling or developer experience -- name: type: test +- name: "type: test" color: e4e669 description: Tests or fixtures -- name: area: xtask +- name: "area: xtask" color: 5319e7 description: Rust xtask tooling -- name: area: schemas +- name: "area: schemas" color: b60205 description: JSON Schemas and examples -- name: area: diagrams +- name: "area: diagrams" color: 0e8a16 description: Mermaid diagrams and tooling -- name: area: ci +- name: "area: ci" color: fef2c0 description: CI/CD workflows -- name: area: build +- name: "area: build" color: 1d76db description: Build, Makefile, toolchain -- name: area: determinism +- name: "area: determinism" color: 0366d6 description: Deterministic projections and encodings -- name: area: privacy +- name: "area: privacy" color: 5319e7 description: Privacy / ciphertext handling concerns -- name: area: governance +- name: "area: governance" color: 0052cc description: Governance model and docs -- name: priority: p0 +- name: "priority: p0" color: b60205 description: Critical priority -- name: priority: p1 +- name: "priority: p1" color: d93f0b description: High priority -- name: priority: p2 +- name: "priority: p2" color: fbca04 description: Normal priority -- name: status: blocked +- name: "status: blocked" color: 000000 description: Blocked on dependency -- name: needs: info +- name: "needs: info" color: cfd3d7 description: Needs more information -- name: needs: repro +- name: "needs: repro" color: cfd3d7 description: Needs minimal reproduction - name: good first issue From ae56988322f5ff0e643c5865581c2aa0341cd008 Mon Sep 17 00:00:00 2001 From: "J. Kirby Ross" Date: Thu, 13 Nov 2025 12:23:37 -0800 Subject: [PATCH 3/5] diagrams: prewarm local mermaid-cli and use local mmdc to avoid intermittent npx exit 126 on CI; keep npx as fallback --- scripts/mermaid/generate.mjs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/mermaid/generate.mjs b/scripts/mermaid/generate.mjs index 170af05c..affcd102 100644 --- a/scripts/mermaid/generate.mjs +++ b/scripts/mermaid/generate.mjs @@ -385,7 +385,19 @@ async function main() { return; } - const mmdcPath = binPath('mmdc'); + // Warm up a local mmdc to avoid repeated concurrent npx executions which can + // occasionally fail under CI with exit 126 due to cache races. When the + // local binary is present we always prefer it; otherwise we fall back to npx. + let mmdcPath = binPath('mmdc'); + try { + const cliVer = await resolveMermaidCliVersion(); + if (!(await hasLocal(mmdcPath))) { + await run('npm', ['i', '--no-save', `@mermaid-js/mermaid-cli@${cliVer}`], { cwd: repoRoot }, 300000); + } + } catch (e) { + // Do not fail generation if warmup install fails; we'll fall back to npx. + } + mmdcPath = binPath('mmdc'); if (verifyOnly) { const errors = await verifyTasks(tasks); if (errors.length) { From 98be08f89895e96166ef9e88679f4ed8c2047f71 Mon Sep 17 00:00:00 2001 From: "J. Kirby Ross" Date: Thu, 13 Nov 2025 12:24:28 -0800 Subject: [PATCH 4/5] =?UTF-8?q?diagrams:=20add=20retry=20path=20=E2=80=94?= =?UTF-8?q?=20on=20npx=20failure=20(e.g.,=20exit=20126)=20install=20local?= =?UTF-8?q?=20mermaid-cli=20and=20rerun=20with=20mmdc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/mermaid/generate.mjs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/scripts/mermaid/generate.mjs b/scripts/mermaid/generate.mjs index affcd102..5781a963 100644 --- a/scripts/mermaid/generate.mjs +++ b/scripts/mermaid/generate.mjs @@ -195,6 +195,14 @@ async function hasLocal(cmdPath) { try { await fs.access(cmdPath); return true; } catch { return false; } } +async function ensureLocalMmdc() { + const cliVer = await resolveMermaidCliVersion(); + const bin = binPath('mmdc'); + if (await hasLocal(bin)) return bin; + await run('npm', ['i', '--no-save', `@mermaid-js/mermaid-cli@${cliVer}`], { cwd: repoRoot }, 300000); + return bin; +} + async function renderTask(task, mmdcPath) { const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'gatos-mmd-')); try { @@ -227,7 +235,20 @@ async function renderTask(task, mmdcPath) { if (await hasLocal(mmdcPath)) { await run(mmdcPath, argsLocal, {}, timeoutMs); } else { - await run('npx', argsNpx, {}, timeoutMs); + try { + await run('npx', argsNpx, {}, timeoutMs); + } catch (e) { + const msg = String(e && e.message || e || ''); + // Retry by installing locally if npx failed (seen as exit code 126 in CI under concurrency) + if (msg.includes('exited with code 126') || msg.includes('exited with code')) { + const local = await ensureLocalMmdc().catch(() => null); + if (local) { + await run(local, argsLocal, {}, timeoutMs); + return; + } + } + throw e; + } } } finally { // Clean up temporary directory regardless of success/failure From 925e8d1e716d49c26ff315657c0f761eb39019f5 Mon Sep 17 00:00:00 2001 From: "J. Kirby Ross" Date: Thu, 13 Nov 2025 12:27:37 -0800 Subject: [PATCH 5/5] =?UTF-8?q?ci(labels):=20make=20colors=20unique=20?= =?UTF-8?q?=E2=80=94=20schemas=20->=206e5494,=20privacy=20->=206f42c1=20(a?= =?UTF-8?q?void=20duplicates=20with=20xtask/privacy=20and=20schemas/p0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/labels.yml b/.github/labels.yml index 00a0ba5e..8115e0f7 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -20,7 +20,7 @@ color: 5319e7 description: Rust xtask tooling - name: "area: schemas" - color: b60205 + color: 6e5494 description: JSON Schemas and examples - name: "area: diagrams" color: 0e8a16 @@ -35,7 +35,7 @@ color: 0366d6 description: Deterministic projections and encodings - name: "area: privacy" - color: 5319e7 + color: 6f42c1 description: Privacy / ciphertext handling concerns - name: "area: governance" color: 0052cc