feat(mount): add _index.json everywhere + LAYOUT.md (issue #106 PR 1)#116
feat(mount): add _index.json everywhere + LAYOUT.md (issue #106 PR 1)#116khaliqgant merged 1 commit intomainfrom
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR introduces a virtual ChangesVirtual LAYOUT.md Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.trajectories/index.json (1)
9-136:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAvoid absolute local paths in committed trajectory registry.
These
/Users/khaliqgant/...paths are machine-specific and leak a local identifier. Prefer repository-relative paths (for portability and privacy hygiene).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.trajectories/index.json around lines 9 - 136, The committed .trajectories index contains absolute local file paths (e.g., the "path" values under entries like "traj_7x9nltybo08h", "traj_82lywlk9dcnc", etc.) which leak machine-specific info; update each trajectory object's "path" field to a repository-relative path (for example ".trajectories/completed/2026-04/traj_7x9nltybo08h.json") and ensure any code that reads/writes these values uses path joining (not hardcoded absolute paths) so the registry is portable and free of local user identifiers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.trajectories/completed/2026-05/traj_pfjtlq9sb0ps.json:
- Line 19: The committed metadata contains a machine-specific absolute path in
the JSON key "projectId"; replace that value in the file entry where "projectId"
is set so it no longer contains a local absolute path (e.g.,
"/Users/khaliqgant/..."). Update the "projectId" value to a portable identifier
such as a relative path, repository name, project slug, or a canonical UUID
(whatever the project convention uses) and commit the change so no username or
local filesystem paths are stored.
In @.trajectories/index.json:
- Around line 5-10: Update the registry entry for traj_rbaf01z4kt7g: change
"status" from "active" to "completed", add a "completedAt" timestamp (use the
completed report's timestamp or the commit time), and update the "path" value to
the completed report path ".trajectories/completed/2026-05/traj_rbaf01z4kt7g.md"
so index consumers see the run as finished.
---
Outside diff comments:
In @.trajectories/index.json:
- Around line 9-136: The committed .trajectories index contains absolute local
file paths (e.g., the "path" values under entries like "traj_7x9nltybo08h",
"traj_82lywlk9dcnc", etc.) which leak machine-specific info; update each
trajectory object's "path" field to a repository-relative path (for example
".trajectories/completed/2026-04/traj_7x9nltybo08h.json") and ensure any code
that reads/writes these values uses path joining (not hardcoded absolute paths)
so the registry is portable and free of local user identifiers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 28019845-e3e6-4473-96c4-e51d8a3fcf9c
📒 Files selected for processing (12)
.trajectories/active/traj_rbaf01z4kt7g.json.trajectories/completed/2026-05/traj_pfjtlq9sb0ps.json.trajectories/completed/2026-05/traj_pfjtlq9sb0ps.md.trajectories/completed/2026-05/traj_rbaf01z4kt7g.json.trajectories/completed/2026-05/traj_rbaf01z4kt7g.md.trajectories/index.jsoninternal/mountfuse/fs.gointernal/mountfuse/fuse_test.gointernal/mountfuse/layout.gointernal/mountfuse/layout_test.gointernal/mountsync/syncer.gointernal/mountsync/syncer_test.go
| }, | ||
| "commits": [], | ||
| "filesChanged": [], | ||
| "projectId": "/Users/khaliqgant/Projects/AgentWorkforce/relayfile", |
There was a problem hiding this comment.
Remove machine-specific absolute path from committed metadata.
projectId currently exposes a local absolute path (including username), which leaks workstation-specific information and makes the artifact non-portable.
🔧 Proposed fix
- "projectId": "/Users/khaliqgant/Projects/AgentWorkforce/relayfile",
+ "projectId": "AgentWorkforce/relayfile",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "projectId": "/Users/khaliqgant/Projects/AgentWorkforce/relayfile", | |
| "projectId": "AgentWorkforce/relayfile", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.trajectories/completed/2026-05/traj_pfjtlq9sb0ps.json at line 19, The
committed metadata contains a machine-specific absolute path in the JSON key
"projectId"; replace that value in the file entry where "projectId" is set so it
no longer contains a local absolute path (e.g., "/Users/khaliqgant/..."). Update
the "projectId" value to a portable identifier such as a relative path,
repository name, project slug, or a canonical UUID (whatever the project
convention uses) and commit the change so no username or local filesystem paths
are stored.
| "traj_rbaf01z4kt7g": { | ||
| "title": "106-mount-layout-improvements-workflow", | ||
| "status": "active", | ||
| "startedAt": "2026-04-30T16:53:07.629Z", | ||
| "path": "/Users/khaliqgant/Projects/AgentWorkforce/relayfile/.trajectories/active/traj_mfyus7zfgxt2.json" | ||
| "startedAt": "2026-05-08T22:58:04.332Z", | ||
| "path": "/Users/khaliqgant/Projects/AgentWorkforce/relayfile/.trajectories/active/traj_rbaf01z4kt7g.json" | ||
| }, |
There was a problem hiding this comment.
traj_rbaf01z4kt7g registry state is inconsistent with completed artifact.
Line 7 marks this trajectory as active, but the PR adds a completed report at .trajectories/completed/2026-05/traj_rbaf01z4kt7g.md. Please finalize this entry (status, completedAt, and completed-path target) so index consumers don’t treat a finished run as in-progress.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.trajectories/index.json around lines 5 - 10, Update the registry entry for
traj_rbaf01z4kt7g: change "status" from "active" to "completed", add a
"completedAt" timestamp (use the completed report's timestamp or the commit
time), and update the "path" value to the completed report path
".trajectories/completed/2026-05/traj_rbaf01z4kt7g.md" so index consumers see
the run as finished.
| return nodeMeta{ | ||
| path: layoutRemotePath(remoteRoot), | ||
| name: layoutFilename, | ||
| mode: syscall.S_IFREG | defaultFileMode, |
There was a problem hiding this comment.
🟡 Virtual LAYOUT.md is writable (0o644) but all write/delete operations will fail with confusing errors
The virtual LAYOUT.md file is created with defaultFileMode (0o644) at internal/mountfuse/layout.go:53, making it appear writable to the kernel and user. However, no guards exist in the Unlink (internal/mountfuse/dir.go:133-158) or flush (internal/mountfuse/file.go:209-247) paths to reject mutations on the virtual file. When a user or agent tries to delete (rm LAYOUT.md) or write to the file, the operation proceeds to call DeleteFile/WriteFile on the remote server with the fake revision "virtual-layout", which will fail with a confusing EIO or EPERM errno. In the write case, a user's edits appear to succeed (buffer writes work) but are silently lost when flush fails on close. The file should use read-only mode (0o444) so the FUSE kernel rejects writes/deletes before they reach the handlers.
| mode: syscall.S_IFREG | defaultFileMode, | |
| mode: syscall.S_IFREG | 0o444, |
Was this helpful? React with 👍 or 👎 to provide feedback.
97ab087 to
4481a13
Compare
4481a13 to
054a40a
Compare
Adds the virtual LAYOUT.md file at mount root (read-only 0o444) with LayoutMarkdown anchor coverage, plumbs isVirtualLayoutPath through listDirectory/lookupMetadata/readFile so the synthesized entry bypasses remote calls. Documents that _index.json files and per-integration .layout.md dotfiles are first-class remote payloads in mountsync, and covers the apply path in TestApplyRemoteFile_IndexAndLayoutFiles. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
054a40a to
602744c
Compare
Part 1 of 3 from #106. Additive, low-risk.
Adds:
_index.jsonin every materialized mount directory containing acompact list of
{ id, title|name, updated }rows so agents cando "find by title" in two reads instead of N.
LAYOUT.md(a.k.a. SKILL.md) at the mount root teaching agentsthe structure on first look.
No existing files are renamed or moved. Symlinks / by-title / by-id
aliases land in PR 2 (#106). State-grouped views + lazy GH land in PR 3.
See #106 for benchmark motivation.
Repo scope
This PR is the relayfile part of wave
wave1-indexes. Thecompanion PRs in the other repos are linked from issue #106.
Test plan
cd /Users/khaliqgant/Projects/AgentWorkforce/relayfile && go test ./internal/mountfuse/... ./internal/mountsync/...cd /Users/khaliqgant/Projects/AgentWorkforce/relayfile && go vet ./...Generated by an overnight agent run. See
/tmp/106-wave1-indexes-status.mdon the host for triage notes.Refs #106