miaoda-game-devkit 0.10.1 → 0.10.3
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/dist/react/testing.d.mts
CHANGED
|
@@ -50,7 +50,8 @@ interface StepUntilOptions {
|
|
|
50
50
|
step?: (step: number) => void | Promise<void>;
|
|
51
51
|
/**
|
|
52
52
|
* Optional read-only state used to make bounded failures actionable.
|
|
53
|
-
*
|
|
53
|
+
*
|
|
54
|
+
* The value is sampled when the bound is exhausted.
|
|
54
55
|
*/
|
|
55
56
|
diagnostics?: () => unknown;
|
|
56
57
|
/** 测试超时或运行取消时停止继续推进,通常由 playthroughTest 自动传入。 */
|
package/dist/react/testing.d.ts
CHANGED
|
@@ -50,7 +50,8 @@ interface StepUntilOptions {
|
|
|
50
50
|
step?: (step: number) => void | Promise<void>;
|
|
51
51
|
/**
|
|
52
52
|
* Optional read-only state used to make bounded failures actionable.
|
|
53
|
-
*
|
|
53
|
+
*
|
|
54
|
+
* The value is sampled when the bound is exhausted.
|
|
54
55
|
*/
|
|
55
56
|
diagnostics?: () => unknown;
|
|
56
57
|
/** 测试超时或运行取消时停止继续推进,通常由 playthroughTest 自动传入。 */
|
package/dist/react/testing.js
CHANGED
|
@@ -341,8 +341,8 @@ async function runBoundedUntil(condition, options = {}) {
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
const diagnostics = formatDiagnostics(options.diagnostics);
|
|
344
|
-
const guidance = options.step ? "The step callback ran, but the authoritative outcome did not change." : "No step callback was provided, and the condition did not become true after the stage action. This does not identify a clock problem; inspect the condition, production input wiring, and observed state boundary.";
|
|
345
344
|
const suffix = diagnostics ? ` Last diagnostics: ${diagnostics}` : "";
|
|
345
|
+
const guidance = options.step ? "The step callback ran, but the authoritative outcome did not change." : "No step callback was provided, and the condition did not become true after the stage action. This does not identify a clock problem; inspect the condition, production input wiring, and observed state boundary.";
|
|
346
346
|
throw codedError(
|
|
347
347
|
options.step ? "PLAYTHROUGH_BOUND_EXHAUSTED" : "PLAYTHROUGH_OUTCOME_NOT_REACHED",
|
|
348
348
|
`Playthrough outcome was not reached within ${maxSteps} steps. ${guidance}${suffix}`
|
package/dist/react/testing.mjs
CHANGED
|
@@ -303,8 +303,8 @@ async function runBoundedUntil(condition, options = {}) {
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
const diagnostics = formatDiagnostics(options.diagnostics);
|
|
306
|
-
const guidance = options.step ? "The step callback ran, but the authoritative outcome did not change." : "No step callback was provided, and the condition did not become true after the stage action. This does not identify a clock problem; inspect the condition, production input wiring, and observed state boundary.";
|
|
307
306
|
const suffix = diagnostics ? ` Last diagnostics: ${diagnostics}` : "";
|
|
307
|
+
const guidance = options.step ? "The step callback ran, but the authoritative outcome did not change." : "No step callback was provided, and the condition did not become true after the stage action. This does not identify a clock problem; inspect the condition, production input wiring, and observed state boundary.";
|
|
308
308
|
throw codedError(
|
|
309
309
|
options.step ? "PLAYTHROUGH_BOUND_EXHAUSTED" : "PLAYTHROUGH_OUTCOME_NOT_REACHED",
|
|
310
310
|
`Playthrough outcome was not reached within ${maxSteps} steps. ${guidance}${suffix}`
|
|
@@ -295,8 +295,8 @@ async function runBoundedUntil(condition, options = {}) {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
const diagnostics = formatDiagnostics(options.diagnostics);
|
|
298
|
-
const guidance = options.step ? "The step callback ran, but the authoritative outcome did not change." : "No step callback was provided, and the condition did not become true after the stage action. This does not identify a clock problem; inspect the condition, production input wiring, and observed state boundary.";
|
|
299
298
|
const suffix = diagnostics ? ` Last diagnostics: ${diagnostics}` : "";
|
|
299
|
+
const guidance = options.step ? "The step callback ran, but the authoritative outcome did not change." : "No step callback was provided, and the condition did not become true after the stage action. This does not identify a clock problem; inspect the condition, production input wiring, and observed state boundary.";
|
|
300
300
|
throw codedError(
|
|
301
301
|
options.step ? "PLAYTHROUGH_BOUND_EXHAUSTED" : "PLAYTHROUGH_OUTCOME_NOT_REACHED",
|
|
302
302
|
`Playthrough outcome was not reached within ${maxSteps} steps. ${guidance}${suffix}`
|
|
@@ -1266,7 +1266,7 @@ function repairGuidance(code) {
|
|
|
1266
1266
|
case "STAGE_STATE_UNCHANGED":
|
|
1267
1267
|
return "The stage ran and asserted, but its observable state matched the previous milestone. Preserve the intended gameplay result and observe the same production Controller rendered by <App />. Do not substitute arbitrary labels or a weaker state change.";
|
|
1268
1268
|
case "PLAYTHROUGH_BOUND_EXHAUSTED":
|
|
1269
|
-
return "
|
|
1269
|
+
return "First read the phase or result field of Last diagnostics. If the run already reached a terminal result other than the one asserted, the game is over and the bound is irrelevant: assert the result the shipped constants actually produce (loss, draw, and ranking are legitimate terminal results), or fix the mechanic that was supposed to make the intended objective reachable. Raising maxSteps or rewriting the in-test play order cannot pass a finished game. If the run is still mid-game, keep the intended outcome unchanged and confirm that each deterministic step advances the same production Controller rendered by <App />; if state remains unchanged, inject ManualGameClock through the production App factory and observe that Controller through Telemetry. Never replace the outcome with navigation, an intermediate phase, a no-op step, or a weaker assertion, and never retune the production constants that define the challenge.";
|
|
1270
1270
|
case "PLAYTHROUGH_OUTCOME_NOT_REACHED":
|
|
1271
1271
|
return "The stage action completed, but its until condition never became true. Inspect TRACE and Last diagnostics, then confirm that the production DOM input reaches the rendered App, until describes the result caused by this stage, and observe reads the matching authoritative state when used. Add a deterministic step only if the gameplay is actually driven by time or frames; do not add a no-op step or weaken the intended outcome.";
|
|
1272
1272
|
case "PLAYTHROUGH_CLOCK_NOT_ADVANCED":
|
|
@@ -261,8 +261,8 @@ async function runBoundedUntil(condition, options = {}) {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
const diagnostics = formatDiagnostics(options.diagnostics);
|
|
264
|
-
const guidance = options.step ? "The step callback ran, but the authoritative outcome did not change." : "No step callback was provided, and the condition did not become true after the stage action. This does not identify a clock problem; inspect the condition, production input wiring, and observed state boundary.";
|
|
265
264
|
const suffix = diagnostics ? ` Last diagnostics: ${diagnostics}` : "";
|
|
265
|
+
const guidance = options.step ? "The step callback ran, but the authoritative outcome did not change." : "No step callback was provided, and the condition did not become true after the stage action. This does not identify a clock problem; inspect the condition, production input wiring, and observed state boundary.";
|
|
266
266
|
throw codedError(
|
|
267
267
|
options.step ? "PLAYTHROUGH_BOUND_EXHAUSTED" : "PLAYTHROUGH_OUTCOME_NOT_REACHED",
|
|
268
268
|
`Playthrough outcome was not reached within ${maxSteps} steps. ${guidance}${suffix}`
|
|
@@ -1232,7 +1232,7 @@ function repairGuidance(code) {
|
|
|
1232
1232
|
case "STAGE_STATE_UNCHANGED":
|
|
1233
1233
|
return "The stage ran and asserted, but its observable state matched the previous milestone. Preserve the intended gameplay result and observe the same production Controller rendered by <App />. Do not substitute arbitrary labels or a weaker state change.";
|
|
1234
1234
|
case "PLAYTHROUGH_BOUND_EXHAUSTED":
|
|
1235
|
-
return "
|
|
1235
|
+
return "First read the phase or result field of Last diagnostics. If the run already reached a terminal result other than the one asserted, the game is over and the bound is irrelevant: assert the result the shipped constants actually produce (loss, draw, and ranking are legitimate terminal results), or fix the mechanic that was supposed to make the intended objective reachable. Raising maxSteps or rewriting the in-test play order cannot pass a finished game. If the run is still mid-game, keep the intended outcome unchanged and confirm that each deterministic step advances the same production Controller rendered by <App />; if state remains unchanged, inject ManualGameClock through the production App factory and observe that Controller through Telemetry. Never replace the outcome with navigation, an intermediate phase, a no-op step, or a weaker assertion, and never retune the production constants that define the challenge.";
|
|
1236
1236
|
case "PLAYTHROUGH_OUTCOME_NOT_REACHED":
|
|
1237
1237
|
return "The stage action completed, but its until condition never became true. Inspect TRACE and Last diagnostics, then confirm that the production DOM input reaches the rendered App, until describes the result caused by this stage, and observe reads the matching authoritative state when used. Add a deterministic step only if the gameplay is actually driven by time or frames; do not add a no-op step or weaken the intended outcome.";
|
|
1238
1238
|
case "PLAYTHROUGH_CLOCK_NOT_ADVANCED":
|
package/package.json
CHANGED
package/tsconfig-base.json
CHANGED