REPOSITORY CODING · EASY
Uppercase archive checksums mark healthy copies as corrupt
The audit rejects valid uppercase and mixed-case SHA-256 strings. Fix digest comparison without accepting mismatched bytes or incomplete hashes.
Incident DebuggingArchive integrity and repair inventory
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
Go · 30 minute session
- Manifests identify files by tenant and key, with a SHA-256 hex digest and desired number of copies (1..20). Compare digest letters without regard to case; hash UTF-8 content bytes.
- An observation identifies tenant, key, location and nonnegative revision. Resolve the greatest revision per identity before checking present or checksum. Identical redelivery is allowed; conflicting content at the same revision is invalid.
- Only the requested tenant is reported. A healthy copy is present and matches the manifest digest. A present mismatching copy is damaged. Missing or unobserved locations cannot be repair sources.
- Status is healthy when the desired copies already exist, under-replicated with at least one healthy copy, otherwise unrecoverable. Status describes the observed inventory before repairs.
- Implement repairs as copy proposals from the lexically first healthy location to lexically ordered nonhealthy configured locations until the desired copy count is met. Do not delete surplus copies. Shortfall is the remaining deficit after proposals.
- Report current unknown keys as sorted orphans without deleting them. Output items, healthy and damaged locations are sorted. All arrays remain arrays, even when empty. This service plans changes and never writes to archival storage.