apex-dev-tools / apex-dev-tools/apex-log-parser

✨ feat: Fix the event classification: split SOSL from SOQL, separate frames from methods

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
2
Forks
0
Avg merge
5h 51m
Merged PRs (30d)
32

Description

### Problem

MCP builds its own operation taxonomy on top of the parser's `type` and `subCategory` because the
parser's classification does not separate what a reader needs to see apart —
`src/tools/operations.ts`:

- `SOSL` cannot be told from `SOQL`: both share the `SOQL` sub-category, so MCP re-splits them by raw
type in `KIND_BY_TYPE` (lines 185-188).
- `EXECUTION_STARTED` is not a method, so MCP holds `FRAME_TYPES` (line 175) to exclude it.
- `ENTERING_MANAGED_PKG` is a package boundary, not a method, and needs the same treatment.

Because `kindOf` returns nothing for a type its tables do not cover, any unclassified frame drops out
of MCP's `Operation` chain — which is what makes its caller-namespace derivation diverge from the
immediate-parent model (see the `callerNamespace` issue).

### Proposed solution

Fix the classification in the parser rather than in each consumer:

- Split SOSL from SOQL at the sub-category level.
- Distinguish a root or execution frame, and a managed-package boundary, from a method.
- Make the classification total, so no event type is unclassified.

Review MCP's `OPERATION_KINDS`, `LOG_CATEGORY_BY_KIND` and `LEVEL_FIELD_BY_CATEGORY` as the reference
for what consumers actually need, and decide which of those mappings belong here.

#### Acceptance

- SOSL and SOQL are distinguishable without inspecting the raw type string.
- Every event type maps to a kind.
- MCP can drop `FRAME_TYPES` and `KIND_BY_TYPE`.

### Alternatives considered

_None recorded._

Contributor guide

Open the contributing guide

Research direction

Start with src/tools/operations.ts, especially OPERATION_KINDS, LOG_CATEGORY_BY_KIND, LEVEL_FIELD_BY_CATEGORY, FRAME_TYPES, and KIND_BY_TYPE, then trace the parser classification definitions they reflect. Compare the consumer mappings with the proposed parser-level kinds and identify the event types that need coverage. Done means SOSL and SOQL are distinguishable, every event type has a kind, and MCP no longer needs its two classification tables.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.