Repository navigation
Group agents by engine in the directory tree - #88
Merged
Merged
Conversation
With the engines named in gete.yaml, an agent refers to its engine by name, but the tree still does not show which agent is listed where: every agent sits directly below agents/, and the engine is one line inside each agent.yaml. With a dozen agents across several engines the natural layout is one directory per engine, and until now that layout was ignored without a word. load_project read agents/*/agent.yaml and nothing else, so validate passed, terraform wrote no module call for the agents below the group and dropped the ones it had written, and the plan destroyed their reasoning engines. A directory below agents/ that carries a named engine's name now holds the agents listed in that engine. They need no registration block; one that disagrees with the directory is reported, and the directory is what counts, since it is what the tree shows. The name still matches the agent's own directory, so the module address, the service account, and the archive are unchanged by the move: only the generated agent_directory changes, and nothing is recreated. Groups go one level deep. A directory below a group without agent.yaml is reported, and so is a directory below agents/ that is neither an agent nor a named engine, since stepping over it quietly is what made the layout dangerous: a misspelt engine would take every agent below it out of the project. Hidden directories are tooling and stay unreported, as they stay out of the archive. Two directories with one name, which a flat agents/ could not hold, are reported on both: the module, the service account, and the reasoning engine are named after it. 🤖 Generated with Claude Code
gete init sales/mail-triage writes agents/sales/mail-triage/, where the agent is listed in sales by where it sits. The engine has to be named in gete.yaml first: validate refuses the directory otherwise, and a scaffold that fails its own validator teaches the wrong shape. One level only, like the loader. When init created the project and then refuses the group, the files it did write are still listed, since the gete.yaml among them is where the engine goes. 🤖 Generated with Claude Code
🤖 Generated with Claude Code
With the engines named, a top-level agent may carry an engine's name, and the loader reads a directory with agent.yaml as that agent before it looks for a group. An agent written below it, which gete init accepted, was then stepped over without a word and validate passed: the silent skip the grouped layout was meant to remove, back through a side door. The loader now reports an agent.yaml found below an agent named after an engine, and init refuses both shapes before writing: a group below a directory that is an agent, and an agent on top of a directory that already holds the engine's agents. A grouped agent whose registration block carries the engine's id was reported twice, once for not being a name and once for disagreeing with the directory. The directory is what counts there, so the block gets the one line that says so. 🤖 Generated with Claude Code
Merged
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.
Why
Since the engines were named in
gete.yaml, an agent refers to its engine by name, but the tree still does not show which agent is listed where: every agent sits directly belowagents/, and the engine is one line inside eachagent.yaml. With a dozen agents across several engines the natural layout is one directory per engine:Until now that layout was ignored without a word.
load_projectreadagents/*/agent.yamland nothing else, so:gete validatepassed,gete terraformwrote no module call for the agents below the group. Files written for them before a move stayed behind and pointed at directories that were gone; regenerated from a cleanterraform/, the module calls were simply missing,agents_dirdoes not help: it names one directory, and only its direct children are read.What
Agents grouped by engine. A directory below
agents/that carries a name fromgemini_enterprise.enginesholds the agents listed in that engine. They need noregistrationblock. A block that agrees with the directory is accepted; one that disagrees is reported, once, whether it names another engine or writes an id, and the directory is what counts, since it is what the tree shows.register,graph, and--check-secretsread the engine throughAgent.engine, so they see the group without changes of their own.Nothing is recreated by the move. The agent's name still matches its own directory, so the module address, the service account, and the archive are unchanged. Only the generated
agent_directorychanges:Strays are reported, not skipped. Stepping over a directory quietly is what made the layout dangerous, so
validatenow reports:agents/with noagent.yamlthat names no engine (a misspelt engine would otherwise drop every agent below it),agent.yaml(groups go one level deep),agent.yamlbelow a top-level agent that carries an engine's name: that directory is the agent, not the group, so an agent put there would otherwise be stepped over,registrationblock that disagrees with the group,agents/could not hold and which would fight over one module, service account, and reasoning engine.Hidden directories (
.venv, a VCS directory) are tooling and stay unreported, as they stay out of the archive.gete init sales/foo-agentscaffolds the agent below the engine's directory. The engine has to be named ingete.yamlfirst; otherwise init refuses, and lists the files it did write, since thegete.yamlamong them is where the engine goes. Init also refuses, before writing anything, the two shapes the loader would report: a group below a directory that is an agent, and an agent on top of a directory that already holds the engine's agents.Flat projects work as before. Top-level agents and groups coexist, which is also where an agent listed in no engine goes.
Decisions
gemini_enterprise.enginesthere are no groups; the message says to name the engines.agent.yamlis that agent, whatever its name; the loader reports what sits below it, and init refuses to write it.gete init.agents/withoutagent.yamlused to be skipped; it is now avalidateproblem. The old test that pinned the skip is replaced. The same holds for a customagents_dir: a directory there that is neither an agent nor a group is reported, so anagents_dirthat also holds other content no longer validates.Checks
uv run pytest -q: 987 passedruff check,ruff format --check,mypy: cleanexamples/minimal:gete validateandgete terraform --checkpass