Repository navigation
Add full CRUD for roles/models/providers/runners to the control panel - #115
Merged
Merged
Conversation
The panel previously rendered these nested config.yaml maps read-only, forcing an operator to hand-edit the file (e.g. to point a role at a local LM Studio/Ollama server). Settings now has add/edit/remove UI for models and providers, edit-in-place for the two fixed runners, presets and an inline reachability check for local endpoints, and a client-side guard against putting maker and checker on the same model. The server-side writer gained a block-level, comment-preserving splice for these maps (js-yaml stays read-only/validate-only) plus a pre-write schema+safety validation pass, reusing scripts/validate-config.mjs's logic via a new shebang-free scripts/lib/config-validate.mjs so it can be imported without breaking Vite's config bundling.
Adds coverage the product-config fixture never exercised: wiring a first-ever roles/models block into a bare host-mode scaffold (the writer's block-not-found append path), and two tests that verify a saved config actually drives correct behavior downstream (resolveRole/planCycle resolve a local model to the openai-http transport and fail closed on an unreachable runner target), not just that the YAML round-trips.
scripts/lib/yaml-lite.mjs (used by the CLI's validate-config.mjs and by run-cycle.mjs) only read inline "[a, b]" arrays, so examples/demo-app/.modonome/ config.yaml — which writes trusted_author_allowlist and protected_paths_extra as block-style "- item" sequences — silently parsed both as empty strings and failed schema validation. parseFlatYaml now recognizes "- item" lines as sequence elements (scalars only; a sequence of mappings stays out of scope, since every array in the config schema holds plain strings) alongside its existing mapping and inline-array support, with a regression test pinning the shipped example config valid going forward.
…ontrol panel Reconciliation: 15 work items (WI-021, WI-022, WI-026 through WI-031, WI-034 through WI-040) had merged PRs implementing them but were still marked queued/claimed, because transition-work-item.mjs is a manual step and nothing checked state against reality. All 15 are now done. STATUS.md's stale "queue is empty" claim is corrected, and every item gets a backfilled type. To stop this recurring, scripts/check-work-item-staleness.mjs (wired into npm run verify and CI) fails when an open item's own declared test file already passes and its declared deliverable files already exist on disk: strong evidence a PR merged and nobody closed the loop. Work items now carry an optional type (fix-issue, develop-feature, create-article, create-plan, update-docs, chore) and assigned_role (a config.roles key), so the queue can hold more than code changes. The control panel's Work Queue screen gets full CRUD for these: add/edit/delete a work item, with metadata edits (type, role, edit set, gates, caps) always allowed but delete refused outright for anything in flight (claimed through merging) until its lease is released. State, owner, and lease themselves stay off-limits to this surface, changing only through the existing lease/transition machinery. Also fixed along the way: the work-item schema's additionalProperties: false rejected lease_owner, the field transition-work-item.mjs itself writes, so a freshly transitioned item was schema-invalid until manually cleaned up. scripts/validate-work-item.mjs's logic moved to a shebang-free scripts/lib/work-item-validate.mjs so the panel's writer can import it without breaking Vite's config bundling, mirroring the same fix already applied to scripts/validate-config.mjs.
…odel The panel had one write flag that granted edits in both modes equally, so product mode silently edited modonome's OWN governance config (including the autonomy levers). A cloner adapting modonome for their own use could turn autonomy on the tool itself without realizing product mode does that. Now writes are tiered. A connected host repo is writable with MODONOME_PANEL_WRITE=1 alone. A write to this repo's own .modonome (self-governance) additionally requires the local git identity to be a CODEOWNER of the config, so evolving a host stays easy while changing how modonome governs itself is reserved to a code owner. The gate keys off the resolved filesystem path, not the client's mode label, so relabeling a product write as "host" cannot bypass it. Fail-closed on a missing CODEOWNERS, no declared owner, or an identity that is not a GitHub noreply handle. This is an honest local guardrail, not a security boundary: whoever runs the dev server controls the machine. The real teeth stay where they were, and the panel respects both: arming needs the MODONOME_ARMED CI key the panel can never set, and a self-governance change still lands only through a PR under branch protection and CODEOWNERS review. The local check mirrors that merge-time boundary as a fast pre-check. The six write routes now funnel through one writeGate (also the single source of source.writable, so the 403 and the UI read-only state can never drift), the read-only banners show the real reason, and docs/control-panel-modes.md is the full mode-and-permission reference.
…spike) The maker/checker loop's checker was private to the internal loop: it only ever reviewed modonome's own maker output, so a change from a human or a coding-agent session was reviewed only at the merge gate, never by the agentic checker. But the trust boundary was never the internal loop; it is the merge gate (branch protection, CODEOWNERS, required checks). Every producer, the loop, a human, an agent session, is just a maker feeding that one gate. ADR-038 adopts that model and decouples the checker. scripts/agent/review-diff.mjs resolves only the checker role and reviews any diff, whoever authored it, with no maker step and no state mutation. planReview is pure (resolves the checker, enforces model independence, builds an injection-hardened prompt that treats the diff as untrusted data); reviewDiff calls the model only under --execute against a local or gateway endpoint. .github/workflows/modonome-review.yml runs it on every pull request as a secretless, contents:read dry-run that writes to the job summary, so this branch's own PR gets an independent review pass. A live model call and posted PR review are documented ADR-038 follow-ups.
…ack (ADR-039) Roles were a generic registry (WI-040) but each carried only one runner and model. A real crew (maker, checker, researcher, and other agents) needs per-agent skills, permitted tools, and a prioritized model list that falls back from a paid frontier choice to a free or local one when there is no budget. Schema gains roles.*.models (prioritized fallback list), roles.*.skills, and roles.*.tools. resolve-role.mjs gains resolveRoleModelChain (the ordered, resolved chain) and selectUsableModel (budget-aware fallback: local/free always affordable, a paid model needs budget, nothing affordable returns null rather than a silent downgrade); resolveRole now surfaces skills/tools and resolves the primary from a models list, and the distinct-model safety rule uses that same primary. A researcher capability profile is seeded in config, deliberately off the active role_sequence so loop behavior is unchanged. The control panel gains an Agents tab that edits an agent's skills, tools, and model-priority order. This extends ADR-038's model: the maker is a channel-variable producer, while the checker and other integrity agents run over any change. This makes the crew describable and editable; wiring the extended sequence with runtime model fallback into the running loop, running the researcher, and real gated tool execution are tracked as WI-041, WI-042, and WI-043.
Captures the operating model that ADR-038 (checker as a review service) and ADR-039 (agent capability profiles) imply, as one canonical picture with a flow diagram: many interchangeable producers (a human with Claude Code, or a scheduled local-model loop on the Mac), two governed checkpoints, and one common CI. The two checkpoints are one principle at two gates: nothing advances without an independent check. A researcher's proposals are checked before they enter the work-item backlog (Checkpoint 1); a maker's diff is cleared by an independent checker plus common CI before it reaches main (Checkpoint 2). Checkpoint 2 exists today; Checkpoint 1 is the one gap and is tracked as WI-044. The scheduled loop's Mac/local-model wiring is a deployment choice (self-hosted runner or local scheduler), not a code gap.
…g (WI-044) ADR-040's operating model has two governed checkpoints; Checkpoint 2 (a maker's diff faces the checker plus common CI) existed, but Checkpoint 1 (a researcher's proposal before it enters the backlog) had only its deterministic half (validateWorkItem in queue.mjs). This adds the agentic half. scripts/agent/review-proposals.mjs is the same author-agnostic checker at the backlog boundary that review-diff.mjs (ADR-038) is at the merge boundary: it vets whether a proposal is worth doing, well-scoped, safe, and not a way to weaken a gate, with the proposal fenced as untrusted data so it cannot prompt-inject an approval. planProposalReview is pure; reviewProposal calls a model only under execute against a local or gateway checker. queue.mjs gates on it with --review (advisory: report and still queue) and --review-execute (enforcing: skip a rejected proposal); a proposal enters the backlog only on an explicit approval, and a markerless review fails closed. Off by default, so existing queue behavior is unchanged. WI-044 is done; live enforcement in the scheduled channel is the remaining follow-up.
Resolves conflicts in the generated snapshot (regenerated) and fixes two lexicon-gate hits from main's new check (work packet -> work item in schemas/work-item.schema.json and modonomeReader.mjs).
Summarizes the control-panel CRUD, agent capability profiles, and the two governed checkpoints added across this branch, per the repo's own changelog convention.
Move the control-panel/design-system dependency install earlier in the ratchet job so tests that import apps/control-panel/server/*.mjs (which needs js-yaml) can resolve it before the test suite runs. Also close a TOCTOU window in createWorkItem by making the existence check and the write atomic, and drop an unused helper.
…e Lexicon Gate and Tripwires PRs
nateshpp
force-pushed
the
feature/control-panel-model-wiring-crud
branch
from
July 5, 2026 02:21
130b3ac to
d0f95b5
Compare
The verify job runs its own test-and-coverage pass and never installed apps/control-panel's dependencies, so it hit the same js-yaml import failure as the ratchet job. Also re-verify and refresh the OpenSSF badge evidence doc: coverage numbers had moved, and the gate-integrity receipt is now keyless-signed via Sigstore, which changes three claims from gap/N-A to partial.
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.
The panel previously rendered these nested config.yaml maps read-only, forcing an
operator to hand-edit the file (e.g. to point a role at a local LM Studio/Ollama
server). Settings now has add/edit/remove UI for models and providers, edit-in-place
for the two fixed runners, presets and an inline reachability check for local
endpoints, and a client-side guard against putting maker and checker on the same
model. The server-side writer gained a block-level, comment-preserving splice for
these maps (js-yaml stays read-only/validate-only) plus a pre-write schema+safety
validation pass, reusing scripts/validate-config.mjs's logic via a new shebang-free
scripts/lib/config-validate.mjs so it can be imported without breaking Vite's config
bundling.