feat(workflow): configure review precision and approval on the review.pr step

This commit is contained in:
sam committed 2026-10-17 17:00:55 +11:00
1 parent a973bd6567
commit 7e940acad4
19 files changed
+107 -267

No files matched your search

+2 -13
View File
@@ -110,12 +110,11 @@ func channelStateDetail(state status.State, configured bool) string {
}
// ConfigView is the daemon's secret-free snapshot for dashboard handlers.
// Only catalog, review and reload are exposed by /api/config.
// Only catalog and reload are exposed by /api/config.
type ConfigView struct {
SecretEngines []secret.EngineInfo `json:"secret_engines"`
Identity IdentityView `json:"identity"`
Repositories []ForgeRepoView `json:"repositories"`
Review ReviewView `json:"review"`
Chat ChatView `json:"chat"`
Catalog []CatalogProviderView `json:"catalog"`
Reload *config.ReloadStatus `json:"reload,omitempty"`
@@ -144,14 +143,6 @@ type ForgeIdentityView struct {
Repos []ForgeRepoView `json:"repos,omitempty"`
}
// ReviewView mirrors config.Review, neither field of which is secret. It
// carries the value in force after the review-settings resource is layered over
// the file's [review] section.
type ReviewView struct {
PrecisionGate bool `json:"precision_gate"`
ApproveBeforePost bool `json:"approve_before_post"`
}
// ChatView carries the chat page's own settings and the facts the setup
// checklist needs. Secret-free by construction: whether a channel has
// credentials, never the credentials.
@@ -197,10 +188,9 @@ func (s *Server) handleConfig(w http.ResponseWriter, r *http.Request) {
}
writeJSON(w, struct {
Catalog []CatalogProviderView `json:"catalog"`
Review ReviewView `json:"review"`
Reload *config.ReloadStatus `json:"reload,omitempty"`
Bootstrap map[string]string `json:"bootstrap"`
}{Catalog: view.Catalog, Review: view.Review, Reload: view.Reload, Bootstrap: maps.Clone(configuration.DeniedKeys)})
}{Catalog: view.Catalog, Reload: view.Reload, Bootstrap: maps.Clone(configuration.DeniedKeys)})
}
// ConfigViewInput is everything BuildConfigView needs. The configuration
@@ -238,7 +228,6 @@ func BuildConfigView(in ConfigViewInput) ConfigView {
Repositories: reposView(cfg.Repos),
MultiIdentity: len(cfg.Identities) > 0,
Identities: identityForgesView(cfg.Identities),
Review: ReviewView{PrecisionGate: cfg.Review.PrecisionGate, ApproveBeforePost: cfg.Review.ApproveBeforePost},
Catalog: append([]CatalogProviderView{}, in.Catalog...),
Chat: ChatView{ShowToolCalls: cfg.Chat.ShowToolCalls, Operator: strings.TrimSpace(cfg.Chat.Operator), ChannelConfigured: chatChannelConfigured(cfg.Chat)},
Reload: in.Reload,