Repository navigation
factory: no chat ever works in codeaf's own folder - #2578
Merged
Merged
Conversation
A factory chat with no checkout of its own fell back to its host's workspace: os.Getwd for a window, worker and runner, and the codeaf home itself (home.Dir()) for the desk's own factory. Every AgentField step's mirror chat was minted there unconditionally, so on a desk each one worked in ~/.codeaf and every save swept graph.db, the factory's clones and credentials into the key vault. AgentField-run jobs (RunOn or an all-AgentField pipeline) now work in the job's own empty folder, <floor>/chats/<job>, which talkFolder already used as its last resort; the foreman falls back to <floor>/chats/foreman. Hosts drop a workspace that is the codeaf home, above it or inside it, and every factory mint site asks factoryFolderRefusal, which refuses the home, its ancestors, and anything inside it outside a job's worktree, clone or own folder. Chats that already name the home stop sweeping it on their next open: cellstore's holdsHome now counts the codeaf home and its ancestors the way it counts the person's home, so only the chat's own folder is sealed. Nothing is moved or deleted. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
A factory chat with no checkout of its own fell back to its host's
workspace, and that was never a project:cmd/codeaf/appfactory_setup.go— the desk's own factory host was built withworkspace: home.Dir(), so the codeaf home ITSELF, whatever the engine's cwd. This is the path the WorkAF desk takes.cmd/codeaf/app_factory.go(newAppFactoryHost),cmd/codeaf/runner_command.go—os.Getwd();cmd/codeaf/factory_run.go— the launch's workspace.cmd/codeaf/factory_agentfield_run.goafRemote.mirrorminted every AgentField step's chat withv3MintSession(bucket, r.workspace, r.workspace)and wroter.workspaceas the header'scwd, so every SWE-AF / RunOn step chat worked in~/.codeaf.foremanMaker) and a stage with no worktree (stageMaker.Open).Every save of those chats ran the seal guard's secret scan over
~/.codeaf—graph.db, factory clones,bin/,credentials.json— into the key vault.The fix
<floor>/chats/<job>— the foldertalkFolderalready used as its last resort, so no new layout. Step mirror chats always use it. A RunOn job's or all-AgentField pipeline's manager uses it too (factory.RunsElsewhere), even when this machine knows a checkout. The chat layer has no "no folder" mode (v3MintSessionneeds a workspace, and an empty one becomes a project bucket keyed on.), so an explicit empty folder is the option the code supports.factoryHostWorkspace); the desk host now has none. The foreman falls back to<floor>/chats/foreman; a stage with no worktree falls back to its job's folder.factoryFolderRefusalis asked by every factory mint site (talk/manager, stage, foreman, AgentField step). It refuses the codeaf home, any folder above it, and any folder inside it that is not strictly inside the floor'swork/,repos/orchats/. The error isa factory chat cannot work in codeaf's own folder (<dir>). Local jobs' worktrees, clones and recorded checkouts pass unchanged.~/.codeaf:internal/cellstoreholdsHomenow treats the codeaf home and its ancestors the way it treats the person's home. Such a chat seals only its own folder, so the scan never walks the home again, whichever door reopens it. Its tools still run there, and nothing is moved or deleted. It shows one notice of its own: "this folder holds codeaf's own folder, so its files are not saved with this chat · …". A folder inside the home, such as a job worktree, still seals as a project.Manual
factory-agentfield.md: new section, "which folder an AgentField job's chat works in".sessions-and-rewind.md: new section, "A chat opened in codeaf's own folder", which quotes the new notice.Tests
cmd/codeaf/factory_chat_folder_test.go. With cwd = the codeaf home, an AgentField step's chat works in<floor>/chats/<id>(empty), not in cwd, not in a folder holding the home, and the header names it. A RunOn manager uses its own folder even when a checkout is known. Local job: its checkout, worktree and clone pass. The guard refuses the home, its parent,v3, the floor,repos,workandbin. A host started in the home gets no workspace. The foreman falls back tochats/foreman.internal/cellstore/codeaf_home_test.go: the codeaf home and its parent are never sealed; a job worktree inside it is.make pr-ready BASE=origin/app/v3passed: the light gate, all of./cmd/codeaf(8 shards) and all of./internal/cellstore, every test on its first run.internal/manualandinternal/namelaware green too.Touches near open PRs
internal/cellstore/engine.goandseat.goonly. #2576 changescaptureplan.goandguard.go, so the files do not overlap. Nothing underinternal/factory/agentfield(#2573) is touched.