[quality] cover intake sniff gates, RTF hex escapes, and upload handler branches - #145
Conversation
…ranches pkg/intake was 68.8% covered with the upload type-confusion gate (sniffMatchesDocument 50%, sniffMatchesAudio 44%) and the RTF hex-escape decoder (parseHexByte/hexVal 0%) untested — directly behind the /api/intake surface hardened by #142. Adds table tests for both sniff gates (every extension arm, accept+reject), StripRTF \'xx escapes, cleanText whitespace branches, MaxUploadBytes env override, Error.Error, and HandleUpload branches (success, unsupported type, oversize, and non-multipart). pkg/intake: 68.8% -> 88.3%. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: hive-quality <sec-check@hive.kubestellar.io>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Test Improvement
Adds
pkg/intake/intake_gap_test.gocovering the untested guard rails behind/api/intake(files/functions claimed:pkg/intake/intake.go—sniffMatchesDocument,sniffMatchesAudio,parseHexByte,hexVal,StripRTFhex escapes,cleanText,MaxUploadBytes,Error.Error,HandleUpload):StripRTF\'xxhex-escape decoding plus directparseHexBytenibble-range/reject cases (both 0%)cleanTextCR-strip, blank-line-cap, and whitespace-collapse branchesMaxUploadBytesDIBS_INTAKE_MAX_MBvalid/invalid/negative override branchesHandleUploadsuccess, unsupported-type (*Errorpropagation), oversize, and non-multipart branchespkg/intake coverage: 68.8% → 88.3%. Test-only change; no production code touched.
Related Issue
Closes #144
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.88