fix: improve call evidence, HDL analysis and MCP index lifecycle - #1845
Draft
danusha2345 wants to merge 25 commits into
Draft
fix: improve call evidence, HDL analysis and MCP index lifecycle#1845danusha2345 wants to merge 25 commits into
danusha2345 wants to merge 25 commits into
Conversation
`const { fetchUser } = useStore.getState()` and `const setZipUri =
useStore((s) => s.setZipUri)` are how a store action reaches its caller;
the local-binding rule read both as definitions and dropped the
cross-file edge the store-action resolution exists to hold
(object-literal-methods, ui-steps-api). A declaration whose pattern or
initializer names the same member is a re-binding of something defined
elsewhere: the graph's symbol is what the bare call means.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit afa69fc)
`const now = opts.now || Date.now` is a local binding after all: on a Kotlin + JS app the wider "initializer mentions the name" exemption sent 24 `now()` calls onto a Kotlin test's `private val now`. A re-binding is a destructuring pattern or an arrow that picks the member off its own parameter (`useStore((s) => s.setZipUri)`); `() => Date.now()` is not one. The `options.now` fixture is back in the test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Keep JS/TS nested call-site text for Steps and framework resolution, and refuse last-name guesses that bound Map.get/set/has to unrelated project methods.
Порт extractor из colbymchenry#402 и eval/402-verilog; HDL flow ограничен Verilog. Проверены Dual UART, eMMC reader и pulp-platform/axi. Co-authored-by: FHYQ-Dong <FHYQ-Dong@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Проблема и результат
Сводный draft восстанавливает точность графа, достоверность состояния индекса, Verilog/SystemVerilog и автосинхронизацию явно выбранных MCP-проектов. Основа — upstream
3ed73bc; интегрированы #1760, #1844, обновлённый #1842, подход #1848, атомарный rebind #1849 и порт #402 (исходный HDL extractor — FHYQ-Dong).Committed-but-unindexed изменения обнаруживаются через
indexed_at_commit; недоступная отметка включает полный scan. Частичный sync не продвигает отметку. Занятый или устаревший CLI sync возвращает exit 1 с объяснением, включая quiet.Callback выбирает метод своего класса через contains/extends, включая same-line классы, bind и TSX→TS. Посторонние одноимённые handlers не становятся целями.
Function-like C/C++ macros не становятся callees. Учитываются includes, sibling/include-root, define/undef, локальные условия и include cycles. Local constructor calls выбирают lexical namespace и единственный overload по арности; pointer/reference braces исключены; extern/pointer/prototype/aggregate controls защищены. Одноаргументные function macros получают подтверждённое AST имя: комментарии и noexcept не служат доказательством; неизвестное состояние после условного undef сохраняется.
C++ и TS/JS/TSX/JSX IDs учитывают UTF-16 колонку; same-line getter/setter сохраняются раздельно. Остальные языки сохраняют прежний формат IDs. Dart extension types получают корректный container и границы членов: прежние четыре parity failures устранены.
Canonical real root объединяет symlink aliases: один cache, watcher и catch-up gate. Explicit projectPath получает catch-up/watch без автоматического создания индекса. После ухода чужого writer следующий запрос забирает ownership. Shutdown дожидается записей и не позволяет позднему запросу повторно открыть закрываемый cache. Тесты останавливают свой daemon и проверяют cleanup.
Verilog .v/.vh/.sv/.svh (grammar 0.4.0, ABI 15): именованные instances с исходными port connections, generate scopes, ports/signals, always/assign blocks, modports и точные package calls. Module→module flow сохранён; instance→type и lexical signal references позволяют навигацию от экземпляра к использованным сигналам. Named connection nodes связываются с формальным портом точно выбранного модуля и локальным выражением; LHS bit/part selects и concatenations сохраняют основания/индексы. Неоднозначные модули не дают предполагаемую formal binding; sync восстанавливает возвращённый порт без изменения top. Positional/.* bindings пересчитываются группой при изменении порядка портов и удалении неоднозначного модуля; старые actual endpoints удаляются. Точные procedural scopes и generate template parameters сохраняют локальные идентичности. Function/task formal fields, default/for initializer calls и lexical package imports проверены; callable owners сохраняются, scope context переживает sync. Добавлены read/write/readwrite/control/event роли, known-formal argument direction и query hdlAccess / CLI --hdl-access. Sync переклассифицирует unchanged caller arguments после изменений сигнатуры; unknown остаётся обычной reference. Includes/imports и tasks/functions сохранены. Исправлены failed query workers, legacy PID locks, phantom hello clients и служебные prompt-hook notifications.
HDL build profiles в
codegraph.jsonзадают source units, вложенные.f/.Ffilelists, includeDirs, defines, topModules и languageMode. Условный source view сохраняет raw hashes и позиции; profile/header changes пересчитывают общие units, удаляют предыдущий HDL-вариант и сохраняют остальные языки. Watcher учитывает конфигурацию, filelists и includes; status/explore разделяют configured/indexed contexts и показывают неполноту. Snapshot защищает от правки во время прохода; partial sync сохраняет диагностику необработанных units. Непрозрачные macros переводят definedness в unknown вместо ложного выбора else. Includes передают macro state, полного expansion/elaboration нет; topModules и languageMode записывают намерение профиля, не выполняют elaboration или проверку соответствия стандарту.Optional slang integration:
codegraph hdl-semanticиCodeGraph.getHdlSemantics()вычисляют parameters и поддержанные port widths для выбранного profile/top/instance. Изолированный snapshot, compiler version/hash, overrides и limits входят в provenance; sourceNodeId появляется только при совпадении profile/raw hash/однозначного declaration. Timeout/cancel, failed compiler, изменившиеся sources и malformed AST не изменяют source graph. Это on-demand view без persisted semantic cache; macro column0 остаётся unknown, Windows runner пока отключён.Optional
hdl-semantic --python: pinned pyslang 11.0.0 компилирует snapshot и возвращает provenance имени parameter/port/typedef через SourceManager original/expansion relations. Нормализованный payload проверяется по физическим UTF-8 offsets; native/helper/Python hashes фиксируются. Macro facts не получают предполагаемый sourceNodeId; collapsed ranges явно incomplete. Старый --slang остаётся доступен, frontend выбирается явно, автоматической установки dependencies нет.Extraction stamp 38: существующим индексам нужен полный
codegraph index. Background rebuild #1798 не добавлен. Неизвестные C build flags обрабатываются консервативно; полного preprocessing нет. HDL access roles означают синтаксическое использование и known-formal contracts, без доказательства исполнения или электрического драйвера. Positional bindings требуют достоверного header order; wildcard matching учитывает explicit overrides и локальные сигналы. Generate iterations и timing/elaboration не моделируются.Проверки
Linux x64, Node 24.15.0; новый native kernel собран из исходников ветки.
Windows/macOS, новое платное agent A/B и аппаратное поведение FPGA не проверялись. Это интеграционный draft, не запрос повторно слить самостоятельные PR; после их принятия diff следует сократить.
7 C++ review fixtures компилируются как C++17; native/WASM результаты совпадают. Раздельные same-line constructors и namespace/arity targets проверены; неоднозначные перегрузки и initializer_list намеренно не угадываются. Symlink-запрос ждёт исходный catch-up barrier; оба ответа содержат добавленный файл.
Проверена актуальность IEEE 1800-2023 и grammar v0.4.0 (2026-07-17). Изолированное сравнение grammar на 137 HDL: одинаковые 7 ERROR, 0 missing, 0 изменений extractor output; затем новая grammar прошла regression/build проверки. На AXI: 32 positional, 14 wildcard clauses, 28 пар formal/actual.
Этап lexical scopes проверен на UART/CRC/AXI и сравнением sync/clean rebuild. Все 7 raw parse ERROR классифицированы как preprocessing boundaries; условные xbar headers проверены в двух конфигурациях, ASSUME property — минимальным control. Полный demux требует отсутствующих common_cells includes.
Access queries проверены на UART/CRC/AXI; после изменения AXI package 6981 access/argument edges совпали с clean rebuild (один local sync control 366 мс).
Основные отчёты:
docs/hdl-profiles.md,docs/validation-hdl-profiles-2026-09-12.md,docs/validation-hdl-access-2026-09-12.md,docs/validation-hdl-scopes-2026-09-12.md,docs/validation-hdl-parse-gaps-2026-09-12.md,docs/validation-hdl-wildcard-2026-09-12.md,docs/validation-hdl-port-bindings-2026-09-12.md,docs/hdl-roadmap.md,docs/validation-hdl-navigation-2026-09-12.md,docs/validation-review-fixes-2026-09-12.md,docs/validation-remaining-defects-2026-09-12.md; предыдущие этапы описаны в остальных validation-отчётах ветки.HDL profiles: 55 новых tests прошли, включая compiled CLI/workers и настоящий fs.watch. На независимых копиях UART synth/sim (6/11 файлов) и AXI normal/VCS (2 файла, 301/303 узла) все переключения sync совпали с clean rebuild; SHA256 исходников не изменились. UART sim сообщает 5 timescale diagnostics, AXI — 17 macro diagnostics; полного preprocessing нет. Все 10 активных локальных индексов проверены: stamp 38, complete, 0 pending.
Полный план продолжения HDL с задачами, зависимостями, критериями приёмки и журналом:
VERILOG_TRACKER.md. Следующий пакет — сравнение compiler frontends на UART/CRC/AXI.Проверка semantic API/CLI: 38 новых tests прошли; реальные UART CLK_FREQ=50000000, CRC width16 и AXI overrides2/4 возвращают проверенные sourceNodeId. Include change обновляет widths8/16→12/16; до sync нет ссылок на stale graph, после sync facts/fingerprint совпадают с recreate+indexAll. Manifest закрепляет137 HDL sources; три AXI dependency revisions восстановлены по lockfile. Slang выбран сравнением24 controls с Verilator; никаких simulation/synthesis утверждений. Отчёты:
docs/hdl-semantics.md,docs/validation-hdl-semantics-2026-09-12.md,docs/hdl-frontend-decision.md,docs/validation-hdl-corpora-build-2026-09-12.md.Macro provenance: 53 focused tests + 6 real pyslang checks прошли. Реальный AXI aw_chan_t: width 35, argument 415:31, macro-body 178:44, outer invocation 415:3–49; inner collapsed range помечен incomplete. Проверены nested/include/concat, UTF-8/BOM/CRLF, physical line mapping, zero/empty string/XZ и compiled CLI. Exporter включён в npm dry-run package. Объём включает declaration-name и прямые expression token origins; транзитивные зависимости и persistent cache ещё не охвачены. Документация:
docs/hdl-macro-source-map.md,docs/validation-hdl-macro-source-map-2026-09-12.md.Expression origins: pyslang различает effective initializer, declared default после override и type/dimensions syntax; command-line и unavailable coverage явно отмечены. Non-ANSI dimensions читаются из internal declarator, normalized duplicates после budget truncation удаляются. На неизменённом axi_from_mem с отдельным diagnostic wrapper проверены типы 35/36/34 бита и macro range arguments; header change, scoped sync и recreate/indexAll дают одинаковые facts/origins. 9 новых TS regressions и 15 реальных Python controls прошли; отчёт
docs/validation-hdl-expression-origins-2026-09-12.md.