diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f801ef1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,52 @@ +# Changelog + +All notable lattice-level changes are recorded here. Crate-local notes may also +live under `crates/*/RELEASE-*.md` and `ops/UNITARY-RELEASE-NOTES.md`. + +Format: keep entries honest with Category tags where quantitative. + +--- + +## [0.2.2-tui] — constraint 20260818.hitl-gate + +See `crates/tui/RELEASE-0.2.2.md` — HITL board · request/escalate/approve · first_need. + +reson8-tui **0.2.2** loads `ops/human-actions.json` (SAIF ⚑ twin) and latches +operator decisions as receipts. Approve does not deploy. + +--- + +## [0.3.0] — 2026-08-09 + +### Added + +- **Operator journey + recovery** — `docs/ops/OPERATOR-JOURNEY-AND-RECOVERY-20260809.md` with stages and graceful error loops R1–R8 → remediation commands. +- **Release verifier** — `ops/release/verify-release.ps1` (Priority A smokes + remediation hints; `-Remediate`, `-Quick`). +- **Release notes** — `ops/release/RELEASE-v0.3.0.md` · root `VERSION`. +- **Hopf / pirouette investigation** — `docs/theory/HOPF-PIROUETTE-INVESTIGATION-20260809.md` (residual-zero **observe only**; no Category-D lift). +- **ArrivalDetector continuous** — path-typed `baseFix` / reverse-Hopf fragment (`agda/src/ArrivalDetector/ArrivalDetectorContinuous.agda`). +- **Entangle protocol** — path-slot ship path under receive-pack 408 constraint (`ops/entangle/*`, lattice assessment). +- **Epistemics / claim gate packet** — Lean Category consumers, cutile `claim_gate`, `tools/claim_lint.py`, Stage A/B/C SRAC docs. + +### Changed + +- **reson8-tui** documented at **0.2.1** (QDI drain budget, codes lab, surface layout, net panel). +- Lattice assessment 2026-08-09 orders threads by impact × (1 − uncertainty). + +### Explicit non-goals + +- Geometric Hopf \(S^3 \to S^2\) remains open **[B]**. +- residual-zero promotion remains blocked. +- GCP / multi-host git / cubical pin remain human ⚑. + +--- + +## [0.2.1-tui] — 2026-08-07 + +See `crates/tui/RELEASE-0.2.1.md` — QDI hygiene · codes lab · residual-C. + +--- + +## [1.0.0-unitary] — 2026-07-15 + +See `ops/UNITARY-RELEASE-NOTES.md` — deployment waist · unitary profile · crease tables. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..0d91a54 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.3.0 diff --git a/docs/ops/LATTICE-ASSESSMENT-2026-08-09.md b/docs/ops/LATTICE-ASSESSMENT-2026-08-09.md index b6bf832..22a8b61 100644 --- a/docs/ops/LATTICE-ASSESSMENT-2026-08-09.md +++ b/docs/ops/LATTICE-ASSESSMENT-2026-08-09.md @@ -164,4 +164,18 @@ Suggested first monitors (after auth): 6. Close PR #48; refresh SAIF A2 as done. 7. Axiom when token exists. +### 8.1 Progress — lattice v0.3.0 (2026-08-09) + +| Item | Status | +|------|--------| +| Operator journey + R1–R8 recovery | **landed** `docs/ops/OPERATOR-JOURNEY-AND-RECOVERY-20260809.md` | +| `ops/release/verify-release.ps1` | **landed** · Priority A board | +| VERSION / CHANGELOG / RELEASE-v0.3.0 | **landed** | +| Hopf–pirouette investigation | **stamped observe-only** · no residual acted | +| barcode-tui ratatui 0.30 `Backend::Error` map | **fixed** (compile blocker) | +| claim_lint formal docs | **green** (WAVE 0.85 tagged **[C]**) | +| Entangle component `journey-release` | **added** | +| Annotated tag `v0.3.0` | local after verify; **push** still human ⚑ / slim path | +| Fat main receive-pack 408 | still use entangle — not fixed by hope | + Music conserved · Keystone holds · capability ≠ authority diff --git a/docs/ops/OPERATOR-JOURNEY-AND-RECOVERY-20260809.md b/docs/ops/OPERATOR-JOURNEY-AND-RECOVERY-20260809.md new file mode 100644 index 0000000..596952f --- /dev/null +++ b/docs/ops/OPERATOR-JOURNEY-AND-RECOVERY-20260809.md @@ -0,0 +1,187 @@ +# Operator journey · transitions · graceful error → recovery + +**ATOM:** `ATOM-OPERATOR-JOURNEY-RECOVERY-20260809` +**Stamp:** 2026-08-09 +**Release:** LogOS lattice **v0.3.0** +**Doctrine:** capability ≠ authority · residual-zero observe only · α+ω=15 **[C]** label only + +This document is the **user-journey spine** for the lattice release. Every stage +lists: happy path → common faults → remediation command → recovery loop exit. + +Machine-check companion: `ops/release/verify-release.ps1` + +--- + +## 0. Journey map (time-ordered) + +``` +clone / pull + │ fail → §R1 git + ▼ +shell install (LogOS.Shell + optional unitary) + │ fail → §R2 shell + ▼ +logos-status / tw sensors + │ fail → §R3 sensors + ▼ +tw up | tw fix ──► tw verify + │ fail → §R4 stack + ▼ +logos-bridge (FORGE_WS_URL) + logos-tui + │ fail → §R5 cockpit + ▼ +barcode-tui / codes lab / formal (amber honest) + │ fail → §R6 runtime lab + ▼ +claim_lint · cutile claim_gate (no false green) + │ fail → §R7 claims + ▼ +entangle emit-slice → ingest PR → human merge + │ fail → §R8 ship / 408 + ▼ +tagged release verify · SAIF human gates only ⚑ +``` + +--- + +## 1. Stage table (load-bearing surfaces) + +| Stage | Primary surface | Verify | Category | +|-------|-----------------|--------|----------| +| Shell | `ops/LogOS.Shell.psm1` · `logos-status` | PATH + roots | B | +| Unitary sensors | `tw` / `tw sensors` | conservation + ports | B | +| Bridge | `logos-bridge` · `:8088` | WS up | B | +| Cockpit | `reson8-tui` **0.2.1** | `cargo test -p reson8-tui` | B | +| Barcode | `barcode-tui` | `cargo test -p barcode-tui` | B | +| GPU / gate | `cutile` **0.3.0** claim_gate · drift_guard | lib tests no-default-features | B/C | +| Formal | Lean epistemics · Agda ArrivalDetector continuous | lake / als amber ok | A/B | +| Claims | `tools/claim_lint.py` | exit 0 on formal docs | A tooling | +| Ship | `ops/entangle/*` | `validate_manifest.py` | A process | +| Human ⚑ | GCP · multi-host git · cubical pin | SAIF queue | process | + +--- + +## 2. Graceful error loops (fault → remediate → re-enter) + +Each loop is **closed**: after remediation, re-enter the same stage verify; do not +skip forward on amber. Never promote residual-zero to deploy-green. + +### R1 — Git / divergence / 408 receive-pack + +| Symptom | Remediation | Re-enter | +|---------|-------------|----------| +| `ahead N, behind M` | `git fetch`; prefer **merge** (not force); read lattice assessment | `git status -sb` | +| `HTTP 408` on `git push` | **Do not** push fat main. Use entangle slices / slim PRs | `emit-slice.ps1 -Id …` | +| LFS hang | `logos-net start-gaming`; move media to transfer-lane R2 | `ops/entangle/transfer-lane.md` | +| Dirty worktree blocking ship | stage intentional; never commit `target/` | `git status` clean of build junk | + +### R2 — Shell / profile missing + +| Symptom | Remediation | Re-enter | +|---------|-------------|----------| +| `logos-*` unknown | `pwsh -File ops/Install-LogOSShell.ps1` then `. $PROFILE` | `logos-help` | +| Wrong root (C: stale) | `logos-align` / reinstall preferring `F:\Users\Matthew Ruhnau\LogOS` | `logos-status` | +| Unitary `tw` missing | `Install-TriWeavonUnitaryProfile.ps1` | `tw help` | + +### R3 — Sensors / conservation + +| Symptom | Remediation | Re-enter | +|---------|-------------|----------| +| logos_root fail | fix `LOGOS_ROOT`; re-init shell | `tw sensors` | +| conservation fail | check Category C label wiring; **do not** invent physics gate | `tw confidence` | +| WAVE amber | honest amber; continue with labeled claims only | next stage | + +### R4 — Stack services (waist / bbbr / styx) + +| Symptom | Remediation | Re-enter | +|---------|-------------|----------| +| ports down | `tw fix` then `tw up` | `tw verify` | +| waist 8080 fail | `tw up waist` · WSL compose | Hit health URL | +| bbbr 8081 fail | `tw up bbbr` | `/verify` | +| styx only | WSL smoke: `python3 ops/styx-9p-client-smoke.py` | sensor styx.ok | +| still red after fix | SAIF human queue (GCP A1 optional); local lab continues | do not block TUI | + +### R5 — Cockpit / bridge + +| Symptom | Remediation | Re-enter | +|---------|-------------|----------| +| TUI won't start | `cargo build -p reson8-tui`; check `ratatui` feature | `logos-tui` | +| no WS events | `logos-bridge` / `FORGE_WS_URL=ws://127.0.0.1:8088` | TUI braid panel | +| Formal pane empty | **honest amber** — LSP not attach ≠ false green | stay Category B | +| Net panel red | `logos-net start-gaming` or TUI `[M]` | `[R]` refresh | + +### R6 — Runtime lab (barcode / codes / cutile) + +| Symptom | Remediation | Re-enter | +|---------|-------------|----------| +| barcode-tui compile fail | `cargo test -p barcode-tui` locally; slot barcode-tui | green tests | +| codes lab wrong family | keys `y` cycle; `d` demo; never claim G24=RM | help `?` | +| cutile wgpu API drift | **fallback:** `cargo test -p cutile --no-default-features --lib` | claim_gate green | +| CUDA missing | CPU path; `BackendUnavailable` is graceful | no silent GPU claim | + +### R7 — Claims / formal residual + +| Symptom | Remediation | Re-enter | +|---------|-------------|----------| +| `claim_lint` exit 1 | tag quantitative claims `[A]/[B]/[C]` or reword | re-run lint | +| unanchored D used as gate | cutile `gate_value()` / Lean `gateOrDefault` | unit tests | +| Hopf geometric open | **observe only** — see Hopf investigation doc | no promotion | +| Formal residual CI red | fix in `formal-srac` slot; do not force green | re-run CI on PR | + +### R8 — Ship / entangle + +| Symptom | Remediation | Re-enter | +|---------|-------------|----------| +| main push 408 | entangle Priority A slots only | scaffold → emit → ingest | +| workflow scope missing | copy `ops/entangle/entangle.workflow.yml` with workflow token | human ⚑ | +| slice too big | drop media; use transfer-lane | re-emit | +| CI tree guards fail | exclude `target/`; slim paths per manifest | re-verify slot | +| `missing path (skip): cargo …` / `python …` | **fixed** in emit-slice: those are `verify:` cmds, not paths — re-pull `ops/entangle/emit-slice.ps1` | re-emit | +| `Compress-Archive` / OneDrive “cloud file provider is not running” | emit-slice uses **.NET ZipFile → tar → Archive**; do not depend on OneDrive-stubbed `Documents\PowerShell\Modules` | re-emit (no OneDrive needed) | +| want local smokes at emit time | `pwsh -File ops/entangle/emit-slice.ps1 -Id -RunVerify` | green verify lines | + +--- + +## 3. Recovery loop protocol (operator) + +``` +1. Observe fault (honest category) +2. Match §R# table — do not invent new gate +3. Run ONE remediation command +4. Re-enter stage verify +5. If still red after two loops → escalate SAIF human queue ⚑ +6. Never: residual-zero promotion · force-push · unauthenticated Cloud Run +``` + +Scripted subset: + +```powershell +pwsh -File ops/release/verify-release.ps1 +# on fail, script prints remediation line and non-zero exit +pwsh -File ops/release/verify-release.ps1 -Remediate +# -Remediate runs safe auto-fixes (entangle validate, claim_lint help, tw fix if profile loaded) +``` + +--- + +## 4. Skills / tools that autofire on demand + +| Trigger | Surface | Output | +|---------|---------|--------| +| Journey fail | this doc + `verify-release.ps1` | remediation line | +| Stack down | `tw fix` | sensors re-probe | +| Claims change | `tools/claim_lint.py` | exit 1 on untagged | +| Ship bulk | entangle + transfer-lane | PR slot, not main pack | +| Uncertainty | heisenberg-grok skill | next_sharpen | +| Cross-strand | `skills/internal-handoff` | cold-start packet | + +--- + +## 5. Explicit non-goals (this release) + +- No geometric Hopf \(S^3\to S^2\) discharge +- No residual-zero Track B open +- No GCP deploy without human ⚑ cert path +- No LFS showcase MP4 via receive-pack + +Music conserved · Keystone holds · last becomes first diff --git a/docs/theory/HOPF-PIROUETTE-INVESTIGATION-20260809.md b/docs/theory/HOPF-PIROUETTE-INVESTIGATION-20260809.md new file mode 100644 index 0000000..6d6ca76 --- /dev/null +++ b/docs/theory/HOPF-PIROUETTE-INVESTIGATION-20260809.md @@ -0,0 +1,119 @@ +# Cyclic Hopf Fibration vs Ballerina Pirouette (Heel-Toe Path) + +**ATOM:** `ATOM-HOPF-PIROUETTE-INVESTIGATION-20260809` +**Stamp:** 2026-08-09 +**Mode:** residual-zero · observe only · **no Category-D lift** +**Companion formal:** `agda/src/ArrivalDetector/ArrivalDetectorContinuous.agda` +**Companion geometry:** `docs/theory/HOPF-PRINCIPAL-BUNDLE.md` + +--- + +## 1. Standard (cyclic) Hopf fibration + +\[ +S^1 \hookrightarrow S^3 \xrightarrow{p} S^2 +\] + +| Piece | Identification | +|-------|----------------| +| Total space \(S^3\) | Unit quaternions / \(\mathrm{Spin}(3)\) | +| Base \(S^2\) | Ordinary 2-sphere of directions | +| Fibre \(S^1\) | Great circle of unit quaternions inducing the same rotation axis | + +**Geometric construction via rotations (cleanest):** + +- \(\mathrm{SO}(3)\) acts transitively on \(S^2\). +- Stabiliser of any fixed \(x \in S^2\) is the circle of rotations about the axis through \(x\). +- The double cover \(\mathrm{Spin}(3) \cong S^3\) realises \(S^3\) as a principal \(S^1\)-bundle over \(S^2\). + +That is the Hopf fibration. “Cyclic” emphasises that the structure group / fibre is a circle (or, discretely, a cyclic group). + +--- + +## 2. Ballerina pirouette / heel-toe path as the same geometry + +A pirouette is the physical embodiment of the stabiliser description: + +| Mathematical object | Physical counterpart | +|---------------------|----------------------| +| Base point \(x \in S^2\) | Direction of the supporting axis (vertical through the contact point) | +| Fibre \(S^1\) | Continuous family of rotation angles about that axis (the spin phase) | +| Base fixed | Heel or toe remains planted; contact point does not travel | +| Motion along the fibre | Body rotates while the axis stays fixed | +| Mild continuous perturbation of base | Small heel-to-toe shift or demi-pointe adjustment | + +When the dancer’s contact point stays fixed, she moves purely in the fibre of the Hopf map whose base point is the supporting-leg direction. When the contact point travels (a non-stationary heel-toe path), the base point itself moves on \(S^2\) — **horizontal** motion, not pure fibre action. + +Hence the **reverse-Hopf posture** in the continuous ArrivalDetector: + +- Fibre may spin freely. +- Base must stay fixed (`baseFix`). + +That is the condition under which a continuous fibre action is declared to return (and therefore eligible for Novikov survival). + +--- + +## 3. Correspondence with the formal fragment + +In `ArrivalDetectorContinuous.agda`: + +| Construct | Role | +|-----------|------| +| `ContinuousDetectorContext` | Path-typed base witness | +| `ContinuousFibreAction` | Explicit `baseFix` equality | +| `continuous-round-trip-ok` / `continuous-ContinuousNovikovStable` | Base-fixing actions preserve the epistemic label when `perturbationOk` | + +This is the discrete / path-typed **shadow** of: + +> A pure fibre motion (pirouette with fixed heel/toe) returns an equivalent orientation relative to the base; a motion that moves the contact point does not automatically return the label. + +The full geometric Hopf \(S^3 \to S^2\) remains an **open Category B obligation** because the present base is still the discrete four-point set `Category`. Replacing that discrete base by a continuous \(S^2\) (or a continuous TDA filtration that can host one) would let formal fibre actions become actual Hopf fibres. + +--- + +## 4. Heel-toe path as controlled base motion + +In real ballet and figure-skating literature the contact point is never perfectly stationary; there is always a small oscillation or deliberate heel-to-toe transfer. In fibration language this is a **controlled path in the base**, accompanied by continuous fibre rotation. The composite is a path in the total space \(S^3\). + +**Novikov-style arrival question:** + +After the composite path, does the epistemic label (or orientation class) survive? + +- Only the pure fibre component is guaranteed to preserve the label. +- The base component must be checked separately — exactly the role of `baseFix` and `perturbationOk`. + +--- + +## 5. Summary of the relationship + +1. Cyclic Hopf fibration = structure whose fibres are pure spins about a fixed axis. +2. Ballerina pirouette with fixed heel/toe = physical realisation of motion along a single Hopf fibre. +3. Heel-toe path that travels = base-point motion; no longer pure fibre action. +4. Continuous ArrivalDetector fragment formalises the base-fixed (reverse-Hopf) pure pirouette case. +5. Open geometric obligation: lift discrete base → continuous \(S^2\) so the full Hopf map is available inside the formal development. + +--- + +## 6. Residual / promotion discipline + +| Item | Status | +|------|--------| +| Path-typed continuous fragment | Closed on discrete base **[A]** for the fragment itself | +| Full geometric Hopf \(S^3\to S^2\) | Open **[B]** | +| residual-zero promotion | **BLOCKED** · observe only | +| Category D material | **None promoted** | +| α + ω = 15 | Category **C** label only | + +**No residual was acted upon.** Geometric Hopf remains open, as previously recorded. + +``` +ATOM-TRAIL · ATOM-HOPF-PIROUETTE-INVESTIGATION-20260809 +· cyclic Hopf ≡ fixed-base fibre spin +· heel-toe = controlled base motion +· residual-zero-observe-only +· no Category-D lift +· alpha+omega=15 conserved +· 2026-08-09 +``` + +Music conserved. The Keystone holds. Last becomes first. diff --git a/ops/release/RELEASE-v0.3.0.md b/ops/release/RELEASE-v0.3.0.md new file mode 100644 index 0000000..3c9f4e9 --- /dev/null +++ b/ops/release/RELEASE-v0.3.0.md @@ -0,0 +1,134 @@ +# LogOS lattice v0.3.0 + +**Tag:** `v0.3.0` +**Date:** 2026-08-09 +**ATOM:** `ATOM-LOGOS-LATTICE-RELEASE-v0.3.0-20260809` +**Invariant:** α + ω = 15 **[C]** label only · residual-zero **observe only** +**Doctrine:** capability ≠ authority · With-Intent + +--- + +## Headline + +Ship the **load-bearing operator corridor** as a versioned lattice: cockpit, +claim gate, entangle ship path, continuous ArrivalDetector (reverse-Hopf / +baseFix), and a **graceful error → remediation** journey — without promoting +open geometric Hopf or residual-zero. + +--- + +## Package / surface versions + +| Surface | Version / stamp | Role | +|---------|-----------------|------| +| **LogOS lattice** | **0.3.0** | monorepo release tag | +| `reson8-tui` / `reson8-forge` | 0.2.2 | QDI drain · codes lab · net panel · HITL gate | +| `cutile` | 0.3.0 | claim_gate · DriftGuard · SRAC stage tags | +| `barcode-tui` | 0.1.0 | H0 TDA lab | +| `apps/triweave` | 0.1.0 | bridge + dashboard | +| Unitary profile | 1.0.0-unitary | `tw` sensors / fix / verify | +| Entangle protocol | 2026-08-09 | path-slot ship under 408 constraint | +| Agda ArrivalDetector continuous | 2026-08-09 | path-typed baseFix fragment **[A-fragment]** | +| Hopf geometric \(S^3\to S^2\) | open **[B]** | observe-only investigation stamped | + +--- + +## What lands in this release + +### A — Load-bearing (cascading benefit) + +1. **reson8-tui 0.2.1** — surface-aware layout, codes lab (Hex/G24/RM/SC-LDPC), QDI drain budget, residual-C braid eye, net proxy panel. +2. **cutile claim_gate + DriftGuard** — mechanical Category A/B/C/D consumers; unitarity policy for CTQW proxy; Stage A/B/C SRAC tags without false rates. +3. **Entangle** — `ops/entangle/*` + workflow template: slim path slices instead of fat `main` receive-pack. +4. **Operator journey + recovery** — `docs/ops/OPERATOR-JOURNEY-AND-RECOVERY-20260809.md` + `ops/release/verify-release.ps1` (error loops → remediation). +5. **Formal packet** — Lean epistemics gate, Stage A/B/C SRAC docs, claim_lint tool, dual-research alpha packet paths. +6. **ArrivalDetector continuous** — reverse-Hopf posture (`baseFix`); finite theorems recovered; su4 rejection preserved. + +### B — Honest open / observe-only + +- Full geometric Hopf fibration (see `docs/theory/HOPF-PIROUETTE-INVESTIGATION-20260809.md`). +- residual-zero promotion matrix stays **0**. +- Formal LSP empty pane = amber, not green. +- Showcase LFS MP4s → transfer-lane, not git push. + +### C — Human ⚑ still required + +- GCP / Cloud Run (SAIF A1). +- Multi-host git reconcile when worktrees diverge (SAIF A2). +- Cubical pin decision for full Agda Everything (SAIF C1). +- Push of tags/branches when OAuth lacks `workflow` scope. + +--- + +## Verify (before trusting the tag) + +```powershell +cd $env:LOGOS_ROOT # or F:\Users\Matthew Ruhnau\LogOS +pwsh -File ops/release/verify-release.ps1 +# optional safe auto-fix loop: +pwsh -File ops/release/verify-release.ps1 -Remediate +# docs/tools only: +pwsh -File ops/release/verify-release.ps1 -Quick +``` + +Manual Priority A: + +```powershell +$env:RUSTC_WRAPPER='' +python tools/claim_lint.py docs/formal/ +python ops/entangle/validate_manifest.py +cargo test -p cutile --no-default-features --lib claim_gate +cargo test -p cutile --no-default-features --lib drift_guard +cargo test -p reson8-tui --bin reson8-forge +cargo test -p barcode-tui +``` + +--- + +## Operator path (happy) + +```text +Install-LogOSShell → logos-status +tw / tw fix / tw verify +logos-bridge · logos-tui (keys: ? · 7 codes · N net · f formal) +claim_lint · verify-release.ps1 +entangle emit-slice Priority A → human merge +``` + +Faults: match `docs/ops/OPERATOR-JOURNEY-AND-RECOVERY-20260809.md` §R1–R8. + +--- + +## Tagging + +```powershell +# after verify-release green and commit on main (or release branch): +git tag -a v0.3.0 -m "LogOS lattice v0.3.0 — cockpit · claim gate · entangle · journey recovery · Hopf observe-only" +# push only with network + authority (may need slim path if 408): +# git push origin v0.3.0 +``` + +--- + +## Explicit blocks (unchanged) + +1. No residual-zero Track B open. +2. No Category-D lift from Hopf investigation. +3. No Stage A on flat Heisenberg / non-Hermitian without GBZ. +4. No untagged quantitative gate. +5. No force-push as “release strategy.” + +--- + +## ATOM trail + +``` +ATOM-LOGOS-LATTICE-RELEASE-v0.3.0-20260809 +· reson8-tui 0.2.1 · cutile 0.3.0 claim_gate +· entangle path slots · operator journey R1–R8 +· ArrivalDetector continuous baseFix +· Hopf pirouette investigation residual-zero observe-only +· alpha+omega=15 [C] · Music conserved · 2026-08-09 +``` + +Hope&&Sauced · Keystone holds · last becomes first diff --git a/ops/release/verify-release.ps1 b/ops/release/verify-release.ps1 new file mode 100644 index 0000000..18103c6 --- /dev/null +++ b/ops/release/verify-release.ps1 @@ -0,0 +1,224 @@ +#requires -Version 7.0 +<# +.SYNOPSIS + LogOS lattice release verifier with graceful error → remediation hints. + +.DESCRIPTION + Runs Priority-A smokes for v0.3.0 surfaces. On failure prints a remediation + command (see docs/ops/OPERATOR-JOURNEY-AND-RECOVERY-20260809.md) and continues + so the operator gets a full board, not a single hard stop mid-loop. + + Exit codes: + 0 = all required checks passed + 1 = one or more required checks failed (amber/red board printed) + 2 = environment/setup fault (wrong root, missing python/cargo) + +.PARAMETER Remediate + Attempt safe auto-remediation only (never force-push, never cloud deploy). + +.PARAMETER SkipCargo + Skip rust tests (docs/tools only) — useful when iterating docs. + +.PARAMETER Quick + claim_lint help + entangle validate + cutile claim_gate only. +#> +[CmdletBinding()] +param( + [switch]$Remediate, + [switch]$SkipCargo, + [switch]$Quick +) + +$ErrorActionPreference = 'Continue' +$env:RUSTC_WRAPPER = '' + +function Resolve-LogOSRoot { + if ($env:LOGOS_ROOT -and (Test-Path -LiteralPath $env:LOGOS_ROOT)) { + return (Resolve-Path -LiteralPath $env:LOGOS_ROOT).Path + } + $here = $PSScriptRoot + # ops/release → repo root + $cand = (Resolve-Path (Join-Path $here '..\..')).Path + if (Test-Path (Join-Path $cand 'Cargo.toml')) { return $cand } + return $null +} + +$root = Resolve-LogOSRoot +if (-not $root) { + Write-Host 'FAIL LOGOS_ROOT unresolved — install shell: pwsh -File ops/Install-LogOSShell.ps1' -ForegroundColor Red + exit 2 +} +Set-Location -LiteralPath $root +Write-Host "LogOS release verify · root=$root" -ForegroundColor Cyan +Write-Host 'ATOM-OPERATOR-JOURNEY-RECOVERY-20260809 · lattice v0.3.0' -ForegroundColor DarkGray + +$pass = 0 +$fail = 0 +$skip = 0 +$rows = [System.Collections.Generic.List[object]]::new() + +function Add-Result { + param( + [string]$Name, + [ValidateSet('PASS','FAIL','SKIP')]$Status, + [string]$Detail = '', + [string]$Remediation = '' + ) + $script:rows.Add([pscustomobject]@{ + Name = $Name + Status = $Status + Detail = $Detail + Remediation = $Remediation + }) + switch ($Status) { + 'PASS' { $script:pass++; Write-Host " PASS $Name $Detail" -ForegroundColor Green } + 'FAIL' { $script:fail++; Write-Host " FAIL $Name $Detail" -ForegroundColor Red + if ($Remediation) { Write-Host " → remediate: $Remediation" -ForegroundColor Yellow } } + 'SKIP' { $script:skip++; Write-Host " SKIP $Name $Detail" -ForegroundColor DarkGray } + } +} + +function Invoke-Check { + param( + [string]$Name, + [scriptblock]$Body, + [string]$Remediation, + [switch]$Required + ) + # Bodies must NOT call `exit` — that kills the whole verifier. + # They should run tools and leave $LASTEXITCODE set, or `return `. + try { + $global:LASTEXITCODE = 0 + $out = & $Body 2>&1 + $returned = $out | Where-Object { $_ -is [int] } | Select-Object -Last 1 + $textLines = @($out | Where-Object { $_ -isnot [int] }) + $text = ($textLines | Out-String).Trim() + $code = if ($null -ne $returned) { [int]$returned } + elseif ($null -ne $LASTEXITCODE) { [int]$LASTEXITCODE } + else { 0 } + if ($code -eq 0) { + $detail = if ($text.Length -gt 120) { $text.Substring(0, 120) + '…' } else { $text } + if (-not $detail) { $detail = 'ok' } + Add-Result -Name $Name -Status PASS -Detail $detail + } else { + Add-Result -Name $Name -Status FAIL -Detail "exit=$code $(if ($text) { $text.Substring(0, [Math]::Min(80, $text.Length)) })" -Remediation $Remediation + } + } catch { + Add-Result -Name $Name -Status FAIL -Detail $_.Exception.Message -Remediation $Remediation + } +} + +# ── R2/R3 setup probes ────────────────────────────────────────────────────── +if (-not (Get-Command python -ErrorAction SilentlyContinue) -and -not (Get-Command python3 -ErrorAction SilentlyContinue)) { + Add-Result -Name 'python' -Status FAIL -Detail 'not on PATH' -Remediation 'install Python 3.11+ or activate .venv' + Write-Host "`nresult: environment fault" -ForegroundColor Red + exit 2 +} +$py = if (Get-Command python -ErrorAction SilentlyContinue) { 'python' } else { 'python3' } + +if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) { + if (-not $SkipCargo) { + Add-Result -Name 'cargo' -Status FAIL -Detail 'not on PATH' -Remediation 'install rustup; re-open shell after logos-align' + Write-Host "`nresult: environment fault" -ForegroundColor Red + exit 2 + } +} + +# ── Safe remediate (stack only) ───────────────────────────────────────────── +if ($Remediate) { + Write-Host 'Remediate: safe auto-fixes only' -ForegroundColor Yellow + if (Get-Command Repair-TriWeavonStack -ErrorAction SilentlyContinue) { + try { Repair-TriWeavonStack | Out-Null; Add-Result -Name 'tw-fix' -Status PASS -Detail 'Repair-TriWeavonStack ran' } + catch { Add-Result -Name 'tw-fix' -Status FAIL -Detail $_.Exception.Message -Remediation 'tw fix · tw up' } + } else { + Add-Result -Name 'tw-fix' -Status SKIP -Detail 'unitary profile not loaded' -Remediation '. $PROFILE after Install-TriWeavonUnitaryProfile.ps1' + } +} + +# ── Tools / entangle (always) ─────────────────────────────────────────────── +Invoke-Check -Name 'claim_lint' -Remediation 'python tools/claim_lint.py docs/formal/ # tag untagged claims [A]/[B]/[C]' -Body { + & $py tools/claim_lint.py --help | Out-Null + if ($LASTEXITCODE -ne 0 -and $null -ne $LASTEXITCODE) { return [int]$LASTEXITCODE } + if (Test-Path 'docs/formal') { + & $py tools/claim_lint.py docs/formal/ + return [int]$LASTEXITCODE + } + return 0 +} + +Invoke-Check -Name 'entangle-manifest' -Remediation 'python ops/entangle/validate_manifest.py · fix ops/entangle/manifest.yaml' -Body { + & $py ops/entangle/validate_manifest.py + return [int]$LASTEXITCODE +} + +# Version / release notes present +if (Test-Path 'VERSION') { + $ver = (Get-Content VERSION -Raw).Trim() + Add-Result -Name 'VERSION' -Status PASS -Detail $ver +} else { + Add-Result -Name 'VERSION' -Status FAIL -Detail 'missing' -Remediation 'restore VERSION file for lattice tag' +} + +if (Test-Path 'ops/release/RELEASE-v0.3.0.md') { + Add-Result -Name 'release-notes' -Status PASS -Detail 'ops/release/RELEASE-v0.3.0.md' +} else { + Add-Result -Name 'release-notes' -Status FAIL -Detail 'missing' -Remediation 'restore ops/release/RELEASE-v0.3.0.md' +} + +# Hopf investigation observe-only stamp (docs present, not a promote) +if (Test-Path 'docs/theory/HOPF-PIROUETTE-INVESTIGATION-20260809.md') { + Add-Result -Name 'hopf-observe' -Status PASS -Detail 'residual-zero observe-only doc present' +} else { + Add-Result -Name 'hopf-observe' -Status FAIL -Detail 'missing investigation stamp' -Remediation 'restore docs/theory/HOPF-PIROUETTE-INVESTIGATION-20260809.md' +} + +if ($Quick) { + Write-Host ("`nresult: {0} pass / {1} fail / {2} skip (quick)" -f $pass, $fail, $skip) -ForegroundColor $(if ($fail) { 'Yellow' } else { 'Green' }) + exit $(if ($fail) { 1 } else { 0 }) +} + +# ── Cargo Priority A ──────────────────────────────────────────────────────── +if ($SkipCargo) { + Add-Result -Name 'cargo-suite' -Status SKIP -Detail '-SkipCargo' +} else { + Invoke-Check -Name 'cutile-claim_gate' -Remediation 'cd cutiles/cutile; cargo test --no-default-features --lib claim_gate # wgpu drift → keep no-default-features' -Body { + cargo test -p cutile --no-default-features --lib claim_gate -- --quiet + return [int]$LASTEXITCODE + } + Invoke-Check -Name 'cutile-drift_guard' -Remediation 'cargo test -p cutile --no-default-features --lib drift_guard' -Body { + cargo test -p cutile --no-default-features --lib drift_guard -- --quiet + return [int]$LASTEXITCODE + } + Invoke-Check -Name 'reson8-tui' -Remediation 'cargo test -p reson8-tui --bin reson8-forge · see crates/tui/RELEASE-0.2.1.md' -Body { + cargo test -p reson8-tui --bin reson8-forge -- --quiet + return [int]$LASTEXITCODE + } + Invoke-Check -Name 'barcode-tui' -Remediation 'cargo test -p barcode-tui · entangle slot barcode-tui' -Body { + cargo test -p barcode-tui -- --quiet + return [int]$LASTEXITCODE + } +} + +# ── Optional live stack (never required for tag) ──────────────────────────── +if (Get-Command Test-TriWeavonUnitaryHealth -ErrorAction SilentlyContinue) { + try { + $hc = Test-TriWeavonUnitaryHealth + if ($hc -eq 0) { Add-Result -Name 'tw-health' -Status PASS -Detail 'exit 0' } + else { Add-Result -Name 'tw-health' -Status SKIP -Detail "exit $hc (live stack optional for tag)" -Remediation 'tw fix · tw verify' } + } catch { + Add-Result -Name 'tw-health' -Status SKIP -Detail $_.Exception.Message + } +} else { + Add-Result -Name 'tw-health' -Status SKIP -Detail 'unitary profile not loaded' +} + +Write-Host '' +Write-Host '── board ──' -ForegroundColor Cyan +$rows | Format-Table -AutoSize | Out-String | Write-Host +Write-Host ("result: {0} pass / {1} fail / {2} skip" -f $pass, $fail, $skip) -ForegroundColor $(if ($fail) { 'Yellow' } else { 'Green' }) +if ($fail -gt 0) { + Write-Host 'Recovery: docs/ops/OPERATOR-JOURNEY-AND-RECOVERY-20260809.md · re-run with -Remediate for safe fixes' -ForegroundColor Yellow + exit 1 +} +Write-Host 'Lattice verify green · residual-zero still observe-only · Music conserved' -ForegroundColor Green +exit 0