test(contacts-write): lock in PR #24878 regression guards#24879
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1dab2c45a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Contributor
Author
|
Addressed in #25064 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
contacts-write.test.tsthat lock in the two invariants fixed by PR fix(personas): restrict persona-file seeding to guardians and invalidate trust cache on guardian creation #24878.upsertContactChanneldoes NOT writeusers/<slug>.mdfor non-guardian contacts (guards the inbound-message eviction cascade regression).createGuardianBindinginvalidates the trust cache so the dynamicdefault:allow-file_edit-guardian-personaauto-allow rule is backfilled (guards the runtime-guardian approval-prompt regression).Context
PR #24878 fixed two bugs from the
drop-user-mdplan:upsertContactChannelwas callingensureGuardianPersonaFile(contact.userFile)on every new contact (Slack, phone, email, etc), which fired theusers/directory watcher added in PR feat(config-watcher): watch users/ directory for persona changes #24845 and evicted live conversations on every inbound message from a new contact. The fix restricted seeding to the guardian-creation path.default:allow-file_{read,write,edit}-guardian-personarule frompermissions/defaults.ts(PR feat(permissions): auto-allow file_{read,write,edit} on guardian persona file #24849) is only backfilled duringtrust-store.loadFromDisk(). Runtime guardian creation paths (self-heal, first-message-seeds-guardian) did not invalidate the cache, so the rule was never backfilled for those guardians and the model had to approve its firstfile_editonusers/<slug>.md.Neither invariant had test coverage. Future contributors could re-add the non-guardian seeding call ("it seems consistent") or remove the
clearTrustCachecall ("this looks like dead code") without CI catching it. This PR adds narrow regression locks for both.Original prompt
Where #4 was: