Skip to content

feat(systems): the public half of system teardown — a structured membership read, a license-blind MCP proxy, and a gated remove panel (abilityai/trinity-enterprise#454) - #2756

Merged
vybe merged 29 commits into
devfrom
AndriiPasternak31/ent454
Sep 21, 2026
Merged

vybe merged 29 commits into
devfrom
AndriiPasternak31/ent454

Conversation

@AndriiPasternak31

@AndriiPasternak31 AndriiPasternak31 commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Refs abilityai/trinity-enterprise#454 · epic abilityai/trinity-enterprise#122

Deploy had no inverse. Removing a manifest-deployed fleet meant DELETE /api/agents/{name} once per member by hand — eleven times for the bundled vc-due-diligence manifest — which is why the install UI warned "there is no un-deploy", why the bundled manifest's own header told operators to delete the fleet before re-deploying, and why the duplicate-deploy trap (_N-suffixed copies) had no recovery path.

This is the public half of a two-repo change

ent#454 is a type-feature in the enterprise tracker, so per CLAUDE.md it is entitlement-gated by default and the verb itself lives in the private submodule. This PR carries only what belongs in this repo:

Here In trinity-enterprise
the edition-agnostic membership primitive the system_teardown module (router + service + models)
SYSTEM_VIEW_AUTO_DESCRIPTION its registration, tests, and feature flow
the license-blind MCP proxy tool
the entitlement-gated Vue panel

Neither submodule gitlink is bumped — verified on the remote after pushing (git ls-tree origin/<branch> .claude src/backend/enterprise byte-identical to origin/dev), not with git status, because this clone sets diff.ignoresubmodules=all and a bump is invisible to both status and diff there (the thing that ejected #2559 from the merge train). The enterprise gitlink moves after the private PR merges, as a separate step (the ent#279 precedent).

The public half stands on its own on an OSS build: the MCP tool degrades on a 404 and the Vue panel renders nothing.

This PR merges FIRST. trinity-enterprise's CI checks out Abilityai/trinity at ref: dev, so the private module's 40 tests currently fail there with ImportError: cannot import name 'system_membership' — they import the OSS primitive this PR adds. That is a structural property of the seam rather than a defect: a private module consuming a new OSS primitive cannot be CI-green before the OSS half is on dev. Nothing in this PR depends on the private one.

The one interesting decision: refuse, don't degrade

system_member_names (#2373's ONE membership predicate) keeps its signature and becomes a thin wrapper; the body moves verbatim into system_membership, which additionally returns two facts the flat name list discarded:

  • tags_readable — that body deliberately degrades to the raw name prefix when the tag read fails, and bug: post-deploy system endpoints — schedules silently dropped (nonexistent DB method), ungated restart, export round-trip breakage, prefix-collision membership #2373 argues the ranking at length: for restart, over-capture restarts one extra container and logs it, while under-capture restarts a SUBSET and reports success. A verb that deletes inverts the cheap half — over-capture removes an innocent agent's container, and the metadata is recoverable but the container is gone. So teardown refuses (503, zero writes, zero audit) where restart proceeds. Same data, different ranking, one predicate — the divergence is taken at the consumer's own call site, so get_system / restart_system / export_manifest keep the behaviour they were designed around.
  • evidence (tag | prefix | both) — why each name is a member, derived from the same two sets that already decided membership. The prefix fallback's documented residual (acme may capture acme-extra-worker) becomes visible instead of silent, which is what lets the UI say "matched by name only" and take an operator's opt-out.

Pinned as properties, because cases already failed here three times

#2373's fallback rule was wrong three times and each wrong rule passed the case test written for its predecessor (learnings.md, 2026-08-31) — one of them returned 0 of 11 members for the flagship manifest, so a healthy fleet read as 404 System not found. So the invariant is a Hypothesis property: members ⊇ raw prefix match whenever the tags are unreadable, tagged ⊆ members whenever they are readable, plus wrapper equivalence and evidence honesty over generated rosters. Any future narrowing fails by construction, whatever shape it narrows on. The named incidents stay as discrete cases — the fixture, not the ceiling.

One counterexample Hypothesis found is kept as an honest asymmetry rather than papered over: an empty roster never reaches the tag read, so it reports tags_readable: True. A destructive caller refuses on False, and refusing a teardown of a memberless system would be a 503 where 404 is the truth.

SYSTEM_VIEW_AUTO_DESCRIPTION

Nothing persists a system↔view link: create_system_view marks the view it creates only by its description plus the system tag. That description is the identifier, so the literal moves into one constant shared by the writer and by any reader that has to find the view again.

MCP — license-blind, and preview-first

teardown_system proxies the gated route and knows nothing about entitlement. It never throws (a thrown error reaches an agent as an opaque transport failure it cannot reason about) and keeps three situations distinct: 404 (no such build) / 403 (not licensed, or an agent key on a human-only verb) / 503 (unverified membership, flagged retryable). Flattening them is how a human on a user key gets told a licensed feature "doesn't exist". A failed report arriving as a 500 comes back as a result — its per-member reasons are the only actionable output.

It reads ApiError.body rather than regexing ApiError.message; that field exists for exactly this, and its own docstring says the regex is what breaks when the message format changes.

dry_run defaults to true — the opposite of deploy_system. An unwanted preview costs a round trip; an unwanted execute costs a fleet.

UI

Library → Systems gains a gated second panel: preview → per-agent checklist → acknowledgement → remove.

The preview is a checklist, which is the design rather than decoration: a prefix-evidence member may belong to a sibling system, the server cannot tell which, so the badge plus the per-member box is the over-capture escape hatch. Which boxes arrive ticked is the load-bearing half — a confirmed member is ticked (opt-out), a prefix member is unticked (opt-in), and the short selection is explained above the list. That default lives in the store (teardownDefaultSelection), not the panel's watcher, so a node-environment vitest can execute it; see the rendered-UI round below for why that matters. Remove is gated on four conditions — preview current for the typed name, membership verified, consequence acknowledged (ent#126's ack-checkbox contract reused), ≥1 agent checked — and a disabled button says which is missing.

Tone switches on status, never the HTTP code. skipped / failed / aborted render as three different things with per-reason copy, because a refusal is not a breakage and an un-attempted member is neither; a discarded ghost never claims recoverability. A timeout says "outcome unknown" and offers no retry — cancelling does not cancel the serial server-side removal.

ManifestPreview's "there is no un-deploy" now tracks the capability. Retiring it everywhere because one edition gained the verb would have been the dishonest fix; it is still exactly true where the module is absent.

Design contract: token-only (scanner: 0 non-gray, 0 hex across all six systems files), both themes, primitives only, bounded member viewport with a stated total, no bare loading gate — the in-flight flags reach only BaseButton.

AC 6, proven on a real stack: acme vs acme-extra

The issue asks for a collision test pinning the #2373 predicate. Unit properties cover the
predicate; this covers the verb — real containers, really deleted, on a live stack
(isolated compose project on :8100, branch @ c73cf2875).

Fixture — two systems, one name a prefix of the other:

acme        ->  acme-web, acme-db          tagged ['acme']
acme-extra  ->  acme-extra-worker          tagged ['acme-extra']

"acme-extra-worker".startswith("acme-") is true, so a raw-prefix match claims it.
Only its own tag excludes it. Both runs asked to remove every current member of acme
with NO confirm list
— nothing the harness did could spare the sibling, only the product could.

Run A — tag read genuinely broken (ALTER TABLE agent_tags RENAME COLUMN tag TO …):

Check Result
positive control GET /api/agents (reads tags, no try/except) HTTP 500 — the fault is real, not simulated
preview 200 — renders rather than refusing
membership_verified false
preview contents all three, every one evidence: prefix — the over-capture is shown, not silent
warning names the 3 name-only matches and states teardown will refuse
execute 503, zero writes, zero audit rows
containers afterwards all three alive, acme-extra-worker included

Run B — tag read working:

Check Result
preview 200, membership_verified: true
preview contents exactly acme-db + acme-web, both evidence: both
acme-extra-worker excluded by its own tag
execute status: torn_down; both outcome: deleted, recoverable: true (soft delete)
survivor acme-extra-worker alive

That asymmetry is the design, not a flake: Docker-unreadable refuses on both paths; a
failed tag read renders a flagged preview and refuses only on execute. A preview that
cannot mutate anything is more useful showing you the over-capture than hiding it.

Three things that would have produced a false green, recorded because they nearly did:

  1. docker/backend/Dockerfile never COPYs src/backend/enterprise, so the prod image is
    OSS-only
    and verify-local gives zero coverage of the gated half. The proof stack must
    use the dev compose, whose ./src/backend:/app bind-mount is what puts the module in the
    container. Entitlement needed no license — EntitlementService is a Phase-0 stub, so
    mounting is the grant.
  2. Injecting the tag fault as ALTER TABLE agent_tags RENAME TO … self-heals: any probe
    that imports Trinity's database runs schema init, and CREATE TABLE IF NOT EXISTS
    recreates it empty (proven after the fact: old table 3 rows, new table 0). The run then
    tests "system has no tags" — where membership_verified: true plus three evidence: prefix
    members is the correct answer — while claiming to test a failed read. Rename a column;
    never probe the system under test through a side channel that boots its own app context.
  3. The bundled default-system.yaml deploys a system literally named acme, so a fresh-DB
    proof stack must pin TRINITY_DEFAULT_SYSTEM_MANIFEST=disabled or first-run seeding adds
    three more members to the system under test.

Verification

Run, not read — every number below came from executing the command, and re-run after the
rebase onto dev @ eb41896f5.

Result
tests/unit/ (/verify-local, py3.13) 15594 passed, 27 skipped, 1 deselected — 0 failed
targeted re-run post-rebase test_ent454_teardown_membership + test_ent454_teardown_frontend + test_2373_system_endpoints — 76 passed
frontend test:unit 3180 passed / 140 files — includes the raw-color and loading-gate ratchets, green against dev's regenerated baselines
mcp-server tsc --noEmit clean; 383 passed / 0 failed
check:tokens clean
lint_root_test_placement / lint_sys_modules clean, no new violations
enterprise-docs-guard the workflow's own grep, run verbatim — clean
verify-local PASS — unit 593s · build+import-smoke 16s · boot+health 14s · integration 70 passed / 13 skipped

--skip-agent is on the merits: zero docker/**, startup.sh or requirements*.txt in
either tree.

The verify stack layers on docker-compose.prod.yml, which has no source mount — so it boots
an OSS-only edition. That is exactly the right primary check here: it proves the public
half does not require the submodule, the property this split depends on. It is also why the
real-stack proof above had to be run separately.

Teeth measured, not assumed. Eleven mutations, each killing ≥1 test against a clean control
(degrade-instead-of-refuse 3 · dry-run-falls-through 2 · stop-excluding-is_system 4 · drop
reject_agent_principal 1 · require_role("admin") 1 · auth-check-after-roster-read 2 ·
ignore-confirmed-set 2 · agents positional 3 · preview-POSTs-to-deploy 8 · failed-as-error 1 ·
gate removed 1).

One mutation survived the first pass and exposed a real gap: "the preview is bound to its
name" stayed green with the name comparison replaced by true, because the setter nulls the
preview and the null-check carried the assertion alone. A test now uses the direct-assignment
bypass the comparison actually guards.

/review has run — four defects, all fixed in this branch

The structural pass ran after the first push and found four real defects. Each is fixed,
tested, and committed here; the one that matters most is C1.

The rendered-UI round — four more defects, found by clicking, not by CI

/review is a structural pass over the diff; it does not render. Nothing in CI renders these
components either
, and that is not an oversight to fix in passing — vitest.config.js pins
environment: 'node' with zero component mounts, tests/unit/test_ent454_teardown_frontend.py
is source-level regex, and the green e2e runs system-install.spec.js, which never touches
teardown. So four defects survived a green board and a full /review, and were found by driving
a live stack.

  • The preview pre-ticked every member regardless of evidence — the one that matters. An
    agent the server matched by NAME with no deploy tag arrived ticked, making the escape hatch
    an opt-OUT on a verb that deletes. The 503 refusal does not cover it: that fires only when
    the tag read FAILED, and a prefix member also appears in the healthy state — tags read
    fine, that one agent simply has no tag row — where membership_verified is true and Remove is
    enabled. §3's own ranking argument is the reason: under-capture is cheaper than
    over-capture for restart and inverts for a verb that deletes, which is why teardown
    refuses rather than degrades everywhere else. The default handed it back in the one state the
    refusal misses. The rule moved to the store, where a node-environment test can execute it.
  • The refusal banner named the tag read for a flag that cannot identify it.
    membership_verified is tags_readable AND roster_complete — one boolean over two independent
    faults — so on the roster arm the banner was simply false: tags readable, agent LIST
    incomplete. It now states the consequence (identical either way) and quotes the server for the
    cause. The roster warning used to fall through to "Notes", i.e. the real fault in a footnote
    beneath a banner naming the other one.
  • (N tagged) was not a tag count. SystemTeardownTag.member_count is len(members) —
    every candidate, tagged or not — so the word overstated the tag whenever any member was
    prefix, and in the refusal state it quoted a figure from the very read the banner says
    failed. Dropped; the total is already stated on the list.
  • "Try the preview again in a moment" was transient-fault advice for a schema/permission
    fault that never clears — re-previewing returns the identical screen forever, training the
    operator to read a real stop as flakiness.

A fifth, found by driving the real panel in a browser after the four above were fixed. The
preview watcher was not immediate, and the store outlives the component: Library.vue mounts
the systems section lazily and nothing resets teardown state on unmount, so leaving the page and
returning remounts the panel onto a preview that is still current — the watcher never fires
for it, and the removal set rendered with every box empty and "Select at least one agent".
Pre-existing (the old all-members default had the same hole) and fail-safe in both directions,
which is why it survived; but it made the component's own stated default untrue on the second
visit. The store spec cannot see it — the rule is right, the wiring never ran.

Each guard was proven to bite by reverting the fix: the three copy/markup fixes → 5 red, the
banner-arm fix → 2 red, the remount fix → 1 red, the store rule → 4 of 5 red (the fifth is the
no-preview case, correctly insensitive).

Rendered and driven in a real browser, via a throwaway Vite+Playwright harness that mounts
the panel over a real pinia store — no backend, no stack. Measured there, not reasoned:

case boxes Remove blocked reason
healthy (acme-db is prefix) web=ON db=off worker=ON Remove 2 agents consequence not yet acknowledged
refusal (server marks all prefix) all off Remove 0 agents, disabled membership cannot be verified
healthy but wholly untagged all off Remove 0 agents, disabled select at least one agent
all confirmed all ON Remove 2 agents consequence not yet acknowledged
then tick acme-db + acknowledge — Remove 3 agents, enabled —

Both themes screenshotted and read. Contrast measured on the two elements this round adds —
light 4.92 / 7.6, dark 10.99 / 9.7, all AA, and identical to their existing siblings, which
is the point: the recipe was matched, not reinvented. The harness is deliberately not
committed — a real render tier is the ui-labeled e2e follow-up below, not something to smuggle
in here.

Three commits touch shared primitives — here is the scope reason

BaseButton.vue and BaseInput.vue are not this issue's files, so the blast radius is stated
rather than assumed. Both were found through this panel and both are defects in the primitive,
not in the caller — fixing them at the call site would have left every other caller broken.

  • BaseButton: secondary rendered borderless in light mode, across 24 call sites. The base
    class string carried border-transparent beside the reserved border width while secondary
    set border-gray-300; equal specificity, so emission order decided and the resting keyword
    won. It survived review because dark mode won by accident — dark:border-gray-700
    compiles to .dark .border-gray-700, one class heavier — so the theme most of us work in was
    correct. This is the #2662 cascade trap in the contract, and the fix is the shape
    fieldClasses.js already documents one primitive over: the base reserves the width, each
    variant names its colour. Guarded by baseButtonVariantBorder.spec.js, which pins the base
    colour-free, asserts both themes (the bug was theme-asymmetric, so a light-only pin would
    let the next edit break dark while staying green), and fails closed on a fifth variant.
  • BaseInput: :aria-describedby was applied after v-bind="controlAttrs", so a caller
    that owned its own help text did not merely lose the merge — its aria-describedby was
    erased, and the help paragraph stopped being announced. Now handed back; error and help
    still win in that order, so no existing caller changes.
  • The third is layout only: the preview action aligning on the field rather than 22px below it.

Those three had never been through CI before this push. The BaseButton claim is now measured
on a live render rather than taken on trust: the secondary control's resting border computes to
1px solid rgb(209,213,219) (gray-300) in light and rgb(55,65,81) (gray-700) in dark — visible
in both, which is exactly what the commit said and what it was not doing before.

One correction for the reader: the BaseInput commit message says "no @vue/test-utils in this
project". That was wrong — it is present at 2.5.1 and tests/unit/portalThemeSwitch.spec.js
already uses the // @vitest-environment jsdom escape hatch. The a11y half is still
browser-verified rather than unit-pinned, so the conclusion stands; only the stated reason was.

Not claimed

  • No schema change in either track, so Invariant Fix git pushing bug #9 does not apply (stated, not skipped).
  • The real-stack proof covers the happy and refusing paths on two colliding systems. It does
    not cover a partial failure mid-teardown (one member failing while others succeed) against real
    containers — that path is unit-tested with an injected double, not proven live.

For the reviewer

  • Refs, not Fixes: a cross-tracker closing keyword does not fire, so status-in-dev on
    ent#454 needs setting by hand
    , and the issue is closed manually at the release cut.
  • Merge order and the unbumped gitlinks are covered above — this one lands on dev first,
    and neither submodule pointer moves in it.
  • The AC's URL changed under gating. The issue title says DELETE /api/systems/{name}; it
    ships as DELETE /api/enterprise/system-teardown/{name}?dry_run=<bool>, because all 15
    existing gated modules mount under /api/enterprise/<module> with no exceptions, and an
    enterprise router on the OSS /api/systems prefix would be the first prefix split across
    editions. Reverting is a one-line prefix change plus a route-order test — say the word.
  • Not self-merging (SOC 2 separation of duties).

Follow-ups to file (not this PR)

  1. GET /api/systems groups by the last hyphen, not the bug: post-deploy system endpoints — schedules silently dropped (nonexistent DB method), ungated restart, export round-trip breakage, prefix-collision membership #2373 predicate —
    vc-due-diligence-dd-analyst → vc-due-diligence-dd, which the predicate resolves to [].
    The teardown UI deliberately never sources names from it. (bug, public)
  2. Extract delete_agent_endpoint's body into services/agent_service/lifecycle.py. Right
    long-term; wrong for this PR, which does not need the hottest destructive path in the
    codebase moved. (refactor, public)
  3. e2e/system-install.spec.js refuses to deploy for real "because there is no un-deploy". On
    an entitled build that premise is now false. (test, public)
  4. A ui-labeled e2e that actually renders the teardown panel. Four defects reached a green
    board because three review layers all read this component's SOURCE and none mounted it; the
    throwaway jsdom harness used in this round proves the shape works and was deliberately left
    uncommitted rather than half-introducing a render tier. (test, public)

🤖 Generated with Claude Code

@AndriiPasternak31 AndriiPasternak31 added the ui PR touches the frontend UI — triggers Playwright e2e tests label Sep 13, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Live-instance suite skipped — merge conflict against dev.

Resolve by merging dev locally and pushing the result; the next nightly re-tests.

AndriiPasternak31 and others added 11 commits September 14, 2026 23:12
…ity-enterprise#454)

Rule #1: requirements before implementation. Records only what lives in this
repo — the edition-agnostic membership primitive, the license-blind MCP proxy
and the Vue gate — and states plainly that the teardown control plane is an
entitlement-gated module in the private submodule (404 on an OSS build). The
paid module's surface and internals stay in the private tree (ent#45).

Also cross-references §33.1: a teardown is N of that soft-delete composed
through the same endpoint, so the 180-day window, name reservation and
schedule freeze are preserved by construction rather than re-implemented.

Co-Authored-By: Claude Opus 5 <[email protected]>
…bilityai/trinity-enterprise#454)

`system_member_names` keeps its signature and becomes a thin wrapper; the body
moves verbatim into `system_membership`, which additionally returns the two
facts the flat name list discarded:

  * `tags_readable` — the body degrades to the raw prefix on a tag-read
    failure, argued there for `restart` (over-capture restarts one container
    too many and logs it; under-capture restarts a subset and reports success).
    A verb that DELETES inverts the cheap half, so it can refuse on unverified
    membership instead of degrading — at its own call site, without forking
    THE ONE predicate into a fourth rule.
  * `evidence` (tag|prefix|both) — derived from the two sets that already
    decided membership, so it cannot disagree with them. Makes the prefix
    fallback's documented residual visible to a caller instead of silent.

`SYSTEM_VIEW_AUTO_DESCRIPTION` replaces the inline f-string: nothing persists a
system<->view link, so that description IS the identifier for the view a deploy
auto-created, and a reader that has to find it again must not restate the
literal.

Behaviour-preserving, not asserted to be: the #2373 suite (33) and the whole
ent#124/125/126 + systems set (325) pass unchanged against the wrapper.

Co-Authored-By: Claude Opus 5 <[email protected]>
…rties (Abilityai/trinity-enterprise#454)

#2373's fallback rule was wrong three times and each wrong rule passed the case
test written for its predecessor, so the fallback is pinned as a PROPERTY
through the new entry point: members ⊇ raw prefix match whenever the tags are
unreadable, plus tagged ⊆ members whenever they are readable. Any future
narrowing fails by construction, whatever shape it narrows on.

Also pinned: the wrapper is a projection of `system_membership` (generated, AND
source-anchored — a property cannot see a copied body that happens to agree
today), evidence is keyed by exactly the members and true of each, and the
auto-view description is asserted THROUGH `create_system_view` rather than by
restating the literal.

The named incidents stay as discrete cases: the eleven `vc-due-diligence-dd-*`,
an agent named exactly `acme`, the sibling-prefixed `acme-api-worker`, and the
`acme` vs `acme-extra` floor from the AC.

One counterexample found by Hypothesis and fixed as a TEST bug, not a code one:
`roster=[]` short-circuits before the tag read and so reports
`tags_readable: True` by design — a destructive caller refuses on False, and
refusing a teardown of a memberless system is a 503 where 404 is the truth.

17 passed under the derandomized `ci` profile and under `explore` (5000
examples); both lint guards clean.

Co-Authored-By: Claude Opus 5 <[email protected]>
…Abilityai/trinity-enterprise#454)

Invariant #13's third surface. The tool ships in the OSS bundle and knows
nothing about entitlement: it proxies DELETE
/api/enterprise/system-teardown/{name} and reports what the route says.

`dry_run` defaults to TRUE — the opposite of `deploy_system`, deliberately: an
unwanted preview costs a round trip, an unwanted execute costs a deleted fleet.
The default lives in tool code, so it is pinned by a test that an `|| false`
typo would fail.

Refusals degrade rather than throw, and stay DISTINCT: 404 (no such build) /
403 (not licensed, or an agent key on a human-only verb) / 503 (membership
unverified — flagged retryable, and says nothing was removed). A thrown error
reaches the agent as an opaque transport failure it cannot reason about, and
flattening the three is how a human on a user key gets told a licensed feature
"doesn't exist". A `failed` report arriving as a 500 is kept as a RESULT — its
per-member reasons are the only actionable output.

Reads `ApiError.body` rather than regexing `ApiError.message`: the field is
retained verbatim for exactly this purpose (ent#443), and its own docstring
says the regex is what breaks when the message format changes. Found while
writing the test, which constructs a real ApiError rather than a `{status}`
stand-in that would have passed over broken body parsing.

No server.ts change: createSystemTools is already in toolGroups, so the tool
inherits the operatorOnly allow-list.

tsc --noEmit clean; npm test 383 pass / 0 fail (364 before).

Co-Authored-By: Claude Opus 5 <[email protected]>
…inity-enterprise#454)

Library -> Systems gains the inverse of install: preview -> per-agent checklist
-> acknowledgement -> remove. Gated on `system_teardown` in
`enterprise_features`, so an OSS build's Systems section looks exactly as it
did rather than offering a control whose route 404s.

The preview is a CHECKLIST, not a list, and that is the design rather than
decoration: a member whose `evidence` is `prefix` matched by name with no
deploy tag to confirm it, so it may belong to a sibling system sharing this
one's prefix. The server cannot tell — only the operator can — so the badge
plus the opt-out IS the over-capture escape hatch, and the confirmed list goes
back on execute to be intersected with freshly-resolved membership.

Remove is gated on four conditions, each blocking something the others do not:
the preview is current for the typed name, membership was verified, the
consequence is acknowledged (ent#126's ack contract reused, not a second
pattern), and at least one agent is checked. A disabled button says why.

Honest reporting: tone switches on `status`, never the HTTP code (`partial` is
200, `failed` is 500 with the report as the body). skipped / failed / aborted
render as three different things with per-reason operator copy, because a
refusal is not a breakage and an un-attempted member is neither; `discarded`
never claims recoverability. A timeout is "outcome unknown" and offers no
retry — the server keeps deleting.

`ManifestPreview`'s "there is no un-deploy" now tracks the CAPABILITY: still
exactly true where the module is absent. Retiring it everywhere because one
edition gained the verb would have been the dishonest fix. `DeployResult` gains
a de-emphasised "Remove this system", also entitlement-gated (AC 7).

Design contract: token-only (scanner reports 0 non-gray / 0 hex across all six
systems files), both themes, primitives only, bounded member viewport with a
stated total, no bare loading gate — the in-flight flags reach only BaseButton.

Tests: 21 vitest store specs + 25 source-anchored contract assertions.
Mutation-checked, and it found a real gap: "the preview is bound to its name"
passed with the name comparison replaced by `true`, because `setTeardownName`
nulls the preview and the null-check carried the assertion alone. The
comparison guards a direct-assignment bypass, so the test now uses one.
Frontend suite 2795 passed (2774 before); check:tokens clean.

Co-Authored-By: Claude Opus 5 <[email protected]>
…es (Abilityai/trinity-enterprise#454)

`system-manifest.md` gains entry-point rows (the gated route, the license-blind
MCP tool, the UI's new status) and a "Teardown — the public half" section
covering what lives in THIS repo: the membership split and why it is a wrapper
rather than a fork, the one-constant auto-view description, the MCP degradation
contract, the checklist UI, and the four tests. The gated verb's own design
stays in the private tree (#151 doc-follows-the-code).

Feature-flows index row added, per the standing rule that a row goes in even
when the flow doc already exists. (The "newest ~20" cap on that table is
already at 140 rows — pre-existing drift, deliberately not pruned here, since
dropping 120 rows would bury this diff.)

Area files: mcp-server.md `systems.ts (4)` -> `(5)`, backend.md's
`system_service.py` line records the membership split and the constant,
frontend.md records the gated half of the Systems section.

Public docs carry the seam and the gate's name only — no paid-module internals.
Verified by running the enterprise-docs-guard's own grep locally: clean.

Co-Authored-By: Claude Opus 5 <[email protected]>
…bilityai/trinity-enterprise#454)

`/sync-feature-flows` mapped every changed file to a flow; two changed files
belong to a second flow each, and those were the gap:

* `mcp-orchestration.md` — the System Tools table and the enumerated tool-count
  comment both said four. `teardown_system` makes five, with its license-blind
  degradation contract and its inverted `dry_run` default recorded where the
  other tools are catalogued.
* `library-page.md` — the `#systems` section now hosts two panels, and the
  second renders nothing without the entitlement. Worth stating there because
  that page's doc is where someone checks why a tab looks different between
  editions.

The index row's Flow column now names all three flows rather than only
`system-manifest.md`.

`system_service.py` also appears in `scheduling.md` and `agent-tags.md`, but
only as the module that writes schedules and tags — nothing this change touched,
so no update.

Index is 552 lines against the skill's 400-line guidance. That is the
pre-existing Recent Updates table at 140 rows against its own documented "~20"
cap; my row is one line of it, and condensing 120 rows would bury this diff.
Flagged, not fixed.

Co-Authored-By: Claude Opus 5 <[email protected]>
…y-enterprise#454)

Reusing ent#126's acknowledgement contract was right for the prop/emit shape and
wrong for the `data-testid`. Install and remove can both be previewed on the
same Library page, so a shared id puts two elements at one address — and
`e2e/system-install.spec.js` addresses the install ack as
`getByTestId('ack-checkbox')` in three places, which would be strict-mode
ambiguous on an entitled build.

It would NOT have failed CI: the teardown panel is unentitled there and renders
nothing, so the collision is invisible to every check that runs today. That is
exactly why it gets a test rather than a CI run. Found by reading the spec that
shares the surface, while waiting on the e2e job.

The pattern is worth sharing; the address is not. `ManifestPreview` keeps
`ack-checkbox`; the teardown ack is `teardown-ack-checkbox`; the contract test
now asserts BOTH — the shared prop/emit shape and the distinct ids.

Frontend suite 2795 passed, check:tokens clean.

Co-Authored-By: Claude Opus 5 <[email protected]>
…bilityai/trinity-enterprise#454)

The per-id fix in the previous commit was the wrong SHAPE, and looking for a
second instance found one immediately: `goto-fleet`, owned by DeployResult.vue
and copied into TeardownResult.vue. Two collisions is the signal to write the
rule instead of fixing instances.

Install and remove are two panels on one Library page, and on an entitled build
both can show a preview AND a result at once — so any id they share is
strict-mode ambiguous for a Playwright `getByTestId(...)`, which is exactly how
`e2e/system-install.spec.js` addresses both `ack-checkbox` and `goto-fleet`.

None of it fails CI today: the teardown panel is unentitled there and renders
nothing, so the collision is invisible to every check that runs. Hence a test
rather than a CI run — `test_no_test_id_is_shared_with_the_install_panel_it_sits_beside`
intersects the two panels' id sets and fails on any overlap, so a third
collision cannot be introduced quietly.

Measured: reintroducing the `goto-fleet` collision turns it red; control clean.

Also drops a now-stale docstring line in TeardownPreview that still claimed the
shared testid.

Frontend suite 2795 passed.

Co-Authored-By: Claude Opus 5 <[email protected]>
…ai/trinity-enterprise#454)

`normalizeError` is shared with deploy, and its unknown-outcome copy read
"Deployment may still be running — re-deploying creates duplicate agents." On a
teardown timeout that is the opposite advice at the worst possible moment: the
in-flight work is removal, and the members removed so far are already gone.

The two sentences that are about WHAT was in flight move into `UNKNOWN_OUTCOME_COPY`,
keyed by verb — everything else in the normalizer is verb-independent, which is why
this stays one function. `teardown-preview` gets its own arm because a dry run writes
nothing, so neither sentence may imply work in flight.

The MCP tool copy is corrected alongside it: the 403 said "an agent-scoped key",
which understates a gate that is now an allowlist refusing every machine credential;
the 503 said "membership could not be verified", which no longer covers the case
where the roster itself was unreadable; and `dry_run` now states that a member with
no container is removed the same way, since that is what frees its name.

Co-Authored-By: Claude Opus 5 <[email protected]>
…not (Abilityai/trinity-enterprise#454)

Three docs claimed the teardown acknowledgement reuses ent#126's
`data-testid="ack-checkbox"`. The code deliberately does the opposite and a guard
test requires it to: both panels render on one Library page, so a shared address
makes every `getByTestId('ack-checkbox')` strict-mode ambiguous. The PATTERN is
what is reused (`:acknowledged` / `update:acknowledged`); the address is not.

The flow and roadmap gain the roster-completeness ruling behind the private fix: every
OSS sibling on this surface resolves its roster from containers, which is cosmetic for
`get_system` / `restart_system` / `export_manifest` and is under-capture-reporting-success
for a verb that claims completion — plus why the #2196 tri-state reader is what makes
the ownership supplement safe, and why an unreadable Docker refuses rather than 404s.

`learnings.md` records C1's class for the next planner: a guard that tests membership
against a list the disqualified entries were just appended to is dead for the case its
own comment describes, and the narrow test beside it passes either way.

Co-Authored-By: Claude Opus 5 <[email protected]>
@AndriiPasternak31
AndriiPasternak31 marked this pull request as ready for review September 14, 2026 22:32
AndriiPasternak31 and others added 3 commits September 15, 2026 01:24
…base string's (Abilityai/trinity-enterprise#454)

BaseButton's shared class string carried `border-transparent` next to the
reserved `border` width, while `secondary` — the one variant drawn BY its
border — set `border-gray-300`. Both are single-class selectors, so
specificity ties and emission order decides: Tailwind emits
`.border-transparent` after `.border-gray-300` (rule 729 vs 698 on the live
dev stylesheet), and the resting keyword won. Every secondary button
rendered borderless in light mode — a white button on a white card with no
outline — across 24 call sites.

It survived review because dark mode won by accident rather than by design:
`dark:border-gray-700` compiles to `.dark .border-gray-700`, one class
heavier, which outranks the tie. The theme most of us work in was correct.

The fix is the one `fieldClasses.js` already documents for FIELD_GHOST_CLASS
one primitive over: the base string keeps the bare `border` (so the focus
ring still costs no layout shift) and every variant names its own colour.

Measured, not reasoned — resting border on the teardown panel's
"Preview removal" control, before → after:
  light: rgba(0,0,0,0)      → rgb(209,213,219)  (gray-300)
  dark:  rgb(55,65,81)      → rgb(55,65,81)     (gray-700, unchanged)

Guard: tests/unit/baseButtonVariantBorder.spec.js pins the base string
colour-free, asserts secondary is outlined in BOTH themes (the bug was
theme-asymmetric, so a light-only pin would let the next edit break dark
while staying green), and fails closed on a fifth variant that names no
border colour. Mutation-checked: restoring `border-transparent` to the base
string turns it red.

Co-Authored-By: Claude Opus 5 <[email protected]>
…ilityai/trinity-enterprise#454)

BaseInput is a three-part stack — label, control, help — so a flex row that
holds one whole aligns against that whole box. `items-end` therefore put the
button's bottom edge on the HELP TEXT's bottom rather than the control's,
leaving "Preview removal" 22px below the field's centre where it read as a
stranded caption instead of the field's action.

Fixed by composing the row the way BaseInput documents and the way
TemplateRegistryPanel already does it for the same control-plus-action shape:
the panel owns the label and the help, and the row holds two control boxes,
so alignment means what it says. `items-stretch` rather than `items-start`
because the two primitives are deliberately different heights (field py-2 on
a 20px line box = 38px; button py-[7px] on 13.5px/1.35 = 34px) and stretching
the shorter one costs no magic number and overrides neither recipe.

Measured on the live dev stack, before → after:
  input  top/bottom  1295/1333  →  1295/1333
  button top/bottom  1319/1353  →  1295/1333
  centre delta           +22px  →       0px

BaseInput carries the second half. Its `:aria-describedby` binding is applied
AFTER `v-bind="controlAttrs"`, so with no `help` prop of its own it did not
leave a caller's `aria-describedby` alone — it ERASED it, and the help
paragraph stopped being announced the moment the panel took ownership of it.
It now hands the attr back instead of winning a merge the caller never knew
it had entered. Strictly additive: error and help still win, in that order,
so no existing caller changes.

There is no mount harness in this project (no @vue/test-utils, vitest runs
environment: 'node'), so the a11y half is browser-verified rather than
unit-pinned — on the live render the control resolves
aria-describedby="v-1-help" to the help paragraph, and label[for] to
"System name". Full unit suite green: 131 files, 2937 tests.

Co-Authored-By: Claude Opus 5 <[email protected]>
…sits in (Abilityai/trinity-enterprise#454)

Two h4s in this PR's own files were written without a size class and fell
through to the UA default of 1em. On a 16px root that made the DEEPEST
headings on the page the LARGEST — bigger than their four `text-sm` siblings
and bigger than the h3 that contains all of them:

  h3  "Remove a deployed system"        14px
  h4  "Agents to remove" / "Also removed" / "Notes"
                                        14px
  h4  "This removes running agents"     16px   ← TeardownPreview.vue:149
  h4  "Outcome unknown"                 16px   ← SystemTeardownPanel.vue:38

Both are warning callouts whose anatomy is identical to the danger callout at
TeardownPreview.vue:8 — bordered box, icon span, heading, list — and that one
already carries `text-sm`. So this was an inconsistency inside a single file,
not a scale that needed inventing. All five h4s now measure 14px on the live
render, matching the h3 they sit under.

Scope is pinned to the three components this PR ADDS. Six more unsized
headings exist on the install side (ManifestPreview ×2, DeployResult ×3,
SystemInstallPanel ×2) and are left alone: they predate this branch, and
TeardownResult's banner h3 is deliberately byte-identical to DeployResult's,
so changing one half would break a parallel that was built on purpose. They
are reported for their own issue rather than folded in here.

Full unit suite green: 131 files, 2937 tests.

Co-Authored-By: Claude Opus 5 <[email protected]>
@AndriiPasternak31
AndriiPasternak31 marked this pull request as draft September 15, 2026 00:40
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

AndriiPasternak31 and others added 9 commits September 18, 2026 22:38
# Conflicts:
#	docs/memory/feature-flows.md
#	docs/memory/learnings.md
…lityai/trinity-enterprise#454)

dev's ent#628 policy table landed while this branch was out. Every registered
tool must carry a TOOL_ACCESS_POLICY row, and policyFor checks it AT
REGISTRATION — so merging dev left the MCP server crash-looping on boot
(ToolAccessPolicyError: tool 'teardown_system' has no entry; nine restarts on a
live stack). PR CI never said so: the PR was CONFLICTING, which runs zero checks.

The row is `baselined`, not `none`. The siblings can honestly say "a system
name, not an agent" (deploy_system, restart_system); this one cannot — it takes
the confirmed removal set as `agents` and deletes them. `agents` is absent from
AGENT_TARGET_PARAMS, so a `none` row would have passed the shape check while
saying something false. The owner names the fence that actually holds the line:
the gated route requires role 'creator' AND a human caller.

Proof: src/mcp-server npm test 440/440, including access.test.ts's "createServer
boots: every registered tool has a row"; rebuilt image boots and stays up.

Co-Authored-By: Claude Opus 5 <[email protected]>
…ilityai/trinity-enterprise#454)

A fresh teardown preview ticked EVERY member regardless of `evidence`. A
member the server matched by NAME with no deploy tag is one it cannot
vouch for — and arriving ticked makes the escape hatch an opt-OUT on a
verb that deletes.

The 503 refusal does not already cover this. It fires only when the tag
read FAILED (`membership_verified: false`, Remove disabled). A `prefix`
member also appears in the HEALTHY state — tags read fine, that one agent
simply has no tag row — where membership is verified, Remove is ENABLED,
and the unconfirmable agent was pre-ticked beside it. #2373 ranks
under-capture as cheaper than over-capture, which is right for `restart`
and inverts for a verb that deletes; that inversion is why teardown
refuses rather than degrades everywhere else, and the default handed it
back in the one state the refusal misses.

The rule moves to the STORE (`teardownDefaultSelection`) rather than
staying in the panel's watcher, because `vitest.config.js` pins
`environment: 'node'` with no component mounting: a default written into
a `.vue` watcher is a decision no runnable test can execute, which is how
this shipped. The panel now applies it and nothing else.

Found by clicking through a live stack, not by any test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…or an opt-in (Abilityai/trinity-enterprise#454)

The rendered half of the pre-tick fix.

A `prefix` member now arrives UNTICKED, so its own copy had to stop
saying "uncheck it if so" — that sentence describes a box that arrives
ticked, and left in place it would have told the operator to undo a
safeguard that had not been applied.

The short selection is also stated above the list. Without it the
unticked rows read as a miscount against the "N of M selected" counter
beside them, and an operator who re-ticks them to "fix" the count has
re-created the defect by hand.

Guards are source-level because nothing renders this component: vitest
is `environment: 'node'` with zero mounts, and the green `e2e` runs
`system-install.spec.js`, which never touches teardown. They go through
a new `_prose` helper that strips comments AND collapses wrapping — the
first version of one of them matched its own JSDoc line, which is the
trap `_code_only` already existed for, landing a third time.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…d no retry that cannot help (Abilityai/trinity-enterprise#454)

Two defects in one banner.

"Try the preview again in a moment" is advice for a transient fault.
The condition this renders under is a failed database read — a schema
or permission fault that does not clear on its own — so re-previewing
produces the identical screen forever, which trains the operator to
read a real stop as flakiness. It now says the fault is standing and
offers the one thing that does work: the per-agent path the server's
own refusal detail already names.

The banner also named the TAG read specifically, and it cannot know
that. `membership_verified` is `tags_readable AND roster_complete` —
one boolean over two independent faults — so on the roster arm the
copy was simply false: the tags read perfectly and it is the agent
LIST that is incomplete. The banner now states the consequence, which
IS identical either way, and quotes the server for the cause.

That required routing the warnings. The roster line used to fall
through to "Notes", which put the real fault in a footnote underneath
a banner naming the other one. Both membership lines are now claimed
by the banner while it renders, and `otherWarnings` is defined by
SUBTRACTING what the banner took rather than by a second independent
regex — two filters that must stay complementary are two chances to
drop a line off the screen entirely.

Also repairs an existing assertion that broke on the re-wrap: the
phrase it pinned was split across two lines without a word changing,
so it now goes through `_prose` like the rest.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…Abilityai/trinity-enterprise#454)

"The acme tag goes with the agents (2 tagged)" was rendering
`SystemTeardownTag.member_count`, which the service sets to
`len(members)` — every candidate, tagged OR matched by name. So the
word "tagged" overstated the tag the moment any member was `prefix`.

In the refusal state it was worse than imprecise: the banner at the top
of the same screen says the membership could not be confirmed, and this
line then quoted a figure derived from that very read. Two statements
about one read, opposite in confidence, on one screen.

Dropped rather than reworded. The total the operator actually needs is
already stated on the list itself ("N of M selected"), and the
sentence's job is the other clause — that the tag is not a separate
record to go and delete.

The field is not wrong; `member_count` counts members and says so. Only
the noun beside it in the UI was.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…lityai/trinity-enterprise#454)

The flow doc described the old checklist ("the badge plus the opt-out
is the mechanism") and said nothing about which boxes arrive ticked,
which is the half that was wrong. It now records the opt-in/opt-out
split and where the decision lives, why the refusal banner names no
fault, how warning routing partitions, and that the tag line carries
no count. Tests table and change history updated with it.

The ledger entry is the transferable part: a UI default written in a
`.vue` watcher is a decision no node-environment suite can execute, so
it is reviewed by eye forever — move it to the store and the spec that
already exists starts covering it. Plus the three smaller shapes this
round produced: a boolean over two faults must name neither, a count
rendered with a different noun than the field counts is a lie with a
number on it, and warning routing partitions by subtraction.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…nity-enterprise#454)

The preview watcher was not `immediate`, and the store outlives the
component. `Library.vue` mounts the systems section lazily and nothing
resets teardown state on unmount, so leaving the page and coming back
remounts this panel onto a preview that is STILL current — and the
watcher never fires for it. The removal set rendered with every box
empty and "Select at least one agent", which makes this component's own
stated default untrue on the second visit.

Pre-existing (the previous all-members default had the same hole) and
fail-safe in both directions, which is exactly why it survived: nothing
breaks, the panel is just wrong and asks the operator to re-tick a set
it had already reasoned about.

Found by driving the real panel in a browser — the store spec cannot
see it (the rule is correct; the wiring never ran) and neither can a
source regex, until one is told to look for `immediate`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…pt-in one (Abilityai/trinity-enterprise#454)

The server's prefix warning ends "Uncheck anything that does not belong
before confirming" — the opt-OUT instruction this branch reversed. It
rendered under "Notes", six lines below the panel's own "tick it only
if it belongs", so one screen gave opposite instructions about the same
row and the stale half read as the authoritative one, because it came
from the server.

Suppressed, which is the rule this component's docstring already
states: a warning that has a dedicated block above is not repeated as
prose. The prefix warning simply had no such block until the
short-selection note gave it one, so it was the only member of that
family still falling through. The excluded, ephemeral and unverified
lines were already suppressed for exactly this reason.

SUPPRESSED rather than MEMBERSHIP_FAULT: it is raised in the HEALTHY
state too, where no banner renders at all.

Visible only in situ — the warning comes from the enterprise module, so
it is absent from every fixture in the frontend tests.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
… before it (Abilityai/trinity-enterprise#454)

`TeardownResult` rendered `result.warnings` unfiltered, so the server's
prefix warning — which ends "Uncheck anything that does not belong
before confirming" — appeared under Notes on the RESULT, beneath a
report of what had already been removed. Advice for a decision already
taken, in the opt-OUT wording the preview stopped using.

Only that line is dropped. Every other warning is a statement of fact
about what happened (agents excluded, members with no container,
ephemeral members with no recovery window) and still reads correctly
after the event.

The preview gained this filter in 581a531; this component did not,
because nothing renders either of them in CI and the preview is the one
a source guard had been written against. Found by tearing a system down
for real on a live stack.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@AndriiPasternak31
AndriiPasternak31 marked this pull request as ready for review September 18, 2026 23:21
@AndriiPasternak31 AndriiPasternak31 self-assigned this Sep 19, 2026
@vybe

vybe commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

merge-train: ejected from today's train — rides the next one once fixed. Nothing was pushed to this branch.

This is close, and the backend half is good work. The membership primitive, the MCP tool and the store all have real teeth — I verified by reverting each and watching tests go red (tags_readable=True hardcoded → 2 red; evidence always "both" → 5 red; dry_run default flipped → 1 red). The OSS/enterprise seam is clean: the docs-guard grep returns 0 hits, no enterprise_* schema, no paid-feature catalog, and mounting under /api/enterprise/system-teardown/{name} correctly sidesteps the Invariant #4 prefix split.

What blocks it is that the destructive gate is the one decision left outside the executable layer. Two semantic mutations pass the entire suite — all 36 source-regex tests and all 29 executing store tests green:

  1. SystemTeardownPanel.vue:246 — canRemove with || instead of &&. Remove becomes enabled with zero agents selected, no acknowledgement, a stale preview and unverified membership. Because !store.isTearingDown is true at rest, it is effectively always enabled. test_remove_is_gated_on_all_four_conditions still passes, because it asserts each condition string appears in the expression — it never evaluates it.
  2. TeardownPreview.vue toggle() inverted. Ticking a box removes the agent from the removal set; unticking adds it. On the only verb in the codebase that deletes a fleet, the operator's confirmation would mean the opposite of what the screen shows. Nothing catches it.

The textual guards aren't vacuous — deleting a gate term or pre-ticking every member each turns something red. They're textual, and a DELETE gate needs semantic.

The reason this is a fix rather than a rewrite: you already built the pattern and applied it one function over. teardownDefaultSelection was deliberately lifted into stores/systems.js:227-236 so "a node-environment vitest can execute it", and that store test has real teeth. canRemove — the four-gate safety mechanism this PR describes at length as its core design — stayed in the component, so it's currently a comment rather than a mechanism.

What unblocks it: lift the canRemove predicate beside teardownDefaultSelection (it already reads teardownPreviewIsCurrent, teardownMembershipUnverified and isTearingDown from the store; only acknowledged and checked.length need to be arguments), give toggle() the same treatment, and add the two mutation cases above to systemsTeardown.spec.js. No new test tier required. Worth knowing: a jsdom/mount tier is also available if you'd rather test the component directly — 20 of 139 specs already use the per-file // @vitest-environment jsdom opt-in.

Worth addressing while you're in there, not blocking on their own:

  • Cross-repo string coupling with no contract. TeardownPreview.vue routes every server warning by regex over English prose owned by the private module (/could not be verified|roster could not be completed/i, /were excluded|no recovery window|matched by NAME ONLY/i). No shared constant, no contract test, and the private module isn't in this repo. A reword on the private side silently demotes a membership fault to a "Notes" footnote — and that exact defect already fired once inside this PR and was patched by adding another alternative.
  • docs/memory/feature-flows/system-manifest.md names SystemTeardownTag.member_count — a private module's internal model field. Naming the gated route is well-precedented; naming a private Pydantic field is a step past it, and the CI guard's pattern can't see it.
  • BaseInput.vue:98 has zero coverage of any kind — reverting return attrs['aria-describedby'] || undefined → return undefined leaves all 139 files / 3161 tests green. It's a shared primitive with 24+ callers, and out of ent#454's scope.
  • Library.vue:396-399 — teardownTarget is a plain ref and the panel watches props.initialName, so re-clicking "Remove this system" for the same system after "Start over" sets an unchanged value, the watcher never fires, and the field stays empty.
  • No closing keyword. Refs abilityai/trinity-enterprise#454 won't auto-promote. Cross-tracker means manual relabelling either way, but Fixes abilityai/trinity-enterprise#454 is still the right line to carry.
  • Merge-order dependency: trinity-enterprise CI is red (ImportError: cannot import name 'system_membership') until this lands. That's a conscious acceptance for whoever merges, and worth restating at the top of the body.
  • docs/memory/learnings.md conflicts with dev — the routine append collision, resolve by keeping both entries.

@vybe

vybe commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

merge-train: not on the 2026-09-21 train either — carried over unfixed. Nothing was pushed to this branch.

This branch's last commit predates yesterday's ejection comment, so the findings there stand unchanged and I have not re-derived them. See the note above for the detail and for what unblocks it.

Not a re-review, just the queue state: this is the second consecutive train this PR has missed. If any of yesterday's findings look wrong to you, say so on the thread and I will re-verify that specific point rather than leave it parked — a disputed finding is a faster conversation than another week in the queue.

sim and others added 4 commits September 21, 2026 17:05
…rors are one rule

`teardownDefaultSelection` pre-ticked `evidence !== 'prefix'`. `evidence` is
free-form text off the wire and the consumer DELETES, so a member arriving
with the field absent, null, or carrying a future fourth value was pre-ticked
by a denylist that had never heard of it.

It was worse than one predicate: the polarity was hand-mirrored in THREE
places, two of them in the template — the store's default, the "matched by
name only" BaseBadge, and the explanation beneath it. The badge and the note
tested `=== 'prefix'`, which is not the complement of `!== 'prefix'` for an
unrecognised value, so such a member was pre-ticked AND unbadged AND
unexplained: swept into a delete with no signal at all.

All three now read one exported predicate, `isConfirmedMember`, an allowlist
of positive confirmation (`tag` / `both` — what `system_service.py` actually
emits). `teardownUnconfirmedMembers` is its complement by subtraction, so the
pair partitions the roster by construction.

Four cases + a partition property added to the spec that already executes this
rule. Negative-controlled: restoring the denylist turns the three
unrecognised-evidence cases red.

The source guard's assertion moved with it — it pinned the literal
`m.evidence === 'prefix'`, i.e. the implementation spelling, and now pins the
shared predicate plus the absence of a raw comparison.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ming no mount harness exists

Two things, one file.

**The pin.** #2922 lands a ratchet that holds any spec with no baseline entry
to ZERO source-text reads. This spec is new, so it fails that ratchet — the
two PRs are individually green and jointly red, which is invisible to either
one alone. It is a legitimate pin rather than a missing mount: the defect is a
cascade tie broken by stylesheet EMISSION ORDER, and neither jsdom nor
@vue/test-utils evaluates a stylesheet, so a mount would report the class list
it was handed and prove nothing. That is exactly the case the marker exists to
make visible to review.

**The false rationale.** The docblock said vitest "runs `environment: 'node'`
here with no mount harness". `environment: 'node'` is the DEFAULT only; a spec
opts into jsdom per file and mounts, which 22 specs already do. Saying the
harness does not exist is the claim #2918 was filed about, and repeating it in
a new file is how the belief survives. The harness exists and is reachable —
this spec stays at source level because a cascade is invisible to it, which is
a different and true reason.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
… target param

The comment justified the `baselined` row by saying `agents` is absent from
AGENT_TARGET_PARAMS, so a `none` row "would have passed the shape check and
said something false". `agents` is in that set (`access.ts`), and `policyFor`
THROWS on a `none` row whose parameters name an agent — the server refuses to
boot. The row is right; its stated reason was the one thing about it that was
wrong, and it understated why the row matters.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@vybe

vybe commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

merge-train — dev merged and four mechanical fixes pushed to this branch (4be473e0)

On the 2026-09-21 train. Validated as lane B, no CRITICAL from either /validate-pr or /review. The backend half holds up under checking: system_membership really is the old body moved, not narrowed — :936's projection is byte-for-byte the prior return, all three callers still go through the wrapper, and the test_2373 count guard still passes. The store is genuinely executed, and reverting teardownDefaultSelection to "tick everything" turns 4 of its cases red. Nothing there needed changing.

Four things did, none of which needed a decision from you:

1. dev merged — docs/memory/learnings.md collided at the tail (both sides append there; it is the routine one). Resolved from the git stages, keeping all three entries: your mid-file 09-13 entry, dev's 09-18/09-19/09-20 block, then your 09-18 entry.

2. The destructive default was a denylist, in three places. teardownDefaultSelection pre-ticked evidence !== 'prefix'. evidence is free-form text off the wire and this feeds the verb that deletes, so a member arriving with the field absent, null, or carrying a future fourth value was pre-ticked by a rule that had never heard of it.

It was worse than one predicate — the polarity was hand-mirrored three times, and I only found the other two by running your own Python guard after fixing the first. The badge (TeardownPreview.vue:120) and the explanation (:131) both tested === 'prefix', which is not the complement of !== 'prefix' for an unrecognised value. So such a member was pre-ticked and unbadged and unexplained — the one path with no signal at all.

All three now read one exported isConfirmedMember (an allowlist of tag/both, what system_service.py:935 actually emits), and teardownUnconfirmedMembers is its complement by subtraction, so the pair partitions the roster by construction. Four cases and a partition property added to the spec that already executes the rule; restoring the denylist turns the three unrecognised-evidence cases red.

Note this is your own learnings entry's rule (4) — "warning routing must partition by subtraction, not by a second regex" — applying one layer further out than where you applied it.

3. baseButtonVariantBorder.spec.js now declares @source-text-pin. This is a genuine member-vs-member interaction, invisible to either PR alone: #2922 is on the same train and lands a ratchet holding any spec with no baseline entry to zero source-text reads. Your spec is new, so the two are individually green and jointly red — I reproduced it on the assembled tree, and it was the only failure in 3276 tests. It is a legitimate pin rather than a missing mount, and I said so in the marker: the defect is a cascade tie broken by stylesheet emission order, which neither jsdom nor @vue/test-utils evaluates.

4. The "no mount harness exists" rationale, in both new test files. vitest.config.js pins environment: 'node' as the default only — a spec opts into jsdom per file, and 22 specs already mount. Both files stated it as though no harness existed; that claim is precisely what #2918 was filed about, and repeating it in new files is how the belief survives. Corrected to the true reason in each. Your decision to move the destructive rule into the store stands and was the right one — it is why that rule is executed today.

Also corrected: access.ts's new comment said agents is absent from AGENT_TARGET_PARAMS. It is in that set, and policyFor would have thrown at startup on a none row — the row is right and its stated reason understated it.

Verification after all of it: frontend 144 files / 3281 passed · mcp-server 456/456 · test_ent454_* + test_2373_system_endpoints + test_models_centralized 90 passed.

Left as yours, none blocking: teardownUnconfirmedMembers is now wired for real but the panel still derives its own list from props rather than the store (one rule, two homes — I unified the predicate, not the plumbing); teardown_system is advertised to agent-scoped MCP sessions where search_executions sets an explicit canAccess; the deploy→teardown handoff is a one-shot ref, so a second "Remove this system" after Cancel does nothing; and the body says Refs, not a closing keyword, so ent#454 needs status-in-dev by hand.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge-train: batch validated on train/20260921-1644 (#2939) — full suite green, regression diff 0 failures across all three seeds. Four mechanical fixes pushed to this branch and announced above (dev merge, the destructive default flipped to an allowlist across its three mirrors, the @source-text-pin that resolves the #2922 interaction, and two false 'no mount harness' rationales). Required checks green after the dev merge; the one stalled pytest seed was a hung xdist worker, and dev's own full suite at e4c225f (16775 passed, 0 failed, pgroup tests included) confirms the earlier pgroup red was the flake #2935 fixes. ent#454 needs status-in-dev by hand — 'Refs' is deliberate here.

@vybe
vybe merged commit c9a71e7 into dev Sep 21, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants