[FEATURE] Select Git history depth for native source acquisition #604

Open
opened 2026-11-08 14:33:06 +01:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Native artifact preparation fetches all reachable Git history even when its recipe selects one exact source commit. Profiling measured eight canonical fetches at 33.6 seconds. A later original-budget build completed compilation but expired during its required source comparison. Source trees and durability checks must remain complete.

Proposed behavior and scope

Add an explicit optional history-depth policy to the original source acquisition request. Keep existing history behavior when absent. A selected finite depth is passed to the genuine canonical Git fetch; native source-only recipes may explicitly select depth one when they need the complete selected tree rather than its history. Propagate the policy through the maintained catalog acquisition path and its declared recipe inputs. Do not change interactive repositories or silently change every caller's fetch policy.

Authority, security and reliability

Only the existing original source owner performs acquisition. A depth, commit name, shallow-file entry or successful Git command supplies no source authority. Preserve the canonical remote, exact commit/tree and source-byte checks, actual returned Git context, fsck/signature duties, durability, original clocks and positive process/forest retirement. Retain original and generated roots separately. Partial fetches, unexpected refs, changed shallow boundaries and uncertain cleanup remain failures; do not retry with broader history or discard mandatory source observations. Keep external toolchain recipes on their declared source semantics.

Acceptance criteria

  • Define and validate the optional policy; preserve absent-policy arguments and behavior.
  • Carry the policy from the original native recipe through canonical acquisition without path- or record-based owner reconstruction.
  • Exercise real full-history and depth-one acquisitions of the same selected tree; compare complete source contents and retained Git context.
  • Cover invalid policy, exact-commit refusal, shallow-boundary mutation, partial fetch and independent cleanup while preserving the first failure.
  • Document source/history semantics, provenance and compatibility; retain existing source-owner and native integration controls.
  • Measure a fresh original-budget native build with the explicit policy, retaining actual compile, post-check and retirement results before full image and guest acceptance.

Alternatives and tradeoffs

Removing file fsync duties or mandatory byte comparisons changes reliability and source custody. Increasing deadlines hides the measured preparation cost. Bounded history instead changes an explicitly selected data input while retaining the complete current tree. Recipes that derive version information from ancestry must request the history they need; shallow selection is not universally interchangeable with a full checkout.

Tracking and rollout

Build on the existing source-owner acquisition protocol and catalog compilation-input lifetime. Implement the optional policy first, then explicitly select it for compatible native source-only recipes. Preserve the default route and independently verify the changed source before another whole-image run.

## Problem and motivation Native artifact preparation fetches all reachable Git history even when its recipe selects one exact source commit. Profiling measured eight canonical fetches at 33.6 seconds. A later original-budget build completed compilation but expired during its required source comparison. Source trees and durability checks must remain complete. ## Proposed behavior and scope Add an explicit optional history-depth policy to the original source acquisition request. Keep existing history behavior when absent. A selected finite depth is passed to the genuine canonical Git fetch; native source-only recipes may explicitly select depth one when they need the complete selected tree rather than its history. Propagate the policy through the maintained catalog acquisition path and its declared recipe inputs. Do not change interactive repositories or silently change every caller's fetch policy. ## Authority, security and reliability Only the existing original source owner performs acquisition. A depth, commit name, shallow-file entry or successful Git command supplies no source authority. Preserve the canonical remote, exact commit/tree and source-byte checks, actual returned Git context, fsck/signature duties, durability, original clocks and positive process/forest retirement. Retain original and generated roots separately. Partial fetches, unexpected refs, changed shallow boundaries and uncertain cleanup remain failures; do not retry with broader history or discard mandatory source observations. Keep external toolchain recipes on their declared source semantics. ## Acceptance criteria - [ ] Define and validate the optional policy; preserve absent-policy arguments and behavior. - [ ] Carry the policy from the original native recipe through canonical acquisition without path- or record-based owner reconstruction. - [ ] Exercise real full-history and depth-one acquisitions of the same selected tree; compare complete source contents and retained Git context. - [ ] Cover invalid policy, exact-commit refusal, shallow-boundary mutation, partial fetch and independent cleanup while preserving the first failure. - [ ] Document source/history semantics, provenance and compatibility; retain existing source-owner and native integration controls. - [ ] Measure a fresh original-budget native build with the explicit policy, retaining actual compile, post-check and retirement results before full image and guest acceptance. ## Alternatives and tradeoffs Removing file fsync duties or mandatory byte comparisons changes reliability and source custody. Increasing deadlines hides the measured preparation cost. Bounded history instead changes an explicitly selected data input while retaining the complete current tree. Recipes that derive version information from ancestry must request the history they need; shallow selection is not universally interchangeable with a full checkout. ## Tracking and rollout Build on the existing source-owner acquisition protocol and [catalog compilation-input lifetime](https://git.erikinkinen.fi/erix/integration/pulls/603). Implement the optional policy first, then explicitly select it for compatible native source-only recipes. Preserve the default route and independently verify the changed source before another whole-image run.
erikinkinen added this to the Alpha 1 milestone 2026-11-08 14:33:06 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/integration#604
No description provided.