Skip to content

fix(postgres): carry tree-sitter-sql in the postgres extra and surface grammar errors - #3048

Closed
Azeem1985 wants to merge 41 commits into
Graphify-Labs:v8from
TelB-io:fix/postgres-extra-sql-grammar
Closed

Azeem1985 wants to merge 41 commits into
Graphify-Labs:v8from
TelB-io:fix/postgres-extra-sql-grammar

Conversation

@Azeem1985

Copy link
Copy Markdown
Contributor

Fixes #3047.

Installing the README-prescribed graphifyy[postgres] and running graphify extract --postgres <DSN> against a live database printed PostgreSQL: 0 nodes, 0 edges with exit 0: the postgres extra ships only psycopg[binary], while the introspection path feeds reconstructed DDL to extract_sql(), which needs tree-sitter-sql from the separate sql extra. The missing-grammar report came back in an error key that introspect_postgres() silently dropped, so a live schema looked like an empty database.

  • pyproject.toml: postgres extra now includes tree-sitter-sql
  • graphify/pg_introspect.py: raise ImportError when extract_sql() reports an error — the CLI already catches (ConnectionError, ImportError) on this path and exits 1, so the failure becomes loud with the correct install hint
  • tests/test_pg_introspect.py: regression test — a grammar error must raise, never return an empty graph

Verified end-to-end on postgres:17-alpine (3 tables + FKs, a view, a function): with the grammar present the same command produces all 6 schema nodes and both FK references edges. Full tests/test_pg_introspect.py suite passes (9/9).

🤖 Generated with Claude Code

Azeem and others added 30 commits August 23, 2026 11:53
…) so the watcher does not re-trigger on its own reads

On Linux, watchdog's inotify observer reports `opened` (watchdog >= 2.3) and `closed_no_write`
(watchdog >= 4) for every file open/close. `Handler.on_any_event` counted those as changes, so the
watcher's own AST rebuild — which reads every watched file — re-triggered the watcher: a debounce
window later it printed "1683 file(s) changed" with nothing modified, rebuilt again, and so on.
Measured on a 17k-node, ~1.7k-file tree: ~26 CPU-minutes per hour, 15 memory-kills of the
watcher in 3 days (it restarts and loops again), and the `needs_update` flag re-written every
1-3 minutes after any doc edit, which permanently softens `hook-guard read --strict` (cli.py
checks the stale flag before the strict check).

Fix: a small helper `_is_read_only_event` returns True for `opened` / `closed_no_write`; the
handler ignores those. Creation, modification, move, deletion and close-after-write still count.
macOS (PollingObserver) never emits these, so nothing changes there.

Tests: two new tests in tests/test_watch.py (plain objects, and the real watchdog event classes
when available).
…ly authenticated Codex CLI

Sibling of the existing claude-cli backend, for operators whose OpenAI access is a ChatGPT
subscription (Codex CLI OAuth), not an API key. Ported from a field-proven implementation
(measured ~308 docs/hour at concurrency 6 on an 8 GB box): codex exec --skip-git-repo-check
--json --sandbox read-only, prompt via stdin (argv would hit Linux MAX_ARG_STRLEN), result
via -o file, empty-graph refusal to avoid hollow-bisect storms. Two per-call config pins:
mcp_servers={} (each exec otherwise spawns the user's configured MCP servers per call —
measured ~160-300 MB each, more than the extraction itself) and model_reasoning_effort
(GRAPHIFY_OPENAI_CLI_EFFORT, default ultra). Model via GRAPHIFY_OPENAI_CLI_MODEL (default
gpt-5.6-sol). Tests: argv contract, env overrides, missing-binary error.
…KIMI_EFFORT, default max) for models that support it

K3 advertises valid_efforts [low, high, max]; with nothing sent the server applies its own
default (high). The key is read by the existing kimi request plumbing and forwarded as
reasoning_effort; env-overridable so no source edit is ever needed.
…the credential (OAuth), mirroring claude-cli
…ket mcp_servers={} does not work

Codex merges config overrides into the table rather than replacing it, so `-c mcp_servers={}` leaves
every server enabled — verified with Codex's own reader: `codex mcp list -c mcp_servers={}` still
shows 'enabled', while `-c mcp_servers.<name>.enabled=false` shows 'disabled' (`enabled` is a real
field in `codex mcp get`). Measured cost of the ineffective pin during a live extraction: four MCP
servers spawned by one `codex exec`, ~152 MB each.

Now the backend asks Codex for its own server list (`codex mcp list --json`) and adds one
`-c mcp_servers.<name>.enabled=false` per server — no hardcoded names, best-effort (older Codex or no
config: extraction proceeds unchanged). Tests cover both servers disabled, the empty-config case, and
that the blanket form is gone.
Two `graphify extract` runs (or an extract racing a watcher/hook rebuild)
on one graphify-out/ interleave cache saves and clobber graph.json. extract
now takes the same advisory flock _rebuild_code takes, immediately after
the output dir exists, and holds it to the end of the command. A contended
run prints the holder's PID and waits up to GRAPHIFY_LOCK_TIMEOUT seconds
(default 600) via a new bounded-wait mode on _rebuild_lock (the kernel only
offers skip or wait-forever, so the deadline is polled in userspace), then
exits 1 instead of hanging forever behind a wedged rebuild. The lock is
acquired exactly once — flock is per-open-file-description, so re-entry in
the same process would self-deadlock — and SystemExit unwinds the context
manager, so the unlink-on-release contract holds on every exit path.

Co-Authored-By: Claude Fable 5 <[email protected]>
… on a second backend

When every semantic chunk fails on the primary backend (missing SDK
package, bad key, an outage), a configured fallback backend retries the
same still-uncached files once instead of failing the build. Nothing is
cache-saved for a zero-success pass, so the retry covers exactly the
files the primary failed on. --model belongs to the primary backend and
is not forwarded, the fallback name is validated before any API spend,
and only a zero-success retry keeps the all-chunks-failed exit 1.
GRAPHIFY_FALLBACK_BACKEND sets the default; the CLI flag wins.

Co-Authored-By: Claude Fable 5 <[email protected]>
…doc changes

Instead of only writing the needs_update flag, `graphify watch --semantic`
runs `graphify extract` on the watched root when a debounced batch contains
surviving non-code files. The extract runs as a subprocess on purpose:
fcntl.flock is held per open file description, so in-process re-entry of
_rebuild_lock would self-deadlock, while a child process serializes cleanly
on graphify-out/.rebuild.lock against hook-driven rebuilds.

A failed extract falls back to _notify_only so the user never loses the
flag + /graphify --update instruction; a successful run clears the flag
(extract itself never touches it — only _rebuild_code does). --backend and
--fallback-backend are forwarded to the extract subprocess and rejected
without --semantic rather than being a silent no-op.

Co-Authored-By: Claude Fable 5 <[email protected]>
The push sinks ran one MERGE query per node and per edge, so pushing a
large graph to a non-local server spent nearly all its time on round
trips. Rows are now grouped by sanitized node label / relationship type
(those are interpolated into the Cypher text and cannot be parameters)
and sent in UNWIND batches of --batch-size rows (default 100, ~100x
fewer round trips). Each row carries exactly the old per-entry params
and UNWIND processes rows in order, so the MERGE/SET upsert semantics -
including idempotent re-runs - are unchanged. A non-positive or
non-integer --batch-size is rejected on parse, before any connection.

Co-Authored-By: Claude Fable 5 <[email protected]>
Review addition: the no-double-spend edge — when the primary backend got at
least one semantic chunk through, --fallback-backend must NOT re-dispatch
the whole uncached set on the second backend. Locks the succeeded == 0
trigger condition in place.

Co-Authored-By: Claude Fable 5 <[email protected]>
extract: hold the per-repo rebuild lock for the whole pipeline
# Conflicts:
#	CHANGELOG.md
#	graphify/cli.py
extract: --fallback-backend retries a zero-success semantic pass on a second backend
watch: --semantic runs LLM extraction automatically when doc/paper/image files change
export: batched UNWIND push for neo4j/falkordb (--batch-size)
# Conflicts:
#	graphify/cli.py
…etail, and turn-usage accounting; changelog

The argv-contract tests said what we send; these say what we accept back:
the -o JSON becomes the result dict with usage from the last turn.completed
JSONL event (cached input not double-counted), a non-zero exit or a missing/
empty -o file raises with stderr AND the JSONL stdout tail preserved (HTTP
errors surface only there), and an empty-but-valid graph raises instead of
feeding the hollow-response bisect.

Co-Authored-By: Claude Fable 5 <[email protected]>
llm: openai-cli backend — semantic extraction through the locally authenticated Codex CLI
… default max; changelog

Import-time env pattern, so the test reloads the module around each
assertion — same convention as test_anthropic_custom_endpoint.py.

Co-Authored-By: Claude Fable 5 <[email protected]>
llm: kimi backend sends an explicit reasoning_effort (GRAPHIFY_KIMI_EFFORT, default max)
watch: ignore read-only inotify events (opened / closed_no_write) so the watcher does not re-trigger on its own reads
…gnore evaluation

_is_ignored's _eval called Path.relative_to(anchor) — and often
relative_to(root) — for EVERY pattern on EVERY walked entry, re-parsed
each pattern's flags per entry, re-split the relative path per pattern,
and re-stat'ed is_dir() per matched directory-only pattern. On Python
3.12+ relative_to walks parents quadratically in depth, so a real
76,579-file vault with a 28,968-file ignored dir (graphify-notes/ in
.graphifyignore) had detect() pinned at 99% CPU for 52+ minutes inside
pathlib._format_parsed_parts (py-spy, live).

Now: the relative path is computed once per entry per distinct anchor
via a lexical parts-prefix helper (_lexical_relative — exactly
relative_to's comparison, Windows casefold included), pattern flags are
parsed once and cached, segment/prefix splits and the is_dir stat happen
at most once per entry. Directory-level pruning (one evaluation excludes
a whole ignored subtree from os.walk) is pinned by regression tests
counting walk descents and evaluation totals.

Semantics proven unchanged: 38,000-case differential fuzz old-vs-new on
Python 3.12.14 and 3.14.4, zero mismatches; full detect/watch/extract
suites green. Synthetic 300-pattern deep tree: 12.0s -> 3.3s; per-scan
relative_to calls 65,732 -> 2,047 on a 1,000-file corpus, 61 patterns.

Co-Authored-By: Claude Fable 5 <[email protected]>
perf(detect): per-entry string matching for ignore rules — no pathlib objects per pattern per file
… memory wall

A --push never needs the graph object: it only iterates nodes, then
edges. Yet the CLI json.loads-ed the ENTIRE graph.json and rebuilt a
full NetworkX graph before push_to_falkordb/neo4j walked it. On a real
1.87GB graph.json that load was OOM-killed on a 7.6GB box (unit capped
6G RAM + 5G swap) before a single row went out; an earlier run measured
the pusher at ~5.3GB peak.

The --push paths (falkordb + neo4j) now stream-parse the file with a
stdlib-only incremental reader for the known node-link shape (ijson is
not a dependency): one fast offset scan, then one row pass per array,
each with a fixed 64KiB buffer, feeding batches straight to the existing
batched UNWIND writers without constructing NetworkX. Measured on a
30.5MB / 50k-node synthetic file: 0.66MB tracemalloc peak vs 135.4MB
for the old path (~204x, ~2% of file size, flat in graph size).

Wire parity is pinned by tests against the in-memory push: identical
Cypher text, identical row payloads, per-label/relation row order and
chunking preserved, nodes fully precede edges (even when "links"
physically precedes "nodes" in the file - offsets are scanned first),
legacy "edges" key honoured, MERGE upserts idempotent, --batch-size and
URI/auth parsing unchanged. Only cross-label batch interleaving differs,
which MERGE makes irrelevant. The GRAPHIFY_MAX_GRAPH_BYTES cap still
guards the push path - now bounding disk read, not RAM. The no-push
cypher.txt route keeps the old in-memory code on purpose.

Co-Authored-By: Claude Fable 5 <[email protected]>
feat(export): stream graph.json into the DB push — kill the load-time memory wall
Azeem and others added 11 commits August 24, 2026 12:44
…write indexes, legacy adoption

Production measurements on a real 1.87GB graph (1,211,189 nodes / ~1.15M
edges) against FalkorDB, streaming pusher, batch 500:

- node MERGEs without indexes: ~3.6s/batch (~137 entries/sec); ~60x faster
  after hand-creating per-label (n:Label) ON (n.id) indexes live (all 1.2M
  nodes landed in ~12 min);
- edge phase: ~2 edges/sec - the edge MERGE matched endpoints with NO label
  (MATCH (a {id: row.src}), (b {id: row.tgt})), and per-label indexes cannot
  serve label-less lookups, so every edge full-scanned 1.2M nodes TWICE;
  1.15M edges were days away.

All four writers (push_to_* and stream_push_to_*) now:

1. stamp every node with the shared :GraphifyNode label (SHARED_NODE_LABEL)
   on top of its per-type label, merging on the shared label + id and adding
   the type label via SET n:<Type> (FalkorDB >= 2.12);
2. create indexes idempotently BEFORE any write - GraphifyNode on (id) plus
   one per type label (Neo4j: CREATE INDEX IF NOT EXISTS; FalkorDB has no
   IF NOT EXISTS, its 'already indexed' reply is tolerated by message; the
   in-memory writers know all labels up front, the streaming writers index
   each label at first encounter, still before that label's first batch);
3. MATCH edge endpoints as (:GraphifyNode {id: ...}) so the one shared-label
   index serves both phases;
4. adopt-on-push old-container contract: every push first runs the one-scan
   MATCH (n) WHERE n.id IS NOT NULL SET n:GraphifyNode, so a container
   loaded by the previous unlabeled pusher is adopted in place - a MERGE on
   (:GraphifyNode {id}) alone could never match an unlabeled legacy node and
   would have duplicated the whole graph on re-push. No fresh container
   required; the scan is a no-op on adopted/empty graphs.

Row payloads, batching, --batch-size, URI/auth parsing and MERGE upsert
idempotence are unchanged; tests pin index-before-write ordering, the
shared-label Cypher, payload parity, already-indexed tolerance (real errors
still raise), and the no-duplicates adoption contract against a semantic
fake that executes the emitted Cypher shapes over a legacy container.

Co-Authored-By: Claude Fable 5 <[email protected]>
feat(export): index-driven DB push — shared :GraphifyNode label, pre-write indexes, legacy adoption
Owner's order 2026-08-24: "This can limit the amount of information
retrieved." The 2000-token default starved multi-node answers, cutting
most of a scoped subgraph before it reached the caller.

Changed everywhere the default lives:
- CLI `graphify query` --budget default (cli.py) and its help text
  (__main__.py)
- MCP schema defaults for query_graph / get_neighbors / get_community
  and the three handler fallbacks (serve.py)
- _query_graph_text / _subgraph_to_text signature defaults (serve.py)
- skillgen fragments (references/query/default.md, core/aider.md,
  core/devin.md), all rendered skill references and monoliths, and the
  blessed expected/ snapshots (python -m tools.skillgen + --bless;
  --check clean)
- new sanctioned change-class predicate in skillgen gen.py so the
  monolith v8 round-trip accepts the renumbering and nothing else

Truncation notices derive from the live token_budget value, so no
message text pinned the old number. --budget N / token_budget still
override.

Tests: new pins for the CLI parse default (test_query_cli.py, including
--budget override), the Python signature defaults (test_serve.py), and
the MCP schema advertisement over tools/list (test_serve_http.py).

Co-Authored-By: Claude Fable 5 <[email protected]>
Raise the default graph-answer token budget from 2000 to 20000
The strict read guard admits an agent only while the 'recently oriented'
stamp (graphify-out/cache/last_query_stamp) is fresh. The CLI's query /
path / explain each touch it (cli._touch_query_stamp), but their MCP
twins never did — an agent that oriented through the server via
query_graph was still treated as blind and had its first raw read
denied.

call_tool now touches the stamp after every successful call to one of
the four orientation tools: query_graph (= query), shortest_path
(= path), get_node + get_neighbors (the MCP split of explain). The
stamp lands next to the graph that answered, so a project_path call
stamps THAT project's graphify-out/cache — the graph whose reads the
guard gates. Browsing tools (graph_stats, god_nodes, get_community) and
the PR tools don't stamp on the CLI and still don't over MCP; a failed
call stamps nothing.

Co-Authored-By: Claude Fable 5 <[email protected]>
fix(serve): MCP orientation refreshes the strict hook's freshness stamp
…esson annotations

The subgraph renderer has supported learning=<status>[:stale] NODE
annotations since the work-memory overlay shipped, and both explain and
the MCP server attach the .graphify_learning.json sidecar at load time.
The CLI query loader builds its graph directly from graph.json and never
attached the overlay, so the same question answered over MCP showed the
lessons while the CLI answer silently dropped them — despite the docs
promising query surfaces a Lesson hint.

Attach the overlay in the CLI query path exactly like serve._load_graph:
display-only, fail-safe to an empty overlay, byte-identical output when
no sidecar exists. The :stale marker renders too.

Co-Authored-By: Claude Fable 5 <[email protected]>
fix(query): CLI query output carries the learning sidecar's lesson annotations
The context cache keyed on graph.json's (mtime_ns, size) alone, but the
.graphify_learning.json sidecar is baked into the cached graph object at
load time (_load_graph attaches it as the learning= annotation overlay).
graphify reflect rewrites only the sidecar, never graph.json — so a
long-running MCP server kept serving stale lesson annotations (or none)
until the graph itself happened to change.

The key now appends the sidecar's (mtime_ns, size), with (0, 0) standing
in when no sidecar exists: appearing, changing, and vanishing each
invalidate exactly like a graph change, on both the pinned default graph
and project_path LRU contexts; an unchanged pair still hits the cache.

Co-Authored-By: Claude Fable 5 <[email protected]>
fix(serve): include the learning sidecar in the graph-context cache key
…e grammar errors

The --postgres path reconstructs DDL and hands it to extract_sql(), which
needs the tree-sitter-sql grammar — but the postgres extra only shipped
psycopg[binary]. Installing 'graphifyy[postgres]' exactly as the README
prescribes then running 'graphify extract --postgres <DSN>' printed
'PostgreSQL: 0 nodes, 0 edges' with exit 0: extract_sql() reported the
missing grammar in an 'error' key that introspect_postgres() silently
dropped, so a live database looked empty instead of failing loudly.

- pyproject: postgres extra now includes tree-sitter-sql
- pg_introspect: raise ImportError when extract_sql reports an error,
  reusing the CLI's existing (ConnectionError, ImportError) exit path
- test: grammar error must raise, never return an empty graph

Co-Authored-By: Claude Fable 5 <[email protected]>

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 5 advisory finding(s) below merit a look before merge.

Formal verification. 3 change(s) tested, no difference found (not proven).


Graphify review — findings

Adds an openai-cli backend that runs semantic extraction and community labeling through the local Codex CLI on a ChatGPT OAuth subscription (stdin-fed prompts, read-only sandbox, per-call MCP servers disabled, serial by default), plus a kimi reasoning_effort control, an extract --fallback-backend that retries all-failed chunks on a second backend, and watch --semantic that fires a locked subprocess extract on doc/paper/image changes. Fixes the FalkorDB/Neo4j --push path to be index-driven and streaming: every writer stamps a shared :GraphifyNode label, MERGEs/MATCHes endpoints on it with indexes created before any write and legacy graphs adopted in place, while the pusher now streams graph.json in fixed buffers instead of loading the whole graph into RAM (~204x lower peak on the synthetic case, no more OOM kills). Fixes detect's ignore evaluation to compute each entry's relative path once via a lexical helper with cached pattern flags and directory-level pruning (52-minute scans down to seconds, matching semantics fuzz-verified), and stops watch from looping on watchdog's read-only opened/closed_no_write events. Fixes three MCP/CLI parity gaps — the graph-context cache now fingerprints the .graphify_learning.json sidecar so reflect is visible to a running server, graphify query attaches the lesson overlay like explain/MCP do, and successful query_graph/shortest_path/get_node/get_neighbors calls touch the read-hook stamp — and raises the default answer token budget from 2000 to 20000 everywhere the default lives.

Worth a look

  • --no-cluster path now references clustered graph state — graphify/cli.py · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • PostgreSQL extraction branch removed while merge still references pg_result — graphify/cli.py · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • Semantic partial-file marker variable is used after its defining assignment was removed — graphify/cli.py · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • AST extraction block is nested under semantic backend handling — graphify/cli.py · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • Deep incremental semantic widening is unreachable — graphify/cli.py · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 4110 functions depend on the 2489 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 474 callers, 42 callees
  • new: _rebuild_code() — 98 callers, 50 callees
  • new: detect() — 108 callers, 15 callees
  • new: deduplicate_entities() — 63 callers, 22 callees
  • new: build_merge() — 46 callers, 15 callees
  • new: save_manifest() — 39 callers, 11 callees
  • new: to_obsidian() — 34 callers, 12 callees
  • new: extract_files_direct() — 17 callers, 22 callees
  • …and 87 more — each is listed as a finding

Verification — 4110 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 3783 function(s) in the blast radius were not formally verified this run

Formal verification

No difference found (not proven): No behavior difference found in \_run\_cli (not a proof).

The verifier ran both versions of \_run\_cli on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

Could not verify: Could not verify load\_cached.

The verifier did not have enough to check load\_cached, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify save\_semantic\_cache.

The verifier did not have enough to check save\_semantic\_cache, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `root` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify \_stamped\_manifest\_files.

The verifier did not have enough to check \_stamped\_manifest\_files, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `root` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify dispatch\_command.

The verifier did not have enough to check dispatch\_command, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 23 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly SystemExit — names the real obstacle, not a sampling gap)

Could not verify: Could not verify \_is\_ignored.

The verifier did not have enough to check \_is\_ignored, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify detect.

The verifier did not have enough to check detect, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `root` is annotated `Path` — outside the synthesizable primitive/collection set

No difference found (not proven): No behavior difference found in to\_obsidian (not a proof).

The verifier ran both versions of to\_obsidian on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

Could not verify: Could not verify push\_to\_falkordb.

The verifier did not have enough to check push\_to\_falkordb, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 200 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly ImportError — names the real obstacle, not a sampling gap)

Could not verify: Could not verify push\_to\_neo4j.

The verifier did not have enough to check push\_to\_neo4j, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 200 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly ImportError — names the real obstacle, not a sampling gap)

Could not verify: Could not verify \_rewire\_unique\_stub\_nodes.

The verifier did not have enough to check \_rewire\_unique\_stub\_nodes, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: the input domain has 81 values but only 9 distinct were tested — a small finite domain must be EXHAUSTED, not sampled (an untested input could invert the result)

Could not verify: Could not verify extract.

The verifier did not have enough to check extract, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `cache_root` is annotated `Path | None` — outside the synthesizable primitive/collection set

Could not verify: Could not verify extract\_bash.

The verifier did not have enough to check extract\_bash, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify extract\_commonlisp.

The verifier did not have enough to check extract\_commonlisp, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify \_extract\_generic.

The verifier did not have enough to check \_extract\_generic, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify extract\_julia.

The verifier did not have enough to check extract\_julia, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify extract\_powershell.

The verifier did not have enough to check extract\_powershell, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify \_load\_tsconfig\_aliases.

The verifier did not have enough to check \_load\_tsconfig\_aliases, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `start_dir` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify \_load\_tsconfig\_base\_url.

The verifier did not have enough to check \_load\_tsconfig\_base\_url, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `start_dir` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify \_merge\_decl\_def\_classes.

The verifier did not have enough to check \_merge\_decl\_def\_classes, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: the input domain has 81 values but only 9 distinct were tested — a small finite domain must be EXHAUSTED, not sampled (an untested input could invert the result)

Could not verify: Could not verify extract\_sql.

The verifier did not have enough to check extract\_sql, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify extract\_zig.

The verifier did not have enough to check extract\_zig, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

Could not verify: Could not verify bisect\_slice.

The verifier did not have enough to check bisect\_slice, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `fs` is annotated `FileSlice` — outside the synthesizable primitive/collection set

No difference found (not proven): No behavior difference found in expand\_oversized\_files (not a proof).

The verifier ran both versions of expand\_oversized\_files on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

Could not verify: Could not verify is\_splittable\_text.

The verifier did not have enough to check is\_splittable\_text, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

· 18 grounded finding(s) anchored inline below; 77 more finding(s) on lines outside this diff (see the check run).

)


def push_to_neo4j(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — push_to_neo4j()

fans out to 9 callees (efferent coupling); 10 callers depend on it (afferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

return sent


def stream_push_to_neo4j(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — stream_push_to_neo4j()

fans out to 8 callees (efferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

return {"nodes": nodes_pushed, "edges": edges_pushed}


def stream_push_to_falkordb(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — stream_push_to_falkordb()

fans out to 8 callees (efferent coupling); 12 callers depend on it (afferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

return self.links_offset if self.links_offset is not None else self.edges_offset


def scan_node_link(path: Path) -> NodeLinkScan:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — scan_node_link()

high coupling complexity (Ca·Ce = 15).

Grounded coupling-delta finding (deterministic), not an LLM guess.

Comment thread graphify/llm.py
return " | ".join(parts) or "(no stderr or stdout)"


def _call_claude_cli(user_message: str, max_tokens: int = 8192, *, deep_mode: bool = False, images: list[_ImageRef] | None = None) -> dict:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — _call_claude_cli()

fans out to 9 callees (efferent coupling); 31 callers depend on it (afferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

Comment thread tests/test_serve_http.py
assert not _stamp_path(default_graph).exists()


def test_mcp_failed_call_does_not_stamp(tmp_path):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — test_mcp_failed_call_does_not_stamp()

fans out to 6 callees (efferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

Comment thread tests/test_serve_http.py
assert loads["n"] == 4


def test_sidecar_change_invalidates_project_context_too(tmp_path, monkeypatch):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — test_sidecar_change_invalidates_project_context_too()

fans out to 7 callees (efferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

# End-state parity vs the in-memory push
# ---------------------------------------------------------------------------

def test_falkordb_stream_matches_in_memory_push(tmp_path, monkeypatch):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — test_falkordb_stream_matches_in_memory_push()

fans out to 8 callees (efferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

assert "tags" not in by_id["n-0"] and "_private" not in by_id["n-0"]


def test_neo4j_stream_matches_in_memory_push(tmp_path, monkeypatch):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — test_neo4j_stream_matches_in_memory_push()

fans out to 8 callees (efferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

assert row["props"].get("confidence") == "INFERRED"


def test_stream_reads_legacy_edges_key(tmp_path, monkeypatch):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — test_stream_reads_legacy_edges_key()

fans out to 8 callees (efferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

@Azeem1985

Copy link
Copy Markdown
Contributor Author

Thanks for the grounded review — no blocking issues noted. The coupling advisories point at the neo4j/falkordb pusher functions, which this PR doesn't modify (they're the subject of the separate streaming/batched-push offers); the postgres fix itself — the extra carrying tree-sitter-sql and surfacing extract_sql errors instead of a silent 0-node graph — drew no findings. Happy to split or adjust if preferred. — Azeem1985/TelB-io fork

🤖 Generated with Claude Code

@Azeem1985

Copy link
Copy Markdown
Contributor Author

Closing this in favour of #3072, which is the same change on a branch cut from v8 — 4 files instead of the 62 this one shows.

This PR was opened from a branch that also carried unrelated work from our fork, so its diff was 62 files of a two-line fix plus effectively our entire fork. That is my mistake in how I cut the branch, and it made this unreviewable. Nothing about the proposed change has altered; only the packaging.

#3072 has the full rationale and measurements. Sorry for the extra noise, and thank you for your patience.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

postgres extra lacks tree-sitter-sql: --postgres on a live DB silently reports 0 nodes, exit 0

1 participant