gdharness 0.13.24 → 0.13.25

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/build/cli.js CHANGED
@@ -7619,6 +7619,11 @@ function contradictedDiagnostics(messages, classes, sourceOf) {
7619
7619
  }
7620
7620
  return found;
7621
7621
  }
7622
+ function staleAnalysisNote(contradicted, dependsOn) {
7623
+ const declaring = [...new Set(contradicted.map((one) => one.declaredIn))].sort();
7624
+ const lever = dependsOn.length === 0 ? ", and the named types depend on no other global class, so that lever is not available here. " + "That is the common case rather than the awkward one: an edit near a type that depends on " + "something refreshes it before the fault is noticed, which is why a type with no " + "dependencies is where this turns up" : `, so changing ${[...dependsOn].sort().join(", ")} and rescanning is worth a try`;
7625
+ return `The editor is reporting against an older copy of ${contradicted.length === 1 ? "a type" : "some types"} ` + "named under contradictedByTheFile. Each member listed is declared in the file the class cache " + "points at, so those diagnostics are wrong however the code is written. Run editor_rescan first: " + "it costs about half a second, it cleared this in one of five attempts in the project that " + "reported it, and it cleared both reproductions measured in a second project, the scan itself " + "returning in 243ms and 275ms. " + "The fault behind it is that a script the editor has loaded keeps the copy it built, and nothing " + `rebuilds that copy when the file changes; editor_rescan with reloadScript set to ${declaring.join(", ")} ` + `recompiles ${declaring.length === 1 ? "that copy" : "those copies"} from the file into the same ` + "object and answers with the members it has afterwards under reloadedMethods. Read that and the " + "next diagnostics as two readings rather than one: a built copy has been seen stale here while " + "the diagnostics on it read clean, so the reload is worth doing and is not known to be what " + "clears these. The other lever measured is that a held type is refreshed when something it " + `depends on changes rather than when it changes itself${lever}. editor_launch restart has always ` + "worked and costs a window. project_import refresh_classes does not, and answers added: [] while " + "this is happening.";
7626
+ }
7622
7627
  function cacheWrittenAt(projectPath) {
7623
7628
  const cache = join6(projectPath, ".godot", "global_script_class_cache.cfg");
7624
7629
  try {
@@ -15970,7 +15975,7 @@ var init_tool_definitions = __esm(() => {
15970
15975
  timeoutMs: { type: "number", description: "How long to wait for the scan. Default 30000." },
15971
15976
  reloadScript: {
15972
15977
  type: "string",
15973
- description: "A script to recompile in the editor after the scan, for the fault a scan cannot reach: a script the editor has loaded keeps the copy it built, and that copy is refreshed when one of its dependencies changes rather than when it changes itself, so a method added to a loaded class reads as missing at every caller. This recompiles into the same object, so the holders that kept the stale copy alive see the new one. The methods it has afterwards come back under reloadedMethods, because a reload that compiled nothing and answered OK is the failure worth catching."
15978
+ description: "A script to recompile in the editor after the scan, for the half a scan does not reach: a script the editor has loaded keeps the copy it built, that copy is refreshed when one of its dependencies changes rather than when it changes itself, and a scan leaves it alone. Measured here, a built copy comes back without a method added to it while script_diagnostics on the same script reads clean in the same window, so the copy the editor built and whatever the analyser resolves types against are not known to be one thing: reload for the copy, and read the diagnostics as a separate answer rather than as this one confirmed. This recompiles into the same object, so the holders that kept the stale copy alive see the new one. The methods it has afterwards come back under reloadedMethods, because a reload that compiled nothing and answered OK is the failure worth catching."
15974
15979
  }
15975
15980
  },
15976
15981
  requires: ["projectPath"]
@@ -38133,7 +38138,7 @@ class GodotServer {
38133
38138
  }
38134
38139
  }
38135
38140
  }
38136
- notes.push(`The editor is reporting against an older copy of ${contradicted.length === 1 ? "a type" : "some types"} named under contradictedByTheFile. Each member listed is declared in the file the class cache points at, so those diagnostics are wrong however the code is written. Try editor_rescan first: it costs about half a second and cleared this in one of five measured attempts. If it does not, the lever is that a held type is refreshed when something it depends on changes rather than when it changes itself${dependsOn.size === 0 ? ", though the named types depend on no other global class, which leaves only the restart" : `, so change ${[...dependsOn].sort().join(", ")} and rescan again`}. editor_launch restart is the only remedy that has always worked, and is the one to reach for when the count above is not good enough odds. project_import refresh_classes does not, and answers added: [] while this is happening.`);
38141
+ notes.push(staleAnalysisNote(contradicted, [...dependsOn]));
38137
38142
  }
38138
38143
  const uncached = unloaded.filter((type) => !type.inTheClassCache);
38139
38144
  if (uncached.length > 0) {
@@ -40701,7 +40706,7 @@ that is running, and the project on disk. ${TOOL_SPECS.length} tools, named \`do
40701
40706
 
40702
40707
  ## Start here
40703
40708
 
40704
- - Every call takes \`projectPath\` except ${toolsWithoutProjectPath().map((name) => `\\\`${name}\\\``).join(", ")}, which take none. The \`runtime_*\` and \`debug_*\` ones pick between running
40709
+ - Every call takes \`projectPath\` except ${toolsWithoutProjectPath().map((name) => `\`${name}\``).join(", ")}, which take none. The \`runtime_*\` and \`debug_*\` ones pick between running
40705
40710
  games instead; the others answer about the editor this server is connected to. There is no
40706
40711
  ambient project, and an argument a tool does not declare is refused rather than ignored.
40707
40712
  - \`editor_status\` says whether an editor is connected and whether its addon matches the server.
package/build/index.js CHANGED
@@ -24879,6 +24879,11 @@ function contradictedDiagnostics(messages, classes, sourceOf) {
24879
24879
  }
24880
24880
  return found;
24881
24881
  }
24882
+ function staleAnalysisNote(contradicted, dependsOn) {
24883
+ const declaring = [...new Set(contradicted.map((one) => one.declaredIn))].sort();
24884
+ const lever = dependsOn.length === 0 ? ", and the named types depend on no other global class, so that lever is not available here. " + "That is the common case rather than the awkward one: an edit near a type that depends on " + "something refreshes it before the fault is noticed, which is why a type with no " + "dependencies is where this turns up" : `, so changing ${[...dependsOn].sort().join(", ")} and rescanning is worth a try`;
24885
+ return `The editor is reporting against an older copy of ${contradicted.length === 1 ? "a type" : "some types"} ` + "named under contradictedByTheFile. Each member listed is declared in the file the class cache " + "points at, so those diagnostics are wrong however the code is written. Run editor_rescan first: " + "it costs about half a second, it cleared this in one of five attempts in the project that " + "reported it, and it cleared both reproductions measured in a second project, the scan itself " + "returning in 243ms and 275ms. " + "The fault behind it is that a script the editor has loaded keeps the copy it built, and nothing " + `rebuilds that copy when the file changes; editor_rescan with reloadScript set to ${declaring.join(", ")} ` + `recompiles ${declaring.length === 1 ? "that copy" : "those copies"} from the file into the same ` + "object and answers with the members it has afterwards under reloadedMethods. Read that and the " + "next diagnostics as two readings rather than one: a built copy has been seen stale here while " + "the diagnostics on it read clean, so the reload is worth doing and is not known to be what " + "clears these. The other lever measured is that a held type is refreshed when something it " + `depends on changes rather than when it changes itself${lever}. editor_launch restart has always ` + "worked and costs a window. project_import refresh_classes does not, and answers added: [] while " + "this is happening.";
24886
+ }
24882
24887
  function cacheWrittenAt(projectPath) {
24883
24888
  const cache = join3(projectPath, ".godot", "global_script_class_cache.cfg");
24884
24889
  try {
@@ -29084,7 +29089,7 @@ var TOOL_SPECS = [
29084
29089
  timeoutMs: { type: "number", description: "How long to wait for the scan. Default 30000." },
29085
29090
  reloadScript: {
29086
29091
  type: "string",
29087
- description: "A script to recompile in the editor after the scan, for the fault a scan cannot reach: a script the editor has loaded keeps the copy it built, and that copy is refreshed when one of its dependencies changes rather than when it changes itself, so a method added to a loaded class reads as missing at every caller. This recompiles into the same object, so the holders that kept the stale copy alive see the new one. The methods it has afterwards come back under reloadedMethods, because a reload that compiled nothing and answered OK is the failure worth catching."
29092
+ description: "A script to recompile in the editor after the scan, for the half a scan does not reach: a script the editor has loaded keeps the copy it built, that copy is refreshed when one of its dependencies changes rather than when it changes itself, and a scan leaves it alone. Measured here, a built copy comes back without a method added to it while script_diagnostics on the same script reads clean in the same window, so the copy the editor built and whatever the analyser resolves types against are not known to be one thing: reload for the copy, and read the diagnostics as a separate answer rather than as this one confirmed. This recompiles into the same object, so the holders that kept the stale copy alive see the new one. The methods it has afterwards come back under reloadedMethods, because a reload that compiled nothing and answered OK is the failure worth catching."
29088
29093
  }
29089
29094
  },
29090
29095
  requires: ["projectPath"]
@@ -30882,7 +30887,7 @@ class GodotServer {
30882
30887
  }
30883
30888
  }
30884
30889
  }
30885
- notes.push(`The editor is reporting against an older copy of ${contradicted.length === 1 ? "a type" : "some types"} named under contradictedByTheFile. Each member listed is declared in the file the class cache points at, so those diagnostics are wrong however the code is written. Try editor_rescan first: it costs about half a second and cleared this in one of five measured attempts. If it does not, the lever is that a held type is refreshed when something it depends on changes rather than when it changes itself${dependsOn.size === 0 ? ", though the named types depend on no other global class, which leaves only the restart" : `, so change ${[...dependsOn].sort().join(", ")} and rescan again`}. editor_launch restart is the only remedy that has always worked, and is the one to reach for when the count above is not good enough odds. project_import refresh_classes does not, and answers added: [] while this is happening.`);
30890
+ notes.push(staleAnalysisNote(contradicted, [...dependsOn]));
30886
30891
  }
30887
30892
  const uncached = unloaded.filter((type) => !type.inTheClassCache);
30888
30893
  if (uncached.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "0.13.24",
3
+ "version": "0.13.25",
4
4
  "mcpName": "io.github.Aureliolo/gdharness",
5
5
  "description": "A harness for driving a Godot 4 project from an agent: editor addons, a runtime bridge into the running game, an MCP server in front of them, and a CLI that installs and diagnoses the Godot side.",
6
6
  "type": "module",