@buaa_smat/hometrans 26.0.7 → 26.0.8

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.
Files changed (154) hide show
  1. package/agents/a2h-executor.md +37 -0
  2. package/env-requirements.json +15 -1
  3. package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +2 -2
  4. package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +1 -1
  5. package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +13 -6
  6. package/i18n/skills/a2h-app-migrate/SKILL.md +2 -2
  7. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +27 -4
  8. package/i18n/skills/a2h-app-migrate/scripts/opencode_depth.mjs +418 -0
  9. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -0
  10. package/i18n/skills/a2h-batch-ui-align/SKILL.md +7 -7
  11. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -1
  12. package/i18n/skills/a2h-batch-ui-align/references/cards/state.md +20 -2
  13. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +2 -2
  14. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +3 -3
  15. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +3 -1
  16. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +2 -2
  17. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +10 -6
  18. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +13 -9
  19. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +59 -7
  20. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +3 -0
  21. package/i18n/skills/a2h-batch-ui-align/scripts/interactions.mjs +186 -0
  22. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +33 -7
  23. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +83 -22
  24. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +39 -5
  25. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +25 -1
  26. package/i18n/skills/a2h-page-specgen/SKILL.md +1 -1
  27. package/i18n/skills/a2h-page-specgen/references/gates.md +3 -1
  28. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +11 -11
  29. package/i18n/skills/a2h-page-specgen/references/spec-template.md +3 -3
  30. package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +40 -3
  31. package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +73 -5
  32. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +144 -0
  33. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +11 -11
  34. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +11 -11
  35. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +11 -11
  36. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +11 -11
  37. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +10 -10
  38. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +1 -1
  39. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +11 -11
  40. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +11 -11
  41. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +11 -11
  42. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +11 -11
  43. package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +45 -1
  44. package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +100 -0
  45. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +132 -3
  46. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +36 -1
  47. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +1 -1
  48. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +16 -0
  49. package/i18n/skills/a2h-utg-static/SKILL.md +2 -0
  50. package/package.json +1 -1
  51. package/platforms/atomcode/agents/a2h-executor.frontmatter.md +6 -0
  52. package/platforms/codebuddy/agents/a2h-executor.frontmatter.md +5 -0
  53. package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +2 -2
  54. package/platforms/deveco/agents/a2h-executor.frontmatter.md +7 -0
  55. package/platforms/deveco/agents/build-fixer.frontmatter.md +0 -2
  56. package/platforms/deveco/agents/code-reviewer.frontmatter.md +0 -2
  57. package/platforms/deveco/agents/model-render-worker.frontmatter.md +0 -2
  58. package/platforms/deveco/agents/model-worker.frontmatter.md +0 -2
  59. package/platforms/deveco/agents/specgen-worker.frontmatter.md +0 -2
  60. package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +1 -1
  61. package/platforms/opencode/agents/a2h-executor.frontmatter.md +7 -0
  62. package/platforms/opencode/agents/build-fixer.frontmatter.md +0 -2
  63. package/platforms/opencode/agents/code-reviewer.frontmatter.md +0 -2
  64. package/platforms/opencode/agents/model-render-worker.frontmatter.md +0 -2
  65. package/platforms/opencode/agents/model-worker.frontmatter.md +0 -2
  66. package/platforms/opencode/agents/specgen-worker.frontmatter.md +0 -2
  67. package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +13 -6
  68. package/skills/a2h-app-migrate/SKILL.md +29 -3
  69. package/skills/a2h-app-migrate/references/host-rules.md +33 -0
  70. package/skills/a2h-app-migrate/references/workflow.yaml +24 -4
  71. package/skills/a2h-app-migrate/scripts/opencode_depth.mjs +418 -0
  72. package/skills/a2h-app-migrate/test/test_executor_header_sync.mjs +78 -0
  73. package/skills/a2h-app-migrate/test/test_opencode_depth.mjs +312 -0
  74. package/skills/a2h-app-migrate/tools/dag.mjs +267 -0
  75. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -0
  76. package/skills/a2h-batch-ui-align/SKILL.md +7 -7
  77. package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -1
  78. package/skills/a2h-batch-ui-align/references/cards/state.md +20 -2
  79. package/skills/a2h-batch-ui-align/references/cards/widgets.md +2 -2
  80. package/skills/a2h-batch-ui-align/references/checker-rules.md +3 -3
  81. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +3 -1
  82. package/skills/a2h-batch-ui-align/references/host-dispatch.md +5 -5
  83. package/skills/a2h-batch-ui-align/references/incremental-scope.md +2 -2
  84. package/skills/a2h-batch-ui-align/references/step3-capture.md +10 -6
  85. package/skills/a2h-batch-ui-align/references/step5-convert.md +13 -9
  86. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +59 -7
  87. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +3 -0
  88. package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +3 -2
  89. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +139 -23
  90. package/skills/a2h-batch-ui-align/scripts/host_env.mjs +32 -8
  91. package/skills/a2h-batch-ui-align/scripts/interactions.mjs +186 -0
  92. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +33 -7
  93. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +83 -22
  94. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +39 -5
  95. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +82 -0
  96. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +25 -1
  97. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +184 -2
  98. package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +33 -0
  99. package/skills/a2h-batch-ui-align/scripts/tests/interactions.test.mjs +258 -0
  100. package/skills/a2h-page-specgen/SKILL.md +1 -1
  101. package/skills/a2h-page-specgen/references/evidence.md +15 -0
  102. package/skills/a2h-page-specgen/references/gates.md +3 -1
  103. package/skills/a2h-page-specgen/references/scenario-authoring.md +10 -10
  104. package/skills/a2h-page-specgen/references/spec-template.md +2 -2
  105. package/skills/a2h-page-specgen/scripts/contract-calls.mjs +40 -3
  106. package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +73 -5
  107. package/skills/a2h-page-specgen/scripts/gate.mjs +141 -0
  108. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +10 -10
  109. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +10 -10
  110. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +10 -10
  111. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +10 -10
  112. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +10 -10
  113. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +1 -1
  114. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +10 -10
  115. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +10 -10
  116. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +10 -10
  117. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +10 -10
  118. package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +45 -1
  119. package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +100 -0
  120. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +104 -3
  121. package/skills/a2h-resource-convert/references/conversion-rules.md +2 -0
  122. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +36 -1
  123. package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +42 -0
  124. package/skills/a2h-spec-design-pipeline/SKILL.md +1 -1
  125. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +16 -0
  126. package/skills/a2h-spec-design-pipeline/references/execution-model.md +2 -2
  127. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +5 -1
  128. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
  129. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
  130. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +2 -1
  131. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +3 -1
  132. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-v2-observation-cn.md +105 -0
  133. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-v2-observation-en.md +122 -0
  134. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +4 -4
  135. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIV2ObservationCheck.js +1862 -0
  136. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +2 -0
  137. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
  138. package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +15 -2
  139. package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +20 -4
  140. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_v2_observation.ts +284 -0
  141. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +32 -0
  142. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +22 -1
  143. package/skills/a2h-utg-static/SKILL.md +2 -0
  144. package/skills/a2h-utg-static/references/extractors.md +16 -0
  145. package/skills/a2h-utg-static/scripts/run_pipeline.mjs +22 -1
  146. package/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +4 -0
  147. package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +15 -0
  148. package/skills/a2h-utg-static/scripts/tests/test_view_attachments.mjs +330 -0
  149. package/skills/a2h-utg-static/scripts/view_attachments.mjs +465 -0
  150. package/platforms/codebuddy/agents/build-fixer.frontmatter.md +0 -5
  151. package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +0 -5
  152. package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +0 -5
  153. package/platforms/codebuddy/agents/model-worker.frontmatter.md +0 -5
  154. package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +0 -5
@@ -241,18 +241,18 @@ Review every lifecycle-signal candidate and choose one of three: a user-observab
241
241
 
242
242
  Timing wording follows the source: "refreshes immediately" when it takes effect on completion, "re-read on return" or "re-read on next entry" when it waits until the page is visible again — never mix the two. An axis scenario's trigger sequence starts from the timing event, and its last step lands on an assertable observable outcome.
243
243
 
244
- ### Request Bodies and Responses
244
+ ### Request Parameters and Responses
245
245
 
246
- When a scenario performs a network request, write the request body as a **tree-shaped field table inside the request step that sends it**. Write the response key by key.
246
+ When a scenario performs a network request, write the request parameters (`query` and `body`) as a **tree-shaped field table inside the request step that sends it**; list path parameters and request headers explicitly with their `in`. Write the response key by key.
247
247
 
248
248
  The table has four fixed, labelled segments in a fixed order and is a top-level fenced code block, so every renderer keeps its line breaks:
249
249
 
250
250
  ```text
251
- <Request body name>
251
+ <Request parameter name>
252
252
  ├─ field:<path> type/encoding:<type> default:<value> send:<rule>
253
253
  ```
254
254
 
255
- - **Write every key**: list each key of the source's request-body construction, including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
255
+ - **Write every key**: list each key of the source's request construction (`query` or `body`), including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
256
256
  - `field:` a top-level field is written with its plain name; a nested leaf is `a.b`; an array element is `a[].b`; the array itself is `a[]` (type `array<T>`). A parent object appears together with its children; give it its own `object` row only when the parent itself carries a send rule.
257
257
  - `type/encoding:` only the closed vocabulary `string`, `int`, `int64`, `float`, `double`, `bool`, `object`, `array<T>`; put a time format, a byte encoding or a radix in parentheses (`string(yyyy-MM-dd HH:mm)`, `string(Base64)`, `int(>=1)`). Never write "text" or "number" as loose prose, and keep the token byte-identical to the contract's `type`.
258
258
  - `default:` `—` means the field has no default value; strings are quoted; write only the value, never whether the key is sent.
@@ -260,22 +260,22 @@ The table has four fixed, labelled segments in a fixed order and is a top-level
260
260
  - `required`: the key is always present. Stop there when a missing source value is a defect; add ", falls back to the default" when the default fills it, and name the source or failure when it matters, for example ", falls back to the default unknown when it cannot be read";
261
261
  - `optional`: the key may be absent, immediately followed by a decidable condition written as ", not sent when <condition>" or ", sent only when <condition>", for example ", not sent when it has no value", ", not sent when the array is empty", ", not sent when it equals the default 0", ", not sent when the source cannot be determined", ", not sent when the user specifies no insert position";
262
262
  - `never`: never appears; the field stays in the data model and is skipped when serializing.
263
- - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent"; a field with a default may be omitted when it equals the default, and may also always be sent.
263
+ - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent", and `"nullable": false` only means the value cannot be empty. **None of these is equivalent to `required`** — a field with a default may be omitted when it equals the default, and may also always be sent.
264
264
  - The condition must be writable as a single `if`: name a concrete condition such as "has no value", "the array is empty", "equals the default", "the control is off", "nothing is selected", "cannot be read", "the source cannot be determined". Never write "as needed", "depending on", "generally", "maybe"; list every condition separately instead of "except in special cases".
265
265
  - `required` and `optional` differ only in whether the key is always present; the `default:` segment says what value fills a missing value and never whether the key appears, so the two segments never substitute for each other. A boolean that uses `false` for "the user set nothing" must say "not sent when it equals the default false", not "not sent when it has no value".
266
266
  - When writing a condition, "no value" means unassigned or `null`; for strings and arrays a length of 0 also counts as no value; `0` and `false` count as values.
267
- - Start the step with an executable action, not a caption such as "the structure is as follows": "the request body is serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
267
+ - Start the step with an executable action, not a caption such as "the structure is as follows": "the request parameters are serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
268
268
  - Separate the segments with at least one space: the path after `field:` must not be glued to the next segment, or the path and `default:` read as a `file:line`; write `default:false`, never `default=false`; no table line starts with `#`.
269
- - Name the table root in business terms (for example "sync request body"), never with the request type name from the source.
269
+ - Name the table root in business terms (for example "sync request body" or "weather query parameters"), never with the request type name from the source.
270
270
  - When a field's value does not come from this page's input (local storage, the previous response, a fixed value, a computed value), add one line after the table naming each such field, for example: "Value sources: `userId` is the current signed-in user number in local storage, `deviceId` is the device identifier in local storage, and `payload` is the pending-queue record count." Fields fed by page input need no entry.
271
271
 
272
- **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Query parameters, path parameters and headers are listed the same way with their own `in`; key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
272
+ **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "query"` or `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Path parameters and headers are listed with their own `in` (no table required); key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
273
273
 
274
274
  **Response.** List one field path per string in `response_fields[]` (`current_temperature`, `hourly.temperatures[]`); the envelope (code/data/message), types, nullability and the handling of a missing or default-valued field go into that endpoint's `note` and are merged into the step — never into a `response_fields` element, because G2 requires each element to appear verbatim in the step.
275
275
 
276
276
  **G2 checks verbatim.** A method, URL, parameter name, parameter default, value source or response field present in the contracts but absent from the steps fails the gate. The envelope, types, nullability and missing-value handling are outside that check and must still be written into the steps, not left in `contracts` alone.
277
277
 
278
- When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
278
+ When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body (or a nested query object) is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
279
279
 
280
280
  ### Platform-Neutral Body Text
281
281
 
@@ -371,9 +371,9 @@ Before submission, confirm all of the following:
371
371
  - Numeric inputs state integer versus decimal and whether a negative value is accepted, with no “accepts digits only” standing in for the type; the decimal places, bounds, whitespace and invalid-character handling the source implements are written out, and no unimplemented constraint is written as existing behavior.
372
372
  - Every data boundary names both sides — present (source and destination) and absent (what it does not carry, write or send, and where empty, missing or default goes); entries over one data set line up item by item, absent items are written out, and absence is never written as -1, 0 or an empty string.
373
373
  - Every value answers where it comes from (including the field’s origin in the consuming code), how it is processed (including the inputs that change the result and the difference after they change), and where it is consumed; missing any of the three leaves the scenario incomplete.
374
- - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never a nullable field, a default value, or a model-required flag.
374
+ - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never nullability (for example `"nullable": false`), a default value, or a model-required flag.
375
375
  - Scenarios that create, read, update, or delete data, or synchronize state or data, list every affected piece of data and how it changes, with no vague “related data updates in sync.”
376
- - Network scenarios write the request body as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
376
+ - Network scenarios write the request parameters (`query` and `body`) as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; path parameters and headers are listed with their `in` (no table required); declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
377
377
  - No vague phrase such as “handle all other errors uniformly” substitutes for concrete branches.
378
378
  - Every scenario is independently readable, with no abbreviated cross-scenario references and no unsupported copy, branches, thresholds, or outcomes added to fill gaps.
379
379
  - Each scenario is exactly one normal or one edge/boundary case, with no success/failure mix.
@@ -11,7 +11,7 @@
11
11
  "A first-page list cursor selects the request branch without extra state",
12
12
  "The user taps “Load list” to start this list request",
13
13
  "Before the list request starts the page marks list loading as pending",
14
- "The list request uses method GET at /api/list, takes query parameter cursor from the current list cursor, and reads response field items",
14
+ "The list request uses method GET at /api/list with the query parameters below and reads response field items\n```text\nList query parameters\nfield:cursor type/encoding:string default:— send:required\n```\nValue sources: cursor comes from the current list cursor; it is the first-page cursor.",
15
15
  "A successful non-empty list response replaces the displayed list",
16
16
  "The list asynchronous continuation saves this response for the interface",
17
17
  "List request completion clears the list loading state"
@@ -48,7 +48,7 @@
48
48
  "A first-page list cursor selects the request branch without extra state",
49
49
  "The user taps “Load list” to start this list request",
50
50
  "Before the list request starts the page marks list loading as pending",
51
- "The list request uses method GET at /api/list, takes query parameter cursor from the current list cursor, and reads response field items",
51
+ "The list request uses method GET at /api/list with the query parameters below and reads response field items\n```text\nList query parameters\nfield:cursor type/encoding:string default:— send:required\n```\nValue sources: cursor comes from the current list cursor; it is the first-page cursor.",
52
52
  "A list HTTP status failure displays the status error and retains the old list",
53
53
  "List request completion clears the list loading state"
54
54
  ],
@@ -84,7 +84,7 @@
84
84
  "A first-page list cursor selects the request branch without extra state",
85
85
  "The user taps “Load list” to start this list request",
86
86
  "Before the list request starts the page marks list loading as pending",
87
- "The list request uses method GET at /api/list, takes query parameter cursor from the current list cursor, and reads response field items",
87
+ "The list request uses method GET at /api/list with the query parameters below and reads response field items\n```text\nList query parameters\nfield:cursor type/encoding:string default:— send:required\n```\nValue sources: cursor comes from the current list cursor; it is the first-page cursor.",
88
88
  "A list transport failure displays the transport error and retains the old list",
89
89
  "List request completion clears the list loading state"
90
90
  ],
@@ -120,7 +120,7 @@
120
120
  "A first-page list cursor selects the request branch without extra state",
121
121
  "The user taps “Load list” to start this list request",
122
122
  "Before the list request starts the page marks list loading as pending",
123
- "The list request uses method GET at /api/list, takes query parameter cursor from the current list cursor, and reads response field items",
123
+ "The list request uses method GET at /api/list with the query parameters below and reads response field items\n```text\nList query parameters\nfield:cursor type/encoding:string default:— send:required\n```\nValue sources: cursor comes from the current list cursor; it is the first-page cursor.",
124
124
  "A list business failure displays the server business error and retains the old list",
125
125
  "List request completion clears the list loading state"
126
126
  ],
@@ -156,7 +156,7 @@
156
156
  "A first-page list cursor selects the request branch without extra state",
157
157
  "The user taps “Load list” to start this list request",
158
158
  "Before the list request starts the page marks list loading as pending",
159
- "The list request uses method GET at /api/list, takes query parameter cursor from the current list cursor, and reads response field items",
159
+ "The list request uses method GET at /api/list with the query parameters below and reads response field items\n```text\nList query parameters\nfield:cursor type/encoding:string default:— send:required\n```\nValue sources: cursor comes from the current list cursor; it is the first-page cursor.",
160
160
  "A successful empty list response displays the empty-list state",
161
161
  "List request completion clears the list loading state"
162
162
  ],
@@ -192,7 +192,7 @@
192
192
  "A first-page refresh cursor requests delta mode and submits the current cursor",
193
193
  "The user taps “Refresh” to start this refresh request",
194
194
  "Before the refresh request starts the composable creates a pending refresh presentation",
195
- "The refresh request uses method POST at /api/refresh, takes query parameter cursor from the current refresh cursor, uses parameter mode with default delta from the fixed incremental mode, and reads response field items",
195
+ "The refresh request uses method POST at /api/refresh with the query parameters below and reads response field items\n```text\nRefresh query parameters\nfield:cursor type/encoding:string default:— send:required\nfield:mode type/encoding:string default:delta send:required\n```\nValue sources: cursor comes from the current refresh cursor, and mode comes from the fixed incremental mode; it is the delta mode.",
196
196
  "A successful non-empty refresh response merges and displays the additions",
197
197
  "The refresh asynchronous continuation saves this refresh response",
198
198
  "Refresh request completion clears the pending refresh presentation"
@@ -237,7 +237,7 @@
237
237
  "A first-page refresh cursor requests delta mode and submits the current cursor",
238
238
  "The user taps “Refresh” to start this refresh request",
239
239
  "Before the refresh request starts the composable creates a pending refresh presentation",
240
- "The refresh request uses method POST at /api/refresh, takes query parameter cursor from the current refresh cursor, uses parameter mode with default delta from the fixed incremental mode, and reads response field items",
240
+ "The refresh request uses method POST at /api/refresh with the query parameters below and reads response field items\n```text\nRefresh query parameters\nfield:cursor type/encoding:string default:— send:required\nfield:mode type/encoding:string default:delta send:required\n```\nValue sources: cursor comes from the current refresh cursor, and mode comes from the fixed incremental mode; it is the delta mode.",
241
241
  "A refresh HTTP status failure displays the refresh status error",
242
242
  "Refresh request completion clears the pending refresh presentation"
243
243
  ],
@@ -281,7 +281,7 @@
281
281
  "A first-page refresh cursor requests delta mode and submits the current cursor",
282
282
  "The user taps “Refresh” to start this refresh request",
283
283
  "Before the refresh request starts the composable creates a pending refresh presentation",
284
- "The refresh request uses method POST at /api/refresh, takes query parameter cursor from the current refresh cursor, uses parameter mode with default delta from the fixed incremental mode, and reads response field items",
284
+ "The refresh request uses method POST at /api/refresh with the query parameters below and reads response field items\n```text\nRefresh query parameters\nfield:cursor type/encoding:string default:— send:required\nfield:mode type/encoding:string default:delta send:required\n```\nValue sources: cursor comes from the current refresh cursor, and mode comes from the fixed incremental mode; it is the delta mode.",
285
285
  "A refresh transport failure displays the refresh transport error",
286
286
  "Refresh request completion clears the pending refresh presentation"
287
287
  ],
@@ -325,7 +325,7 @@
325
325
  "A first-page refresh cursor requests delta mode and submits the current cursor",
326
326
  "The user taps “Refresh” to start this refresh request",
327
327
  "Before the refresh request starts the composable creates a pending refresh presentation",
328
- "The refresh request uses method POST at /api/refresh, takes query parameter cursor from the current refresh cursor, uses parameter mode with default delta from the fixed incremental mode, and reads response field items",
328
+ "The refresh request uses method POST at /api/refresh with the query parameters below and reads response field items\n```text\nRefresh query parameters\nfield:cursor type/encoding:string default:— send:required\nfield:mode type/encoding:string default:delta send:required\n```\nValue sources: cursor comes from the current refresh cursor, and mode comes from the fixed incremental mode; it is the delta mode.",
329
329
  "A refresh business failure displays the refresh business error",
330
330
  "Refresh request completion clears the pending refresh presentation"
331
331
  ],
@@ -369,7 +369,7 @@
369
369
  "A first-page refresh cursor requests delta mode and submits the current cursor",
370
370
  "The user taps “Refresh” to start this refresh request",
371
371
  "Before the refresh request starts the composable creates a pending refresh presentation",
372
- "The refresh request uses method POST at /api/refresh, takes query parameter cursor from the current refresh cursor, uses parameter mode with default delta from the fixed incremental mode, and reads response field items",
372
+ "The refresh request uses method POST at /api/refresh with the query parameters below and reads response field items\n```text\nRefresh query parameters\nfield:cursor type/encoding:string default:— send:required\nfield:mode type/encoding:string default:delta send:required\n```\nValue sources: cursor comes from the current refresh cursor, and mode comes from the fixed incremental mode; it is the delta mode.",
373
373
  "A successful empty refresh response displays the no-additions state",
374
374
  "Refresh request completion clears the pending refresh presentation"
375
375
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "discovery_digest": "da18650b6f97415a79f4132b5798197b29dad562b36777f784db530e90716ebc",
3
- "drafts_digest": "fdd40175bf0ea8fc1f7508bce7481e9f82da46cd2db69641558a5d5ee6bd1f4a",
3
+ "drafts_digest": "28ab1cfc829a10b8dc96e0257d42cfbd4eccaeb71a549e886317ee63434525a7",
4
4
  "attempt": 0,
5
5
  "status": "completed",
6
6
  "reviews": [
@@ -306,18 +306,18 @@ Review every lifecycle-signal candidate and choose one of three: a user-observab
306
306
 
307
307
  Timing wording follows the source: "refreshes immediately" when it takes effect on completion, "re-read on return" or "re-read on next entry" when it waits until the page is visible again — never mix the two. An axis scenario's trigger sequence starts from the timing event, and its last step lands on an assertable observable outcome.
308
308
 
309
- ### Request Bodies and Responses
309
+ ### Request Parameters and Responses
310
310
 
311
- When a scenario performs a network request, write the request body as a **tree-shaped field table inside the request step that sends it**. Write the response key by key.
311
+ When a scenario performs a network request, write the request parameters (`query` and `body`) as a **tree-shaped field table inside the request step that sends it**; list path parameters and request headers explicitly with their `in`. Write the response key by key.
312
312
 
313
313
  The table has four fixed, labelled segments in a fixed order and is a top-level fenced code block, so every renderer keeps its line breaks:
314
314
 
315
315
  ```text
316
- <Request body name>
316
+ <Request parameter name>
317
317
  ├─ field:<path> type/encoding:<type> default:<value> send:<rule>
318
318
  ```
319
319
 
320
- - **Write every key**: list each key of the source's request-body construction, including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
320
+ - **Write every key**: list each key of the source's request construction (`query` or `body`), including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
321
321
  - `field:` a top-level field is written with its plain name; a nested leaf is `a.b`; an array element is `a[].b`; the array itself is `a[]` (type `array<T>`). A parent object appears together with its children; give it its own `object` row only when the parent itself carries a send rule.
322
322
  - `type/encoding:` only the closed vocabulary `string`, `int`, `int64`, `float`, `double`, `bool`, `object`, `array<T>`; put a time format, a byte encoding or a radix in parentheses (`string(yyyy-MM-dd HH:mm)`, `string(Base64)`, `int(>=1)`). Never write "text" or "number" as loose prose, and keep the token byte-identical to the contract's `type`.
323
323
  - `default:` `—` means the field has no default value; strings are quoted; write only the value, never whether the key is sent.
@@ -325,22 +325,22 @@ The table has four fixed, labelled segments in a fixed order and is a top-level
325
325
  - `required`: the key is always present. Stop there when a missing source value is a defect; add ", falls back to the default" when the default fills it, and name the source or failure when it matters, for example ", falls back to the default unknown when it cannot be read";
326
326
  - `optional`: the key may be absent, immediately followed by a decidable condition written as ", not sent when <condition>" or ", sent only when <condition>", for example ", not sent when it has no value", ", not sent when the array is empty", ", not sent when it equals the default 0", ", not sent when the source cannot be determined", ", not sent when the user specifies no insert position";
327
327
  - `never`: never appears; the field stays in the data model and is skipped when serializing.
328
- - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent"; a field with a default may be omitted when it equals the default, and may also always be sent.
328
+ - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent", and `"nullable": false` only means the value cannot be empty. **None of these is equivalent to `required`** — a field with a default may be omitted when it equals the default, and may also always be sent.
329
329
  - The condition must be writable as a single `if`: name a concrete condition such as "has no value", "the array is empty", "equals the default", "the control is off", "nothing is selected", "cannot be read", "the source cannot be determined". Never write "as needed", "depending on", "generally", "maybe"; list every condition separately instead of "except in special cases".
330
330
  - `required` and `optional` differ only in whether the key is always present; the `default:` segment says what value fills a missing value and never whether the key appears, so the two segments never substitute for each other. A boolean that uses `false` for "the user set nothing" must say "not sent when it equals the default false", not "not sent when it has no value".
331
331
  - When writing a condition, "no value" means unassigned or `null`; for strings and arrays a length of 0 also counts as no value; `0` and `false` count as values.
332
- - Start the step with an executable action, not a caption such as "the structure is as follows": "the request body is serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
332
+ - Start the step with an executable action, not a caption such as "the structure is as follows": "the request parameters are serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
333
333
  - Separate the segments with at least one space: the path after `field:` must not be glued to the next segment, or the path and `default:` read as a `file:line`; write `default:false`, never `default=false`; no table line starts with `#`.
334
- - Name the table root in business terms (for example "sync request body"), never with the request type name from the source.
334
+ - Name the table root in business terms (for example "sync request body" or "weather query parameters"), never with the request type name from the source.
335
335
  - When a field's value does not come from this page's input (local storage, the previous response, a fixed value, a computed value), add one line after the table naming each such field, for example: "Value sources: `userId` is the current signed-in user number in local storage, `deviceId` is the device identifier in local storage, and `payload` is the pending-queue record count." Fields fed by page input need no entry.
336
336
 
337
- **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Query parameters, path parameters and headers are listed the same way with their own `in`; key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
337
+ **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "query"` or `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Path parameters and headers are listed with their own `in` (no table required); key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
338
338
 
339
339
  **Response.** List one field path per string in `response_fields[]` (`current_temperature`, `hourly.temperatures[]`); the envelope (code/data/message), types, nullability and the handling of a missing or default-valued field go into that endpoint's `note` and are merged into the step — never into a `response_fields` element, because G2 requires each element to appear verbatim in the step.
340
340
 
341
341
  **G2 checks verbatim.** A method, URL, parameter name, parameter default, value source or response field present in the contracts but absent from the steps fails the gate. The envelope, types, nullability and missing-value handling are outside that check and must still be written into the steps, not left in `contracts` alone.
342
342
 
343
- When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
343
+ When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body (or a nested query object) is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
344
344
 
345
345
  ### Platform-Neutral Body Text
346
346
 
@@ -436,9 +436,9 @@ Before submission, confirm all of the following:
436
436
  - Numeric inputs state integer versus decimal and whether a negative value is accepted, with no “accepts digits only” standing in for the type; the decimal places, bounds, whitespace and invalid-character handling the source implements are written out, and no unimplemented constraint is written as existing behavior.
437
437
  - Every data boundary names both sides — present (source and destination) and absent (what it does not carry, write or send, and where empty, missing or default goes); entries over one data set line up item by item, absent items are written out, and absence is never written as -1, 0 or an empty string.
438
438
  - Every value answers where it comes from (including the field’s origin in the consuming code), how it is processed (including the inputs that change the result and the difference after they change), and where it is consumed; missing any of the three leaves the scenario incomplete.
439
- - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never a nullable field, a default value, or a model-required flag.
439
+ - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never nullability (for example `"nullable": false`), a default value, or a model-required flag.
440
440
  - Scenarios that create, read, update, or delete data, or synchronize state or data, list every affected piece of data and how it changes, with no vague “related data updates in sync.”
441
- - Network scenarios write the request body as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
441
+ - Network scenarios write the request parameters (`query` and `body`) as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; path parameters and headers are listed with their `in` (no table required); declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
442
442
  - No vague phrase such as “handle all other errors uniformly” substitutes for concrete branches.
443
443
  - Every scenario is independently readable, with no abbreviated cross-scenario references and no unsupported copy, branches, thresholds, or outcomes added to fill gaps.
444
444
  - Each scenario is exactly one normal or one edge/boundary case, with no success/failure mix.
@@ -208,18 +208,18 @@ Review every lifecycle-signal candidate and choose one of three: a user-observab
208
208
 
209
209
  Timing wording follows the source: "refreshes immediately" when it takes effect on completion, "re-read on return" or "re-read on next entry" when it waits until the page is visible again — never mix the two. An axis scenario's trigger sequence starts from the timing event, and its last step lands on an assertable observable outcome.
210
210
 
211
- ### Request Bodies and Responses
211
+ ### Request Parameters and Responses
212
212
 
213
- When a scenario performs a network request, write the request body as a **tree-shaped field table inside the request step that sends it**. Write the response key by key.
213
+ When a scenario performs a network request, write the request parameters (`query` and `body`) as a **tree-shaped field table inside the request step that sends it**; list path parameters and request headers explicitly with their `in`. Write the response key by key.
214
214
 
215
215
  The table has four fixed, labelled segments in a fixed order and is a top-level fenced code block, so every renderer keeps its line breaks:
216
216
 
217
217
  ```text
218
- <Request body name>
218
+ <Request parameter name>
219
219
  ├─ field:<path> type/encoding:<type> default:<value> send:<rule>
220
220
  ```
221
221
 
222
- - **Write every key**: list each key of the source's request-body construction, including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
222
+ - **Write every key**: list each key of the source's request construction (`query` or `body`), including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
223
223
  - `field:` a top-level field is written with its plain name; a nested leaf is `a.b`; an array element is `a[].b`; the array itself is `a[]` (type `array<T>`). A parent object appears together with its children; give it its own `object` row only when the parent itself carries a send rule.
224
224
  - `type/encoding:` only the closed vocabulary `string`, `int`, `int64`, `float`, `double`, `bool`, `object`, `array<T>`; put a time format, a byte encoding or a radix in parentheses (`string(yyyy-MM-dd HH:mm)`, `string(Base64)`, `int(>=1)`). Never write "text" or "number" as loose prose, and keep the token byte-identical to the contract's `type`.
225
225
  - `default:` `—` means the field has no default value; strings are quoted; write only the value, never whether the key is sent.
@@ -227,22 +227,22 @@ The table has four fixed, labelled segments in a fixed order and is a top-level
227
227
  - `required`: the key is always present. Stop there when a missing source value is a defect; add ", falls back to the default" when the default fills it, and name the source or failure when it matters, for example ", falls back to the default unknown when it cannot be read";
228
228
  - `optional`: the key may be absent, immediately followed by a decidable condition written as ", not sent when <condition>" or ", sent only when <condition>", for example ", not sent when it has no value", ", not sent when the array is empty", ", not sent when it equals the default 0", ", not sent when the source cannot be determined", ", not sent when the user specifies no insert position";
229
229
  - `never`: never appears; the field stays in the data model and is skipped when serializing.
230
- - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent"; a field with a default may be omitted when it equals the default, and may also always be sent.
230
+ - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent", and `"nullable": false` only means the value cannot be empty. **None of these is equivalent to `required`** — a field with a default may be omitted when it equals the default, and may also always be sent.
231
231
  - The condition must be writable as a single `if`: name a concrete condition such as "has no value", "the array is empty", "equals the default", "the control is off", "nothing is selected", "cannot be read", "the source cannot be determined". Never write "as needed", "depending on", "generally", "maybe"; list every condition separately instead of "except in special cases".
232
232
  - `required` and `optional` differ only in whether the key is always present; the `default:` segment says what value fills a missing value and never whether the key appears, so the two segments never substitute for each other. A boolean that uses `false` for "the user set nothing" must say "not sent when it equals the default false", not "not sent when it has no value".
233
233
  - When writing a condition, "no value" means unassigned or `null`; for strings and arrays a length of 0 also counts as no value; `0` and `false` count as values.
234
- - Start the step with an executable action, not a caption such as "the structure is as follows": "the request body is serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
234
+ - Start the step with an executable action, not a caption such as "the structure is as follows": "the request parameters are serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
235
235
  - Separate the segments with at least one space: the path after `field:` must not be glued to the next segment, or the path and `default:` read as a `file:line`; write `default:false`, never `default=false`; no table line starts with `#`.
236
- - Name the table root in business terms (for example "sync request body"), never with the request type name from the source.
236
+ - Name the table root in business terms (for example "sync request body" or "weather query parameters"), never with the request type name from the source.
237
237
  - When a field's value does not come from this page's input (local storage, the previous response, a fixed value, a computed value), add one line after the table naming each such field, for example: "Value sources: `userId` is the current signed-in user number in local storage, `deviceId` is the device identifier in local storage, and `payload` is the pending-queue record count." Fields fed by page input need no entry.
238
238
 
239
- **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Query parameters, path parameters and headers are listed the same way with their own `in`; key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
239
+ **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "query"` or `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Path parameters and headers are listed with their own `in` (no table required); key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
240
240
 
241
241
  **Response.** List one field path per string in `response_fields[]` (`current_temperature`, `hourly.temperatures[]`); the envelope (code/data/message), types, nullability and the handling of a missing or default-valued field go into that endpoint's `note` and are merged into the step — never into a `response_fields` element, because G2 requires each element to appear verbatim in the step.
242
242
 
243
243
  **G2 checks verbatim.** A method, URL, parameter name, parameter default, value source or response field present in the contracts but absent from the steps fails the gate. The envelope, types, nullability and missing-value handling are outside that check and must still be written into the steps, not left in `contracts` alone.
244
244
 
245
- When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
245
+ When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body (or a nested query object) is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
246
246
 
247
247
  ### Platform-Neutral Body Text
248
248
 
@@ -338,9 +338,9 @@ Before submission, confirm all of the following:
338
338
  - Numeric inputs state integer versus decimal and whether a negative value is accepted, with no “accepts digits only” standing in for the type; the decimal places, bounds, whitespace and invalid-character handling the source implements are written out, and no unimplemented constraint is written as existing behavior.
339
339
  - Every data boundary names both sides — present (source and destination) and absent (what it does not carry, write or send, and where empty, missing or default goes); entries over one data set line up item by item, absent items are written out, and absence is never written as -1, 0 or an empty string.
340
340
  - Every value answers where it comes from (including the field’s origin in the consuming code), how it is processed (including the inputs that change the result and the difference after they change), and where it is consumed; missing any of the three leaves the scenario incomplete.
341
- - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never a nullable field, a default value, or a model-required flag.
341
+ - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never nullability (for example `"nullable": false`), a default value, or a model-required flag.
342
342
  - Scenarios that create, read, update, or delete data, or synchronize state or data, list every affected piece of data and how it changes, with no vague “related data updates in sync.”
343
- - Network scenarios write the request body as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
343
+ - Network scenarios write the request parameters (`query` and `body`) as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; path parameters and headers are listed with their `in` (no table required); declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
344
344
  - No vague phrase such as “handle all other errors uniformly” substitutes for concrete branches.
345
345
  - Every scenario is independently readable, with no abbreviated cross-scenario references and no unsupported copy, branches, thresholds, or outcomes added to fill gaps.
346
346
  - Each scenario is exactly one normal or one edge/boundary case, with no success/failure mix.
@@ -306,18 +306,18 @@ Review every lifecycle-signal candidate and choose one of three: a user-observab
306
306
 
307
307
  Timing wording follows the source: "refreshes immediately" when it takes effect on completion, "re-read on return" or "re-read on next entry" when it waits until the page is visible again — never mix the two. An axis scenario's trigger sequence starts from the timing event, and its last step lands on an assertable observable outcome.
308
308
 
309
- ### Request Bodies and Responses
309
+ ### Request Parameters and Responses
310
310
 
311
- When a scenario performs a network request, write the request body as a **tree-shaped field table inside the request step that sends it**. Write the response key by key.
311
+ When a scenario performs a network request, write the request parameters (`query` and `body`) as a **tree-shaped field table inside the request step that sends it**; list path parameters and request headers explicitly with their `in`. Write the response key by key.
312
312
 
313
313
  The table has four fixed, labelled segments in a fixed order and is a top-level fenced code block, so every renderer keeps its line breaks:
314
314
 
315
315
  ```text
316
- <Request body name>
316
+ <Request parameter name>
317
317
  ├─ field:<path> type/encoding:<type> default:<value> send:<rule>
318
318
  ```
319
319
 
320
- - **Write every key**: list each key of the source's request-body construction, including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
320
+ - **Write every key**: list each key of the source's request construction (`query` or `body`), including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
321
321
  - `field:` a top-level field is written with its plain name; a nested leaf is `a.b`; an array element is `a[].b`; the array itself is `a[]` (type `array<T>`). A parent object appears together with its children; give it its own `object` row only when the parent itself carries a send rule.
322
322
  - `type/encoding:` only the closed vocabulary `string`, `int`, `int64`, `float`, `double`, `bool`, `object`, `array<T>`; put a time format, a byte encoding or a radix in parentheses (`string(yyyy-MM-dd HH:mm)`, `string(Base64)`, `int(>=1)`). Never write "text" or "number" as loose prose, and keep the token byte-identical to the contract's `type`.
323
323
  - `default:` `—` means the field has no default value; strings are quoted; write only the value, never whether the key is sent.
@@ -325,22 +325,22 @@ The table has four fixed, labelled segments in a fixed order and is a top-level
325
325
  - `required`: the key is always present. Stop there when a missing source value is a defect; add ", falls back to the default" when the default fills it, and name the source or failure when it matters, for example ", falls back to the default unknown when it cannot be read";
326
326
  - `optional`: the key may be absent, immediately followed by a decidable condition written as ", not sent when <condition>" or ", sent only when <condition>", for example ", not sent when it has no value", ", not sent when the array is empty", ", not sent when it equals the default 0", ", not sent when the source cannot be determined", ", not sent when the user specifies no insert position";
327
327
  - `never`: never appears; the field stays in the data model and is skipped when serializing.
328
- - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent"; a field with a default may be omitted when it equals the default, and may also always be sent.
328
+ - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent", and `"nullable": false` only means the value cannot be empty. **None of these is equivalent to `required`** — a field with a default may be omitted when it equals the default, and may also always be sent.
329
329
  - The condition must be writable as a single `if`: name a concrete condition such as "has no value", "the array is empty", "equals the default", "the control is off", "nothing is selected", "cannot be read", "the source cannot be determined". Never write "as needed", "depending on", "generally", "maybe"; list every condition separately instead of "except in special cases".
330
330
  - `required` and `optional` differ only in whether the key is always present; the `default:` segment says what value fills a missing value and never whether the key appears, so the two segments never substitute for each other. A boolean that uses `false` for "the user set nothing" must say "not sent when it equals the default false", not "not sent when it has no value".
331
331
  - When writing a condition, "no value" means unassigned or `null`; for strings and arrays a length of 0 also counts as no value; `0` and `false` count as values.
332
- - Start the step with an executable action, not a caption such as "the structure is as follows": "the request body is serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
332
+ - Start the step with an executable action, not a caption such as "the structure is as follows": "the request parameters are serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
333
333
  - Separate the segments with at least one space: the path after `field:` must not be glued to the next segment, or the path and `default:` read as a `file:line`; write `default:false`, never `default=false`; no table line starts with `#`.
334
- - Name the table root in business terms (for example "sync request body"), never with the request type name from the source.
334
+ - Name the table root in business terms (for example "sync request body" or "weather query parameters"), never with the request type name from the source.
335
335
  - When a field's value does not come from this page's input (local storage, the previous response, a fixed value, a computed value), add one line after the table naming each such field, for example: "Value sources: `userId` is the current signed-in user number in local storage, `deviceId` is the device identifier in local storage, and `payload` is the pending-queue record count." Fields fed by page input need no entry.
336
336
 
337
- **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Query parameters, path parameters and headers are listed the same way with their own `in`; key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
337
+ **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "query"` or `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Path parameters and headers are listed with their own `in` (no table required); key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
338
338
 
339
339
  **Response.** List one field path per string in `response_fields[]` (`current_temperature`, `hourly.temperatures[]`); the envelope (code/data/message), types, nullability and the handling of a missing or default-valued field go into that endpoint's `note` and are merged into the step — never into a `response_fields` element, because G2 requires each element to appear verbatim in the step.
340
340
 
341
341
  **G2 checks verbatim.** A method, URL, parameter name, parameter default, value source or response field present in the contracts but absent from the steps fails the gate. The envelope, types, nullability and missing-value handling are outside that check and must still be written into the steps, not left in `contracts` alone.
342
342
 
343
- When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
343
+ When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body (or a nested query object) is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
344
344
 
345
345
  ### Platform-Neutral Body Text
346
346
 
@@ -436,9 +436,9 @@ Before submission, confirm all of the following:
436
436
  - Numeric inputs state integer versus decimal and whether a negative value is accepted, with no “accepts digits only” standing in for the type; the decimal places, bounds, whitespace and invalid-character handling the source implements are written out, and no unimplemented constraint is written as existing behavior.
437
437
  - Every data boundary names both sides — present (source and destination) and absent (what it does not carry, write or send, and where empty, missing or default goes); entries over one data set line up item by item, absent items are written out, and absence is never written as -1, 0 or an empty string.
438
438
  - Every value answers where it comes from (including the field’s origin in the consuming code), how it is processed (including the inputs that change the result and the difference after they change), and where it is consumed; missing any of the three leaves the scenario incomplete.
439
- - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never a nullable field, a default value, or a model-required flag.
439
+ - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never nullability (for example `"nullable": false`), a default value, or a model-required flag.
440
440
  - Scenarios that create, read, update, or delete data, or synchronize state or data, list every affected piece of data and how it changes, with no vague “related data updates in sync.”
441
- - Network scenarios write the request body as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
441
+ - Network scenarios write the request parameters (`query` and `body`) as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; path parameters and headers are listed with their `in` (no table required); declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
442
442
  - No vague phrase such as “handle all other errors uniformly” substitutes for concrete branches.
443
443
  - Every scenario is independently readable, with no abbreviated cross-scenario references and no unsupported copy, branches, thresholds, or outcomes added to fill gaps.
444
444
  - Each scenario is exactly one normal or one edge/boundary case, with no success/failure mix.
@@ -241,18 +241,18 @@ Review every lifecycle-signal candidate and choose one of three: a user-observab
241
241
 
242
242
  Timing wording follows the source: "refreshes immediately" when it takes effect on completion, "re-read on return" or "re-read on next entry" when it waits until the page is visible again — never mix the two. An axis scenario's trigger sequence starts from the timing event, and its last step lands on an assertable observable outcome.
243
243
 
244
- ### Request Bodies and Responses
244
+ ### Request Parameters and Responses
245
245
 
246
- When a scenario performs a network request, write the request body as a **tree-shaped field table inside the request step that sends it**. Write the response key by key.
246
+ When a scenario performs a network request, write the request parameters (`query` and `body`) as a **tree-shaped field table inside the request step that sends it**; list path parameters and request headers explicitly with their `in`. Write the response key by key.
247
247
 
248
248
  The table has four fixed, labelled segments in a fixed order and is a top-level fenced code block, so every renderer keeps its line breaks:
249
249
 
250
250
  ```text
251
- <Request body name>
251
+ <Request parameter name>
252
252
  ├─ field:<path> type/encoding:<type> default:<value> send:<rule>
253
253
  ```
254
254
 
255
- - **Write every key**: list each key of the source's request-body construction, including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
255
+ - **Write every key**: list each key of the source's request construction (`query` or `body`), including keys that are **always the default**, **always sent**, or **never sent on this page**; dropping one is a failure, and fields may not be picked by scenario. **A field with a default is not necessarily sent** — whether it appears must be confirmed from the source's serializer or request-construction site.
256
256
  - `field:` a top-level field is written with its plain name; a nested leaf is `a.b`; an array element is `a[].b`; the array itself is `a[]` (type `array<T>`). A parent object appears together with its children; give it its own `object` row only when the parent itself carries a send rule.
257
257
  - `type/encoding:` only the closed vocabulary `string`, `int`, `int64`, `float`, `double`, `bool`, `object`, `array<T>`; put a time format, a byte encoding or a radix in parentheses (`string(yyyy-MM-dd HH:mm)`, `string(Base64)`, `int(>=1)`). Never write "text" or "number" as loose prose, and keep the token byte-identical to the contract's `type`.
258
258
  - `default:` `—` means the field has no default value; strings are quoted; write only the value, never whether the key is sent.
@@ -260,22 +260,22 @@ The table has four fixed, labelled segments in a fixed order and is a top-level
260
260
  - `required`: the key is always present. Stop there when a missing source value is a defect; add ", falls back to the default" when the default fills it, and name the source or failure when it matters, for example ", falls back to the default unknown when it cannot be read";
261
261
  - `optional`: the key may be absent, immediately followed by a decidable condition written as ", not sent when <condition>" or ", sent only when <condition>", for example ", not sent when it has no value", ", not sent when the array is empty", ", not sent when it equals the default 0", ", not sent when the source cannot be determined", ", not sent when the user specifies no insert position";
262
262
  - `never`: never appears; the field stays in the data model and is skipped when serializing.
263
- - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent"; a field with a default may be omitted when it equals the default, and may also always be sent.
263
+ - Whether a key is sent follows the source's serializer or request-construction site: a nullable field, a field with a default, and a model-required field do not mean "always sent", and `"nullable": false` only means the value cannot be empty. **None of these is equivalent to `required`** — a field with a default may be omitted when it equals the default, and may also always be sent.
264
264
  - The condition must be writable as a single `if`: name a concrete condition such as "has no value", "the array is empty", "equals the default", "the control is off", "nothing is selected", "cannot be read", "the source cannot be determined". Never write "as needed", "depending on", "generally", "maybe"; list every condition separately instead of "except in special cases".
265
265
  - `required` and `optional` differ only in whether the key is always present; the `default:` segment says what value fills a missing value and never whether the key appears, so the two segments never substitute for each other. A boolean that uses `false` for "the user set nothing" must say "not sent when it equals the default false", not "not sent when it has no value".
266
266
  - When writing a condition, "no value" means unassigned or `null`; for strings and arrays a length of 0 also counts as no value; `0` and `false` count as values.
267
- - Start the step with an executable action, not a caption such as "the structure is as follows": "the request body is serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
267
+ - Start the step with an executable action, not a caption such as "the structure is as follows": "the request parameters are serialized field by field from the table below and then sent; the key order follows the table's row order and whether a key appears follows the send segment".
268
268
  - Separate the segments with at least one space: the path after `field:` must not be glued to the next segment, or the path and `default:` read as a `file:line`; write `default:false`, never `default=false`; no table line starts with `#`.
269
- - Name the table root in business terms (for example "sync request body"), never with the request type name from the source.
269
+ - Name the table root in business terms (for example "sync request body" or "weather query parameters"), never with the request type name from the source.
270
270
  - When a field's value does not come from this page's input (local storage, the previous response, a fixed value, a computed value), add one line after the table naming each such field, for example: "Value sources: `userId` is the current signed-in user number in local storage, `deviceId` is the device identifier in local storage, and `payload` is the pending-queue record count." Fields fed by page input need no entry.
271
271
 
272
- **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Query parameters, path parameters and headers are listed the same way with their own `in`; key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
272
+ **Relation to the contracts.** Each table row is also declared once in that scenario's `contracts.endpoints[].params` with `in: "query"` or `in: "body"`, byte-identical. The contracts are the audited fact base: G2 compares every parameter name, default and value source against the step text, and one missing token fails the gate. The table is what the reader and the downstream coder see. Path parameters and headers are listed with their own `in` (no table required); key names, defaults and fixed values follow the source — never guess, and never drop a key that has a default.
273
273
 
274
274
  **Response.** List one field path per string in `response_fields[]` (`current_temperature`, `hourly.temperatures[]`); the envelope (code/data/message), types, nullability and the handling of a missing or default-valued field go into that endpoint's `note` and are merged into the step — never into a `response_fields` element, because G2 requires each element to appear verbatim in the step.
275
275
 
276
276
  **G2 checks verbatim.** A method, URL, parameter name, parameter default, value source or response field present in the contracts but absent from the steps fails the gate. The envelope, types, nullability and missing-value handling are outside that check and must still be written into the steps, not left in `contracts` alone.
277
277
 
278
- When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
278
+ When the same request appears in several scenarios, each scenario repeats the complete table; never write "same as above" or "see scenario 1". The send condition lives only in the table; the steps state the server behaviour or the user-visible result once the condition holds. When the body (or a nested query object) is an object or an array, state the nesting and every child key; never write "other fields", "etc.", or a single sample value.
279
279
 
280
280
  ### Platform-Neutral Body Text
281
281
 
@@ -371,9 +371,9 @@ Before submission, confirm all of the following:
371
371
  - Numeric inputs state integer versus decimal and whether a negative value is accepted, with no “accepts digits only” standing in for the type; the decimal places, bounds, whitespace and invalid-character handling the source implements are written out, and no unimplemented constraint is written as existing behavior.
372
372
  - Every data boundary names both sides — present (source and destination) and absent (what it does not carry, write or send, and where empty, missing or default goes); entries over one data set line up item by item, absent items are written out, and absence is never written as -1, 0 or an empty string.
373
373
  - Every value answers where it comes from (including the field’s origin in the consuming code), how it is processed (including the inputs that change the result and the difference after they change), and where it is consumed; missing any of the three leaves the scenario incomplete.
374
- - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never a nullable field, a default value, or a model-required flag.
374
+ - Every branch states how its condition is determined and both outcomes; every step traces to a source location or an evidence entry; whether a key is sent follows the source serializer, never nullability (for example `"nullable": false`), a default value, or a model-required flag.
375
375
  - Scenarios that create, read, update, or delete data, or synchronize state or data, list every affected piece of data and how it changes, with no vague “related data updates in sync.”
376
- - Network scenarios write the request body as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
376
+ - Network scenarios write the request parameters (`query` and `body`) as a field table inside the sending step, each row carrying the four labelled segments `field:`, `type/encoding:`, `default:` and `send:`; path parameters and headers are listed with their `in` (no table required); declare the same fields in `contracts.endpoints[].params`, list every value source that is not page input, start every send segment with `required`/`optional`/`never` and follow it with a decidable condition (never "as needed" or "depending on"), describe the response structure as fully as possible, and keep all of these facts in that same step.
377
377
  - No vague phrase such as “handle all other errors uniformly” substitutes for concrete branches.
378
378
  - Every scenario is independently readable, with no abbreviated cross-scenario references and no unsupported copy, branches, thresholds, or outcomes added to fill gaps.
379
379
  - Each scenario is exactly one normal or one edge/boundary case, with no success/failure mix.
@@ -4,7 +4,7 @@ import os from "node:os";
4
4
  import path from "node:path";
5
5
  import test from "node:test";
6
6
  import { DatabaseSync } from "node:sqlite";
7
- import { classifyContractSignals, collectContractCalls } from "../contract-calls.mjs";
7
+ import { classifyContractSignals, collectContractCalls, CONTRACT_CALLS_SCHEMA_VERSION } from "../contract-calls.mjs";
8
8
 
9
9
  function makeGraph(root, nodes, edges) {
10
10
  const dir = path.join(root, ".homegraph");
@@ -85,6 +85,50 @@ test("keeps a call-only HTTP client and rejects a plain utility", () => {
85
85
  db.close();
86
86
  });
87
87
 
88
+ test("one service file with two transport functions yields one target per symbol", () => {
89
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), "contract-calls-multi-symbol-"));
90
+ write(root, "Main.kt", "class Main { fun run() { Repo().load() } }");
91
+ write(root, "Repo.kt", "class Repo { fun load() { Client().first(); Client().second() } }");
92
+ write(root, "Client.kt", `
93
+ class Client {
94
+ val base = "https://api.example.com"
95
+ fun first() { Request.Builder().url(base + "/first").build() }
96
+ fun second() { Request.Builder().url(base + "/second").build() }
97
+ }
98
+ `);
99
+ const db = makeGraph(root, [
100
+ { id: "m", file: "Main.kt" },
101
+ { id: "r", file: "Repo.kt" },
102
+ { id: "c1", file: "Client.kt", kind: "class", name: "first" },
103
+ { id: "c2", file: "Client.kt", kind: "class", name: "second" },
104
+ ], [
105
+ { source: "m", target: "r", line: 1, col: 20 },
106
+ { source: "r", target: "c1", line: 1, col: 24 },
107
+ { source: "r", target: "c2", line: 1, col: 40 },
108
+ ]);
109
+
110
+ const result = collectContractCalls({
111
+ db,
112
+ sourceProject: root,
113
+ page: page(),
114
+ entry: {
115
+ resolvedFile: "Main.kt",
116
+ composition: new Set(["Repo.kt"]),
117
+ bodyInheritance: new Set(),
118
+ directInheritance: new Set(),
119
+ origin_units: [],
120
+ },
121
+ });
122
+
123
+ assert.equal(result.targets.length, 2);
124
+ assert.deepEqual(result.targets.map(target => target.target_symbol), ["first", "second"]);
125
+ assert.ok(result.targets.every(target => target.locator === "Client.kt"));
126
+ assert.equal(result.counts.kept, 1);
127
+ assert.equal(result.counts.targets, 2);
128
+ assert.equal(result.schema_version, CONTRACT_CALLS_SCHEMA_VERSION);
129
+ db.close();
130
+ });
131
+
88
132
  test("keeps a call-only uni.request module for a Vue page", () => {
89
133
  const root = fs.mkdtempSync(path.join(os.tmpdir(), "contract-calls-vue-"));
90
134
  write(root, "pages/list/index.vue", "<template><view/></template><script>import api from '@/api/weather'; api.load()</script>");