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.

merge: reconcile verified audit with hosted CI fixes

Rahmanefb8fb31d0ab
diff --cc docs/CHANGELOG.md
index 00e873d1,227c6db3..24edd2e7
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@@ -13,10 -12,9 +13,13 @@@ this is the *what*, and it is what Sett
**Fixed**
+- `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
diff --cc docs/PROGRESS.md
index 541c3d01,3b5a3d82..552e363a
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@@ -1,71 -1,15 +1,83 @@@
+## 2026-09-17 — Descriptor-pinned Workflow storage hardening
+
+The PR/branch audit exposed default-branch security annotations for Workflow run,
+graph, version, variable, cache and recipe-archive storage. These stores now reuse
+the existing owner-root and ancestor-pinning authority, open each file without
+following links, inspect and read the same descriptor, bound reads against file
+growth, and atomically write through a pinned parent. Version listing and exact
+revision lookup both enforce full snapshot filenames, byte limits and matching
+graph/revision identity. Receipt pruning still reads only bounded metadata rather
+than parsing every receipt; existing formats, quotas and revision guards remain.
+
+Added real filesystem regressions for symlinks, symlinked ancestors, FIFOs, unsafe
+permissions, oversized/growing files, mismatched versions and unchanged atomic
+serialization. The installed node-gyp PATH setup now separates assignment/export
+so command failures are not masked. Scanner settings, ignores and alert thresholds
+are unchanged. Passing local tests or scans does not close GitHub alerts: the
+candidate still requires the normal PR checks and production release path.
+
+## 2026-09-17 — Recover dormant PR/branch work without overwriting active agents
+
+Reconciled the verified performance candidate, the preserved GitHub OAuth-first preference,
+the dormant exact-session-artifact history candidate, and fork PR #44's edge/directory
+improvements onto the current main lineage in an isolated worktree. Newer semantic session
+labels, script/learning directories, read-only session graphs and VPS-backed Store behavior
+are preserved instead of taking the older fork files wholesale. Original candidate branches
+remain recoverable until integration is complete. Active hosted/Hermes and gateway work is
+owned by other sessions and is not replaced or deployed by this reconciliation.
+
+Historical artifact previews now reapply current host read-root/credential policy, refuse
+symlink aliases, use bounded no-follow descriptor reads with post-open path identity checks,
+and compute diffs from the same verified byte buffers. Git blob identity is computed from
+already-read bytes, eliminating diff/hash-object subprocesses and repository filters during
+capture. No file body is persisted in the event metadata. PTY access remains scoped to its
+creating principal. Added denial coverage for restricted paths, symlink escapes and revoked
+read roots; synthetic test roots explicitly grant only their own read/write access.
+
+The audit records every observed branch, worktree and PR with a disposition. Normal Git
+cleanup removes only clean, dormant worktrees whose HEAD is already reachable from main;
+active/dirty/unmerged trees, local environments and referenced dependencies remain protected.
+A verified private Git bundle and ignored-note backups precede cleanup.
+The resumed build exposed a broad Turbopack filesystem trace from the artifact reader.
+Owner-selected files are runtime data, so the three guarded open/lstat path arguments now
+use the established runtime-only tracing annotation. No files are excluded globally and
+read-root, no-follow, size and identity checks remain intact. An isolated production build
+now passes without warnings; the existing targeted artifact/PTY/connection tests also pass.
+
+Full-suite verification caught a compatibility issue in the preserved OAuth candidate:
+UI ordering must not change the existing API default for an omitted connection source.
+The API retains its original direct default; the UI explicitly submits the selected OAuth
+source, preserving both existing callers and OAuth-first presentation. Detailed verification
+and release status belong to the workflow evidence; this entry does not claim deployment.
+The expanded browser acceptance now reseeds its synthetic Git history idempotently for
+all three viewports, waits for complete modal exit/focus cleanup, and asserts node-click
+selection before inspecting details. It does not replace a failed node click with a
+compact-toolbar fallback or skip any artifact, redaction, terminal or accessibility check.
+
+## 2026-09-17 — GitHub OAuth-first Integrations routing
+
+GitHub Connections now present hosted OAuth and provider-owned OAuth/MCP before the manual PAT fallback. The direct GitHub path remains available without capability loss, but it is explicitly labeled as a fallback and recommends an expiring fine-grained token when a direct credential is deliberately required. `/integrations` now states the no-silent-fallback rule: a failed OAuth/MCP identity must never be replaced by another PAT/principal implicitly. This complements Baton tenant OAuth, which remains a separate user/workspace trust boundary instead of copying customer OAuth tokens into the MSO operator vault.
+
+## 2026-09-17 — Isolated shell bundle and first-open performance improvements
+
+Reduced eager shell work without removing applications or changing authorization, persistence, native terminal sessions, service-worker recovery, or deployment behavior. Organization's public view now has a lazy facade (the descriptor stays cheap); ReactFlow CSS follows the shared graph canvas rather than the root stylesheet. Search, Inspector, mobile Alfa/Control Center and clipboard presentation load on demand through an effect/state boundary, while lock protection, capture, hotkeys and notifications remain active from startup. The Inspector keeps its selected tab across close/reopen. Settings section bodies are split behind the existing selection and Owner-role checks. App-module prefetch now requires 250 ms of intent, cancels pending requests on leave/blur/close, respects constrained connections, deduplicates loads, and lets expensive app descriptors opt out. The existing local Geist Mono stays available without global preloading.
+
+The exact production build at baseline `866ec61` and the optimized candidate, using the same lockfile and Next 16.3.4, measured eager modern-browser JS at 340,067 → 269,498 gzip bytes (20.8% reduction), shell-entry JS 208,982 → 138,413 (33.8%), CSS 31,158 → 28,887 (7.3%), and preloaded font files 141,020 → 69,652 raw bytes. These are build-manifest measurements, not a claimed page-speed percentage; legacy nomodule polyfills and optional lazy downloads are separate. Added fail-closed bundle limits, import-boundary/prefetch regression tests and a five-shell synthetic browser journey to both the existing isolated build gate and CI. Heavy background-removal assets, quality defaults and runtime/cache deployment layout are intentionally untouched in this phase.
+
+The mandatory Workflow landscape journey exposed an existing readability bug: the unchanged `866ec61` build also shrank a trigger to ~67 pixels in an 826 × 122 canvas. Shared graph fitting now considers canvas height as well as width, waits for measured nodes, cancels pending frames correctly and has a single initial-fit owner. Manual full-graph Fit and zoom remain available. The browser test retains its original size thresholds but samples settled geometry rather than transient animation frames.
+
+ ## 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.
+
+ ## 2026-09-17 — Doctor respects no-systemd and remote runtime boundaries
+
+ A live hosted/container audit reproduced a false `mso.service not active` failure while the loopback runtime, public HTTPS and authenticated CLI were healthy. Doctor now probes actual systemd manager availability before diagnosing its service and never inspects this machine's units for a remote `--base`. No-systemd hosts continue through the normal health/auth checks without suppressing real failures: health must be JSON identifying a healthy MSO service, and local probes bypass outbound proxy variables. `--fix` never creates a tunnel, adopts an external supervisor, or claims boot persistence. Added regressions for unavailable managers, inactive real services, remote bases, failed health and unrelated HTTP 200 responses; documented the hosted startup and verified-public-origin boundaries. This changes diagnosis only; no runtime, bind, provider, Node version or existing hosted Hermes/update behavior is replaced.
+
## 2026-09-17 — Gateway core becomes deployment/provider/supervisor agnostic
Refactored the gateway reliability boundary without removing the existing Cloudflare lifecycle or process-ownership protections. The new read-only classifier separates local, public, provider and process health from ownership/supervisor state and reports `managed-running`, `external-running`, `degraded`, `recovering`, `stopped` or `unknown`. A configured public origin is healthy only when its structured MSO health identity matches the selected local runtime, including `buildSha` when present; this fixes the real case where a healthy externally supervised public route was previously displayed as stopped. Added `mso gateway status --json`, capability-based provider metadata, external duplicate-start protection, and provider-neutral non-mutating doctor diagnostics. Cloudflare remains the current managed/default adapter; external reverse proxies/tunnels are detected but never adopted, stopped or restarted. Existing PID/start-ticks/executable/argv/runtime-instance, atomic private state, update locks and recovery markers remain authoritative. No generic `gateway supervise` daemon was added because the current external-supervisor model already covers systemd/s6/container/Kubernetes/PaaS ownership without duplicating supervisor semantics. Added provider-neutral regression coverage and a dedicated `docs/GATEWAY.md` architecture/operations reference.
diff --cc scripts/cli/organization.sh
index 058080a8,fc02f14d..bfdef68d
--- a/scripts/cli/organization.sh
+++ b/scripts/cli/organization.sh
@@@ -1,56 -1,19 +1,28 @@@
#!/usr/bin/env bash
# Owner-private Organization CLI. Same API as Alfa → Organization and MCP.
run_org() {
- local sub="${1:-show}" revision input action key body id
+ local sub="${1:-show}"
+ local revision=""
+ local input=""
+ local action=""
+ local key=""
+ local body=""
+ local id=""
shift || true
+
case "$sub" in
- show|list) jget "/api/v1/organization" ;;
+ show|list)
+ jget "/api/v1/organization"
+ ;;
unit-upsert|seat-upsert|replace)
- revision="${1:?revision}"
- input="${2:?JSON or @file}"
- if [[ "$input" == @* ]]; then
- input=$(cat -- "${input#@}")
- 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
- jpost "/api/v1/organization" "$body"
- ;;
+ 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
+ jpost "/api/v1/organization" "$body" ;;
unit-delete|seat-delete)
- revision="${1:?revision}"
- id="${2:?id}"
- action="${sub//-/_}"
- body=$(jq -n \
- --arg action "$action" \
- --arg revision "$revision" \
- --arg id "$id" \
- '{action:$action,expected_revision:$revision,id:$id}')
- jpost "/api/v1/organization" "$body"
- ;;
- *)
- die "usage: mso ${U_org:-org}"
- ;;
+ 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:?Organization CLI usage contract unavailable}" ;;
esac
}