Skip to content

Mount layout: precompute filter-view directories (by-state, by-date, by-author) #108

@khaliqgant

Description

@khaliqgant

Context

Companion to #106. Across the May 8 benchmark (Opus / Sonnet / Haiku × MCP / relayfile, on the "what did I work on yesterday" multi-source synthesis task), ~9 of 23 turns on every relayfile run were spent hand-crafting filtersfind -newermt "2026-05-07", grep -l '"updated_at":"2026-05-07', inline python3 -c "..." over JSON files.

This is the largest remaining cost source after #106 lands. The fix is to materialize the common filters as directories so the agent's filter becomes a ls.

Proposal

Maintain symlink trees alongside the canonical <uuid>.json files. The relayfile sync daemon already watches the data; have it maintain these views on every change.

linear/issues/by-state/{Todo,In Progress,Done,Backlog}/AGE-12.json -> ../<uuid>.json
linear/issues/by-assignee/khaliqgant/AGE-12.json                   -> ../<uuid>.json
linear/issues/by-updated/2026-05-07/AGE-12.json                    -> ../<uuid>.json

notion/pages/by-edited/2026-05-07/<title>.json                     -> ../../<uuid>.json
notion/pages/by-author/khaliqgant/<title>.json                     -> ../../<uuid>.json

github/repos/<owner>/<repo>/pulls/by-author/khaliqgant/95.json     -> ../../<uuid-or-num>.json
github/repos/<owner>/<repo>/pulls/by-state/{open,merged,closed}/...
github/repos/<owner>/<repo>/pulls/by-updated/2026-05-07/...

Symlinks, not copies — storage cost is negligible.

Why this matters per task

  • "List my open Linear issues"ls linear/issues/by-state/Todo/. Zero filtering logic in the agent.
  • "What did I work on yesterday"ls notion/pages/by-edited/2026-05-07/ + same for github/linear. Three ls calls instead of three find/grep/python pipelines.
  • "What PRs has Khaliq opened this week"for d in by-updated/2026-05-0{2..8}; ls $d/by-author/khaliqgant/.

Predicted benchmark impact

After #106 + this:

  • Sonnet RF: $0.38 → ~$0.15 (vs Sonnet MCP at $0.19)
  • Opus RF: $0.80 → ~$0.30 (vs Opus MCP at $0.32)
  • Haiku RF: $0.19 → ~$0.08 (vs Haiku MCP at $0.16)

This is the lever that flips relayfile from "more expensive but more thorough" to "cheaper and more thorough" on every model.

Implementation notes

  • Maintain at sync time, not query time — the daemon already gets every update; emit symlink updates as a side effect.
  • Decide the canonical filter axes per integration (state, date, author/assignee are the obvious three; integrations can opt in to more).
  • Document the available views in LAYOUT.md (Mount layout: add indexes, semantic aliases, and a SKILL.md to reduce agent file-shopping #106) so the agent knows to use them.
  • Filter-view filenames should be human-readable where possible (AGE-12.json not the UUID), so ls output is useful directly.

Out of scope

Acceptance

  • Each top-level integration directory has at least one by-*/ view (concrete axes per integration TBD in PR review).
  • Re-running the May 8 benchmark "what did I work on yesterday" prompt shows < 10 turns and < $0.20 cost on Sonnet RF.
  • LAYOUT.md documents what views exist and how to use them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions