Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
fix(security): guard model discovery and isolate CodeQL findings
Abdurrahman Fakhrul2559d320b457
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.ymlindex ae06fd47..b7dc437e 100644--- a/.github/workflows/codeql.yml+++ b/.github/workflows/codeql.yml@@ -43,8 +43,8 @@ jobs:- name: Report every result from this exact CodeQL analysisrun: node scripts/codeql-report.mjs "$RUNNER_TEMP/mso-codeql-results"- - name: Inspect actual branch findings after SARIF processing+ - name: Inspect actual CodeQL branch findings after SARIF processingif: github.event_name == 'push'- run: node scripts/security-alerts.mjs --include-closed --ref "$GITHUB_REF" --commit "$GITHUB_SHA" --wait-seconds 60+ run: node scripts/security-alerts.mjs --tool CodeQL --include-closed --ref "$GITHUB_REF" --commit "$GITHUB_SHA" --wait-seconds 60env:GITHUB_TOKEN: ${{ github.token }}diff --git a/app/api/models/discover/route.test.ts b/app/api/models/discover/route.test.tsindex 324f51be..d578c3f7 100644--- a/app/api/models/discover/route.test.ts+++ b/app/api/models/discover/route.test.ts@@ -8,9 +8,8 @@ const mocks = vi.hoisted(() => ({safeProviderId: vi.fn(),discoverEndpointModels: vi.fn(),assertSafeUrl: vi.fn(),- safeProviderFetch: vi.fn(),}));-const { readConfig, getKey, safeProviderId, discoverEndpointModels, assertSafeUrl, safeProviderFetch } = mocks;+const { readConfig, getKey, safeProviderId, discoverEndpointModels, assertSafeUrl } = mocks;vi.mock("@/lib/auth/require-session", () => ({ requireSession: vi.fn(async () => true) }));vi.mock("@/lib/config/store", () => ({@@ -21,7 +20,6 @@ vi.mock("@/lib/config/store", () => ({vi.mock("@/lib/models/discover.js", () => ({ discoverEndpointModels: mocks.discoverEndpointModels }));vi.mock("@/lib/host/ssrf", () => ({assertSafeUrl: mocks.assertSafeUrl,- safeProviderFetch: mocks.safeProviderFetch,}));const post = (body: unknown) =>@@ -71,7 +69,6 @@ describe("/api/models/discover", () => {expect(assertSafeUrl).toHaveBeenCalledWith("https://gateway.example/v1/");expect(discoverEndpointModels).toHaveBeenCalledWith({ baseUrl: "https://gateway.example/v1", apiKey: "sk-secret", protocol: "anthropic" },- { fetchImpl: safeProviderFetch },);});@@ -80,7 +77,6 @@ describe("/api/models/discover", () => {await POST(post({ baseURL: "https://gateway.example/v1", apiKey: "sk-secret" }));expect(discoverEndpointModels).toHaveBeenCalledWith({ baseUrl: "https://gateway.example/v1", apiKey: "sk-secret", protocol: "openai" },- { fetchImpl: safeProviderFetch },);});@@ -115,7 +111,6 @@ describe("/api/models/discover", () => {expect(assertSafeUrl).not.toHaveBeenCalled();expect(discoverEndpointModels).toHaveBeenCalledWith({ baseUrl: "https://gw.example/v1", apiKey: "stored-key", protocol: "anthropic" },- { fetchImpl: safeProviderFetch },);});diff --git a/app/api/models/discover/route.ts b/app/api/models/discover/route.tsindex 52d673a9..0c3f4075 100644--- a/app/api/models/discover/route.ts+++ b/app/api/models/discover/route.ts@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from "next/server";import { requireSession } from "@/lib/auth/require-session";import { hostCredentialStore, readConfig, safeProviderId } from "@/lib/config/store";import { discoverEndpointModels } from "@/lib/models/discover.js";-import { assertSafeUrl, safeProviderFetch } from "@/lib/host/ssrf";+import { assertSafeUrl } from "@/lib/host/ssrf";export const runtime = "nodejs";export const dynamic = "force-dynamic";@@ -62,7 +62,7 @@ export async function POST(req: NextRequest) {}try {- const models = await discoverEndpointModels({ baseUrl, apiKey, protocol }, { fetchImpl: safeProviderFetch });+ const models = await discoverEndpointModels({ baseUrl, apiKey, protocol });return NextResponse.json({ ok: true, count: models.length, models });} catch (e) {return NextResponse.json({ ok: false, error: (e as Error).message });diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.mdindex eee2c794..54c8d1c5 100644--- a/docs/CHANGELOG.md+++ b/docs/CHANGELOG.md@@ -8,6 +8,7 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh**Added**+- establish Nakama traceability and first Owner workflows- `mcp` bump toolset version and regenerate MCP catalog for fs_stat- `mcp` add fs_stat read capability and parity exemption- `mcp` reclaim ChatGPT profile budget by lowering compact description cap@@ -26,6 +27,9 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh**Fixed**+- `security` guard model discovery and isolate CodeQL findings+- close domain integration regressions and preserve strict gates+- satisfy strict CLI and source parsing checks- `assistant` reset thread drawer state during render, not in effect- `update` treat a proven service-owned listener as update-safe- `assistant` keep the eager shell CSS rule set unchanged@@ -55,14 +59,1491 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh**Added**+- `domains` provision persistent managed-app subdomains from CLI- `models` discover model ids from custom endpoints**Docs**+- `progress` preserve managed-domain CLI handoff and remaining gates- `progress` record custom-endpoint discovery deploy and no-service ship limitation## 2026-10-15+**Fixed**++- `security-core` parse the provider case arm on its own lines+- `oauth` re-register a cached public client id on demand++**Faster**++- `appshell` memoise chat rows and show human tool identity++## 2026-10-14++**Added**++- `tenancy` owner-only enrollment CLI for tenant bindings++**Fixed**++- `cli` repair provider picker and make models add scriptable+- `config` keep tenant config path traceable by Turbopack++## 2026-10-13++**Added**++- `config` per-tenant credential store under OS_MULTIUSER_ROOT++**Tests**++- `e2e` right-click the desktop from its measured box+- `e2e` scope workflow directory assertions to the panel++**Build**++- `deps-dev` bump the development-minor-patch group with 3 updates+- `deps` bump the production-minor-patch group with 15 updates+- `deps-dev` bump the test-toolchain group with 2 updates++## 2026-10-12++**Added**++- `channels` start an Agent group from a bound Telegram group+- `agent-group` multi-agent discussion groups over Hermes profiles++**Fixed**++- `agent-group` spawn hermes by name to keep build tracing static++## 2026-10-10++**Added**++- `vault` read agent knowledge natively in MSO++**Fixed**++- `security` preserve worker grants and bound file reads+- `mcp` retain scanner limits and document mailbox parity+- `security` close credential sinks and revoke pending sessions+- `mcp` preserve managed configuration behind credential guards+- `security` bind receipts to authority and pin browser artifacts+- `security` keep connected app bootstrap code static+- `security` protect public admission and OAuth registration trust++**Faster**++- `vault` bound unfinished Markdown link matching++**Tests**++- `security` keep raw stream fixture fully parseable+- `e2e` scope MCP refresh to its tab panel+- `managed-apps` wait for durable job finalization before cleanup+- `workflows` complete waited receipt fixture schema+- `oauth` receive consent callbacks outside the shell+- `security` exercise webhook admission with explicit proxy trust+- `auth` isolate default proxy policy from host configuration++**Other**++- `mcp` keep local agent tools within architecture limit++## 2026-10-09++**Added**++- `apps` reuse MSO sessions for private connected apps+- `agent-vault` isolate repository progress in private Obsidian vaults++**Fixed**++- `security` close rescan authorization and isolation gaps+- `agent-vault` reuse shared styles within the shell bundle budget+- `security` pin bounded MCP store reads to one descriptor+- `oauth` keep registered consent within narrow viewports+- `security` enforce live delegated grants and bound provider and OAuth state+- `security` close remaining repository scan trust boundaries++**Tests**++- `security` assert oversized admission before body transfer+- `security` preserve regressions without synthetic scanner matches+- `security` exercise managed app authorization on its actual host+- `workflow` pin grant fixture time during revocation checks+- `security` run app cookie proof in the browser release lane++**Docs**++- `security` document legacy cookie cleanup configuration++## 2026-10-08++**Fixed**++- `macos` align window title and control edges+- `appshell` inherit macOS menu colors without extra CSS+- `appshell` align macOS menu symbol colors+- `macos` unify shared menu glass material+- `macos` unify shared menu typography with Figma reference+- `fs` cap the complete enumeration response+- `security` revalidate durable authority and bound follow-up scan paths+- `heartbeat` preserve relative env paths in cron+- `ux` reuse existing loading and glass styles within the shell budget+- `heartbeat` use parseable multiline shell case statements+- `ux` stack install notice above the update badge without overlap+- `build` keep guarded host runtime paths out of asset tracing+- `security` close resource and launcher gaps and repair gates+- `security` inspect ZIP output through pinned descriptor+- `ci` close gateway typing and audit file races+- `security` pin NodeSource bootstrap bytes+- `security` bound managed-app backup retention+- `security` bound audit growth and tail reads+- `security` bind gateway tunnels to proven local runtime+- `ux` Spotlight contrast, cold-load splash, and safe P2 polish+- `security` fail closed on mutable managed-app updates+- `security` keep OpenClaw provider keys out of argv+- `security` serialize managed-app lifecycle cross-process+- `security` bound archive generation resources+- `security` serialize bounded image imports+- `security` require exec for A2A loopback discovery+- `security` isolate PAT principals and revoke refresh replay+- `ci` clear typecheck, OSV, and reviewed history gates+- `security` require authenticated workflow webhooks+- `security` block delegated writes to control plane++**Changed**++- `macos` centralize shared chrome geometry and typography+- `security` keep authority fixes within architecture line limits++**Tests**++- `macos` measure menu width after opening animation+- `security` distinguish synthetic A2A redaction fixture+- `security` verify production sockets and preserve bounded project scans+- `lock` wait for the privacy curtain keyboard listener before unlocking++## 2026-10-07++**Fixed**++- `security` bound public ingress bodies+- `security` enforce live workflow authority+- `security` harden credential and A2A boundaries++**Docs**++- `security` record scan hardening boundaries++## 2026-10-06++**Added**++- `runtime` add opt-in cron heartbeat for fallback recovery+- integrate verified MSO shell and tenant changes++**Fixed**++- `deps` update sharp override for librsvg security patch+- `deps` update source-map-js to patched 1.2.2+- `agent` preserve overlapping standby wakeups++**Tests**++- `e2e` wait for deferred lock keyboard listener++**Docs**++- reconcile reviewed 9Router app-host proposal++## 2026-10-05++**Chores**++- `deps-dev` bump simple-icons++**CI**++- preserve strict audit and require native audit and shell journeys++## 2026-10-04++**Added**++- `appearance` refresh default light and dark wallpapers++**Fixed**++- `appearance` version immutable default wallpaper URLs+- `appearance` refine default 27 desktop wallpapers+- `security` clear unfixed dependency and Semgrep audit gates++**Chores**++- `deps` bump the actions-minor-patch group with 3 updates+- `deps` bump the production-minor-patch group with 5 updates+- `deps-dev` bump the test-toolchain group with 2 updates++## 2026-10-02++**Fixed**++- `alfa` preserve provider configuration and verify inference++## 2026-09-30++**Added**++- `settings` surface MSO updates in footer+- `assistant` show explicit run state and scoped approvals++**Fixed**++- `security` validate trace metadata and use atomic file descriptors+- `security` bound code-scanning filesystem paths and CLI test execution+- `organization` memoize focused groups and retain group search+- `deps` update brace-expansion within supported major lines+- `reconciliation` close combined environment and fixture contracts++**Changed**++- `local-agent` keep lifecycle initialization within source gate+- `alfa` extract dated transcript within source size gate++**Tests**++- `security` isolate count and identity scans from elapsed deadlines+- `store` align standalone assertions with page readiness budget++**Docs**++- `progress` record verified reconciliation takeover++## 2026-09-29++**Added**++- `a2a` add provider-neutral workflow trace skill++## 2026-09-28++**Added**++- `app-store` read bounded MANEF catalog metadata+- `host` begin native platform runtime adapters+- `store` import portable connected app manifests++**Tests**++- `host` exercise native macOS and Windows candidate build+- `projects` isolate count and deadline continuation budgets++**Chores**++- `deps-dev` bump the development-minor-patch group across 1 directory with 3 updates+- `deps` bump the actions-minor-patch group with 3 updates+- `deps` bump the production-minor-patch group with 5 updates+- `deps-dev` bump the test-toolchain group with 2 updates++## 2026-09-27++**Added**++- `shell` persist and embed external app connections+- `managed-apps` preflight install backend on host+- `jev` persist reusable session capsules+- `settings` nest version and updates under About++**Fixed**++- `settings` keep action labels readable on dark cards+- `install` preserve portable host commits and validate WSL2+- `jev` validate decision release contract+- `jev` open responsive session details in release journey+- `settings` align MCP release journey with breadcrumbs+- `settings` scroll MCP pages without reading a ref during render++**Docs**++- `features` define modular external feature contract+- `release` record Windows taskbar fidelity++## 2026-09-26++**Added**++- `jev` productionize decision plane+- `settings` add an Account section for profile, password, devices, and about+- `jev` add policy-bound MCP actions+- `workflows` isolate source-changing agents+- `agent` recover interrupted sessions automatically+- connect OpenRouter for JEV without switching model+- route JEV through OpenRouter and preserve sessions+- `integrations` clarify DOKU credential fields+- `memory` expose backup history and checksum-bound verification receipts++**Fixed**++- `jev` close release contract gaps+- `auth` rebuild the account profile before writing it+- `windows` match native taskbar proportions+- `worktrees` keep runtime paths out of build tracing+- `memory` keep runtime backup paths out of build tracing+- `tests` make recovery fixtures portable+- `workflows` close source isolation bypasses+- `config` document agent worktree root+- tolerate bounded session name contention++**Changed**++- `mcp` preserve architecture line ratchet++**Tests**++- `memory` isolate backup panel accessibility and preserve failure evidence++**Docs**++- refresh changelog for Windows taskbar fidelity+- `launch` focus demo on one verifiable agent journey+- `launch` define measurable MSO readiness contract++## 2026-09-25++**Added**++- `memory` preserve session sources and expose owner second brain+- `integrations` add native Google OAuth and read-only APIs++**Fixed**++- `memory` exclude guarded runtime backup paths from build tracing+- `integrations` expose native Google through MCP schemas++**Docs**++- `integrations` finalize native Google MCP verification+- `integrations` record native Google verification++**Other**++- `memory` preserve non-destructive backup worker checkpoint+- `memory` preserve bounded discovery worker checkpoint++## 2026-09-24++**Added**++- `memory-graph` add an owner knowledge graph+- `integrations` add JEV variables and AI providers tab+- `workflows` add Jev flow optimizer++**Changed**++- `workflows` remove optimizer type cycle++**Docs**++- `integrations` record release verification++**Chores**++- `workflows` finalize Jev flow optimizer release++## 2026-09-23++**Added**++- `mcp` add personal access tokens and auto-session fallback++**Fixed**++- `security` pin Termux guest installer payload+- `architecture` keep Dokploy adapter within ratchet+- `dokploy` sync public Docker build args+- `security` restore federation gate checks+- `dns` support wildcard staging hosts+- `termux` pin guest bootstrap and align platform contracts+- `ci` keep PAT scope case parseable by strict Semgrep++**Tests**++- `channels` avoid secret-like Discord fixture+- `termux` avoid check then read race in launcher fixture++**Docs**++- `mcp` record restored PAT quality gates+- `termux` record PRoot isolation and verification++**Other**++- `channels` allowlist synthetic Discord fixtures++## 2026-09-22++**Added**++- `channels` add Telegram and Discord channels+- `federation` bridge Batonly to MSO and SI-Coder+- `workflows` split n8n and improve org automation ux++**Fixed**++- `cli` cover federation status and PAT creation+- `termux` make partial installs resumable on low memory+- `mcp` restore main quality gates+- `termux` replace legacy launcher symlink safely+- `termux` isolate Linux runtime inside PRoot+- `mcp` publish modern cache hints+- `workflows` reopen details on node selection+- `mcp` normalize widget resource discovery++**Changed**++- `graph` establish shared flow foundation+- `ui` reduce organization and workflow chrome++**Tests**++- `workflows` update details selection contract++## 2026-09-21++**Added**++- `workflows` refine builder and organization focus UX++**Fixed**++- `mcp` negotiate native app ui++**Chores**++- `deps-dev` bump the development-minor-patch group with 3 updates+- `deps` bump the production-minor-patch group with 4 updates++## 2026-09-20++**Added**++- `workflows` add bounded repeat-until loops+- `agent` add durable local-agent standby++**Fixed**++- `alfa` restore mobile text selection and copy+- `mcp` add native UI host probe+- `chatgpt` stage portable OpenAI plugin package+- `memory` keep large typed projections mutable++## 2026-09-19++**Added**++- `memory` close self-improvement loop+- `cognitive` add bounded replay and candidate reuse+- `install` add detailed platform tabs+- `mcp` encode agent bootstrap and capability-parity map++**Fixed**++- `integrations` classify resend scope-limited doctor safely+- `browser` stop Camoufox session cleanly+- `plugin` distinguish staging from ChatGPT app install+- `memory` persist workflow and organization actions+- `browser` settle Camoufox viewer auth before reload+- `browser` keep Camoufox viewer transport clean+- `plugin` bind ChatGPT app by stable app id only+- `cli` keep candidate command parser strict+- `plugin` keep OpenAI app binding private per install+- `security` keep remote-authority test shell path trusted+- `security` keep installer sources strict-semgrep parseable+- `browser` reload viewer after ticket exchange+- `mcp` harden native UI and plugin bindings+- `ai` separate provider connect from selection+- `security` bind Convex snapshot path identity+- `browser` derive isolated Camoufox viewer origin+- `browser` probe cache-isolated Camoufox path+- `security` pin Convex snapshot import bytes+- `security` keep macOS installer fully parseable+- `mcp` keep architecture ratchet and bootstrap tests green+- `browser` route Camoufox websocket through viewer namespace+- `browser` isolate Camoufox viewer cache++**Changed**++- `security` isolate Convex snapshot staging++**Tests**++- `browser` keep viewer reload regression within architecture ratchet+- `security` keep snapshot regression descriptor-only++**Chores**++- `mcp` advance graph toolset signature++## 2026-09-18++**Added**++- `install` add cross-platform host adapters+- `integrations` add safe Convex Cloud deploy runner+- `ci` add independent exact-SHA verification runner+- `workflows` add reviewed external editor tabs+- `graph` add selected custom nodes and readable connection routing+- `organization` add internal project flows with callable CRUD++**Fixed**++- `browser` isolate sibling Camoufox viewer auth+- `integrations` allow Convex snapshot imports+- `security` cover reviewed static asset variants+- `review` preserve session and surface store invariants+- `security` validate cache exceptions from raw report+- `security` scope passive cache review by path+- `auth` permanently revoke retired cookie sessions+- `workflows` preserve explicit empty sandbox+- `security` review cache-only passive signal+- `graph` close routing and compact focus review+- `auth` bind sessions to cookie scope+- `workflows` remount editors when sandbox policy changes+- `workflows` retain approved shared surface placements+- `browser` keep Camoufox automation on demand+- `workflows` isolate external editors from cockpit session cookies+- `ci` preserve repository-owned local gate environment+- `graph` reconcile controlled selection and preserve routing groundwork+- `workflows` keep runtime registry out of deployment tracing+- `security` apply existing ZAP informational policy explicitly+- `security` require executed passive scan evidence+- `security` restore native dependency update cooldown+- `browser` retain private viewer connectivity without server access+- `release` align Node support and read-only browser reconnects+- `extensions` lock project controls until initial inspection+- `browser` diagnose secure viewer failures without losing power state++**Tests**++- `security` track reviewed cache signal+- `browser` make viewer fixtures independent of host configuration+- `security` inspect organization fixture through one descriptor++**Docs**++- `progress` preserve merged release order+- `ci` document independent runner state directory+- `security` document the hosted passive scan target++**Chores**++- `deps-dev` bump @types/node+- `deps` bump the production-minor-patch group across 1 directory with 7 updates++## 2026-09-17++**Added**++- `workflows` add exact session artifact history+- `store` unify VPS MCP and skills installation with dynamic host harness++**Fixed**++- `ci` reconcile dependency updates as matched toolchains+- `security` retain cooldown for native dependency updates+- `installer` lock isolated native build tool dependencies+- `proxy` finish portable managed-app loopback relay+- `workflows` pin private storage reads and atomic writes+- `ci` preserve strict scanner coverage on hosted release+- `forge` make sandbox bootstrap portable on hosted Linux+- `integrations` preserve implicit direct connection compatibility+- `doctor` respect no-systemd and remote runtimes+- `workflows` harden reconciled artifact history reads+- `integrations` prefer GitHub OAuth+- `hosted` restore updates and Hermes runtime+- `update` recover no-systemd container installs+- `installer` build node-pty reliably on Codespaces+- `managed-apps` support Hermes without systemd++**Faster**++- `workflows` keep runtime artifacts out of build tracing+- `shell` defer optional surfaces and bound cold-load bundles++**Changed**++- `gateway` isolate provider adapter boundary+- `gateway` make lifecycle provider agnostic++**Tests**++- `security` drain lock contenders before fixture cleanup+- `gateway` reap lock holder fixtures without orphan processes+- `workflows` stabilize repeated artifact inspection journeys++**Docs**++- `comparison` refresh product audit++**Chores**++- `deps` bump the actions-minor-patch group with 3 updates+- `deps-dev` bump postcss in the development-minor-patch group+- `deps` bump the production-minor-patch group with 7 updates+- `release` bump app version to 0.2.18+- `release` bump app version to 0.2.17++## 2026-09-16++**Added**++- `workflows` close session self-improvement loop+- `mcp` add compact ChatGPT list surface+- `plugins` add structured OpenAI skill contracts+- `workflows` stabilize semantic action references+- `workflows` add semantic session flows+- `workflows` visualize agent sessions+- `ai` add dynamic free provider discovery+- `workflows` maximize script and search automation++**Fixed**++- `plugin` support optional connector bindings+- `workflows` keep session nodes clear on compact canvas+- `workflows` dismiss session inspector on handoff+- `canvas` isolate react flow accessibility ids+- `workflows` keep compact session nodes clickable++**Changed**++- `workflows` satisfy session graph release gates++**Tests**++- `workflows` count hidden terminal sessions during inspector+- `workflows` expand semantic action receipt reliably+- `workflows` target semantic action summary+- `workflows` expand session actions before launch+- `mcp` close mobile session windows+- `canvas` scope graph controls per app+- `mcp` clean workflow window after session journey+- `mcp` restore settings after terminal handoff+- `mcp` preserve preexisting terminal state+- `mcp` close session terminal across shells+- `mcp` close terminal after session graph check++**Docs**++- `plugin` clarify extension taxonomy++## 2026-09-15++**Added**++- `workflows` finish edge controls and directory+- `workflows` complete canvas runtime+- `canvas` unify organization and workflow navigation+- `organization` surface as first-class app+- `organization` add agent org chart and routing+- `workflows` complete server-native automation parity+- `workflows` add server-native workflow graph++**Fixed**++- `responsive` reflow feature panes+- `workflows` separate runtime input from graph secret guards+- `workflows` allow inbound webhook trigger boundary+- `workflows` honor responsive shell modal policy+- `workflows` compact graph mcp surface+- `workflows` complete cli and release gates+- `mcp` expose downstream project tool results (#43)++**Tests**++- `mcp` register organization parity boundaries+- `cli` include organization command module in route coverage++## 2026-09-14++**Added**++- `integrations` simplify UI and secure credential exports+- `mcp` add original-byte file transfer++**Fixed**++- `shell` place server status in native chrome+- `integrations` use contrast-safe action tokens+- `integrations` inherit shell design tokens+- `integrations` align layout with Settings sidebar+- `mcp` harden bidirectional file transfer+- `mcp` bind ChatGPT Azure file trust to OAuth provenance+- `mcp` make project plugins explicit opt-in installs+- `mcp` trust verified ChatGPT Azure file host+- `integrations` preserve strict SC bundle validation+- `integrations` make shell embed frameable+- `integrations` add shell app and detect SC worktrees+- `integrations` expose native shell and managed SC project bindings+- `mcp` fall back when project MCP discover returns -32601++**Changed**++- `integrations` source compact width from responsive SSOT++## 2026-09-12++**Added**++- `mcp` unify responsive previews and recover session storage+- `mcp` add project automation flows and dynamic MCP sessions++**Fixed**++- `update` report latest builds without systemd+- `ui` theme native scrollbars across the MSO shell+- `ui` fill MCP Page height and apply MSO branding+- `flows` enforce canonical paths and bounded waits++**Tests**++- `ui` constrain simulated host message origins++**Docs**++- `mcp` add README quickstart and practical how-to+- `progress` record native scrollbar verification++## 2026-09-11++**Added**++- `install` enable MCP exec + document stable Cloudflare tunnel defaults++**Fixed**++- `ci` resolve synthetic history findings and await exact CodeQL evidence++**Tests**++- `forge` use node fixture commands under Bun runner++**Docs**++- `termux` add one-pass Android installer+- `security` document fresh-install MCP exec exposure++## 2026-09-10++**Added**++- `mcp` expose complete ChatGPT tool surface++## 2026-09-09++**Added**++- `integrations` unify semantic credential management+- add bounded Dokploy Dockerfile build operation+- `mcp` add session cards, readable logs and handover guide+- split MCP access and add plugin registry++**Fixed**++- `mcp` keep ChatGPT Page iframe-free+- `mcp` make Page surface registry instance-dynamic+- `update` harden release verification and settings UX+- `auth` harden browser session persistence+- `integrations` synchronize owner-local SC credential snapshots+- `security` eliminate parser gaps and enforce strict SAST coverage+- `gateway` wait for launcher handoff before tracking tunnel identity+- `build` separate runtime inputs and clarify mobile MCP guides+- `a11y` label settings controls and expose selected options+- `settings` clarify MCP navigation and enforce zero-warning tests+- persist the ready tunnel process identity after launcher exec+- reject login redirects normalized into external destinations+- isolate legacy browser credentials and close scanner findings+- keep the session mode badge clear of mobile navigation+- harden audited execution, integrations and release journeys++**Faster**++- `mcp` bound active session refresh to live leases++**Changed**++- `gateway` keep provisional readiness with pending lifecycle++**Tests**++- `pty` wait for terminal output to drain after exit+- remove obsolete preview directory configuration+- validate the bundle fixture before checking tag rejection+- stabilize authenticated release journeys and retain build failure logs+- distinguish desktop dock launch from icon selection+- target accessible launchers and clarify delegated sign-in++**Docs**++- record extended production browser verification+- record audit remediation verification and limits++## 2026-09-08++**Added**++- `desktop` give Finder, Explorer and Settings native platform layouts++**Fixed**++- `portability` allow configured auth query+- `portability` derive instance MCP context+- `integrations` verify self-hosted Convex admin keys++**Chores**++- standardize bun 1.4.2++## 2026-09-07++**Added**++- `integrations` share a responsive connection workbench+- `mcp` bind modular project tools to private integrations+- `infra` ensure Dokploy GitHub applications++**Fixed**++- `infra` allow Baton build SHA metadata++## 2026-09-06++**Added**++- `infra` add bounded Dokploy application deploy+- `infra` separate DOKU payment and MCP credentials+- `infra` add private DOKU MCP connections+- `infra` add private Convex env presence checks+- `infra` add safe Dokploy deployment recovery+- `infra` manage Convex Cloud custom domains safely+- `infra` add bounded Dokploy public env rollout++**Fixed**++- `infra` allow bounded Dokploy public env values+- `mcp` preserve compact integration headroom+- `infra` expose bounded Dokploy integration operations+- `infra` support modern pinned DNS lookups++## 2026-09-05++**Added**++- `integrations` detect local SI-Coder migration+- `agent` add native integrations slash skill+- `integrations` polish Finder TUI frame and UX+- `integrations` use Finder-style column browser+- `integrations` add interactive terminal navigator+- `hostinger` add Mail API connection operations+- `integrations` add portable JSON transfer and standalone import adapter+- `integrations` unify native users connections and source-aware execution+- `artifacts` add private per-session screenshot storage and retention+- `integrations` add native secure credential setup in browser and MCP Page+- add safe local maintenance and visual README+- `mcp` preserve restricted project service bridge++**Fixed**++- `security` enforce actual branch code-scanning alerts+- `security` make import preview confirmations opaque+- `security` key portable import preview confirmations+- `mcp` render one bounded inline Page preview+- preserve home-relative stores and prove tunnel rollback completion+- `security` verify exact branch dispositions and narrow message origins+- `security` retain artifact-lock compatibility and require fresh scan evidence+- `security` pin store paths and eliminate unsafe file-read patterns+- `mcp` add explicit browser sign-in for reviewed embedded apps+- `security` gate on actual GitHub open findings+- `integrations` repair embedded setup and complete native provider catalog+- `integrations` recover setup UI and cached chat links+- `release` wait for HTTP readiness before validating served assets+- `mcp` initialize page previews and verify embedded app readiness+- reconcile maintenance handoff and CLI version contracts+- `security` close exec expansion gap and exact test discovery+- `security` harden share audit and release verification+- `update` handle diverged checkout explicitly++**Changed**++- remove unused symbols and enforce compiler checks++**Tests**++- make insecure-permission fixture explicit under private umask+- validate PR integration and maintenance safety boundaries++**Docs**++- show the interactive mso terminal in README+- restore inline demo and lead with agent capabilities+- `mcp` document service tokens and update reconciliation++**Chores**++- `security` expose sanitized alert annotations+- release security and visual documentation fixes as app 0.2.4++## 2026-09-04++**Added**++- `mcp` simplify ChatGPT UI to Block and Page+- `assistant` turn Alfa into MSO cockpit++**Fixed**++- `mcp` align widgets with rahmanef palette+- `release` bound local dependency audit++**Changed**++- `mcp` dedupe ChatGPT CSP metadata++## 2026-09-03++**Added**++- `mcp` embed Play Together securely+- `mcp` add secure ChatGPT MSO Surface+- `agent` add P10 memory lifecycle calibration+- `mcp` complete Fresh 3 plugin contracts+- `mcp` maximize Fresh 3 operator capabilities+- `mcp` harden ChatGPT profile and project bridge++**Fixed**++- `mcp` correct Fresh 3 Surface scope+- `mcp` open contextual MSO views+- `runtime` prevent live Next build corruption+- `mcp` harden Open in MSO navigation+- `agent` calibrate correction memory semantics+- `agent` compare normalized token proofs per row+- `mcp` advertise implemented protocol era+- `mcp` support trusted browser probes+- `oauth` issue distinct dynamic client ids+- `mcp` make read pipeline schema portable++**Faster**++- `agent` add P8 calibration harness+- `agent` add repeatable corpus runner+- `agent` expand objective repo corpus++**Changed**++- `mcp` unify ChatGPT Surface UI++**Tests**++- `agent` calibrate local semantic memory retrieval+- separate corpus accounting ownership+- keep Fresh 3 within architecture ratchets+- `gateway` await complete browser argv capture++**Docs**++- bound Cognitive Runtime claims to verified evidence+- refresh maintainability changelog+- `agent` record P9 memory calibration+- `agent` record P8 calibration baseline+- `agent` record P7 repeated corpus baseline++## 2026-09-02++**Added**++- `mcp` add two-way local agent receive+- `mcp` add read-only result pipeline+- add RASMIC orchestration memory automation+- `agent` section terminal and recover API errors+- `agent` name sessions and wrap composer+- `agent` correlate local replies and add subagents+- `agent` add native local session messaging+- `agent` add restart and new session+- `a2a` enable local and inbound defaults+- ship authenticated and local A2A+- `agent` add eval-gated tool forge+- `agent` add interactive permissions and a2a v1++**Fixed**++- make modular shell ownership explicit+- `agent` wake on local requests+- `cli` clear ShellCheck warnings+- `agent` require live receiver for mentions+- `agent` make restart process-safe+- `a2a` harden remote v1 delegation++**Faster**++- `agent` normalize provider usage semantics+- `agent` add comparable quality corpus+- `agent` route capabilities before model reasoning++**Changed**++- split installer phases and lock release lifecycle+- split CLI into bounded command modules+- separate shared client server contracts+- segment host capability facades+- separate workflow and memory ownership+- enforce one-way shell dependencies+- extract capability kernel and architecture ratchets++**Tests**++- lock security coverage for new boundaries+- follow modular onboarding owner+- follow RASMIC storage split++**Docs**++- generate MCP catalog and lock architecture ownership+- reconcile RASMIC with latest agent docs+- publish catalog-first RASMIC runtime+- publish RASMIC MCP contract+- `testing` record 1.12 live verification++**Chores**++- `agent` sync docs and trim internal exports+**Other**-- Merge pull request #121 from rahmanef63/dependabot/bun/development-minor-patch-fd1384ab1e+- cover maintainability architecture boundaries+- pin ZAP Docker Hub mirror+- cover RASMIC orchestration++## 2026-09-01++**Added**++- `agent` ship cognitive runtime p1+- `agent` humanize sessions and add yolo mode+- `mcp` ship cognitive runtime p0+- `agent` add interrupt-safe terminal controls+- `agent` add arrow picker and skill states+- `agent` align model and session terminal UX+- `install` make upgrades agent-friendly+- `agent` add interactive slash palette+- `agent` add project-aware slash skills+- `agent` persist terminal and MCP sessions+- `mcp` render live workflow progress in ChatGPT+- `cli` add MSO folder ASCII icon++**Fixed**++- `agent` resolve resumes across full session store+- `mcp` remove session lookup contention+- `agent` wake prompt after child tty sigint+- `cli` clarify version and update labels+- `agent` stabilize terminal banner navigation+- `cli` make updates visible and idempotent+- `9router` proxy over internal Docker network+- `mcp` preserve app-only workflow status schema++## 2026-08-31++**Added**++- `cli` add MSO agent and infrastructure providers+- `mcp` add guided client setup++**Fixed**++- `update` wait through systemd restart drain+- `cli` diagnose HTTPS login and add doctor --fix+- `mcp` validate browser origins+- `security` avoid recovery guard fsync convoy+- `runtime` verify service readiness before handoff+- `jobs` finish retention before releasing runtime+- `runtime` preserve fallback recovery readiness+- `runtime` keep service starts on shared exclusion+- `service` bound lifecycle exclusion wait+- `settings` hide premature update warning+- `update` enforce main and raise MCP daily limit+- `mcp` raise daily token call limit+- `gateway` canonicalize public origin assignment+- `git` restore executable script modes+- `runtime` close service installer and notice races+- `install` hold update lock across checkout refresh+- `install` restore service after pre-mutation abort++**Tests**++- `security` remove recovery marker TOCTOU+- `gateway` assert one live tunnel after concurrent start+- `install` read abort capture by descriptor+- `install` align bootstrap and abort harness+- `install` make abort recovery harness static++**Docs**++- `mcp` mark guided setup shipped++**Chores**++- `deps` bump aquasecurity/trivy-action (#32)+- `deps` bump actions/checkout from 6.1.0 to 7.0.1 (#31)+- `deps-dev` bump @types/react-dom (#29)++## 2026-08-30++**Added**++- `gateway` secure laptop public access lifecycle+- `gateway` add loopback-only public web gateway++**Fixed**++- `runtime` close update authority and stop races+- `runtime` preserve installer and env lifecycles+- `runtime` serialize deploy and service starts+- `gateway` recheck web state under lock+- `update` reject unowned live runtimes+- `runtime` verify live update identities+- `runtime` close final update web edges+- `update` emit success after runtime restore+- `update` serialize all checkout runtimes+- `gateway` reject active named tunnel switches+- `gateway` serialize runtime recovery and updates+- `gateway` close final lifecycle boundaries+- `gateway` close tunnel fork signal race+- `gateway` serialize offline recovery state+- `gateway` harden update and proxy edges+- `gateway` close lifecycle review gaps+- `security` harden gateway scanner fixtures+- `install` survive Bun bin metadata corruption+- `install` keep bootstrap guard shellcheck-clean+- `install` guard earliest bootstrap prefix+- `install` make bootstrap handoff truncation-safe+- `install` make one-line bootstrap atomic+- `install` bind readiness to runtime instance+- `install` preserve caller path semantics+- `install` prove stable-id service takeover+- `install` keep security hint literal+- `install` make WSL CLI setup reliable+- `security` harden GitHub quality controls+- `security` canonicalize writable path containment++**Tests**++- `gateway` treat zombie children as stopped+- `gateway` isolate lifecycle fixtures+- `cli` lock offline update dispatch+- `gateway` harden hosted security fixtures++**Docs**++- `security` disclose scorecard posture gaps++## 2026-08-29++**Fixed**++- `security` keep path sinks in validated branches+- `security` make root containment explicit+- `security` close follow-up CodeQL flows++**Docs**++- `comparison` use explicit SEO-friendly ratings++**Chores**++- `deps` hold incompatible toolchain majors+- `deps` migrate to lucide-react 1.33.0++## 2026-08-28++**Added**++- `operations` add evidence-backed comparison and delegated control+- `mcp` add bounded async exec jobs++**Fixed**++- `security` remediate hosted CodeQL findings+- `security` remediate ultimate assurance findings+- `security` resolve full assurance findings+- `security` raise complete component scan budget+- `security` keep Codex scan state private+- `security` block recursive credential relocation++**Chores**++- `deps` bump actions/setup-python from 6.3.0 to 7.0.0+- `deps` bump zaproxy/action-baseline+- `deps` bump actions/setup-node from 6.5.0 to 7.0.0+- `deps` bump actions/upload-artifact from 4.6.2 to 7.0.1+- `deps` bump ossf/scorecard-action in the actions-minor-patch group+- `deps-dev` bump the development-minor-patch group with 4 updates+- `deps` bump the production-minor-patch group with 4 updates+- `security` update Codex Security to 0.1.21++## 2026-08-26++**Added**++- `mcp` add reverse-engineering implementation playbook++**Fixed**++- `security` split documentation scan scope+- `security` bound Codex component scope+- `security` use complete Codex component scans+- `security` size Codex budget for full scan++**Docs**++- refresh changelog++**Chores**++- `security` add ultimate assurance suite+- `security` add Codex Security scanning++## 2026-08-24++**Added**++- `managed-apps` add 9Router as a one-click managed app++**Fixed**++- `managed-apps` embed 9router existing domain+- `managed-apps` make 9router public-ip first+- harden security state and credential guards++## 2026-08-23++**Added**++- add interactive onboarding and skill market+- complete terminal and mobile app surfaces++**Fixed**++- `android` clear notch in app drawer+- `mobile` stabilize widgets back and viewport++**Changed**++- `ui` separate shell design systems++**Docs**++- refresh architecture and ChatGPT MCP guide++## 2026-08-22++**Fixed**++- `settings` adopt native iOS hierarchy+- `icons` align mobile platform artwork+- `responsive` harden mobile and landscape layouts+- `git` isolate push-gate test repositories+- `settings` improve MCP UI and activity scrolling++## 2026-08-21++**Added**++- `projects` add opt-in function capabilities++## 2026-08-20++**Added**++- `mcp` global project/skill discovery, drop image generation+- `mcp` import ChatGPT generated files+- `mcp` add provider-backed image generation++**Fixed**++- `mcp` lossless scan continuation and exact-id project resolution+- `mcp` one project validator, dirent budgets, resumable caps+- `mcp` contain, bound and uniquely identify project discovery+- `mcp` make ChatGPT file imports region agnostic+- `mcp` allow ChatGPT India South Central file storage+- `mcp` allow ChatGPT New Zealand file storage+- `mcp` allow ChatGPT Australia file storage+- `mcp` allow ChatGPT regional file storage+- `mcp` report rejected file host safely++## 2026-08-19++**Added**++- enable image generation and full access defaults+- `mcp` isolate workflows and standardize skill flows+- `mcp` streamline bootstrap and workflow visibility+- add semantic skill memory and workflow recipes+- add secure temporary screenshot links+- add MCP screenshots and live activity++**Fixed**++- `oauth` force visible ChatGPT callback+- `icons` use native macOS and Windows artwork+- `update` remove passwordless sudo requirement+- use official agent logos++## 2026-08-18++**Added**++- finish native platform icon set+- harden skills and refresh platform icons++**Fixed**++- use transparent feature icon artwork++## 2026-08-17++**Added**++- `settings` render the changelog as records in a scroll area, not injected markdown+- `update` a Check again row, so a release that lands while the panel is open is visible+- `files` long-press opens the context menu, so Preview is reachable on a phone+- `update` tell the running build from the checkout, so a pending rebuild is visible+- `settings,preview` update MSO from the app, and preview the formats a real disk has++**Fixed**++- `security` shell rc files hold API tokens — the credential denylist now says so+- `changelog` a regeneration commit must not appear in the file it regenerates+- `deps` pin nanoid >=3.3.18 — the audit gate has been failing on main+- `managed-apps` say why a dashboard is missing instead of silently opening a terminal+- `install` write the uid out — %U resolves to 0 for a User=<name> system unit+- `managed-apps` fail closed on an unreadable bus, and stop a retry eating the live venv+- `managed-apps` one-click install died, and installed apps read as "not installed", under systemd+- `install` bind loopback by default, and restart the service on re-run++**Changed**++- one download helper, one path helper, and gates for the drifts they hid++**Tests**++- `e2e` a committed browser check for Preview and the update panel+- `preview` one anchor the e2e can read on both surfaces++**Docs**++- `progress` record the codebase audit — what was duplicated, drifted, undefended+- record external MCP consumer compatibility+- `readme` the update button, and what Preview actually opens+- plain http to an IP cannot complete a login — say so where it matters++## 2026-08-11++**Added**++- `ship` one command that changelogs, pushes, rebuilds and verifies+- `shells` Windows/iOS/Android to their 2026 specs, plus a backup for local state++**Fixed**++- `ship` amend on retry, and collapse a repeated subject in the changelog+- `ai` Codex DOES do tool calling — implement it instead of announcing it cannot+- `pwa,chat` notch clearance, a doubled iOS inset, and an assistant that was lying++**Tests**++- `e2e` a browser that actually loads the page — and the three bugs it found++**Docs**++- `progress` log the shell-spec pass, the springs, and the backup++## 2026-08-10++**Added**++- give Alfa the reach MCP has, and a gate so they cannot drift apart again+- `mcp` managed-app logs and lifecycle, tiered by blast radius not by layer+- `mcp` an MCP server so ChatGPT, Claude.ai or Cursor can drive this VPS++**Fixed**++- `cli` four missing verbs, a prod-breaking build, and a silently-wrong --base+- close the four cheap findings from the tool-surface parity audit+- `mcp` the audit trail was recording refused commands as successes+- `audit` stop a test run appending to the owner's forensic trail+- `mcp` record what an MCP token did — the trail it was bypassing+- `a11y,perf` name the dock icons, announce login errors, stop the resize storm+- `perf,ux` halve the boot API calls, unstick the dead chunk spinner, cut 9 orphans++**Faster**++- get the shell chrome and the Alfa catalog out of first load++**Changed**++- delete five retired subsystems nothing could reach++**Docs**++- `progress` log the three-surface parity audit and what it fixed+- `progress` log the MCP server and what was verified live+- cut five finished plans, trim PROGRESS's tail, log the audit follow-up++## 2026-08-04++**Fixed**++- `hydration` render the shell after mount — zero mismatches anywhere+- `hydration` kill 3 of 4 React #418 sources; mobile contrast + back labels+- `css` un-break every border-color utility, and make Android's Back visible++## 2026-08-03++**Added**++- `ci` real dependency + build gates, and fix the sharp CVE they caught+- migrate pnpm -> bun, and fix what the audit actually found+- `shell` Docs app, a state-aware dock, and quicklinks back to the owner+- `cli` print a paste-ready command under every device+- `cli` complete API coverage, doctor, completion, global options+- `cli` device pending + revoke all, per-command help, version+- `cli` add `mso` CLI + agent skills so the web UI is one frontend, not the product++**Fixed**++- `a11y` raise 4 mobile touch targets to the WCAG 24x24 floor+- `security` close 3 of 4 rm -rf bypasses, and stop a corrupt file wiping the device allowlist+- `cli` name the near-miss flag, and report what's left after a revoke+- `cli` make `device` a subcommand group and say what an unknown command was++**Faster**++- keep the OS shell out of every route, stop sleeping on every stats poll++**Changed**++- delete 836 net lines of metadata and dead exports nothing reads+- `quicklinks` owner's links become owner's data, repo keeps a neutral fallback+- rename os-vps -> mso across code, config and prod wiring++**Docs**++- reconcile every live doc against what the box actually does+- `progress` record the 2026-08-03 bun migration, audit and gate work++**Chores**++- drop the one-shot contrast tuner nothing invokesdiff --git a/docs/PROGRESS.md b/docs/PROGRESS.mdindex 970f78bf..92d321e0 100644--- a/docs/PROGRESS.md+++ b/docs/PROGRESS.md@@ -1,3 +1,13 @@+## 2026-10-18: Repair model-discovery findings and separate CodeQL from historical Scorecard posture++The main push at `94c133a2aa6bcb8e54f39286d9b4993a2f47855a` completed its CodeQL analysis, then failed the open-alert gate on four CodeQL findings and Scorecard SAST alert #137. The model-discovery route already injected the pinned provider transport, but its shared helper exposed a raw-fetch default. The helper now owns the mandatory SSRF/DNS-pinned transport. Invalid credentials, provider response bodies and unexpected transport errors cannot be returned as diagnostic text containing API keys. Rejected and oversized responses cancel their bodies. The domain environment regression now checks final content and file permissions through one opened descriptor while retaining its idempotence assertion.++CodeQL's post-upload gate now selects only CodeQL alerts through GitHub's tool filter and fails closed if the response violates that filter. The separate security inventory still checks every tool and fails on any open finding. Regression coverage explicitly proves that a Scorecard finding still fails the combined inventory. No alert was dismissed, no scanner rule was excluded and no security threshold was lowered.++Scorecard #137 is an accurate historical process finding: PR #123 was merged with a failed native CodeQL check reporting two new high-severity findings, although its Actions analysis job succeeded. The pinned Scorecard v5.5.0 examines recent commits associated with merged PRs and requires successful native SAST checks for their recorded PR heads. Rescanning fixed main code does not change the historical PR head. The Scorecard workflow therefore remains unchanged, and a clean current CodeQL result must not be described as a clean all-tool inventory while #137 remains open. Merge review must inspect the native CodeQL result as well as the Actions job.++Local candidate verification: 74 focused tests across six files pass, including real URL/DNS-guard execution with intercepted sockets, address pinning, redirect refusal, malformed keys, response cancellation and strict inventory failure cases. Typecheck, zero-warning lint, repository contract checks and the strict high/critical dependency audit pass. Hosted CI remains the full coverage/build/browser gate because this isolated development environment has no Docker daemon for the mandatory Forge fixture. MSO MCP returned an internal error during target discovery, so this entry records repository work rather than a runtime deployment.+## 2026-10-18: Implement the first three bounded Nakama journeysOwner onboarding now advances from installation readiness to a selected project and a saved, read-only Workflow receipt. Its first action uses a fixed graph and exact graph revision; it stores the attempt identity before dispatch, reconciles lost responses and reopens the existing receipt after reload. Optional model checks disclose their cost, while the initial project action needs no inference. Viewer and Operator devices can inspect readiness without receiving Owner controls. The backup link describes the actual browser and memory restore surfaces; it does not imply a full installation restore.diff --git a/docs/SECURITY-ASSURANCE.md b/docs/SECURITY-ASSURANCE.mdindex 52cc743e..99670a2b 100644--- a/docs/SECURITY-ASSURANCE.md+++ b/docs/SECURITY-ASSURANCE.md@@ -27,7 +27,7 @@ All GitHub Actions referenced by the repository are pinned to immutable commit S## Actual open-alert inventory-`Security alert inventory` uses the repository-scoped GitHub Actions token with read-only security permissions to enumerate and paginate default-branch alerts and their affected instances. It fails for any remaining open finding, or when the inventory/scan evidence cannot be read. It never dismisses alerts or changes scan configuration. Its status is deliberately separate from a successful CodeQL analysis job. The job logs and summary expose rule/path/severity evidence, never bearer credentials or secret-scanning values. `node scripts/security-alerts.mjs --inventory` is an explicit collection-only mode, not release clearance.+`Security alert inventory` uses the repository-scoped GitHub Actions token with read-only security permissions to enumerate and paginate default-branch alerts and their affected instances. It fails for any remaining open finding, or when the inventory/scan evidence cannot be read. It never dismisses alerts or changes scan configuration. Its status is deliberately separate from a successful CodeQL analysis job. The CodeQL job selects `--tool CodeQL` for its post-upload check; the separate inventory retains all tools, including Scorecard process findings. A denied or mismatched filtered response remains incomplete evidence. The job logs and summary expose rule/path/severity evidence, never bearer credentials or secret-scanning values. `node scripts/security-alerts.mjs --inventory` is an explicit collection-only mode, not release clearance.The push inventory and the follow-up CodeQL/Scorecard inventories allow up to 360 secondsfor CodeQL evidence on their exact checkout commit. The post-analysis CodeQL step allowsdiff --git a/lib/models/discover-network.test.ts b/lib/models/discover-network.test.tsnew file mode 100644index 00000000..4a17a69a--- /dev/null+++ b/lib/models/discover-network.test.ts@@ -0,0 +1,83 @@+import { EventEmitter } from "node:events";+import { Readable } from "node:stream";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { discoverEndpointModels } from "./discover.js";++const mocks = vi.hoisted(() => ({ lookup: vi.fn(), httpsRequest: vi.fn(), httpRequest: vi.fn() }));+vi.mock("node:dns/promises", () => ({ lookup: mocks.lookup }));+vi.mock("node:https", () => ({ request: mocks.httpsRequest }));+vi.mock("node:http", () => ({ request: mocks.httpRequest }));++beforeEach(() => {+ vi.clearAllMocks();+ vi.stubEnv("OS_CUSTOM_PROVIDER_ALLOW_INSECURE_HTTP", "0");+ vi.stubGlobal("fetch", vi.fn(() => { throw new Error("unguarded fetch used"); }));+ mocks.lookup.mockResolvedValue([{ address: "8.8.8.8", family: 4 }]);+});+afterEach(() => { vi.unstubAllEnvs(); vi.unstubAllGlobals(); });++function upstream(status: number, body: string, headers = {}) {+ mocks.httpsRequest.mockImplementation((_options, callback) => {+ const request = new EventEmitter();+ return Object.assign(request, {+ end() {+ callback(Object.assign(Readable.from([Buffer.from(body)]), { statusCode: status, headers }));+ queueMicrotask(() => request.emit("close"));+ },+ destroy: vi.fn(),+ });+ });+}++describe("model discovery network boundary", () => {+ it.each(["", "fixture-key\nextra", "fixture-key\r", "fixture-key\u0000", "fixture-key\u0100"])(+ "rejects malformed credentials before request construction: %j", async (apiKey) => {+ await expect(discoverEndpointModels({ baseUrl: "https://api.example.com/v1", apiKey }))+ .rejects.toThrow(/^invalid model discovery API key$/);+ expect(mocks.lookup).not.toHaveBeenCalled();+ expect(mocks.httpsRequest).not.toHaveBeenCalled();+ expect(fetch).not.toHaveBeenCalled();+ },+ );+ it.each(["https://127.0.0.1/v1", "https://169.254.169.254/v1", "https://[::1]/v1", "https://user:[email protected]/v1"])(+ "rejects an unsafe configured endpoint before opening a socket: %s", async (baseUrl) => {+ await expect(discoverEndpointModels({ baseUrl, apiKey: "fixture-key" })).rejects.toThrow();+ expect(mocks.lookup).not.toHaveBeenCalled();+ expect(mocks.httpsRequest).not.toHaveBeenCalled();+ expect(mocks.httpRequest).not.toHaveBeenCalled();+ expect(fetch).not.toHaveBeenCalled();+ },+ );++ it("rejects a public hostname with any private DNS answer before sending credentials", async () => {+ mocks.lookup.mockResolvedValue([{ address: "8.8.8.8", family: 4 }, { address: "10.0.0.1", family: 4 }]);+ await expect(discoverEndpointModels({ baseUrl: "https://api.example.com/v1", apiKey: "fixture-key" }))+ .rejects.toThrow(/^model discovery request failed$/);+ expect(mocks.lookup).toHaveBeenCalledOnce();+ expect(mocks.httpsRequest).not.toHaveBeenCalled();+ expect(fetch).not.toHaveBeenCalled();+ });++ it("pins the validated address while preserving the provider host, path and credentials", async () => {+ upstream(200, '{"data":[{"id":"model-a"}]}');+ expect(await discoverEndpointModels({ baseUrl: "https://api.example.com/v1", apiKey: "fixture-key" }))+ .toEqual([{ id: "model-a", name: "model-a" }]);+ const [options] = mocks.httpsRequest.mock.calls[0];+ expect(options).toMatchObject({ hostname: "api.example.com", path: "/v1/models", headers: { authorization: "Bearer fixture-key" } });+ const callback = vi.fn();+ options.lookup("api.example.com", { all: true }, callback);+ expect(callback).toHaveBeenCalledWith(null, [{ address: "8.8.8.8", family: 4 }]);+ expect(mocks.lookup).toHaveBeenCalledOnce();+ expect(fetch).not.toHaveBeenCalled();+ });++ it("does not follow redirects or return an upstream credential echo", async () => {+ upstream(302, "fixture-key", { location: "https://169.254.169.254/credentials" });+ await expect(discoverEndpointModels({ baseUrl: "https://api.example.com/v1", apiKey: "fixture-key" }))+ .rejects.toThrow(/^model discovery HTTP 302$/);+ expect(mocks.httpsRequest).toHaveBeenCalledOnce();+ expect(mocks.lookup).toHaveBeenCalledOnce();+ expect(mocks.httpRequest).not.toHaveBeenCalled();+ expect(fetch).not.toHaveBeenCalled();+ });+});diff --git a/lib/models/discover.js b/lib/models/discover.jsindex 15cf0416..0ad3ee03 100644--- a/lib/models/discover.js+++ b/lib/models/discover.js@@ -3,6 +3,7 @@// endpoint's own list API so the picker is never empty. Runtime-only, bounded, and// credential-safe: the key is sent to the endpoint's pinned host, never returned,// logged, or placed on a process argv.+import { safeProviderFetch } from '../host/ssrf'const MAX_MODELS = 500const MAX_BODY_BYTES = 2 * 1024 * 1024@@ -16,6 +17,9 @@ export function modelsEndpoint(baseUrl, protocol) {}export function modelDiscoveryHeaders(protocol, apiKey) {+ if (typeof apiKey !== 'string' || !apiKey.trim() || /[^\x20-\x7e]/.test(apiKey)) {+ throw new Error('invalid model discovery API key')+ }if (protocol === 'anthropic') {return { accept: 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' }}@@ -56,7 +60,10 @@ export function parseDiscoveredModels(payload) {async function readBounded(response) {const declared = Number(response.headers.get('content-length') || 0)- if (declared > MAX_BODY_BYTES) throw new Error('model list response exceeds size limit')+ if (declared > MAX_BODY_BYTES) {+ await response.body?.cancel().catch(() => {})+ throw new Error('model list response exceeds size limit')+ }if (!response.body) return ''const reader = response.body.getReader()const chunks = []@@ -80,20 +87,23 @@ async function readBounded(response) {/*** @param {{baseUrl:string, apiKey:string, protocol?:'openai'|'anthropic'}} conn- * @param {{fetchImpl?:typeof fetch, timeoutMs?:number}} [options]+ * @param {{timeoutMs?:number}} [options]* @returns {Promise<{id:string, name:string}[]>}*/-export async function discoverEndpointModels({ baseUrl, apiKey, protocol = 'openai' }, { fetchImpl = fetch, timeoutMs = 15000 } = {}) {+export async function discoverEndpointModels({ baseUrl, apiKey, protocol = 'openai' }, { timeoutMs = 15000 } = {}) {const signal = AbortSignal.timeout(timeoutMs)- const response = await fetchImpl(modelsEndpoint(baseUrl, protocol), {- method: 'GET',- headers: modelDiscoveryHeaders(protocol, apiKey),- redirect: 'error',- signal,- })+ const headers = modelDiscoveryHeaders(protocol, apiKey)+ let response+ try {+ response = await safeProviderFetch(modelsEndpoint(baseUrl, protocol), {+ method: 'GET', headers, redirect: 'error', signal,+ })+ } catch {+ throw new Error('model discovery request failed')+ }if (!response.ok) {- const detail = await readBounded(response).catch(() => '')- throw new Error(`model discovery HTTP ${response.status}${detail ? `: ${detail.slice(0, 140)}` : ''}`)+ await response.body?.cancel().catch(() => {})+ throw new Error(`model discovery HTTP ${response.status}`)}const text = await readBounded(response)let payloaddiff --git a/lib/models/discover.test.ts b/lib/models/discover.test.tsindex 742f749d..4e96a366 100644--- a/lib/models/discover.test.ts+++ b/lib/models/discover.test.ts@@ -1,4 +1,5 @@-import { describe, expect, it, vi } from "vitest";+import { beforeEach, describe, expect, it, vi } from "vitest";+import { safeProviderFetch } from "../host/ssrf";import {discoverEndpointModels,modelDiscoveryHeaders,@@ -6,6 +7,10 @@ import {parseDiscoveredModels,} from "./discover.js";+vi.mock("../host/ssrf", () => ({ safeProviderFetch: vi.fn() }));+const fetchModels = vi.mocked(safeProviderFetch);+beforeEach(() => { fetchModels.mockReset(); });+describe("endpoint model discovery", () => {it("builds the list URL per protocol and avoids a doubled /v1", () => {expect(modelsEndpoint("https://gateway.example/v1", "openai")).toBe("https://gateway.example/v1/models");@@ -36,40 +41,61 @@ describe("endpoint model discovery", () => {expect(parseDiscoveredModels(null)).toEqual([]);});- it("discovers through the injected fetch, without leaking the key elsewhere", async () => {- const fetchImpl = vi.fn(async (_url: string, _init?: RequestInit) =>- new Response(JSON.stringify({ data: [{ id: "gpt-oss" }] }), { status: 200 }),- );+ it("always discovers through the pinned provider transport", async () => {+ fetchModels.mockResolvedValue(new Response(JSON.stringify({ data: [{ id: "gpt-oss" }] })));const models = await discoverEndpointModels({ baseUrl: "https://gateway.example/v1", apiKey: "sk-secret", protocol: "openai" },- { fetchImpl: fetchImpl as unknown as typeof fetch },);expect(models).toEqual([{ id: "gpt-oss", name: "gpt-oss" }]);- const [url, init] = fetchImpl.mock.calls[0];+ const [url, init] = fetchModels.mock.calls[0];expect(url).toBe("https://gateway.example/v1/models");expect(init).toMatchObject({ method: "GET", redirect: "error" });expect((init?.headers as Record<string, string>).authorization).toBe("Bearer sk-secret");});- it("surfaces a bounded provider error instead of the response body", async () => {- const fetchImpl = vi.fn(async () =>- new Response("denied ".repeat(1000), { status: 401 }),- );+ it("cancels provider errors without exposing an echoed credential", async () => {+ const cancel = vi.fn();+ const body = new ReadableStream({ cancel });+ fetchModels.mockResolvedValue(new Response(body, { status: 401 }));await expect(discoverEndpointModels({ baseUrl: "https://gateway.example/v1", apiKey: "sk-secret" },- { fetchImpl: fetchImpl as unknown as typeof fetch },),- ).rejects.toThrow(/model discovery HTTP 401/);+ ).rejects.toThrow(/^model discovery HTTP 401$/);+ expect(cancel).toHaveBeenCalledOnce();+ fetchModels.mockResolvedValue(new Response("Unauthorized: Bearer sk-secret", { status: 401 }));+ await expect(discoverEndpointModels({ baseUrl: "https://gateway.example/v1", apiKey: "sk-secret" }))+ .rejects.toThrow(/^model discovery HTTP 401$/);});it("rejects a non-JSON success body", async () => {- const fetchImpl = vi.fn(async () => new Response("<html>", { status: 200 }));+ fetchModels.mockResolvedValue(new Response("<html>", { status: 200 }));await expect(discoverEndpointModels({ baseUrl: "https://gateway.example/v1", apiKey: "sk-secret" },- { fetchImpl: fetchImpl as unknown as typeof fetch },),).rejects.toThrow(/invalid JSON/);});++ it("does not expose a transport exception containing a credential", async () => {+ fetchModels.mockRejectedValue(new Error('invalid header: Bearer sk-secret'));+ await expect(discoverEndpointModels({ baseUrl: "https://gateway.example/v1", apiKey: "sk-secret" }))+ .rejects.toThrow(/^model discovery request failed$/);+ });++ it("rejects declared and streamed oversized model lists", async () => {+ const declaredCancel = vi.fn();+ fetchModels.mockResolvedValue(new Response(new ReadableStream({ cancel: declaredCancel }), {+ headers: { "content-length": String(3 * 1024 * 1024) },+ }));+ const connection = { baseUrl: "https://gateway.example/v1", apiKey: "sk-secret" };+ await expect(discoverEndpointModels(connection)).rejects.toThrow(/size limit/);+ expect(declaredCancel).toHaveBeenCalledOnce();+ const cancel = vi.fn();+ fetchModels.mockResolvedValue(new Response(new ReadableStream({+ start(controller) { controller.enqueue(new Uint8Array(2 * 1024 * 1024 + 1)); }, cancel,+ })));+ await expect(discoverEndpointModels(connection)).rejects.toThrow(/size limit/);+ expect(cancel).toHaveBeenCalledOnce();+ });});diff --git a/scripts/domain-env.test.ts b/scripts/domain-env.test.tsindex 14b19bb1..7e1793ca 100644--- a/scripts/domain-env.test.ts+++ b/scripts/domain-env.test.ts@@ -38,9 +38,14 @@ describe("managed-domain environment repair", () => {const changed = await fs.readFile(file, "utf8");expect(first).toMatchObject({ changed: true, applied: true, restartRequired: true });expect(changed).toBe(`${privateLines}OS_PUBLIC_ORIGIN=${config.publicOrigin}\nNEXT_PUBLIC_MANAGED_APP_HOST_TEMPLATE=${config.hostTemplate}\n`);- expect((await fs.stat(file)).mode & 0o777).toBe(0o600);expect(await managedDomainEnvironment(file, config, true)).toMatchObject({ changed: false, applied: true, restartRequired: false });- expect(await fs.readFile(file, "utf8")).toBe(changed);+ const handle = await fs.open(file, "r");+ try {+ expect(await handle.readFile("utf8")).toBe(changed);+ expect((await handle.stat()).mode & 0o777).toBe(0o600);+ } finally {+ await handle.close();+ }});it("preserves a final unrelated line without a newline", async () => {diff --git a/scripts/security-alerts.mjs b/scripts/security-alerts.mjsindex fa11e04b..dbe8492d 100644--- a/scripts/security-alerts.mjs+++ b/scripts/security-alerts.mjs@@ -8,13 +8,15 @@ let inventory = false;let includeClosed = false;let expectedCommit;let waitSeconds = 0;+let selectedTool;for (let i = 0; i < args.length; i++) {if (args[i] === "--inventory") inventory = true;else if (args[i] === "--include-closed") includeClosed = true;else if (args[i] === "--ref" && args[i + 1]) selectedRef = args[++i];else if (args[i] === "--commit" && args[i + 1]) expectedCommit = args[++i];+ else if (args[i] === "--tool" && args[i + 1] === "CodeQL") selectedTool = args[++i];else if (args[i] === "--wait-seconds" && /^(0|[1-9][0-9]{0,2})$/.test(args[i + 1] ?? "")) waitSeconds = Number(args[++i]);- else throw new Error("usage: node scripts/security-alerts.mjs [--inventory] [--ref refs/heads/branch] [--include-closed] [--commit SHA] [--wait-seconds 0..480]");+ else throw new Error("usage: node scripts/security-alerts.mjs [--inventory] [--ref refs/heads/branch] [--include-closed] [--commit SHA] [--tool CodeQL] [--wait-seconds 0..480]");}if (waitSeconds > 480) throw new Error("Readiness wait must be bounded to 480 seconds");if (expectedCommit && !/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(expectedCommit)) throw new Error("An exact commit SHA is required");@@ -87,24 +89,27 @@ try {// Only missing/stale analysis is retryable; API denial and real findings still fail.await new Promise((resolve) => setTimeout(resolve, Math.min(10_000, deadline - Date.now())));}- const alerts = await pages(`/code-scanning/alerts?state=open&ref=${encodeURIComponent(ref)}`);+ const toolQuery = selectedTool ? `&tool_name=${encodeURIComponent(selectedTool)}` : "";+ const alerts = await pages(`/code-scanning/alerts?state=open&ref=${encodeURIComponent(ref)}${toolQuery}`);const rows = [];for (const alert of alerts) {+ if (selectedTool && alert.tool?.name !== selectedTool) throw new Error("Unexpected tool in filtered security inventory");const row = descriptor(alert);const instances = await pages(`/code-scanning/alerts/${row.number}/instances?ref=${encodeURIComponent(ref)}`);rows.push({ ...row, instances: instances.map(({ ref, analysis_key, category, state, message, location, classifications }) =>({ ref, analysis_key, category, state, message, location, classifications })) });}- const closed = includeClosed ? (await pages(`/code-scanning/alerts?state=closed&ref=${encodeURIComponent(ref)}`)).map(descriptor) : [];+ const closed = includeClosed ? (await pages(`/code-scanning/alerts?state=closed&ref=${encodeURIComponent(ref)}${toolQuery}`)).map(descriptor) : [];// Detect a concurrent publication before reporting stale findings as current.const after = (await get(`/branches/${encodeURIComponent(branchName)}`)).value;if (after.commit.sha !== branch.commit.sha) throw new Error("Branch changed during security verification; retry");const report = { capturedAt: new Date().toISOString(), repository: GITHUB_REPOSITORY,- ref, head: branch.commit.sha, openCount: rows.length, alerts: rows, closed,+ ref, head: branch.commit.sha, tool: selectedTool ?? "all", openCount: rows.length, alerts: rows, closed,recentAnalyses: recent.value.map(({ id, commit_sha, ref, created_at, category, error, tool }) =>({ id, commit_sha, ref, created_at, category, error, tool })), olderAnalysesOmitted: recent.more };console.log(`CODE_SCANNING_REF ${ref}`);console.log(`CODE_SCANNING_HEAD ${report.head}`);+ console.log(`CODE_SCANNING_TOOL ${report.tool}`);console.log(`CODE_SCANNING_OPEN ${rows.length}`);for (const alert of rows) { console.log(`ALERT ${JSON.stringify(alert)}`); emitAnnotation(alert); }for (const alert of closed) console.log(`CLOSED_ALERT ${JSON.stringify(alert)}`);diff --git a/scripts/security-alerts.test.ts b/scripts/security-alerts.test.tsindex 8647b4ed..87d89d74 100644--- a/scripts/security-alerts.test.ts+++ b/scripts/security-alerts.test.ts@@ -6,7 +6,7 @@ import { afterEach, describe, expect, it } from "vitest";const roots: string[] = [];afterEach(() => { for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true }); });-function run(options: { count?: number; denied?: boolean; noAnalysis?: boolean; paginate?: boolean; stale?: boolean; hostile?: boolean; args?: string[]; readyAfter?: number; branchMoved?: boolean; wrongRef?: boolean; analysisError?: boolean; invalidAnalysis?: boolean } = {}) {+function run(options: { count?: number; scorecard?: boolean; filterIgnored?: boolean; denied?: boolean; noAnalysis?: boolean; paginate?: boolean; stale?: boolean; hostile?: boolean; args?: string[]; readyAfter?: number; branchMoved?: boolean; wrongRef?: boolean; analysisError?: boolean; invalidAnalysis?: boolean } = {}) {const root = mkdtempSync(path.join(tmpdir(), "mso-alert-report-test-")); roots.push(root);const stub = `const options=${JSON.stringify(options)};process.argv=['node','security-alerts.mjs',...(options.args??[])];@@ -18,6 +18,7 @@ function run(options: { count?: number; denied?: boolean; noAnalysis?: boolean;let value={default_branch:'main'};let headers={};if(url.includes('/branches/'))value={commit:{sha:(++branches>1&&options.branchMoved?'b':'a').repeat(40)}};if(url.includes('/alerts?')){inventories++;value=Array.from({length:options.count??0},(_,i)=>({number:i+1,state:'open',tool:{name:'CodeQL'},rule:{id:options.hostile?'js/test%0A::error::boom':'js/test',severity:'warning',security_severity_level:'high'}}));+ if(options.scorecard&&(!url.includes('tool_name=CodeQL')||options.filterIgnored))value.push({number:137,state:'open',tool:{name:'Scorecard'},rule:{id:'SASTID',security_severity_level:'medium'}});if(options.paginate){if(url.includes('page=2'))value=[];else headers={link:'<https://api.github.com/next>; rel="next"'};}}if(url.includes('/instances?'))value=[{ref:'refs/heads/main',state:'open',location:{path:options.hostile?'../escape.ts':'lib/test.ts',start_line:3},message:{text:'review me'}}];if(url.includes('/analyses?')){analyses++;value=options.invalidAnalysis?{}:options.noAnalysis?[]:[{id:1,commit_sha:(options.stale||analyses<=(options.readyAfter??0)?'b':'a').repeat(40),tool:{name:'CodeQL'},ref:options.wrongRef?'refs/heads/other':'refs/heads/main',error:options.analysisError?'failed':''}];}@@ -25,7 +26,7 @@ function run(options: { count?: number; denied?: boolean; noAnalysis?: boolean;};await import(${JSON.stringify(path.join(process.cwd(), "scripts/security-alerts.mjs"))});console.log('FETCH_COUNTS '+JSON.stringify({analyses,branches,waits,inventories}));`;const result = spawnSync(process.execPath, ["--input-type=module", "-e", stub], { encoding: "utf8", timeout: 10_000,env: { NODE_ENV: "test", PATH: process.env.PATH, GITHUB_TOKEN: "synthetic-test-value", GITHUB_REPOSITORY: "example/repository", RUNNER_TEMP: root } });- let report: { openCount: number; alerts: unknown[]; ref: string } | undefined;+ let report: { openCount: number; alerts: unknown[]; closed: unknown[]; ref: string; tool: string } | undefined;try { report = JSON.parse(result.stdout.split("\n").find((line) => line.startsWith("CODE_SCANNING_REPORT "))!.slice("CODE_SCANNING_REPORT ".length)); } catch { /* failed evidence is expected in negative cases */ }const counts = JSON.parse(result.stdout.split("\n").find((line) => line.startsWith("FETCH_COUNTS "))?.slice(13) ?? "{}");return { ...result, report, counts };@@ -46,6 +47,25 @@ describe("GitHub open-alert evidence", () => {it("does not call an old clean scan current", () => { expect(run({ stale: true }).status).toBe(2); });it("does not call an unscanned repository clean", () => { expect(run({ noAnalysis: true }).status).toBe(2); });it("follows pagination instead of treating a first page as the complete inventory", () => { const result = run({ count: 2, paginate: true }); expect(result.status).toBe(1); expect(result.report?.alerts).toHaveLength(2); });+ it("still fails the default all-tool inventory on Scorecard findings", () => {+ const result = run({ scorecard: true });+ expect(result.status).toBe(1); expect(result.report).toMatchObject({ openCount: 1, tool: "all" });+ expect(result.stdout).toContain('"tool":"Scorecard"');+ });+ it("scopes CodeQL open and closed queries without masking an open CodeQL alert", () => {+ const args = ["--tool", "CodeQL", "--include-closed"];+ const clean = run({ scorecard: true, args });+ expect(clean.status).toBe(0); expect(clean.report).toMatchObject({ openCount: 0, closed: [], tool: "CodeQL" });+ const finding = run({ scorecard: true, count: 1, args });+ expect(finding.status).toBe(1); expect(finding.report?.openCount).toBe(1);+ });+ it("fails closed when the API does not honor the selected tool", () => {+ const result = run({ scorecard: true, filterIgnored: true, args: ["--tool", "CodeQL"] });+ expect(result.status).toBe(2); expect(result.stderr).toContain("Unexpected tool");+ });+ it.each(["Scorecard", "", "--inventory"])("rejects unsupported tool selection: %s", (tool) => {+ expect(run({ args: ["--tool", tool] }).status).not.toBe(0);+ });});@@ -94,7 +114,10 @@ it("keeps hosted inventories strict, bounded and pinned to the checkout SHA", ()}expect(source).not.toContain("continue-on-error: true");if (file === "security-alerts.yml") {+ expect(commands.every(command => !command.includes("--tool"))).toBe(true);expect(source).toContain("${{ github.event_name }}-${{ github.event.workflow_run.name || 'direct' }}");+ } else {+ expect(commands.every(command => command.includes("--tool CodeQL"))).toBe(true);}}});