@llm4ts/shell 0.5.0 → 0.6.1

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 (168) hide show
  1. package/dist/Cli.d.ts +2 -2
  2. package/dist/Cli.d.ts.map +1 -1
  3. package/dist/Cli.js +8 -4
  4. package/dist/Cli.js.map +1 -1
  5. package/dist/FlowCatalog.d.ts.map +1 -1
  6. package/dist/FlowCatalog.js +6 -2
  7. package/dist/FlowCatalog.js.map +1 -1
  8. package/flows/fixtures/scaffolds/kafka-streams-service/README.md +12 -0
  9. package/flows/fixtures/scaffolds/kafka-streams-service/pom.xml +49 -0
  10. package/flows/fixtures/scaffolds/kafka-streams-service/scripts/replay.sh +10 -0
  11. package/flows/fixtures/scaffolds/kafka-streams-service/src/main/java/com/meridian/scaffold/Application.java +29 -0
  12. package/flows/fixtures/scaffolds/kafka-streams-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +21 -0
  13. package/flows/fixtures/scaffolds/kafka-streams-service/src/test/resources/features/.gitkeep +0 -0
  14. package/flows/fixtures/scaffolds/nextjs-spa/README.md +6 -0
  15. package/flows/fixtures/scaffolds/nextjs-spa/app/layout.js +11 -0
  16. package/flows/fixtures/scaffolds/nextjs-spa/app/page.js +7 -0
  17. package/flows/fixtures/scaffolds/nextjs-spa/docs/specs/.gitkeep +0 -0
  18. package/flows/fixtures/scaffolds/nextjs-spa/features/.gitkeep +0 -0
  19. package/flows/fixtures/scaffolds/nextjs-spa/next.config.js +7 -0
  20. package/flows/fixtures/scaffolds/nextjs-spa/package.json +15 -0
  21. package/flows/fixtures/scaffolds/nextjs-spa/tests/smoke.test.js +6 -0
  22. package/flows/fixtures/scaffolds/spring-bff/README.md +9 -0
  23. package/flows/fixtures/scaffolds/spring-bff/frontend/app/layout.js +11 -0
  24. package/flows/fixtures/scaffolds/spring-bff/frontend/app/page.js +7 -0
  25. package/flows/fixtures/scaffolds/spring-bff/frontend/next.config.js +7 -0
  26. package/flows/fixtures/scaffolds/spring-bff/frontend/package.json +15 -0
  27. package/flows/fixtures/scaffolds/spring-bff/frontend/tests/smoke.test.js +6 -0
  28. package/flows/fixtures/scaffolds/spring-bff/pom.xml +57 -0
  29. package/flows/fixtures/scaffolds/spring-bff/scripts/test.sh +6 -0
  30. package/flows/fixtures/scaffolds/spring-bff/src/main/java/com/meridian/bff/Application.java +12 -0
  31. package/flows/fixtures/scaffolds/spring-bff/src/main/resources/application.yaml +12 -0
  32. package/flows/fixtures/scaffolds/spring-bff/src/test/java/com/meridian/bff/ApplicationTests.java +12 -0
  33. package/flows/fixtures/scaffolds/spring-bff/src/test/resources/features/.gitkeep +0 -0
  34. package/flows/fixtures/scaffolds/spring-boot-service/README.md +7 -0
  35. package/flows/fixtures/scaffolds/spring-boot-service/pom.xml +53 -0
  36. package/flows/fixtures/scaffolds/spring-boot-service/scripts/replay.sh +9 -0
  37. package/flows/fixtures/scaffolds/spring-boot-service/src/main/java/com/meridian/scaffold/Application.java +12 -0
  38. package/flows/fixtures/scaffolds/spring-boot-service/src/main/resources/application.yaml +12 -0
  39. package/flows/fixtures/scaffolds/spring-boot-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +12 -0
  40. package/flows/fixtures/scaffolds/spring-boot-service/src/test/resources/features/.gitkeep +0 -0
  41. package/flows/implement.js +29 -0
  42. package/flows/issue-pr.js +71 -0
  43. package/flows/judge-suite.js +48 -0
  44. package/flows/local.js +40 -0
  45. package/flows/modernize-bench.js +263 -0
  46. package/flows/modernize-extract.js +454 -0
  47. package/flows/modernize-implement.js +249 -0
  48. package/flows/modernize-review.js +237 -0
  49. package/flows/modernize-seed.js +189 -0
  50. package/flows/modernize-survey.js +0 -0
  51. package/flows/modernize-verify.js +435 -0
  52. package/flows/packs/ace-integration/lessons.md +6 -0
  53. package/flows/packs/ace-integration/pack.md +29 -0
  54. package/flows/packs/ace-integration/prompts/analysis.md +21 -0
  55. package/flows/packs/ace-integration/prompts/bdd.md +13 -0
  56. package/flows/packs/ace-integration/prompts/implement.md +17 -0
  57. package/flows/packs/ace-integration/prompts/plan.md +12 -0
  58. package/flows/packs/ace-integration/prompts/review.md +17 -0
  59. package/flows/packs/ace-integration/prompts/spec.md +29 -0
  60. package/flows/packs/ace-integration/reviewers/routing-fidelity.md +19 -0
  61. package/flows/packs/ace-integration/reviewers/traceability.md +13 -0
  62. package/flows/packs/ace-kafka/lessons.md +6 -0
  63. package/flows/packs/ace-kafka/pack.md +36 -0
  64. package/flows/packs/ace-kafka/prompts/analysis.md +21 -0
  65. package/flows/packs/ace-kafka/prompts/bdd.md +13 -0
  66. package/flows/packs/ace-kafka/prompts/implement.md +34 -0
  67. package/flows/packs/ace-kafka/prompts/plan.md +12 -0
  68. package/flows/packs/ace-kafka/prompts/review.md +17 -0
  69. package/flows/packs/ace-kafka/prompts/spec.md +31 -0
  70. package/flows/packs/ace-kafka/prompts/vectors.md +21 -0
  71. package/flows/packs/ace-kafka/reviewers/event-contracts.md +9 -0
  72. package/flows/packs/ace-kafka/reviewers/routing-fidelity.md +19 -0
  73. package/flows/packs/ace-kafka/reviewers/traceability.md +13 -0
  74. package/flows/packs/cobol-kafka/lessons.md +3 -0
  75. package/flows/packs/cobol-kafka/pack.md +51 -0
  76. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-001-record-to-event.md +7 -0
  77. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-002-job-step-topology.md +6 -0
  78. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-003-checkpoint-idempotence.md +7 -0
  79. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-004-eod-totals-window.md +7 -0
  80. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-005-reject-topic.md +6 -0
  81. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-006-keyed-state-store.md +7 -0
  82. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-007-outbox.md +7 -0
  83. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-008-partition-key.md +7 -0
  84. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-009-batch-window-cutoff.md +7 -0
  85. package/flows/packs/cobol-kafka/patterns/PAT-STREAM-010-replay-backfill.md +7 -0
  86. package/flows/packs/cobol-kafka/prompts/analysis.md +23 -0
  87. package/flows/packs/cobol-kafka/prompts/bdd.md +15 -0
  88. package/flows/packs/cobol-kafka/prompts/implement.md +47 -0
  89. package/flows/packs/cobol-kafka/prompts/plan.md +13 -0
  90. package/flows/packs/cobol-kafka/prompts/review.md +17 -0
  91. package/flows/packs/cobol-kafka/prompts/spec.md +28 -0
  92. package/flows/packs/cobol-kafka/prompts/vectors.md +21 -0
  93. package/flows/packs/cobol-kafka/reviewers/cobol-fidelity.md +16 -0
  94. package/flows/packs/cobol-kafka/reviewers/pattern-conformance.md +10 -0
  95. package/flows/packs/cobol-kafka/reviewers/traceability.md +13 -0
  96. package/flows/packs/cobol-springboot/lessons.md +3 -0
  97. package/flows/packs/cobol-springboot/pack.md +51 -0
  98. package/flows/packs/cobol-springboot/prompts/analysis.md +23 -0
  99. package/flows/packs/cobol-springboot/prompts/bdd.md +15 -0
  100. package/flows/packs/cobol-springboot/prompts/implement.md +31 -0
  101. package/flows/packs/cobol-springboot/prompts/plan.md +13 -0
  102. package/flows/packs/cobol-springboot/prompts/review.md +17 -0
  103. package/flows/packs/cobol-springboot/prompts/spec.md +28 -0
  104. package/flows/packs/cobol-springboot/prompts/vectors.md +22 -0
  105. package/flows/packs/cobol-springboot/reviewers/cobol-fidelity.md +16 -0
  106. package/flows/packs/cobol-springboot/reviewers/pattern-conformance.md +10 -0
  107. package/flows/packs/cobol-springboot/reviewers/traceability.md +13 -0
  108. package/flows/packs/jsp-bff-nextjs/lessons.md +6 -0
  109. package/flows/packs/jsp-bff-nextjs/pack.md +30 -0
  110. package/flows/packs/jsp-bff-nextjs/prompts/analysis.md +20 -0
  111. package/flows/packs/jsp-bff-nextjs/prompts/bdd.md +10 -0
  112. package/flows/packs/jsp-bff-nextjs/prompts/implement.md +17 -0
  113. package/flows/packs/jsp-bff-nextjs/prompts/plan.md +12 -0
  114. package/flows/packs/jsp-bff-nextjs/prompts/review.md +16 -0
  115. package/flows/packs/jsp-bff-nextjs/prompts/spec.md +27 -0
  116. package/flows/packs/jsp-bff-nextjs/reviewers/bff-boundary.md +18 -0
  117. package/flows/packs/jsp-bff-nextjs/reviewers/traceability.md +13 -0
  118. package/flows/packs/jsp-nextjs/lessons.md +6 -0
  119. package/flows/packs/jsp-nextjs/pack.md +29 -0
  120. package/flows/packs/jsp-nextjs/prompts/analysis.md +21 -0
  121. package/flows/packs/jsp-nextjs/prompts/bdd.md +12 -0
  122. package/flows/packs/jsp-nextjs/prompts/implement.md +17 -0
  123. package/flows/packs/jsp-nextjs/prompts/plan.md +14 -0
  124. package/flows/packs/jsp-nextjs/prompts/review.md +16 -0
  125. package/flows/packs/jsp-nextjs/prompts/spec.md +26 -0
  126. package/flows/packs/jsp-nextjs/reviewers/traceability.md +13 -0
  127. package/flows/packs/jsp-nextjs/reviewers/ux-fidelity.md +16 -0
  128. package/flows/patterns/PAT-COBOL-001-comp3-money.md +7 -0
  129. package/flows/patterns/PAT-COBOL-002-redefines.md +7 -0
  130. package/flows/patterns/PAT-COBOL-003-88-levels.md +7 -0
  131. package/flows/patterns/PAT-COBOL-004-perform-thru.md +7 -0
  132. package/flows/patterns/PAT-COBOL-005-file-status.md +6 -0
  133. package/flows/patterns/PAT-COBOL-006-sqlcode.md +7 -0
  134. package/flows/patterns/PAT-COBOL-007-validation-order.md +7 -0
  135. package/flows/patterns/PAT-COBOL-008-zoned-decimal.md +6 -0
  136. package/flows/patterns/PAT-COBOL-009-occurs-table.md +6 -0
  137. package/flows/patterns/PAT-COBOL-010-copybook-record.md +7 -0
  138. package/flows/patterns/PAT-COBOL-011-batch-counters.md +6 -0
  139. package/flows/patterns/PAT-COBOL-012-commit-frequency.md +7 -0
  140. package/flows/patterns/PAT-COBOL-013-abend.md +6 -0
  141. package/flows/patterns/PAT-COBOL-014-reject-file.md +6 -0
  142. package/flows/patterns/PAT-COBOL-015-accept-date.md +6 -0
  143. package/flows/patterns/PAT-COBOL-016-string-building.md +6 -0
  144. package/flows/patterns/PAT-COBOL-017-cursor-loop.md +6 -0
  145. package/flows/patterns/PAT-COBOL-018-yn-switches.md +6 -0
  146. package/flows/patterns/PAT-COBOL-019-shared-accumulators.md +6 -0
  147. package/flows/patterns/PAT-COBOL-020-tiered-fees.md +7 -0
  148. package/flows/patterns/PAT-COBOL-021-overdraft-floor.md +7 -0
  149. package/flows/patterns/PAT-COBOL-022-jcl-job-net.md +6 -0
  150. package/flows/patterns/PAT-COBOL-023-sort-step.md +6 -0
  151. package/flows/patterns/PAT-COBOL-024-fixed-width-records.md +6 -0
  152. package/flows/patterns/PAT-COBOL-025-audit-rows.md +6 -0
  153. package/flows/sdd.js +114 -0
  154. package/package.json +5 -4
  155. package/src/Cli.ts +13 -4
  156. package/src/FlowCatalog.ts +8 -2
  157. package/flows/implement.ts +0 -38
  158. package/flows/issue-pr.ts +0 -108
  159. package/flows/judge-suite.ts +0 -63
  160. package/flows/local.ts +0 -59
  161. package/flows/modernize-bench.ts +0 -362
  162. package/flows/modernize-extract.ts +0 -633
  163. package/flows/modernize-implement.ts +0 -333
  164. package/flows/modernize-review.ts +0 -343
  165. package/flows/modernize-seed.ts +0 -259
  166. package/flows/modernize-survey.ts +0 -0
  167. package/flows/modernize-verify.ts +0 -611
  168. package/flows/sdd.ts +0 -181
@@ -0,0 +1,21 @@
1
+ You are an ESB reverse-engineering analyst. Extract the COMPLETE observable
2
+ behaviour of the IBM ACE (IIB) message flows in this repository into a spec pack
3
+ precise enough that a team who never sees this source can rebuild them as Spring
4
+ Boot integration services.
5
+
6
+ How to read the estate:
7
+
8
+ - The .msgflow is the topology: nodes, their types (MQInput/MQOutput/Compute),
9
+ their labels, and the connections — including FAILURE terminals, which are error
10
+ handling and must be accounted for.
11
+ - Queue names on input/output nodes are the INTERFACES: who sends, who consumes,
12
+ and what each queue means downstream (a CICS request queue means the mainframe is
13
+ the system of record — say so).
14
+ - The ESQL carries the logic: validation rules with their reject codes, routing
15
+ predicates (read every CASE/IF — including account-prefix and currency
16
+ conditions), field-by-field message mappings, thresholds and the flags they set.
17
+ - Static routing tables (SHARED ROW, CASE ladders) are business policy — reproduce
18
+ them as tables in the spec, not prose.
19
+ - Reject envelopes are contract: code, reason, and what wraps the original payload.
20
+
21
+ Never invent behaviour. Ambiguity goes in "Open questions", not guesses.
@@ -0,0 +1,13 @@
1
+ Write Gherkin .feature files encoding the specs as executable message-in/outcome-out
2
+ scenarios — these become the acceptance tests of the new integration service.
3
+
4
+ - One feature per flow (or per coherent rule cluster within one).
5
+ - Scenario shape: Given a payment message with concrete field values, When the
6
+ service processes it, Then it is delivered to <destination> with <mapped fields /
7
+ flags> — or rejected with code <code>.
8
+ - Business vocabulary with the codes kept in the Then step (e.g. `Then the payment
9
+ is rejected with code V01 (unsupported currency)`).
10
+ - Concrete values everywhere: real amounts, currencies, account numbers, IBANs.
11
+ - Cover: every routing branch, EVERY reject code, every threshold boundary (a flag
12
+ at 10000.00 gets scenarios at 9999.99 and 10000.00 per its semantics), and the
13
+ field mappings of each destination message.
@@ -0,0 +1,17 @@
1
+ You implement one task at a time in a Spring Boot 3 / Java 21 integration service
2
+ that replaces an IBM ACE message flow. The committed specs under docs/specs/ and the
3
+ .feature files under src/test/resources/features/ are the contract; the acceptance
4
+ tests encode them — make them pass without weakening them.
5
+
6
+ Non-negotiables when porting ESQL semantics:
7
+
8
+ - Validation order and reject codes match the spec exactly — first-failure-wins,
9
+ codes verbatim.
10
+ - The routing table stays DATA (a declarative table/map the spec's table maps onto),
11
+ not a nest of ifs — reviewers must be able to diff it against the spec table.
12
+ - Amount thresholds keep their inclusive/exclusive semantics; money and amounts are
13
+ BigDecimal — never float/double.
14
+ - Destination messages are built by explicit field-by-field mapping per the spec —
15
+ no passthrough of unmapped fields.
16
+ - Destinations are ports (interfaces); tests capture what was sent where. Keep the
17
+ scaffold's structure and idioms.
@@ -0,0 +1,12 @@
1
+ Derive the implementation task list for the target Spring Boot integration service
2
+ from the spec pack. Constraints:
3
+
4
+ - The FIRST task must be exactly: encode the BDD scenarios as failing JUnit 5
5
+ acceptance tests against the seeded .feature files, driving the service's
6
+ processing entry point with in-memory inputs/outputs (no production code).
7
+ - Early tasks: the message model (typed payment/request/reject types mirroring the
8
+ spec's mappings — money as BigDecimal) and the ports for destinations (interfaces
9
+ the tests can capture; real MQ/HTTP adapters are out of scope for the slice).
10
+ - Then one task per rule cluster in spec order: validation chain with reject codes,
11
+ the routing table, destination mappings, thresholds/flags.
12
+ - Each task names the spec rules (R1, ...) and scenarios it covers.
@@ -0,0 +1,17 @@
1
+ You review a finished modernization increment: a Spring Boot integration service
2
+ built from specs reverse-engineered out of IBM ACE message flows. Judge against the
3
+ committed spec pack, not your own taste.
4
+
5
+ Look specifically for:
6
+
7
+ - Routing drift: predicates, currency lists, or account-prefix rules differing from
8
+ the spec's routing table in any value or in evaluation order.
9
+ - Reject-code drift: wrong codes, reordered validations, missing reject envelope
10
+ fields.
11
+ - Threshold/flag drift: boundaries moved, flags set at the wrong amounts.
12
+ - Mapping gaps: destination message fields missing, renamed, or silently passed
13
+ through unmapped.
14
+ - Weakened tests: scenarios deleted, captured-destination assertions loosened.
15
+
16
+ Classify each finding as FIX (violates the spec) or IMPROVEMENT (compliant but
17
+ worth a follow-up).
@@ -0,0 +1,29 @@
1
+ Write one behavioural spec per message flow as Markdown with exactly these sections:
2
+
3
+ # <Flow> — <one-line purpose>
4
+
5
+ ## Overview
6
+ What the flow does, its trigger (input queue), and where messages can end up.
7
+
8
+ ## Interfaces
9
+ Every queue (name, direction, who is on the other end) and the message format on
10
+ each.
11
+
12
+ ## Routing rules
13
+ Numbered (R1, R2, ...), in evaluation order: the predicate (exact values —
14
+ currencies, prefixes, thresholds with boundary semantics) and the destination.
15
+ Static routing tables reproduced AS TABLES.
16
+
17
+ ## Validation & rejects
18
+ Each validation in order, its reject code, and the reject envelope structure.
19
+
20
+ ## Message mappings
21
+ Field-by-field source→target mappings for each output (e.g. the CICS request built
22
+ from the inbound payment), naming the exact target fields.
23
+
24
+ ## Thresholds & flags
25
+ Every amount threshold and the flag/value it sets (priority, regulatory reporting),
26
+ with inclusive/exclusive semantics.
27
+
28
+ ## Open questions
29
+ Anything ambiguous in the source. Empty if none.
@@ -0,0 +1,19 @@
1
+ ---
2
+ files: .*\.java
3
+ ---
4
+ You are the routing-fidelity reviewer for an ACE-to-Spring-Boot port. Your single
5
+ concern: does the Java preserve the exact routing and rejection semantics the specs
6
+ carried over from the ESQL?
7
+
8
+ Flag as Critical:
9
+ - Routing predicates or their evaluation order differing from the spec's routing
10
+ table in any value (currencies, prefixes, thresholds).
11
+ - Reject codes differing in any character, or validations running out of spec
12
+ order.
13
+ - Amount thresholds with drifted boundaries (>= where the spec says >), or
14
+ float/double anywhere amounts flow.
15
+ - The routing table dissolved into scattered conditionals that can no longer be
16
+ diffed against the spec table.
17
+ - Destination message mappings missing fields the spec maps.
18
+
19
+ Ignore style, naming, and framework choices — other reviewers own those.
@@ -0,0 +1,13 @@
1
+ You are the traceability reviewer for a spec-driven modernization. Every behavioural
2
+ change must be traceable to the committed spec pack.
3
+
4
+ Flag as Critical:
5
+ - Production behaviour with no corresponding spec rule (R-number) or BDD scenario —
6
+ either the spec pack is incomplete or the change is out of scope.
7
+ - Changes to .feature files or acceptance tests that alter expected values or delete
8
+ scenarios (the contract must not be edited to fit the code).
9
+
10
+ Flag as Warning:
11
+ - Commits/tasks that do not state which spec rules they cover.
12
+
13
+ Ignore refactors with no behavioural surface.
@@ -0,0 +1,6 @@
1
+ - ESQL routing ladders are business policy tables in disguise: extract them into the
2
+ spec AS TABLES and keep them as declarative data in the target service — once they
3
+ dissolve into nested ifs, nobody can verify them against the source again.
4
+ - MQ failure terminals and reject queues are part of the contract: every failure
5
+ path in the msgflow needs a spec rule and a scenario, or it silently disappears in
6
+ the port.
@@ -0,0 +1,36 @@
1
+ # Pack: ace-kafka
2
+
3
+ source: ace
4
+ scaffold: ../../fixtures/scaffolds/kafka-streams-service
5
+ sources: .*\.(msgflow|esql)
6
+ programs: .*\.(msgflow|esql)
7
+ specs-dir: docs/specs
8
+ features-dir: src/test/resources/features
9
+ replay: scripts/replay.sh
10
+
11
+ ## Gates
12
+
13
+ - build: mvn -q -B test-compile
14
+ - test: mvn -q -B test
15
+ - verify: mvn -q -B verify
16
+
17
+ ## Judge
18
+
19
+ - completeness (0..2): Every node in the message flow, every routing rule, validation, reject code, interface, message mapping, and threshold/flag in the msgflow/ESQL source is captured in the specs and BDD scenarios — re-expressed as event contracts (topics, keys, event payloads); the traceability matrix accounts for every flow node and ESQL module. Score 2 only if nothing material is missing.
20
+ - faithfulness (0..2): Every statement is grounded in the source: reject codes, routing predicates, currency lists, thresholds, flag values, and field mappings match the ESQL exactly, and nothing is invented — renaming a queue to a topic is mapping, changing its meaning is invention. Score 2 only if fully source-grounded.
21
+ - testability (0..2): Scenarios are concrete event-in/events-out examples — specific payloads, amounts, currencies, correlation keys, and the exact output topic or reject code expected; no vague language. Score 2 only if every scenario is directly encodable as a TopologyTestDriver test.
22
+
23
+ ## Equivalence
24
+
25
+ - ordering: per-key
26
+ - ignore: TIMESTAMP, TS, PROCESSED_AT
27
+
28
+ ## Coverage: flow-node
29
+
30
+ files: .*\.msgflow
31
+ unit: <translation xmi:type="utility:ConstantString" string="([^"]+)"/>
32
+
33
+ ## Coverage: esql-module
34
+
35
+ files: .*\.esql
36
+ unit: ^CREATE (?:COMPUTE|FILTER|DATABASE) MODULE (\S+)
@@ -0,0 +1,21 @@
1
+ You are an ESB reverse-engineering analyst. Extract the COMPLETE observable
2
+ behaviour of the IBM ACE (IIB) message flows in this repository into a spec pack
3
+ precise enough that a team who never sees this source can rebuild them as Spring
4
+ Boot integration services.
5
+
6
+ How to read the estate:
7
+
8
+ - The .msgflow is the topology: nodes, their types (MQInput/MQOutput/Compute),
9
+ their labels, and the connections — including FAILURE terminals, which are error
10
+ handling and must be accounted for.
11
+ - Queue names on input/output nodes are the INTERFACES: who sends, who consumes,
12
+ and what each queue means downstream (a CICS request queue means the mainframe is
13
+ the system of record — say so).
14
+ - The ESQL carries the logic: validation rules with their reject codes, routing
15
+ predicates (read every CASE/IF — including account-prefix and currency
16
+ conditions), field-by-field message mappings, thresholds and the flags they set.
17
+ - Static routing tables (SHARED ROW, CASE ladders) are business policy — reproduce
18
+ them as tables in the spec, not prose.
19
+ - Reject envelopes are contract: code, reason, and what wraps the original payload.
20
+
21
+ Never invent behaviour. Ambiguity goes in "Open questions", not guesses.
@@ -0,0 +1,13 @@
1
+ Write Gherkin .feature files encoding the specs as executable message-in/outcome-out
2
+ scenarios — these become the acceptance tests of the new integration service.
3
+
4
+ - One feature per flow (or per coherent rule cluster within one).
5
+ - Scenario shape: Given a payment event with concrete field values and key, When
6
+ the topology processes it, Then an event is emitted on <output topic> with
7
+ <mapped fields / flags> — or a reject event with code <code>.
8
+ - Business vocabulary with the codes kept in the Then step (e.g. `Then the payment
9
+ is rejected with code V01 (unsupported currency)`).
10
+ - Concrete values everywhere: real amounts, currencies, account numbers, IBANs.
11
+ - Cover: every routing branch, EVERY reject code, every threshold boundary (a flag
12
+ at 10000.00 gets scenarios at 9999.99 and 10000.00 per its semantics), and the
13
+ field mappings of each destination message.
@@ -0,0 +1,34 @@
1
+ You implement one task at a time in a Kafka Streams / Java 21 service that replaces
2
+ an IBM ACE message flow with an event-streaming topology. The committed specs under
3
+ docs/specs/ and the .feature files under src/test/resources/features/ are the
4
+ contract; the acceptance tests encode them — make them pass without weakening them.
5
+
6
+ Non-negotiables when porting ESQL semantics to a topology:
7
+
8
+ - Queues become topics per the spec's interface mapping: one input topic for the
9
+ flow's trigger, one output topic per destination (CICS bridge, SEPA gateway,
10
+ rejects). The event KEY is the correlation identity the spec names (the payment's
11
+ debtor account unless the spec says otherwise) — per-key ordering is contract.
12
+ - Validation order and reject codes match the spec exactly — first-failure-wins,
13
+ codes verbatim; a rejected payment emits ONE reject event and nothing else.
14
+ - The routing table stays DATA (a declarative map the spec's table maps onto), not
15
+ a nest of ifs — reviewers must be able to diff it against the spec table.
16
+ - Amount thresholds keep their inclusive/exclusive semantics; money is BigDecimal —
17
+ never float/double, and never a double-backed Serde.
18
+ - Destination events are built by explicit field-by-field mapping per the spec — no
19
+ passthrough of unmapped fields.
20
+ - The topology is built by a pure `Topology buildTopology()` factory the tests and
21
+ the replay harness drive with TopologyTestDriver — no broker in the test path.
22
+ Keep the scaffold's structure and idioms.
23
+
24
+ Replay harness (equivalence verification — part of the contract, same rules as tests):
25
+
26
+ - The scaffold ships scripts/replay.sh; it runs com.meridian.replay.ReplayHarness,
27
+ which YOU implement: read one equivalence vector as JSON on stdin, print a JSON
28
+ array of observations on stdout — nothing else on stdout, ever.
29
+ - The vector's "inputs" is a flat string map: the inbound event's fields using the
30
+ specs' names, plus "topic:" for the input topic and "key:" for the event key.
31
+ Feed exactly one input event through TopologyTestDriver and emit every output
32
+ event, in per-key order, as:
33
+ {"type":"message","topic":"<output topic>","key":"<event key>","fields":{...}}
34
+ - Amounts as plain scale-2 decimal strings, codes verbatim from the specs.
@@ -0,0 +1,12 @@
1
+ Derive the implementation task list for the target Spring Boot integration service
2
+ from the spec pack. Constraints:
3
+
4
+ - The FIRST task must be exactly: encode the BDD scenarios as failing JUnit 5
5
+ acceptance tests against the seeded .feature files, driving the service's
6
+ processing entry point with in-memory inputs/outputs (no production code).
7
+ - Early tasks: the message model (typed payment/request/reject types mirroring the
8
+ spec's mappings — money as BigDecimal) and the ports for destinations (interfaces
9
+ the tests can capture; real MQ/HTTP adapters are out of scope for the slice).
10
+ - Then one task per rule cluster in spec order: validation chain with reject codes,
11
+ the routing table, destination mappings, thresholds/flags.
12
+ - Each task names the spec rules (R1, ...) and scenarios it covers.
@@ -0,0 +1,17 @@
1
+ You review a finished modernization increment: a Spring Boot integration service
2
+ built from specs reverse-engineered out of IBM ACE message flows. Judge against the
3
+ committed spec pack, not your own taste.
4
+
5
+ Look specifically for:
6
+
7
+ - Routing drift: predicates, currency lists, or account-prefix rules differing from
8
+ the spec's routing table in any value or in evaluation order.
9
+ - Reject-code drift: wrong codes, reordered validations, missing reject envelope
10
+ fields.
11
+ - Threshold/flag drift: boundaries moved, flags set at the wrong amounts.
12
+ - Mapping gaps: destination message fields missing, renamed, or silently passed
13
+ through unmapped.
14
+ - Weakened tests: scenarios deleted, captured-destination assertions loosened.
15
+
16
+ Classify each finding as FIX (violates the spec) or IMPROVEMENT (compliant but
17
+ worth a follow-up).
@@ -0,0 +1,31 @@
1
+ Write one behavioural spec per message flow as Markdown with exactly these sections:
2
+
3
+ # <Flow> — <one-line purpose>
4
+
5
+ ## Overview
6
+ What the flow does, its trigger (input queue), and where messages can end up.
7
+
8
+ ## Interfaces
9
+ Every queue (name, direction, who is on the other end) and the message format on
10
+ each — PLUS the target event contract: a queue→topic mapping table (queue, topic
11
+ name, event key = the correlation identity, payload fields). Per-key ordering on
12
+ the key you name becomes part of the contract.
13
+
14
+ ## Routing rules
15
+ Numbered (R1, R2, ...), in evaluation order: the predicate (exact values —
16
+ currencies, prefixes, thresholds with boundary semantics) and the destination.
17
+ Static routing tables reproduced AS TABLES.
18
+
19
+ ## Validation & rejects
20
+ Each validation in order, its reject code, and the reject envelope structure.
21
+
22
+ ## Message mappings
23
+ Field-by-field source→target mappings for each output (e.g. the CICS request built
24
+ from the inbound payment), naming the exact target fields.
25
+
26
+ ## Thresholds & flags
27
+ Every amount threshold and the flag/value it sets (priority, regulatory reporting),
28
+ with inclusive/exclusive semantics.
29
+
30
+ ## Open questions
31
+ Anything ambiguous in the source. Empty if none.
@@ -0,0 +1,21 @@
1
+ You generate equivalence vectors for a message flow being replaced by a Kafka
2
+ Streams topology. A vector is one execution: one inbound event and the exact
3
+ output events the spec promises. Both sides of the wall anchor on the SPEC's
4
+ names — the replay harness is built from the same specs, so never invent field
5
+ or topic names.
6
+
7
+ Conventions for this pack (ACE msgflow → Kafka Streams):
8
+
9
+ - inputs: the inbound event's payload fields using the specs' names verbatim
10
+ (e.g. "DebtorAccount": "1000012345", "Amount": "250.00", "Currency": "EUR"),
11
+ plus "topic:" (the input topic from the spec's interface table) and "key:"
12
+ (the correlation key value for this event).
13
+ - observations: kind "message" only — one per output event, in per-key order:
14
+ topic is the output topic from the spec's interface table, key is the event
15
+ key the spec assigns, fields carry the mapped payload exactly as the spec's
16
+ message-mapping section states.
17
+ - A rejected payment produces exactly ONE reject event and nothing else; reject
18
+ code and reason verbatim.
19
+ - Cover every routing branch, EVERY reject code, and every threshold boundary
20
+ (a flag at 10000.00 gets vectors at 9999.99 and 10000.00 per its semantics).
21
+ - Amounts as plain scale-2 decimal strings.
@@ -0,0 +1,9 @@
1
+ ---
2
+ files: .*\.java
3
+ ---
4
+ Check the event contracts against the specs: topics and event keys match the
5
+ spec's interface table exactly; per-key ordering is preserved (no repartition
6
+ that loses the correlation key before an order-sensitive step); a rejected
7
+ payment emits exactly one reject event and nothing else; amounts are BigDecimal
8
+ end-to-end (no double-backed Serde); destination events carry only the fields
9
+ the spec's mapping names — no passthrough of unmapped fields.
@@ -0,0 +1,19 @@
1
+ ---
2
+ files: .*\.java
3
+ ---
4
+ You are the routing-fidelity reviewer for an ACE-to-Spring-Boot port. Your single
5
+ concern: does the Java preserve the exact routing and rejection semantics the specs
6
+ carried over from the ESQL?
7
+
8
+ Flag as Critical:
9
+ - Routing predicates or their evaluation order differing from the spec's routing
10
+ table in any value (currencies, prefixes, thresholds).
11
+ - Reject codes differing in any character, or validations running out of spec
12
+ order.
13
+ - Amount thresholds with drifted boundaries (>= where the spec says >), or
14
+ float/double anywhere amounts flow.
15
+ - The routing table dissolved into scattered conditionals that can no longer be
16
+ diffed against the spec table.
17
+ - Destination message mappings missing fields the spec maps.
18
+
19
+ Ignore style, naming, and framework choices — other reviewers own those.
@@ -0,0 +1,13 @@
1
+ You are the traceability reviewer for a spec-driven modernization. Every behavioural
2
+ change must be traceable to the committed spec pack.
3
+
4
+ Flag as Critical:
5
+ - Production behaviour with no corresponding spec rule (R-number) or BDD scenario —
6
+ either the spec pack is incomplete or the change is out of scope.
7
+ - Changes to .feature files or acceptance tests that alter expected values or delete
8
+ scenarios (the contract must not be edited to fit the code).
9
+
10
+ Flag as Warning:
11
+ - Commits/tasks that do not state which spec rules they cover.
12
+
13
+ Ignore refactors with no behavioural surface.
@@ -0,0 +1,3 @@
1
+ - COBOL COMP-3 (packed decimal) money fields are exact decimals: port them as
2
+ BigDecimal with explicit scale 2 and RoundingMode.HALF_UP (COBOL COMPUTE ROUNDED);
3
+ never float/double.
@@ -0,0 +1,51 @@
1
+ # Pack: cobol-kafka
2
+
3
+ source: cobol
4
+ scaffold: ../../fixtures/scaffolds/kafka-streams-service
5
+ sources: .*\.(cbl|CBL|cpy|CPY|jcl|JCL)
6
+ programs: .*\.(cbl|CBL|jcl|JCL)
7
+ specs-dir: docs/specs
8
+ features-dir: src/test/resources/features
9
+ replay: scripts/replay.sh
10
+
11
+ ## Gates
12
+
13
+ - build: mvn -q -B test-compile
14
+ - test: mvn -q -B test
15
+ - verify: mvn -q -B verify
16
+
17
+ ## Judge
18
+
19
+ - completeness (0..2): Every business rule, validation, calculation (fees, limits, interest tiers), error path, and side effect (ledger rows, audit rows, reject records) present in the COBOL/JCL source is captured in the specs and BDD scenarios, INCLUDING the batch-to-streaming mapping: every input record, output, and accumulator has an event-contract counterpart (topic, key, payload). Score 2 only if nothing material is missing.
20
+ - faithfulness (0..2): Every statement in the specs is grounded in the source: amounts, thresholds, status codes, reason codes, rounding, and the ORDER of validations match the code exactly, and nothing is invented — re-expressing a file as a topic is mapping, changing its meaning is invention. Score 2 only if fully source-grounded.
21
+ - testability (0..2): Acceptance criteria and scenarios are concrete event-in/events-out examples — specific amounts, account states, correlation keys, and expected output events or reject codes; no vague language. Score 2 only if every scenario is directly encodable as a TopologyTestDriver test.
22
+
23
+ ## Equivalence
24
+
25
+ - ordering: per-key
26
+ - ignore: TIMESTAMP, TS, PROCESSED_AT
27
+
28
+ ## Coverage: cobol-paragraph
29
+
30
+ files: .*\.(cbl|CBL)
31
+ unit: ^ {7}(\d{4}-[A-Z0-9-]+)\.
32
+
33
+ ## Coverage: jcl-step
34
+
35
+ files: .*\.(jcl|JCL)
36
+ unit: ^//([A-Z0-9]+) +EXEC
37
+
38
+ ## Survey: calls
39
+
40
+ files: .*\.(cbl|CBL)
41
+ unit: CALL '([A-Z0-9]+)'
42
+
43
+ ## Survey: copies
44
+
45
+ files: .*\.(cbl|CBL)
46
+ unit: ^ {6}[ ]*COPY +([A-Z0-9]+)
47
+
48
+ ## Survey: exec-pgm
49
+
50
+ files: .*\.(jcl|JCL)
51
+ unit: EXEC +PGM=([A-Z0-9]+)
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: READ |ORGANIZATION IS SEQUENTIAL
3
+ ---
4
+ Each input file record becomes one keyed event: the record layout maps to the event
5
+ payload, and the correlation key is the entity the batch processes per record (the
6
+ source account for transfers). The event schema lives in the spec&apos;s interface
7
+ table — never invent fields the record does not carry.
@@ -0,0 +1,6 @@
1
+ ---
2
+ match: PERFORM [0-9]|^//[A-Z0-9]+ +EXEC
3
+ ---
4
+ The batch main loop and JCL steps map to topology stages: validate → enrich → route
5
+ → post, one named processor per paragraph cluster. Keep stage boundaries where the
6
+ batch had paragraph boundaries so traceability survives the paradigm shift.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: COMMIT|RESTART
3
+ ---
4
+ Commit-every-N restart logic becomes idempotence: enable exactly-once processing
5
+ (or idempotent writes keyed by the event id) instead of chunked commits. A replayed
6
+ event must produce the same ledger rows, not duplicates — that is the equivalence
7
+ property the batch checkpoint was protecting.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: FINALIZE|FEE-TOTAL|DISPLAY .*TOTAL
3
+ ---
4
+ End-of-run totals become windowed aggregations: the batch summary (posted count,
5
+ fees collected) maps to a daily tumbling window keyed by run date, emitted on window
6
+ close. The cutoff that was implicit in the batch schedule becomes an explicit
7
+ window boundary in the spec.
@@ -0,0 +1,6 @@
1
+ ---
2
+ match: REJECT
3
+ ---
4
+ The reject file becomes a reject topic: same codes, same reasons, one reject event
5
+ per failed input event, keyed like the input. Downstream consumers replace the
6
+ morning reject-report job; a rejected event NEVER also produces output events.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: ACCUM|WORKING-STORAGE
3
+ ---
4
+ Per-account working-storage accumulators (daily transfer totals) become keyed state
5
+ stores: the accumulator is state keyed by the event key, updated transactionally
6
+ with the emit. Reset jobs (EOD accumulator reset) become punctuator/window
7
+ lifecycle, named in the spec.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: INSERT INTO|WRITE
3
+ ---
4
+ A batch that both writes DB rows and emits records must not dual-write from a
5
+ stream: either the topology emits events and a downstream projector owns the DB, or
6
+ writes go through a transactional outbox. Pick per the spec&apos;s system-of-record
7
+ statement — the mainframe ledger owner decides.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: ACCT
3
+ ---
4
+ Rules scoped per account (limits, balances, validation order) require the account
5
+ id as the partition key: per-key ordering is the only ordering Kafka guarantees, and
6
+ it is exactly the ordering the batch had after its sort step. Repartitioning away
7
+ from the account key mid-topology breaks the contract.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: DAILY|NIGHTLY|XFERDLY
3
+ ---
4
+ The nightly batch window becomes continuous processing with explicit cutoffs:
5
+ "posted today" turns into event-time windows with a documented business cutoff, and
6
+ same-day semantics (daily limits) key on the event-time date. State the timezone —
7
+ the mainframe had one implicitly.
@@ -0,0 +1,7 @@
1
+ ---
2
+ match: RERUN|RESUBMIT
3
+ ---
4
+ Batch rerun-from-file becomes topic replay: reprocessing is resetting offsets over
5
+ an immutable input topic, which is only safe because of idempotent processing
6
+ (PAT-STREAM-003). Document the replay procedure in the runbook the way rerun JCL
7
+ was documented.
@@ -0,0 +1,23 @@
1
+ You are a mainframe reverse-engineering analyst. Your job is to extract the COMPLETE
2
+ observable behaviour of the COBOL/JCL estate in this repository into a spec pack —
3
+ precise enough that a team who never sees this source can reimplement it.
4
+
5
+ How to read the estate:
6
+
7
+ - Start from the JCL: each job step names a program and its files — that is the
8
+ orchestration (order, condition codes, restart behaviour).
9
+ - For each COBOL program, follow the PERFORM graph from the first paragraph; every
10
+ paragraph exists for a reason and must be accounted for.
11
+ - Copybooks are the record layouts: field names, PIC clauses (COMP-3 = packed decimal
12
+ money), 88-levels (status values). REPLACING tells you the same layout is used for
13
+ more than one role.
14
+ - EXEC SQL blocks are the data contract: tables, columns, and how SQLCODE 0 / +100 /
15
+ negative are each handled.
16
+ - Reject/error paths ARE business rules: every reason code, its trigger condition, and
17
+ the exact order validations run in. First-failure-wins ordering must be preserved.
18
+ - Constants are business policy: thresholds, fees, rates, caps, floors. Record the
19
+ exact values and their rounding behaviour (COMPUTE ROUNDED = half-up).
20
+
21
+ Never invent behaviour. If the source does not do it, the spec must not say it.
22
+ If something is genuinely ambiguous, record it in an "Open questions" section rather
23
+ than guessing.
@@ -0,0 +1,15 @@
1
+ Write Gherkin .feature files encoding the specs' business rules as executable
2
+ scenarios — these become the acceptance tests of the new Spring Boot service.
3
+
4
+ - One feature file per COBOL program (or per coherent rule cluster within one).
5
+ - Business vocabulary, not mainframe vocabulary: "the transfer is rejected because the
6
+ source account is frozen", not "reject code 11 is written to REJFILE" — but keep the
7
+ reason code in the Then step so traceability holds (e.g. `Then the transfer is
8
+ rejected with reason code 11 (source account frozen)`).
9
+ - Every scenario uses concrete values: real amounts, statuses, and expected balances
10
+ after posting — never "a large amount" or "the correct fee".
11
+ - Cover: the happy path, EVERY reject reason, every fee tier and its boundary values
12
+ (e.g. exactly 1000.00), limit boundaries (exactly at the daily limit), overdraft
13
+ floor boundaries, and rounding-sensitive amounts.
14
+ - Boundary discipline: when a rule says "< 1000.00", write scenarios at 999.99 and
15
+ 1000.00.
@@ -0,0 +1,47 @@
1
+ You implement one task at a time in a Kafka Streams / Java 21 service that replaces
2
+ a COBOL batch program with an event-streaming topology — this is the batch-window
3
+ kill: continuous processing with the batch's exact business rules. The committed
4
+ specs under docs/specs/ and the .feature files under src/test/resources/features/
5
+ are the contract; the acceptance tests encode them — make them pass without
6
+ weakening them.
7
+
8
+ The batch→streaming mapping (the paradigm shift, applied mechanically):
9
+
10
+ - Each input file record becomes one keyed event; the correlation key is the entity
11
+ the batch processed per record (the source account for transfers). Per-key
12
+ ordering replaces the batch's sort step — never repartition away from that key
13
+ mid-topology.
14
+ - The batch main loop's paragraph clusters become named topology stages (validate →
15
+ route → post); posted side effects (ledger rows, audit rows) become output events
16
+ per the spec's event-contract table; the reject file becomes a reject topic with
17
+ the same codes.
18
+ - Per-account accumulators (daily limits) become keyed state stores updated
19
+ transactionally with the emit; commit-interval restart logic becomes idempotent,
20
+ exactly-once processing.
21
+ - The pattern cards tagged in the task's specs (PAT-STREAM-*, PAT-COBOL-*) are the
22
+ translation playbook — follow them, and say in the commit which cards applied.
23
+
24
+ Non-negotiables carried over from the COBOL:
25
+
26
+ - Money is BigDecimal scale 2; COMPUTE ROUNDED is RoundingMode.HALF_UP; never
27
+ float/double, never a double-backed Serde.
28
+ - Preserve the specs' validation ORDER exactly (first-failure-wins) and reason codes
29
+ verbatim; a rejected event emits ONE reject event and no other output.
30
+ - Boundary conditions match the spec: "< 1000.00" means 999.99 qualifies and 1000.00
31
+ does not.
32
+ - The topology is built by a pure `Topology buildTopology()` factory driven by
33
+ TopologyTestDriver in tests and in the replay harness — no broker in the test
34
+ path. Keep the scaffold's structure and idioms.
35
+
36
+ Replay harness (equivalence verification — part of the contract, same rules as tests):
37
+
38
+ - The scaffold ships scripts/replay.sh; it runs com.meridian.replay.ReplayHarness,
39
+ which YOU implement: read one equivalence vector as JSON on stdin, print a JSON
40
+ array of observations on stdout — nothing else on stdout, ever.
41
+ - The vector's "inputs" is a flat string map keyed by the specs' COBOL field names
42
+ ("XFER-AMOUNT", "FROM-ACCT", …) plus "state:"-prefixed pre-existing state
43
+ ("state:ACCOUNT:<id>": account row, "state:RUN-DATE"). Arrange the state (seeded
44
+ state stores), feed exactly one input event through TopologyTestDriver, and emit
45
+ every output event in per-key order as:
46
+ {"type":"message","topic":"<output topic>","key":"<event key>","fields":{...}}
47
+ - Amounts as plain scale-2 decimal strings, status and reason codes verbatim.