Walkers never open live SQLite files; AFT storage stays out of project scans

Merged
AF
1d ago
+1756-97

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

Prevents project walkers and source readers from opening AFT's internal storage and live SQLite databases (plus their -wal/-shm/-journal sidecars), avoiding lost SQLite locks and SIGBUS crashes.

  • Centralizes exclusion in project_content and routes all indexed reads, bounded reads, grep fallback, watchers, live deltas, view assembly, and manifest reuse through it.
  • Registered names and identities are cached under a reader lock: 1,000 reads across 20 registered databases drop from 61,000 to 1,000 metadata calls, and walkers skip identity probes for directories entirely.
  • Cached live identities include birth time where available, so a source file reusing a sidecar's recycled inode is never refused; Windows, which has no inode identity, refuses registered SQLite names by name.
  • Source folders with database-like names stay searchable and their watcher events still reach checkout; committed database fixtures no longer break view builds.
  • Explicit task grep and glob still work, but only through registered non-secret artifact names checked against the caller's session/head ownership, including legacy flat task layouts; SQLite names and aliases to live databases are rejected before any opens.
  • Owned task outputs with multiple hard links are refused by read, grep, and glob so a linked artifact can never bypass the checks.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new blocking issue was found.

Summary

Keeps AFT storage and SQLite files out of project scans while preserving authorized task-output searches.

  • Project readers skip AFT storage and live SQLite files.
  • Search and code tools check project files before reading them.
  • Explicit task searches show only outputs the caller can access.
  • Views omit database files, while source-folder watcher events still pass through.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Requested path] --> B{Explicit authorized task artifact?}
  B -->|Yes| C[Check SQLite names and aliases]
  C --> D[Check file type and Unix link count]
  D --> E[Read allowed task output]
  B -->|No| F[Check storage roots and SQLite files]
  F --> G[Read allowed project source]

Reviews (8) · Last reviewed commit: "mason: reject hard-linked owned artifact..." · Reviewed by Greptile