Repository navigation
chore(scripts): add index-metrics, pr-guard and probe rows; merge CHANGELOG with union - #274
Merged
Merged
Conversation
…NGELOG with union Tools that lived in a private deployment repo move here, because they are about this repository rather than one host: - scripts/index-metrics.mjs: graph counts and a line-insensitive call-edge diff between two indexes. - scripts/pr-guard.mjs: fails when a branch for upstream adds a bun.lock, yarn.lock or pnpm-lock.yaml. - probe-explore.mjs gains --tasks/--ids/--out JSON rows (source offset, rendered files, mustMatch offsets, memory), --expect on a single query, --build, and --mcp/--runtime to ask a serve --mcp subprocess. The positional form still prints the answer. - .gitattributes merges CHANGELOG.md with git's union driver, which replaces a hand-written conflict resolver.
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.
The upstream-merge updater for this fork runs from a separate host-configuration repo. Some of its code is about this repository, not the host: graph metrics, a lockfile rule for upstream PRs, the explore probe, and a CHANGELOG conflict resolver. This PR moves that code here. The updater will call these scripts once this lands.
Changes
scripts/index-metrics.mjs <a.db> [b.db] [--labels a,b]prints graph counts: nodes, edges, self-calls, interface members, import-to-member edges, initializer calls andresolvedBytotals. With two indexes it adds a one-line delta and a call-edge diff keyed on (source, target, refName) by qualified name, with multiplicities. An edit that only shifts lines does not show up as a lost edge.diff-index-drift.mjsstays separate: it compares a synced index against a rebuild of the same tree, keyed on node ids.scripts/pr-guard.mjs [--base upstream/main] [--allow path]fails when the current branch addsbun.lock,bun.lockb,yarn.lockorpnpm-lock.yamlat any depth. Upstream tracks onlypackage-lock.json. A straybun.lockreached upstream feat(explore): markdown index (#361) with a section-first doc tier colbymchenry/codegraph#1699 before this check existed.scripts/agent-eval/probe-explore.mjs:--expect <regex>, which reports where each pattern first matches and exits 1 when one is missing.--tasks <file> [--ids globs] --out <dir>prints one JSON row per task:ms,chars,sourceAt,filesandmustMatchAt. A finalmemoryrow follows, and each answer is saved as<id>.md.--mcp [--runtime <path>]asks aserve --mcpsubprocess instead of the in-process handler.--build <dir>points at another checkout'sdist/.sourceAtandmustMatchAt..gitattributes:CHANGELOG.md merge=union. Upstream and the fork both append bullets under the same headings. Git now keeps both sides instead of stopping the merge.codegraph-build-validationskill.Verification
__tests__/fork-tooling-scripts.test.ts(13 tests). It covers the metrics against a realnode:sqliteindex, the edge diff, the lockfile rule, probe rows and task globs. It also runs the MCP mode against a fixture server for timeouts, a server exit, an RPC error, a tool error and success, and checks that the server is reaped each time.--expect(a present pattern at offset 2464; a missing one gives exit 1).--tasksin-process on Node.--mcpserved on Bun, and on Node from a Bun-run script. Rows match across modes.index-metrics.mjson the zod upstream/fork indexes from the precision replay:import-resolved 1399 -> 5320, with the diff listed. A missing file gives exit 2 without creating it.README rows checked: none apply. These are maintainer scripts, not user-visible features, and no measured number moves.