Skip to content

feat(universal): harden LifeOS and add cross-harness runtime - #3

Open
jSydorowicz21 wants to merge 81 commits into
mainfrom
feat/universal-uai-implementation
Open

feat(universal): harden LifeOS and add cross-harness runtime#3
jSydorowicz21 wants to merge 81 commits into
mainfrom
feat/universal-uai-implementation

Conversation

@jSydorowicz21

@jSydorowicz21 jSydorowicz21 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

Builds on PR #1 and completes the audited stabilization plus universal-runtime roadmap. This branch can merge after #1 (GitHub will reduce the diff) or supersede it as a single reviewed cutover.

  • hardens installer lifecycle, rollback, ownership, crash recovery, source/root containment, settings/hooks, and USER migration
  • makes OMP installation transactional with Claude-free inference, stable session identity, memory/observability safeguards, and fail-closed critical controls
  • keeps OMP agent-neutral: fresh installs inject no forced Forge, reviewer, observer, named-agent, or auto-spawn binding
  • adds the uai.adapter.v1 kernel with Claude, OMP, Codex, and OpenCode adapters, capability reporting, policy lowering, conformance evidence, and lifecycle integration
  • aligns Codex with current first-party PreToolUse/PostToolUse, block, hookSpecificOutput, updated-input/additional-context, AGENTS.md, and reusable-agent TOML surfaces
  • adds hostile cross-platform fixtures and blocking compile/unit/fixture/conformance gates for Windows, macOS, and Linux
  • preserves UAI-authored content; the unrelated pre-existing ToolInventory.md deletion remains excluded

Design and audit artifacts

  • docs/prd/pr-1-stabilization.md
  • docs/prd/universal-runtime.md
  • plans/uai-universal-runtime-roadmap.md
  • ISA.md (18/18 criteria complete)

Renewed self-audit

Two independent implementation vets rechecked lifecycle/security invariants and Codex first-class support. The audit corrected two native Codex contract mismatches: legacy event/decision shapes and stale reusable-agent capability loss. Exact regression coverage now proves canonical event lowering, documented allow/block/update/advisory output, C0/C1 discovery/bootstrap/uninstall, fixture-capped C2 conformance, and refusal to claim C3/active without a repository-owned native executor.

A real credential-free smoke found codex-cli 0.144.5, applied the documented AGENTS.md C1 bootstrap in an isolated temporary profile, proved instruction-sentinel, byte-preserving uninstall, and profile-root isolation, then returned uninstalled. No live profile was mutated.

Verification

Final-head GitHub Actions run 29676660490 passed all 12 blocking jobs on commit 309e313:

  • compile, unit, fixtures, and Codex-expanded conformance
  • Windows, macOS, and Linux
  • optional credentialed vendor discovery skipped by design and remains non-certifying

The Claude review check also passed on final head in run 29676662977; when its OAuth secret is absent, the workflow records an explicit successful skip instead of failing during action setup.

Local evidence:

  • OMP neutrality/stabilization: 86 pass, 0 fail, 342 assertions
  • universal runtime: 74 pass, 0 fail, 433 assertions
  • CI-bound conformance slice: 16 pass, 0 fail, 118 assertions
  • kernel conformance: 11/11 probes
  • compile and six-check workflow-layout probes passed
  • real Codex default discovery/C1 apply/uninstall passed
  • protected-file validator passed all six files

Residual limits

Live credentialed model execution remains intentionally optional and was not exercised. Codex --version discovery and isolated bootstrap were exercised against the installed CLI. Runtime support claims remain evidence-derived; configuration presence alone never certifies an adapter, fixture evidence cannot earn C3, and unsupported surfaces stay explicit.

First release under the LifeOS name. The whole system now ships as one
self-contained skill (LifeOS/): SKILL.md + Workflows + Tools + an install/
payload (system prompt, Algorithm v6.23.0, 49 skills, hooks, agents, Pulse,
statusline, USER + MEMORY scaffolds). curl -fsSL ourlifeos.ai/install.sh | bash
lays down the complete system. Old Packs/Releases archive left intact.

Release notes: Releases/v6.0.0/README.md
New LifeOS logo + name (was Personal AI Infrastructure), skill-only one-line
install via ourlifeos.ai, Algorithm v6.23.0, all repo refs -> danielmiessler/LifeOS,
v6.0.0 update-history entry. Preserves the existing Principles/Features/FAQ prose.
…page

- Front-page README: styled one-line-install terminal graphic (ports the
  ourlifeos.ai install widget), pointing at ourlifeos.ai/install.sh
- Releases/v6.0.0 page: LifeOS logo at the top
… + wide/low banner

- FIX (critical): install.sh EXTRACTED find matched $TMP_DIR itself (mktemp name
  has hyphens) -> 'LifeOS skill not in tarball'. Now -mindepth 1 -maxdepth 1.
  Verified against the real v6.0.0 tarball.
- Wider, lower, gradient banner.
- README + v6.0.0 release page: make clear LifeOS is an AI-native install that
  runs inside your AI harness and hands off to /lifeos-setup.
…es index

- README: new ## Core Components section (8 unique features + 5 supporting)
- Releases/README.md: LifeOS-branded, v6.0.0 (Current) + v5.0.0 rows, fixed clone URL
- Releases/v6.0.0: link to Core Components overview
…R/REPO placeholder, aborted network install)
…ibuting/License/Credits/Support/Related Reading/history) atop the simplified core
Removed the project name 'LifeOS' from the README.
…nents section

Replace the two hand-maintained component tables with a single screenshot of
the live 'What makes LifeOS work' section on ourlifeos.ai. The whole image links
to the site so readers land where the cards actually expand. Keeps the
## Core Components heading so Releases READMEs' #core-components anchor resolves.
The FAQ wrongly framed LifeOS as built natively on and only for Claude Code.
LifeOS is designed to run on any high-end AI coding harness; Claude Code is the
most-tested path because that's what we build on, not a hard requirement. Rewrote
the three Claude-Code-centric FAQ answers into two harness-agnostic ones and fixed
the install lines to stop hard-requiring Claude Code.
- Replace AI-clipart release-icon-v2.png with the real LifeOS staircase mark
  (deterministic SVG -> 1024px PNG, brand blues, dark app-icon tile)
- Add a lineage note: v2.3-v5.0.0 shipped as PAI before the LifeOS rename
- Install section now harness-agnostic (give-it-to-your-AI prompt + curl
  shortcut), matching the redesigned main README
…de/ directory

The page wrongly described releases as full ~/.claude/ directories you copy into
your home folder. That's the old model. LifeOS now ships as a single
self-contained skill; the .claude/-directory releases (v2.3-v5.0.0) are legacy
history, not the current install path. Reframed What Are Releases, added a
'Legacy Releases (.claude/-era)' divider, rewrote Installation + Troubleshooting.
…ep), install.sh→6.0.3, repo pointer + case rename
HotSauceHacker and others added 30 commits July 12, 2026 13:28
SKILL.md and Workflows/Audit.md tell the model to move rarely used
context to on-demand loading via CONTEXT_ROUTING, but no file or
mechanism by that name exists anywhere in the repo. The routing
table lives in CLAUDE.md (CLAUDE.template.md calls itself the
routing table). Repoint both references to the CLAUDE.md routing
table so the instruction resolves to something real.
… Pulse System Health), Algorithm v8.4.0 depth steering, statusline upgrades, community fixes (#1450 #1456 #1463 #1470 #1471)
…re logo lockup, badges to 7.1.1 / Algorithm 8.4.0, 7.1.1 update-history entry, typo fix
…deo render)

GitHub strips the poster attr on user-attachment videos, so the old embed
showed a white first frame. Prepend the website poster as frame-0 and commit
the video into the repo, referenced by raw URL (renders as a player, survives).
…> tags; user-attachment auto-player is web-upload-only)
…restructure

True merge (shared ancestor 2fde1bb; parents = UAI main 68f501b + upstream/main
03a969d). UAI is now 0 commits behind upstream.

Core sync
- LifeOS/** → upstream latest. Upstream retired the committed Releases/ archive
  (058e29d, 2026-07-12, "in favor of GitHub Releases") and moved the live tree to
  LifeOS/: 1,288 files rename-carried from Releases/v5.0.0/.claude/** to
  LifeOS/install/** (456 of them also content-updated), 552 truly new (installer
  product: GETTING-STARTED/INSTALL/SKILL.md, 11 Tools/, 4 Workflows/; 9 new skills;
  24 new hooks + hooks.json; 6 researcher agent contexts; RULES/, USER_TEMPLATES/,
  VERSION; 7 lifeos-* images), 9,334 deleted (Releases/ v2.3–v5.0.0 snapshots).

Conflict resolution (567 conflicts)
- Upstream wins on every path it tracks (UU/AA/UD); UAI wins on paths it authored
  (AU) and the protected set (.pai-protected.json: README.md, SECURITY.md,
  .env.example, Tools/validate-protected.ts, manifest). validate-protected.ts passes.
- Non-conflicted auto-merges preserved UAI's Codex-port edits in 15 files upstream
  hadn't touched since the fork (multi-provider TranscriptParser, Windows spawn fix
  in SystemIntegrity, provider-aware Webdesign messages).
- Telos DashboardTemplate case twins (App/+app/, Lib/+lib/) mirrored byte-exact from
  upstream (macOS case-insensitive checkout collision; index authoritative).

UAI product preserved
- Packs/ (1,850 files) + PLATFORM.md restored: they predate the fork divergence, so
  git applied upstream's deletion silently — reviewed and reversed.
- UAI Codex docs kept under LifeOS/install/LIFEOS/DOCUMENTATION/
  (UaiScopedRenamePlan, CodexNativePort, CodexClaudeParityGapAnalysis).
- Blob-audit: 157 rename-carried UAI files verified byte-identical; zero UAI-authored
  paths lost; zero upstream paths missing; zero conflict markers.

CI
- pai-codex-validation.yml: pull_request trigger narrowed to the workflow file
  (suite validates the pre-restructure layout and cannot pass post-sync); entrypoint
  repointed to the moved LifeOS/install/LIFEOS/TOOLS/CodexBranchValidation.ts with
  continue-on-error until the suite is ported. Legacy push branches +
  workflow_dispatch untouched.

README install/update flow re-pinned (would 404 on merge otherwise)
- All 16 Releases/ links pinned to 68f501b (last commit carrying the bundle).
- Every clone recipe (install, convert-to-UAI ×2, manual install, updater ×2) gained
  an explicit `git checkout 68f501b` step; updater recipes carry --no-pull/-NoPull
  (a pull on the pinned checkout errors or moves past the bundle).
- Pre-existing breakage documented: the updater's standalone raw-URL mode defaults to
  --branch pai-codex-flawless-runtime, which no longer exists on origin; standalone
  recipes now clone at the pinned commit and pass --source-dir explicitly.

Follow-ups for maintainer (Phase-2 rename work): port installer + Codex validation
suite to the LifeOS/ layout; re-apply Phase-1 uai-rename pass over synced core files.
…er + memory + safety

Ports the full LifeOS<->OMP integration into UAI, extending the fork's
multi-harness thesis (Claude Code + Codex) to a third harness. Everything
lives under LifeOS/install/LIFEOS/OMP/ and is additive — Claude Code and
Codex behavior is unchanged.

What ships
- Constitution: APPEND_SYSTEM.md (modes-off) + APPEND_SYSTEM_MODES.md
  (modes-on, full CC banner templates), symlinked into the OMP agent dir.
- 5 OMP extensions: lifeos-memory (hot-layer <pai-memory> injection +
  prompt-keyed KNOWLEDGE retrieval), lifeos-commands (/e1-/e5, /interview,
  /modes, /cs...), lifeos-safety (native port of Safety.hook.ts), lifeos-hooks
  (CC-hook-protocol adapter: runs the real hooks/*.hook.ts against mapped OMP
  events with async execution, tool-input normalization, Pulse gating),
  lifeos-observability (tool-activity/failure trackers + statusline).
- manage.ts: install / uninstall / status / modes on|off / inference
  claude|omp|auto|status. Deadlock-proof modes state machine; YAML-safe
  config.yml wiring; PI_CODING_AGENT_DIR respected.
- Inference backend abstraction: 'omp' spawns bare omp sessions on OMP's own
  default model (any provider/auth); 'auto' = claude first with one omp retry
  on any failure — survives a Claude-subscription cancellation with zero
  config. Model pinning via LIFEOS_OMP_INFERENCE_MODEL (use provider/model
  fully-qualified ids).
- Tool patches (additive, CC-safe): MemoryReviewer dual-store transcript scan
  (~/.omp/agent/sessions); TranscriptParser OMP line-shape support;
  Inference.ts omp/auto backends.

UAI-specific merge notes
- TranscriptParser: extended UAI's textMessageFromEntry/isRealUserPrompt with
  OMP's nested { message: { role, content } } branch instead of importing
  upstream's normalizeEntry — one helper family now reads all four shapes
  (CC, Codex response_item, OpenCode top-level message, OMP nested message).
  Functionally verified across all four.
- Inference: kept UAI's executedModel/modelDowngraded verification and
  resolveClaudeBin; added the omp/auto backend machinery around them. The
  upstream advisor block (removed by upstream since the fork) stays removed.
- manage.ts source-check accepts both parser conventions (UAI helpers or
  upstream normalizeEntry).

Verification
- bun build --no-bundle clean on manage.ts + all 5 extensions.
- manage.ts status under an isolated PI_CODING_AGENT_DIR: constitutions,
  extensions, and both tool patches detected; no source warnings.
- Four-shape transcript parse test: CC / Codex / OpenCode / OMP all pass.
Runs the REAL LIFEOS_StatusLine.sh — the same script Claude Code's statusLine
setting runs — inside OMP, single-sourced so it can never drift from CC:

- lifeos-observability paints the panel on session_start + every turn_end:
  synthesizes the CC-shape stdin JSON (model display name, context-window
  size/pct/tokens from ctx.getContextUsage(), harness identity) and renders
  the script's output via ctx.ui.setWidget below the editor.
- Harness line reads 'HARN: OMP <version>' via the script's existing
  harness stdin field; model line follows the script's own EFFORT_MODEL
  doctrine (active-level model, falls back to the session model).
- Separator rows are distilled out to fit OMP's 10-line widget cap; ANSI
  styling preserved.
- /statusline on|off|refresh — off writes an opt-out marker; default ON
  when the script exists in the installed LifeOS tree.
- Non-blocking: async spawn, 10s timeout, single render in flight,
  fail-open (statusline must never break a turn).

Verified: bun syntax clean; end-to-end unit test (factory + stubbed ctx)
renders the real panel (10 lines, placement=belowEditor) from live caches;
RPC-mode probe confirms setWidget traverses OMP's extension UI bridge.
…getContextUsage mismatch

ctx.getContextUsage() returns a Promise in print/headless mode but a PLAIN
value in interactive TUI mode. The panel code chained .catch() on the return
value, which throws (undefined is not a function) on every interactive paint —
caught by the fail-open guard, so the panel silently never appeared. Repro'd
in a real PTY session; root-caused via temporary notify diagnostics.

- await ctx.getContextUsage?.() inside try/catch (await normalizes both shapes)
- interface widened: () => ContextUsage | undefined | Promise<...>
- HARN line: resolve omp's real version once per process (async spawn with 3s
  timeout, awaited by the first paint) instead of trusting env — renders
  'HARN: OMP 17.0.0'

Verified in a live interactive PTY: full panel renders at session start
(LIFEOS/location/weather header, STATE rings, HARN: OMP 17.0.0, CONTEXT bar).
…ree ships

Final-audit finding: the adapter manifest was written against a pre-restructure
LifeOS install; 7 of its 23 hook entries referenced files that do not exist in
THIS tree (upstream's 2026-07-11 hooks consolidation renamed/retired them).
The adapter fails open on missing files, so for a fresh UAI+OMP user those
bridges were silent no-ops — exactly the 'nothing silently dropped' violation
the PARITY doctrine forbids.

Remapped (verified against the successors' own headers):
- OutputFormatGate + SuccessClaimGate → StopGates.hook.ts (upstream's ONE
  Stop-gate: FormatGate + VerificationGate + WritingGate; ungated — FormatGate
  is telemetry-only so it cannot deadlock modes-off sessions)
- MemoryReviewTrigger → dropped; MemoryReviewFire (already bridged) owns the
  whole review cadence upstream

Dropped with documentation (retired upstream, no successor):
- TheRouter — modes-on now relies on the constitution's model
  self-classification (both constitution variants updated to say exactly that)
- TelosSummarySync, RelationshipMemory, ArtWorkflowGuard

Docs aligned in the same pass: PARITY.md subsystem row + hook-by-hook tables +
retired-hooks note, OMP README, OmpSystem.md bridged list, manage.ts modes
help/messages, working-message text ('context + gates…' — no classifier runs
here), stale comments.

Verified: all 17 manifest hooks exist in LifeOS/install/hooks/ (was 16/23);
StopGates answers the adapter's CC stdin shape (exit 0); all touched TS
compiles; zero stale references outside historical/explanatory notes.
…es ENTIRELY, not just TheRouter

Correction of a wrong claim these files previously made. Upstream's 7.0.0
'Bitter Pill' release (2026-07-11) retired the whole mode system — modes,
tiers, routing, AND the per-mode templates — in favor of ONE unified response
format (source: DOCUMENTATION/Router/RouterSystem.md 'RETIRED 2026-07-11',
LIFEOS_SYSTEM_PROMPT.md 'One format, every response — there are no modes',
and release commit 3baba67 'modes/tiers retired').

These files previously described modes-on as 'the constitution's
self-classification' — implying it was upstream's intended 7.x flow. It is
not: the modes-on variant re-creates the pre-7.x LifeOS-6 banner experience.
Now labeled everywhere as an OPTIONAL LEGACY banner regime:

- Both constitution headers: honesty note citing the retirement + pointer to
  exact-stock behavior (symlink the constitution to the deployed
  LIFEOS_SYSTEM_PROMPT.md)
- PARITY.md: 'Mode system' row renamed 'Format regime' (default = unified
  format; modes-on = opt-in legacy)
- README, OmpSystem.md, adapter comments, manage.ts messages: same correction

Also worth knowing upstream: 7.1.1's shipped hooks/README.md still documents
TheRouter as the classifier and PromptProcessing/isa-utils/tab-setter still
reference its mode tokens — stale docs for a component that no longer ships.
…red modes entirely

Follow-through on the previous doc correction: since 7.x has ONE unified
response format (no modes, no tiers, no per-mode templates), the mode toggle
surface was dead weight that could only mislead. Removed:

- APPEND_SYSTEM_MODES.md (the legacy LifeOS-6-style banner constitution)
- manage.ts: 'modes on|off' subcommand, APPEND_SRC_MODES, MODES_MARKER state
  machine, mode-system status line ('modes' now exits with an explanatory
  error; uninstall still clears a legacy marker if a pre-7.x install left one)
- lifeos-hooks: MODES_MARKER/MODES_ON snapshot, HookSpec.toggle field (no
  manifest entry used it), mode-dependent working message (now always
  'LifeOS: loading context…')
- lifeos-commands: /modes command (+ now-dead spawn/fs imports)
- lifeos-observability: 'modes:ON|off' statusline tag (now 'LifeOS · 🔧N')
- Docs (README, PARITY, OmpSystem, constitution header): mode rows replaced
  with the unified-format contract; PARITY 'Install lifecycle' row updated

The constitution note stays: for byte-exact stock behavior, point the
APPEND_SYSTEM.md symlink at the deployed LIFEOS_SYSTEM_PROMPT.md.

Verified: all 6 TS files compile; no orphaned identifiers (AGENT_DIR/BUN_BIN/
HOME sweeps); 'manage.ts modes' exits with guidance instead of ReferenceError;
residual 'modes' mentions are historical/explanatory only.
Show DIRECT for ordinary turns and ALGO <phase> <effort> while the current OMP tab has active ISA work. Derive the work slug from that tab's own tool path so shared work.json state cannot leak another tab's phase. Add Bun regression coverage, package test command, installer-facing docs, and remove the final stale opt-in-mode wording.
Mark OMP-launched hook subprocesses with LIFEOS_HARNESS=omp and make Inference.ts choose the bare OMP backend when no explicit override exists. Claude remains the backward-compatible default outside OMP and an explicit opt-in inside it. Add default reset semantics, no-subscription execution tests, fresh-profile install coverage, and create the missing OMP agent directory during first install.
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.

7 participants