Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
stop CI diagnostics from claiming a cancelled run means no test failed
[._.]/ Adam Eivydc6b6c9fd019
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.mdindex ed6354fc6e..d0036ae735 100644--- a/docs/TROUBLESHOOTING.md+++ b/docs/TROUBLESHOOTING.md@@ -471,52 +471,116 @@ npm test -- lib/taskParser.test.jsnpm run test:watch```-### CI cancelled with no successor run+### CI red with every job "cancelled"-**Symptom**: A pull request's `CI Gate` / `Full CI Gate` goes red while several-PRs are building at once. Opening the run shows no failing assertion — jobs-report `##[error]The operation was canceled.` mid-step, often inside-`actions/checkout`, and the in-workflow `Cancel sibling CI jobs after failure`-step is `skipped` in every job. Re-running is usually cancelled the same way-until the queue empties; the identical SHA then passes on an idle queue.+**Symptom**: A pull request's `CI Gate` / `Full CI Gate` goes red. Opening the+run shows no failing assertion — jobs report `##[error]The operation was+canceled.` mid-step, the run's top-level conclusion is `cancelled` rather than+`failure`, and `gh pr checks` lists the long-running shards as `fail` with+nothing saying why.-**What it is not**: this is *not* `cancel-in-progress` doing its job. The-concurrency group is per-PR (`.github/workflows/ci.yml`), and a legitimate-supersession always leaves a **newer run** for the same PR. An external cancel-leaves none.+**Two very different causes produce that identical surface**, and the run+and job conclusions do not tell them apart:-**The likely cause is the Actions spending limit, not the concurrent-job cap.**-Exceeding the job cap makes GitHub *queue* runs; cancelling in-flight runs is-the spending-limit behaviour. So the billing reading below is the primary-diagnostic, not a footnote. Full runs are expensive because the three Windows-shards bill at a 2× minute multiplier.+1. **A real test failure.** `scripts/cancel-current-ci-run.js` cancels the+ sibling jobs the moment one job fails, so the failing job is cancelled out+ from under its own reporting step and its conclusion reads `cancelled` too.+ Nothing in the run reads `failure`.+2. **An external cancel** — the Actions spending limit, or a human pressing+ cancel.-**Tell the two apart** — list the runs for the branch and look for a successor:+**Always rule out (1) first.** It is the common case, it is the one you can fix,+and assuming billing sends you to a dashboard instead of the one-line assertion+that is actually red. Two PortOS incidents were misdiagnosed as billing this way+(#7482 on 2026-09-16, #7571 on 2026-09-17) and burned full-matrix re-runs before+anyone read a job log.++#### Step 1 — ask whether a STEP failed (this is the primary diagnostic)++A cancelled job keeps its steps' conclusions, so the failing step survives even+though the job that owns it reads `cancelled`. **`gh run view --json jobs` does+not expose steps** — that omission is precisely why both incidents above were+misread. Go to the REST API instead:++```bash+gh api "/repos/atomantic/PortOS/actions/runs/<run-id>/jobs?per_page=100" \+ --jq '.jobs[] | select(any(.steps[]?; .conclusion=="failure"))+ | "\(.name) job=\(.conclusion) failedStep=\([.steps[] | select(.conclusion=="failure") | .name] | join(", "))"'+```++On a run where every job read `cancelled`, that printed:++```+Windows server unit tests (3/3) job=cancelled failedStep=Run server tests on Windows+CI Gate job=failure failedStep=Require every selected job to pass+Full CI Gate job=failure failedStep=Require the aggregate gate to have passed+```++Ignore the two gate rows — they always fail downstream of a red run. **Any other+row is your culprit.** This is the same signal+`scripts/ci-retry-cancelled-run.js` uses (`jobFailed` reads step conclusions,+not just the job's), which is why the recovery workflow correctly refuses to+retry a fail-fast run.++Then read the assertion out of that job's log. **`--log-failed` prints nothing+here** — GitHub populates it only for steps GitHub itself marked failed on a+job that concluded `failure`, so a self-cancelled job yields an empty result+and the failure looks absent. Use the full log:++```bash+gh run view --job <job-id> --log 2>&1 \+ | grep -nE '🛑 Requested cancellation|FAIL |AssertionError|✕ |Test Files .*failed'+```++The `🛑 Requested cancellation` line is written by+`scripts/cancel-current-ci-run.js` and exists **only** when a job really failed+— it is the confirming tell if the step query is ever inconclusive.++If no job has a failed step and no log shows a failure, go to step 2.++A Windows-only failure is a recurring shape: a test that hardcodes a POSIX+answer for platform-dependent behaviour (shell quoting, path separators,+process-group flags) is green locally and on Linux, and red only on the Windows+shard. See "Windows server unit tests fail but macOS/Linux pass" below.++#### Step 2 — only now consider an external cancel++Confirm there is no successor run. `cancel-in-progress` is per-PR+(`.github/workflows/ci.yml`), and a legitimate supersession always leaves a+**newer** run for the same branch; an external cancel leaves none.```bash-# Every run for one PR branch, newest first. A supersession has a run NEWER-# than the cancelled one; an external cancel does not.gh run list --branch "<head-branch>" --workflow CI \--json databaseId,headSha,status,conclusion,createdAt,attempt--# Did any job actually fail, or were they all cancelled?-gh run view <run-id> --json jobs \- --jq '.jobs[] | {name, conclusion, startedAt, completedAt}'```-All jobs `cancelled` or `success`, none `failure`, and no newer run for the-branch → external cancel. One job `failure` → a real red run that-`scripts/cancel-current-ci-run.js` then stopped on purpose.+Supporting signals for the spending-limit case, none of them sufficient alone:++- Every runner is cancelled within a short window of one another, rather than+ one job finishing ~30–60 s ahead of the rest.+- The logs show tests still passing right up to the cancel.+- Nothing in `scripts/ci-gate-report.js`'s output helps here — it prints+ `CANCELLED, not failed` for a fail-fast run too, because it reads job+ conclusions. Do not count it as a signal either way.++Exceeding the concurrent-**job cap** makes GitHub queue runs; cancelling+in-flight runs is the **spending-limit** behaviour. Full runs are expensive+because the three Windows shards bill at a 2× minute multiplier.-**Account-level confirmation** (needs a scope the unattended agent cannot-grant itself — run it yourself):+**Account-level confirmation** (needs a scope an unattended agent cannot grant+itself — run it yourself):```bashgh auth refresh -s usergh api /users/<your-login>/settings/billing/actions```-**What PortOS already does about it**:+Only the account owner can raise or clear the limit. If that is the cause,+re-running spends more of the budget the limit is protecting — stop after one+manual retry, arm auto-merge (`gh pr merge <n> --merge --auto --delete-branch`,+which branch protection still gates), and leave the PR for the owner.++#### What PortOS already does about it- One automatic retry. `.github/workflows/ci-cancel-recovery.yml` watches for acompleted CI run and re-dispatches it exactly once when it was cancelled on a@@ -524,15 +588,19 @@ gh api /users/<your-login>/settings/billing/actionsThe budget is the run attempt: `POST /rerun` produces attempt 2, and attempt2 is never retried. A supersession and a self-cancel after a real failure areboth skipped, and the recovery run's own summary page states which of those- applied. This is the layer that explains a run-wide cancel, because it is the- only one that survives it.+ applied. Its "no job failed" test reads **step** conclusions as well as the+ job's (`jobFailed` in `scripts/ci-retry-cancelled-run.js`), which is what+ keeps it from burning an attempt on a fail-fast run — the same signal step 1+ above uses by hand.- The gate reports the difference **when the gate itself runs**.`scripts/ci-gate-report.js` prints `this run was CANCELLED, not failed`,names the cancelled jobs, and points back here — instead of the old- undifferentiated "did not pass". Note the limit: `if: always()` defeats an+ undifferentiated "did not pass". Two limits: `if: always()` defeats anupstream failure, not a run-wide cancellation, so in the full external-cancel- case the gate job is cancelled too and prints nothing. It covers a partial- cancel; the recovery run covers the rest.+ case the gate job is cancelled too and prints nothing; and the wording is+ about job conclusions, so it says `CANCELLED, not failed` for a fail-fast run+ as well. **Never read that line as proof of an external cancel** — it is a+ statement about conclusions, not about causes.**A caveat worth knowing**: the retry re-runs the whole suite, Windows shardsincluded, so if the cause really is the spending limit then recovery spends@@ -540,14 +608,46 @@ more of it. That is the same cost as the manual re-run it replaces, but itmeans recovery is not a substitute for reducing billable minutes — tracked inissue #7440.-If a PR is still stuck after that one retry, the queue was busy for longer than-one attempt — re-run it by hand once the other runs have drained.-One deliberate rough edge: a run **you** cancel by hand looks identical to anexternal cancel from the API, so it gets the same single retry. Push a newcommit (or close the PR) rather than cancelling if you want the run to staystopped.+### Windows server unit tests fail but macOS/Linux pass++**Symptom**: `Windows server unit tests (n/3)` is the only shard with a real+assertion failure. Because that shard fail-fasts, the run then reads as a+run-wide cancel — see the section above for how to find the assertion at all.++The cause is almost always a **test** that hardcodes the POSIX answer to a+platform-dependent question, not a production bug. Three recurring shapes:++- **Shell quoting.** `formatShellCommandLine` (`server/lib/shellCd.js`) quotes+ for the session's shell, so a line that reads `pi --provider nvidia` under+ `zsh` reads `& 'pi' '--provider' 'nvidia'` under PowerShell. Assert on the+ flags, not the dialect — strip the quoting first, the way+ `server/services/compositeProviders.test.js` and+ `server/lib/tuiShellLaunch.test.js` do. Reproduce locally with+ `PORTOS_SHELL=pwsh`, which yields the exact Windows string with no runner:++ ```bash+ cd server && PORTOS_SHELL=pwsh node_modules/.bin/vitest run <suite>+ ```++- **Path separators.** A suite that mocks `node:os` `platform()` still gets the+ host's `path.join`, so POSIX-style fixtures diverge from the `C:\…` the module+ builds. Simulate it by mocking `node:path` to `path.win32` in a throwaway copy+ of the suite, and prefer `dirname`/`join` over separator regexes in the code+ under test.++- **Platform-gated behaviour flags.** When production deliberately decides+ something per platform (`needsProcessGroup(...)` returning `false` on Windows+ because `taskkill /T` already covers the tree), assert the *policy* in the+ helper's own unit test with an injected platform, and derive the call-site+ expectation from `process.platform` rather than writing the POSIX literal.+ An assertion with no Windows meaning at all belongs behind+ `it.skipIf(process.platform === 'win32')`.+## Known Issues### GPU watchdog kernel panic during LoRA trainingdiff --git a/scripts/ci-gate-report.js b/scripts/ci-gate-report.jsindex a6961e742a..4d8301069c 100644--- a/scripts/ci-gate-report.js+++ b/scripts/ci-gate-report.js@@ -42,7 +42,7 @@ const PASSING_RESULTS = new Set(['success', 'skipped']);*/const STRICT_PASSING_RESULTS = new Set(['success']);const DEFAULT_LABEL = 'CI Gate';-const TROUBLESHOOTING_ANCHOR = '"CI cancelled with no successor run" in docs/TROUBLESHOOTING.md';+const TROUBLESHOOTING_ANCHOR = '"CI red with every job \'cancelled\'" in docs/TROUBLESHOOTING.md';const pair = ({ job, result }) => `${job}=${result}`;@@ -108,15 +108,29 @@ export function summarizeGateResults(results, label = DEFAULT_LABEL, requireSuccreturn {verdict: 'cancelled',lines: [- `🚫 ${label}: this run was CANCELLED, not failed — no job reported a failure.`,+ `🚫 ${label}: this run was CANCELLED, not failed — no job REPORTED a failure.`,`Cancelled jobs: ${cancelled.join(', ')}`,finished(),- 'No test failed, so start with why the job STOPPED. A job that hits the'- + ' 6-hour limit is recorded as `cancelled`, not `timed_out` — check the'- + ' cancelled jobs for a hang first. Otherwise a newer push superseded this'- + ' run (cancel-in-progress), or GitHub cancelled it externally while several'- + ' runs were in flight.',- `Telling those apart, and what to do about each: ${TROUBLESHOOTING_ANCHOR}`,+ // This wording is load-bearing. The old line said "No test failed", and+ // twice (#7482, #7571) that sent a reader straight to the billing+ // dashboard while a real assertion sat unread in a job log: a job that+ // fails is cancelled by scripts/cancel-current-ci-run.js before its own+ // reporting step runs, so its conclusion is `cancelled` too and NOTHING+ // in the run metadata reads `failure`. Only the logs distinguish them.+ 'A cancelled conclusion does NOT mean no test failed. PortOS fail-fasts:'+ + ' the job that failed is cancelled out from under its own reporting'+ + ' step, so a real red build looks exactly like this. READ THE JOB LOGS'+ + ' FIRST — and note that `gh run view --job <id> --log-failed` prints'+ + ' NOTHING here, because no step is marked failed. Use the full'+ + ' `--log` and grep for `🛑 Requested cancellation` (written only when'+ + ' a job really failed), `FAIL `, or `AssertionError`; the culprit is'+ + ' usually the job that completed EARLIEST.',+ 'Only if no job log shows a failure: a job that hits the 6-hour limit is'+ + ' recorded as `cancelled` rather than `timed_out` (check for a hang),'+ + ' a newer push superseded this run (cancel-in-progress leaves a NEWER'+ + ' run for the branch), or GitHub cancelled it externally — the Actions'+ + ' spending limit, which is the LAST hypothesis, not the first.',+ `Working through those in order: ${TROUBLESHOOTING_ANCHOR}`,],};}diff --git a/scripts/ci-gate-report.test.js b/scripts/ci-gate-report.test.jsindex bd0b1b3e2b..c4b74b56b1 100644--- a/scripts/ci-gate-report.test.js+++ b/scripts/ci-gate-report.test.js@@ -57,7 +57,13 @@ describe('summarizeGateResults', () => {expect(summary.verdict).toBe('cancelled');const text = summary.lines.join('\n');expect(text).toContain('CANCELLED, not failed');- expect(text).toContain('no job reported a failure');+ expect(text).toContain('no job REPORTED a failure');+ // The gate reads job CONCLUSIONS, and a fail-fast run hides a real+ // failure behind the same conclusions (#7482, #7571). The summary must+ // therefore send the reader to the logs, never imply the tree is green.+ expect(text).toContain('READ THE JOB LOGS FIRST');+ expect(text).toContain('does NOT mean no test failed');+ expect(text).not.toMatch(/\bNo test failed\b/);expect(summary.lines).toContain('Cancelled jobs: server, client, windows-server');expect(summary.lines).toContain('Jobs that finished: impact=success, database=success');// The reader needs somewhere to go next, and the doc is the only place the