Skip to content

Audit: exec-approvals request/decision/resolve subsystem registration survives a gut — wire-path or unregister #2606

@alexey-pelykh

Description

@alexey-pelykh

Finding

src/cli/nodes-cli/register.invoke.ts:15 carries the comment:

// Exec-approvals subsystem was gutted — inline minimal types and helpers.

But the schema and method-name registrations for the request / decision / resolve flow survive:

  • Method names declared in src/gateway/method-scopes.ts:33-35:
    • exec.approval.request
    • exec.approval.waitDecision
    • exec.approval.resolve
  • Schemas registered in src/gateway/protocol/schema/protocol-schemas.ts:265-266:
    • ExecApprovalRequestParams: ExecApprovalRequestParamsSchema
    • ExecApprovalResolveParams: ExecApprovalResolveParamsSchema
  • Schema definitions at src/gateway/protocol/schema/exec-approvals.ts

Note the subsystem split:

  • exec.approvals.* (plural) — POLICY/STORAGE methods (exec.approvals.node.get, etc.) are in active use (e.g. register.invoke.ts:198)
  • exec.approval.* (singular) — REQUEST/DECISION/RESOLVE methods are the gutted subsystem. No handler dispatch is visible in src/gateway/server.impl.ts (the only mention is hasExecApprovalClients at line 649, which is scope-routing only, not a method handler)

Acceptance criteria

Investigate and cite file:line evidence for each:

  • Confirm whether exec.approval.* (singular) handlers exist anywhere in the codebase
  • Identify the original consumers of the gutted subsystem and confirm they were also removed
  • Verify there is no end-to-end request → wait → resolve flow with at least one client implementation
  • Determine whether ExecApprovalRequestParamsSchema / ExecApprovalResolveParamsSchema carry fields used elsewhere (correlation prefix id / agentId / sessionKey / turnSource{...} / twoPhase / timeoutMs) that should be extracted as a shared ApprovalCorrelationFields shape before deletion

Outcomes

One of:

  1. Wire-path is complete and the audit missed it — document the flow in a brief README under src/gateway/protocol/ and add tests
  2. Wire-path is intentionally partial (placeholder for future restoration) — document as such inline + open a tracking issue for restoration with the restoration trigger
  3. Wire-path is fully gutted — remove the dead method-name declarations (method-scopes.ts:33-35), schema registrations (protocol-schemas.ts:265-266), and exec-approvals.ts entries that have no live consumer. Match the comment at register.invoke.ts:15. If correlation-fields extraction is warranted, do that first as a separate small refactor

Non-goals

  • Not designing a new approval system
  • Not extending to runtime-emitted approvals (a separate deferred design question)
  • The plural exec.approvals.* (policy/storage) subsystem is in active use — leave it intact

Effort

Audit + decision: 1-2 days. Cleanup or restoration follow-up: sized after the audit lands.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions