fix: trim dossier_get's extracted values, not just one leading space #478

Merged
igor merged 1 commit from agent/475-fix-dossier-get-must-trim-extracted-values into master 2026-08-09 02:50:23 +00:00
Collaborator

What this PR does

  • fix: trim dossier_get's extracted values, not just one leading space
  • Apply the same trim to the agent.json fallback values for symmetry
  • Add a padded-fixture test asserting dossier_validate/dossier_keys/dossier_get three-way agreement

Test plan

  • bin/test-dossier.sh passes, including the new padded type: arcade fixture
  • make test passes
  • make lint passes

Closes #475

## What this PR does - [x] fix: trim dossier_get's extracted values, not just one leading space - [x] Apply the same trim to the agent.json fallback values for symmetry - [x] Add a padded-fixture test asserting dossier_validate/dossier_keys/dossier_get three-way agreement ## Test plan - [x] `bin/test-dossier.sh` passes, including the new padded `type: arcade ` fixture - [x] `make test` passes - [x] `make lint` passes Closes #475
fix: trim dossier_get's extracted values, not just one leading space
All checks were successful
Lint / check-sync (push) Successful in 7s
Lint / check-sync (pull_request) Successful in 5s
c9239bbe83
Author
Collaborator

🤖 Review — APPROVE (automated)

CI for c9239bbe: success

Two-line fix in lib/dossier.sh replacing the single-leading-space strip with the existing _dossier_trim helper (plus the same for the agent.json fallback), with a padded fixture test. Matches issue #475 exactly; CI green.

Findings

  • lib/dossier.sh:77 — correct fix: _dossier_trim is the same helper _dossier_validate_metadata uses, so reader/validator agreement is guaranteed by construction rather than by two independent trim implementations. The new test in bin/test-dossier.sh:109-115 asserts the three-way agreement (validate/keys/get) the issue asked for.
  • lib/dossier.sh:88 — the fallback trim also changes behavior for a whitespace-only extracted value: previously type:␠␠␠ yielded a non-empty "␠␠" and returned 0; now it trims to empty and returns 1. That's the right semantics (a blank value is absent), and I don't see a caller in this diff that depended on the old truthy result — flagging only so a human isn't surprised by it.
  • Checklist is honest: all three checked items correspond to real hunks. No comment bloat, no drive-by changes, diff is the size the task requires.

Coverage note (non-blocking)

  • The agent.json fallback trim is untested — the issue itself calls it symmetry-only ("jq output is clean today"), so no test was expected, but it means that line is asserted by nothing. If a fixture harness for agent.json exists elsewhere, a one-line padded-JSON case would close the gap.

Independent review by the harness on claude-opus-5 (effort: high). The human reviewer is requested once Igor has reviewed; a human still merges.

### 🤖 Review — `APPROVE` _(automated)_ CI for `c9239bbe`: **success** Two-line fix in `lib/dossier.sh` replacing the single-leading-space strip with the existing `_dossier_trim` helper (plus the same for the `agent.json` fallback), with a padded fixture test. Matches issue #475 exactly; CI green. **Findings** - `lib/dossier.sh:77` — correct fix: `_dossier_trim` is the same helper `_dossier_validate_metadata` uses, so reader/validator agreement is guaranteed by construction rather than by two independent trim implementations. The new test in `bin/test-dossier.sh:109-115` asserts the three-way agreement (validate/keys/get) the issue asked for. - `lib/dossier.sh:88` — the fallback trim also changes behavior for a whitespace-only extracted value: previously `type:␠␠␠` yielded a non-empty `"␠␠"` and returned 0; now it trims to empty and returns 1. That's the right semantics (a blank value is absent), and I don't see a caller in this diff that depended on the old truthy result — flagging only so a human isn't surprised by it. - Checklist is honest: all three checked items correspond to real hunks. No comment bloat, no drive-by changes, diff is the size the task requires. **Coverage note (non-blocking)** - The `agent.json` fallback trim is untested — the issue itself calls it symmetry-only ("jq output is clean today"), so no test was expected, but it means that line is asserted by nothing. If a fixture harness for `agent.json` exists elsewhere, a one-line padded-JSON case would close the gap. --- <sub>Independent review by the harness on `claude-opus-5` (effort: high). The human reviewer is requested once Igor has reviewed; a human still merges.</sub> <!-- review sha=c9239bbe83642ece6cc7d1ed2358b447b9ce6433 verdict=APPROVE ci=success -->
igor added spent time 2026-08-09 02:49:17 +00:00
35 seconds
igor merged commit 07cee7c274 into master 2026-08-09 02:50:23 +00:00
igor deleted branch agent/475-fix-dossier-get-must-trim-extracted-values 2026-08-09 02:50:24 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Total time spent: 35 seconds
igor
35 seconds
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
joshtronic/igor!478
No description provided.