Docs  /  `_AugmentedIntelligence` auto-update brainstorm

_AugmentedIntelligence auto-update brainstorm

Status: design / brainstorm (not an implementation PR)
Date: 2026-07-19

Two questions this doc answers:

  1. Question before — how should the app ask before applying an update?
  2. Check during runtime — how should it detect updates while the process is running?

0. What you already have (reuse)

Piece Relevance
GithubRestAPI / ExternalApis github GET /repos/{owner}/{repo}/releases/latest for version metadata
Settings + MySQL ai_settings Persist policy: auto-check on/off, channel, last prompt, snooze
FileSystemUpdate Pattern for background interval thread + MySQL audit (not app updates, but same cadence model)
EthicsGood / LegalShield Gate what can be downloaded/executed; no silent self-modify of high-risk paths
Dear ImGui dashboard Modal “Update available?” + toast when check finds a newer build
Console / typed commands update status \| check \| ask \| apply dry-run
CHANGELOG.md / version branding Human-readable delta to show in the prompt
Pixel companion Never auto-update from phone; desktop only holds keys/installers
AgentRuntime Optional: agent may notify, never apply without human

Non-goals for v1: silent silent in-place overwrite of the running .exe without consent; auto-update of random plugins from untrusted URLs.


1. Product principles

  1. Consent before mutate — check can be automatic; apply never is unless user set an explicit policy and confirms at least once per channel (stable/beta).
  2. Ask clearly — one question, three answers: Now / Later / Never this version.
  3. Runtime check ≠ runtime install — background thread only polls metadata; download/apply is a separate state machine.
  4. Safe defaultscheck=on, prompt=on, auto_apply=off, channel=stable.
  5. Audit — every check/prompt/apply lands in MySQL or local log (who/when/result).
  6. Train/bot safety — never apply while Gaming RL / Minecraft train / Magisk-critical jobs are active unless user forces.

2. “Question before” — UX flows

2.1 When to ask

Trigger Prompt?
Startup (after settings load) Yes if newer than last dismissed version and not snoozed
Runtime check finds newer Yes (console + optional ImGui modal + toast)
User types update check Report only unless they then update apply
Policy auto_apply=true Still show one-line confirmation the first time per version; optional “always for patch” later
Headless / service mode No modal; write update pending + exit code / event log; operator applies offline

2.2 Question copy (suggested)

_AugmentedIntelligence update available
  current:  11.0.typed-2026.07.18
  latest:   11.0.typed-2026.07.25  (stable)
  notes:    Gaming ethics NN gate; Minecraft client bridge; External APIs hub
  size:     ~180 MB installer

Apply this update?
  [Y] Yes, download and stage (restart required)
  [N] Not now (ask again in 24h)
  [S] Skip this version
  [D] Details / changelog
  [X] Disable auto-check

ImGui equivalent: modal with same five actions; toast if user is mid-train: “Update available — open Update panel when safe.”

2.3 Answer semantics

Answer Persist Next check
Yes pending_apply=version Enter download → verify → stage → prompt restart
Not now snooze_until=now+24h No prompt until snooze ends
Skip this version skipped_versions+=latest Ignore this version forever; still see newer ones
Details none Open CHANGELOG excerpt / release body
Disable auto-check update_check_enabled=false Only manual update check

2.4 Second question (restart)

After stage succeeds:

Update staged at: _updates/11.0.typed-2026.07.25/
Restart _AugmentedIntelligence now to finish install?
  [Y] Restart now   [N] Restart later (I'll close the app myself)

Never force-kill train loops without warning.

2.5 Channels for the question

Surface Mechanism
Console Blocking or async prompt when stdin is a TTY; else log-only
Dear ImGui Modal + update panel
Windows toast / tray Optional later
Speech “Update available. Say update apply or update snooze.”
Minecraft / agents Notify only — never apply from game chat

3. “Check during runtime” — architecture

                    ┌─────────────────────┐
  timer / command   │  _AutoUpdate        │
  ─────────────────►│  CheckLoop (thread) │
                    └─────────┬───────────┘
                              │ GET release metadata
                              ▼
                    GithubRestAPI / manifest URL
                              │
                              ▼
                    Compare VersionId(current, latest)
                              │
              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
         no update      update found     check error
              │               │               │
              │               ▼               ▼
              │        Policy engine      log + backoff
              │        (snooze/skip?)
              │               │
              │         need prompt?
              │          /      \
              │        yes      no (already asked)
              │         │
              ▼         ▼
         idle     AskUser (console/ImGui)
                          │
                     Yes → Download+Verify+Stage
                          │
                     Restart prompt

3.1 Version identity

Prefer explicit build id over marketing “v11.0”:

AI_BUILD_ID=11.0.typed.20260719.1
AI_CHANNEL=stable|beta|dev
AI_UPDATE_MANIFEST_URL=https://…/manifest.json   # optional private
AI_UPDATE_GITHUB_REPO=owner/AugmentedIntelligence   # optional public releases

Embed AI_BUILD_ID at compile time; also write build_id.txt next to the exe for field diagnostics.

{
  "channel": "stable",
  "build_id": "11.0.typed.20260725.1",
  "semver": "11.0.25",
  "published_at": "2026-07-25T18:00:00Z",
  "min_os": "windows-10",
  "notes_url": "https://…/CHANGELOG.md#…",
  "notes_summary": "Gaming ethics NN; client bridge; external APIs",
  "artifacts": [
    {
      "name": "AugmentedIntelligence-setup.exe",
      "url": "https://…/…exe",
      "sha256": "…",
      "size_bytes": 188743680,
      "kind": "installer"
    },
    {
      "name": "delta.7z",
      "url": "https://…/delta.7z",
      "sha256": "…",
      "kind": "delta",
      "from_build_id": "11.0.typed.20260718.1"
    }
  ],
  "requires_ack": true,
  "breaking": false
}

Fallback without private manifest: GitHub Releases API via existing GithubRestAPI (export tag name + body + asset URL).

3.3 Runtime check cadence

Setting Default Notes
update_check_enabled true Master switch
update_check_interval_sec 21600 (6h) Jitter ±15% to avoid thundering herd
update_check_on_startup true After settings + MySQL ready
update_check_on_idle_only true Skip while gaming rl train / long MSBuild / Magisk flash
update_check_wifi_only false Optional for laptops
update_channel stable stable / beta / dev
update_auto_download false Download only after Yes (safer)
update_auto_apply false Never default true in lab builds

3.4 What the checker does not do

  • Does not stop the process
  • Does not overwrite AugmentedIntelligence.exe while mapped
  • Does not run unsigned installers
  • Does not phone home with full settings dumps (only build_id + OS + channel)

3.5 Concurrent with other runtime systems

Active system Check OK? Prompt OK? Apply OK?
Idle console yes yes after Yes
Dear ImGui open yes modal after Yes
Gaming RL train yes (quiet) toast only no (unless force)
Minecraft bridge train yes toast no
Ethics / legal selftest yes defer no
Offline / airgap fail soft n/a local package only

4. Apply pipeline (after Yes)

  1. Download to _updates/staging/<build_id>/
  2. Verify SHA-256 (and optional Authenticode on Windows)
  3. Stage rename to _updates/ready/<build_id>/
  4. Write pending_update.json { build_id, staged_path, asked_at, user }
  5. Prompt restart
  6. On next launch before main init: if pending, run helper AIUpdateHelper.exe (or script) to replace files, then start new binary
  7. Health gate: new build must pass update selftest (smoke: start, settings load, integrate stack-test soft) or auto-rollback

Rollback: keep previous build under _updates/previous/.


5. Proposed module surface

class _AutoUpdate {
  Init / Shutdown
  StartRuntimeCheckLoop / Stop
  CheckNow() -> UpdateInfo
  ShouldPrompt(info) -> bool
  AskUser(info) -> Answer   // Now|Later|Skip|Disable|Details
  Download(info, dry_run)
  Stage / ApplyPending / Rollback
  Status / Doctor
  HandleSpeechCommand / RegisterLuaGlobals
};

Typed commands

update status
update doctor
update check                 # runtime check once
update check loop on|off
update interval 21600
update channel stable|beta|dev
update ask                   # force the “question before” UI if pending
update snooze 24h
update skip                  # skip this latest
update download dry-run
update apply                 # only if staged + confirmed
update rollback
update policy show|set …

Settings keys (sketch)

update_check_enabled=true
update_check_interval_sec=21600
update_check_on_startup=true
update_prompt_enabled=true
update_auto_download=false
update_auto_apply=false
update_channel=stable
update_manifest_url=
update_github_repo=
update_snooze_until=
update_skipped_versions=
update_last_check_epoch=
update_last_result=
update_pending_build_id=

Lua

update_status()
update_check()
update_ask()          -- returns "now"|"later"|"skip"|…

6. Security & Ethics

Risk Mitigation
Supply-chain malware HTTPS + SHA-256 + optional code signing; pin repo/manifest host
Prompt fatigue → blind Yes Show notes_summary + size; rate-limit prompts; skip remembers version
Train interrupted mid-apply Block apply when train flags set; “force” requires typed confirm phrase
Privilege escalation Helper runs as same user; no silent UAC dance without UI
Telemetry overreach Check payload = build_id, channel, OS only
Beta on production lab Separate channel; default stable

EthicsGood framing: auto-update is capability maintenance, not autonomous self-modification of moral policy. LegalShield: no downloading “cracks” or unsigned third-party game cheats via update channel.


7. Runtime check implementation sketch

// Background (FileSystemUpdate-style)
every interval_sec ± jitter:
  if !enabled || now < snooze_until: continue
  if busy_critical_workload(): continue   // train / flash
  info = fetch_manifest_or_github()
  if info.error: log; exponential backoff; continue
  if !is_newer(info.build_id, current): continue
  if info.build_id in skipped: continue
  if already_prompted_this_session(info.build_id): toast once; continue
  post_event(UpdateAvailable)
  if prompt_enabled:
     AskUser(info)   // console and/or ImGui

Busy detection hooks:

  • gaming_rl auto_train running
  • MinecraftDQN auto_train
  • long system() export jobs
  • optional: CPU > N% for M minutes

8. Phased roadmap

Phase U0 — Metadata only (1–2 days)

  • Embed AI_BUILD_ID
  • update status / update check against GitHub or local manifest file
  • No download

Phase U1 — Question before (2–3 days)

  • Console prompt + ImGui modal
  • Snooze / skip persistence in settings
  • Toast when train blocks modal

Phase U2 — Runtime loop (2 days)

  • Background interval check (like fs start)
  • Idle-only option
  • Audit log table ai_settings.update_events

Phase U3 — Download + stage (3–5 days)

  • SHA-256 verify
  • Stage under _updates/
  • Restart prompt + helper process

Phase U4 — Rollback + signed builds (later)

  • Previous build restore
  • Authenticode
  • Delta packages

9. Success metrics

Metric Target
Checks complete without crash 100% soft-fail
User can always choose Skip / Disable Required
No apply without explicit Yes (default policy) Required
Train not killed by update Required
Prompt latency after check < 1s to show UI

10. “Do this first” shortlist

  1. U0: update check + build id in status.
  2. U1: Question before on startup if newer.
  3. U2: Runtime loop every 6h, idle-aware.
  4. Wire GitHub latest release via existing GithubRestAPI.
  5. ImGui Update panel next to Ops strip.


Living brainstorm — promote U0 when you want a thin update check MVP.

Generated from the project markdown docs on 2026-07-24. This is a static, self-contained site.