docs(webui): design a backend-owned config schema for the Configuration page

Field metadata (label, section, type, editability, restart-required)
currently lives only in settings.js/config-row.js, disjoint from the
backend's ConfigView allowlist -- adding or changing a runtime-tunable
setting means editing Go and JS by hand in two places with nothing to
catch drift. Repo.ReviewEnabled never reaches the API at all, and
AllowConcurrent/MaxRetries reach it but the repositories card never
renders them.

Decision: keep the existing secret-free ConfigView allowlist as the
safety boundary (no reflection over config.Config, which is already
scheduled for dissolution), and hand-author a descriptor per allowed
field so the frontend renders sections/fields generically instead of
hardcoding rows.

Filed as archie-core-b6ew (epic) with five dependency-ordered children.
This commit is contained in:
sam committed 2026-09-02 22:01:41 +10:00
1 parent f4b0df5092
commit 2980ffa7c7
2 files changed
+172

No files matched your search

+6
View File
@@ -91,6 +91,12 @@
{"_type":"issue","id":"archie-core-g7tm","title":"telegram: finalize the reply through a live context, matching the error branch","description":"The success path calls live.finalize(turnCtx, reply) with the raw cancellable turn context (telegram.go:582), while the error branch two lines above deliberately uses context.WithoutCancel(turnCtx). If /stop lands during finalize, the rich edit, the plain-text retry, and the split-send fallback all abort with context.Canceled (go-telegram/bot builds requests with NewRequestWithContext), so the authoritative reply is never delivered and the live message keeps the ▌ cursor forever. The reply is persisted to the ledger, so the loss is delivery-level — but the user sees a frozen half-answer.\n\nFailure: a long tool-using turn is /stop-ped as it completes; turnCtx is cancelled mid-finalize; every send fails on the dead context; the chat shows the last live frame with a blinking cursor and no final answer.\n\nFound by code-review of PR #476 (feat/467, merged 98e8dda).","design":"live.finalize(context.WithoutCancel(turnCtx), reply) — the one-liner the error branch already uses. Consider making finalize take a live context internally rather than trusting each caller to remember.","acceptance_criteria":"A /stop landing mid-finalize still delivers the authoritative reply and drops the cursor; a test covers the cancellable-context finalize path.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:08Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:07:36Z","started_at":"2026-08-14T14:53:28Z","closed_at":"2026-08-14T15:03:28Z","close_reason":"Fixed in internal/channels/telegram/live.go and telegram.go: finalize/abandon strip context cancellation before sending (mirroring each other), ToolCall escapes Markdown metacharacters via bot.EscapeMarkdown, splitLongMessage splits on rune boundaries. All new/changed tests verified red-then-green; task check clean; adversarial review pass found no blocking issues.","external_ref":"https://github.com/samcharles93/archie-core/issues/484","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-tb3a","title":"Fix streaming review blockers for inline tool calls","description":"Resolve the four evidence-gated findings in merged inline tool-call streaming: preserve the authoritative Telegram reply when final edits fail; keep Telegram network I/O off the model FullStream consumer and cancellable; correlate tool inputs with results and render a bounded redacted parameter summary; snapshot show_tool_calls per live reply to avoid reload races. Add regression tests for every path and run task check plus lint/race validation.","acceptance_criteria":"Regression tests fail on the merged implementation and pass after the fix. Final edit failure falls back to normal split delivery. Delta and ToolCall callbacks do not wait on Telegram HTTP and stop cancels in-flight rendering. Completed tool events include bounded redacted parameters correlated by tool-call ID. Reload cannot race an in-flight reply's show_tool_calls setting. task check passes, golangci-lint reports no new findings, and focused race tests pass.","notes":"Implemented in worktree /tmp/archie-core-tb3a on branch fix/archie-core-tb3a. Added cancellable async Telegram rendering, final edit failure fallback through normal split delivery, call-ID-correlated bounded conservative parameter summaries, atomic per-reply show_tool_calls snapshots, SSE/UI parameter rendering, rebuilt ui/dist, and regression tests. Validation: GOFLAGS=-buildvcs=false task check passed; golangci-lint --new-from-rev=HEAD ./... reported 0 issues; focused race suite passed; fresh adversarial reviewer reported PASS with zero findings. Plain task check is blocked in linked worktrees by Go VCS stamping exit 128, hence buildvcs override.\n2026-08-24 reconciliation: the close reason's 'worktree left uncommitted' is stale. The work did land on main via ba33527 (Merge pull request #477 from samcharles93/fix/archie-core-tb3a); verified on main: gateway/stream.go sensitiveParameterKey+redactToolParameters, telegram/live.go per-reply showToolCalls snapshot, webui/api_chat.go gating. The /tmp/archie-core-tb3a worktree and its branch are gone, as expected.\n","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T18:05:35Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:29:09Z","started_at":"2026-08-13T18:05:39Z","closed_at":"2026-08-13T18:35:26Z","close_reason":"Completed and independently reviewed; worktree left uncommitted per conservative repository policy.","external_ref":"https://github.com/samcharles93/archie-core/issues/485","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-dzx","title":"Remove duplicate archie-agent safe.directory setup","description":"## Problem\\ncmd/archie-agent/main.go configures git safe.directory inline and then calls markWorktreeSafe, so startup writes the same global git configuration twice.\\n\\n## Scope\\nKeep markWorktreeSafe as the single tested production path and remove the older inline exec.Command block/import. Add regression coverage proving startup wiring has exactly one authoritative safe-directory call.\\n\\n## Acceptance\\n- archie-agent startup invokes markWorktreeSafe exactly once\\n- no second inline safe.directory command remains in main.go\\n- cmd/archie-agent tests and repository quality gate pass","acceptance_criteria":"Single tested safe.directory setup path remains; duplicate inline command is removed; tests and task check pass","notes":"Red proof: TestMainConfiguresWorktreeSafetyOnce failed with 2 setup paths before implementation. Green proof: go test/vet/build ./cmd/archie-agent/... passed; golangci-lint --new-from-rev=HEAD reported 0 issues. Fresh adversarial review found no blockers. Full task check was not run because the working tree contains unrelated in-progress changes and task check rewrites files; scoped package gate used per repository protocol.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:09Z","created_by":"Sam Catlow","updated_at":"2026-08-13T16:13:48Z","started_at":"2026-08-13T16:10:24Z","closed_at":"2026-08-13T16:13:48Z","close_reason":"Removed duplicate inline safe.directory setup; markWorktreeSafe is now the single tested production path","external_ref":"https://github.com/samcharles93/archie-core/issues/470","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-b6ew.4","title":"Structured configuration editors: repositories, maps","description":"Repositories currently render as a static read-only table missing AllowConcurrent, MaxRetries, and ReviewEnabled entirely (ReviewEnabled is absent from RepoView in api_config.go, not just unrendered). Add ReviewEnabled to RepoView, and build a dedicated backend-defined editor for the repositories section (and the models/providers maps) so these stop being silently read-only. This is the concrete fix for the allow_concurrent discoverability gap Sam hit, delivered as a typed editor rather than a one-off card patch, since the schema this epic introduces is what should own its shape.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:00:46Z","dependencies":[{"issue_id":"archie-core-b6ew.4","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.4","depends_on_id":"archie-core-b6ew.2","type":"blocks","created_at":"2026-09-02T12:00:51Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-b6ew.5","title":"Schema contract tests: metadata completeness and secret-safety","description":"Assert every field the schema exposes carries type, label, and section; assert restart_required and editable are set deliberately (not zero-value defaults hiding an unreviewed field); assert secrets still never appear (extend the existing TestHandleConfigNeverLeaksSecrets pattern to the schema response); assert the frontend's generic renderer can render the full schema fixture without any field-specific branch (a JS test walking the schema and asserting no field key appears literally in settings.js).","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:00:46Z","dependencies":[{"issue_id":"archie-core-b6ew.5","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.5","depends_on_id":"archie-core-b6ew.3","type":"blocks","created_at":"2026-09-02T12:00:52Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.5","depends_on_id":"archie-core-b6ew.4","type":"blocks","created_at":"2026-09-02T12:00:52Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-b6ew.3","title":"Generic frontend renderer for scalar configuration fields","description":"Replace settings.js's hardcoded row(...) calls for scalar/bool/int/enum/duration fields with a renderer that walks the backend's sections/fields schema and builds the section cards, labels, and edit affordances from the descriptor alone -- the frontend must not know that containers.max_concurrency is an int or which card it belongs in. Structured fields (repositories, models, providers maps) are out of scope here and keep their existing bespoke rendering, tagged type=structured so the generic renderer skips them without special-casing each key.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:45Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:00:45Z","dependencies":[{"issue_id":"archie-core-b6ew.3","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:45Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.3","depends_on_id":"archie-core-b6ew.2","type":"blocks","created_at":"2026-09-02T12:00:50Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-b6ew.1","title":"Backend configuration schema contract: field descriptor types and section metadata","description":"Define the descriptor types (Section, Field, Option) in internal/webui alongside ConfigView -- Key, Label, Description, Section, Type (string|int|bool|duration|enum|structured), Editable, LockedReason, Overridden, Options, RestartRequired. Hand-author one descriptor per existing ConfigView field, grouped into the sections the settings page already renders (identity, repositories, models, providers, budgets, storage, containers, web). No reflection over config.Config -- config.Config is scheduled for dissolution (internal/config/config.go package doc) and every field here is already a deliberate allowlist entry, so this is metadata on fields that already passed the secret-safety allowlist, not a new safety boundary.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:44Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:00:44Z","dependencies":[{"issue_id":"archie-core-b6ew.1","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-b6ew.2","title":"Expose the config schema via GET /api/config","description":"Extend handleConfig's response with a schema-driven shape (sections of fields, each carrying its descriptor and current value) built from the field descriptors, replacing the flat ConfigView value tree the frontend currently re-interprets by hand. Keep the existing Locked/Overridden/Reload/Provenance top-level fields -- they describe runtime state, not the field catalog, and the schema-driven fields reference into them (locked_reason, overridden) rather than duplicating that logic.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:44Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:00:44Z","dependencies":[{"issue_id":"archie-core-b6ew.2","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:44Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.2","depends_on_id":"archie-core-b6ew.1","type":"blocks","created_at":"2026-09-02T12:00:50Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":2,"comment_count":0}
{"_type":"issue","id":"archie-core-b6ew","title":"[EPIC] Backend-owned configuration schema for the webui Configuration page","description":"The Configuration page's field definitions (label, section, type, editability, restart-required, options) are hand-maintained in ui/src/settings/settings.js and config-row.js, disjoint from the backend's own ConfigView allowlist in internal/webui/api_config.go. Adding or changing a runtime-tunable setting today means editing Go and JS in two unrelated places by hand, and nothing catches drift between them. Repo.ReviewEnabled is missing from the API entirely; AllowConcurrent and MaxRetries reach the API but the repositories card never renders them, which is what blocked Sam from discovering the allow_concurrent fix without an agent tracing the Go source directly.\n\nDesign: docs/prds/config-schema.md. The backend keeps its existing hand-picked, secret-free allowlist (ConfigView in api_config.go) -- config.Config is scheduled for dissolution per its own package doc, so this is deliberately NOT a reflection-based schema over config.Config. Instead each already-allowlisted field gains a hand-authored descriptor (label, section, type, editable, restart_required, options) alongside its existing value, and the frontend renders scalar/bool/int/enum/duration fields generically from that descriptor instead of hardcoding rows. Structured fields (repositories, maps) get dedicated typed editors rather than staying silently read-only.","status":"open","priority":2,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:27Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:00:27Z","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-z6wy","title":"Curator action timestamps rendered as '105694 wks ago'","description":"Curator actions built without an explicit At (e.g. sessioncurator before this fix, and skillcurator) serialized time.Time's zero value to the dashboard, which rendered as a nonsense relative time. Fixed by stamping sessioncurator's action with its clock and backfilling any zero Action.At in activityTracker.record from the pass timestamp.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-02T11:52:20Z","created_by":"Sam Catlow","updated_at":"2026-09-02T11:52:24Z","closed_at":"2026-09-02T11:52:24Z","close_reason":"Fixed: sessioncurator now stamps Action.At from its clock; activityTracker.record backfills any zero Action.At from the pass timestamp as a defense in depth for engines with no clock (skillcurator).","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-enfj","title":"[EPIC] Dynamic workflow routing: route task intent to the cheapest sufficient workflow","description":"workflow.Route() (internal/domain/workflow/workflow.go:237) only checks an explicit t.Workflow, then label match, then falls back unconditionally to 'implement' -- the heaviest workflow. There is no content/intent-based routing at all. task_spawn's own tool schema actively overpromises: 'workflow: ... Omit to let the daemon route it' (internal/gateway/task_tools.go:240), implying real routing exists when it means only 'check labels, then give up and run the heaviest workflow anyway'.\n\nConfirmed via production task 6 (2026-09-02): a chat-spawned task whose entire content was 'this is just a test, close it when you receive it' ran the full implement pipeline (prepare, baseline, plan, build, commit-push) end to end, burning 669,421 tokens and ~7 minutes, when nothing about the request needed a worktree, a plan, or a build at all.\n\nNeeds a design doc before any code lands per CLAUDE.md's scope-discipline rule (no settled design exists).","status":"closed","priority":2,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-09-02T11:29:07Z","created_by":"Sam Catlow","updated_at":"2026-09-02T11:40:00Z","closed_at":"2026-09-02T11:40:00Z","close_reason":"Implemented internal/domain/workflow/triage.go: a cheap classify-only-once AgentStage (still runs StagePrepareWorktree -- AgentStage requires tc.Dir to mount into the container, no cheaper primitive exists) that either closes a task needing no code change (reusing the CloseIssue/StatusMerged pattern feasibility.go's OnResult already established for the same ctx-less constraint) or sets tc.Task.Workflow and requeues under the chosen workflow (implement/tdd/feasibility, defaulting to implement for a missing/unrecognized choice). Route()'s fallback (workflow.go) now prefers reg[\"triage\"] over reg[\"implement\"] when registered, falling back unchanged when it isn't -- fully backward compatible. Registered in skillbuild.builtins(). 9 new tests (triage_test.go, routing_test.go) plus the design doc at docs/prds/dynamic-workflow-triage.md. task check clean.","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-rwzo","title":"Token usage totals mislead: raw prompt sum not netted against cache hits","description":"Confirmed on production task 6 (2026-09-02, carina): dashboard/PR summary showed '14 iterations · 405,004 tokens · 400,021 prompt · 4,983 completion · 360,018 cached'. Cross-checked against the per-iteration daemon log: nothing is double-counted or hardcoded -- the totals are the correct sum of 14 real, separately-billed API calls with growing context. But 360,018 of the 400,021 'prompt tokens' shown were cache hits (billed at a steep discount), not full price -- real fresh spend was ~40,003 tokens. Showing only the raw prompt-token sum makes every agent run's cost read roughly 10x worse than what was actually billed, everywhere this aggregate surfaces (PR body, dashboard timeline).\n\nSeparately (real, not just cosmetic cost): StageBaselineGate's retry-mission prompt re-injected the ENTIRE go test ./... output -- hundreds of lines covering every passing package -- into every retry iteration's prompt, not just the failing ones. Direct mechanical contributor to the growing per-iteration prompt sizes.","design":"TaskContext.RunUsage (in-memory, not persisted -- Task.TokensUsed remains authoritative) accumulates agentexec.Usage across every agent run in one workflow execution. formatTokenUsage(total, usage) renders 'N tokens (F fresh + C cached)' with a plain fallback. extractFailingGateOutput(s) strips go test 'ok' package lines, only when it recognizes --- FAIL:/FAIL\\t markers, else returns input unchanged. Known gap: a task resumed after a daemon restart mid-workflow loses RunUsage and falls back to the plain total -- an honest degrade, not a bug; persisting the breakdown would need a store migration for a purely presentational value, not worth it yet.","acceptance_criteria":"PR bodies and the dashboard timeline show a fresh-vs-cached breakdown (or an equivalent net figure) instead of a raw prompt-token sum, falling back gracefully when no usage breakdown is available. Gate-retry mission prompts drop passing-package output, keeping only failure-relevant content, with graceful degradation for non-Go gates or unrecognized output shapes. task check passes.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-02T11:28:39Z","created_by":"Sam Catlow","updated_at":"2026-09-02T11:28:49Z","closed_at":"2026-09-02T11:28:49Z","close_reason":"Added TaskContext.RunUsage + accumulateUsage (agent.go, implement.go's baseline-fix branch) and formatTokenUsage (workflow.go), wired into implement.go's and tdd.go's PR-body footers plus ui/src/tasks/timeline-event.js's agent_finish rendering (raw prompt replaced with computed fresh = prompt - cached). Added extractFailingGateOutput (workflow.go) trimming go test 'ok' package lines from StageBaselineGate's retry mission, degrading to unchanged output when no --- FAIL:/FAIL\\t marker survives the filter. 5 new Go tests, 1 updated JS test. task check clean, 100/100 JS tests.","dependency_count":0,"dependent_count":0,"comment_count":0}
+166
View File
@@ -0,0 +1,166 @@
# Backend-owned configuration schema for the webui -- decision
**Status:** Approved for `archie-core-b6ew` implementation
**Date:** 2026-09-02
**Beads issue:** `archie-core-b6ew` (epic), with children `.1`-`.5`
## Decision
The dashboard's Configuration page keeps reading a secret-free,
hand-picked view of `config.Config` -- that allowlist is a safety
boundary and stays exactly as it is. What changes is who defines the
page around it: today `ui/src/settings/settings.js` and
`config-row.js` hardcode every row's label, section, type, and
editability by hand; after this, the backend attaches that metadata to
each field it already allows through, and the frontend renders
sections and fields generically from what the backend sends.
This is **not** a reflection-based schema over `config.Config`.
`internal/config/config.go`'s own package doc states it is "scheduled
for dissolution: its types and methods are to be reassigned to the
domains whose behaviour they describe" -- building a generic
schema-from-struct-tags mechanism over a struct on its way out would be
building on a foundation this repo has already decided to remove.
Instead, every field already in `ConfigView` (`internal/webui/api_config.go`)
got there because someone deliberately vetted it as safe to show; the
schema adds a hand-authored descriptor to that same deliberate act,
not a new mechanism that re-derives safety automatically.
## Why now
Task #6's investigation (`/9/26`) found the concrete failure this
produces: `Repo.AllowConcurrent` and `Repo.MaxRetries` already reach
`GET /api/config` (`RepoView` in `api_config.go`), but the
repositories card renders a static read-only table that never shows
them, so the fix for "why isn't a second agent running" required an
agent tracing Go source instead of a checkbox on the dashboard.
`Repo.ReviewEnabled` is worse: it never reaches the API at all. Both
are symptoms of the same root cause -- the frontend decides what a
field means and whether it's shown, and nothing keeps that in sync
with what the backend actually allows.
## Shape
```go
// internal/webui/config_schema.go (new)
type ConfigFieldType string
const (
FieldString ConfigFieldType = "string"
FieldInt ConfigFieldType = "int"
FieldBool ConfigFieldType = "bool"
FieldDuration ConfigFieldType = "duration"
FieldEnum ConfigFieldType = "enum"
FieldStructured ConfigFieldType = "structured" // repositories, models, providers
)
type ConfigField struct {
Key string `json:"key"` // dotted path, matches UpdateConfig's key space
Label string `json:"label"`
Description string `json:"description,omitempty"`
Type ConfigFieldType `json:"type"`
Value any `json:"value"`
Editable bool `json:"editable"`
LockedReason string `json:"locked_reason,omitempty"`
Overridden bool `json:"overridden"`
Options []string `json:"options,omitempty"` // enum only
RestartRequired bool `json:"restart_required"`
}
type ConfigSection struct {
ID string `json:"id"`
Label string `json:"label"`
Fields []ConfigField `json:"fields"`
}
```
`handleConfig` builds `[]ConfigSection` from the existing per-field
values it already assembles, plus `overlay.DeniedKeys` for
`LockedReason` and the existing `Overridden` list -- both already
computed today, just re-attached per field instead of returned as
side-channel maps the frontend cross-references by key string.
`Locked`/`Overridden`/`Reload`/`Provenance` stay as top-level
`ConfigView` fields; they describe runtime state (what happened on
the last reload, which keys the overlay refuses), not the field
catalog, and duplicating that logic per-field would be the same drift
risk this change exists to remove.
`FieldStructured` fields (repositories, models, providers) carry
`Value` as today's structured JSON and are rendered by dedicated
editors, not the generic renderer -- see "What this does not do".
## Sections
Matches the cards the settings page already has: `identity`,
`repositories`, `models`, `providers`, `budgets`, `storage`,
`containers`, `web`. No new sections; this is metadata on existing
rows, not new configuration surface.
## Frontend
`config-row.js`'s `row(label, value, opts)` becomes the renderer's
private implementation detail, called generically:
```js
for (const section of schema.sections) {
const rows = section.fields
.filter(f => f.type !== "structured")
.map(f => row(f.label, f.value, {
key: f.key, type: f.type, options: f.options,
locked: f.locked_reason, overridden: f.overridden,
restartRequired: f.restart_required,
}));
// structured fields render through their dedicated editor (b6ew.4)
}
```
`settings.js` stops knowing that `containers.max_concurrency` is an
`int`, belongs in the "Sandboxed containers" card, or requires a
restart. It knows how to render a section and a field of a given type.
## What this does not do
- **Does not marshal `config.Config` wholesale or add reflection over
it.** The allowlist boundary in `api_config.go` is unchanged; this
adds a label next to a value that was already being shown.
- **Does not make every backend field appear automatically.** A field
still requires someone to write its descriptor, same as it requires
someone to add it to `ConfigView` today -- the fix is one
source of truth instead of two, not zero review.
- **Does not solve structured editing generically.** Repositories and
maps get their own typed editor (`archie-core-b6ew.4`), not a
generic "array of objects" renderer -- a repo's fields have their
own validation shape (owner/name pair identity, gate command
argv) that a generic structured-field renderer would either get
wrong or reinvent per-type anyway.
- **Does not change what `UpdateConfig`/`overlay.DeniedKeys` accept.**
`Editable` on a field descriptor mirrors that existing policy; it
does not grant new write access.
## Acceptance criteria (epic-level; see child issues for per-task detail)
1. Every field currently rendered as a hardcoded row in `settings.js`
has a backend-authored descriptor with type, label, and section.
2. `Repo.ReviewEnabled` reaches the API and the dashboard, alongside
`AllowConcurrent` and `MaxRetries`.
3. Adding a new scalar field to the schema requires one backend
descriptor and zero frontend changes to appear correctly labeled,
sectioned, and editable.
4. `TestHandleConfigNeverLeaksSecrets`-style coverage extends to the
schema response; no descriptor exists for a secret-bearing field.
5. A schema-fixture-driven frontend test asserts the generic renderer
needs no field-specific branch to render every scalar field type.
## Work breakdown
- `archie-core-b6ew.1` -- descriptor types + hand-authored section/field
metadata for every existing `ConfigView` field.
- `archie-core-b6ew.2` -- `handleConfig` returns the schema-driven
shape (depends on `.1`).
- `archie-core-b6ew.3` -- generic frontend renderer for scalar/bool/
int/enum/duration fields (depends on `.2`).
- `archie-core-b6ew.4` -- structured editors: repositories (incl. the
`ReviewEnabled` gap), models, providers (depends on `.2`).
- `archie-core-b6ew.5` -- contract tests for metadata completeness,
secret-safety, and generic-renderer coverage (depends on `.3`, `.4`).