Repository navigation
Description
Summary
The four post-deploy system endpoints (GET /api/systems, GET /api/systems/{name}, POST /api/systems/{name}/restart, GET /api/systems/{name}/manifest) are essentially untouched since the original 2025 implementation, while every commit since ent#124 hardened the deploy half (ent#125/#126, #1884, ent#314, ent#89). A review pass found four verified defects on those endpoints plus two cheap preview hardenings that belong in the same PR.
Defects
1. GET /api/systems/{name} silently drops the schedules key — nonexistent DB method.
routers/systems.py:251 calls db.get_agent_schedules(agent['name']). DatabaseManager exposes list_agent_schedules and get_agent_schedules_summary — there is no get_agent_schedules and no __getattr__ fallback (database.py documents this deliberately). The AttributeError is swallowed by the except Exception a few lines below, so every response omits schedules for every agent and logs one warning per agent. tests/test_systems.py never asserts on the key, so CI is green. This is exactly the mocked-database-module failure mode the db facade's own comment warns about.
2. POST /api/systems/{name}/restart has no role gate.
The route is gated on bare get_current_user (routers/systems.py:274), while POST /deploy and even the read-only bundled-catalog routes are require_role("creator"). Any authenticated principal — including role: user, and agent-scoped MCP keys (which resolve to their owner carrying the owner's role) — can stop/start every container in any system whose agents it can see. Unlike POST /api/agents/{name}/start it also skips enforce_agent_spawn_scope. A mutating fleet-wide verb sitting below the gate of the read-only catalog is an oversight, not a decision. Fix: require_role("creator") (which now rejects agent principals per #1890) at minimum; confirm whether per-agent start/stop authorization should also apply per member.
3. export_manifest round-trip breakage (two related defects).
- The non-full-mesh permissions branch in
services/system_service.pyslicestarget_agent[len(system_name)+1:]with nostartswith(f"{system_name}-")filter — the sibling explicit-permissions branch has one. A permission edge pointing outside the system exports as a blind-sliced garbage short name, which then failsvalidate_manifest's "unknown agent in permissions" check on re-deploy → 400. Round-trip broken. - The export injects the instance-global
trinity_promptsetting as the manifest'sprompt:. Deploying that exported manifest on another instance overwrites that instance's platform-wide prompt. Nothing records whether the source system ever set a prompt, so the honest fix is to stop exporting the global prompt entirely.
4. Membership matching by name prefix collides across systems.
get_system, restart_system, and export_manifest all match agents via startswith(f"{system_name}-") — so operations on system acme also capture every agent of a system named acme-extra. list_systems' split-on-hyphen derivation means the bundled 11-agent vc-due-diligence manifest does not round-trip through its own list endpoint (it groups under vc-due-diligence-dd), hyphen-less agents are dropped entirely, and any hyphenated standalone agent becomes a phantom system (trinity-system → system "trinity"). Deploy already applies the system name as a tag on every member (configure_tags), so membership should prefer the system tag with the prefix as fallback for pre-tag deployments.
Hardenings (same PR)
5. Per-agent unknown-key warnings. parse_manifest reads five specific per-agent keys and silently drops everything else — agents.x.credentials:, agents.x.skills:, agents.x.display_label: all vanish with no warning, while top-level unknown keys already warn (ent#126). This is precisely the set of fields users try first. ~15-line fix.
6. Preview/deploy resource-default drift. _preflight_template validates against the admin-configurable settings_service.get_agent_default_resources() while deploy_manifest hardcodes {"cpu": "2", "memory": "4g"} when the manifest declares no resources. The one spot that escaped ent#126's pure-resolver no-drift pattern.
Acceptance Criteria
-
GET /api/systems/{name}returns realschedulesfor agents that have them, with a test asserting on the key (not just 200). -
POST /api/systems/{name}/restartisrequire_role("creator")-gated; an agent-scoped key is rejected; test pins both. - Export → validate → re-deploy round-trips green with a cross-system permission edge present (edge dropped or scoped, never blind-sliced).
- Exported manifests no longer embed the instance-global prompt.
-
get_system/restart_system/export_manifestkey membership on the system tag with prefix fallback; operations onacmeprovably never touch anacme-extraagent. - Unknown per-agent manifest keys surface as preview warnings, mirroring the existing top-level behavior.
- Preview and deploy resolve the identical resource default (single source).
-
docs/memory/feature-flows/system-manifest.mdupdated (its line references are also stale).
Technical Notes
- All defects live in
src/backend/routers/systems.pyandsrc/backend/services/system_service.py; the deploy path itself (parse/validate/preview/deploy/seed) is healthy and out of scope here. - Fix fix: add missing logging_config.py to backend Dockerfile #4's tag-based membership is also the prerequisite for the upcoming system teardown verb (tracked separately), so the predicate should land as one shared helper, not per-endpoint copies.
list_systems' derivation defects are fully fixed only by persisting deployed systems (a larger, separate design); within this issue the goal is that tag-based membership makes get/restart/export correct, andlist_systemsat least stops mis-grouping tagged systems.
Activity
dolho commentedon Aug 27, 2026
/claim
github-actions commentedon Aug 27, 2026
Claimed by @dolho. Label
status-in-progressadded.Next steps:
feature/2373-<short-slug>Fixes #2373fix(2373): restart_system is human-only; drop a false claim about req…
fix(systems): the four post-deploy endpoints — a nonexistent DB call,…
fix(2373): restart_system is human-only; drop a false claim about req…
fix(review): a credential disclosure, two membership defects, and a b…
12 remaining items
refactor(systems): structured membership + one auto-view vocabulary (A…
test(systems): pin the destructive-read membership primitive as prope…
Release: v0.9.5 (#2872)
fix(systems): an unconfirmable member is opt-in, never pre-ticked (Ab…
feat(systems): the public half of system teardown — a structured memb…
feat(systems): export and get_system_manifest round-trip `naming` (en…
feat(systems): skills and skill_sets in the manifest (ent#1030 CP1)
feat(systems): a manifest states the whole desired shape, and apply r…
fix(systems): suffixed keys reparse, bare membership by tag, declared…
fix(systems): bare-naming edge cases: key rule, naming-aware membersh…
fix(systems): apply and deploy results name only what was observed or…
fix(systems): an exported manifest applies back clean; unobserved fie…
fix(systems): a failed gate write on a held skill says the skill runs…