Skip to content

armgit / mso

Public Imported from GitHub
0

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.

fix(ci): preserve strict scanner coverage on hosted release

Rahman3032e248355c
diff --git a/bin/mso-doctor.test.ts b/bin/mso-doctor.test.ts
index 95c64d57..c7a81a11 100644
--- a/bin/mso-doctor.test.ts
+++ b/bin/mso-doctor.test.ts
@@ -79,7 +79,7 @@ describe("mso doctor", () => {
const fx = fixture("unavailable");
try {
const result = spawnSync(CLI, ["doctor", "--fix"], { encoding: "utf8", env: fx.env });
- expect(result.status).toBe(0);
+ expect(result.status, result.stdout + result.stderr).toBe(0);
expect(result.stdout).toContain("systemd manager unavailable");
expect(result.stdout).not.toContain("FAIL service unit");
expect(result.stderr).not.toContain("System has not been booted");
@@ -118,4 +118,14 @@ describe("mso doctor", () => {
} finally { fs.rmSync(fx.root, { recursive: true, force: true }); }
});
+ it.each(["http://127.0.0.1:4555", "http://localhost:4555", "http://[::1]:4555"])("keeps local supervisor semantics for %s", (base) => {
+ const fx = fixture("unavailable");
+ try {
+ const result = spawnSync(CLI, ["--base", base, "doctor", "--fix"], { encoding: "utf8", env: fx.env });
+ expect(result.status, result.stdout + result.stderr).toBe(0);
+ expect(result.stdout).toContain("systemd manager unavailable");
+ expect(result.stdout).not.toContain("skipped: --base is remote");
+ } finally { fs.rmSync(fx.root, { recursive: true, force: true }); }
+ });
+
});
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index b67c3bcd..227c6db3 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -12,6 +12,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Fixed**
+- `ci` preserve strict scanner coverage on hosted release
- `forge` make sandbox bootstrap portable on hosted Linux
- `doctor` respect no-systemd and remote runtimes
- `hosted` restore updates and Hermes runtime
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 44aa0141..3b5a3d82 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,7 @@
+## 2026-09-17 — Preserve strict hosted-release scanner coverage
+
+The Cursor recovery PR exposed existing ShellCheck declaration warnings and Semgrep strict-parser ambiguities alongside one new loopback case pattern. Keep all scanners strict: split command-substitution declarations, use shell parameter expansion for the pinned node-gyp PATH, preserve the Organization usage contract, spell conditional decimal literals unambiguously, and express owner `@file` handling without nested one-line case statements. Regression tests preserve file paths containing spaces and both IPv4/IPv6 local doctor approval; IPv6 brackets are literal in CLI transport/onboarding rather than a shell character class. No rule exclusions, secret checks, or runtime isolation settings are weakened.
+
## 2026-09-17 — Portable executable Forge sandbox bootstrap
A hosted Debian audit found two bootstrap assumptions that prevented the real, network-disabled Forge sandbox from starting: non-GNU awk omitted the ELF interpreter from `ldd`, and the imported `mktemp` root retained mode 0700. The bootstrap now uses POSIX whitespace matching and sets only the root traversal mode to 0755, without granting write access or changing the container isolation flags. Regression fixtures cover glibc/musl loader rows and the root mode; the real Docker fixture tests verify source read-only mounts, disabled networking and source-change refusal. The image is still built exclusively from the already-trusted local Node binary and shared libraries, with no version downgrade or registry download.
diff --git a/frontend/slices/workflows/components/workflow-canvas.tsx b/frontend/slices/workflows/components/workflow-canvas.tsx
index ad085a10..12d9f164 100644
--- a/frontend/slices/workflows/components/workflow-canvas.tsx
+++ b/frontend/slices/workflows/components/workflow-canvas.tsx
@@ -41,7 +41,7 @@ function toNodes(graph:WorkflowGraph,selectedId:string|null,nodeStates?:Readonly
function edgeVisual(edge:WorkflowGraph["edges"][number],state:WorkflowGraphRunEdgeState|undefined,nodeStates?:ReadonlyMap<string,WorkflowGraphNodeState>){
const running=nodeStates?.get(edge.source)==="running"||nodeStates?.get(edge.target)==="running",error=edge.sourceHandle==="error",branch=Boolean(edge.sourceHandle&&edge.sourceHandle!=="output"),disabled=state==="disabled";
const stroke=error?"var(--destructive)":running?"var(--accent)":state==="enabled"?"var(--success)":"var(--sep-strong)";
- return {animated:running&&!disabled,style:{stroke,strokeWidth:running?2.5:state==="enabled"?2:1.5,opacity:disabled?.24:state==="pending"?.55:1,strokeDasharray:disabled?"2 6":branch?"7 5":undefined},markerEnd:{type:MarkerType.ArrowClosed,width:18,height:18,color:stroke}};
+ return {animated:running&&!disabled,style:{stroke,strokeWidth:running?2.5:state==="enabled"?2:1.5,opacity:disabled ? 0.24 : state === "pending" ? 0.55 : 1,strokeDasharray:disabled?"2 6":branch?"7 5":undefined},markerEnd:{type:MarkerType.ArrowClosed,width:18,height:18,color:stroke}};
}
function toEdges(graph:WorkflowGraph,nodeStates?:ReadonlyMap<string,WorkflowGraphNodeState>,edgeStates?:ReadonlyMap<string,WorkflowGraphRunEdgeState>):FlowEdge[]{return graph.edges.map((edge)=>({id:edge.id,source:edge.source,target:edge.target,sourceHandle:edge.sourceHandle??"output",targetHandle:"input",type:"smoothstep",...edgeVisual(edge,edgeStates?.get(edge.id),nodeStates)}));}
function minimapColor(node:FlowNode){const state=node.data.state;if(state==="running")return"var(--accent)";if(state==="failed")return"var(--destructive)";if(state==="completed")return"var(--success)";if(state==="skipped"||state==="blocked")return"var(--text-dim)";return"var(--info)";}
diff --git a/scripts/cli-file-input.test.ts b/scripts/cli-file-input.test.ts
new file mode 100644
index 00000000..c0fde2c5
--- /dev/null
+++ b/scripts/cli-file-input.test.ts
@@ -0,0 +1,21 @@
+import { spawnSync } from "node:child_process";
+import { mkdtempSync, writeFileSync, rmSync } from "node:fs";
+import os from "node:os";
+import path from "node:path";
+import { describe, expect, it } from "vitest";
+
+describe("organization/workflow owner file inputs", () => {
+ it.each(["organization", "workflows"])("preserves quoted @file input for %s", (name) => {
+ const root = mkdtempSync(path.join(os.tmpdir(), "mso-cli-input-"));
+ try {
+ const file = path.join(root, "input with spaces.json");
+ writeFileSync(file, JSON.stringify({ label: "owner fixture" }));
+ const script = path.join(__dirname, "cli", name + ".sh");
+ const code = 'set -euo pipefail; source "$1"; jpost(){ printf "%s" "$2"; }; die(){ exit 2; }; if [ "$2" = organization ]; then run_org replace rev1 "@$3"; else run_workflow create --input "@$3"; fi';
+ const result = spawnSync("bash", ["-c", code, "fixture", script, name, file], { encoding: "utf8" });
+ expect(result.status).toBe(0);
+ const body = JSON.parse(result.stdout);
+ expect(name === "organization" ? body.chart : body.graph).toEqual({ label: "owner fixture" });
+ } finally { rmSync(root, { recursive: true, force: true }); }
+ });
+});
diff --git a/scripts/cli/commands-host.sh b/scripts/cli/commands-host.sh
index 3d155572..0a2bc554 100755
--- a/scripts/cli/commands-host.sh
+++ b/scripts/cli/commands-host.sh
@@ -115,7 +115,9 @@ case "$cmd" in
fi
local_runtime=0
- case "$B" in http://127.*:*|http://localhost:*|http://\[::1\]:*) local_runtime=1 ;; esac
+ case "$B" in
+ 'http://127.'*:*|'http://localhost:'*|'http://[::1]:'*) local_runtime=1 ;;
+ esac
if [ "$local_runtime" = 0 ]; then
echo " -- service unit (skipped: --base is remote)"
elif ! service_manager_read show --property=Version --value >/dev/null 2>&1; then
@@ -141,8 +143,8 @@ case "$cmd" in
chk "reachable" "doctor_health_ok" "no healthy MSO at $B; for local recovery run: mso web --local --print"
d=$(cli_device); device_ready=0
- case "$B" in
- http://127.0.0.1:*|http://localhost:*|http://[::1]:*)
+ case "$local_runtime" in
+ 1)
if dev_script --is-approved "$d" >/dev/null 2>&1; then
echo " ok device known"; device_ready=1
elif [ "$fix" = 1 ]; then
diff --git a/scripts/cli/onboarding.sh b/scripts/cli/onboarding.sh
index a46ccec2..d887df86 100755
--- a/scripts/cli/onboarding.sh
+++ b/scripts/cli/onboarding.sh
@@ -25,7 +25,7 @@ tty_secret() {
ensure_local_cli_device() {
local d; d=$(cli_device)
case "$B" in
- http://127.0.0.1:*|http://localhost:*|http://[::1]:*) ;;
+ 'http://127.0.0.1:'*|'http://localhost:'*|'http://[::1]:'*) ;;
*) return 0 ;;
esac
if ! dev_script --is-approved "$d" >/dev/null 2>&1; then
diff --git a/scripts/cli/organization.sh b/scripts/cli/organization.sh
index 1cf36156..fc02f14d 100644
--- a/scripts/cli/organization.sh
+++ b/scripts/cli/organization.sh
@@ -6,7 +6,7 @@ run_org() {
case "$sub" in
show|list) jget "/api/v1/organization" ;;
unit-upsert|seat-upsert|replace)
- revision="${1:?revision}"; input="${2:?JSON or @file}"; case "$input" in @*) input=$(cat -- "${input#@}") ;; esac
+ revision="${1:?revision}"; input="${2:?JSON or @file}"; if [ "${input:0:1}" = "@" ]; then input=$(cat -- "${input:1}"); fi
action="${sub//-/_}"; key="${sub%%-*}"
if [ "$sub" = replace ]; then body=$(jq -n --arg action "$action" --arg revision "$revision" --argjson chart "$input" '{action:$action,expected_revision:$revision,chart:$chart}')
else body=$(jq -n --arg action "$action" --arg revision "$revision" --arg key "$key" --argjson data "$input" '{action:$action,expected_revision:$revision} + {($key):$data}'); fi
@@ -14,6 +14,6 @@ run_org() {
unit-delete|seat-delete)
revision="${1:?revision}"; id="${2:?id}"; action="${sub//-/_}"
jpost "/api/v1/organization" "$(jq -n --arg action "$action" --arg revision "$revision" --arg id "$id" '{action:$action,expected_revision:$revision,id:$id}')" ;;
- *) die "usage: mso $U_org" ;;
+ *) die "usage: mso ${U_org:?Organization CLI usage contract unavailable}" ;;
esac
}
diff --git a/scripts/cli/transport.sh b/scripts/cli/transport.sh
index b6272f24..cb455f69 100755
--- a/scripts/cli/transport.sh
+++ b/scripts/cli/transport.sh
@@ -8,7 +8,7 @@
# so the operator believed they had approved a device that was still pending.
dev_script() {
case "$B" in
- http://127.0.0.1:*|http://localhost:*|http://[::1]:*) ;;
+ 'http://127.0.0.1:'*|'http://localhost:'*|'http://[::1]:'*) ;;
*) die "device commands edit the LOCAL allowlist (~/.mso/auth-devices.json) and cannot reach $B.
Run them ON that host, or over ssh: ssh <host> mso device $*" ;;
esac
diff --git a/scripts/cli/workflows.sh b/scripts/cli/workflows.sh
index 052500f6..cbcae61a 100644
--- a/scripts/cli/workflows.sh
+++ b/scripts/cli/workflows.sh
@@ -19,7 +19,7 @@ run_workflow() {
*) die "unknown workflow option: $1" ;;
esac
done
- case "$input" in @*) input=$(cat -- "${input#@}") ;; esac
+ if [ "${input:0:1}" = "@" ]; then input=$(cat -- "${input:1}"); fi
case "$sub" in
list) jget "/api/v1/workflows"; return ;;
show) jget "/api/v1/workflows?graph_id=$(enc "$id")"; return ;;
@@ -42,5 +42,8 @@ run_workflow() {
*) die "usage: mso ${U_workflow:-workflow}" ;;
esac
while [ "$wait" -eq 1 ] && [ "$(jq -r .state <<<"$result")" = running ]; do result=$(jget "/api/v1/workflows?run_id=$(enc "$id")&wait_ms=1500"); done
- printf '%s\n' "$result"; case "$(jq -r .state <<<"$result")" in failed|interrupted) return 1 ;; esac
+ printf '%s\n' "$result"
+ case "$(jq -r .state <<<"$result")" in
+ failed|interrupted) return 1 ;;
+ esac
}
diff --git a/scripts/install/runtime-build.sh b/scripts/install/runtime-build.sh
index efa1eba8..f4847bc3 100755
--- a/scripts/install/runtime-build.sh
+++ b/scripts/install/runtime-build.sh
@@ -23,7 +23,7 @@ NODE_GYP_BIN="$NODE_GYP_PREFIX/node_modules/.bin/node-gyp"
ensure_node_gyp_runner() {
if [ -x "$NODE_GYP_BIN" ] && [ "$("$NODE_GYP_BIN" --version 2>/dev/null || true)" = "v$NODE_GYP_VERSION" ]; then
- export PATH="$(dirname "$NODE_GYP_BIN"):$PATH"
+ export PATH="${NODE_GYP_BIN%/*}:$PATH"
return
fi
command -v npm >/dev/null 2>&1 || die "npm is required to provision pinned node-gyp for node-pty."
@@ -32,7 +32,7 @@ ensure_node_gyp_runner() {
npm install --prefix "$NODE_GYP_PREFIX" --no-save --ignore-scripts "node-gyp@$NODE_GYP_VERSION" >/dev/null
[ -x "$NODE_GYP_BIN" ] || die "node-gyp bootstrap did not produce $NODE_GYP_BIN"
[ "$("$NODE_GYP_BIN" --version 2>/dev/null || true)" = "v$NODE_GYP_VERSION" ] || die "unexpected node-gyp version after bootstrap"
- export PATH="$(dirname "$NODE_GYP_BIN"):$PATH"
+ export PATH="${NODE_GYP_BIN%/*}:$PATH"
}
node_pty_ready() {
diff --git a/scripts/lib/gateway-provider.sh b/scripts/lib/gateway-provider.sh
index 6f94e166..86115369 100644
--- a/scripts/lib/gateway-provider.sh
+++ b/scripts/lib/gateway-provider.sh
@@ -96,7 +96,8 @@ gateway_provider_start_locked() {
}
gateway_provider_doctor_readonly() {
- local provider="$(gateway_provider_family "${1:-custom}")"
+ local provider
+ provider="$(gateway_provider_family "${1:-custom}")"
case "$provider" in
cloudflare)
gateway_provider_load_cloudflare_adapter
@@ -113,7 +114,8 @@ gateway_provider_doctor_readonly() {
}
gateway_provider_install() {
- local provider="$(gateway_provider_family "${1:-$(gateway_provider_default)}")"
+ local provider
+ provider="$(gateway_provider_family "${1:-$(gateway_provider_default)}")"
case "$provider" in
cloudflare) gateway_provider_load_cloudflare_adapter; gateway_cmd_install_tool ;;
*) gateway_fail "provider '$provider' has no MSO-managed install adapter" ;;
@@ -121,7 +123,8 @@ gateway_provider_install() {
}
gateway_provider_probe_public() {
- local provider="$(gateway_provider_family "${1:-custom}")"
+ local provider
+ provider="$(gateway_provider_family "${1:-custom}")"
case "$provider" in
cloudflare) gateway_provider_load_cloudflare_adapter; gateway_probe_public ;;
*) gateway_health_url_matches_identity "$GATEWAY_PUBLIC_URL" "$LOCAL_HEALTH_IDENTITY" ;;
@@ -129,7 +132,8 @@ gateway_provider_probe_public() {
}
gateway_provider_domain_hint() {
- local provider="$(gateway_provider_family "${1:-$(gateway_provider_default)}")" origin="$2" domain_host
+ local provider origin="$2" domain_host
+ provider="$(gateway_provider_family "${1:-$(gateway_provider_default)}")"
domain_host="${origin#https://}"
case "$provider" in
cloudflare)