Read publication inventory without execution snapshots

This commit is contained in:
2026-12-02 15:44:52 +00:00
parent 7ad8deb381
commit ebdf8b522f
14 changed files with 194 additions and 41 deletions

View File

@@ -49,6 +49,21 @@ func LoadCurrentState(
store storage.ObjectStore,
sessionPrefix string,
validation CurrentStateValidation,
) (*CurrentState, error) {
state, err := LoadCurrentInventory(ctx, store, sessionPrefix, validation)
if err != nil {
return nil, err
}
return loadCommittedCurrentState(ctx, store, state, validation)
}
// LoadCurrentInventory reads the selected publication identity and declarations
// without fetching an execution snapshot.
func LoadCurrentInventory(
ctx context.Context,
store storage.ObjectStore,
sessionPrefix string,
validation CurrentStateValidation,
) (*CurrentState, error) {
prefix := strings.TrimSpace(sessionPrefix)
if prefix == "" {
@@ -66,7 +81,7 @@ func LoadCurrentState(
if !pointerExists {
return nil, &CurrentCommitPointerMissingError{Key: pointerKey}
}
return loadCommittedCurrentState(ctx, store, prefix, pointerKey, validation)
return loadCommittedInventory(ctx, store, prefix, pointerKey, validation)
}
func ValidateCurrentStateIdentity(state *CurrentState, validation CurrentStateValidation) error {