Skip to content

Harden Organization mutual growth between FreeOS and openXYOS - #23

Merged
XYAIStudio merged 4 commits into
mainfrom
cursor/org-mutual-growth-d3b8
Sep 16, 2026
Merged

XYAIStudio merged 4 commits into
mainfrom
cursor/org-mutual-growth-d3b8

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Deepens the Octop ↔ openXYOS self-growth loop on 组织 after #21. A healthy sidecar no longer ends with 已推送到控制面: false / “started but not reachable” as the normal outcome.

FreeOS → openXYOS: pack / loop POST /api/freeos/ingest with a shared FREEOS_INGEST_TOKEN (no login wall). Employees, talent, plugins, skills, and MCP land in the sidecar sql.js DB. The Organization page shows progress, localized 是/否, and a landed receipt (created / updated counts).

openXYOS → FreeOS: /api/freeos/export plus “导入到 FreeOS” compile live employees into chat-usable colleagues (org-<slug>).

Loop: wait/start the sidecar only when a URL is explicit, a probe succeeds, or a bundled runtime exists. Default 127.0.0.1:3780 is not treated as “must apply remotely” when nothing is listening. Durable proof stays in {FREEOS_HOME}/openxyos-mirror/<tenant>/.

#21 install paths still resolved: FREEOS_OPENXYOS_HOME, %LOCALAPPDATA%\FreeOS\openxyos, FREEOS_OPENXYOS_INSTALL / $INSTDIR\openxyos, {home}/openxyos, portable org-sidecar.

Also: “从语料生产同事” (local distill or ima/cloud pointer → blueprint → spawn). One-click Ollama pull now registers the model on the ollama provider.

CodeQL (this follow-up): apply.py no longer joins user pack_dir into filesystem paths. Apply reads only {FREEOS_HOME}/asset-packs/latest (the loop already publishes there), with realpath + startswith confinement and assert_safe_host_path. CodeQL on this PR is green (no new alerts).

Constraints kept: 8-item sidebar, 组织 label, no login wall / WebView2 panic, desktop OCTOP_DESKTOP paths. Version stays 0.0.1. Do not merge; do not replace Release assets.

Target branch

Type of change

  • Bug fix (loop remote_applied=false when sidecar is healthy; CodeQL path-injection)
  • New feature (ingest/export bridge, produce-from-corpus, landed UX)
  • Breaking change
  • Documentation

Test plan

  • Org apply/loop unit + e2e
  • CodeQL pass — “No new alerts in code changed by this pull request”
  • CI Python 3.12 pass
  • CI Windows / Python 3.12 pass
  • Desktop Package can keep running (not a merge gate)

Checklist

  • Updated CHANGELOG.md (Unreleased)
  • README / docs/asset-loop.md updated
  • Do not merge
  • Do not upload or replace Release assets
Open in Web Open in Cursor 

Add a token-gated /api/freeos ingest-export bridge so a healthy sidecar
accepts FreeOS packs without a login wall. Loop and pack wait on the
control plane only when reachable or bundled, persist landed surfaces,
and localize timeline yes/no. Organization gets assemble/pack/loop/produce.
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
CodeQL py/path-injection flagged glob/is_dir on user pack_dir.
Jail packs under FREEOS_HOME and list children only after an
inline realpath/startswith guard on the same string used to open.
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
Comment thread src/octop/modules/org_os/apply/apply.py Fixed
CodeQL still treated pack_dir as a user path into isdir/listdir.
Only the basename is used, joined under {home}/asset-packs, then
realpath + startswith home. Reject '..' and other unsafe names.
CodeQL kept tainting isdir/listdir through helper dest_s parameters.
Read only {FREEOS_HOME}/asset-packs/latest (the loop already publishes
there) and list children after realpath + startswith on that root.
@XYAIStudio
XYAIStudio merged commit 1dd99b1 into main Sep 16, 2026
12 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/org-mutual-growth-d3b8 branch September 16, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants