Commit Graph

344 Commits

Author SHA1 Message Date
vasilito 923697887c docs: record python harness migration; drop superseded policy docs
- 06-BUILD-SYSTEM-SETUP: note which QEMU proof scripts use
  qemu-login-expect.py vs host expect
- 01-REDOX-ARCHITECTURE, LOCAL-FORK-SUPREMACY-POLICY,
  SYSTEM-STABILITY-AND-UPSTREAM-SYNC-PLAN, UPSTREAM-SYNC-PROCEDURE:
  sync with current fork-model and sync-procedure state
- Delete archived/SOURCE-ARCHIVAL-POLICY.md and
  fork-push-status/2026-07-12-Round-5-phase-4.1.md — superseded by the
  current local-fork model docs and newer fork-push-status rounds
- config/redbear-mini.toml: trailing newline
2026-07-20 09:06:25 +09:00
vasilito 8801805031 docs: record expect-to-python harness migration and 2026-07-20 runtime-proof status
IRQ plan + validation matrix: the login-based QEMU proofs (PS/2 + serio,
monotonic timer, IOMMU first-use, USB storage BOT) now run through
local/scripts/qemu-login-expect.py (stdlib python) instead of the host expect
tool. MSI-X (virtio-net) and xHCI interrupt-driven mode were re-confirmed on
the current redbear-mini ISO. Re-confirmation of the login-based legs with the
new harness is pending an uncontended host (parallel QEMU workload kills QEMU
processes and stalls guest boots). Also record the fbcond Performing-handoff
boot freeze observed with -vga std (separate graphics-path issue).
2026-07-20 05:56:39 +09:00
vasilito a6c7d1d9c6 docs: 'reactor startup race' root cause = startup latency under load
Correct the P3-A runtime-validation note and matrix row: the
intermittent apparent boot freeze is startup latency under load (guest
clock ~10-15x slower than wall), not a deadlock or an xhcid bug. A short
50-60s test timeout occasionally cuts the spawn+enumerate sequence,
producing a 'frozen' log while the guest is still running — proven by
18 boots (one apparent short-timeout loss), a 12s log-quiet 'freeze'
the guest resumed from, and every >=180s run enumerating fully. No fix
required beyond adequate test timeouts; no speculative kernel-deadlock
fix was implemented.
2026-07-19 23:13:46 +09:00
vasilito 6446d440bf usb: hub-child enumeration proven end-to-end in QEMU + tighten hub test
The usb-kbd behind the QEMU usb-hub now enumerates fully: debounce ->
port reset -> enable -> second debounce -> pre-attach -> attach ->
ATTACH 5.2 -> slot 3 -> addressed -> descriptors read -> HID class match
-> 'Loading subdriver "USB HID" for port 5.2' (class 3.1 proto 1,
keyboard boot protocol).

Root cause of the final stall: an unconditional SetPortFeature
(PORT_INDICATOR) for every connected+enabled port NAK-hung on QEMU's
indicator-less hub (no control-transfer timeout), blocking the flow
before the post-enable debounce. Now gated on
wHubCharacteristics.HUB_CHAR_PORTIND like Linux has_indicators.

test-usb-hub-qemu.sh: check #5 now requires the hub-child subdriver
line ('Loading subdriver "USB HID" for port <root>.<child>') so a
root-port HID (tablet) can no longer satisfy it — closes a false-
positive hole. Timeout raised to 360s for slow TT-path driver bring-up.

Docs (plan P3-A runtime validation + matrix): full hub + hub-child
chain recorded as QEMU-proven; remaining items (intermittent reactor
startup race, slow TT-path Evaluate Context) noted.
2026-07-19 19:55:27 +09:00
vasilito e55e0f186b docs: P3-A runtime validation — hub chain proven, hub-child gap recorded
USB-IMPLEMENTATION-PLAN.md P3-A: record the 2026-07-19 QEMU runtime
validation (test-usb-hub-qemu.sh) — full usbhubd chain proven
(descriptor, EP1 change detection, initial scan, debounce, reset to
port-enable), the five latent bugs it surfaced and that were fixed
(scheme attach bootstrap, bitmap off-by-one, missing initial scan,
unbounded EP1 wait, debounce clear deadlock), QEMU's ClearPortFeature
stall handled gracefully by P2-C recovery, and the remaining gap:
hub-child device enumeration (usb-kbd to HID driver) blocked on
xhcid's hub-child attach path (debug-level; TT/route investigation)
plus an intermittent xhcid IRQ-reactor startup race.

HARDWARE-VALIDATION-MATRIX.md: hub row to QEMU-validated for the
enumeration chain, with the hub-child gap noted.
2026-07-19 11:17:21 +09:00
vasilito ba46a4c715 base fork sync (upstream 59cf8189) + P3-B/C doc closure + hub proof script
Base fork:
- Merged upstream/main 59cf8189 (13 upstream commits) into submodule/base
  as 9bbdc2ca; 3 conflicts resolved by hand (irq_reactor.rs process_one_event
  refactor + SPURIOUS_REBOOT reapply; randd simplification + fcntl reapply;
  Makefile /dev symlink block). verify-fork-functions gate now passes for
  base. kernel (11 fns) and relibc (2 fns) remain behind upstream — tracked
  as T-7d82cf6f / T-a5699340 / T-f5b7a0ea for dedicated sessions.
- Also landed earlier: upgrade-forks.sh cd-back bug fix (7e7ef73a).

Docs:
- P3-B marked COMPLETE (premise was stale: usbhubd is interrupt-driven
  with polling fallback today).
- P3-C marked hub-side COMPLETE (PortIndicator set in event loop);
  keyboard LED sync remains P5-C scope.
- README USB/Bluetooth row upgraded from red/in-progress to reflect
  P2-A/B/C + P3-A/B/C reality.

Validation:
- New test-usb-hub-qemu.sh (P8-B): boots QEMU with usb-hub + usb-kbd
  behind it, validates usbhubd spawn, 8-port descriptor read, change-
  detection mode, HID registration behind the hub, no panics. Cannot
  run until kernel+relibc syncs unblock the image build.
2026-07-19 05:48:45 +09:00
vasilito bfd56bac7e usb: P3-A complete — Linux hub.c enumeration state machine in usbhubd
Track base pointer to bd379e07 (usbhubd debounce/reset-wait/U0-wait/
wHubDelay + SET_ISOCH_DELAY, HubDescriptorV3 device_removable fix).

USB-IMPLEMENTATION-PLAN.md: P3-A marked CORE COMPLETE with the full
Linux equivalence inventory and documented follow-ups (USB 2.0 bitmaps,
SS.Inactive warm-reset loop, multi-TT, hub LPM). Hub gap-table row
updated (249 -> ~700 LoC with Linux state machine).

HARDWARE-VALIDATION-MATRIX.md: hub row updated — enumeration core
complete with 14 unit tests; runtime hub proof tracked under P8-B.
2026-07-19 00:28:29 +09:00
vasilito efd745c073 docs: USB/quirks/low-level doc consolidation + P2-C recovery completion
Documentation pass (staleness audit across 5 docs):

USB-IMPLEMENTATION-PLAN.md:
- P2-A marked COMPLETE (canonical 51-flag table in redox-driver-sys,
  ~85 entries, real HCIVERSION reads, BROKEN_MSI pre-gate)
- P2-C marked CORE COMPLETE: full 36-code recovery matrix documented
  (maybe_recover_transfer_error scheme.rs:559-925) with Linux xhci-ring.c
  equivalences, restart_endpoint bug fixes, known simplifications, and
  remaining P8-C injection-test scope
- Gap table corrected (quirks done, error recovery core done, PM substrate)
- P7-A corrected: HLC lives in Supported Protocol capability port_info
  DWORD, NOT HCCPARAMS1 (driver bug fixed in P2-B)
- §12 rewritten: runbook is live v3, not archived; lineage consolidated

IRQ-AND-LOWLEVEL-CONTROLLERS-ENHANCEMENT-PLAN.md:
- xHCI section rewritten: 'restored' -> hardened/gated (BROKEN_MSI
  pre-gate, quirk convergence, real HCIVERSION, handle/method agreement)
- Priority 6 refocused from 'keep path healthy' to runtime validation
  (BROKEN_MSI controller proof, event-ring under sustained load)
- 26 stale recipes/core/*/source paths -> local/sources/* fork paths
- duplicate ACPI-IMPROVEMENT-PLAN.md reference removed
- xhcid evidence class upgraded to quirk-hardened
- USB plan cross-reference added (feature ownership boundary)

QUIRKS-AUDIT.md:
- xHCI tombstone removed: lookup_xhci_controller_quirks_full is now a
  real implementation over XHCI_QUIRK_TABLE (was stub returning empty())
- 'broken TOML mappings' section marked RESOLVED (all 4 flag names now
  in PCI_FLAG_NAMES)
- Implementation-status section re-assessed: xhcid consumes 51-flag
  XhciControllerQuirkFlags in ~40 paths (was: only PciQuirkFlags)
- test inventory +38 xhci_table.rs tests

QUIRKS-SYSTEM.md:
- xhci_table.rs added to compiled-in tables inventory and file layout
- implementation status: canonical xHCI table row added (P2-A)
- driver consumption: xhcid xHCI-controller-path flag list documented

QUIRKS-IMPROVEMENT-PLAN.md:
- Task 3.1 (USB device quirks in xhcid) marked DONE (13 flags consumed)
- exit criteria 3/4/5/7 marked met; deliverables 1/3/4 completed
- reassessment summary updated for XhciControllerQuirkFlags consumption

Also: chmod +x test-xhci-irq-qemu.sh, test-msix-qemu.sh,
test-usb-storage-qemu.sh (were non-executable).

Track base pointer to 26000333 (P2-C restart_endpoint fixes).
2026-07-18 23:15:00 +09:00
vasilito d3e5fc0a82 usb: P2-B complete — HCCPARAMS2 capability gating in xhcid
Track base pointer to d20557f7 (xHCI 1.1+ feature gating: LEC/U3C/CIC
gates, HW LPM substrate with protocol-caps HLC detection, PORTPMSC
register-target fix, bogus HCCPARAMS1-HLC accessor removed).

Mark P2-B COMPLETE in USB-IMPLEMENTATION-PLAN.md with the full gating
inventory and Linux 7.1 cross-references. Per-device L1 enablement
(BESL, MEL Evaluate Context) explicitly deferred to P3 hub work.
2026-07-18 22:34:28 +09:00
vasilito fdcb2f5fbc fix: complete remaining Tier 1 messages and Tier 2 doc consolidation
Tier 1 message fixes (Part 5.3):
- M18/M19 (build-redbear.sh:523-524): reworded patch-application messages
  to reflect local fork model (forks have patches committed; recipe patches
  for non-fork recipes applied atomically by repo fetch)
- M46 (build-redbear.sh:923): 'immutable archives' → 'local forks'

Tier 2 doc consolidation (Part 7):
- GRUB-INTEGRATION-PLAN.md: updated all 'make all CONFIG_NAME=' commands
  to canonical './local/scripts/build-redbear.sh' equivalents
- SLEEP-IMPLEMENTATION-PLAN.md: archived (referenced 0.2.4 branch, pre-0.3.1)

Assessment doc Part 7 updated: all Tier 1 (items 1-6) and Tier 2 (items 7-13)
marked as verified complete with per-item status.

All Q1-Q10 quality improvement opportunities from Part 6.2 and all Tier 1-3
items from Part 7 are now resolved.
2026-07-18 17:44:16 +09:00
vasilito d9b2f69213 feat: build-system binary store integrity (per-pkgar BLAKE3 manifest + post-restore verify)
Q1 from assessment Part 6.2 — closes the largest robustness gap (Mechanism #2):
corrupt cached pkgar that passes mtime check was previously not detected
until runtime.

Publish side (repo_builder.rs):
- Accumulates BLAKE3 hash of each published file (pkgar, toml, dep_hashes,
  auto_deps) into a BinaryStoreManifest
- Writes <recipe>.manifest.toml alongside published artifacts in repo/

Restore side (cook_build.rs):
- BinaryStoreManifest struct with read() returning Result<Option<Self>, String>
  (same pattern as DepHashes: Ok(None) for missing = backward compat,
  Err for corrupt TOML = loud WARN + skip)
- After restoring from binary store, verifies each file's BLAKE3 against
  the manifest. On mismatch or missing file: WARN + all_restored=false
  (forces rebuild). Missing manifest = backward compatible (older cookbook
  published without one).

Helper (fs.rs):
- compute_file_blake3_hex(): 64KB chunked BLAKE3 hash, avoids loading
  entire pkgar into memory

Tests: 3 new (roundtrip, missing-file Ok(None), corrupt-TOML Err).
Total: 38/38 pass. cargo check clean. No new clippy warnings.

Assessment doc Part 6.2/6.3/7 updated: Q1-Q6 all marked resolved.
Auto-correction table updated: transient network failure (Q2 retry) and
corrupt cached pkgar (Q1 BLAKE3 manifest) moved from 'does NOT auto-correct'
to 'auto-corrects'.
2026-07-18 17:28:09 +09:00
vasilito 1528e04b09 docs: consolidate build-system docs + Tier 1 message fixes
Phase 2 of the build-system assessment:

Tier 1 (user-facing message fixes):
- mk/podman.mk: 'mk/config.mk' -> '.config' (the actual config location)
- mk/prefix.mk: vague 're-run the build' -> specific 'make prefix' guidance
- mk/virtualbox.mk: 'RedBearOS directory' -> 'Red Bear OS VM directory'
- src/bin/repo.rs: '{:?}' -> '{:#}' anyhow chain format + 'repo: ' prefix

Tier 2 (doc consolidation):
- Archive BUILD-SYSTEM-IMPROVEMENTS.md to local/docs/archived/ (self-labeled
  'HISTORICAL POST-MORTEM', no longer current).
- Add local/docs/BUILD-SYSTEM-ASSESSMENT-2026-07-18.md (459-line
  comprehensive assessment: architecture, quality, robustness, gaps).
- docs/README.md: refresh status note (2026-05-01 -> 2026-07-18, v4.0 ->
  v6.0); fix 'as an full fork' grammar.
- docs/07-RED-BEAR-OS-IMPLEMENTATION-PLAN.md: add status header noting
  canonical/secondary split vs CONSOLE-TO-KDE-DESKTOP-PLAN.md; fix grammar.
- HARDWARE.md: remove nonexistent PROFILE-MATRIX.md reference; repoint to
  README.md and the canonical desktop plan.
- local/docs/LOCAL-FORK-SUPREMACY-POLICY.md: 'currently 0.1.0' -> 'currently
  branch 0.3.1; legacy release archive at sources/redbear-0.1.0/'.
- local/docs/GRUB-INTEGRATION-PLAN.md: 'make all CONFIG_NAME=redbear-grub'
  -> canonical './local/scripts/build-redbear.sh redbear-grub'.
- recipes/AGENTS.md, recipes/core/AGENTS.md: replace upstream-Redox-pattern
  content with proper redirects to root AGENTS.md reflecting the local
  fork / path-fork model actually used by Red Bear.
- CONTRIBUTING.md: full rewrite for local fork workflow (Gitea, single-repo
  rule, path-fork model, patch governance, build-redbear.sh as canonical
  entry point, no AI attribution policy).
- README.md: add BUILD-SYSTEM-ASSESSMENT-2026-07-18.md to Documentation list.

Verified: cargo check (0 errors), cargo test --lib (35/35 passed),
cargo clippy (0 new warnings vs baseline).
2026-07-18 16:32:19 +09:00
vasilito c2f5bb09fc feat: build-system hardening (validate gate, cache safeguards, status sync)
Phase 1 remediation of the build-system assessment:

- Makefile: wire 'validate' target into build/live/reimage flows; surface
  lint-config and init-service validators as a first-class gate.
- mk/disk.mk: add 'validate' target running lint-config, init-service
  validator, and file-ownership validator; suppress noisy unmount warnings
  that masked real failures.
- mk/redbear.mk: add source-fingerprint tracking so integrate-redbear.sh
  re-runs when local/recipes, local/Assets, or local/firmware change.
- src/cook/cook_build.rs: atomic dep_hashes.toml write (tmp + rename) to
  prevent torn-write cache corruption; binary-store restore now checks
  dep_hashes before silent restore; fix production bug in
  collect_files_recursive that silently dropped subdirectories whose
  name matched an exclude pattern.
- src/cook/fetch.rs, src/cook/fetch_repo.rs: harden atomic patch
  application and protected-recipe gating.
- AGENTS.md, local/AGENTS.md, local/docs/COLLISION-DETECTION-STATUS.md:
  sync collision-detection status to 'implemented (Phase 15.0)' now that
  CollisionTracker is wired across all four installer layers
  (installer submodule pointer tracked separately in 13cc6fb0c3).

Verified: cargo check (0 errors), cargo test --lib (35/35 passed),
cargo clippy (0 new warnings vs baseline), make -n validate, make -n live.
2026-07-18 16:30:23 +09:00
vasilito 99e5641127 feat: release-bump pipeline + external graphics version sync
Pipeline (3 operator asks):
- bump-release.sh: canonical orchestrator (forks + sources + external)
- upgrade-forks.sh --to=<tag>: rebase forks with diverged-mode guard
- bump-graphics-recipes.sh: map-driven group-aware graphics bumps
- check-external-versions.sh: drift checker for Qt6/KF6/Plasma/Mesa/Wayland
- refresh-fork-upstream-map.sh: append-only map updater with --check
- post-checkout-version-sync.sh + install-git-hooks.sh: opt-in branch hook
- external_version_lib.py: shared version-parsing/bumping library
- external-upstream-map.toml: ~80 external package entries
- bump-fork.sh: deprecated (REDBEAR_I_KNOW_BUMP_FORK_IS_DEPRECATED=1)
- RELEASE-BUMP-WORKFLOW.md: operator runbook

Quality fixes (8 defects from two independent audits):
- blake2b stable cache keys (was hash(), non-portable)
- atomic cache writes via os.replace
- version_sort_key pre-release demotion (was sorting after finals)
- apply_ver_transform re.error tolerance
- grep || true (pipefail abort)
- cd failure detection in upgrade-forks
- sed URL escape (injection hardening)
- refresh-fork-upstream-map last-row drop fix

Doc cleanup:
- Archive 5 obsolete plans to local/docs/archived/
- Remove 14 stale/superseded docs
- Update 18 docs to reference bump-release.sh and fix inbound links
- TOOLS.md drift fixes
2026-07-18 14:45:41 +09:00
vasilito 79e7f24f00 docs: remove completed submodule-normalization handoff
The fork branch normalization it described is done — all local/sources forks are
on submodule/* branches (submodule/relibc, submodule/base, ... in active use).
Unreferenced one-time handoff; recoverable from git history if needed.
2026-07-18 03:11:56 +09:00
vasilito 7462574f3c docs: remove completed one-time doc-cleanup session log
SESSION-2026-07-13-DOC-CLEANUP.md was an explicitly-transient session handoff
log (marked not-edit-me) recording a past cleanup; its content is fully
historical. Durable records (post-mortems, policy, resolved-plan implementation
notes) are intentionally kept.
2026-07-18 00:36:56 +09:00
vasilito 441aba3d32 local/docs/SUBMODULE-NORMALIZATION-2026-07-13.md: operator handoff for fork branch normalization
6 of 9 local fork working-trees are on branches that violate local/AGENTS.md § "BRANCH AND SUBMODULE POLICY":
  - 4 forks on master (bootloader, libredox, redoxfs, userutils)
  - 2 forks on version-suffixed branches (installer, syscall)

Captures the exact 6-command fix, verification, and AGENTS.md policy citations. NO fallbacks, NO code changes — operator-only per "agents MUST NOT create new git branches" rule.

(NO AI attribution)
2026-07-14 12:41:17 +09:00
vasilito aec5a71096 local/docs/BLUETOOTH-IMPLEMENTATION-PLAN.md: fix deleted + wrong-path cross-refs
D7 validation: INPUT-SCHEME-ENHANCEMENT.md + PROFILE-MATRIX.md deleted
during cleanup but still referenced. Replaced with local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md (consolidation target).

(NO AI attribution)
2026-07-14 01:18:22 +03:00
vasilito ec9697f5d9 local/docs/DRM-MODERNIZATION-EXECUTION-PLAN.md: fix deleted + wrong-path cross-refs
D7 validation: 3 stale refs remained after cleanup.
- Removed DESKTOP-STACK-CURRENT-STATUS.md ref (file deleted)
- Removed docs/QUIRKS-IMPROVEMENT-PLAN.md ref (correct path is local/docs/)
- Verified all remaining refs resolve.

(NO AI attribution)
2026-07-14 01:18:21 +03:00
vasilito 757f5cfa53 local/docs/NETWORKING-IMPROVEMENT-PLAN.md: refresh fork SHAs to current HEADs
D7 validation found fork SHAs in this doc were stale vs the actual
local fork HEADs. Refreshed kernel/relibc rows to current; added
missing base row.

(NO AI attribution)
2026-07-14 01:18:10 +03:00
vasilito 88654e62c7 local/docs/SESSION-2026-07-13-DOC-CLEANUP.md: session-end state summary
Captures what was done this session (doc cleanup) and what carry-over issues remain (kernel fork at detached HEAD 2086faec with fix 22f5f622 in master; boot still fails at unit loading).

For handoff to next agent or operator.
2026-07-14 00:46:43 +03:00
vasilito 724923f6cc local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md: D6 follow-up cleanups
D6 verification flagged 3 stale remnants missed by the Round-12 cleanup pass. Per ground-truth:

- Line 155: relibc "active patches" is stale. Core recipes use PATCHED-VIA-PATH-FORK; 26 patch files in local/patches/relibc/ are reference/archived only.
- Lines 1832, 1902: qtbase 6.11.0 bumped to 6.11.1 to match README and actual fork state.

(NO AI attribution)
2026-07-13 19:47:44 +03:00
vasilito d367a86083 docs: sync archived inventory with current files
Round-7 audit found stale entries for files deleted by c04da4f031 and ecf1f19d55, plus missing entries for files still present in the archive. Rewrote the inventory to match the filesystem and added the 2026-07-13 sync note.
2026-07-13 19:43:56 +03:00
vasilito e8f35c9869 local/docs/BLUETOOTH-IMPLEMENTATION-PLAN.md: remove AMD-FIRST-INTEGRATION.md reference
Per ground-truth: AMD-FIRST-INTEGRATION.md was deleted. Replaced the cross-ref at line 91.
2026-07-13 19:42:01 +03:00
vasilito 338892d3ec local/docs/ACPI-IMPROVEMENT-PLAN.md: remove references to deleted plans
Per ground-truth: BOOT-PROCESS-ASSESSMENT.md, IOMMU-SPEC-REFERENCE.md, and LINUX-BORROWING-RUST-IMPLEMENTATION-PLAN.md are gone. Replaced with "(deleted)" markers. Lines 73-74 (duplicate BOOT-PROCESS-ASSESSMENT.md refs) collapsed to a single marker.
2026-07-13 19:41:55 +03:00
vasilito 67507071c0 local/docs/DRM-MODERNIZATION-EXECUTION-PLAN.md: remove references to deleted plans
Per ground-truth: AMD-FIRST-INTEGRATION.md, HARDWARE-3D-ASSESSMENT.md, DMA-BUF-IMPROVEMENT-PLAN.md were deleted during the P0 archive cleanup. Replaced each occurrence with "(deleted)" markers.
2026-07-13 19:41:47 +03:00
vasilito 041bdb9e72 local/docs/ECOSYSTEM-ADAPTION-POLICY.md: refresh version table
Per fork-upstream-map.toml + ground-truth section A:
  syscall       -> upstream 0.9.0     (was claimed 0.7.5)
  libredox      -> upstream 0.1.18    (was claimed 0.1.13)
  redoxfs       -> upstream 0.9.1
  redox-scheme  -> upstream 0.11.2    (was claimed 0.11.0)
  relibc        -> upstream 0.2.5
  kernel        -> upstream 0.6.0
  bootloader    -> upstream 1.0.0
  installer     -> upstream 0.2.42
  userutils     -> upstream 0.1.0

Updated lines 14-42 with current upstream versions. Line 32 claim about "no upstream consumer has migrated to 0.8.x" updated to reflect syscall fork is now on upstream 0.9.0.

(NO AI attribution)
2026-07-13 19:40:42 +03:00
vasilito c22569b28a docs: advance 0.3.0 to 0.3.1 2026-07-13 19:39:05 +03:00
vasilito 5805b18e9b docs: refresh fork state table
Lines 298-311 had 8 fork HEAD SHAs from 2026-07-07 (+rb0.3.0 era) that have since advanced. Per ground-truth section A:\n  base        4d09ab7f\n  bootloader  c78c3a6\n  installer   1e9dcde\n  kernel      22f5f622\n  libredox    b99b204\n  redoxfs     b78a791\n  relibc      11a1f8bc\n  syscall     6e4e5bd   (+rb0.3.1)\n  userutils   0dc0cb7\n\nAll forks now use +rb0.3.1 suffix. Line 311 "intentionally kept at +rb0.3.0" updated to "kept at +rb0.3.1".
2026-07-13 19:38:24 +03:00
vasilito c97a8c759c docs: remove dangling archived doc refs
Updated the live USB and threading plans to reference the restored live copies instead of deleted archived paths.
2026-07-13 19:28:13 +03:00
vasilito e784cbc988 docs: restore archived validation and quirks plans
Moved the two docs back under local/docs because live documentation still treats them as active references.
2026-07-13 19:27:51 +03:00
vasilito ffaa4c6bb4 phase 16.2: update docs for sync-versions.sh safe-by-default + --dry-run
- PATCH-PRESERVATION-AUDIT: add Phase 16.1 to cumulative reduction table
  (122→0 orphans, Round 17); update operator test section with all 6 modes;
  replace stale 'Round 3 final' re-run with current Round 17 verification
- TOOLS.md: add --regen and --dry-run flags; clarify default is opt-in
- HOOKS.md: add --regen and --dry-run to sync-versions.sh option list
2026-07-12 15:27:39 +03:00
vasilito a4adf22d29 phase 15.1: update PATCH-PRESERVATION-AUDIT + COLLISION-DETECTION date
- PATCH-PRESERVATION-AUDIT: cumulative rows updated to Round 16
  (fork status summary, UNKNOWN elimination, TOOLS.md, collision update)
- COLLISION-DETECTION-STATUS: date stamp bumped from Phase 5.5
  to Phase 14.1 / Round 15 to reflect the Phase 11.3 and 14.1 updates

Round 16 (Phase 15.x):
  - Phase 15.0: Baseline audit — 0 orphans, 0 collisions
  - Phase 15.1: Cumulative doc update
2026-07-12 13:58:16 +03:00
vasilito a529160c14 phase 11.3: update COLLISION-DETECTION-STATUS for Phase 5.1+8.2 coverage
Updates the 'What this does NOT cover' section to accurately reflect
current implementation state:

  - Item 1: [[package]].files now COVERED (Phase 5.1, 39 recipes)
  - Item 3: base dynamic paths now PARTIALLY COVERED (Phase 8.2,
    18 hardcoded paths from base's Makefile)
  - 162 total paths surveyed across installs + files + dynamic

Round 12 (Phase 11.x) work:
  - Phase 11.0: Baseline audit — 0 orphans, 0 collisions, all forks pass
  - Phase 11.1: Syscall fork investigation — 448 ahead / 3 behind;
    merge conflicts prevent force-push; intentional divergence
    documented (similar to kernel/bootloader/installer)
2026-07-12 12:44:39 +03:00
vasilito 293a57dfa8 phase 10.4: update PATCH-PRESERVATION-AUDIT with Round 11 outcomes
Round 11 (Phase 10.x) outcomes:
- Phase 10.0: Full audit — 0 orphans, 0 collisions, all forks pass
- Phase 10.2: Kernel fork-upstream-map tag fixed — was tracking
  nonexistent 0.5.12, now tracks 0.6.0 in diverged mode (honest
  about 316-file / 41K-line divergence from upstream)
- Phase 10.3: AGENTS.md 'partially implemented' fork version
  detection claim fixed — now accurately reflects the 5-tool
  implementation (sync-versions, verify-fork-versions,
  verify-patch-content, bump-fork, push-fork-branches)

Cumulative: 122 patches, 0 orphans (0%) — Round 11.
2026-07-12 12:26:12 +03:00
vasilito 40aa21fc8a phase 9.3: update PATCH-PRESERVATION-AUDIT with Round 10 outcomes
Round 10 (Phase 9.x) outcomes:
- Phase 9.0: Full state audit — 0 orphans, 0 collisions,
  all forks pass. Base fork had 1 small diagnostic commit
  (no patch impact).
- Phase 9.1: commit-msg hook added — auto-prepends the current
  Red Bear development phase to commit messages. Opt-in
  (copy to .git/hooks/commit-msg).
- Phase 9.2: HOOKS.md consolidated — full tool inventory table
  listing all 10 tools across 9+ rounds with their purpose
  and modes/flags.

Cumulative: 122 patches, 0 orphans (0%) — Round 10.
2026-07-12 12:21:05 +03:00
vasilito 87f3f908bf phase 9.1-9.2: add commit-msg hook + consolidate tool docs
Adds the commit-msg hook promised in HOOKS.md since Round 5.
The hook auto-prepends the current Red Bear development phase
(e.g. 'phase 8.4:') to commit messages. The phase is detected
from the most recent 'phase X.Y:' commit in the git log.

Hook behavior:
  - Normal commit    → prepended: 'phase 8.4: my message'
  - Already has prefix → skipped
  - Revert message   → skipped
  - Empty/comment    → skipped

Install: cp local/scripts/commit-msg .git/hooks/commit-msg && chmod +x

Updates HOOKS.md with:
  - commit-msg hook documentation (install, behavior)
  - Full tool inventory table (10 tools across 9+ rounds)
    listing each tool's type, purpose, and modes/flags
2026-07-12 12:20:29 +03:00
vasilito 3cbdad57e1 phase 8.4: update PATCH-PRESERVATION-AUDIT + fork-push-status doc for Round 9
Round 9 (Phase 8.x) outcomes:
- Phase 8.1: Legacy archive audit — 0 cross-archive duplicates,
  3 empty dirs removed (legacy-absorbed/base/redoxfs/userutils),
  97 superseded + 62 absorbed = 159 archived verified
- Phase 8.2: Collision detection now tracks base's dynamic build
  paths from Makefile (18 hardcoded entries: initfs, init.d,
  pcid.d, drivers). Source field shows 'build-dynamic'.
  Production: 162 paths surveyed, 0 collisions.
- Phase 8.3: New fork-push-status doc for Round 9
  (local/docs/fork-push-status/2026-07-12-Round-9-phase-8.3.md)
  documenting the operator's reversion of Round 5 pushes and the
  current deadlock state.

Updated:
- PATCH-PRESERVATION-AUDIT cumulative reduction table: added
  After Phase 8.2 row
- README.md fork-push-status link updated to Round 9 doc

Cumulative: 122 patches, 0 orphans (0%) through 9 rounds.
2026-07-12 12:13:42 +03:00
vasilito bcde4a9e0c phase 7.6: update PATCH-PRESERVATION-AUDIT + README for Round 8
Round 8 (Phase 7.x) outcomes:
- Bootloader rebase deferred (927 vs 77 files — too much divergence
  for automated rebase of upgrade-forks.sh). Documented as permanent
  divergence with clearer fork-upstream-map.toml comment.
- patch-status.sh added (Phase 7.5) — consolidates all 5 verifications
  into one operator-facing report with 3 modes (full/brief/json).
  Takes 30-120s.
- Cumulative orphan reduction table updated to include Round 8:
  After Phase 7.5: 122 patches, 0 orphans (0%)

Updated PATCH-PRESERVATION-AUDIT cumulative reduction table to
reflect the Round 8 state and the new patch-status.sh tool.
2026-07-12 11:53:41 +03:00
vasilito 89c20e281e phase 6.6: update PATCH-PRESERVATION-AUDIT with Round 7 outcomes
Updates the cumulative reduction table with Phase 6.3-6.5 results:
- Phase 6.3 local-patches archive structure documented (Round 7)
- Phase 6.4 operator-decision automation (--report action)
- Phase 6.5 selftest with 5 regression cases

Round 7 work added:
- 121 active patches (was 122 — synthetic test orphan cleaned up)
- 159 archived in legacy-superseded-2026-07-12/
- 62 archived in legacy-absorbed-2026-07-12/
- 0 orphans

Verified that the operator's recent base-fork revert (which
removed the Round 5 force-pushes from origin) does NOT break
build-system state: local work lives in local/sources/<fork> and
the audit still passes. Base fork push STILL DEADLOCKED at the
gitea receive.shallowUpdate level; operator-side fix via
unblock-base-push.sh path-a/b/c.
2026-07-12 11:04:21 +03:00
vasilito 4a440131d9 phase 5.6: update PATCH-PRESERVATION-AUDIT + README for Round 6
Updates the audit doc to reflect Round 6 (Phase 5) outcomes:
- 122 active patches (was 119 in Round 5)
- Cumulative: 6 patches re-extracted from legacy-absorbed for test
  recipes (Phase 5.2: relibc-tests/recipe.toml and
  relibc-tests-bins/recipe.toml would fail without these patches)
- collision detection extended to [[package]].files (Phase 5.1)
- 8 regression tests added (Phase 5.4)
- base-fork push deadlock helper created (Phase 5.3)

Updates README.md Documentation list to point at:
- HOOKS.md (Phase 4.5)
- fork-push-status/ (Phase 4.1/5.3)

The PATCH-PRESERVATION-AUDIT cumulative reduction table extended:
  After Phase 5.2: 122 patches, 0 orphans (0%) — Round 6

Out-of-scope for Phase 1/2/3/4/5:
  - base fork push STILL DEADLOCKED (Phase 5.3 added operator-side
    helper at local/scripts/unblock-base-push.sh with 3 paths)
  - Collision detection extension #4 marked DONE in Phase 5.1
2026-07-12 10:22:00 +03:00
vasilito 23b7722ab6 phase 5.5: polish COLLISION-DETECTION-STATUS for Phases 5.1+5.4
Updates the doc to reflect the 2 follow-on improvements to
collision detection:

- Phase 5.1 added 'recipe files' source (handles the 39 recipes
  with [[package]].files dict). Out-of-scope #1 in this doc
  marked as DONE.

- Phase 5.4 added --selftest mode with 8 regression cases wired
  into the pre-push hook. Future-work item #4 added for property-
  based fuzzing (e.g. hypothesis).
2026-07-12 10:19:49 +03:00
vasilito a07cfabce8 phase 4.6: update PATCH-PRESERVATION-AUDIT with Round 5 outcomes
Round 5 (Phase 4.x) additions to the cumulative audit:

- Phase 4.0 fork-branch push: 6 forks advanced to origin
  (installer, kernel, syscall via --strict=0-behind; libredox,
   userutils, relibc via force-push with --force-with-lease).
- Phase 4.3 patch-loss catch: P0-canary + P5-context-mod-sched
  archived as operator-superseded (operator's recent cleanup
  commits 66a5243f and dc51e67d made them obsolete).
- Phase 4.1 fork-branch deadlock: base fork could not be pushed
  due to gitea receive.shallowUpdate=true. Documented in
  local/docs/fork-push-status/2026-07-12-Round-5-phase-4.1.md.

Updated cumulative reduction table:
  Round 0: 251 patches, 144 orphans (57%)
  After Phase 1.0A: 96 orphans (38%)
  After Phase 2.1: 27 orphans (15%)
  After Phase 3.0-3.2: 0 orphans (0%) ← Round 3 closed
  After Phase 4.3: 0 orphans (0%) ← Round 5 still 0

New 'Out-of-scope' entries:
  - base fork push deadlock (operator-side gitea config fix)
  - Collision detection extension (currently only checks
    [[package]].installs, not [[package]].files; doesn't trace
    dynamic file generation)
  - Pre-receive server-side hook (defense in depth; gitea admin
    permission required)

Also add brief mention of Phase 4.2 (collision detection) and
Phase 4.5 (pre-push hook) governance additions.
2026-07-12 09:40:38 +03:00
vasilito a1613c0590 phase 4.5: add pre-push-checks.sh opt-in hook + HOOKS doc
Per AGENTS.md 'Daily-upstream-safe workflow', drift between fork
state and active patch system can only be caught at next-build time.
This commit closes the gap by providing a pre-push hook that runs
the 4 critical pre-flight checks BEFORE pushing to origin.

The hook runs (in order):
  1. sync-versions.sh --check (Cat 0 + Cat 1 + Cat 2 versions)
  2. verify-fork-versions.sh (Cat 2 fork supremacy)
  3. verify-patch-content.py (no orphan patches)
  4. verify-collision-detection.py (no config-vs-package conflicts)

Per AGENTS.md 'absolutely NEVER DELETE, NEVER IGNORE' rule, the hook
is OPT-IN: operators must explicitly install it via
  cp local/scripts/pre-push-checks.sh .git/hooks/pre-push
  chmod +x .git/hooks/pre-push

The opt-in nature respects operator autonomy — local hooks do not
propagate (each clone must re-install), and false positives would
block legitimate pushes.

HOOKS.md documents the available hooks + future work (pre-receive
on server side for defense in depth; commit-msg hook for auto-phase
prefix in commit messages).

Default mode of the script: fail on any drift (exit 1). Use
--soft flag or REDBEAR_SKIP_PRE_PUSH=1 to bypass.
2026-07-12 09:38:12 +03:00
vasilito dbcff12184 phase 4.2: implement general package-vs-config collision detection
Per AGENTS.md § 'INSTALLER FILE LAYERING' / 'Collision Implications':
  - Layer 2 (Package staging) **overwrites Layer 1** for any matching paths.
  - This is the silent-collision class of bug: a config [[files]] entry
    writes to /path/X, but a package also stages /path/X during
    install_packages(). Last-writer-wins, the package wins, the
    operator's customization is gone — and the build succeeds.

Phase 0 audit confirmed that AGENTS.md's promise of a CollisionTracker
in src/cook/collision.rs was false (the file doesn't exist). Phase 4.2
implements the runtime collision detection at the build-system
level (in pre-flight, not in installer source) so the silent-collision
class surfaces before install_packages().

New file: local/scripts/verify-collision-detection.py
- Parses every recipes/<cat>/<pkg>/recipe.toml's [[package]].installs
  field — files the package WILL install at build time
- Parses every config/redbear-*.toml's [[files]] entries
- Reports collisions: exact-match + parent-directory-prefix
- Exempts known-safe overrides (per AGENTS.md 'Init Service File
  Ownership'): /etc/init.d/*, /etc/environment.d/*

Initial result (2026-07-12):
  - 68 recipe installs surveyed
  - 165 config [[files]] entries surveyed
  - 0 collisions

Wired into local/scripts/build-preflight.sh via:
  - Default: report-only
  - --strict: exit 1 on collision (for CI)
  - REDBEAR_SKIP_COLLISION_CHECK=1: bypass entirely

Updated local/docs/COLLISION-DETECTION-STATUS.md with:
- Phase 4.2 implementation summary
- How the algorithm works
- What it does NOT cover (runtime conflicts, patch-induced, dynamic
  generation)
- Recovery options
2026-07-12 09:36:54 +03:00
vasilito 831d3db8b1 phase 4.1: add fork-push-status doc (Phase 4.0 push results + base deadlock)
After running local/scripts/push-fork-branches.sh --execute in
Phase 4.0, 6 forks were successfully force-pushed:

  installer, kernel, syscall, libredox, userutils, relibc

Each push used --force-with-lease=<old-sha> to prevent clobbering
concurrent work. All target refs now reflect Round 0-4 work rather
than the abandoned +rb0.2.5/+rb0.3.0 upstream-tracking era.

Base push BLOCKED by gitea's receive.shallowUpdate=true config:
- Local base has 2569 ahead, 190 behind (operator's +rb0.2.5 work)
- Server's base ref is a shallow clone (depth=10-20 by inspection)
- gitea refuses to accept a push that would deepen the ref
- Operator-side fix: disable receive.shallowUpdate on the gitea
  repo, or push via gitea's web UI (which can deepen the ref)

Bootloader push DEFERRED (Phase 2.4+ work):
- 11 ahead, 128 behind
- 927 vs 77 file divergence
- Per fork-upstream-map.toml, bootloader is marked 'diverged' for a
  reason — needs upgrade-forks.sh bootloader manual run

The new doc at local/docs/fork-push-status/2026-07-12-Round-5-phase-4.1.md
records:
- Per-fork push status (before/after)
- Origin SHA -> Local SHA transitions
- Per-fork push reason
- The base deadlock explanation
- The bootloader deferral plan
- Audit notes confirming the parent gitlinks are now correct
2026-07-12 09:31:08 +03:00
vasilito d0c519e4ef phase 3.4: update PATCH-PRESERVATION-AUDIT with Round 3 outcomes + operator testing cookbook
- Cumulative orphan reduction table extended:
    Round 0: 144 orphans (57%)
    ...
    After Phase 3: 0 orphans (0%) — Round 3 cleanup

- Phase 3 details:
  * 67 absorbed/ files moved to legacy-absorbed-2026-07-12/
  * 4 file-restructured SUPERSEDED cases documented
  * 10 no-target-file SUPERSEDED cases
  * 2 INTEGRATED-via-diff-commit cases
  * 35 dangling symlinks removed

- 100% patch preservation achieved: every patch in
  local/patches/<comp>/ corresponds to substantive content in
  the matching fork source tree.

- Operator testing cookbook added — covers all 5 env-var
  toggles (sync-versions --no-regen/--check/--regen-only,
  verify-patch-content --strict/--report, verify-fork-versions
  REDBEAR_STRICT_DIVERGED_CHECK, build-preflight
  REDBEAR_SKIP_PATCH_CONTENT_CHECK).

- Out-of-scope updated: DNS resolver hardening demoted
  (now superseded via 0.6.0 upstream converge).

- Audit re-run section shows current clean state:
    verify-patch-content.sh: 0 orphaned / 121 preserved (100%)
    verify-fork-versions.sh: passes (3 advisory)
    sync-versions.sh --check: clean
    REDBEAR_STRICT_DIVERGED_CHECK=1 properly returns exit 1
2026-07-12 02:32:21 +03:00
vasilito c3baf7ca84 phase 2.6: update PATCH-PRESERVATION-AUDIT with Phase 1+2 results
Updated audit doc with the cumulative outcome of Phase 0 through 2.4:

  Round 0 (start):     251 patches, 144 orphans (57% at risk)
  After Phase 1.0A:     96 orphans (38%) — 48 recovered
  After Phase 2.1:      27 orphans (15%) — 69 archived
  After Phase 2.2:      20 orphans (12%) — manual deep review

Also documents:
- Phase 1 round: kernel banner fix, acpi_ext + S3 wiring
- Phase 2.3: orphan-patch decision tree in AGENTS.md
- Phase 2.4: verify-fork-versions.sh bug fix + 'diverged' mode
- Out-of-scope Phase 2.4+: bootloader rebase, DNS hardening, fork
  branch pushes (operator-only per AGENTS.md policy)
2026-07-12 02:18:56 +03:00
vasilito 0073f6e230 phase 1.6: sync doc version references from 0.1.0/0.2.5 to 0.3.1
The build system had multiple authoritative docs claiming 'Red Bear
OS 0.1.0 (baseline)' and 'branch 0.2.5' long after the working
branch advanced to 0.3.1. Operator confusion was inevitable:
- 'repo --version' showed 0.2.5 (root Cargo.toml drift, fixed G2)
- AGENTS.md said rust-toolchain = nightly-2025-10-03 (actual
  nightly-2026-05-24)
- local/AGENTS.md example versions all said 0.2.5 (should be 0.3.1)
- README.md and docs/* claimed 'baseline 0.1.0' on the current
  branch (which has 0.3.1 forks as the source of truth)

This commit syncs the docs to reality without rewriting historical
content where the 0.1.0 reference is genuinely about the legacy
release archive at sources/redbear-0.1.0/ (which DOES exist and
serves the release-mode fallback per BUILD-SYSTEM-SETUP).

The 0.1.0 release-archive references are preserved with explicit
'legacy' annotations because that archive IS the durable record
of the old overlay-patch approach and is used by
restore-sources.sh --release=0.1.0 in fallback build paths.

Updated across:
- AGENTS.md (root): toolchain, current baseline phrasing
- local/AGENTS.md: example versions 0.2.5->0.3.1, RELEASE MODEL
  clarified that current source-of-truth is local/sources/ forks
- README.md: branch refs 0.2.5->0.3.1
- docs/06-BUILD-SYSTEM-SETUP.md: baseline 0.1.0->0.3.1
- local/docs/UPSTREAM-SYNC-PROCEDURE.md: baseline clarified
- local/docs/LOCAL-FORK-SUPREMACY-POLICY.md: snapshot phrasing
- local/docs/CUB-PACKAGE-MANAGER.md: archive context clarified
2026-07-12 01:45:53 +03:00
vasilito 4a37ae1a57 phase 1.2: move 137 legacy .patch symlinks out of path-source recipes
Per AGENTS.md § 'Local Fork Recipe Directories Must Not Carry Patch
Files', the symlinks under recipes/core/{base,kernel,relibc,
bootloader,installer}/ pointing at the canonical local/patches/<comp>/
patches were violations. The recipes use path = '...' source so the
cookbook would never apply these patches; the symlinks were a
navigation aid only.

This commit moves all 137 valid symlinks (and the redox.patch
counterparts) to local/docs/legacy-recipe-patches/<comp>/ with a
README explaining the rationale and pointing readers at the canonical
patch location.

The patches themselves (local/patches/<comp>/*.patch) are NOT
modified — they remain git-tracked at their canonical location.
Per AGENTS.md 'NEVER DELETE' policy the patches stay in their
canonical home; only the navigation aid symlinks are relocated.

Breakdown:
  base (61)         - legacy-recipe-patches/base/
  kernel (26)       - legacy-recipe-patches/kernel/
  relibc (46)       - legacy-recipe-patches/relibc/
  bootloader (3)    - legacy-recipe-patches/bootloader/
  installer (1)     - legacy-recipe-patches/installer/

After this commit, recipes/core/<comp>/.patch references all show
zero matches per AGENTS.md rule.
2026-07-12 01:35:58 +03:00