Repository navigation
GHOST v1.1.0
[1.1.0] — 2026-10-17
Added
-
Python hybrid Phase 3 pilot — reset_cursor v0.3 thin manifest
(2026-10-17): the Cursor reset's 15 steps now run every store mutation
throughsrc/python/ghost_cli.pycore subcommands via a single
Invoke-GhostCorehelper — new core modulesghost/filesweep.py
(binary-store rename-or-delete, verified deletes, per-file tree sweeps)
andghost/winstore.py(machine-id file, device_id_salt rotation, dotted
JSON key removal) plus 7 new subcommands (backup,machineid-file,
salt-rotate,json-remove,store-delete,sweep-file,sweep-tree),
all covered by the expanded unittest suite (58 cases incl. CLI bridge
contracts). Step order, audit keys, restore actions and the summary are
identical to v0.2 (archived atarchive/reset_cursor_windows-v0.2.ps1,
local-only); step 4's inline temp-.py heredoc — the last one in the repo —
is replaced by the shareddelete-secretssubcommand. Python is now
required for ALL Cursor reset steps (fail-fast up front). 1031 → 840
lines. The mandatory live comparison run (pilot acceptance #3) is
user-supervised and pending. Decision record + design:
docs/PYTHON_HYBRID_ROADMAP.md (Phase 2
leaf-tools migration CANCELLED with per-tool reasons). -
Clone-suite generator (
tools/new_clone_suite.ps1, 2026-10-17) —
turns the app-cloning playbook's Phases 3-10 mechanics into scaffolding:
from an intake JSON (or interactive defaults) it emits the reset manifest,
clone launcher,.batwrapper, AUMID-shortcuts installer (+ branding
wiring +-RepairPrimaryAumid) and a spec stub with a ground-truth table,
then wires a new GHOST.bat submenu (backup + anchor edit + verify-after,
next submenu id / DispatchOne gids allocated by parsing the current file).
Every emitted.ps1is parse-checked before the tool claims success;
Phases 0-2 (discovery/isolation design) stay with the agent as marked
<TODO: Phase 1 discovery>slots. Acceptance: a generated demo suite
passed the harness and repo-integrity, then was removed. -
ZCode per-clone Telegram bots (UI-assisted, EC-D03) —
tools/set_zcode_bot.ps1
(-VerifyOnlyaudit /-Target <name> -Fixbackup-first sync): fingerprints
the encryptedcredentials.json -> bot:<id>:credential(enc:v1:, sha8
only, never values) + bot id across BOTHbot-config.jsonand
bot-config.v3.jsonin all 4 homes (the 2026-10-16 Fourthv2=False / v3=Truesplit looked disabled while polling — both files are now always
checked); fails loudly on any duplicate-while-enabled (HTTP 409 risk).
src/windows/launch_zcode_second_instance.ps1 [2c]upgraded from
always-disable to sha8-compare (duplicate -> disable both files; unique ->
preserve +.telegram-routedv2 marker, never reverted). Flow: operator
creates 3 BotFather bots, pastes each token once in that clone's ZCode UI
(app mints freshbot-<guid>+enc:v1:), tooling guards/syncs. Quota
decision 2026-10-16: Option C — Fourth keeps its big quota isolated.
Docs: docs/ZCODE_TELEGRAM_BOTS.md; tests:
tests/set_zcode_bot.Tests.ps1(4 passing). -
AutoClaw multi-instance clones (Primary + inst1–inst4) — full suite per
docs/AUTOCLAW_CLONES_SPEC.md:
tools/patch_autoclaw_ports.ps1(+.mjsengine v1) widens the installed
app's hardcoded 4-slot MCP port array to 8 (backup + marker +-Restore,
verified byte-identical via SHA-256 round-trip; re-run after every AutoClaw
update);src/windows/launch_autoclaw_clone.ps1(-Instance inst1..inst4,
-Status) launches clones with env-var isolation (USERPROFILE/HOME,
AUTOCLAW_GATEWAY_PORTwith actual-port read-back + drift recording) and a
credential-free seed (tokens stripped,token-cache.jsonexcluded, gateway
state never copied — one manual login per clone) plus verify-after-launch
health/port/pairing checks;src/windows/reset_autoclaw.ps1(-Target
Primary|inst1..4|All,-DryRun) rotates both device identities (auth
deviceId+ ed25519 keypair via node:crypto) and deletes the live operator
credential;tools/install_autoclaw_clone_shortcuts.ps1installs per-clone
AUMID shortcuts with-RepairPrimaryAumid;src/windows/Launch-AutoClaw-Clone.bat
double-click wrapper. GHOST.bat gains a fourth submenu (AutoClaw
Multi-Instance & Clones [1]–[12], gids 29–40) and IDE Resets [9]. -
App cloning playbook docs — docs/APP_CLONING_PLAYBOOK.md
(the generic clone-any-app process: identity suite with a
never-silently-degrade rule, developer-inputs contract, icon policy with
improvise+report as the default for missing icons, phases 0–10
checklists, and a fixed final-report format),
docs/APP_CLONING_EDGE_CASES.md (the
normative EC-xx catalog distilled from the ZCode 2026-09 and AutoClaw
2026-10 suites), and docs/APP_CLONING_INTAKE_TEMPLATE.md
(the per-request fill-in form). AGENTS.md gains the "App cloning playbook"
section;docs/README.mdindexes all three plus the previously missing
AUTOCLAW spec row.
Fixed
- GHOST.bat menu input executed hostile self-input (2026-10-17): the
unquoted%chain%/%choice%expansions ran1 & calcverbatim and
parens broke the parse. A new:ValidateChoiceallowlists digits, spaces,
commas and U/u inside an isolated delayed-expansion probe, and all five
prompt sites reject before the "0" check, tokenization, for-in dispatch or
:RunChaincall. Harness 12/12 incl. hostile amp/parens/submenu scenarios. - Captcha watchdog could run twice and leaked its log-tail state
(2026-10-17): a second resident copy (menu [11] again) double-fired
restarts/Telegram escalations on the shared state file — the watcher now
carries the taskbar watcher's guard (startup process scan + named mutex,
-RunOncealways runs).Read-NewLogLineswas rewritten byte-level: it
consumes only up to the last complete newline (a trailing partial line or
partial multi-byte char is re-read complete next pass) and advances the
offset by bytes actually consumed instead of a file length probed after
ReadToEnd(the old race skipped whatever the agent appended in between). - update_ghost misidentified a Download-ZIP copy sitting inside another
repository as a clone (2026-10-17):rev-parse --is-inside-work-tree
answers "true" against the PARENT repo, so the updater fetched/pulled/reset
in the wrong place ("no origin remote" as the visible symptom). The clone
track now additionally requires--show-toplevelto equal the GHOST folder
itself; a parent-tree hit warns explicitly and routes into the ZIP-copy
conversion flow. - Chat refresh classified a splash-phase clone as the Primary
(2026-10-17):refresh_zcode_second_chats.ps1matched mains by window
title only, and a clone launching (splash title plain "ZCode") was claimed
as a Primary main with its app-servers recycled as Primary's. Classification
is now process-marker-first (the verified 2026-09-24/26 taskbar rule):
WMI subtree walk to the root main, clone roaming/home markers, clone v6
color title overrides a spurious Primary read; unresolved windows are
skipped, never guessed. Live smoke against running instances passed. - Shortcut installers broke under PowerShell 7 (2026-10-17): both
installers set the.lnkTargetPath to$PSHOME\powershell.exe, which
does not exist in pwsh's own directory — shortcuts created by a pwsh-run
installer targeted a nonexistent exe. They now pin the OS-shipped
System32\WindowsPowerShell\v1.0\powershell.exeand fail fast if absent. - block_qoder_domains corrupted non-ASCII hosts comments (2026-10-17,
local-only tool): the hosts round-trip read BOM-less bytes as UTF-8 and
wrote with ASCII encoding, flattening every non-ASCII character to a
permanent?. Read/write now both use the system ANSI codepage (BOM
auto-detect still wins), matching how the Windows resolver reads hosts —
single-byte-codepage content survives byte-exactly. - IDE Resets [9] dispatched the wrong task: the Resets submenu had no
local→gid resolver, so typed ids reached:DispatchOneraw — local [9]
"Reset AutoClaw" therefore ran global gid 9 (the ZCode captcha watchdog,
already reachable as ZCode [11]) instead of gid 28
(reset_autoclaw.ps1 -Target Primary). A:ResetsOneresolver now maps
1–8 identity + 9→28, and both Resets dispatch sites route through it
(the prompt loop and the main-menu chained input1 9); bare global ids
from the main menu keep using:RunChain. Verified 2026-10-16: a
harness extracted the shipped:ResetsOneverbatim and passed all five
cases (1→gid 1, 8→gid 8, 9→gid 28, unknown→error, chained9 2→
gid 28 then gid 2); CRLF intact (434/0); Pester repo-integrity green. - Green-clone-alone showed the Primary's taskbar icon: the Start-menu
ZCode.lnkhad been hijacked withdev.zcode.app.4AND its icon field
wiped (,0), so the shell resolved the clone's AUMID to an icon-less
shortcut and fell back to the exe default icon.Repair-PrimaryAumidin
tools/install_zcode_second_shortcuts.ps1now also restores the Primary
shortcut's icon to<ZCode.exe>,0(Desktop + both Start-menu copies
covered), and the residenttools/watch_zcode_taskbar.ps1self-heals a
hijack every ~5 min (read-only check, repair only when broken,
REPAIR/FAIL logged;-RunOnce -CheckPrimaryHijackfor a one-shot
repair). Verified 2026-09-28: PrimaryZCode.lnkback todev.zcode.app
with a healthy icon; the green window's identity was already correct. - Python detection no longer false-positives on the Microsoft Store
stubs:Get-PythonCommandInfo(and the chat-refresh tool's detector)
now functionally probe candidates (python/python3/py+ per-user
install paths) with--versionand require an exit-0 "Python 3" report —
the WindowsApps app-execution aliases (exit 9009, no interpreter), stale
Python 2, and profile aliases are rejected. Thepylauncher and
per-user installs are found even when an elevatedPATHhides them;
not-found messages now point atwinget install Python.Python.3.12.
Changed
- Launcher menus renumbered to continuous local ids: each
GHOST.bat
screen numbers its own tasks — Resets[1]–[8], ZCode[1]–[17]
(5 launch + 5 reset + 7 sync/watchers), Maintenance[1]–[2]— with
per-screen resolvers (:ZCodeOne/:MaintOne) translating local ids to
the unchanged global dispatch payloads. Chains typed inside a submenu use
its local ids;2 1 3 4from the main menu opens ZCode and runs local
1 3 4back-to-back (PENDING_CHAINreplaces the oldBACKflow); bare
global ids (13) still work from the main menu only — inside ZCode the
local ids shadow the old global ones (old[13]icon patch is now
ZCode[12]). Docs remapped inAGENTS.md,docs/cli.md,
docs/getting-started.md,docs/ZCODE_CHAT_SYNC_WATCHER_PLAN.md, and
docs/PLAN-2026-09-24-rebrand.md. - UTF-8 piping for the Python core:
ghostforces its stdout to UTF-8
and the PowerShell callers set[Console]::OutputEncoding = UTF8, so
non-ASCII output (e.g. Arabic chat titles inchat-check MISSINGlines)
survives the pipe on any console code page. #Requires -Version 5.1on every.ps1insrc/windows+tools
(enforced by a new repo-integrity test) — standard error on archaeic
hosts instead of mid-script syntax failures; PS 7 satisfies>= 5.1.- Python core extracted (de-duplicated bridges): the four embedded
Python here-strings that lived inside PowerShell scripts now live in one
stdlib-only packagesrc/python/ghostinvoked via
src\python\ghost_cli.py—Set-SqliteKeys(identity_utils.ps1), the
secrets-delete and CLI-telemetry bridges (reset_zcode.ps1), and the
chat-sync helper (refresh_zcode_second_chats.ps1) no longer write temp
.pyfiles to$env:TEMP. Base64-in / JSON-stdout contracts, audit
wording, and verify-after behavior are unchanged; per-call temp files are
gone. - Launcher rebranded:
how-to-run.bat→GHOST.batand
how-to-run.sh→ghost.sh; all docs now reference the GHOST launcher by
name. The direct-command cheat sheet moved fromhow-to-run.txtto
docs/cli.md, and the analyzer settings moved from the repo
root totests/PSScriptAnalyzerSettings.psd1(CI + test paths updated).
Menu numbers are unchanged.
Added
- Python core —
src/python/ghost/(stdlib only: sqlite3, json,
secrets, uuid) +ghost_cli.pybootstrap; owns the shared SQLite/JSON
identity logic (identity sets, key UPSERT with verify-after re-read,
secrets deletion, CLI telemetry scrub, chat-sync diff/hot-activity probe,
JSON patch, audit log, restore-script generator). Tested by
tests/python/test_ghost_core.py(30 stdlibunittestcases, mirrors the
Pester suite + real-SQLite coverage) and a new CIpython-corejob. - GHOST launcher icon + shortcuts —
assets/ghost.ico(16–256, generated
from the poster art bytools/make_ghost_icon.ps1: auto tile detection,
rounded-corner transparency, committedassets/ghost-source.pngmaster for
regeneration). Since a.batcannot carry an Explorer icon, the icon ships
viatools/install_ghost_shortcut.ps1(menu [24]):GHOST.lnkon the
Desktop and in the repo root, pointing atGHOST.bat(.lnkfiles are
gitignored — regenerate, never commit). - ZCode multi-instance expansion — Primary + three branded clones:
Second (blue), Third (yellow), Fourth (green).launch_zcode_second_instance.ps1 -Instance Second|Third|Fourthwith
per-clone homes (ZCode{Second,Third,Fourth}Home), roaming dirs
(ZCode-Second/ZCode-Third/ZCode-Fourth), and first-run
seed-clone + identity scrub; plus double-click wrappers
Launch-ZCode-Second/Third/Fourth.bat.reset_zcode.ps1 -Target Third|Fourth|All— per-instance resets with
independent ID sets per child, per-target backups and scoped tree-kill
(survivor instances keep running).
tools/patch_zcode_icon_override.ps1(+.mjsengine v6) — one-time
app.asarpatch enablingZCODE_ICON_DIR,ZCODE_AUMID_SUFFIX,
ZCODE_ACCENT_HEX,ZCODE_INSTANCE_NAMEoverrides (branded icon, separate
taskbar button/pins, accent color, "ZCode " window title) and
disabling the clones' auto-updater; marker file auto-upgrades older patches.
Re-run after every ZCode app update (GHOST.batmenu [13]).tools/install_zcode_second_shortcuts.ps1— per-user Desktop + Start-menu
shortcuts for all three clones, each with its ownSystem.AppUserModel.ID
so pins never collide with the Primary (-Remove,-Instance,
-RepairPrimaryAumid); menu [14].tools/refresh_zcode_second_chats.ps1— cross-instance chat refresh
without an app restart: finds shared-store chats missing from the target's
sidebar index and recycles its app-server(s) (auto-respawn reseeds the
index), with a multi-signal hot-activity guard and verify-after
(-Target Primary|Second|Third|Fourth|All; menus [15]/[23]) plus an
error-triggered-Watchdaemon that refreshes every running instance on
captcha-stall / quota / rate-limit failures (menu [22]). Supersedes the
row-copyingtest_live_inject.pyspike (deleted).tools/zcode-{blue,yellow,green}-branding/— per-clone icon assets
(icon_windows.png,tray_icon.ico) and the shared generator.GHOST.batmenus [13]–[23]: icon patch, clone shortcuts, chat
refresh (one-shot + watcher), clone launches (single + all), per-instance
ZCode resets, and refresh-all.tools/update_ghost.ps1+GHOST.batmenu [26] — repo self-updater:
fetchesorigin, compares HEAD with the remote default branch, lists the
new commits, and asks beforegit pull --ff-only(-CheckOnly= report
only). Refuses when local commits or a non-main/detached branch block the
fast-forward; a dirty working tree gets an interactive stash → pull →
restore (a failed restore keeps the stash). Verify-after re-reads HEAD; a
failed fetch (offline) is a warning, not a failure.
Security
- Docs depersonalized: machine-specific home paths replaced with
%USERPROFILE%indocs/ZCODE_CHAT_SYNC_WATCHER_PLAN.md(newly tracked).