You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d532b2e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ NPL currently lacks ZTOAD's transparent table. SAP_BASIS 750 has no ADT transpar
61
61
- Use dependency injection for external collaborators. Use test seams only as a temporary legacy-code bridge.
62
62
- Test both the success path and invalid/untrusted input. ZTOAD executes dynamic SQL, so authorization boundaries, dynamic table/column input, escaping, DML, and native SQL are security-sensitive.
63
63
- For generated source, test the actual emitted line representation: split only at whitespace outside literals, reject unsafe hard cuts, and never move `*` into ABAP source column one.
64
+
- When a tokenizer or masker rebuilds text character by character, run its whitespace-preservation regression on SAP; converting a fixed-length `TYPE c` blank into a string can trim the separator even when static lint is green.
64
65
- ABAP Unit tests must not change customizing or persistent business data. Any integration test that writes must use an explicitly disposable Z table and be cleaned up.
65
66
- Local abaplint is a fast compatibility/static gate, not a substitute for SAP syntax, activation, ABAP Unit, or ATC.
66
67
- ABAP Unit and syntax cannot prove that a Control Framework class is supported by a particular frontend. GUI-control changes require a new browser session against the exact active candidate plus a post-run dump check.
Copy file name to clipboardExpand all lines: docs/baseline-findings.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# ZTOAD baseline findings
2
2
3
-
_Snapshot: 2026-08-07 · branch `codex/fix-base-run-006` from released `master` 5.0.0 · live system A4H client 001, SAP_BASIS 758 SP02 · secondary target NPL client 001, SAP_BASIS 750 SP02_
3
+
_Snapshot: 2026-08-07 · branch `codex/fix-base-bug-002` from merged master`5218476` · live system A4H client 001, SAP_BASIS 758 SP02 · secondary target NPL client 001, SAP_BASIS 750 SP02_
4
4
5
5
This is the ordered work list for incremental TDD. It records observed defects separately from broad style debt so a new failure cannot disappear inside the legacy backlog. A finding is closed only after its regression test is green locally where possible, green on A4H, and green on the SAP_BASIS 750 target.
6
6
@@ -9,15 +9,15 @@ This is the ordered work list for incremental TDD. It records observed defects s
9
9
| Gate | Result | Interpretation |
10
10
|---|---|---|
11
11
| Repository `npm test`| Passed, 0 configured abaplint findings | Fast compatibility/XML gate is green |
12
-
| Full abaplint quality profile | 2,109 findings across 61 rules | Configured abaplint remains at zero and is the merge gate; the full profile is a diagnostic debt inventory |
13
-
| A4H SAP syntax | 0 errors, 2 POSIX warnings | Exact `BASE-RUN-006`commit `31eca99` activated successfully; both warnings are pre-existing compatibility findings |
14
-
| A4H ABAP Unit |57 passed, 0 failed | The combined suite adds WebGUI/desktop capability regressions to the three P0 security fixes|
12
+
| Full abaplint quality profile | 2,169 findings across 63 rules | Configured abaplint remains at zero and is the merge gate; the full profile is a diagnostic debt inventory |
13
+
| A4H SAP syntax | 0 errors, 2 POSIX warnings | Exact BASE-BUG-002 source commit `3657984` activated successfully; both warnings are pre-existing compatibility findings |
14
+
| A4H ABAP Unit |67 passed, 0 failed | The suite adds seven pure CASE-analyzer tests and three CASE-generator tests to merged master|
15
15
| A4H ATC `S4HANA_READINESS_2023`| Initial run displayed 0 finding rows | Later evidence shows missing prerequisites; this is not an authoritative zero gate |
16
-
| A4H ATC `ABAP_CLOUD_READINESS`| 682 findings: 474 P1, 208 P2 | Complete exact-candidate run; +14 classic frontend/API findings versus master's 668, retained as an architectural burn-down signal rather than a zero gate |
17
-
| A4H WebGUI smoke | Fresh empty editor, two sanitized statements, deterministic last-statement execution, ALV row `000 / 1`, clean F3 exit | Exact `BASE-RUN-006` candidate is green; no ST22 entry appeared after the 06:26:10 UTC marker |
16
+
| A4H ATC `ABAP_CLOUD_READINESS`| 682 findings: 474 P1, 208 P2 | Complete exact-candidate run; unchanged from merged master and retained as an architectural burn-down signal rather than a zero gate |
17
+
| A4H WebGUI smoke | Fresh editor executed the sanitized SFLIGHT CASE aggregate, returned eight grouped rows with `NET_PRICE`, and exited cleanly with F3 | Exact BASE-BUG-002 candidate is green; no ST22 entry appeared after the 06:26:10 UTC marker |
18
18
| ABAP 7.50 live gate | ARC-1 lifecycle passed; ZTOAD blocked |`arc-1-750` can create/activate/syntax/unit/delete, but ZTOAD's transparent table is absent and SAP_BASIS 750 cannot create it over ADT |
19
19
20
-
All three P0 security fixes are merged and their complete production/test corpus is preserved in this candidate. Exact `BASE-RUN-006`commit `31eca9936202b63874ba089e3744fe9971dfa0e4` has local source SHA-256 `4b4823a5db169697696d71edf42b432ca66db0d8585c36066a3bd3817f61a2e5`; its explicitly activated A4H active/inactive source was equal at server-normalized SHA-256 `138d7cf38e68649abb7d714093afc809a27f7a26ca98b511d15dec4ef68d9e36`. After live evidence, A4H was restored and activated to exact `origin/master` server SHA-256 `21ef81d0b925bca71182822a0e9650cb80b32c6e3fd3ae4d1d73576011cb74b7`. `S4HANA_READINESS_2023` returned no rows but remains incomplete because its prerequisite checks are unavailable. See the [finished BASE-SEC-003 plan](plans/finished/base-sec-003.md), [finished BASE-SEC-001 plan](plans/finished/base-sec-001.md), and [BASE-SEC-002 research](research/2026-08-06-base-sec-002-native-sql.md).
20
+
All three P0 security fixes, the installation closure, and the WebGUI capability adapter are merged and preserved in this candidate. Exact BASE-BUG-002 source commit `36579848804e822f0863827479e221e3000231b5` has local SHA-256 `8ac6f8ddc965c08d53f87995403c8271d4d95542d73d567387a222389a65283e`; its explicitly activated A4H active/inactive source was equal at server-normalized SHA-256 `e32d7d3b8bebdb38457cd81f52e90a3b00dc0e830ac537b7690b70cee4544897`. After live evidence, A4H was restored and activated to exact `origin/master``5218476`, server SHA-256 `138d7cf38e68649abb7d714093afc809a27f7a26ca98b511d15dec4ef68d9e36`, with 57/57 master tests and a clean native-abapGit check. `S4HANA_READINESS_2023` returned no rows but remains incomplete because its prerequisite checks are unavailable.
21
21
22
22
## Ordered findings register
23
23
@@ -30,7 +30,7 @@ Priority meanings: **P0** blocks the requested test workflow or is an immediate
30
30
| BASE-SEC-002 | P0 | Native SQL used unsupported kernel call `C_DB_EXECUTE`. It was a high-impact arbitrary database-command path and produced a live compiler warning. | Default rejection, rejection despite the deprecated enable flag, preserved UPDATE/DELETE parsing, and a no-kernel-call repository contract. | Fixed and merged in PR #18; inherited by this candidate |
31
31
| BASE-SEC-003 | P0 | SELECT authorization extraction tokenized top-level `FROM`/`JOIN` text and could miss nested subqueries/CTEs or concealed data sources. A quote-aware scanner now applies the existing policy to every provable physical source and rejects unprovable dynamic/CTE/comment/path/hierarchy syntax, including attached path tokens. | Multi-table joins, nested subqueries, aliases, literal keywords, scanner-level comment rejection, `UNION`/`UNION ALL` sources, attached/detached paths, hierarchy/keyword lookalikes, and unauthorized inner-table cases. | Fixed candidate: exact integrated source is 57/57 green on A4H; parenthesized joins deliberately fail closed |
32
32
| BASE-BUG-001 | P1 |[Issue #6](https://github.com/marianfoo/ztoad/issues/6): a reported `SELECT DISTINCT ... COUNT ... MAX ... GROUP BY ... HAVING` query produces “The INTO/APPENDING clause must be at the end of the SELECT.” | Sanitized `DD03L` reproduction; check exact generated ordering around `HAVING`, `ORDER BY`, `UP TO`, and `INTO TABLE`. | Fixed and 17/17 green on A4H; live 7.50 pending |
33
-
| BASE-BUG-002 | P1 |[Issue #7](https://github.com/marianfoo/ztoad/issues/7): a reported `SUM( CASE ... END ) AS ...` over `EKBE` produces “No component exists with the name CASE.” The expression is split into false result components. | Sanitized aggregate with multi-line `CASE`, qualified fields, multiplication, alias, WHERE, and GROUP BY; assert one aggregate expression and the expected generated row type. |Open|
33
+
| BASE-BUG-002 | P1 |[Issue #7](https://github.com/marianfoo/ztoad/issues/7): a reported `SUM( CASE ... END ) AS ...` over `EKBE` produces “No component exists with the name CASE.” The expression is split into false result components. | Sanitized aggregate with multi-line `CASE`, qualified fields, multiplication, alias, WHERE, and GROUP BY; assert one aggregate expression and the expected generated row type. |Fixed in PR #21: 67/67 Unit, exact activation/state and sanitized CASE WebGUI/ST22 green; Cloud ATC unchanged, S/4 ATC incomplete, NPL prerequisite blocked|
34
34
| BASE-BUG-003 | P1 |[Issue #4](https://github.com/marianfoo/ztoad/issues/4): `SUBSTRING`/`CONCAT` produce “No component exists with the name SUBSTRING(”, exposing naïve select-list tokenization. | Nested function arguments, commas inside functions, aliases, literals containing spaces/commas, and function composition. | Open |
35
35
| BASE-BUG-004 | P1 | Keyword detection uses string searches and space splitting rather than quote/parenthesis-aware lexical tokens. Keywords in literals, comments, functions, or subqueries can move clause boundaries. | Quoted `FROM`, `WHERE`, `UNION`, `UP TO`; escaped quotes; comments; nested parentheses; multiline queries. | Open |
36
36
| BASE-BUG-005 | P1 |`UNION` splitting is whitespace-sensitive and does not model `UNION ALL`; branches are appended while assuming compatible result layouts. |`UNION`, `UNION ALL`, mismatched branch types/columns, per-branch limits, and keywords in literals/subqueries. | Open |
@@ -59,11 +59,12 @@ This diagnostic profile is intentionally not the merge gate yet. Run `npm run li
59
59
60
60
## Initial executable tests
61
61
62
-
The program now ends with six harmless, short ABAP Unit classes:
62
+
The program now ends with seven harmless, short ABAP Unit classes:
63
63
64
64
-`LTC_QUERY_PARSER`: 23 tests for the original SELECT contract plus authorized/unauthorized nested sources, two-level nesting, ordinary and parenthesized joins, literal/identifier keyword lookalikes, scanner-level comment rejection, later `UNION`/`UNION ALL` sources, and fail-closed dynamic/CTE/attached-path/detached-path/hierarchy sources.
65
65
-`LTC_QUERY_INPUT_VALIDATOR`: 12 tests for the supported SQL-fragment alphabet, literal state, decimals/minus, and source-boundary rejection.
66
-
-`LTC_QUERY_GENERATOR`: 5 tests for strict aggregate clause ordering, escaped-count and legacy-select compatibility, statement-injection rejection, and doubled-quote wrapping rejection.
66
+
-`LTCL_SELECT_EXPR_ANALYZER`: 7 tests for simple/searched CASE result references, qualified/unqualified columns, quoted `THEN` lookalikes, and fail-closed literal-only results.
67
+
-`LTC_QUERY_GENERATOR`: 8 tests for CASE aggregate generation/metadata/fail-closed typing, strict aggregate clause ordering, escaped-count and legacy-select compatibility, statement-injection rejection, and doubled-quote wrapping rejection.
67
68
-`LTC_LINE_SPLITTER`: 6 tests for short/exact/long safe lines, unsafe hard-cut and literal-space rejection, and column-one comment prevention.
-`LTCL_EDITOR_CONFIGURATION`: 4 tests selecting the supported editor and proving the restricted WebGUI capability profile plus the unchanged desktop profile.
# BASE-BUG-002 plan: generate aggregate CASE result types
2
+
3
+
## Goal
4
+
5
+
Make the `SUM( CASE ... END ) AS ...` form reported in GitHub issue #7 produce a valid generated subroutine pool while preserving existing aggregate behavior, authorization, injection controls, ABAP 7.50 compatibility, and ALV field metadata.
6
+
7
+
## Scope
8
+
9
+
- In scope: simple and searched CASE inside `SUM`, a direct qualified or unqualified DDIC column at the start of a result branch, alias metadata, focused parser/generator characterization, and exact A4H validation.
10
+
- Out of scope: arbitrary SQL-expression type inference, nested built-in-function support, generic select-list tokenization, executing the reported business query, provisioning ZTOAD on NPL, or resolving other open function/parser issues. A read-only SFLIGHT query using the sanitized regression grammar is in scope for the A4H smoke test.
11
+
12
+
## TDD and implementation sequence
13
+
14
+
1. Replay the test-only red candidate on the final integrated base: the added `GENERATES_CASE_SUM_EXPRESSION` test must be the only failure, and no SQL may execute. The earlier 55/56 result is historical evidence, not a substitute for this rerun.
15
+
2. Add a small pure select-expression analyzer with tests for simple CASE, searched CASE, qualified/unqualified results, quoted `THEN` lookalikes (including spaces and doubled quotes), and an unprovable literal result.
16
+
3. During existing aggregate-token collection, ask the analyzer for the first provable CASE result-column reference. Keep the original SELECT text unchanged.
17
+
4. Feed the proven reference through the existing table-alias/DDIC type path. For CASE aggregates, keep the SQL alias as display metadata instead of claiming that the computed value is the physical source field.
18
+
5. Extend the generator helper/test to assert a generated pool, strict/new syntax, table-result mode, and alias-preserving field metadata. Add a searched-CASE generator regression and retain all earlier aggregate/security tests.
19
+
6. Run configured abaplint, repository-contract checks, the full diagnostic lint inventory, and `git diff --check`. Review touched code against Clean ABAP without mass-refactoring the legacy report.
20
+
7. Deploy the exact source to A4H through ARC-1 with server preflight and explicit activation. Run active syntax, all ABAP Unit tests with coverage, object-state comparison, both recorded ATC variants, and a fresh WebGUI execution of the sanitized read-only CASE query plus ST22 delta.
21
+
8. Reconfirm the 7.50 limitation through ARC-1/ADT only. If ZTOAD remains absent on NPL, record the existing prerequisite blocker rather than claiming a live pass.
22
+
9. Review the implementation, security boundaries, test names, documentation placement, and development process; update the existing PR #21 only after PR #24 is merged and this branch is rebased onto the resulting `master`.
23
+
10. Wait for the first required green GitHub run, audit the process/CI, apply useful guidance changes in the same PR, move this plan to `docs/plans/finished/`, and wait for CI again.
24
+
25
+
## Review criteria
26
+
27
+
- The analyzer returns only a restricted DDIC column token and never rewrites executable SQL.
28
+
- A quoted keyword or non-column result cannot be mistaken for a type reference. Literal masking must preserve token boundaries, handle doubled SQL quotes, and fail closed on an unbalanced literal.
29
+
- Unsupported CASE result forms fail through the existing no-program contract.
30
+
- Generated-program syntax remains the final proof that the chosen result target is compatible with the complete CASE expression.
- The patch introduces no post-7.50 production syntax and does not weaken configured abaplint.
33
+
34
+
## Integration status
35
+
36
+
- The original PR #21 implementation was based on `612330c`, before the P0 security fixes, complete-object installation repair, and WebGUI capability adapter. Its old commit hashes, test totals, ATC totals, browser limitation, and live source hashes are stale.
37
+
- PR #24 was squash-merged as `5218476`; the integration series was rebased deliberately onto that exact tree. Configured abaplint, repository/install contracts, `npm ci`, `git diff --check`, and the diagnostic 2,169-finding/63-rule inventory are complete.
38
+
- Detailed review added two adversarial regressions. The inherited space-split analyzer would stop at `THEN` inside `'X THEN Y'` or `'X'' THEN Y'`; a quote-aware literal masker now removes literal contents before token analysis and handles doubled quotes without rewriting executable SQL.
39
+
- The rebased test-only candidate reproduced 57/58: only `GENERATES_CASE_SUM_EXPRESSION` failed. The first green candidate exposed an ABAP representation bug live: `&&` trimmed a one-character `TYPE c` blank, removed every token boundary, and caused eight CASE-dependent failures (59/67). Replacing those concatenations with `CONCATENATE ... RESPECTING BLANKS` made the existing tests exercise the intended representation.
40
+
- Exact source commit `36579848804e822f0863827479e221e3000231b5` has local SHA-256 `8ac6f8ddc965c08d53f87995403c8271d4d95542d73d567387a222389a65283e`. A4H activation and active syntax passed with zero errors/two existing POSIX warnings; all 67 Unit tests passed with 26.98% statement, 26.31% branch, and 20.45% procedure coverage. Active/inactive source matched at server SHA-256 `e32d7d3b8bebdb38457cd81f52e90a3b00dc0e830ac537b7690b70cee4544897`, with no inactive ZTOAD child part.
41
+
- Complete `ABAP_CLOUD_READINESS` remained 682 findings (474 P1/208 P2), so the patch added no released-API finding. `S4HANA_READINESS_2023` returned zero rows but remains prerequisite-incomplete. NPL 7.50 again returned no PROG/TABL object for ZTOAD, so the exact gate remains blocked rather than passed.
42
+
- A fresh marked WebGUI session executed the sanitized SFLIGHT CASE aggregate, returned eight grouped rows with `NET_PRICE` metadata, and exited cleanly with F3. Client-side comparison found no ST22 dump newer than the `2026-08-07T06:26:10Z` marker. A4H was then restored and explicitly activated to exact master `5218476`; 57/57 master tests, syntax/state, inactive-child inventory, and native-abapGit check are green at server SHA-256 `138d7cf38e68649abb7d714093afc809a27f7a26ca98b511d15dec4ef68d9e36`.
43
+
44
+
## Post-CI process audit
45
+
46
+
- The first refreshed PR run was green for repository Quality and required abaplint checks.
47
+
- Sequential integration, red replay, exact-source hashing, explicit activation, live Unit, ATC, marked WebGUI/ST22, master restoration, and native-abapGit verification all contributed independent evidence; none should be removed.
48
+
- Existing guidance already required the dump marker before browser smoke and editor-scoped locators after ALV. The final evidence repeated the smoke when the marker was initially missing and narrowed the F3 action to the TextEdit textarea when grid cells made an unscoped textbox locator ambiguous.
49
+
- The missing rule was ABAP fixed-length character blank preservation. `AGENTS.md` and `docs/test-strategy.md` now require a live whitespace-preservation regression for tokenizers/maskers rather than treating static lint as behavioral proof.
50
+
- No CI workflow change is needed: the repository gate remained fast and green, while the live SAP gate correctly caught behavior that the local syntax model cannot execute.
0 commit comments