feat(lex-apollo): identity persistence, access_scope enforcement (global/team/private), erasure compliance#23
Merged
Conversation
…and access_scope (default global)
…ild_semantic_search_sql
… and retrieve_relevant
…r GDPR compliance
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
handle_ingestnow accepts and persistsaccess_scope,identity_principal_id,identity_id,identity_canonical_nametoapollo_entries— populated automatically by legion-apollo's identity injection; defaults toaccess_scope: 'global'for backward compatibilitybuild_semantic_search_sqladds optional access-scope SQL filter whenrequesting_principal_id:is provided: global always visible, private owner-only (dual-path for multi-provider auth via bothidentity_principal_idFK andidentitiessubquery), team via group membership joinhandle_queryandretrieve_relevantboth accept and forwardrequesting_principal_id:— covers the GAIA path (viahandle_query) and the direct-call path (viaretrieve_relevant); browse-mode fallback (list_entries_chronologically) filtered tooaccess_scope: 'private', the content-hash dedup check is scoped per-principal so two different principals writing identical content each get their own rowhandle_erasure_requestnow clearsidentity_principal_id,identity_id,identity_canonical_nameon confirmed entries — GDPR right-to-erasure compliance gap closedPrerequisites
apollo_entriesneedsaccess_scope,identity_principal_id,identity_id,identity_canonical_namecolumnsLegion::Apollo.ingestalready injects these kwargsTest plan
handle_ingestforwards identity kwargs andaccess_scopetocreate_candidate_entryhandle_ingestdefaultsaccess_scopeto'global'when not providedhandle_ingestpersistsidentity_idandidentity_canonical_namebuild_semantic_search_sqlwithoutrequesting_principal_idhas noaccess_scopeclause (backwards compatible)build_semantic_search_sqlwithrequesting_principal_idgenerates correct global/team/private SQLhandle_queryforwardsrequesting_principal_idtobuild_semantic_search_sqlretrieve_relevantforwardsrequesting_principal_idtobuild_semantic_search_sqlhandle_erasure_requestclears identity FK columns on confirmed (redacted) entries