fix(manager): show the subtree a context delete destroys, and ask before taking it - #261
Merged
Merged
Conversation
…ore taking it Deleting a context deletes everything below it. The delete panel said nothing about that, and the omission broke in both directions. A context holding nothing of its own rendered "Your agent reports it holds no keys and no DIDs", `needsForce` was false, the panel sent `force: false`, and the agent refused — because sub-contexts exist. The operator was shown a refusal for a deletion the screen had just called harmless. A context holding one key of its own rendered that one key, `force` went true on the strength of it, and the agent destroyed every context below and everything they held. The checkbox read "destroying the keys and DIDs listed above"; the list was one key and the deletion was a subtree. The panel now names the sub-contexts first — they reframe every list under them as the subtree's contents rather than this context's — and decides `force` from all six of the agent's lists, not two of them. `contextPreviewDelete` returned three of the six. `aclEntriesRemoved` is the one an operator most needs, since it names the subjects about to lose their authority outright rather than merely have it narrowed, and dropping it in the client meant no screen could show it however carefully it was written. It now returns the whole preview as `ContextDeletePreview`, and the panel renders removed-entirely and narrowed as the distinct events the agent already distinguishes. Sub-contexts are derived from the context list the pane already holds: `vta/contexts/preview-delete/1.0` has no member naming them (one is proposed upstream), and a delete that silently takes them is exactly what this prompt exists to prevent, so it is computed rather than left out. Matching is segment-wise, so `acme-corp` is not a child of `acme`. The three render tests were confirmed to fail against the old panel; the fourth — an empty leaf still says so and still needs no force — is the control that keeps the other three from passing vacuously. Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
4 tasks
…ent used to return `contextPreviewDelete` now returns all six of the agent's lists, so the two tests asserting the old three-field object were asserting the defect. They become: every snake_case list translates, every camelCase spelling is read (which is what was missing), and all six default when the context holds nothing. Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
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.
Deleting a context deletes everything below it. The delete panel said nothing about that, and the omission broke in both directions.
A context holding nothing of its own read as harmless. The preview rendered "Your agent reports it holds no keys and no DIDs",
needsForcewas false, the panel sentforce: false, and the agent refused — because sub-contexts exist. The operator was shown a refusal for a deletion the screen had just called harmless.A context holding one key of its own read as almost harmless.
forcewent true on the strength of that one key, the confirmation listed it, and the agent destroyed every context below and everything they held. The checkbox read "destroying the keys and DIDs listed above"; the list was one key and the deletion was a subtree.Both are the same missing fact.
What changed
The panel names the sub-contexts first — they reframe every list under them as the subtree's contents rather than this context's — and decides
forcefrom all six of the agent's lists, not two.contextPreviewDeletereturned three of the six.aclEntriesRemovedis the one an operator most needs, since it names the subjects about to lose their authority outright rather than merely have it narrowed, and dropping it in the client meant no screen could show it however carefully it was written. It now returns the whole preview asContextDeletePreview, and the panel renders removed-entirely and narrowed as the distinct events the agent already distinguishes.Where the sub-contexts come from
Derived from the context list the pane already holds.
vta/contexts/preview-delete/1.0has no member naming them — trustoverip/dtgwg-trust-tasks-tf#513 proposessubContexts— and a delete that silently takes sub-contexts is exactly what this prompt exists to prevent, so it is computed rather than left out.Matching is segment-wise, so
acme-corpis not read as a child ofacme. When the member lands this becomesp.subContextsand the derivation goes.Agent side
The agent's preview under-reported the same way; OpenVTC/verifiable-trust-infrastructure#1576 makes it answer for the subtree. This PR is not waiting on it — the six arrays are rendered and counted correctly either way, and with #1576 they carry the subtree's contents rather than only the named context's.
OpenVTC/verifiable-trust-infrastructure#1575 is the more serious half: the agent was dropping sub-context DIDs' local records without removing the published log from their hosting server, which is the behaviour that prompted all of this.
Tests
tests/contexts-pane-delete.render.test.mts, four cases:The control is what keeps the other three from passing vacuously.
Verification
npm run lint(tsc -b, all workspaces) — cleannpm test— 730 tests, 0 failuresnpm run build— clean