u/system-ronin

How I architect an entire architecture instructing LLM, Here is the process I could wrote so far, because it is lot more bigger than what i could explained here (I had no CS degree and no coding experience)
▲ 1 r/LLM

How I architect an entire architecture instructing LLM, Here is the process I could wrote so far, because it is lot more bigger than what i could explained here (I had no CS degree and no coding experience)

github.com
u/system-ronin — 5 days ago
▲ 2 r/Patents+1 crossposts

Prior Art as Code: How to protect open source innovations without paying anything, blocking patent trolls (A practical guide, grounded by law)

github.com
u/system-ronin — 5 days ago
▲ 0 r/git

I have modified git-filter-repo to delete commit(s) contains a uuid without breaking the repo, what do you think about this idea?

misc.add_argument('--uuid-erase', metavar='UUID',
    help=_("Completely erase all traces of a specific UUID from history, including commits"))

misc.add_argument('--notebook-erase', metavar='NOTEBOOK_UUID:UUID1,UUID2,...',
    help=_("Completely erase an entire notebook and all its UUIDs from history"))

last part of git-filter-repo

class UUIDEraseFilter(RepoFilter):
    """
    Specialized filter for completely erasing UUIDs and their associated commits
    """
    
    def __init__(self, args, uuid_to_erase):
        super().__init__(args)
        self.uuid = uuid_to_erase.encode() if isinstance(uuid_to_erase, str) else uuid_to_erase
        self.commits_removed = 0
        self.blobs_removed = 0
        
    def _tweak_commit(self, commit, aux_info):
        """Override to aggressively remove UUID commits"""
        
        # CRITICAL: Check if this commit contains the UUID in its message
        if commit.message and self.uuid in commit.message:
            # Skip ERASED commits (keep tombstones)
            if b"ERASED" not in commit.message:
                # 🔇 Verbose output - comment out for silent operation
                # print(f"        🔥 REMOVING commit {commit.original_id[:8] if commit.original_id else 'unknown'} (contains UUID)")
                commit.skip()  # This removes the entire commit
                self.commits_removed += 1
                return
                
        # ========== FIX: Handle missing parents gracefully ==========
        # Filter out parents that are not in the graph
        orig_parents = aux_info.get('orig_parents', [])
        valid_parents = []
        for p in orig_parents:
            if p in self._orig_graph.value:
                valid_parents.append(p)
        
        if len(valid_parents) != len(orig_parents):
            # Some parents missing, update the commit's parents
            commit.parents = valid_parents
            aux_info['orig_parents'] = valid_parents
        # ========== END FIX ==========
        
        # Also check file changes for the UUID
        has_uuid_in_files = False
        for change in commit.file_changes:
            if change.type == b'M' and hasattr(change, 'blob_id'):
                # We'll let the blob_callback handle content removal
                pass
                
        # Call parent method to handle normal filtering
        try:
            super()._tweak_commit(commit, aux_info)
        except AssertionError:
            # If assertion fails, skip this commit
            commit.skip()
            self.commits_removed += 1
        
    def _tweak_blob(self, blob):
        """Remove UUID from blob contents"""
        if blob.data and self.uuid in blob.data:
            # Count how many blobs we're modifying
            if self.uuid in blob.data:
                old_size = len(blob.data)
                blob.data = blob.data.replace(self.uuid, b'')
                new_size = len(blob.data)
                if new_size < old_size:
                    self.blobs_removed += 1
                    # 🔇 Verbose output - comment out for silent operation
                    # print(f"        📦 Removed UUID from blob {blob.original_id[:8] if blob.original_id else 'unknown'}")
        
        # Call parent method
        super()._tweak_blob(blob)
class NotebookEraseFilter(RepoFilter):
    """
    Specialized filter for completely erasing an entire notebook and all its commits
    """
    
    def __init__(self, args, notebook_uuid, all_uuids):
        super().__init__(args)
        self.notebook_uuid = notebook_uuid.encode() if isinstance(notebook_uuid, str) else notebook_uuid
        self.all_uuids = [u.encode() if isinstance(u, str) else u for u in all_uuids]
        self.commits_removed = 0
        
    def _tweak_commit(self, commit, aux_info):
        """Override to aggressively remove ALL commits belonging to this notebook"""
        
        # Get the full commit message
        full_message = commit.message or b''
        
        # Check if this commit belongs to the notebook by looking for root UUID
        root_pattern = b'root:' + self.notebook_uuid
        if root_pattern in full_message:
            commit.skip()
            self.commits_removed += 1
            return
            
        # Also check for any UUID from this notebook
        for uuid in self.all_uuids:
            uuid_pattern = b'uuid:' + uuid
            if uuid_pattern in full_message:
                commit.skip()
                self.commits_removed += 1
                return
        
        # ========== FIX: Filter out parents that are not in the graph ==========
        orig_parents = aux_info.get('orig_parents', [])
        valid_parents = []
        
        for p in orig_parents:
            # Check if this parent exists in the graph
            if hasattr(self, '_orig_graph') and hasattr(self._orig_graph, 'value'):
                if p in self._orig_graph.value:
                    valid_parents.append(p)
                else:
                    # Parent was filtered out - this is expected during erasure
                    pass
            else:
                # Fallback: keep parent if we can't check
                valid_parents.append(p)
        
        # Update the commit's parents to only valid ones
        if len(valid_parents) != len(orig_parents):
            commit.parents = valid_parents
            aux_info['orig_parents'] = valid_parents
            
            # If no valid parents remain, this commit becomes a root commit
            # That's fine - it will still be processed
        # ========== END FIX ==========
        
        # Call parent for normal processing
        try:
            super()._tweak_commit(commit, aux_info)
        except AssertionError as e:
            # If assertion still fails, skip this commit
            commit.skip()
            self.commits_removed += 1

def main():
    setup_gettext()
    args = FilteringOptions.parse_args(sys.argv[1:])
    
    # Check for notebook erasure mode
    if hasattr(args, 'notebook_erase') and args.notebook_erase:
        # Format: notebook_erase=notebook_uuid:uuid1,uuid2,uuid3
        parts = args.notebook_erase.split(':')
        notebook_uuid = parts[0]
        all_uuids = parts[1].split(',') if len(parts) > 1 else [notebook_uuid]
        
        filter = NotebookEraseFilter(args, notebook_uuid, all_uuids)
        filter.run()
        print(f"\n      ✓ Notebook completely erased")
        print(f"        Removed {filter.commits_removed} commit(s)")
        return
        
    # Check for UUID erasure mode (single item)
    if hasattr(args, 'uuid_erase') and args.uuid_erase:
        filter = UUIDEraseFilter(args, args.uuid_erase)
        filter.run()
        print(f"\n      ✓ UUID {args.uuid_erase} completely erased from history")
        print(f"        Removed {filter.commits_removed} commit(s)")
        return
        
    if args.analyze:
        RepoAnalyze.run(args)
    else:
        filter = RepoFilter(args)
        filter.run()

if __name__ == '__main__':
  main()
else:
    # Allow importing as a module
    pass

from cli, (i never used it outside where it is embedded and used as python module)

python git_filter_repo.py --uuid-erase <UUID> --force

Example:

python git_filter_repo.py --uuid-erase 20260609174733 --force

or

python git_filter_repo.py --notebook-erase <NOTEBOOK_UUID>:<UUID1>,<UUID2>,... --force
python git_filter_repo.py --notebook-erase 20262609175249:20260609174733,20262609175249,20260609174738 --force

i believe git filter repo can be used safely for many such problem like this. i solve the parmanent erasing issue using git-filter-repo in my app. I did this modification directing llm. The main requirement is to have uuid in commit structure consistantly. I am no python or git internal expert. I am a sysadmin with 25 years of system knowledge. and i noticed that it is also gdpr compatible and can be used elsewhere based on this concept, what do you think for the future usages in other environment?

reddit.com
u/system-ronin — 26 days ago