Ship default plan/code/merge workflow in the binary#62
Open
guettli wants to merge 1 commit into
Open
Conversation
Closes #42. A freshly scaffolded loop used to require three on-disk prompt files just to run the canonical plan -> code -> merge pipeline. The bodies in init.go were the single source of truth, but they were copied into every deployment repo where the operator now had to keep them in sync with upstream by hand. Make the default workflow live entirely in the binary and let `prompts/` stay empty unless the operator wants to customize something. Changes: - Embed plan.md / code.md / merge.md under internal/config/defaults/ and load them through the same parser as on-disk prompt files (parsePrompt is split out of LoadPrompt and shared). - LoadLoop merges the built-ins into the prompt set for any name the user did not override in prompts/. New Config.DefaultPrompts (default true) toggles the merge off for operators who want every prompt to come from disk. Loop.Builtin records which prompts came from the binary. - Add a `default: <name>` front-matter directive so a user file can inherit the built-in body / concurrency / timeout / routes and only override the fields it sets explicitly (typically the labels). Mixing default: with an inline body is rejected as ambiguous. - `agentloop init` no longer writes plan.md / code.md / merge.md; it leaves prompts/ empty and prints a hint that the default workflow is built in. - Tracker.EnsureLabel now takes a description so the labels created in the forge explain themselves. Built-in InputLabels say "override at prompts/<name>.md"; user labels say "edit prompts/<name>.md". Descriptions are capped at 100 chars (GitHub's per-label limit) with an ellipsis. Verified with `./run task check` (gofmt, go vet, golangci-lint and the full test suite).
Open
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.
Closes #42.
Summary
plan/code/mergeprompts underinternal/config/defaults/and load them through the same parser ason-disk prompt files.
LoadLoopmerges these built-ins in for any name the user did not overridein
prompts/. Newconfig.yamlfielddefaultPrompts: falseopts thewhole mechanism off.
Loop.Builtinrecords which prompts came from thebinary so downstream code can distinguish the two cases.
default: <name>front-matter directive: a user file with thisdirective (and no inline body) inherits the built-in's body, concurrency,
timeout and routes, while every field the user sets explicitly wins —
useful for "default body, custom labels".
agentloop initno longer scaffolds prompt files;prompts/is left emptyand the printed hint tells the operator where to look to customize.
Tracker.EnsureLabelnow takes a description and writes per-labeldocumentation into the forge UI. Descriptions are capped at 100 chars
(GitHub's per-label limit) with a trailing ellipsis on overflow.
recipes and the
defaultPromptsopt-out.Test plan
./run task check(gofmt + go vet + golangci-lint + go test ./...)TestInitLoopScaffolds— fresh init leavesprompts/empty and theloop still loads with all three built-in prompts
TestLoadLoopEmptyPromptsUsesBuiltins,TestLoadLoopUserOverridesBuiltinByName— merge / override semanticsTestDefaultPromptsParse— every embedded default round-trips throughLoadDefaultPromptTestLoadPromptDefaultDirective*—default:directive behaviourTestEnsureLabelsWritesDescriptions— built-in vs user descriptionfooter
TestTruncateLabelDescription— GitHub 100-char cap