fix: dossier hardening -- loud missing-lib guard, key-syntax alignment, whitespace trimming #466
Labels
No labels
Agent
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Total time spent: 6 minutes 57 seconds
Due date
igor
6 minutes 57 seconds
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor#466
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #465 (dossier parser), from the shadow review's final round -- three small hardening items in
lib/dossier.sh/lib/repo-checks.sh:check_dossier's defensive*)arm documents that it catches "lib/dossier.sh not sourced -> 127", but it is unreachable for that case:dossier_is_declared "$content" || return 2swallows the 127 (command-not-found) into rc2, the silent legacy path -- exactly the dead-gate outcome the arm was added to prevent. Fix: at the top ofcheck_dossier,declare -F dossier_validate >/dev/null || { ...stderr warning...; return 3; }(or similar distinct status the*)arm actually receives). Correct the arm's comment to match reality.dossier_keysaccepts leading whitespace (sed -nE 's/^[[:space:]]*([a-z][a-z-]*):...') whiledossier_get(grep -E "^${key}:") and_dossier_validate_metadata(^([a-z][a-z-]*):) reject it -- an indented key is listed but unreadable. Pick the strict form everywhere (no leading whitespace; the validator's rule is the spec).type: arcade(two spaces) fails the closed-list check with a message that prints the padded value and reads as a mystery; same for a double-spaced H1 in the host comparison. Trim the extracted value and H1 name before comparison so near-miss whitespace either passes or fails with an obvious reason.Tests: extend
bin/test-dossier.sh-- unsourced-lib guard (subshell withoutlib/dossier.sh), indented-key fixture asserting reader/validator agreement, and the two-spacetype:/ H1 cases asserting the post-trim behavior.All three are latent (no live caller hits them today) -- priority low, no rush.