@aroman22/codegraph-vba-darwin-arm64 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/codegraph +5 -0
- package/lib/dist/bin/codegraph.d.ts +1 -1
- package/lib/dist/bin/codegraph.d.ts.map +1 -1
- package/lib/dist/bin/codegraph.js +307 -81
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/command-supervision.d.ts +38 -1
- package/lib/dist/bin/command-supervision.d.ts.map +1 -1
- package/lib/dist/bin/command-supervision.js +22 -3
- package/lib/dist/bin/command-supervision.js.map +1 -1
- package/lib/dist/db/index.d.ts +84 -5
- package/lib/dist/db/index.d.ts.map +1 -1
- package/lib/dist/db/index.js +209 -12
- package/lib/dist/db/index.js.map +1 -1
- package/lib/dist/db/migrations.d.ts +1 -1
- package/lib/dist/db/migrations.d.ts.map +1 -1
- package/lib/dist/db/migrations.js +80 -3
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/queries.d.ts +116 -4
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +294 -7
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/schema.sql +43 -1
- package/lib/dist/db/wal-valve.d.ts +106 -0
- package/lib/dist/db/wal-valve.d.ts.map +1 -0
- package/lib/dist/db/wal-valve.js +208 -0
- package/lib/dist/db/wal-valve.js.map +1 -0
- package/lib/dist/directory.d.ts +9 -5
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +210 -19
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/extraction/cfml-extractor.d.ts +107 -0
- package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/cfml-extractor.js +494 -0
- package/lib/dist/extraction/cfml-extractor.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +25 -1
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +177 -23
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +47 -2
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +568 -51
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/languages/arkts.d.ts +3 -0
- package/lib/dist/extraction/languages/arkts.d.ts.map +1 -0
- package/lib/dist/extraction/languages/arkts.js +127 -0
- package/lib/dist/extraction/languages/arkts.js.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts +98 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +563 -1
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/cfquery.d.ts +12 -0
- package/lib/dist/extraction/languages/cfquery.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cfquery.js +28 -0
- package/lib/dist/extraction/languages/cfquery.js.map +1 -0
- package/lib/dist/extraction/languages/cfscript.d.ts +3 -0
- package/lib/dist/extraction/languages/cfscript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cfscript.js +73 -0
- package/lib/dist/extraction/languages/cfscript.js.map +1 -0
- package/lib/dist/extraction/languages/cobol.d.ts +33 -0
- package/lib/dist/extraction/languages/cobol.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cobol.js +499 -0
- package/lib/dist/extraction/languages/cobol.js.map +1 -0
- package/lib/dist/extraction/languages/erlang.d.ts +3 -0
- package/lib/dist/extraction/languages/erlang.d.ts.map +1 -0
- package/lib/dist/extraction/languages/erlang.js +350 -0
- package/lib/dist/extraction/languages/erlang.js.map +1 -0
- package/lib/dist/extraction/languages/index.d.ts.map +1 -1
- package/lib/dist/extraction/languages/index.js +18 -0
- package/lib/dist/extraction/languages/index.js.map +1 -1
- package/lib/dist/extraction/languages/nix.d.ts +3 -0
- package/lib/dist/extraction/languages/nix.d.ts.map +1 -0
- package/lib/dist/extraction/languages/nix.js +294 -0
- package/lib/dist/extraction/languages/nix.js.map +1 -0
- package/lib/dist/extraction/languages/solidity.d.ts +3 -0
- package/lib/dist/extraction/languages/solidity.d.ts.map +1 -0
- package/lib/dist/extraction/languages/solidity.js +293 -0
- package/lib/dist/extraction/languages/solidity.js.map +1 -0
- package/lib/dist/extraction/languages/terraform.d.ts +3 -0
- package/lib/dist/extraction/languages/terraform.d.ts.map +1 -0
- package/lib/dist/extraction/languages/terraform.js +641 -0
- package/lib/dist/extraction/languages/terraform.js.map +1 -0
- package/lib/dist/extraction/languages/vbnet.d.ts +11 -0
- package/lib/dist/extraction/languages/vbnet.d.ts.map +1 -0
- package/lib/dist/extraction/languages/vbnet.js +141 -0
- package/lib/dist/extraction/languages/vbnet.js.map +1 -0
- package/lib/dist/extraction/mybatis-extractor.d.ts +30 -10
- package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.js +140 -38
- package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
- package/lib/dist/extraction/parse-pool.d.ts +28 -1
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
- package/lib/dist/extraction/parse-pool.js +76 -7
- package/lib/dist/extraction/parse-pool.js.map +1 -1
- package/lib/dist/extraction/parse-worker.js +11 -4
- package/lib/dist/extraction/parse-worker.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.js +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +20 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +60 -1
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +905 -20
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/vba/call-sweep.d.ts +3 -0
- package/lib/dist/extraction/vba/call-sweep.d.ts.map +1 -0
- package/lib/dist/extraction/vba/call-sweep.js +206 -0
- package/lib/dist/extraction/vba/call-sweep.js.map +1 -0
- package/lib/dist/extraction/vba/calls.d.ts +55 -0
- package/lib/dist/extraction/vba/calls.d.ts.map +1 -0
- package/lib/dist/extraction/vba/calls.js +439 -0
- package/lib/dist/extraction/vba/calls.js.map +1 -0
- package/lib/dist/extraction/vba/constants.d.ts +42 -0
- package/lib/dist/extraction/vba/constants.d.ts.map +1 -0
- package/lib/dist/extraction/vba/constants.js +112 -0
- package/lib/dist/extraction/vba/constants.js.map +1 -0
- package/lib/dist/extraction/vba/context.d.ts +175 -0
- package/lib/dist/extraction/vba/context.d.ts.map +1 -0
- package/lib/dist/extraction/vba/context.js +268 -0
- package/lib/dist/extraction/vba/context.js.map +1 -0
- package/lib/dist/extraction/vba/controls.d.ts +24 -0
- package/lib/dist/extraction/vba/controls.d.ts.map +1 -0
- package/lib/dist/extraction/vba/controls.js +89 -0
- package/lib/dist/extraction/vba/controls.js.map +1 -0
- package/lib/dist/extraction/vba/declarations.d.ts +3 -0
- package/lib/dist/extraction/vba/declarations.d.ts.map +1 -0
- package/lib/dist/extraction/vba/declarations.js +154 -0
- package/lib/dist/extraction/vba/declarations.js.map +1 -0
- package/lib/dist/extraction/vba/dims.d.ts +3 -0
- package/lib/dist/extraction/vba/dims.d.ts.map +1 -0
- package/lib/dist/extraction/vba/dims.js +186 -0
- package/lib/dist/extraction/vba/dims.js.map +1 -0
- package/lib/dist/extraction/vba/docmd.d.ts +16 -0
- package/lib/dist/extraction/vba/docmd.d.ts.map +1 -0
- package/lib/dist/extraction/vba/docmd.js +179 -0
- package/lib/dist/extraction/vba/docmd.js.map +1 -0
- package/lib/dist/extraction/vba/enums-consts.d.ts +15 -0
- package/lib/dist/extraction/vba/enums-consts.d.ts.map +1 -0
- package/lib/dist/extraction/vba/enums-consts.js +178 -0
- package/lib/dist/extraction/vba/enums-consts.js.map +1 -0
- package/lib/dist/extraction/vba/implements.d.ts +3 -0
- package/lib/dist/extraction/vba/implements.d.ts.map +1 -0
- package/lib/dist/extraction/vba/implements.js +52 -0
- package/lib/dist/extraction/vba/implements.js.map +1 -0
- package/lib/dist/extraction/vba/procedures.d.ts +3 -0
- package/lib/dist/extraction/vba/procedures.d.ts.map +1 -0
- package/lib/dist/extraction/vba/procedures.js +239 -0
- package/lib/dist/extraction/vba/procedures.js.map +1 -0
- package/lib/dist/extraction/vba/sql-wrapper.d.ts +17 -0
- package/lib/dist/extraction/vba/sql-wrapper.d.ts.map +1 -0
- package/lib/dist/extraction/vba/sql-wrapper.js +212 -0
- package/lib/dist/extraction/vba/sql-wrapper.js.map +1 -0
- package/lib/dist/extraction/vba/tempvars.d.ts +10 -0
- package/lib/dist/extraction/vba/tempvars.d.ts.map +1 -0
- package/lib/dist/extraction/vba/tempvars.js +138 -0
- package/lib/dist/extraction/vba/tempvars.js.map +1 -0
- package/lib/dist/extraction/vba/text-utils.d.ts +73 -0
- package/lib/dist/extraction/vba/text-utils.d.ts.map +1 -0
- package/lib/dist/extraction/vba/text-utils.js +195 -0
- package/lib/dist/extraction/vba/text-utils.js.map +1 -0
- package/lib/dist/extraction/vba-extractor.d.ts +3 -951
- package/lib/dist/extraction/vba-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vba-extractor.js +46 -2934
- package/lib/dist/extraction/vba-extractor.js.map +1 -1
- package/lib/dist/extraction/vba-preprocess.d.ts +1 -1
- package/lib/dist/extraction/vba-preprocess.d.ts.map +1 -1
- package/lib/dist/extraction/vba-preprocess.js +300 -88
- package/lib/dist/extraction/vba-preprocess.js.map +1 -1
- package/lib/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -1
- package/lib/dist/graph/traversal.js +76 -17
- package/lib/dist/graph/traversal.js.map +1 -1
- package/lib/dist/index.d.ts +81 -1
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +460 -10
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/index.d.ts +42 -0
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +97 -2
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +35 -3
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +101 -9
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.js +2 -1
- package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/lib/dist/mcp/early-ppid.d.ts +26 -0
- package/lib/dist/mcp/early-ppid.d.ts.map +1 -0
- package/lib/dist/mcp/early-ppid.js +29 -0
- package/lib/dist/mcp/early-ppid.js.map +1 -0
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +29 -4
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts +18 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.js +73 -13
- package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +30 -4
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/query-pool.d.ts +14 -0
- package/lib/dist/mcp/query-pool.d.ts.map +1 -1
- package/lib/dist/mcp/query-pool.js +18 -0
- package/lib/dist/mcp/query-pool.js.map +1 -1
- package/lib/dist/mcp/session.d.ts +14 -0
- package/lib/dist/mcp/session.d.ts.map +1 -1
- package/lib/dist/mcp/session.js +28 -1
- package/lib/dist/mcp/session.js.map +1 -1
- package/lib/dist/mcp/startup-handshake.d.ts +44 -0
- package/lib/dist/mcp/startup-handshake.d.ts.map +1 -0
- package/lib/dist/mcp/startup-handshake.js +73 -0
- package/lib/dist/mcp/startup-handshake.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +22 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +289 -23
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/mcp/transport.d.ts.map +1 -1
- package/lib/dist/mcp/transport.js +18 -0
- package/lib/dist/mcp/transport.js.map +1 -1
- package/lib/dist/project-config.d.ts +44 -0
- package/lib/dist/project-config.d.ts.map +1 -1
- package/lib/dist/project-config.js +151 -2
- package/lib/dist/project-config.js.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.js +170 -146
- package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts +1 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +1109 -97
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/cooperative-yield.d.ts +32 -0
- package/lib/dist/resolution/cooperative-yield.d.ts.map +1 -0
- package/lib/dist/resolution/cooperative-yield.js +42 -0
- package/lib/dist/resolution/cooperative-yield.js.map +1 -0
- package/lib/dist/resolution/frameworks/cics.d.ts +20 -0
- package/lib/dist/resolution/frameworks/cics.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/cics.js +90 -0
- package/lib/dist/resolution/frameworks/cics.js.map +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +6 -0
- package/lib/dist/resolution/frameworks/index.js.map +1 -1
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/java.js +14 -6
- package/lib/dist/resolution/frameworks/java.js.map +1 -1
- package/lib/dist/resolution/frameworks/terraform.d.ts +38 -0
- package/lib/dist/resolution/frameworks/terraform.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/terraform.js +277 -0
- package/lib/dist/resolution/frameworks/terraform.js.map +1 -0
- package/lib/dist/resolution/goframe-synthesizer.d.ts +2 -1
- package/lib/dist/resolution/goframe-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/goframe-synthesizer.js +8 -3
- package/lib/dist/resolution/goframe-synthesizer.js.map +1 -1
- package/lib/dist/resolution/import-resolver.d.ts +7 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +129 -4
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +64 -2
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +476 -58
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/name-matcher.d.ts +22 -3
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +613 -39
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/strip-comments.d.ts +1 -1
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
- package/lib/dist/resolution/strip-comments.js +49 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -1
- package/lib/dist/resolution/types.d.ts +29 -0
- package/lib/dist/resolution/types.d.ts.map +1 -1
- package/lib/dist/resolution/workspace-packages.d.ts +10 -0
- package/lib/dist/resolution/workspace-packages.d.ts.map +1 -1
- package/lib/dist/resolution/workspace-packages.js +142 -4
- package/lib/dist/resolution/workspace-packages.js.map +1 -1
- package/lib/dist/search/identifier-segments.d.ts +60 -0
- package/lib/dist/search/identifier-segments.d.ts.map +1 -0
- package/lib/dist/search/identifier-segments.js +176 -0
- package/lib/dist/search/identifier-segments.js.map +1 -0
- package/lib/dist/sync/git-hooks.d.ts.map +1 -1
- package/lib/dist/sync/git-hooks.js +2 -0
- package/lib/dist/sync/git-hooks.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +10 -5
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +51 -14
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/sync/worktree.d.ts +9 -0
- package/lib/dist/sync/worktree.d.ts.map +1 -1
- package/lib/dist/sync/worktree.js +45 -0
- package/lib/dist/sync/worktree.js.map +1 -1
- package/lib/dist/types.d.ts +25 -2
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +10 -0
- package/lib/dist/types.js.map +1 -1
- package/lib/dist/upgrade/index.d.ts +32 -0
- package/lib/dist/upgrade/index.d.ts.map +1 -1
- package/lib/dist/upgrade/index.js +163 -14
- package/lib/dist/upgrade/index.js.map +1 -1
- package/lib/dist/upgrade/remove-binary.d.ts +87 -0
- package/lib/dist/upgrade/remove-binary.d.ts.map +1 -0
- package/lib/dist/upgrade/remove-binary.js +289 -0
- package/lib/dist/upgrade/remove-binary.js.map +1 -0
- package/lib/dist/upgrade/update-check.d.ts +92 -0
- package/lib/dist/upgrade/update-check.d.ts.map +1 -0
- package/lib/dist/upgrade/update-check.js +258 -0
- package/lib/dist/upgrade/update-check.js.map +1 -0
- package/lib/node_modules/.modules.yaml +1 -1
- package/lib/node_modules/.pnpm-workspace-state-v1.json +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/lib/dist/reasoning/config.d.ts +0 -45
- package/lib/dist/reasoning/config.d.ts.map +0 -1
- package/lib/dist/reasoning/config.js +0 -171
- package/lib/dist/reasoning/config.js.map +0 -1
- package/lib/dist/reasoning/credentials.d.ts +0 -5
- package/lib/dist/reasoning/credentials.d.ts.map +0 -1
- package/lib/dist/reasoning/credentials.js +0 -83
- package/lib/dist/reasoning/credentials.js.map +0 -1
- package/lib/dist/reasoning/login.d.ts +0 -21
- package/lib/dist/reasoning/login.d.ts.map +0 -1
- package/lib/dist/reasoning/login.js +0 -85
- package/lib/dist/reasoning/login.js.map +0 -1
- package/lib/dist/reasoning/reasoner.d.ts +0 -43
- package/lib/dist/reasoning/reasoner.d.ts.map +0 -1
- package/lib/dist/reasoning/reasoner.js +0 -308
- package/lib/dist/reasoning/reasoner.js.map +0 -1
package/lib/dist/db/schema.sql
CHANGED
|
@@ -68,7 +68,15 @@ CREATE TABLE IF NOT EXISTS files (
|
|
|
68
68
|
errors TEXT -- JSON array
|
|
69
69
|
);
|
|
70
70
|
|
|
71
|
-
-- Unresolved References: References that need resolution after full indexing
|
|
71
|
+
-- Unresolved References: References that need resolution after full indexing.
|
|
72
|
+
-- status lifecycle: rows are inserted 'pending' by extraction; a completed
|
|
73
|
+
-- resolution pass either deletes a row (resolved) or marks it 'failed'
|
|
74
|
+
-- (attempted, no match — kept so a later sync can retry it when a changed
|
|
75
|
+
-- file introduces a symbol that could satisfy it, #1240). name_tail is the
|
|
76
|
+
-- last segment of reference_name ('util.greet' → 'greet'), written when a
|
|
77
|
+
-- row is marked failed, so the retry lookup matches new node names against
|
|
78
|
+
-- dotted refs too. Rows follow their from_node via ON DELETE CASCADE, so
|
|
79
|
+
-- re-extracting or deleting a file clears its stale rows in any status.
|
|
72
80
|
CREATE TABLE IF NOT EXISTS unresolved_refs (
|
|
73
81
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
74
82
|
from_node_id TEXT NOT NULL,
|
|
@@ -79,6 +87,8 @@ CREATE TABLE IF NOT EXISTS unresolved_refs (
|
|
|
79
87
|
candidates TEXT, -- JSON array
|
|
80
88
|
file_path TEXT NOT NULL DEFAULT '',
|
|
81
89
|
language TEXT NOT NULL DEFAULT 'unknown',
|
|
90
|
+
status TEXT NOT NULL DEFAULT 'pending',
|
|
91
|
+
name_tail TEXT NOT NULL DEFAULT '',
|
|
82
92
|
FOREIGN KEY (from_node_id) REFERENCES nodes(id) ON DELETE CASCADE
|
|
83
93
|
);
|
|
84
94
|
|
|
@@ -124,6 +134,25 @@ CREATE TRIGGER IF NOT EXISTS nodes_au AFTER UPDATE ON nodes BEGIN
|
|
|
124
134
|
VALUES (NEW.rowid, NEW.id, NEW.name, NEW.qualified_name, NEW.docstring, NEW.signature);
|
|
125
135
|
END;
|
|
126
136
|
|
|
137
|
+
-- Prose-word → symbol-name lookup for the prompt hook's graph-derived gate.
|
|
138
|
+
-- One row per (segment, name): segment is a lowercased word of a symbol name
|
|
139
|
+
-- ("OrderStateMachine" → order, state, machine — see identifier-segments.ts),
|
|
140
|
+
-- which lets natural-language prompt words be verified against the graph in
|
|
141
|
+
-- any language whose technical nouns are Latin script. File nodes are
|
|
142
|
+
-- excluded — a file's basename duplicates the symbols inside it and skews the
|
|
143
|
+
-- singleton-vs-cluster rarity statistics. FTS can't serve this lookup (its
|
|
144
|
+
-- tokenizer keeps camelCase names as single tokens), so segments are
|
|
145
|
+
-- materialized on the node write path.
|
|
146
|
+
-- Deletions leave orphan rows ON PURPOSE: rows are PROPOSALS, always
|
|
147
|
+
-- re-verified against nodes before being surfaced (CodeGraph.getSegmentMatches),
|
|
148
|
+
-- and a full index clears the table at its start. Populated lazily on old
|
|
149
|
+
-- databases (empty until the next index/sync heals it).
|
|
150
|
+
CREATE TABLE IF NOT EXISTS name_segment_vocab (
|
|
151
|
+
segment TEXT NOT NULL,
|
|
152
|
+
name TEXT NOT NULL,
|
|
153
|
+
PRIMARY KEY (segment, name)
|
|
154
|
+
) WITHOUT ROWID;
|
|
155
|
+
|
|
127
156
|
-- Edge indexes.
|
|
128
157
|
-- idx_edges_source / idx_edges_target are intentionally omitted —
|
|
129
158
|
-- the (source, kind) and (target, kind) composites below cover the
|
|
@@ -134,6 +163,17 @@ CREATE INDEX IF NOT EXISTS idx_edges_kind ON edges(kind);
|
|
|
134
163
|
CREATE INDEX IF NOT EXISTS idx_edges_source_kind ON edges(source, kind);
|
|
135
164
|
CREATE INDEX IF NOT EXISTS idx_edges_target_kind ON edges(target, kind);
|
|
136
165
|
|
|
166
|
+
-- Edge identity uniqueness. An edge IS uniquely (source, target, kind, line,
|
|
167
|
+
-- col); insertEdge uses `INSERT OR IGNORE`, but without something UNIQUE to
|
|
168
|
+
-- conflict on it behaved like a plain INSERT, so two passes emitting the same
|
|
169
|
+
-- edge produced byte-identical duplicate rows that inflated counts and flowed
|
|
170
|
+
-- into callers/impact (#1034). IFNULL folds the nullable line/col so
|
|
171
|
+
-- coordinate-less edges (synthesized / file-level) dedup too — SQLite treats
|
|
172
|
+
-- each NULL as distinct otherwise. Migration v6 dedups existing rows + adds
|
|
173
|
+
-- this on older databases.
|
|
174
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_edges_identity
|
|
175
|
+
ON edges(source, target, kind, IFNULL(line, -1), IFNULL(col, -1));
|
|
176
|
+
|
|
137
177
|
-- File indexes
|
|
138
178
|
CREATE INDEX IF NOT EXISTS idx_files_language ON files(language);
|
|
139
179
|
CREATE INDEX IF NOT EXISTS idx_files_modified_at ON files(modified_at);
|
|
@@ -143,6 +183,8 @@ CREATE INDEX IF NOT EXISTS idx_unresolved_from_node ON unresolved_refs(from_node
|
|
|
143
183
|
CREATE INDEX IF NOT EXISTS idx_unresolved_name ON unresolved_refs(reference_name);
|
|
144
184
|
CREATE INDEX IF NOT EXISTS idx_unresolved_file_path ON unresolved_refs(file_path);
|
|
145
185
|
CREATE INDEX IF NOT EXISTS idx_unresolved_from_name ON unresolved_refs(from_node_id, reference_name);
|
|
186
|
+
CREATE INDEX IF NOT EXISTS idx_unresolved_status ON unresolved_refs(status);
|
|
187
|
+
CREATE INDEX IF NOT EXISTS idx_unresolved_failed_tail ON unresolved_refs(name_tail) WHERE status = 'failed';
|
|
146
188
|
CREATE INDEX IF NOT EXISTS idx_edges_provenance ON edges(provenance);
|
|
147
189
|
|
|
148
190
|
-- Project metadata for version/provenance tracking
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAL checkpoint valve — bounds WAL growth while auto-checkpointing is
|
|
3
|
+
* deferred during a bulk index (#1231).
|
|
4
|
+
*
|
|
5
|
+
* Why deferral: SQLite's default `wal_autocheckpoint` (1000 pages) re-writes
|
|
6
|
+
* hot B-tree/FTS pages into the main DB file over and over during a bulk
|
|
7
|
+
* index — measured at ~95% of ALL disk I/O, and the difference between 45s
|
|
8
|
+
* and 19+ minutes on HDD-class storage (150 random IOPS). Deferring
|
|
9
|
+
* checkpoints turns the store into pure sequential WAL appends; each backfill
|
|
10
|
+
* pass writes distinct pages once, in page order (≈ sequential).
|
|
11
|
+
*
|
|
12
|
+
* Why a valve: unbounded deferral is its own failure mode, both measured in
|
|
13
|
+
* the #1231 repro. The WAL duplicates hot pages per COMMIT, so it grows far
|
|
14
|
+
* faster than the DB (5.9GB WAL for a ~340MB DB on a 3.3k-file index) —
|
|
15
|
+
* filling the disk, and poisoning every subsequent read that must page
|
|
16
|
+
* through it (the first resolution-phase read blocked the main thread >60s
|
|
17
|
+
* and the #850 liveness watchdog killed the healthy index). The valve
|
|
18
|
+
* watches WAL growth on a timer and, past a soft threshold, backfills with
|
|
19
|
+
* `PRAGMA wal_checkpoint(PASSIVE)` on a worker-thread connection — PASSIVE
|
|
20
|
+
* never blocks the writer, and off-thread means the main thread (and the
|
|
21
|
+
* watchdog heartbeat) keep turning regardless of how long a backfill takes.
|
|
22
|
+
*
|
|
23
|
+
* The load-bearing subtlety: a WAL file's SIZE never shrinks. After a full
|
|
24
|
+
* backfill, the writer's next commit RESTARTS the WAL from the top and the
|
|
25
|
+
* frames recycle inside the same file — so raw size says nothing about the
|
|
26
|
+
* un-backfilled backlog, and a size-triggered valve degenerates into firing
|
|
27
|
+
* (and pausing the writer) forever once the file passes its threshold
|
|
28
|
+
* (measured: guava crawled at ~9min per 160 files). Instead the valve
|
|
29
|
+
* tracks `sizeAtLastFullBackfill` — refreshed whenever a checkpoint reports
|
|
30
|
+
* `log === checkpointed` (everything backfilled) — and triggers on GROWTH
|
|
31
|
+
* beyond that baseline, which only happens when genuinely un-backfilled
|
|
32
|
+
* frames push past the file's high-water mark.
|
|
33
|
+
*
|
|
34
|
+
* Backpressure: if the writer outruns the checkpointer past a hard cap of
|
|
35
|
+
* growth (2× soft), {@link backpressure} pauses the writer (at a safe,
|
|
36
|
+
* between-transactions boundary) until a FULL backfill lands. One in-flight
|
|
37
|
+
* pass is not enough: on a disk saturated by the writer, every concurrent
|
|
38
|
+
* PASSIVE pass is already stale by the time it finishes (the writer appended
|
|
39
|
+
* past its snapshot), so neither SQLite's WAL wrap nor the baseline ever
|
|
40
|
+
* trigger and the WAL grows without bound (measured: 5.9GB on guava at 150
|
|
41
|
+
* IOPS, then a >60s read stall and a watchdog kill). With the writer parked,
|
|
42
|
+
* the next pass covers everything, the WAL wraps on the following commit,
|
|
43
|
+
* and the pause is the disk's honest catch-up cost — the correct terminal
|
|
44
|
+
* mode when hardware genuinely can't keep up with the append rate.
|
|
45
|
+
*/
|
|
46
|
+
import type { DatabaseConnection } from './index';
|
|
47
|
+
/**
|
|
48
|
+
* Resolve the valve's soft threshold from the `CODEGRAPH_WAL_VALVE_MB`
|
|
49
|
+
* override; non-numeric / non-positive values fall back to the default.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveWalValveMb(envVal: string | undefined): number;
|
|
52
|
+
export declare class WalCheckpointValve {
|
|
53
|
+
private readonly db;
|
|
54
|
+
private readonly intervalMs;
|
|
55
|
+
private readonly log;
|
|
56
|
+
private timer;
|
|
57
|
+
private inflight;
|
|
58
|
+
/** Writer pause in progress (hard cap breached): passes loop until a full backfill. */
|
|
59
|
+
private pause;
|
|
60
|
+
/**
|
|
61
|
+
* WAL file size observed when a checkpoint last reported the ENTIRE WAL
|
|
62
|
+
* backfilled. Growth is measured against this baseline — see the header
|
|
63
|
+
* comment for why absolute size cannot be used.
|
|
64
|
+
*/
|
|
65
|
+
private sizeAtLastFullBackfill;
|
|
66
|
+
private readonly softBytes;
|
|
67
|
+
private readonly hardBytes;
|
|
68
|
+
constructor(db: DatabaseConnection, softMb?: number, intervalMs?: number, log?: (msg: string) => void);
|
|
69
|
+
private mb;
|
|
70
|
+
/** Un-backfilled growth estimate: bytes the WAL has grown past the last full backfill. */
|
|
71
|
+
private growthBytes;
|
|
72
|
+
/** Begin watching the WAL. Idempotent; the timer never holds the loop open. */
|
|
73
|
+
start(): void;
|
|
74
|
+
/** Stop watching. Any in-flight checkpoint keeps running — await drain(). */
|
|
75
|
+
stop(): void;
|
|
76
|
+
/** One poll: fire an off-thread passive checkpoint when growth passes the soft threshold. */
|
|
77
|
+
check(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Writer-side backstop, called at a between-transactions boundary. Returns
|
|
80
|
+
* null (no wait) while growth is under the hard cap; past it, returns a
|
|
81
|
+
* promise that resolves only once a FULL backfill has landed — see the
|
|
82
|
+
* header comment for why a single pass is not enough on a saturated disk.
|
|
83
|
+
*/
|
|
84
|
+
backpressure(): Promise<void> | null;
|
|
85
|
+
/** Await any in-flight checkpoint and writer pause. */
|
|
86
|
+
drain(): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Phase-boundary fold: backfill the ENTIRE WAL now (off-thread, awaited).
|
|
89
|
+
* Called between bulk phases — e.g. after parsing, before resolution's
|
|
90
|
+
* first reads — so the next phase never pages a bulk-write-sized WAL on
|
|
91
|
+
* the main thread (the post-parse read against a multi-GB WAL is what
|
|
92
|
+
* blew the #850 watchdog's 60s window in the #1231 repro). The await
|
|
93
|
+
* keeps the event loop (and the watchdog heartbeat) turning.
|
|
94
|
+
*/
|
|
95
|
+
foldNow(): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* With the writer parked on the returned promise, loop passive passes until
|
|
98
|
+
* one reports the entire WAL backfilled (typically the second: the first
|
|
99
|
+
* drains the pass that was already running against a stale snapshot). Gives
|
|
100
|
+
* up after a bounded number of passes — e.g. a reader pinning the WAL —
|
|
101
|
+
* because unbounded WAL growth degrades; a wedged writer never recovers.
|
|
102
|
+
*/
|
|
103
|
+
private backfillFully;
|
|
104
|
+
private fire;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=wal-valve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wal-valve.d.ts","sourceRoot":"","sources":["../../src/db/wal-valve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAWlD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAMpE;AAED,qBAAa,kBAAkB;IAe3B,OAAO,CAAC,QAAQ,CAAC,EAAE;IAEnB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG;IAjBtB,OAAO,CAAC,KAAK,CAA+C;IAC5D,OAAO,CAAC,QAAQ,CAA8B;IAC9C,uFAAuF;IACvF,OAAO,CAAC,KAAK,CAA8B;IAC3C;;;;OAIG;IACH,OAAO,CAAC,sBAAsB,CAAK;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAGhB,EAAE,EAAE,kBAAkB,EACvC,MAAM,GAAE,MAA8D,EACrD,UAAU,GAAE,MAA0B,EACtC,GAAG,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAe;IAMxD,OAAO,CAAC,EAAE;IAIV,0FAA0F;IAC1F,OAAO,CAAC,WAAW;IAInB,+EAA+E;IAC/E,KAAK,IAAI,IAAI;IAMb,6EAA6E;IAC7E,IAAI,IAAI,IAAI;IAOZ,6FAA6F;IAC7F,KAAK,IAAI,IAAI;IAIb;;;;;OAKG;IACH,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAYpC,uDAAuD;IACjD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B;;;;;;;OAOG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ9B;;;;;;OAMG;YACW,aAAa;IAc3B,OAAO,CAAC,IAAI;CAoBb"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* WAL checkpoint valve — bounds WAL growth while auto-checkpointing is
|
|
4
|
+
* deferred during a bulk index (#1231).
|
|
5
|
+
*
|
|
6
|
+
* Why deferral: SQLite's default `wal_autocheckpoint` (1000 pages) re-writes
|
|
7
|
+
* hot B-tree/FTS pages into the main DB file over and over during a bulk
|
|
8
|
+
* index — measured at ~95% of ALL disk I/O, and the difference between 45s
|
|
9
|
+
* and 19+ minutes on HDD-class storage (150 random IOPS). Deferring
|
|
10
|
+
* checkpoints turns the store into pure sequential WAL appends; each backfill
|
|
11
|
+
* pass writes distinct pages once, in page order (≈ sequential).
|
|
12
|
+
*
|
|
13
|
+
* Why a valve: unbounded deferral is its own failure mode, both measured in
|
|
14
|
+
* the #1231 repro. The WAL duplicates hot pages per COMMIT, so it grows far
|
|
15
|
+
* faster than the DB (5.9GB WAL for a ~340MB DB on a 3.3k-file index) —
|
|
16
|
+
* filling the disk, and poisoning every subsequent read that must page
|
|
17
|
+
* through it (the first resolution-phase read blocked the main thread >60s
|
|
18
|
+
* and the #850 liveness watchdog killed the healthy index). The valve
|
|
19
|
+
* watches WAL growth on a timer and, past a soft threshold, backfills with
|
|
20
|
+
* `PRAGMA wal_checkpoint(PASSIVE)` on a worker-thread connection — PASSIVE
|
|
21
|
+
* never blocks the writer, and off-thread means the main thread (and the
|
|
22
|
+
* watchdog heartbeat) keep turning regardless of how long a backfill takes.
|
|
23
|
+
*
|
|
24
|
+
* The load-bearing subtlety: a WAL file's SIZE never shrinks. After a full
|
|
25
|
+
* backfill, the writer's next commit RESTARTS the WAL from the top and the
|
|
26
|
+
* frames recycle inside the same file — so raw size says nothing about the
|
|
27
|
+
* un-backfilled backlog, and a size-triggered valve degenerates into firing
|
|
28
|
+
* (and pausing the writer) forever once the file passes its threshold
|
|
29
|
+
* (measured: guava crawled at ~9min per 160 files). Instead the valve
|
|
30
|
+
* tracks `sizeAtLastFullBackfill` — refreshed whenever a checkpoint reports
|
|
31
|
+
* `log === checkpointed` (everything backfilled) — and triggers on GROWTH
|
|
32
|
+
* beyond that baseline, which only happens when genuinely un-backfilled
|
|
33
|
+
* frames push past the file's high-water mark.
|
|
34
|
+
*
|
|
35
|
+
* Backpressure: if the writer outruns the checkpointer past a hard cap of
|
|
36
|
+
* growth (2× soft), {@link backpressure} pauses the writer (at a safe,
|
|
37
|
+
* between-transactions boundary) until a FULL backfill lands. One in-flight
|
|
38
|
+
* pass is not enough: on a disk saturated by the writer, every concurrent
|
|
39
|
+
* PASSIVE pass is already stale by the time it finishes (the writer appended
|
|
40
|
+
* past its snapshot), so neither SQLite's WAL wrap nor the baseline ever
|
|
41
|
+
* trigger and the WAL grows without bound (measured: 5.9GB on guava at 150
|
|
42
|
+
* IOPS, then a >60s read stall and a watchdog kill). With the writer parked,
|
|
43
|
+
* the next pass covers everything, the WAL wraps on the following commit,
|
|
44
|
+
* and the pause is the disk's honest catch-up cost — the correct terminal
|
|
45
|
+
* mode when hardware genuinely can't keep up with the append rate.
|
|
46
|
+
*/
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.WalCheckpointValve = void 0;
|
|
49
|
+
exports.resolveWalValveMb = resolveWalValveMb;
|
|
50
|
+
/** Soft WAL-growth threshold (MB) that triggers an off-thread passive checkpoint. */
|
|
51
|
+
const DEFAULT_WAL_VALVE_MB = 256;
|
|
52
|
+
/** Hard cap = this × soft threshold; past it the writer pauses for a full backfill. */
|
|
53
|
+
const HARD_CAP_MULTIPLIER = 2;
|
|
54
|
+
/** Passes attempted per writer pause before giving up (a pinned reader could stall forever). */
|
|
55
|
+
const MAX_PAUSED_BACKFILL_PASSES = 20;
|
|
56
|
+
/** How often the timer looks at the WAL file size. */
|
|
57
|
+
const CHECK_INTERVAL_MS = 2000;
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the valve's soft threshold from the `CODEGRAPH_WAL_VALVE_MB`
|
|
60
|
+
* override; non-numeric / non-positive values fall back to the default.
|
|
61
|
+
*/
|
|
62
|
+
function resolveWalValveMb(envVal) {
|
|
63
|
+
if (envVal !== undefined && envVal !== '') {
|
|
64
|
+
const n = Number(envVal);
|
|
65
|
+
if (Number.isFinite(n) && n > 0)
|
|
66
|
+
return Math.floor(n);
|
|
67
|
+
}
|
|
68
|
+
return DEFAULT_WAL_VALVE_MB;
|
|
69
|
+
}
|
|
70
|
+
class WalCheckpointValve {
|
|
71
|
+
db;
|
|
72
|
+
intervalMs;
|
|
73
|
+
log;
|
|
74
|
+
timer = null;
|
|
75
|
+
inflight = null;
|
|
76
|
+
/** Writer pause in progress (hard cap breached): passes loop until a full backfill. */
|
|
77
|
+
pause = null;
|
|
78
|
+
/**
|
|
79
|
+
* WAL file size observed when a checkpoint last reported the ENTIRE WAL
|
|
80
|
+
* backfilled. Growth is measured against this baseline — see the header
|
|
81
|
+
* comment for why absolute size cannot be used.
|
|
82
|
+
*/
|
|
83
|
+
sizeAtLastFullBackfill = 0;
|
|
84
|
+
softBytes;
|
|
85
|
+
hardBytes;
|
|
86
|
+
constructor(db, softMb = resolveWalValveMb(process.env.CODEGRAPH_WAL_VALVE_MB), intervalMs = CHECK_INTERVAL_MS, log = () => { }) {
|
|
87
|
+
this.db = db;
|
|
88
|
+
this.intervalMs = intervalMs;
|
|
89
|
+
this.log = log;
|
|
90
|
+
this.softBytes = softMb * 1024 * 1024;
|
|
91
|
+
this.hardBytes = this.softBytes * HARD_CAP_MULTIPLIER;
|
|
92
|
+
}
|
|
93
|
+
mb(n) {
|
|
94
|
+
return `${Math.round(n / 1024 / 1024)}MB`;
|
|
95
|
+
}
|
|
96
|
+
/** Un-backfilled growth estimate: bytes the WAL has grown past the last full backfill. */
|
|
97
|
+
growthBytes() {
|
|
98
|
+
return this.db.getWalSizeBytes() - this.sizeAtLastFullBackfill;
|
|
99
|
+
}
|
|
100
|
+
/** Begin watching the WAL. Idempotent; the timer never holds the loop open. */
|
|
101
|
+
start() {
|
|
102
|
+
if (this.timer)
|
|
103
|
+
return;
|
|
104
|
+
this.timer = setInterval(() => this.check(), this.intervalMs);
|
|
105
|
+
this.timer.unref?.();
|
|
106
|
+
}
|
|
107
|
+
/** Stop watching. Any in-flight checkpoint keeps running — await drain(). */
|
|
108
|
+
stop() {
|
|
109
|
+
if (this.timer) {
|
|
110
|
+
clearInterval(this.timer);
|
|
111
|
+
this.timer = null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/** One poll: fire an off-thread passive checkpoint when growth passes the soft threshold. */
|
|
115
|
+
check() {
|
|
116
|
+
if (!this.pause && !this.inflight && this.growthBytes() > this.softBytes)
|
|
117
|
+
this.fire();
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Writer-side backstop, called at a between-transactions boundary. Returns
|
|
121
|
+
* null (no wait) while growth is under the hard cap; past it, returns a
|
|
122
|
+
* promise that resolves only once a FULL backfill has landed — see the
|
|
123
|
+
* header comment for why a single pass is not enough on a saturated disk.
|
|
124
|
+
*/
|
|
125
|
+
backpressure() {
|
|
126
|
+
if (this.pause)
|
|
127
|
+
return this.pause;
|
|
128
|
+
if (this.growthBytes() <= this.hardBytes)
|
|
129
|
+
return null;
|
|
130
|
+
this.log(`backpressure: wal=${this.mb(this.db.getWalSizeBytes())} baseline=${this.mb(this.sizeAtLastFullBackfill)} — pausing writer for full backfill`);
|
|
131
|
+
const t0 = Date.now();
|
|
132
|
+
this.pause = this.backfillFully().finally(() => {
|
|
133
|
+
this.pause = null;
|
|
134
|
+
this.log(`backpressure released after ${Date.now() - t0}ms: wal=${this.mb(this.db.getWalSizeBytes())} baseline=${this.mb(this.sizeAtLastFullBackfill)}`);
|
|
135
|
+
});
|
|
136
|
+
return this.pause;
|
|
137
|
+
}
|
|
138
|
+
/** Await any in-flight checkpoint and writer pause. */
|
|
139
|
+
async drain() {
|
|
140
|
+
while (this.pause || this.inflight) {
|
|
141
|
+
if (this.pause)
|
|
142
|
+
await this.pause;
|
|
143
|
+
if (this.inflight)
|
|
144
|
+
await this.inflight;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Phase-boundary fold: backfill the ENTIRE WAL now (off-thread, awaited).
|
|
149
|
+
* Called between bulk phases — e.g. after parsing, before resolution's
|
|
150
|
+
* first reads — so the next phase never pages a bulk-write-sized WAL on
|
|
151
|
+
* the main thread (the post-parse read against a multi-GB WAL is what
|
|
152
|
+
* blew the #850 watchdog's 60s window in the #1231 repro). The await
|
|
153
|
+
* keeps the event loop (and the watchdog heartbeat) turning.
|
|
154
|
+
*/
|
|
155
|
+
async foldNow() {
|
|
156
|
+
await this.drain();
|
|
157
|
+
if (this.growthBytes() <= 0)
|
|
158
|
+
return;
|
|
159
|
+
this.log(`foldNow: wal=${this.mb(this.db.getWalSizeBytes())} baseline=${this.mb(this.sizeAtLastFullBackfill)}`);
|
|
160
|
+
this.pause = this.backfillFully().finally(() => { this.pause = null; });
|
|
161
|
+
await this.pause;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* With the writer parked on the returned promise, loop passive passes until
|
|
165
|
+
* one reports the entire WAL backfilled (typically the second: the first
|
|
166
|
+
* drains the pass that was already running against a stale snapshot). Gives
|
|
167
|
+
* up after a bounded number of passes — e.g. a reader pinning the WAL —
|
|
168
|
+
* because unbounded WAL growth degrades; a wedged writer never recovers.
|
|
169
|
+
*/
|
|
170
|
+
async backfillFully() {
|
|
171
|
+
for (let i = 0; i < MAX_PAUSED_BACKFILL_PASSES; i++) {
|
|
172
|
+
if (this.inflight)
|
|
173
|
+
await this.inflight; // fold in the stale in-flight pass first
|
|
174
|
+
const res = await this.db.checkpointWalPassive();
|
|
175
|
+
if (!res)
|
|
176
|
+
return; // checkpoint machinery unavailable — don't spin
|
|
177
|
+
this.log(`backfill pass ${i + 1}: busy=${res.busy} log=${res.log} checkpointed=${res.checkpointed} wal=${this.mb(this.db.getWalSizeBytes())}`);
|
|
178
|
+
if (res.busy === 0 && res.log === res.checkpointed) {
|
|
179
|
+
this.sizeAtLastFullBackfill = this.db.getWalSizeBytes();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
this.log(`backfill gave up after ${MAX_PAUSED_BACKFILL_PASSES} passes — WAL stays unbounded this cycle`);
|
|
184
|
+
}
|
|
185
|
+
fire() {
|
|
186
|
+
const p = this.db
|
|
187
|
+
.checkpointWalPassive()
|
|
188
|
+
.then((res) => {
|
|
189
|
+
// Full backfill (busy 0, every log frame checkpointed) ⇒ the writer's
|
|
190
|
+
// next commit wraps the WAL; the file's current size becomes the new
|
|
191
|
+
// growth baseline. A partial pass (writer appended during it, or a
|
|
192
|
+
// read transaction pinned frames) leaves the baseline alone, so the
|
|
193
|
+
// next tick fires again and copies the remainder. In non-WAL mode
|
|
194
|
+
// SQLite reports log = checkpointed = -1, which is harmless here.
|
|
195
|
+
if (res && res.busy === 0 && res.log === res.checkpointed) {
|
|
196
|
+
this.sizeAtLastFullBackfill = this.db.getWalSizeBytes();
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
.catch(() => { })
|
|
200
|
+
.finally(() => {
|
|
201
|
+
if (this.inflight === p)
|
|
202
|
+
this.inflight = null;
|
|
203
|
+
});
|
|
204
|
+
this.inflight = p;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.WalCheckpointValve = WalCheckpointValve;
|
|
208
|
+
//# sourceMappingURL=wal-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,kEAAkE;YAClE,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,YAAY,EAAE,CAAC;gBAC1D,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC;YAC1D,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE,GAAqB,CAAC,CAAC;aAClC,OAAO,CAAC,GAAG,EAAE;YACZ,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC;gBAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAChD,CAAC,CAAC,CAAC;QACL,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,CAAC;CACF;AAxID,gDAwIC"}
|
package/lib/dist/directory.d.ts
CHANGED
|
@@ -86,10 +86,14 @@ export declare function findIndexedSubprojectRoots(root: string, opts?: {
|
|
|
86
86
|
max?: number;
|
|
87
87
|
}): string[];
|
|
88
88
|
/**
|
|
89
|
-
* Does `prompt` contain an explicit structural keyword
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
89
|
+
* Does `prompt` contain an explicit structural keyword? A keyword is a strong,
|
|
90
|
+
* self-contained signal, so the front-load hook fires on it directly — no graph
|
|
91
|
+
* check needed. (A *code-token* match, by contrast, is only a candidate the
|
|
92
|
+
* hook verifies against the graph first; see {@link extractCodeTokens}.)
|
|
93
|
+
* Coverage is multilingual (#994, #1126): the ~29 languages with the largest
|
|
94
|
+
* developer populations, across Latin, Cyrillic, Greek, CJK, Hangul, Arabic,
|
|
95
|
+
* Hebrew, Thai, and Devanagari scripts. Languages beyond the keyword table
|
|
96
|
+
* still fire through the language-agnostic code-token path.
|
|
93
97
|
*/
|
|
94
98
|
export declare function hasStructuralKeyword(prompt: string): boolean;
|
|
95
99
|
/**
|
|
@@ -110,7 +114,7 @@ export declare function extractCodeTokens(prompt: string): string[];
|
|
|
110
114
|
/**
|
|
111
115
|
* Cheap, graph-free candidate gate for the front-load hook: could `prompt` be a
|
|
112
116
|
* structural / flow / impact / "where-how" question worth front-loading context
|
|
113
|
-
* for? True on an explicit keyword
|
|
117
|
+
* for? True on an explicit keyword in any covered language (#994, #1126) OR an
|
|
114
118
|
* identifier-shaped token. A keyword is sufficient to fire on its own; a
|
|
115
119
|
* token-only match is only a candidate the hook then verifies against the graph
|
|
116
120
|
* (a brand name like `JavaScript` is token-shaped but isn't a symbol). Every
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAqBzC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,QAAqB,CAAC;AAEhD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQxD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAQ1D;AAED;;;;;;;;GAQG;AACH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8BxE;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmBzE;AA2BD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,MAAM,EAAE,CAmBV;
|
|
1
|
+
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"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