Repository navigation
docs(guide): recommended workspace layout for Trinity-compatible agents (#3797) - #3801
Conversation
Restates ## Directory Structure as three zones (platform-owned, committed, volume-only) with three rules, project_files/<slug>/, $TMPDIR scratch, gitignored side clones vs submodules (#2366), the .gitignore read as a consequence of the zones, and source links. Drops the stale .claude/skills-library/ mount line. Wording kept consistent with the platform prompt's environment block (trinity-enterprise#945). Refs #3797 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #3797 Co-Authored-By: Claude Opus 5.5 <[email protected]>
#3797) - Content Folder Convention, Best Practices and the commit_paths example name reports/<kind>/ as the committed work folder, matching the new Directory Structure tree; outputs/ is kept as a legacy name that still works. - The reset-to-main sentence states the default persistent set used when .trinity/persistent-state.yaml is absent, and that untracked files are never touched. - The FAQ, agent-data.md, the guide's data_paths section and the agent-data-volumes flow no longer call an ordinary template pull a reset. - Memory Management points at the repo-level memory/ and keeps per-person facts out of it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trinity-ability
left a comment
There was a problem hiding this comment.
PR Validation Report: #3801
Lane A (docs only: 4 files, +115/−41), base dev, tip 24c65fbf1. Draft.
| Category | Status | Notes |
|---|---|---|
| Commit messages | ✅ | 3 × docs(guide): … (#3797) |
| Base branch / size | ✅ | dev, 4 files |
| Status auto-promotion | Body says Implements #3797, which is not a closing keyword. #3797 will not auto-promote. Its current label is status-ready, not status-in-progress. |
|
| Requirements / architecture | ➖ | Docs only |
| Feature flows | ✅ | agent-data-volumes.md reworded only; format unchanged |
| Security §4.1–4.3, 4.10, enterprise-docs grep | ✅ | No hits. The only /home/ path is the container's /home/developer/, and the only URL is the your-org placeholder. Trinity-enterprise#945 is cited by number only. |
| Merge gate (Tier 1) | ✅ | All required checks plus pytest (head) and regression diff are green. dev-ci is success and no dev-ci red issue is open. |
| Execution coverage | ✅ | Guard tests that read the guide/FAQ re-run in the PR worktree: test_1402_prompt_contract 18, test_1908_bundled_template_gitignore 94, test_2007_mcp_template_render 36, test_2110_widget_type_parity 16, test_github_init_gitignore 7. All pass. |
Facts checked against the owning code
_DEFAULT_PERSISTENT_STATE=workspace/**,.trinity/**,.mcp.json,.claude.json,.claude/.credentials.json(docker/base-image/agent_server/routers/files.py:327). Snapshot goes to.trinity/backup/<ts>/and the reset isreset --hard origin/mainwith noclean(routers/git.py:2766,2774). ✅$TMPDIR=/home/developer/.tmp(capabilities.py:116) and.tmp/is in_GITIGNORE_PATTERNS./tmpis noexec with an operator-tunable size, default 512m (capabilities.py:83-92)..tmp/codexis Codex's home (files.py:263-270). ✅public/isPUBLISH_DIR,uploads/isUPLOAD_BASE,content/is created bystartup.sh:768, and.trinity/*is write-denied in the Files tab (agent_service/files.py:71). ✅- Skills land at
~/.claude/skills/<name>/(skill_service.py:13,407). The library lives at/data/skills-libraryon the backend, not as an agent mount, so removing theskills-libraryline is correct. ✅ - #2366 is open and matches the submodule claim. Every new link and anchor resolves (
#5-gitignore-required,#runtime-data-data_paths--1169,#platform-skills, …). ✅ - Cross-check with #3800 (
### Your environment): the user, durable volume, noexec/tmp→$TMPDIR, the reset-to-main default set, untracked files untouched, the folder list,.trinity/(agent writes, Files tab cannot), committedmemory/, and auto-memory under~/.claude/projects/all agree. No contradiction found.
Critical (block merge)
None.
Warnings
- W1: closing keyword. Change
Implements #3797toCloses #3797in the PR body, or #3797 strands withoutstatus-in-devafter merge.
Suggestions (non-blocking; fine as follow-ups)
- S1: the force-reset pull deletes untracked files.
docs/user-docs/agents/agent-data.md:11says "neither wipes untracked files", andfaq/agents.md:47says the same. That is accurate for reset-to-main and the default pull. But theforce_resetpull strategy (GitConflictModal and MCPgit_pull) runsgit clean -fdafter its reset (routers/git.py:2567). That removes untracked, non-ignored files, for example uncommittedmemory/orreports/files. Gitignored side clones anddata/survive. One clause would close the gap. - S2: "merges" vs rebase. The default (
clean) pull isgit pull --rebase(routers/git.py:2232). The guide (:442), FAQ and agent-data say "merges"; the feature flow and PR body say "merge or rebase". The feature-flow wording is the precise one. - S3:
data/is not gitignored by default. The zone table (TRINITY_COMPATIBLE_AGENT_GUIDE.md:405) saysdata/is "never" committed.data/is only gitignored oncedata_pathsis declared (trinity_files.py:59,211), as the guide's own "Why the .gitignore" block says. Consider "never (gitignored when you declaredata_paths)". The same unconditional "gitignored" appears in #3800's block. That is a note for its validation, not a contradiction with this guide.
Recommendation
APPROVE. The docs are accurate against the code and consistent with #3800, and every gate is green. Fix W1 before merge; S1–S3 are optional. Per the chain, merge alongside #3800.
|
Held as a draft by the build-chain orchestrator despite the APPROVE. Suggestion S1 (a force-replace pull runs |
#3797) A force-replace pull (strategy=force_reset) runs git reset --hard then git clean -fd, so it deletes untracked files that are not gitignored; the default pull is git pull --rebase; data/ is gitignored only once data_paths is declared. Wording matches the companion PR #3800. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trinity-ability
left a comment
There was a problem hiding this comment.
/validate-pr: round 2 on a178c5efc, APPROVE
Lane A. The PR changes only 4 docs files and makes no deletions in tests/. Secret, email, IP, file-mode and enterprise-guard greps found nothing. The only absolute path is /home/developer/, the agent container's home, not a host path. Tier 1 is green: 18 pass, 6 skipped, 0 failing. dev-ci is success.
Round-1 items
| Item | Status |
|---|---|
S1 force-replace pull runs git clean -fd |
✅ Fixed in all four files (guide Submodules + data_paths "already durable", FAQ, agent-data.md, feature flow). The sentence is word-for-word the #3800 ### Your environment wording. It matches the code: force_reset → git clean -fd in agent_server/routers/git.py, and the MCP git_pull exposes force_reset. |
S2 the default pull is --rebase |
✅ Guide, FAQ and agent-data.md say "rebases onto the remote", and the flow says "(a rebase)". This matches git pull --rebase in the agent server. No "pull merges" wording is left in the four files. |
S3 data/ is gitignored only once data_paths is declared |
✅ Zone table: "data/ never (gitignored once you declare data_paths)". This matches #3800's data/ bullet. |
| W1 closing keyword | ✅ The body says "Fixes #3797". |
Agreement with the #3800 block (8fd08e2)
- Reset-to-main default keep-set (
workspace/,.trinity/,.mcp.json,.claude.json,.claude/.credentials.json): identical. The guide adds the.trinity/backup/<ts>/snapshot, which is an addition, not a contradiction. - Force-replace pull: identical sentence.
data/ignore condition: same condition.memory/committed: stated in both. The guide's rule 3 and Memory Management also carry the shared-across-users caveat, matching #3800..trinity/: both say it is reserved or shared with the platform, the agent writes to it, and people cannot edit it from the Files tab.
Execution coverage (§5.4)
This is a docs-only PR. The five tests that read the guide or FAQ (test_1402, test_1908, test_2007, test_2110, test_github_init_gitignore) were re-run in the PR worktree on a178c5efc: 171 passed.
New findings
None blocking.
Fixes #3797. This adds a recommended workspace layout to the Trinity-compatible agent guide.
What
docs/TRINITY_COMPATIBLE_AGENT_GUIDE.md→## Directory Structuregains H3 subsections with a recommended layout: what is committed and what is gitignored, project folders, side clones, scratch space, and the directories the platform reserves. The heading is unchanged, so existing links still resolve.project_files/<slug>/. Committed outputs go inreports/<kind>/.repos/wrapper).setup.shclones if missing, refreshes withgit pull --ff-only, prints the sha, and puts no token in the URL. Afetch+reset --hardrefresh is only for a clone the agent never writes to. Submodules are only for an exact pin, with the caveats (bug: agent workspaces with git submodules are second-class in the platform's own git paths —create_agentskips them,git_pullfails on a moved pointer #2366, and a reset leaving the submodule checkout stale).$TMPDIR(~/.tmp/), one subdirectory per job, and never clear it wholesale (~/.tmp/codex/)./tmpis a small RAM-backednoexectmpfs sized by the operator.memory/is committed and shared across all users. Claude Code's auto-memory lives under~/.claude/projects/and is shared too. Per-person facts go throughwrite_user_memory..trinity/is reserved by the platform but written by the agent. People cannot edit it from the Files tab.Pull vs reset, stated once and the same everywhere:
.trinity/persistent-state.yaml. Without that file, a default set is kept:workspace/,.trinity/,.mcp.json,.claude.jsonand.claude/.credentials.json. Kept files are snapshotted to.trinity/backup/<ts>/. Untracked files are never touched.git_pulltool) is the exception: it resets to the remote and runsgit clean -fd, deleting untracked files that are not gitignored.data/is gitignored only once the agent declaresdata_paths; it is not in the fleet-wide patterns.The fix commit makes the rest of the docs agree with the new section:
commit_pathsexample and Best Practices now namereports/<kind>/;outputs/still works for older templates.docs/user-docs/faq/agents.md,docs/user-docs/agents/agent-data.mdanddocs/memory/feature-flows/agent-data-volumes.md.memory/, andpreferences.jsonis relabelled as agent preferences, never a person's details.Commits:
7f9be37c7guide section ·6d51351c3FAQ pointer ·24c65fbf1review fixes ·a178c5efcvalidation round 1 fixes (force-replace pull, pull rebases,data/ignore condition).Rulings carried
memory/is committed.## Directory Structure, and one FAQ pointer in user-docs: accepted.repos/wrapper, because the fleet's canon layer already clones tocanon/. Refresh is ff-only; a reset is only for never-written clones./tmpsize, because it is operator-tunable (default 512m)..trinity/, reset-to-main and protected-path facts match the platform-prompt block in the sibling PR feat(prompt): "Your environment" block in the platform prompt (trinity-enterprise#945) #3800 (trinity-enterprise#945), so the guide and the prompt state the same facts.routers/git.pyforce_resetrunsgit clean -fd) in the guide, FAQ,agent-data.mdand the feature flow, with feat(prompt): "Your environment" block in the platform prompt (trinity-enterprise#945) #3800's wording; "an ordinary pull merges" becomes "rebases onto the remote" (git pull --rebase); the zone table saysdata/is gitignored oncedata_pathsis declared.Review + security
24c65fbf1./cso --difffound nothing; docker was down, which does not matter for a docs-only diff./validate-prround 1 (review 5567835276) APPROVED with suggestions S1–S3. S1 was feat(prompt): "Your environment" block in the platform prompt (trinity-enterprise#945) #3800's blocker, so this PR was held as a draft and both were fixed together in round 2..claudeandsrc/backend/enterpriseare untouched. The only URL is ayour-orgplaceholder, and thesetup.shexample carries no token.Tests
The five files that read the guide or the FAQ all pass (re-run on
a178c5efc, same counts):test_1402_prompt_contract: 18test_1908_bundled_template_gitignore: 94test_2007_mcp_template_render: 36test_2110_widget_type_parity: 16test_github_init_gitignore: 7The guide still has exactly three
gitignorefences, with the first untouched. All new internal links and the TOC resolve. The old#outputs-vs-contentanchor has no inbound links.Before merge
devon files this PR does not touch. fix(agent-runtime): drop the startup credentials auto-import that called a route that never existed (#3510) #3758 and fix(agent-server): price turns run through OpenRouter at OpenRouter prices #3490 test-merge clean.Handoffs (follow-ups, not in this PR)
docs/diagrams/03-agent-container.mdand09-agent-lifecycle-states.mdshow a staleskills-librarymount.src/mcp-server/src/tools/docs.ts:78still printsoutputs/ # Generated contentin the tree the MCP docs tool returns./tmpis also lost on a plain stop/start (review item I2), which could be one more sentence.Built by trinity-pm's build-chain run
chain-agent-env(plan → rulings → implement → review → fix) through the fleet engineer.🤖 Generated with Claude Code