Repository navigation
[Roadmap][Phase 2] codegraph-vba Event declarations — P1 sub-prompt within round-2 #21
Description
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 12Eventdeclarations across forms and classes)no_conformidades(around 8Eventdeclarations)expedientes(around 6Eventdeclarations)
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
-
Eventdeclarations (e.g.,Public Event AlgoChanged(ByVal NewValue As String)) modeled aseventnodes with module + line + signature attached -
RaiseEventinvocations modeled as edges (caller → event node) -
WithEvents X As ClassYdeclarations modeled as subscriber edges (variable → event node) - Programmatic
Set X = New ClassY+ laterX_SomeEventhandler wiring detected via heuristic (for VBA's implicitWithEventsafterSet, depending on the project's coding convention) -
codegraph_explore "Event NombreEvento"returns: declaration site + list ofRaiseEventcallers + list of handlers - RED + GREEN tests against
Gestion_Riesgos.accdb(inardelperal/VBA_TOOLKIT_BENCH) using a real Event likeForm_FormRiesgosGestionRiesgo.NotificacionEnviadaor equivalent - Edge cases: event declared but never raised → returns empty
raise_sites; event raised but no subscriber → emptyhandlers(with no false positives from string literals) - Documented in
ardelperal/codegraph-vba/README.mdnode kinds table
Self-verification (mantainer-side)
Before closing this issue, the maintainer must verify ALL of the following:
- Event node kind exists:
codegraph_exploreagainst the bench returns at least oneeventnode for a real Event declaration inGestion_Riesgos.accdb - Trace from RaiseEvent works: A specific test calls
codegraph_explorewith"RaiseEvent X"and returns the declaration site + at least one caller site correctly - WithEvents / Set X subscribers detected: A specific test verifies a
WithEventsdeclaration 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_sitesreturned 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
eventkind is in the node kinds table inardelperal/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
- Plan: https://github.com/ardelperal/VBA_TOOLKIT_BENCH/blob/main/plans/plan-ambicioso-dysflow-codegraph-vba-2026-06-29.md (Phase 2.1)
- Epic Phase 2: https://github.com/ardelperal/VBA_TOOLKIT_BENCH/issues/2
- Companion round-2 issue (broader scope): fix(vba): resolve parser, SQL, and form control extraction bugs #2
- Round-3 (already OPEN, parallel work): [Roadmap][Phase 1] Round-3: model Enums + Consts + .sql queries in graph #25
- Consumer skill it unblocks: https://github.com/ardelperal/VBA_TOOLKIT_BENCH/issues/9
- Test bench: https://github.com/ardelperal/VBA_TOOLKIT_BENCH
- Maintainer prompt pack format: existing dysflow #611-#616 for the established style
Activity
ardelperal commentedon Jul 1, 2026
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.