Skip to content

Conversation

@dobrac
Copy link
Contributor

@dobrac dobrac commented Nov 5, 2025

Note

Revamps header mapping normalization to be non-mutating, adds strict/soft validation with version gating, bumps metadata version to 3, and wires validation into sandbox and inspect tool.

  • Storage/Header:
    • Normalization: Reimplement NormalizeMappings to return a new, non-mutating merged list using BuildMap.Copy(); merges only adjacent same-BuildId ranges.
    • Validation & Safety: Add NormalizeFixVersion and Header.IsNormalizeFixApplied(); enforce bounds/alignment and negative-length checks in GetShiftedMapping/getMapping with errors for v3+ and warnings for older headers.
    • Version: Bump metadataVersion to 3 in serialization.go.
    • Tests: Add comprehensive tests for NormalizeMappings edge cases.
  • Orchestrator:
    • Sandbox snapshotting: After building memfile/rootfs headers, call header.ValidateMappings; fail for v3+, otherwise log warnings with build ID.
    • CLI (inspect-header): Run ValidateMappings on deserialized header and print warning if invalid.

Written by Cursor Bugbot for commit 9290e96. This will update automatically on new commits. Configure here.

@dobrac dobrac added the bug Something isn't working label Nov 5, 2025
Copy link
Member

@ValentaTomas ValentaTomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for resolution of hard/soft checks, but otherwise, LGTM.

@dobrac dobrac merged commit 935281c into main Nov 5, 2025
27 checks passed
@dobrac dobrac deleted the fix-headers branch November 5, 2025 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants