@cspeach/cli 1.1.56 → 1.1.57

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.
@@ -34,7 +34,7 @@ import { teamFixOffers, cspeachWritesThisSession } from '../register/offer.js';
34
34
  import { appendPending, finalizeToolCall } from '../session/pending.js';
35
35
  import { checkTransportFit, checkTransportNeeded, reusedRequestRefusal, noteTransportNeededAsked, takeTransportNeededAsked, } from './transport-fit-check.js';
36
36
  import { typeCode } from '../approvals/risk-floor.js';
37
- import { auditLog, SapError, hasClassicParameterBlock } from '@cspeach/sap-client';
37
+ import { auditLog, SapError, hasClassicParameterBlock, documentWriteHint } from '@cspeach/sap-client';
38
38
  import { ERR } from '../errors/codes.js';
39
39
  import { interceptUpdateMethod, CancelledByUserError, } from './update-method-intercept.js';
40
40
  // F-L2-1: statusline-only wire — records the transport a write ACTUALLY
@@ -50,13 +50,39 @@ import { snapshotChainState, writtenWithSyntaxErrors, chainActivation, journeyWo
50
50
  */
51
51
  const FUNC_CLASSIC_BLOCK_TEXT = 'A function module\'s signature goes in the FUNCTION statement (IMPORTING / EXPORTING / CHANGING / TABLES / EXCEPTIONS), '
52
52
  + 'not in a *" comment block. Rewrite the header and try again.';
53
+ /**
54
+ * F15 review (2026-11-02): sap-client's document-type sentence names client
55
+ * methods (createDomain, maintainMessages, …); this names the CLI tool the
56
+ * model can actually call. Keyed by the bare upper-case type code.
57
+ */
58
+ const DOCUMENT_TYPE_TOOL = {
59
+ DOMA: 'sap_create_domain',
60
+ DTEL: 'sap_create_data_element',
61
+ MSAG: 'sap_message_maintain',
62
+ TTYP: 'sap_create_table_type',
63
+ DEVC: 'sap_create_object',
64
+ SRVB: 'sap_create_object, then sap_service_binding_publish',
65
+ ENHO: 'sap_create_badi_implementation',
66
+ ENHS: 'no CLI tool yet (create the spot in ADT)',
67
+ };
53
68
  const SET_SOURCE_SPEC = {
54
69
  tool: 'sap_set_source',
55
70
  // Part 2c D16 (review I-4): a function module's classic *" block is refused
56
71
  // before the approval is spent, the snapshot is read or the WAL is opened.
57
- beforeApproval: (a) => (typeCode(a.type) === 'FUNC' && hasClassicParameterBlock(String(a.source ?? ''))
58
- ? { error: 'classic_parameter_block', detail: FUNC_CLASSIC_BLOCK_TEXT }
59
- : undefined),
72
+ // F15 (2026-11-02): an ADT document type (DOMA, DTEL, MSAG, DEVC, SRVB, …) is
73
+ // refused at the same point, before the approval is spent, the snapshot is
74
+ // read or the WAL is opened — with sap-client's own sentence.
75
+ beforeApproval: (a) => {
76
+ if (typeCode(a.type) === 'FUNC' && hasClassicParameterBlock(String(a.source ?? ''))) {
77
+ return { error: 'classic_parameter_block', detail: FUNC_CLASSIC_BLOCK_TEXT };
78
+ }
79
+ const hint = documentWriteHint(a.type);
80
+ if (hint !== undefined) {
81
+ const useTool = DOCUMENT_TYPE_TOOL[typeCode(a.type)] ?? 'the tool for its kind';
82
+ return { error: 'not_a_source_object', detail: `${hint} CLI tool: ${useTool}.`, use_tool: useTool };
83
+ }
84
+ return undefined;
85
+ },
60
86
  // Rule 7a in code (2026-10-22): on an existing class, a rewrite whose only
61
87
  // change is inside method bodies is refused — sap_update_method per method.
62
88
  methodOnlyGuard: (a) => ({ type: a.type, name: a.name, source: String(a.source ?? '') }),
@@ -123,7 +149,9 @@ registerTool({
123
149
  + 'Use for class-definition changes, new methods, or any change not confined to '
124
150
  + 'a single method body. For method-body-only edits use sap_update_method (Rule 7a). '
125
151
  + 'The transport auto-resolves to the owning request if the object is already locked. '
126
- + 'Types FUNC (function module), FINC (function-group include, e.g. L<GROUP>TOP), INCL (program include) and TTYP (table type) are supported; give the bare name — CSPeach finds the group.',
152
+ + 'Types FUNC (function module), FINC (function-group include, e.g. L<GROUP>TOP) and INCL (program include) are supported; give the bare name — CSPeach finds the group. '
153
+ + 'For a number range object (NROB) the source is SAP\'s nrob-v1 JSON document (formatVersion "1"; header.description, header.originalLanguage; interval.numberLengthDomain, percentWarning, subType, untilYear, rolling, prefix; configuration.buffering mainBuffer|parallel|none, bufferedNumbers), sent as application/json. '
154
+ + 'Domains, data elements, message classes, packages, bindings and table types have no source text: use their own tools.',
127
155
  isMutating: true,
128
156
  requiresSap: true,
129
157
  input_schema: {
@@ -1379,14 +1407,15 @@ registerTool({
1379
1407
  });
1380
1408
  // ── sap_number_range_intervals (STUB) ─────────────────────────────────────────
1381
1409
  //
1382
- // STUB — NROB interval write requires NR-object XML format not yet implemented
1383
- // in @cspeach/sap-client.
1410
+ // STUB — number range intervals (SNRO) are not an ADT resource: discovery lists
1411
+ // no intervals collection (probe docs/research/2026-11-02-nrob-adt-probe.md).
1384
1412
  registerTool({
1385
1413
  name: 'sap_number_range_intervals',
1386
1414
  requires: 'nrob',
1387
- description: 'STUB — not currently implemented; do not call. '
1388
- + 'Writing NROB number-range intervals via ADT requires NR-object XML format '
1389
- + 'not yet implemented in @cspeach/sap-client.',
1415
+ description: 'Not available: number range intervals (SNRO) are not an ADT resource on the systems we run against — '
1416
+ + 'the discovery document lists no intervals collection. '
1417
+ + 'Create the number range object with sap_create_object and sap_set_source (nrob-v1 JSON); '
1418
+ + 'the developer maintains its intervals in SNRO.',
1390
1419
  isMutating: true,
1391
1420
  requiresSap: true,
1392
1421
  input_schema: {
@@ -1406,7 +1435,7 @@ registerTool({
1406
1435
  return {
1407
1436
  content: JSON.stringify({
1408
1437
  error: 'not_implemented',
1409
- detail: 'NROB interval write via ADT requires NR-object XML format not yet implemented in @cspeach/sap-client',
1438
+ detail: 'number range intervals are maintained in SNRO; ADT exposes the object, not its intervals',
1410
1439
  }),
1411
1440
  is_error: true,
1412
1441
  };
@@ -0,0 +1,41 @@
1
+ CSPeach live check: system S4H, package ZTEST_LAS, run 2BUS
2
+ Transport S4HK903771 (given with --transport)
3
+
4
+ PASS CLI: sap_run and sap_transport_read (pipeline; D3, D18 refusals, one-shot run approval, dump window, spill; never a release) 90.6 s
5
+ PASS temp home 0.0 s alias S4H copied; write_mode approval-gated; safety cards off
6
+ covers: approval id + claims, Rule 9 transport, Rule 7 snapshot, WAL, Rule 10 verify, chain; not: Rule 8 (dispatchTool), the cards
7
+ PASS card input 0.0 s risk high (code_run); this runs code on the SAP system
8
+ PASS sap_create_object + sap_set_source CLAS 7.1 s ZCL_ZCSPLC2BUS_CR created and written; activated by the write and verified
9
+ info: object locked in S4HK903771 — writing under owning transport
10
+ info: snapshot ✓ CLAS ZCL_ZCSPLC2BUS_CR 2026-10-17T17-42-31-537Z
11
+ ① snapshot ✓ ② written ✓ ③ syntax ✓ ④ activate pending
12
+ audit: 2026-10-17T17:42:34.691Z | setSource | CLAS | ZCL_ZCSPLC2BUS_CR | success | 3146ms
13
+ audit: 2026-10-17T17:42:34.976Z | setSource | CLAS | ZCL_ZCSPLC2BUS_CR | success | 4539ms
14
+ PASS sap_run standard class refused 0.0 s run_refused before any request: CSPeach runs only your own classes and programs (names starting with Z or Y). CL_ABAP_UNIT_ASSERT is not one of them.
15
+ PASS sap_lock 0.3 s ZCL_ZCSPLC2BUS_CR locked through sap_lock (a manual lock is held)
16
+ PASS sap_run under a manual lock 0.0 s manual_lock_held before any request: A lock you took with sap_lock is still held. Unlock it (sap_unlock) first, then ask for the run again.
17
+ PASS sap_unlock 0.7 s ZCL_ZCSPLC2BUS_CR unlocked; no manual lock held
18
+ PASS sap_run CLAS 0.3 s the same approval id ran it once: {"ran":true,"type":"CLAS","name":"ZCL_ZCSPLC2BUS_CR","lines":9,"chars":107,"elapsed_ms":287,"session_ended":false}
19
+ info: run CLAS ZCL_ZCSPLC2BUS_CR · ran · 287 ms
20
+ PASS sap_run again with the same id 0.0 s APPROVAL_INVALID nonce_spent; no request
21
+ PASS sap_run PROG 4.2 s ran: {"ran":true,"type":"PROG","name":"ZCSPLC2BUS_CRP","lines":6,"chars":255,"elapsed_ms":291,"session_ended":false}
22
+ PASS sap_run CLAS dump 4.7 s run_dumped: "Division by zero", dump_window 20261018034313–20261018034713; next_step: sap_short_dump with fromDate and toDate = dump_window (SAP system time), then operation detail on the newest du...
23
+ PASS sap_short_dump in the dump window 1.5 s listed: ZCL_ZCSPLC2BUS_CRX============CP (20261018034513vhcals4hci_S4H_00%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20S.LAEEQ%20%20%20%20%20100%20%20%20%20%20%20%2012); 1 dump(s) in the window
24
+ PASS sap_run CLAS long output 17.9 s the content carries the pointer line; the spill file holds 20001 lines (the facts line and 20 000 output lines); {"ran":true,"type":"CLAS","name":"ZCL_ZCSPLC2BUS_CRB","lines":20001,"chars":1328895,...
25
+ PASS sap_transport_read request 12.9 s S4HK903771 status D, 1 task(s), object_count 691, can_release true
26
+ PASS sap_transport_read task 7.2 s S4HK903772: kind task of S4HK903771; note: S4HK903772 is a task of S4HK903771.
27
+ PASS release card input (never used) 13.2 s risk high (transport_release); no approval minted, never sent
28
+ Request S4HK903771 "CSPeach live check 2026-10-14" · owner S.LAEEQ · target CL5
29
+ 1 task: S4HK903772 · 691 objects
30
+ Cannot be undone. Once released, the request can move to the other systems on the transport route.
31
+ CSPeach reads SAP's verdict after each step and checks the request afterwards. Check the transport in SE09 after the release.
32
+ PASS sap_delete_object CLAS ZCL_ZCSPLC2BUS_CRB 5.7 s deleted; a search finds nothing
33
+ PASS sap_delete_object CLAS ZCL_ZCSPLC2BUS_CRX 5.5 s deleted; a search finds nothing
34
+ PASS sap_delete_object PROG ZCSPLC2BUS_CRP 3.7 s deleted; a search finds nothing
35
+ PASS sap_delete_object CLAS ZCL_ZCSPLC2BUS_CR 5.6 s deleted; a search finds nothing
36
+ PASS Cleanup 0.0 s
37
+
38
+ 2 passed, 0 failed
39
+ Transport: S4HK903771
40
+ The transport is NOT released. Delete or release it in SE09.
41
+ Leftover objects: none.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cspeach/cli",
3
- "version": "1.1.56",
3
+ "version": "1.1.57",
4
4
  "description": "CSPeach — AI-assisted ABAP development CLI. Direct SAP access, signed skills, safety gates.",
5
5
  "keywords": [
6
6
  "abap",
@@ -54,7 +54,7 @@
54
54
  "@anthropic-ai/sdk": "^0.90.0",
55
55
  "@azure/msal-node": "6.0.1",
56
56
  "@cspeach/register-core": "0.4.2",
57
- "@cspeach/sap-client": "0.1.31",
57
+ "@cspeach/sap-client": "0.1.32",
58
58
  "@iarna/toml": "^2.2.5",
59
59
  "@inkjs/ui": "^2.0.0",
60
60
  "@inquirer/prompts": "^7.0.0",