G §57, §345: a replace leaves the object it replaced, and a value over a bundle's object limit is refused, never split
Builds: design 47 G §57, §345 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -27,9 +27,6 @@ type Ref struct {
|
||||
Object string `json:"object"`
|
||||
// Size is the object's size in bytes.
|
||||
Size int64 `json:"size"`
|
||||
// Parts is how many objects the bytes are split over, named `<Object>.<n>` from 0, when the store takes no object as
|
||||
// large as the value (a bundle's runtime carries a message of 16 MiB); zero is one object named Object.
|
||||
Parts int `json:"parts,omitempty"`
|
||||
// Digest is the hex SHA-256 of the object's bytes; a reader checks it after the read.
|
||||
Digest string `json:"sha256"`
|
||||
// Form is FormVersion.
|
||||
@@ -37,7 +34,7 @@ type Ref struct {
|
||||
}
|
||||
|
||||
func (r Ref) valid() bool {
|
||||
if r.Store == "" || r.Object == "" || r.Size < 0 || r.Parts < 0 || r.Form != FormVersion || len(r.Digest) != 64 {
|
||||
if r.Store == "" || r.Object == "" || r.Size < 0 || r.Form != FormVersion || len(r.Digest) != 64 {
|
||||
return false
|
||||
}
|
||||
_, err := hex.DecodeString(r.Digest)
|
||||
|
||||
Reference in New Issue
Block a user