The auditor's hybrid fixture on PR #1 (branch auditor/scaffold) caught this
during layer 3 validation on 2026-04-22. A re-seed with fresh doc_refs on
the same (operation, day) produced mode=updated but the doc_refs vanished.
Root cause
upsert_entry UPDATE arm only merged endorsed_names + partially handled
schema_fingerprint. Three fields were dropped: doc_refs, valid_until,
plus the schema_fingerprint partial handling was inconsistent with the
Phase 25 intent.
schema_fingerprint — already correct, clarified in comment.
Tests
4 new regression tests under upsert_tests. All 9 upsert tests pass.
Merge order
Independent of PR #2. Either can merge first. If PR #2 merges first
(which changes the UpsertOutcome enum shape), this branch needs a
rebase — only the 2 pattern-match sites in the tests update (_ → { .. }),
the fix logic is untouched.
## Surfaced by
The auditor's hybrid fixture on PR #1 (branch `auditor/scaffold`) caught this
during layer 3 validation on 2026-04-22. A re-seed with fresh doc_refs on
the same (operation, day) produced mode=updated but the doc_refs vanished.
## Root cause
`upsert_entry` UPDATE arm only merged endorsed_names + partially handled
schema_fingerprint. Three fields were dropped: `doc_refs`, `valid_until`,
plus the `schema_fingerprint` partial handling was inconsistent with the
Phase 25 intent.
## Fix
- `doc_refs` — merge by tool (case-insensitive). Same-tool supersedes,
different-tool appends, empty incoming preserves existing.
- `valid_until` — refresh if caller provides one.
- `schema_fingerprint` — already correct, clarified in comment.
## Tests
4 new regression tests under `upsert_tests`. All 9 upsert tests pass.
## Merge order
Independent of PR #2. Either can merge first. If PR #2 merges first
(which changes the UpsertOutcome enum shape), this branch needs a
rebase — only the 2 pattern-match sites in the tests update (_ → { .. }),
the fix logic is untouched.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
The auditor's hybrid fixture (branch auditor/scaffold) surfaced this
on 2026-04-22. A re-seed of the same (operation, day) pair with new
endorsed_names merged the names but silently discarded the incoming
doc_refs and valid_until fields. schema_fingerprint was partially
handled (set-if-Some) but doc_refs and valid_until weren't touched.
Root cause: the UPDATE arm of upsert_entry at playbook_memory.rs:609
only covered:
- endorsed_names (union-merge)
- timestamp
- embedding (if Some)
- schema_fingerprint (if Some)
Fix:
- valid_until — refresh if caller provides one
- doc_refs — merge by tool (case-insensitive). Same-tool new entry
supersedes older one; different-tool refs are appended. Empty
incoming doc_refs preserves existing (don't wipe on partial seed).
4 new regression tests under upsert_tests:
- update_merges_doc_refs_with_existing_ones
- update_same_tool_supersedes_older_version
- update_preserves_existing_doc_refs_when_new_entry_has_none
- update_refreshes_valid_until_when_caller_provides_one
Test result: 9/9 upsert tests pass (4 new + 5 pre-existing).
Branch basis note: this branch is off main, so the UpsertOutcome enum
here still has the newtype variants Added(String) / Noop(String). PR
#2 (fix/upsert-outcome-serde) changes that enum to struct-like. When
PR #2 merges first this branch needs a trivial rebase; the UPDATE
arm logic is untouched by that change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After merging main (with the UpsertOutcome struct-like enum shape
from PR #2), the 4 new upsert tests needed pattern-match updates:
UpsertOutcome::Added(_) → UpsertOutcome::Added { .. }
9/9 upsert tests pass.
profit
merged commit b82caa9971 into main2026-04-22 09:11:16 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Surfaced by
The auditor's hybrid fixture on PR #1 (branch
auditor/scaffold) caught thisduring layer 3 validation on 2026-04-22. A re-seed with fresh doc_refs on
the same (operation, day) produced mode=updated but the doc_refs vanished.
Root cause
upsert_entryUPDATE arm only merged endorsed_names + partially handledschema_fingerprint. Three fields were dropped:
doc_refs,valid_until,plus the
schema_fingerprintpartial handling was inconsistent with thePhase 25 intent.
Fix
doc_refs— merge by tool (case-insensitive). Same-tool supersedes,different-tool appends, empty incoming preserves existing.
valid_until— refresh if caller provides one.schema_fingerprint— already correct, clarified in comment.Tests
4 new regression tests under
upsert_tests. All 9 upsert tests pass.Merge order
Independent of PR #2. Either can merge first. If PR #2 merges first
(which changes the UpsertOutcome enum shape), this branch needs a
rebase — only the 2 pattern-match sites in the tests update (_ → { .. }),
the fix logic is untouched.
🤖 Generated with Claude Code
The auditor's hybrid fixture (branch auditor/scaffold) surfaced this on 2026-04-22. A re-seed of the same (operation, day) pair with new endorsed_names merged the names but silently discarded the incoming doc_refs and valid_until fields. schema_fingerprint was partially handled (set-if-Some) but doc_refs and valid_until weren't touched. Root cause: the UPDATE arm of upsert_entry at playbook_memory.rs:609 only covered: - endorsed_names (union-merge) - timestamp - embedding (if Some) - schema_fingerprint (if Some) Fix: - valid_until — refresh if caller provides one - doc_refs — merge by tool (case-insensitive). Same-tool new entry supersedes older one; different-tool refs are appended. Empty incoming doc_refs preserves existing (don't wipe on partial seed). 4 new regression tests under upsert_tests: - update_merges_doc_refs_with_existing_ones - update_same_tool_supersedes_older_version - update_preserves_existing_doc_refs_when_new_entry_has_none - update_refreshes_valid_until_when_caller_provides_one Test result: 9/9 upsert tests pass (4 new + 5 pre-existing). Branch basis note: this branch is off main, so the UpsertOutcome enum here still has the newtype variants Added(String) / Noop(String). PR #2 (fix/upsert-outcome-serde) changes that enum to struct-like. When PR #2 merges first this branch needs a trivial rebase; the UPDATE arm logic is untouched by that change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>Auditor verdict: ✅
approveOne-liner: all checks passed (3 findings, all info)
Head SHA:
320009ddf4deAudited at: 2026-04-22T09:07:16.396Z
dynamic — 1 findings (0 block, 0 warn, 1 info)
ℹ️ info — dynamic check skipped — skipped by options
skipped by optionsinference — 1 findings (0 block, 0 warn, 1 info)
ℹ️ info — no ship-claims extracted — skipping cloud inference
parser returned empty claim list; nothing to verify against cloudkb_query — 1 findings (0 block, 0 warn, 1 info)
ℹ️ info — KB: 69 recent scenario runs, 209/289 events ok (fail rate 27.7%)
most recent: scenario-2026-04-21T05-29-34recent failing sigs: 5745bcd5e4c68591, 5745bcd5e4c68591, caeeeffc69d36009Metrics
Lakehouse auditor · SHA
320009dd· re-audit on new commit flips the status automatically.