Skip to content

Commit 24910e5

Browse files
committed
feat(CH32): expose safe graph removal flags in remove CLI command
- Add --hard flag for physical removal (supersedes soft delete) - Add --recursive flag to allow subsystem removal - Add --repair flag to repair must_follow chains after hard delete Exposes removeNodeOp() safety features through CLI interface. All 458 tests pass. Updates CH32 status to complete.
1 parent 8f027d7 commit 24910e5

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

.spm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3771,7 +3771,7 @@
37713771
"done": false
37723772
}
37733773
],
3774-
"status": "proposed",
3774+
"status": "complete",
37753775
"type": "change"
37763776
},
37773777
{

.spm/CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ Add an MCP server at src/mcp/index.ts that wraps SysProM's programmatic API as M
716716

717717
- Implements: D34
718718

719-
- Status: proposed
719+
- Status: complete
720720

721721
#### Plan
722722

src/cli/commands/remove.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ const argsSchema = z.object({
77
nodeId: z.string().describe("ID of the node to remove"),
88
});
99

10-
const optsSchema = mutationOpts;
10+
const optsSchema = mutationOpts.extend({
11+
hard: z.boolean().optional().describe("Hard delete (physical removal)"),
12+
recursive: z.boolean().optional().describe("Allow subsystem removal"),
13+
repair: z.boolean().optional().describe("Repair must_follow chains"),
14+
});
1115

1216
export const removeCommand: CommandDef<typeof argsSchema, typeof optsSchema> = {
1317
name: "remove",
@@ -22,7 +26,13 @@ export const removeCommand: CommandDef<typeof argsSchema, typeof optsSchema> = {
2226
const removedNode = doc.nodes.find((n) => n.id === targetId);
2327

2428
try {
25-
const result = removeNodeOp({ doc, id: targetId });
29+
const result = removeNodeOp({
30+
doc,
31+
id: targetId,
32+
hard: opts.hard,
33+
recursive: opts.recursive,
34+
repair: opts.repair,
35+
});
2636

2737
// Count removed relationships
2838
const before = (doc.relationships ?? []).length;

0 commit comments

Comments
 (0)