Skip to content

[Roadmap][Phase 2] codegraph-vba Event declarations — P1 sub-prompt within round-2 #21

Closed

Description

@ardelperal

Goal

Ship Event declarations modeling as a high-priority sub-prompt within the broader codegraph-vba round-2. Specifically: model Event ... RaiseEvent declarations AND find every subscriber / handler across the project (WithEvents, Set X = ... patterns). This is the P1 slice of round-2 — the maintainer is invited to ship it first or standalone if the broader round-2 scope is too large for a single PR.

Why this is P1

The orchestrator consumes codegraph-vba across multiple Access projects where Event ... RaiseEvent is heavily used:

  • gestion_riesgos (around 12 Event declarations across forms and classes)
  • no_conformidades (around 8 Event declarations)
  • expedientes (around 6 Event declarations)

Without Event modeling, the orchestrator's static reachability analysis over those projects is incomplete. Today's workaround: grep for the event name in .cls files — slow, error-prone, no caller coverage.

Consumer context

Once shipped, this unblocks the new skill vba-event-tracer (ardelperal/VBA_TOOLKIT_BENCH#9), which takes an event name and returns: list of RaiseEvent call sites + list of handlers attached via WithEvents or Set X = .... That skill is on the orchestrator's Phase 1 backlog.

This also feeds vba-handler-backtrace (ardelperal/VBA_TOOLKIT_BENCH#10), which traces the chain control event → handler → helpers → DAO calls.

Acceptance criteria

  • Event declarations (e.g., Public Event AlgoChanged(ByVal NewValue As String)) modeled as event nodes with module + line + signature attached
  • RaiseEvent invocations modeled as edges (caller → event node)
  • WithEvents X As ClassY declarations modeled as subscriber edges (variable → event node)
  • Programmatic Set X = New ClassY + later X_SomeEvent handler wiring detected via heuristic (for VBA's implicit WithEvents after Set, depending on the project's coding convention)
  • codegraph_explore "Event NombreEvento" returns: declaration site + list of RaiseEvent callers + list of handlers
  • RED + GREEN tests against Gestion_Riesgos.accdb (in ardelperal/VBA_TOOLKIT_BENCH) using a real Event like Form_FormRiesgosGestionRiesgo.NotificacionEnviada or equivalent
  • Edge cases: event declared but never raised → returns empty raise_sites; event raised but no subscriber → empty handlers (with no false positives from string literals)
  • Documented in ardelperal/codegraph-vba/README.md node kinds table

Self-verification (mantainer-side)

Before closing this issue, the maintainer must verify ALL of the following:

  • Event node kind exists: codegraph_explore against the bench returns at least one event node for a real Event declaration in Gestion_Riesgos.accdb
  • Trace from RaiseEvent works: A specific test calls codegraph_explore with "RaiseEvent X" and returns the declaration site + at least one caller site correctly
  • WithEvents / Set X subscribers detected: A specific test verifies a WithEvents declaration is detected as a subscriber edge
  • No false positives from comments / strings: A specific test includes an Event name appearing in a string literal + a comment, and confirms zero raise_sites returned for that surface (only real call sites counted)
  • Tests verde against the bench: RED + GREEN tests pass against ardelperal/VBA_TOOLKIT_BENCH/Gestion_Riesgos.accdb
  • No regresiones: codegraph-vba v1.2.0 existing queries keep working
  • Documented in README: The new event kind is in the node kinds table in ardelperal/codegraph-vba/README.md
  • Backward compatible schema: If any node kind shape changed vs round-3 (feat(vba-extractor): add VBA / Access language support to codegraph #1) or earlier round, document the migration in the PR description

Only when ALL checkboxes are checked should this issue move to status:approved → status:done. If any is missing, comment which one and why before closing.

Scope vs broader round-2

This issue focuses exclusively on Events. The other round-2 scopes (Type, Declare, huecos 5/3/9) are tracked at ardelperal/codegraph-vba#2 and can ship together OR separately. This P1 sub-prompt lets the maintainer ship Events alone if the rest of round-2 needs more time.

Required side-effect

Closing this issue unblocks vba-event-tracer (ardelperal/VBA_TOOLKIT_BENCH#9) and partially unblocks vba-handler-backtrace (ardelperal/VBA_TOOLKIT_BENCH#10 — full unblock needs Type + Declare too).

References

Activity

  1. ardelperal commented on Jul 1, 2026

    @ardelperal
    OwnerAuthor

    Re-cierre con evidencia (2026-06-29): commit 904bcdd v1.2.0 — VBA form control-modeling (6 huecos cerrados, CI verde) (PR #13) NO cierra este issue (Event declarations P1 sin modelar como nodo en v1.2.0; v1.2.0 añade aristas event-handler, no nodo event). Se cierra aquí como duplicado sin labels de #26, que tiene el scope consolidado de Round-2 (Event + Type + Declare + huecos 5/3/9). El sub-prompt P1 de Events se reabre en un issue futuro si Round-2 se separa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions