From dd9e5b7921bfb6ff189f2969eb1386ec482495de Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 21:24:43 +0000 Subject: [PATCH] feat: add standard CI workflow and fix lint/test failures - Added `.github/workflows/ci.yml` to run build, lint, and test on PRs/push to main. - Updated `.github/workflows/ci-resilience-nightly.yml` to use Node.js 22. - Fixed lint errors in `src/services/governance/index.js` (no-empty, preserve-caught-error). - Added `governance-agent` to daily roster and scheduler prompt to fix `npm test` scheduler validation failure. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- .github/workflows/ci-resilience-nightly.yml | 2 +- .github/workflows/ci.yml | 22 ++++++++++++++++++ src/prompts/daily-scheduler.md | 25 +++++++++++---------- src/prompts/roster.json | 1 + src/services/governance/index.js | 8 ++++--- 5 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci-resilience-nightly.yml b/.github/workflows/ci-resilience-nightly.yml index 3df8ac8..0f7c55d 100644 --- a/.github/workflows/ci-resilience-nightly.yml +++ b/.github/workflows/ci-resilience-nightly.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 cache: npm - name: Install dependencies diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1234f7f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 22 + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + - run: npm ci + - run: npm run build + - run: npm run lint + - run: npm test diff --git a/src/prompts/daily-scheduler.md b/src/prompts/daily-scheduler.md index 5973af9..02c45e4 100644 --- a/src/prompts/daily-scheduler.md +++ b/src/prompts/daily-scheduler.md @@ -27,15 +27,16 @@ Canonical roster source: `src/prompts/roster.json` (`daily` key). | 8 | docs-agent | `docs-agent.md` | | 9 | docs-alignment-agent | `docs-alignment-agent.md` | | 10 | docs-code-investigator | `docs-code-investigator.md` | -| 11 | innerhtml-migration-agent | `innerhtml-migration-agent.md` | -| 12 | known-issues-agent | `known-issues-agent.md` | -| 13 | load-test-agent | `load-test-agent.md` | -| 14 | log-fixer-agent | `log-fixer-agent.md` | -| 15 | onboarding-audit-agent | `onboarding-audit-agent.md` | -| 16 | perf-agent | `perf-agent.md` | -| 17 | protocol-research-agent | `protocol-research-agent.md` | -| 18 | scheduler-update-agent | `scheduler-update-agent.md` | -| 19 | style-agent | `style-agent.md` | -| 20 | test-audit-agent | `test-audit-agent.md` | -| 21 | todo-triage-agent | `todo-triage-agent.md` | -| 22 | torch-garbage-collection-agent | `torch-garbage-collection-agent.md` | +| 11 | governance-agent | `governance-agent.md` | +| 12 | innerhtml-migration-agent | `innerhtml-migration-agent.md` | +| 13 | known-issues-agent | `known-issues-agent.md` | +| 14 | load-test-agent | `load-test-agent.md` | +| 15 | log-fixer-agent | `log-fixer-agent.md` | +| 16 | onboarding-audit-agent | `onboarding-audit-agent.md` | +| 17 | perf-agent | `perf-agent.md` | +| 18 | protocol-research-agent | `protocol-research-agent.md` | +| 19 | scheduler-update-agent | `scheduler-update-agent.md` | +| 20 | style-agent | `style-agent.md` | +| 21 | test-audit-agent | `test-audit-agent.md` | +| 22 | todo-triage-agent | `todo-triage-agent.md` | +| 23 | torch-garbage-collection-agent | `torch-garbage-collection-agent.md` | diff --git a/src/prompts/roster.json b/src/prompts/roster.json index 6d41f4b..9fe4dda 100644 --- a/src/prompts/roster.json +++ b/src/prompts/roster.json @@ -10,6 +10,7 @@ "docs-agent", "docs-alignment-agent", "docs-code-investigator", + "governance-agent", "innerhtml-migration-agent", "known-issues-agent", "load-test-agent", diff --git a/src/services/governance/index.js b/src/services/governance/index.js index c57029d..a5d8532 100644 --- a/src/services/governance/index.js +++ b/src/services/governance/index.js @@ -50,7 +50,9 @@ export async function getProposal(id) { let diff = ''; try { diff = await fs.readFile(diffPath, 'utf8'); - } catch {} + } catch { + // Ignore missing diff + } return { id, @@ -60,7 +62,7 @@ export async function getProposal(id) { dir }; } catch (e) { - throw new Error(`Proposal ${id} not found or invalid: ${e.message}`); + throw new Error(`Proposal ${id} not found or invalid: ${e.message}`, { cause: e }); } } @@ -281,6 +283,6 @@ export async function rollbackPrompt(target, hashOrStrategy = 'latest') { execSync(`git checkout "${commit}" -- "${target}"`); return { success: true, source: 'git', restored: commit }; } catch (e) { - throw new Error(`Rollback failed: Local archive not found and git failed (${e.message})`); + throw new Error(`Rollback failed: Local archive not found and git failed (${e.message})`, { cause: e }); } }