Commit Graph

11 Commits

Author SHA1 Message Date
vasilito 65e47b62a6 phase 14.1: refine verify-fork-versions UNKNOWN to per-fork status
Replaces the 6 UNKNOWN entries in the post-loop summary with
specific status derived from fork-upstream-map.toml when the
main loop doesn't set a per-fork status.

Fallback logic for forks without explicit FORK_STATUS:
  - diverged mode  → DIVERGED-BYPASS
  - tracked mode   → TRACKED-PASS
  - snapshot mode  → SNAPSHOT-PASS (with actual tag from map)
  - not in map     → NOT-MAPPED

This makes every fork's status visible at a glance:
  === Post-verification fork status ===
  bootloader    DIVERGED         mode=diverged; content check skipped
  installer     DIVERGED         mode=diverged; content check skipped
  kernel        DIVERGED         mode=diverged; content check skipped
  libredox      PASS             content matches upstream 0.1.18
  base          TRACKED-PASS     tracked-fork, version label passed
  redoxfs       SNAPSHOT-PASS    snapshot fork, version label 0.9.1
  relibc        SNAPSHOT-PASS    snapshot fork, version label 0.2.5
  ...

Bug fix: upstream_tag variable was stale from the last loop
iteration. Now reads the correct tag from fork-upstream-map.toml.
2026-07-12 13:53:57 +03:00
vasilito d4ff72d9a6 phase 13.1: add post-loop fork status summary to verify-fork-versions.sh
Per assessment G2 from Round 11: verify-fork-versions.sh silently
skipped content checks for forks whose upstream tags don't exist,
making failures invisible. This adds a post-loop summary table
that enumerates each fork's verification status.

Added per-fork status tracking:
  - DIVERGED:       fork in diverged mode (content check skipped)
  - NO_UPSTREAM_TAG: upstream tag doesn't exist (content check skipped)
  - PASS:           content matches upstream tag
  - SKIP:           no Cargo.toml (not a tracked fork)
  - UNKNOWN:        not yet classified (future refinement)

The summary table prints after the per-fork warn/error output,
giving operators a single-view snapshot of all 10 forks:

  === Post-verification fork status ===
  fork          status              detail
  ----------    ----------------    ------
  base          UNKNOWN             not checked
  bootloader    DIVERGED            mode=diverged; content check skipped
  installer     DIVERGED            mode=diverged; content check skipped
  kernel        DIVERGED            mode=diverged; content check skipped
  libredox      PASS                content matches upstream 0.1.18
  ...

Bug fix: added cd "$ROOT" before post-loop summary because the
per-fork content-check loop cd's into each fork directory.
2026-07-12 13:48:20 +03:00
vasilito 4ac665b288 phase 2.4: boilerplate fixes — diverged mode + liibredox .gitignore
Build system improvements after Phase 2.0 / 2.1 / 2.2 patch work:

1. New 'diverged' mode in local/fork-upstream-map.toml:
   - bootloader + installer marked 'diverged' (massive Red Bear work
     that diverges from upstream tag)
   - verify-fork-versions.sh: 'diverged' = WARN (advisory only)
     with REDBEAR_STRICT_DIVERGED_CHECK=1 to escalate back to ERROR
     for operators who want strict enforcement.

2. Bug fix in verify-fork-versions.sh (Phase 2.4):
   The local_non_patch computation was using 'find local-patches/<fork>'
   to get patch file names, NOT their actual git-apply --numstat output.
   Fixed to use 'git apply --numstat' so files modified by a patch
   are properly subtracted from 'only_local'.

3. Per-fork declarative expected-differ list:
   - libredox: src/lib.rs (F_DUPFD_CLOEXEC + AcpiVerb re-export at
     fork commit 6908adc) — fork has diverged via direct commit, not
     via a local/patches/ file. Algorithm now recognizes this as
     INTEGRATED.
   - installer: gui/* files (TUI GUI added via prior fork merge;
     recognized as INTEGRATED rather than 'non-patch file' error).

4. libredox fork cleanup:
   - Removed .cargo-ok + .cargo_vcs_info.json from tracking (cargo
     metadata that should be in .gitignore, not source control)
   - Added /Cargo.lock to .gitignore (matches upstream .gitignore)
   - This unblocks verify-fork-versions.sh for libredox 0.1.18.

After this commit:
- bash verify-fork-versions.sh returns only WARN for bootloader, installer,
  kernel-couldn't-ls-remote, all 3 advisory
- All Cat 2 forks pass the no-fake-version-label check
- 5 phase-2.4 forks tracked correctly
2026-07-12 02:16:15 +03:00
vasilito 79285e4ebf verify-fork-versions.sh: add per-fork upstream content fingerprint cache
When the upstream commit hash of the claimed upstream tag has not changed
since the last successful verify, reuse the cached file list instead of
re-cloning and re-hashing from scratch. This makes the canonical preflight
fast on the common case where upstream didn't move.

Cache is stored in .redbear-fork-verify/<fork>-<tag>.fingerprint. Touched
only after a successful full content diff, so cache corruption is detected
on the next run (commit hash mismatch triggers fresh clone).
2026-07-12 00:33:52 +03:00
vasilito 9bbc38fe60 build tools: gnu-grep 3.1→3.12, libsodium 1.0.16→1.0.22, autoconf 2.71→2.73
Live upstream versions verified 2026-07-11:
- gnu-grep 3.12 (2025-04-10)  -- https://ftp.gnu.org/gnu/grep/
- libsodium 1.0.22-stable (2026-07-08) -- https://download.libsodium.org/libsodium/releases/
- autoconf 2.73 (2026-03-20)  -- https://ftp.gnu.org/gnu/autoconf/

Each recipe updated with new tar URL + BLAKE3 hash. Build-tool upgrades are
isolated from the fork content-verification system, so these are SAFE to
upgrade without the relibc-style risk.

diffutils was already at 3.12 (previously committed).

Also: fork-upstream-map.toml — bootloader flagged PENDING_REBASE
(2026-07-11 detection: 1.0.0 tag mismatch, fork based on 0.1.0 archive
not a true rebase — documented inline).
2026-07-11 02:26:10 +03:00
vasilito 7d134eef37 verify-fork-versions.sh: remove snapshot content-skip, add base fork to map
Context: A relibc fork check via cargo compare exposed that the fork
labeled 0.6.0 (matching a 2020-12-23 upstream tag) was on a
completely different codebase from upstream master. The fork was
imported as a snapshot. The verify-fork-versions.sh tool allowed
this because 'snapshot' mode skipped byte-for-byte content comparison.

Changes:
1. Remove 'snapshot = skip content check' behavior. All Cat 2 forks must
   pass actual content comparison against their claimed upstream tag.
2. Add base to local/fork-upstream-map.toml so it's checked too (was missing).

Effect: Future 'fake version label' divergences (Cargo.toml says
version X but source content does not match upstream X) will be
caught by the preflight check instead of slipping through build.
2026-07-11 01:49:12 +03:00
vasilito b4fc7d9869 verify-fork-versions: fix patch file parsing to use --numstat 2026-07-06 15:08:41 +03:00
vasilito 54de45d461 docs/scripts: enforce single-repo policy and +rb build-metadata suffix
- Update AGENTS.md single-repo rule to explicitly forbid creating any new
  Gitea repositories and to require deleting per-component repos.
- Change version suffix policy from pre-release -rb to build-metadata +rb
  in AGENTS.md, sync-versions.sh, apply-rb-suffix.sh, verify-fork-versions.sh.
- Update migration instructions to push to existing submodule/<component>
  branches inside RedBear-OS, not create new repos.
- Update BUILD-SYSTEM-IMPROVEMENTS.md and SLEEP-IMPLEMENTATION-PLAN.md to
  reference submodule/* branches instead of defunct per-component repos.
- Fix delete-per-component-repos.sh example to use a real historical repo.
2026-07-05 22:50:33 +03:00
vasilito b8aac3c9bc D7: editor multi-cursor support
Add secondary_cursors field to Editor with insert_char_multi,
delete_back_multi, delete_forward_multi methods. Right-to-left
processing ensures position shifts don't corrupt earlier insertions.

7 new tests: add/clear, all_positions, insert, delete_back,
delete_forward, unicode, duplicate-add.
2026-07-05 22:29:19 +03:00
vasilito b66a9e509e policy: mark bootloader fork as PENDING_REBASE
The local bootloader fork claims to be upstream 1.0.0 + Red Bear
patches, but the patches in local/patches/bootloader/ do NOT
apply cleanly to upstream 1.0.0. The fork was originally a 0.1.0
baseline with substantial additions that pre-date the upstream-1.0.0
refactor.

Changes:

  * local/fork-upstream-map.toml: set bootloader's upstream tag to
    PENDING_REBASE. The verifier recognises this as a deliberate
    state marker (a fork whose rebase is in progress) and refuses
    the build with a clear error pointing the user to the rebase
    procedure documented in the map.

  * local/scripts/verify-fork-versions.sh: when a fork is marked
    PENDING_REBASE in the map, the script reports a dedicated error
    message instead of running the upstream content comparison (which
    would always fail for a fork in this state).

The current state of the build is:
  * 5 of 6 `-rb1` Cat 2 forks pass the no-fake-version-label
    check (redoxfs, redox-scheme, kernel, installer, userutils).
  * bootloader refuses to build until a real rebase onto a chosen
    upstream tag is completed (the patches must apply cleanly with
    --fuzz=0).
  * installer has additional divergent content that may need a
    rebase too (separate operational task).

This is the strict enforcement the user asked for. The build
cannot proceed silently with fake labels. The user must drive
the rebase work for bootloader (and installer) following the
procedure in fork-upstream-map.toml.
2026-07-05 05:15:27 +03:00
vasilito f7c3d504dd policy: enforce no-fake-version-label rule for Cat 2 forks
Per local/AGENTS.md \xC2\xA7 'No-fake-version-label rule':

  Every Cat 2 fork version MUST match the source content from the
  corresponding upstream release + documented Red Bear patches.
  A `-rbN` label on stale content is a fake label and a policy
  violation.

Changes:

  * local/AGENTS.md: documented the no-fake-version-label rule,
    including what counts as a fake label, the enforcement contract,
    and what a real Red Bear fork looks like.

  * local/fork-upstream-map.toml: authoritative mapping of each
    Cat 2 fork (syscall, libredox, redoxfs, redox-scheme, relibc,
    kernel, bootloader, installer, userutils) to its upstream Git
    URL and release tag.

  * local/scripts/refresh-fork-upstream-map.sh: auto-update the
    fork-upstream-map by querying each upstream repo for the
    current latest stable release tag.

  * local/scripts/verify-fork-versions.sh: preflight enforcement
    script. For each Cat 2 fork with a `-rbN` version field:
      1. Compare fork's file list and content against the upstream
         release tag from the map. Reject the build if files are
         missing (would be a fake label).
      2. Reject the build if files exist in local that don't exist
         in upstream (must be moved to local/patches/<fork>/ as
         documented Red Bear patches).
      3. Reject the build if shared files diverge in content.

  * local/scripts/apply-rb-suffix.sh: invokes
    verify-fork-versions.sh after applying the `-rbN` label so the
    build fails fast if the labelled content is fake.

  * local/scripts/build-preflight.sh: invokes
    verify-fork-versions.sh at the start of every build. Bypassed
    only with REDBEAR_SKIP_FORK_VERIFY=1 (emergency only).

  * local/patches/bottom/0001-ratui-0.30-braille-compat.patch: the
    ratatui 0.30+ compatibility shim for bottom 0.11.2.

This is the structural enforcement that prevents fake labels from
ever reaching the build again. The current 6 forks with `-rbN`
labels are flagged by the verifier — they must be rebased onto
their actual upstream release before the build can succeed.
2026-07-05 02:37:54 +03:00